Radiation Refactor (#15331)

* First Commit

* visible radiation and engine goggles

* correction

* t-ray fix

* further adjustments and fixups

* gieger addition and cleaning fixup

* yet more fixes

* styling fixes

* fixes

* human glowing fix

* do the merge conflict avoidance dance

* Update supermatter.dm

* supermatter rads

* mapping in

* radiation doors

* yeah yeah line endings

* clean up

* styling issues

* showers
This commit is contained in:
Fox McCloud
2021-01-24 17:03:13 -05:00
committed by GitHub
parent acaefa9591
commit de795c4e31
154 changed files with 1967 additions and 674 deletions
-1
View File
@@ -9,7 +9,6 @@
armor = list("melee" = 20, "bullet" = 20, "laser" = 20, "energy" = 100, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
var/list/barsigns=list()
var/list/hiddensigns
var/emagged = 0
var/state = 0
var/prev_sign = ""
var/panel_open = 0
@@ -34,6 +34,7 @@
new /obj/item/holosign_creator/engineering(src)
new /obj/item/flash(src)
new /obj/item/clothing/head/beret/eng(src)
new /obj/item/clothing/glasses/meson/engine(src)
new /obj/item/door_remote/chief_engineer(src)
new /obj/item/rpd(src)
new /obj/item/reagent_containers/food/drinks/mug/ce(src)
@@ -109,7 +110,7 @@
new /obj/item/clothing/under/rank/engineer/skirt(src)
new /obj/item/clothing/suit/storage/hazardvest(src)
new /obj/item/clothing/mask/gas(src)
new /obj/item/clothing/glasses/meson(src)
new /obj/item/clothing/glasses/meson/engine(src)
new /obj/item/cartridge/engineering(src)
new /obj/item/clothing/head/beret/eng(src)
@@ -143,5 +144,6 @@
new /obj/item/watertank/atmos(src)
new /obj/item/clothing/suit/fire/atmos(src)
new /obj/item/clothing/head/hardhat/atmos(src)
new /obj/item/clothing/glasses/meson/engine/tray(src)
new /obj/item/rpd(src)
new /obj/item/destTagger(src)
@@ -140,6 +140,7 @@
icon_closed = "radsuitcloset"
/obj/structure/closet/radiation/populate_contents()
new /obj/item/geiger_counter(src)
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
@@ -385,16 +385,6 @@
icon_opened = "radiationopen"
icon_closed = "radiation"
/obj/structure/closet/crate/radiation/populate_contents()
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
new /obj/item/clothing/suit/radiation(src)
new /obj/item/clothing/head/radiation(src)
/obj/structure/closet/crate/secure/weapon
desc = "A secure weapons crate."
name = "weapons crate"
+1 -2
View File
@@ -44,8 +44,7 @@
if(prob(50))
empulse(src, 4, 10)
else
for(var/mob/living/M in range(10, loc))
M.apply_effect(rand(5, 25), IRRADIATE)
radiation_pulse(get_turf(src), 500, 2)
/obj/structure/fusionreactor/wrench_act(mob/user, obj/item/I)
. = TRUE
+5 -6
View File
@@ -12,6 +12,8 @@
anchored = TRUE
icon = 'icons/turf/walls/wall.dmi'
icon_state = "wall"
flags_2 = RAD_PROTECT_CONTENTS_2 | RAD_NO_CONTAMINATE_2
rad_insulation = RAD_MEDIUM_INSULATION
var/mineral = /obj/item/stack/sheet/metal
var/mineral_amount = 2
@@ -191,16 +193,13 @@
/obj/structure/falsewall/uranium/proc/radiate()
if(!active)
if(world.time > last_event+15)
if(world.time > last_event + 15)
active = 1
for(var/mob/living/L in range(3,src))
L.apply_effect(12,IRRADIATE,0)
for(var/turf/simulated/wall/mineral/uranium/T in range(3,src))
radiation_pulse(src, 150)
for(var/turf/simulated/wall/mineral/uranium/T in orange(1, src))
T.radiate()
last_event = world.time
active = null
return
return
/*
* Other misc falsewall types
*/
+2
View File
@@ -4,6 +4,8 @@
anchored = 1
density = 1
layer = BELOW_OBJ_LAYER
flags_2 = RAD_PROTECT_CONTENTS_2 | RAD_NO_CONTAMINATE_2
rad_insulation = RAD_VERY_LIGHT_INSULATION
var/state = GIRDER_NORMAL
var/girderpasschance = 20 // percentage chance that a projectile passes through the girder.
max_integrity = 200
+1
View File
@@ -6,6 +6,7 @@
density = TRUE
anchored = TRUE
flags = CONDUCT
flags_2 = RAD_PROTECT_CONTENTS_2 | RAD_NO_CONTAMINATE_2
pressure_resistance = 5*ONE_ATMOSPHERE
layer = BELOW_OBJ_LAYER
level = 3
+4
View File
@@ -62,6 +62,8 @@
/obj/structure/holosign/barrier/engineering
icon_state = "holosign_engi"
flags_2 = RAD_PROTECT_CONTENTS_2 | RAD_NO_CONTAMINATE_2
rad_insulation = RAD_LIGHT_INSULATION
/obj/structure/holosign/barrier/atmos
name = "holo firelock"
@@ -72,6 +74,8 @@
anchored = TRUE
layer = ABOVE_MOB_LAYER
alpha = 150
flags_2 = RAD_PROTECT_CONTENTS_2 | RAD_NO_CONTAMINATE_2
rad_insulation = RAD_LIGHT_INSULATION
/obj/structure/holosign/barrier/atmos/Initialize(mapload)
. = ..()
@@ -9,6 +9,8 @@
icon_state = "metal"
max_integrity = 200
armor = list("melee" = 10, "bullet" = 0, "laser" = 0, "energy" = 100, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 50, "acid" = 50)
flags_2 = RAD_PROTECT_CONTENTS_2 | RAD_NO_CONTAMINATE_2
rad_insulation = RAD_MEDIUM_INSULATION
var/initial_state
var/state = 0 //closed, 1 == open
var/isSwitchingStates = 0
@@ -153,11 +155,13 @@
icon_state = "silver"
sheetType = /obj/item/stack/sheet/mineral/silver
max_integrity = 300
rad_insulation = RAD_HEAVY_INSULATION
/obj/structure/mineral_door/gold
name = "gold door"
icon_state = "gold"
sheetType = /obj/item/stack/sheet/mineral/gold
rad_insulation = RAD_HEAVY_INSULATION
/obj/structure/mineral_door/uranium
name = "uranium door"
@@ -174,6 +178,7 @@
/obj/structure/mineral_door/transparent
opacity = 0
rad_insulation = RAD_VERY_LIGHT_INSULATION
/obj/structure/mineral_door/transparent/Close()
..()
@@ -207,6 +212,7 @@
icon_state = "diamond"
sheetType = /obj/item/stack/sheet/mineral/diamond
max_integrity = 1000
rad_insulation = RAD_EXTREME_INSULATION
/obj/structure/mineral_door/wood
name = "wood door"
@@ -217,6 +223,7 @@
hardness = 1
resistance_flags = FLAMMABLE
max_integrity = 200
rad_insulation = RAD_VERY_LIGHT_INSULATION
/obj/structure/mineral_door/resin
name = "resin door"
+1
View File
@@ -6,6 +6,7 @@
layer = 3.5
max_integrity = 100
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 50)
flags_2 = RAD_PROTECT_CONTENTS_2 | RAD_NO_CONTAMINATE_2
/obj/structure/sign/play_attack_sound(damage_amount, damage_type = BRUTE, damage_flag = 0)
switch(damage_type)
+2 -3
View File
@@ -90,10 +90,9 @@
/obj/structure/statue/uranium/proc/radiate()
if(!active)
if(world.time > last_event+15)
if(world.time > last_event + 15)
active = 1
for(var/mob/living/L in range(3,src))
L.apply_effect(12,IRRADIATE,0)
radiation_pulse(src, 30)
last_event = world.time
active = null
+98 -105
View File
@@ -240,6 +240,10 @@
pixel_x = 0
pixel_y = 32
#define SHOWER_FREEZING "freezing"
#define SHOWER_NORMAL "normal"
#define SHOWER_BOILING "boiling"
/obj/machinery/shower
name = "shower"
desc = "The HS-451. Installed in the 2550s by the Nanotrasen Hygiene Division."
@@ -248,11 +252,11 @@
density = 0
anchored = 1
use_power = NO_POWER_USE
var/on = 0
var/obj/effect/mist/mymist = null
var/ismist = 0 //needs a var so we can make it linger~
var/watertemp = "normal" //freezing, normal, or boiling
var/mobpresent = 0 //true if there is a mob on the shower's loc, this is to ease process()
///Is the shower on or off?
var/on = FALSE
///What temperature the shower reagents are set to.
var/current_temperature = SHOWER_NORMAL
///What sound will be played on loop when the shower is on and pouring water.
var/datum/looping_sound/showering/soundloop
/obj/machinery/shower/New(turf/T, newdir = SOUTH, building = FALSE)
@@ -270,7 +274,6 @@
layer = FLY_LAYER
/obj/machinery/shower/Destroy()
QDEL_NULL(mymist)
QDEL_NULL(soundloop)
return ..()
@@ -280,47 +283,45 @@
name = "mist"
icon = 'icons/obj/watercloset.dmi'
icon_state = "mist"
layer = MOB_LAYER + 1
anchored = 1
layer = FLY_LAYER
anchored = TRUE
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/obj/machinery/shower/attack_hand(mob/M as mob)
/obj/machinery/shower/attack_hand(mob/M)
on = !on
update_icon()
handle_mist()
add_fingerprint(M)
if(on)
START_PROCESSING(SSmachines, src)
process()
soundloop.start()
if(M.loc == loc)
wash(M)
check_heat(M)
M.water_act(100, convertHeat(), src)
for(var/atom/movable/G in src.loc)
G.clean_blood()
G.water_act(100, convertHeat(), src)
else
soundloop.stop()
var/turf/simulated/T = loc
if(istype(T) && !T.density)
T.MakeSlippery(TURF_WET_WATER, 5 SECONDS)
/obj/machinery/shower/attackby(obj/item/I as obj, mob/user as mob, params)
/obj/machinery/shower/attackby(obj/item/I, mob/user, params)
if(I.type == /obj/item/analyzer)
to_chat(user, "<span class='notice'>The water temperature seems to be [watertemp].</span>")
if(on)
I.water_act(100, convertHeat(), src)
to_chat(user, "<span class='notice'>The water temperature seems to be [current_temperature].</span>")
return ..()
/obj/machinery/shower/wrench_act(mob/user, obj/item/I)
. = TRUE
if(!I.tool_use_check(user, 0))
return
to_chat(user, "<span class='notice'>You begin to adjust the temperature valve with the [I].</span>")
if(I.use_tool(src, user, 50, volume = I.tool_volume))
switch(watertemp)
if("normal")
watertemp = "freezing"
if("freezing")
watertemp = "boiling"
if("boiling")
watertemp = "normal"
user.visible_message("<span class='notice'>[user] adjusts the shower with the [I].</span>", "<span class='notice'>You adjust [src] to [watertemp].</span>")
update_icon() //letsa update whenever we change the temperature, since the mist might need to change
..()
to_chat(user, "<span class='notice'>You begin to adjust the temperature valve with [I].</span>")
if(I.use_tool(src, user, 50))
switch(current_temperature)
if(SHOWER_NORMAL)
current_temperature = SHOWER_FREEZING
if(SHOWER_FREEZING)
current_temperature = SHOWER_BOILING
if(SHOWER_BOILING)
current_temperature = SHOWER_NORMAL
user.visible_message("<span class='notice'>[user] adjusts the shower with \the [I].</span>", "<span class='notice'>You adjust the shower with \the [I] to [current_temperature] temperature.</span>")
add_hiddenprint(user)
handle_mist()
return TRUE
/obj/machinery/shower/welder_act(mob/user, obj/item/I)
. = TRUE
@@ -331,111 +332,103 @@
return
visible_message("<span class='notice'>[user] begins slicing [src] free...</span>", "<span class='notice'>You begin slicing [src] free...</span>", "<span class='warning'>You hear welding.</span>")
if(I.use_tool(src, user, 40, volume = I.tool_volume))
if(mymist)
qdel(mymist)
user.visible_message("<span class='notice'>[user] cuts [src] loose!</span>", "<span class='notice'>You cut [src] loose!</span>")
var/obj/item/mounted/shower/S = new /obj/item/mounted/shower(get_turf(user))
transfer_prints_to(S, TRUE)
qdel(src)
/obj/machinery/shower/update_icon() //this makes the shower mist up or clear mist (depending on water temperature)
overlays.Cut() //once it's been on for a while, in addition to handling the water overlay.
/obj/machinery/shower/update_icon()
cut_overlays()
if(on)
overlays += image('icons/obj/watercloset.dmi', src, "water", MOB_LAYER + 1, dir)
var/mist_time = 50 //5 seconds at normal temperature to build up mist
if(watertemp == "freezing")
mist_time = 70 //7 seconds on freezing temperature to disperse existing mist
if(watertemp == "boiling")
mist_time = 20 //2 seconds on boiling temperature to build up mist
addtimer(CALLBACK(src, .proc/update_mist), mist_time)
else
addtimer(CALLBACK(src, .proc/update_mist), 250) //25 seconds for mist to disperse after being turned off
var/mutable_appearance/water_falling = mutable_appearance('icons/obj/watercloset.dmi', "water", ABOVE_MOB_LAYER)
add_overlay(water_falling)
/obj/machinery/shower/proc/update_mist()
/obj/machinery/shower/proc/handle_mist()
// If there is no mist, and the shower was turned on (on a non-freezing temp): make mist in 5 seconds
// If there was already mist, and the shower was turned off (or made cold): remove the existing mist in 25 sec
var/obj/effect/mist/mist = locate() in loc
if(!mist && on && current_temperature != SHOWER_FREEZING)
addtimer(CALLBACK(src, .proc/make_mist), 5 SECONDS)
if(mist && (!on || current_temperature == SHOWER_FREEZING))
addtimer(CALLBACK(src, .proc/clear_mist), 25 SECONDS)
/obj/machinery/shower/proc/make_mist()
var/obj/effect/mist/mist = locate() in loc
if(!mist && on && current_temperature != SHOWER_FREEZING)
new /obj/effect/mist(loc)
/obj/machinery/shower/proc/clear_mist()
var/obj/effect/mist/mist = locate() in loc
if(mist && (!on || current_temperature == SHOWER_FREEZING))
qdel(mist)
/obj/machinery/shower/Crossed(atom/movable/AM)
..()
if(on)
if(watertemp == "freezing")
if(mymist)
qdel(mymist)
ismist = 0
return
if(mymist)
return
ismist = 1
mymist = new /obj/effect/mist(loc)
else
if(mymist)
qdel(mymist)
ismist = 0
/obj/machinery/shower/Crossed(atom/movable/O, oldloc)
..()
wash(O)
if(ismob(O))
mobpresent += 1
check_heat(O)
/obj/machinery/shower/Uncrossed(atom/movable/O)
if(ismob(O))
mobpresent -= 1
..()
wash(AM)
/obj/machinery/shower/proc/convertHeat()
switch(watertemp)
if("boiling")
switch(current_temperature)
if(SHOWER_BOILING)
return 340.15
if("normal")
if(SHOWER_NORMAL)
return 310.15
if("freezing")
if(SHOWER_FREEZING)
return 230.15
//Yes, showers are super powerful as far as washing goes.
/obj/machinery/shower/proc/wash(atom/movable/O as obj|mob)
if(!on) return
if(istype(O, /obj/item))
var/obj/item/I = O
/obj/machinery/shower/proc/wash(atom/A)
if(isitem(A))
var/obj/item/I = A
I.extinguish()
O.water_act(100, convertHeat(), src)
A.water_act(100, convertHeat(), src)
if(isliving(O))
var/mob/living/L = O
if(isliving(A))
var/mob/living/L = A
check_heat(L)
L.ExtinguishMob()
L.adjust_fire_stacks(-20) //Douse ourselves with water to avoid fire more easily
to_chat(L, "<span class='warning'>You've been drenched in water!</span>")
L.clean_blood()
if(isturf(loc))
var/turf/tile = loc
loc.clean_blood()
for(var/obj/effect/E in tile)
if(is_cleanable(E))
qdel(E)
A.clean_blood(radiation_clean = TRUE)
/obj/machinery/shower/process()
if(!on || !mobpresent)
return
for(var/mob/living/carbon/C in loc)
if(prob(33))
wash(C) //re-applies water and re-cleans mob while they remain under the shower, 33% chance per process to avoid message spam/quick death
check_heat(C)
if(on)
if(isturf(loc))
var/turf/tile = loc
tile.water_act(100, convertHeat(), src)
tile.clean_blood(radiation_clean = TRUE)
for(var/obj/effect/E in tile)
if(is_cleanable(E))
qdel(E)
for(var/A in loc)
wash(A)
else
on = FALSE
soundloop.stop()
handle_mist()
update_icon()
/obj/machinery/shower/proc/check_heat(mob/M as mob)
if(!on || watertemp == "normal")
/obj/machinery/shower/proc/check_heat(mob/M)
if(current_temperature == SHOWER_NORMAL)
return
if(iscarbon(M))
var/mob/living/carbon/C = M
if(watertemp == "freezing")
if(current_temperature == SHOWER_FREEZING)
//C.bodytemperature = max(80, C.bodytemperature - 80)
to_chat(C, "<span class='warning'>The water is freezing!</span>")
return
if(watertemp == "boiling")
else if(current_temperature == SHOWER_BOILING)
//C.bodytemperature = min(500, C.bodytemperature + 35)
C.adjustFireLoss(5)
to_chat(C, "<span class='danger'>The water is searing!</span>")
return
#undef SHOWER_FREEZING
#undef SHOWER_NORMAL
#undef SHOWER_BOILING
/obj/item/bikehorn/rubberducky
name = "rubber ducky"
+9
View File
@@ -30,10 +30,12 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
pressure_resistance = 4*ONE_ATMOSPHERE
anchored = TRUE
flags = ON_BORDER
flags_2 = RAD_PROTECT_CONTENTS_2
can_be_unanchored = TRUE
max_integrity = 25
resistance_flags = ACID_PROOF
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 80, "acid" = 100)
rad_insulation = RAD_VERY_LIGHT_INSULATION
var/ini_dir = null
var/state = WINDOW_OUT_OF_FRAME
var/reinf = FALSE
@@ -505,6 +507,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
cancolor = TRUE
heat_resistance = 1600
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 25, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 100)
rad_insulation = RAD_HEAVY_INSULATION
max_integrity = 50
explosion_block = 1
glass_type = /obj/item/stack/sheet/rglass
@@ -579,6 +582,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
max_integrity = 150
explosion_block = 1
armor = list("melee" = 75, "bullet" = 5, "laser" = 0, "energy" = 0, "bomb" = 45, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
rad_insulation = RAD_NO_INSULATION
/obj/structure/window/plasmabasic/BlockSuperconductivity()
return 1
@@ -593,6 +597,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
max_integrity = 500
explosion_block = 2
armor = list("melee" = 85, "bullet" = 20, "laser" = 0, "energy" = 0, "bomb" = 60, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
rad_insulation = RAD_NO_INSULATION
damage_deflection = 21
/obj/structure/window/plasmareinforced/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
@@ -630,6 +635,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
canSmoothWith = list(/obj/structure/window/full/basic, /obj/structure/window/full/reinforced, /obj/structure/window/full/reinforced/tinted, /obj/structure/window/full/plasmabasic, /obj/structure/window/full/plasmareinforced)
explosion_block = 1
armor = list("melee" = 75, "bullet" = 5, "laser" = 0, "energy" = 0, "bomb" = 45, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
rad_insulation = RAD_NO_INSULATION
/obj/structure/window/full/plasmareinforced
name = "reinforced plasma window"
@@ -643,6 +649,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
max_integrity = 1000
explosion_block = 2
armor = list("melee" = 85, "bullet" = 20, "laser" = 0, "energy" = 0, "bomb" = 60, "bio" = 100, "rad" = 100, "fire" = 99, "acid" = 100)
rad_insulation = RAD_NO_INSULATION
/obj/structure/window/full/plasmareinforced/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
@@ -658,6 +665,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
reinf = TRUE
heat_resistance = 1600
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 25, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 100)
rad_insulation = RAD_HEAVY_INSULATION
explosion_block = 1
glass_type = /obj/item/stack/sheet/rglass
cancolor = TRUE
@@ -707,6 +715,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
reinf = TRUE
heat_resistance = 1600
armor = list("melee" = 50, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 50, "bio" = 100, "rad" = 100, "fire" = 80, "acid" = 100)
rad_insulation = RAD_HEAVY_INSULATION
smooth = SMOOTH_TRUE
canSmoothWith = null
explosion_block = 3