Skip to content

Commit

Permalink
Take two at making ATMOS actually capable of fixing ATMOS in a timely…
Browse files Browse the repository at this point in the history
… manner
  • Loading branch information
Ergovisavi committed Jun 19, 2017
1 parent ce39cd3 commit 9f30277
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 38 deletions.
42 changes: 41 additions & 1 deletion code/game/objects/effects/effect_system/effects_foam.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,14 @@
metal = 1
icon_state = "mfoam"


/obj/effect/particle_effect/foam/metal/iron
name = "iron foam"
metal = 2

/obj/effect/particle_effect/foam/metal/resin
name = "resin foam"
metal = 3


/obj/effect/particle_effect/foam/New(loc)
..(loc)
Expand All @@ -49,6 +52,8 @@
new /obj/structure/foamedmetal(src.loc)
if(2)
new /obj/structure/foamedmetal/iron(src.loc)
if(3)
new /obj/structure/foamedmetal/resin(src.loc)
flick("[icon_state]-disolve", src)
QDEL_IN(src, 5)

Expand Down Expand Up @@ -230,3 +235,38 @@
obj_integrity = 50
max_integrity = 50
icon_state = "ironfoam"

//Atmos Backpack Resin, transparent, prevents atmos and filters the air
/obj/structure/foamedmetal/resin
name = "ATMOS Resin"
desc = "A lightweight, transparent resin used to suffocate fires, scrub the air of toxins, and restore the air to a safe temperature"
opacity = 0
icon_state = "atmos_resin"
alpha = 120
obj_integrity = 10
max_integrity = 10

/obj/structure/foamedmetal/resin/New()
if(isopenturf(loc))
var/turf/open/O = loc
if(O.air)
var/datum/gas_mixture/G = O.air
G.temperature = 293.15
for(var/obj/effect/hotspot/H in O)
qdel(H)
var/list/G_gases = G.gases
for(var/I in G_gases)
if(I != "o2")
G.gases[I][MOLES] = 0
G.garbage_collect()
O.air_update_turf()
for(var/obj/machinery/atmospherics/components/unary/U in O)
if(!isnull(U.welded) && !U.welded) //must be an unwelded vent pump or vent scrubber.
U.welded = 1
U.update_icon()
U.visible_message("<span class='danger'>[U] sealed shut!</span>")
for(var/mob/living/L in O)
L.ExtinguishMob()
for(var/obj/item/Item in O)
Item.extinguish()
..()
8 changes: 8 additions & 0 deletions code/game/objects/items/weapons/holosign_creator.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,14 @@
creation_time = 30
max_signs = 6

/obj/item/weapon/holosign_creator/atmos
name = "ATMOS holofan projector"
desc = "A holographic projector that creates holographic barriers that prevent changes in atmosphere conditions."
icon_state = "signmaker_engi"
holosign_type = /obj/structure/holosign/barrier/atmos
creation_time = 0
max_signs = 3

/obj/item/weapon/holosign_creator/cyborg
name = "Energy Barrier Projector"
desc = "A holographic projector that creates fragile energy fields"
Expand Down
66 changes: 31 additions & 35 deletions code/game/objects/items/weapons/tanks/watertank.dm
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,16 @@
//ATMOS FIRE FIGHTING BACKPACK

#define EXTINGUISHER 0
#define NANOFROST 1
#define METAL_FOAM 2
#define RESIN_LAUNCHER 1
#define RESIN_FOAM 2

/obj/item/weapon/watertank/atmos
name = "backpack firefighter tank"
desc = "A refridgerated and pressurized backpack tank with extinguisher nozzle, intended to fight fires. Swaps between extinguisher, nanofrost launcher, and metal foam dispenser for breaches. Nanofrost converts plasma in the air to nitrogen, but only if it is combusting at the time."
icon_state = "waterbackpackatmos"
desc = "A refridgerated and pressurized backpack tank with extinguisher nozzle, intended to fight fires. Swaps between extinguisher, resin launcher and a smaller scale resin foamer."
item_state = "waterbackpackatmos"
icon_state = "waterbackpackatmos"
volume = 200
slowdown = 0

/obj/item/weapon/watertank/atmos/New()
..()
Expand Down Expand Up @@ -218,7 +219,7 @@
var/obj/item/weapon/watertank/tank
var/nozzle_mode = 0
var/metal_synthesis_cooldown = 0
var/nanofrost_cooldown = 0
var/resin_cooldown = 0

