Merge pull request #3395 from Citadel-Station-13/upstream-merge-31731
[MIRROR] [s] Fixes camera mobs becoming contaminated and other tweaks
This commit is contained in:
@@ -15,7 +15,7 @@ Ask ninjanomnom if they're around
|
||||
#define RAD_MOB_COEFFICIENT 0.25 // Radiation applied is multiplied by this
|
||||
|
||||
#define RAD_LOSS_PER_TICK 1
|
||||
#define RAD_TOX_COEFFICIENT 0.1 // Toxin damage per tick coefficient
|
||||
#define RAD_TOX_COEFFICIENT 0.05 // Toxin damage per tick coefficient
|
||||
|
||||
#define RAD_MOB_SAFE 300 // How much stored radiation in a mob with no ill effects
|
||||
#define RAD_MOB_KNOCKDOWN 1500 // How much stored radiation to start stunning
|
||||
|
||||
@@ -11,25 +11,29 @@
|
||||
return
|
||||
|
||||
for(var/i in 1 to location.contents.len)
|
||||
var/static/list/ignored_things = typecacheof(list(/mob/dead, /obj/effect, /obj/docking_port, /turf, /atom/movable/lighting_object))
|
||||
var/static/list/ignored_things = typecacheof(list(/mob/dead, /obj/effect, /obj/docking_port, /turf, /atom/movable/lighting_object, /mob/camera))
|
||||
var/atom/thing = location.contents[i]
|
||||
if(ignored_things[thing.type])
|
||||
continue
|
||||
get_rad_contents(thing, output)
|
||||
|
||||
/proc/radiation_pulse(turf/epicenter, intensity, range_modifier, log=FALSE, can_contaminate=TRUE)
|
||||
/proc/radiation_pulse(atom/source, intensity, range_modifier, log=FALSE, can_contaminate=TRUE)
|
||||
if(!SSradiation.can_fire)
|
||||
return
|
||||
for(var/dir in GLOB.cardinals)
|
||||
new /datum/radiation_wave(epicenter, dir, intensity, range_modifier, can_contaminate)
|
||||
new /datum/radiation_wave(source, dir, intensity, range_modifier, can_contaminate)
|
||||
|
||||
var/list/things = get_rad_contents(epicenter) //copypasta because I don't want to put special code in waves to handle their origin
|
||||
var/list/things = get_rad_contents(source) //copypasta because I don't want to put special code in waves to handle their origin
|
||||
for(var/k in 1 to things.len)
|
||||
var/atom/thing = things[k]
|
||||
if(!thing)
|
||||
continue
|
||||
thing.rad_act(intensity)
|
||||
|
||||
var/static/last_huge_pulse = 0
|
||||
if(intensity > 3000 && world.time > last_huge_pulse + 200)
|
||||
last_huge_pulse = world.time
|
||||
log = TRUE
|
||||
if(log)
|
||||
log_game("Radiation pulse with intensity:[intensity] and range modifier:[range_modifier] in area [epicenter.loc.name] ")
|
||||
log_game("Radiation pulse with intensity:[intensity] and range modifier:[range_modifier] in area [get_area(source)] ")
|
||||
return TRUE
|
||||
@@ -6,12 +6,15 @@
|
||||
/datum/component/radioactive
|
||||
dupe_mode = COMPONENT_DUPE_UNIQUE
|
||||
|
||||
var/source
|
||||
|
||||
var/hl3_release_date //the half-life measured in ticks
|
||||
var/strength
|
||||
var/can_contaminate
|
||||
|
||||
/datum/component/radioactive/Initialize(_strength=0, _half_life=RAD_HALF_LIFE, _can_contaminate=TRUE)
|
||||
/datum/component/radioactive/Initialize(_strength=0, _source, _half_life=RAD_HALF_LIFE, _can_contaminate=TRUE)
|
||||
strength = _strength
|
||||
source = _source
|
||||
hl3_release_date = _half_life
|
||||
can_contaminate = _can_contaminate
|
||||
|
||||
@@ -31,7 +34,7 @@
|
||||
return ..()
|
||||
|
||||
/datum/component/radioactive/process()
|
||||
radiation_pulse(get_turf(parent),strength,1,FALSE,can_contaminate)
|
||||
radiation_pulse(parent,strength,1,FALSE,can_contaminate)
|
||||
|
||||
if(hl3_release_date && prob(50))
|
||||
strength -= strength / hl3_release_date
|
||||
@@ -64,7 +67,7 @@
|
||||
to_chat(user, out.Join())
|
||||
|
||||
/datum/component/radioactive/proc/rad_attack(atom/movable/target, mob/living/user)
|
||||
radiation_pulse(get_turf(target), strength/20)
|
||||
radiation_pulse(parent, strength/20)
|
||||
target.rad_act(strength/2)
|
||||
|
||||
#undef RAD_AMOUNT_LOW
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
/datum/radiation_wave
|
||||
var/source
|
||||
var/turf/master_turf //The center of the wave
|
||||
var/steps=0 //How far we've moved
|
||||
var/intensity //How strong it was originaly
|
||||
@@ -7,8 +8,9 @@
|
||||
var/list/__dirs //The directions to the side of the wave, stored for easy looping
|
||||
var/can_contaminate
|
||||
|
||||
/datum/radiation_wave/New(turf/place, dir, _intensity=0, _range_modifier=RAD_DISTANCE_COEFFICIENT, _can_contaminate=TRUE)
|
||||
master_turf = place
|
||||
/datum/radiation_wave/New(atom/_source, dir, _intensity=0, _range_modifier=RAD_DISTANCE_COEFFICIENT, _can_contaminate=TRUE)
|
||||
source = _source
|
||||
master_turf = get_turf(_source)
|
||||
|
||||
move_dir = dir
|
||||
__dirs = list()
|
||||
@@ -87,7 +89,7 @@
|
||||
continue
|
||||
thing.rad_act(strength)
|
||||
|
||||
var/static/list/blacklisted = typecacheof(list(/turf))
|
||||
var/static/list/blacklisted = typecacheof(list(/turf, /obj/structure/cable, /obj/machinery/atmospherics))
|
||||
if(!can_contaminate || blacklisted[thing.type])
|
||||
continue
|
||||
if(prob((strength-RAD_MINIMUM_CONTAMINATION) * RAD_CONTAMINATION_CHANCE_COEFFICIENT * min(1/(steps*range_modifier), 1))) // Only stronk rads get to have little baby rads
|
||||
@@ -95,4 +97,5 @@
|
||||
if(insulation && insulation.contamination_proof)
|
||||
continue
|
||||
else
|
||||
thing.AddComponent(/datum/component/radioactive, (strength-RAD_MINIMUM_CONTAMINATION) * RAD_CONTAMINATION_STR_COEFFICIENT * min(1/(steps*range_modifier), 1))
|
||||
var/rad_strength = (strength-RAD_MINIMUM_CONTAMINATION) * RAD_CONTAMINATION_STR_COEFFICIENT * min(1/(steps*range_modifier), 1)
|
||||
thing.AddComponent(/datum/component/radioactive, rad_strength, source)
|
||||
@@ -268,7 +268,7 @@ GLOBAL_LIST_INIT(meteorsC, list(/obj/effect/meteor/dust)) //for space dust event
|
||||
..()
|
||||
explosion(src.loc, 0, 0, 4, 3, 0)
|
||||
new /obj/effect/decal/cleanable/greenglow(get_turf(src))
|
||||
radiation_pulse(get_turf(src), 500)
|
||||
radiation_pulse(src, 500)
|
||||
|
||||
//Meaty Ore
|
||||
/obj/effect/meteor/meaty
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
/obj/item/grenade/gluon/prime()
|
||||
update_mob()
|
||||
playsound(loc, 'sound/effects/empulse.ogg', 50, 1)
|
||||
radiation_pulse(get_turf(src), rad_damage)
|
||||
radiation_pulse(src, rad_damage)
|
||||
for(var/turf/T in view(freeze_range,loc))
|
||||
if(isfloorturf(T))
|
||||
var/turf/open/floor/F = T
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
if(cooldown < world.time - 60)
|
||||
cooldown = world.time
|
||||
flick(pulseicon, src)
|
||||
radiation_pulse(get_turf(src), 400, 2)
|
||||
radiation_pulse(src, 400, 2)
|
||||
|
||||
//nuke core box, for carrying the core
|
||||
/obj/item/nuke_core_container
|
||||
@@ -140,7 +140,7 @@
|
||||
return
|
||||
else
|
||||
to_chat(user, "<span class='notice'>As it touches \the [src], both \the [src] and \the [W] burst into dust!</span>")
|
||||
radiation_pulse(get_turf(user), 100)
|
||||
radiation_pulse(user, 100)
|
||||
playsound(src, 'sound/effects/supermatter.ogg', 50, 1)
|
||||
qdel(W)
|
||||
qdel(src)
|
||||
@@ -151,7 +151,7 @@
|
||||
return FALSE
|
||||
var/mob/ded = user
|
||||
to_chat(user, "<span class='warning'>You reach for the supermatter sliver with your hands. That was dumb.</span>")
|
||||
radiation_pulse(get_turf(user), 500, 2)
|
||||
radiation_pulse(user, 500, 2)
|
||||
playsound(get_turf(user), 'sound/effects/supermatter.ogg', 50, 1)
|
||||
ded.dust()
|
||||
|
||||
@@ -240,7 +240,7 @@
|
||||
user.visible_message("<span class='danger'>As [user] touches \the [AM] with \a [src], silence fills the room...</span>",\
|
||||
"<span class='userdanger'>You touch \the [AM] with \the [src], and everything suddenly goes silent.</span>\n<span class='notice'>\The [AM] flashes into dust, and soon as you can register this, you do as well.</span>",\
|
||||
"<span class='italics'>Everything suddenly goes silent.</span>")
|
||||
radiation_pulse(get_turf(user), 500, 2)
|
||||
radiation_pulse(user, 500, 2)
|
||||
playsound(src, 'sound/effects/supermatter.ogg', 50, 1)
|
||||
user.dust()
|
||||
icon_state = "supermatter_tongs"
|
||||
|
||||
@@ -199,7 +199,7 @@
|
||||
if(!active)
|
||||
if(world.time > last_event+15)
|
||||
active = 1
|
||||
radiation_pulse(get_turf(src), 150)
|
||||
radiation_pulse(src, 150)
|
||||
for(var/turf/closed/wall/mineral/uranium/T in orange(1,src))
|
||||
T.radiate()
|
||||
last_event = world.time
|
||||
|
||||
@@ -131,7 +131,7 @@
|
||||
if(!active)
|
||||
if(world.time > last_event+15)
|
||||
active = 1
|
||||
radiation_pulse(get_turf(src), 30)
|
||||
radiation_pulse(src, 30)
|
||||
last_event = world.time
|
||||
active = null
|
||||
return
|
||||
|
||||
@@ -206,7 +206,7 @@
|
||||
if(!active)
|
||||
if(world.time > last_event+15)
|
||||
active = 1
|
||||
radiation_pulse(get_turf(src), 10)
|
||||
radiation_pulse(src, 10)
|
||||
for(var/turf/open/floor/mineral/uranium/T in orange(1,src))
|
||||
T.radiate()
|
||||
last_event = world.time
|
||||
|
||||
@@ -70,7 +70,7 @@
|
||||
if(!active)
|
||||
if(world.time > last_event+15)
|
||||
active = 1
|
||||
radiation_pulse(get_turf(src), 40)
|
||||
radiation_pulse(src, 40)
|
||||
for(var/turf/closed/wall/mineral/uranium/T in orange(1,src))
|
||||
T.radiate()
|
||||
last_event = world.time
|
||||
|
||||
@@ -48,10 +48,6 @@ Pipelines + Other Objects -> Pipe network
|
||||
SSair.atmos_machinery += src
|
||||
SetInitDirections()
|
||||
|
||||
/obj/machinery/atmospherics/ComponentInitialize()
|
||||
. = ..()
|
||||
AddComponent(/datum/component/rad_insulation, RAD_NO_INSULATION) //This would be a bad idea
|
||||
|
||||
/obj/machinery/atmospherics/Destroy()
|
||||
for(DEVICE_TYPE_LOOP)
|
||||
nullifyNode(I)
|
||||
|
||||
@@ -295,7 +295,7 @@
|
||||
if(!active)
|
||||
if(world.time > last_event+30)
|
||||
active = 1
|
||||
radiation_pulse(get_turf(H), 50)
|
||||
radiation_pulse(H, 50)
|
||||
last_event = world.time
|
||||
active = null
|
||||
..()
|
||||
|
||||
@@ -363,7 +363,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
|
||||
|
||||
|
||||
/obj/machinery/gravity_generator/main/proc/pulse_radiation()
|
||||
radiation_pulse(get_turf(src), 200)
|
||||
radiation_pulse(src, 200)
|
||||
|
||||
// Shake everyone on the z level to let them know that gravity was enagaged/disenagaged.
|
||||
/obj/machinery/gravity_generator/main/proc/shake_everyone()
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
..()
|
||||
add_avail(power_gen)
|
||||
if(panel_open && irradiate)
|
||||
radiation_pulse(get_turf(src), 60)
|
||||
radiation_pulse(src, 60)
|
||||
|
||||
/obj/machinery/power/rtg/RefreshParts()
|
||||
var/part_level = 0
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
/obj/singularity/process()
|
||||
if(current_size >= STAGE_TWO)
|
||||
move()
|
||||
radiation_pulse(get_turf(src), energy, 0.5)
|
||||
radiation_pulse(src, energy, 0.5)
|
||||
if(prob(event_chance))//Chance for it to run a special event TODO:Come up with one or two more that fit
|
||||
event()
|
||||
eat()
|
||||
@@ -388,7 +388,7 @@
|
||||
var/radiation = 15
|
||||
if (energy>200)
|
||||
radiation += round((energy-150)/10,1)
|
||||
radiation_pulse(get_turf(src), radiation)
|
||||
radiation_pulse(src, radiation)
|
||||
|
||||
|
||||
/obj/singularity/proc/combust_mobs()
|
||||
|
||||
@@ -332,7 +332,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
|
||||
power = max( (removed.temperature * temp_factor / T0C) * gasmix_power_ratio + power, 0) //Total laser power plus an overload
|
||||
|
||||
if(prob(50))
|
||||
radiation_pulse(get_turf(src), power * (1 + power_transmission_bonus/10 * freon_transmit_modifier))
|
||||
radiation_pulse(src, power * (1 + power_transmission_bonus/10 * freon_transmit_modifier))
|
||||
|
||||
var/device_energy = power * REACTION_POWER_MODIFIER
|
||||
|
||||
@@ -545,7 +545,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
|
||||
Consume(W)
|
||||
playsound(get_turf(src), 'sound/effects/supermatter.ogg', 50, 1)
|
||||
|
||||
radiation_pulse(get_turf(src), 150, 4)
|
||||
radiation_pulse(src, 150, 4)
|
||||
|
||||
|
||||
/obj/machinery/power/supermatter_shard/CollidedWith(atom/movable/AM)
|
||||
@@ -579,7 +579,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_shard)
|
||||
matter_power += 200
|
||||
|
||||
//Some poor sod got eaten, go ahead and irradiate people nearby.
|
||||
radiation_pulse(get_turf(src), 3000, 2, TRUE)
|
||||
radiation_pulse(src, 3000, 2, TRUE)
|
||||
for(var/mob/living/L in range(10))
|
||||
investigate_log("has irradiated [L] after consuming [AM].", INVESTIGATE_SUPERMATTER)
|
||||
if(L in view())
|
||||
|
||||
@@ -454,7 +454,7 @@
|
||||
|
||||
/datum/reagent/medicine/potass_iodide/on_mob_life(mob/living/M)
|
||||
if(M.radiation > 0)
|
||||
M.radiation-=2
|
||||
M.radiation -= min(M.radiation, 4)
|
||||
..()
|
||||
|
||||
/datum/reagent/medicine/pen_acid
|
||||
@@ -466,7 +466,7 @@
|
||||
metabolization_rate = 0.5 * REAGENTS_METABOLISM
|
||||
|
||||
/datum/reagent/medicine/pen_acid/on_mob_life(mob/living/M)
|
||||
M.radiation -= min(M.radiation, 8)
|
||||
M.radiation -= min(M.radiation, log(M.radiation)*10)
|
||||
M.adjustToxLoss(-2*REM, 0)
|
||||
for(var/datum/reagent/R in M.reagents.reagent_list)
|
||||
if(R != src)
|
||||
|
||||
@@ -255,7 +255,7 @@
|
||||
ejectItem()
|
||||
else if(prob(EFFECT_PROB_VERYLOW-badThingCoeff))
|
||||
visible_message("<span class='danger'>[src] malfunctions, melting [exp_on] and leaking radiation!</span>")
|
||||
radiation_pulse(get_turf(src), 50)
|
||||
radiation_pulse(src, 500)
|
||||
ejectItem(TRUE)
|
||||
else if(prob(EFFECT_PROB_LOW-badThingCoeff))
|
||||
visible_message("<span class='warning'>[src] malfunctions, spewing toxic waste!</span>")
|
||||
|
||||
Reference in New Issue
Block a user