mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-25 04:57:47 +01:00
Merge pull request #3465 from Yoshax/radiation
Ports radiation rework and stuff from Bay
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
var/const/enterBelt = 30
|
||||
var/const/radIntervall = 5 // Enough time between enter/leave belt for 10 hits, as per original implementation
|
||||
var/const/leaveBelt = 80
|
||||
var/const/revokeAccess = 135
|
||||
var/const/revokeAccess = 165
|
||||
startWhen = 2
|
||||
announceWhen = 1
|
||||
endWhen = revokeAccess
|
||||
@@ -27,23 +27,21 @@
|
||||
radiate()
|
||||
|
||||
else if(activeFor == leaveBelt)
|
||||
command_announcement.Announce("The station has passed the radiation belt. Please report to medbay if you experience any unusual symptoms. Maintenance will lose all access again shortly.", "Anomaly Alert")
|
||||
|
||||
command_announcement.Announce("The station has passed the radiation belt. Please allow for up to one minute while radiation levels dissipate, and report to medbay if you experience any unusual symptoms. Maintenance will lose all access again shortly.", "Anomaly Alert")
|
||||
/datum/event/radiation_storm/proc/radiate()
|
||||
var/radiation_level = rand(15, 35)
|
||||
for(var/z in using_map.station_levels)
|
||||
radiation_repository.z_radiate(locate(1, 1, z), radiation_level, 1)
|
||||
|
||||
for(var/mob/living/carbon/C in living_mob_list)
|
||||
var/area/A = get_area(C)
|
||||
if(!A)
|
||||
continue
|
||||
if(!(A.z in using_map.station_levels))
|
||||
continue
|
||||
if(A.flags & RAD_SHIELDED)
|
||||
continue
|
||||
|
||||
if(istype(C,/mob/living/carbon/human))
|
||||
var/mob/living/carbon/human/H = C
|
||||
H.apply_effect((rand(15,35)),IRRADIATE,0)
|
||||
if(prob(5))
|
||||
H.apply_effect((rand(40,70)),IRRADIATE,0)
|
||||
if (prob(75))
|
||||
randmutb(H) // Applies bad mutation
|
||||
domutcheck(H,null,MUTCHK_FORCED)
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
radiate()
|
||||
|
||||
/datum/event/solar_storm/proc/radiate()
|
||||
// Note: Too complicated to be worth trying to use the radiation system for this. Its only in space anyway, so we make an exception in this case.
|
||||
for(var/mob/living/L in living_mob_list)
|
||||
var/turf/T = get_turf(L)
|
||||
if(!T)
|
||||
@@ -36,8 +37,7 @@
|
||||
continue
|
||||
|
||||
//Todo: Apply some burn damage from the heat of the sun. Until then, enjoy some moderate radiation.
|
||||
L.apply_effect((rand(15,30)),IRRADIATE,blocked = L.getarmor(null, "rad"))
|
||||
|
||||
L.rad_act(rand(15, 30))
|
||||
|
||||
/datum/event/solar_storm/end()
|
||||
command_announcement.Announce("The solar storm has passed the station. It is now safe to resume EVA activities. Please report to medbay if you experience any unusual symptoms. ", "Anomaly Alert")
|
||||
|
||||
@@ -482,7 +482,7 @@ var/list/mining_overlay_cache = list()
|
||||
M.flash_eyes()
|
||||
if(prob(50))
|
||||
M.Stun(5)
|
||||
M.apply_effect(25, IRRADIATE)
|
||||
radiation_repository.flat_radiate(src, 25, 200)
|
||||
if(prob(25))
|
||||
excavate_find(prob(5), finds[1])
|
||||
else if(rand(1,500) == 1)
|
||||
|
||||
@@ -94,7 +94,7 @@ emp_act
|
||||
var/obj/item/organ/external/organ = organs_by_name[organ_name]
|
||||
if(organ)
|
||||
var/weight = organ_rel_size[organ_name]
|
||||
armorval += getarmor_organ(organ, type) * weight
|
||||
armorval += (getarmor_organ(organ, type) * weight)
|
||||
total += weight
|
||||
return (armorval/max(total, 1))
|
||||
|
||||
|
||||
@@ -352,6 +352,7 @@ var/global/list/robot_modules = list(
|
||||
src.modules += new /obj/item/device/pipe_painter(src)
|
||||
src.modules += new /obj/item/device/floor_painter(src)
|
||||
src.modules += new /obj/item/weapon/gripper/no_use/loader(src)
|
||||
src.modules += new /obj/item/device/geiger(src)
|
||||
|
||||
var/datum/matter_synth/metal = new /datum/matter_synth/metal()
|
||||
var/datum/matter_synth/plasteel = new /datum/matter_synth/plasteel()
|
||||
@@ -396,6 +397,7 @@ var/global/list/robot_modules = list(
|
||||
src.modules += new /obj/item/device/pipe_painter(src)
|
||||
src.modules += new /obj/item/device/floor_painter(src)
|
||||
src.emag = new /obj/item/weapon/melee/baton/robot/arm(src)
|
||||
src.modules += new /obj/item/device/geiger(src)
|
||||
|
||||
var/datum/matter_synth/metal = new /datum/matter_synth/metal(40000)
|
||||
var/datum/matter_synth/glass = new /datum/matter_synth/glass(40000)
|
||||
|
||||
@@ -396,17 +396,13 @@
|
||||
/obj/machinery/power/port_gen/pacman/super/UseFuel()
|
||||
//produces a tiny amount of radiation when in use
|
||||
if (prob(2*power_output))
|
||||
for (var/mob/living/L in range(src, 5))
|
||||
L.apply_effect(1, IRRADIATE) //should amount to ~5 rads per minute at max safe power
|
||||
radiation_repository.radiate(src, 4)
|
||||
..()
|
||||
|
||||
/obj/machinery/power/port_gen/pacman/super/explode()
|
||||
//a nice burst of radiation
|
||||
var/rads = 50 + (sheets + sheet_left)*1.5
|
||||
for (var/mob/living/L in range(src, 10))
|
||||
//should really fall with the square of the distance, but that makes the rads value drop too fast
|
||||
//I dunno, maybe physics works different when you live in 2D -- SM radiation also works like this, apparently
|
||||
L.apply_effect(max(20, round(rads/get_dist(L,src))), IRRADIATE)
|
||||
radiation_repository.radiate(src, (max(20, rads)))
|
||||
|
||||
explosion(src.loc, 3, 3, 5, 3)
|
||||
qdel(src)
|
||||
|
||||
@@ -31,6 +31,11 @@ var/global/list/rad_collectors = list()
|
||||
last_power_new = 0
|
||||
|
||||
|
||||
if(P && active)
|
||||
var/rads = radiation_repository.get_rads_at_turf(get_turf(src))
|
||||
if(rads)
|
||||
receive_pulse(rads * 5) //Maths is hard
|
||||
|
||||
if(P)
|
||||
if(P.air_contents.gas["phoron"] == 0)
|
||||
investigate_log("<font color='red'>out of fuel</font>.","singulo")
|
||||
|
||||
@@ -406,15 +406,13 @@
|
||||
var/toxrange = 10
|
||||
var/toxdamage = 4
|
||||
var/radiation = 15
|
||||
var/radiationmin = 3
|
||||
if (src.energy>200)
|
||||
toxdamage = round(((src.energy-150)/50)*4,1)
|
||||
radiation = round(((src.energy-150)/50)*5,1)
|
||||
radiationmin = round((radiation/5),1)//
|
||||
radiation_repository.radiate(src, radiation) //Always radiate at max, so a decent dose of radiation is applied
|
||||
for(var/mob/living/M in view(toxrange, src.loc))
|
||||
if(M.status_flags & GODMODE)
|
||||
continue
|
||||
M.apply_effect(rand(radiationmin,radiation), IRRADIATE)
|
||||
toxdamage = (toxdamage - (toxdamage*M.getarmor(null, "rad")))
|
||||
M.apply_effect(toxdamage, TOX)
|
||||
return
|
||||
@@ -448,13 +446,13 @@
|
||||
/obj/singularity/proc/smwave()
|
||||
for(var/mob/living/M in view(10, src.loc))
|
||||
if(prob(67))
|
||||
M.apply_effect(rand(energy), IRRADIATE)
|
||||
M << "<span class=\"warning\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>"
|
||||
M << "<span class=\"notice\">Miraculously, it fails to kill you.</span>"
|
||||
to_chat(M, "<span class=\"warning\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>")
|
||||
to_chat(M, "<span class=\"notice\">Miraculously, it fails to kill you.</span>")
|
||||
else
|
||||
M << "<span class=\"danger\">You hear an uneartly ringing, then what sounds like a shrilling kettle as you are washed with a wave of heat.</span>"
|
||||
M << "<span class=\"danger\">You don't even have a moment to react as you are reduced to ashes by the intense radiation.</span>"
|
||||
M.dust()
|
||||
radiation_repository.radiate(src, rand(energy))
|
||||
return
|
||||
|
||||
/obj/singularity/proc/pulse()
|
||||
|
||||
@@ -23,8 +23,11 @@
|
||||
#define DAMAGE_RATE_LIMIT 3 //damage rate cap at power = 300, scales linearly with power
|
||||
|
||||
|
||||
//These would be what you would get at point blank, decreases with distance
|
||||
#define DETONATION_RADS 200
|
||||
// Base variants are applied to everyone on the same Z level
|
||||
// Range variants are applied on per-range basis: numbers here are on point blank, it scales with the map size (assumes square shaped Z levels)
|
||||
#define DETONATION_RADS 20
|
||||
#define DETONATION_HALLUCINATION_BASE 300
|
||||
#define DETONATION_HALLUCINATION_RANGE 300
|
||||
#define DETONATION_HALLUCINATION 600
|
||||
|
||||
|
||||
@@ -95,6 +98,11 @@
|
||||
anchored = 1
|
||||
grav_pulling = 1
|
||||
exploded = 1
|
||||
var/turf/TS = get_turf(src) // The turf supermatter is on. SM being in a locker, mecha, or other container shouldn't block it's effects that way.
|
||||
if(!TS)
|
||||
return
|
||||
for(var/z in GetConnectedZlevels(TS.z))
|
||||
radiation_repository.z_radiate(locate(1, 1, z), DETONATION_RADS, 1)
|
||||
for(var/mob/living/mob in living_mob_list)
|
||||
var/turf/T = get_turf(mob)
|
||||
if(T && (loc.z == T.z))
|
||||
@@ -102,8 +110,6 @@
|
||||
//Hilariously enough, running into a closet should make you get hit the hardest.
|
||||
var/mob/living/carbon/human/H = mob
|
||||
H.hallucination += max(50, min(300, DETONATION_HALLUCINATION * sqrt(1 / (get_dist(mob, src) + 1)) ) )
|
||||
var/rads = DETONATION_RADS * sqrt( 1 / (get_dist(mob, src) + 1) )
|
||||
mob.apply_effect(rads, IRRADIATE)
|
||||
spawn(pull_time)
|
||||
explosion(get_turf(src), explosion_power, explosion_power * 2, explosion_power * 3, explosion_power * 4, 1)
|
||||
qdel(src)
|
||||
@@ -258,12 +264,15 @@
|
||||
if(eye_shield < 1)
|
||||
l.hallucination = max(0, min(200, l.hallucination + power * config_hallucination_power * sqrt( 1 / max(1,get_dist(l, src)) ) ) )
|
||||
|
||||
/*
|
||||
//adjusted range so that a power of 170 (pretty high) results in 9 tiles, roughly the distance from the core to the engine monitoring room.
|
||||
//note that the rads given at the maximum range is a constant 0.2 - as power increases the maximum range merely increases.
|
||||
for(var/mob/living/l in range(src, round(sqrt(power / 2))))
|
||||
var/radius = max(get_dist(l, src), 1)
|
||||
var/rads = (power / 10) * ( 1 / (radius**2) )
|
||||
l.apply_effect(rads, IRRADIATE)
|
||||
*/
|
||||
radiation_repository.radiate(src, power * 1.5) //Better close those shutters!
|
||||
|
||||
power -= (power/DECAY_FACTOR)**3 //energy losses due to radiation
|
||||
|
||||
@@ -377,9 +386,8 @@
|
||||
"<span class=\"warning\">The unearthly ringing subsides and you notice you have new radiation burns.</span>", 2)
|
||||
else
|
||||
l.show_message("<span class=\"warning\">You hear an uneartly ringing and notice your skin is covered in fresh radiation burns.</span>", 2)
|
||||
var/rads = 500 * sqrt( 1 / (get_dist(l, src) + 1) )
|
||||
l.apply_effect(rads, IRRADIATE)
|
||||
|
||||
var/rads = 500
|
||||
radiation_repository.radiate(src, rads)
|
||||
|
||||
/obj/machinery/power/supermatter/proc/supermatter_pull()
|
||||
//following is adapted from singulo code
|
||||
|
||||
@@ -15,16 +15,10 @@
|
||||
|
||||
/datum/artifact_effect/radiate/DoEffectAura()
|
||||
if(holder)
|
||||
var/turf/T = get_turf(holder)
|
||||
for (var/mob/living/M in range(src.effectrange,T))
|
||||
M.apply_effect(radiation_amount,IRRADIATE,0)
|
||||
M.updatehealth()
|
||||
radiation_repository.flat_radiate(holder, radiation_amount, src.effectrange)
|
||||
return 1
|
||||
|
||||
/datum/artifact_effect/radiate/DoEffectPulse()
|
||||
if(holder)
|
||||
var/turf/T = get_turf(holder)
|
||||
for (var/mob/living/M in range(src.effectrange,T))
|
||||
M.apply_effect(radiation_amount * 25,IRRADIATE,0)
|
||||
M.updatehealth()
|
||||
radiation_repository.radiate(holder, ((radiation_amount * 25) * (sqrt(src.effectrange)))) //Need to get feedback on this
|
||||
return 1
|
||||
|
||||
@@ -198,8 +198,7 @@
|
||||
radiation = rand() * 15 + 85
|
||||
if(!rad_shield)
|
||||
//irradiate nearby mobs
|
||||
for(var/mob/living/M in view(7,src))
|
||||
M.apply_effect(radiation / 25, IRRADIATE, 0)
|
||||
radiation_repository.radiate(src, radiation / 25)
|
||||
else
|
||||
t_left_radspike = pick(10,15,25)
|
||||
|
||||
@@ -361,4 +360,4 @@
|
||||
scanned_item = null
|
||||
|
||||
add_fingerprint(usr)
|
||||
return 1 // update UIs attached to this object
|
||||
return 1 // update UIs attached to this object
|
||||
Reference in New Issue
Block a user