/obj/item/weapon/extinguisher/mini/nozzle/New(parent_tank)
..()
Expand All @@ -238,16 +239,16 @@
/obj/item/weapon/extinguisher/mini/nozzle/attack_self(mob/user)
switch(nozzle_mode)
if(EXTINGUISHER)
nozzle_mode = NANOFROST
nozzle_mode = RESIN_LAUNCHER
tank.icon_state = "waterbackpackatmos_1"
to_chat(user, "Swapped to nanofrost launcher")
to_chat(user, "Swapped to resin launcher")
return
if(NANOFROST)
nozzle_mode = METAL_FOAM
if(RESIN_LAUNCHER)
nozzle_mode = RESIN_FOAM
tank.icon_state = "waterbackpackatmos_2"
to_chat(user, "Swapped to metal foam synthesizer")
to_chat(user, "Swapped to resin foamer")
return
if(METAL_FOAM)
if(RESIN_FOAM)
nozzle_mode = EXTINGUISHER
tank.icon_state = "waterbackpackatmos_0"
to_chat(user, "Swapped to water extinguisher")
Expand All @@ -267,64 +268,59 @@
var/Adj = user.Adjacent(target)
if(Adj)
AttemptRefill(target, user)
if(nozzle_mode == NANOFROST)
if(nozzle_mode == RESIN_LAUNCHER)
if(Adj)
return //Safety check so you don't blast yourself trying to refill your tank
var/datum/reagents/R = reagents
if(R.total_volume < 100)
to_chat(user, "<span class='warning'>You need at least 100 units of water to use the nanofrost launcher!</span>")
to_chat(user, "<span class='warning'>You need at least 100 units of water to use the resin launcher!</span>")
return
if(nanofrost_cooldown)
to_chat(user, "<span class='warning'>Nanofrost launcher is still recharging...</span>")
if(resin_cooldown)
to_chat(user, "<span class='warning'>Resin launcher is still recharging...</span>")
return
nanofrost_cooldown = 1
resin_cooldown = 1
R.remove_any(100)
var/obj/effect/nanofrost_container/A = new /obj/effect/nanofrost_container(get_turf(src))
log_game("[user.ckey] ([user.name]) used Nanofrost at [get_area(user)] ([user.x], [user.y], [user.z]).")
var/obj/effect/resin_container/A = new /obj/effect/resin_container(get_turf(src))
log_game("[user.ckey] ([user.name]) used Resin Launcher at [get_area(user)] ([user.x], [user.y], [user.z]).")
playsound(src,'sound/items/syringeproj.ogg',40,1)
for(var/a=0, a<5, a++)
step_towards(A, target)
sleep(2)
A.Smoke()
spawn(100)
if(src)
nanofrost_cooldown = 0
resin_cooldown = 0
return
if(nozzle_mode == METAL_FOAM)
if(nozzle_mode == RESIN_FOAM)
if(!Adj|| !isturf(target))
return
if(metal_synthesis_cooldown < 5)
var/obj/effect/particle_effect/foam/metal/F = new /obj/effect/particle_effect/foam/metal(get_turf(target))
var/obj/effect/particle_effect/foam/metal/F = new /obj/effect/particle_effect/foam/metal/resin(get_turf(target))
F.amount = 0
metal_synthesis_cooldown++
spawn(100)
metal_synthesis_cooldown--
else
to_chat(user, "<span class='warning'>Metal foam mix is still being synthesized...</span>")
to_chat(user, "<span class='warning'>Resin foam mix is still being synthesized...</span>")
return

/obj/effect/nanofrost_container
name = "nanofrost container"
desc = "A frozen shell of ice containing nanofrost that freezes the surrounding area after activation."
/obj/effect/resin_container
name = "resin container"
desc = "A compacted ball of expansive resin, used to repair the atmosphere in a room, or seal off breaches."
icon = 'icons/effects/effects.dmi'
icon_state = "frozen_smoke_capsule"
mouse_opacity = 0
pass_flags = PASSTABLE

/obj/effect/nanofrost_container/proc/Smoke()
var/datum/effect_system/smoke_spread/freezing/S = new
S.set_up(2, src.loc, blasting=1)
S.start()
var/obj/effect/decal/cleanable/flour/F = new /obj/effect/decal/cleanable/flour(src.loc)
F.add_atom_colour("#B2FFFF", FIXED_COLOUR_PRIORITY)
F.name = "nanofrost residue"
F.desc = "Residue left behind from a nanofrost detonation. Perhaps there was a fire here?"
/obj/effect/resin_container/proc/Smoke()
var/obj/effect/particle_effect/foam/metal/resin/S = new /obj/effect/particle_effect/foam/metal/resin(get_turf(loc))
S.amount = 3
playsound(src,'sound/effects/bamf.ogg',100,1)
qdel(src)

#undef EXTINGUISHER
#undef NANOFROST
#undef METAL_FOAM
#undef resin
#undef RESIN_FOAM

/obj/item/weapon/reagent_containers/chemtank
name = "backpack chemical injector"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
new /obj/item/clothing/gloves/color/yellow(src)
new /obj/item/clothing/gloves/color/yellow(src)
new /obj/item/weapon/inducer(src)
new /obj/item/weapon/inducer(src)
new /obj/item/weapon/inducer(src)
for(var/i in 1 to 3)
new /obj/item/weapon/storage/toolbox/electrical(src)
for(var/i in 1 to 3)
Expand Down Expand Up @@ -88,7 +88,7 @@
new /obj/item/weapon/storage/toolbox/mechanical(src)
new /obj/item/weapon/tank/internals/emergency_oxygen/engi(src)
new /obj/item/device/analyzer(src)
new /obj/item/weapon/holosign_creator/engineering(src)
new /obj/item/weapon/holosign_creator/atmos(src)
new /obj/item/weapon/watertank/atmos(src)
new /obj/item/clothing/suit/fire/atmos(src)
new /obj/item/clothing/head/hardhat/atmos(src)
Expand Down
18 changes: 18 additions & 0 deletions code/game/objects/structures/holosign.dm
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,24 @@
/obj/structure/holosign/barrier/engineering
icon_state = "holosign_engi"

/obj/structure/holosign/barrier/atmos
name = "holo atmospheric fan"
desc = "A holographic fan that acts as a barrier for atmospheric changes."
icon_state = "holo_fan"
density = FALSE
anchored = 1
CanAtmosPass = ATMOS_PASS_NO
layer = ABOVE_NORMAL_TURF_LAYER

/obj/structure/holosign/barrier/atmos/New()
..()
air_update_turf(1)

/obj/structure/holosign/barrier/atmos/Destroy()
CanAtmosPass = ATMOS_PASS_YES
air_update_turf(1)
return ..()

/obj/structure/holosign/barrier/cyborg
name = "Energy Field"
desc = "A fragile energy field that blocks movement. Excels at blocking lethal projectiles."
Expand Down
Binary file modified icons/effects/effects.dmi
Binary file not shown.

0 comments on commit 9f30277

Please sign in to comment.