Extinguisher + Container Reworks (#4793)

Reworked how slipping on tiles work. If there is too much lube/water on one tile, it will spread to all adjacent tiles.

Fixed a potential bug where spilling copious amounts of water on a tile will turn it to ice.

Containers are much more saner now. They all share a standard system, unless specified.

You can drink from any open holdable container using help intent. You can splash the contents of the container on anything via harm intent.

Sinks are more saner, you can refill or empty them easier with various refill amounts.

Removed silly exclusive cyborg limb checking for hyposprays.

Added a new chemsprayer, the "Xenoblaster" which is a significantly weaker chem sprayer. Two can be found in xenobiology.

Large reagent containers (beer kegs, water tanks, fuel tanks) now share a system together. Both can leak their reagents via harm intent with a wrench, and bother can accept any sort of reagent, with exception to the fuel tank.

Large reagent container leaking happens over time as opposed to just leaking every time it moves.

New chemical, Monoammonium phosphate. Monoammonium phosphate is a fertilizer and also a potent fire extinguishing and preventing chemical. It can be made with 1 part ammonia, 1 part sulfuric acid, 1 part sodium, 1 part phosphorus.

All extinguishers now have monoammonium phosphate in them instead of water.

Extinguishers can hold any reagent, however they must be filled using an extinguisher refiller cartridge. These can be ordered or found in atmospherics.

Nerfed the extinguisher range so it only sprays in a 3x3 radius.

Mini-extinguishers spray in a 1x1 radius.

Adds Monoammonium phosphate containers across the station.

Most watertanks are replaced with Monoammonium phosphate containers.
This commit is contained in:
BurgerLUA
2018-08-05 20:14:00 +03:00
committed by Erki
parent 4cd7b99e43
commit 1620d81661
54 changed files with 820 additions and 523 deletions
+1 -1
View File
@@ -79,4 +79,4 @@
//used by evil things
/obj/effect/effect/water/firewater
name = "napalm gel"
icon_state = "mustard"
icon_state = "mustard"
@@ -107,4 +107,51 @@
var/sticky = min(rand(5,25), amount)
if(sticky > 1)
L.adjust_fire_stacks(sticky)
amount = max(1, amount - sticky)
amount = max(1, amount - sticky)
/obj/effect/decal/cleanable/foam //Copied from liquid fuel
name = "foam"
desc = "Some kind of extinguishing foam."
gender = PLURAL
density = 0
anchored = 1
layer = 2
icon = 'icons/effects/effects.dmi'
icon_state = "white_foam"
var/amount = 1
/obj/effect/decal/cleanable/foam/Initialize(mapload, amt = 1, nologs = 0)
src.amount = amt
var/has_spread = 0
//Be absorbed by any other liquid fuel in the tile.
for(var/obj/effect/decal/cleanable/foam/other in loc)
if(other != src)
other.amount += src.amount
other.Spread()
has_spread = 1
break
if(!has_spread)
Spread()
QDEL_IN(src, 2 MINUTES)
else
qdel(src)
/obj/effect/decal/cleanable/foam/proc/Spread(exclude=list())
if(amount < 15) return
var/turf/simulated/S = loc
if(!istype(S)) return
for(var/d in cardinal)
var/turf/simulated/target = get_step(src,d)
var/turf/simulated/origin = get_turf(src)
if(origin.CanPass(null, target, 0, 0) && target.CanPass(null, origin, 0, 0))
var/obj/effect/decal/cleanable/foam/other_foam = locate() in target
if(other_foam)
other_foam.amount += amount*0.25
if(!(other_foam in exclude))
exclude += src
other_foam.Spread(exclude)
else
new/obj/effect/decal/cleanable/foam(target, amount*0.25,1)
amount *= 0.75
+1 -1
View File
@@ -85,7 +85,7 @@
QDEL_IN(src, duration)
/obj/effect/overlay/temp/ex_act()
/obj/effect/overlay/temp/ex_act(var/severity = 2.0)
return
/obj/effect/overlay/temp/dir_setting
@@ -20,7 +20,7 @@
/obj/effect/temp_visual/singularity_pull()
return
/obj/effect/temp_visual/ex_act()
/obj/effect/temp_visual/ex_act(var/severity = 2.0)
return
/obj/effect/temp_visual/dir_setting
@@ -109,7 +109,7 @@
M << "<span class='warning'>Your chameleon-projector deactivates.</span>"
master.disrupt()
/obj/effect/dummy/chameleon/ex_act()
/obj/effect/dummy/chameleon/ex_act(var/severity = 2.0)
for(var/mob/M in src)
M << "<span class='warning'>Your chameleon-projector deactivates.</span>"
master.disrupt()
+102 -23
View File
@@ -1,3 +1,76 @@
/obj/item/weapon/reagent_containers/extinguisher_refill
name = "extinguisher refiller"
desc = "A one time use extinguisher refiller that allows fire extinguishers to be refilled with an aerosol mix. Just pour in the reagents and twist."
icon = 'icons/obj/items.dmi'
icon_state = "metal_canister"
item_state = "metal_canister"
hitsound = 'sound/weapons/smash.ogg'
flags = CONDUCT | OPENCONTAINER
throwforce = 8
w_class = 4.0 // Don't want to give people free bluespace beakers.
throw_speed = 2
throw_range = 10
force = 8
matter = list(DEFAULT_WALL_MATERIAL = 90)
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
amount_per_transfer_from_this = 300
possible_transfer_amounts = null
volume = 300
/obj/item/weapon/reagent_containers/extinguisher_refill/attackby(var/obj/O as obj, var/mob/user as mob)
if(istype(O,/obj/item/weapon/extinguisher))
var/obj/item/weapon/extinguisher/E = O
if(src.is_open_container())
to_chat(user,"<span class='notice'>\The [src] needs to be secured first!</span>")
else if(src.reagents.total_volume <= 0)
to_chat(user,"<span class='notice'>\The [src] is empty!</span>")
else if(E.reagents.total_volume < E.reagents.maximum_volume)
src.reagents.trans_to(E, src.reagents.total_volume)
user.visible_message("<span class='notice'>[user] fills \the [E] with the [src].</span>", "<span class='notice'>You fill \the [E] with the [src].</span>")
playsound(E.loc, 'sound/items/stimpack.ogg', 50, 1)
else
to_chat(user,"<span class='notice'>\The [E] is full!</span>")
return
. = ..()
/obj/item/weapon/reagent_containers/extinguisher_refill/attack_self(mob/user as mob) //Copied from inhalers.
if(is_open_container())
if(reagents && reagents.reagent_list.len)
to_chat(user,"<span class='notice'>With a quick twist of the cartridge's lid, you secure the reagents inside \the [src].</span>")
flags ^= OPENCONTAINER
else
to_chat(user,"<span class='notice'>You can't secure the cartridge without putting reagents in!</span>")
else
to_chat(user,"<span class='notice'>\The reagents inside [src] are already secured!</span>")
return
/obj/item/weapon/reagent_containers/extinguisher_refill/examine(var/mob/user) //Copied from inhalers.
if(!..(user, 2))
return
if(is_open_container())
if(reagents && reagents.reagent_list.len)
to_chat(user,"<span class='notice'>It contains [round(reagents.total_volume, accuracy)] units of non-aerosol mix.</span>")
else
to_chat(user,"<span class='notice'>It is empty.</span>")
else
if(reagents && reagents.reagent_list.len)
to_chat(user,"<span class='notice'>The reagents are secured in the aerosol mix.</span>")
else
to_chat(user,"<span class='notice'>The cartridge seems spent.</span>")
/obj/item/weapon/reagent_containers/extinguisher_refill/filled
name = "extinguisher refiller (monoammonium phosphate)"
desc = "A one time use extinguisher refiller that allows fire extinguishers to be refilled with an aerosol mix. This one is contains monoammonium phosphate."
/obj/item/weapon/reagent_containers/extinguisher_refill/filled/Initialize()
. =..()
reagents.add_reagent("monoammoniumphosphate", volume)
flags &= ~OPENCONTAINER
return
/obj/item/weapon/extinguisher
name = "fire extinguisher"
desc = "A traditional red fire extinguisher."
@@ -16,6 +89,7 @@
var/spray_particles = 3
var/spray_amount = 10 //units of liquid per particle
var/spray_distance = 3
var/max_water = 300
var/last_use = 1.0
var/safety = 1
@@ -27,21 +101,25 @@
icon_state = "miniFE0"
item_state = "miniFE"
hitsound = null //it is much lighter, after all.
flags = OPENCONTAINER
throwforce = 2
w_class = 2.0
force = 3.0
max_water = 150
spray_particles = 3
force = 2.0
max_water = 60
spray_amount = 10
spray_particles = 1
spray_distance = 1
sprite_name = "miniFE"
/obj/item/weapon/extinguisher/New()
create_reagents(max_water)
reagents.add_reagent("water", max_water)
reagents.add_reagent("monoammoniumphosphate", max_water)
..()
/obj/item/weapon/extinguisher/examine(mob/user)
if(..(user, 0))
user << text("\icon[] [] contains [] units of water left!", src, src.name, src.reagents.total_volume)
to_chat(user,"The [src] contains [src.reagents.total_volume] units of reagents.")
to_chat(user,"The safety is [safety ? "on" : "off"].")
return
/obj/item/weapon/extinguisher/attack_self(mob/user as mob)
@@ -51,6 +129,24 @@
user << "The safety is [safety ? "on" : "off"]."
return
/obj/item/weapon/extinguisher/attackby(var/obj/O as obj, var/mob/user as mob)
if(istype(O,/obj/item/weapon/reagent_containers/extinguisher_refill))
var/obj/item/weapon/reagent_containers/extinguisher_refill/ER = O
if(ER.is_open_container())
to_chat(user,"<span class='notice'>\The [ER] needs to be secured first!</span>")
else if(ER.reagents.total_volume <= 0)
to_chat(user,"<span class='notice'>\The [ER] is empty!</span>")
else if (src.reagents.total_volume < src.reagents.maximum_volume)
ER.reagents.trans_to(src, ER.reagents.total_volume)
user.visible_message("<span class='notice'>[user] fills \the [src] with the [ER].</span>", "<span class='notice'>You fill \the [src] with the [ER].</span>")
playsound(ER.loc, 'sound/items/stimpack.ogg', 50, 1)
else
to_chat(user,"<span class='notice'>\The [src] is full!</span>")
return
. = ..()
/obj/item/weapon/extinguisher/proc/propel_object(var/obj/O, mob/user, movementdirection)
if(O.anchored) return
@@ -70,23 +166,6 @@
sleep(3)
/obj/item/weapon/extinguisher/afterattack(var/atom/target, var/mob/user, var/flag)
//TODO; Add support for reagents in water.
if( istype(target, /obj/structure/reagent_dispensers/watertank) && flag)
var/obj/o = target
var/amount = o.reagents.trans_to_obj(src, 50)
if (src.reagents.total_volume == 300)
user << "<span class='danger'>The fire extinguisher is full!</span>"
return 0
if (o.reagents.total_volume < 1)
user << "<span class='danger'>There is nothing left in the [target].</span>"
return 0
else
user << "<span class='notice'>You fill [src] with [amount] units of the contents of [target].</span>"
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
return
if (!safety)
if (src.reagents.total_volume < 1)
@@ -125,7 +204,7 @@
W.create_reagents(spray_amount)
reagents.trans_to_obj(W, spray_amount)
W.set_color()
W.set_up(my_target)
W.set_up(my_target,spray_distance,3)
if((istype(usr.loc, /turf/space)) || (usr.lastarea.has_gravity() == 0))
user.inertia_dir = get_dir(target, user)
@@ -35,7 +35,7 @@
qdel(src)
return
/obj/item/weapon/a_gift/ex_act()
/obj/item/weapon/a_gift/ex_act(var/severity = 2.0)
qdel(src)
return
@@ -215,7 +215,7 @@
return
/obj/item/weapon/xmasgift/ex_act()
/obj/item/weapon/xmasgift/ex_act(var/severity = 2.0)
qdel(src)
return
@@ -304,7 +304,7 @@
/obj/item/weapon/grenade/chem_grenade/large/phoroncleaner
name = "large cardox grenade"
desc = "A large smoke grenade containing a heavy amount of cardox. Use in case of phoron leaks. Warning: Harmful to Vaurca health."
desc = "A large chemical grenade containing a heavy amount of cardox. Use in case of phoron leaks. Warning: Harmful to Vaurca health."
stage = 2
path = 1
@@ -347,3 +347,24 @@
beakers += B2
icon_state = initial(icon_state) +"_locked"
/obj/item/weapon/grenade/chem_grenade/monoammoniumphosphate
name = "extinguisher grenade"
desc = "BLAM!-brand foaming extinguisher. Incredibly useful for taking out large chemical fires at a distance."
stage = 2
path = 1
Initialize()
. = ..()
var/obj/item/weapon/reagent_containers/glass/beaker/B1 = new(src)
var/obj/item/weapon/reagent_containers/glass/beaker/B2 = new(src)
B1.reagents.add_reagent("surfactant", 40)
B1.reagents.add_reagent("monoammoniumphosphate", 20)
B2.reagents.add_reagent("water", 40)
B2.reagents.add_reagent("monoammoniumphosphate", 20)
detonator = new/obj/item/device/assembly_holder/timer_igniter(src)
beakers += B1
beakers += B2
icon_state = initial(icon_state) +"_locked"
+1 -1
View File
@@ -85,7 +85,7 @@
if(deployed)
trigger()
/obj/item/weapon/landmine/ex_act()
/obj/item/weapon/landmine/ex_act(var/severity = 2.0)
if(deployed)
trigger()
+1 -1
View File
@@ -342,7 +342,7 @@
message_admins("[key_name_admin(user)] triggered a fueltank explosion.")
log_game("[key_name(user)] triggered a fueltank explosion with a welding tool.",ckey=key_name(user))
user << span("alert", "That was stupid of you.")
tank.explode()
tank.ex_act(3.0)
return
else
tank.armed = 0
+1 -1
View File
@@ -244,7 +244,7 @@
healthcheck()
return 0
/obj/effect/energy_net/ex_act()
/obj/effect/energy_net/ex_act(var/severity = 2.0)
health = 0
healthcheck()
@@ -701,3 +701,11 @@
return pickweight(random_stock_uncommon)
if ("3")
return pickweight(random_stock_common)
/obj/structure/closet/crate/extinguisher_catridges
name = "crate of extinguisher cartridges"
desc = "Contains a dozen empty extinguisher cartridges."
/obj/structure/closet/crate/extinguisher_catridges/fill()
for(var/a = 1 to 12)
new /obj/item/weapon/reagent_containers/extinguisher_refill(src)
+1 -1
View File
@@ -91,7 +91,7 @@
desc = "It looks dead."
dead = 1
//No complex interactions, just make them fragile
/obj/structure/flora/pottedplant/ex_act()
/obj/structure/flora/pottedplant/ex_act(var/severity = 2.0)
death()
return ..()
+14 -4
View File
@@ -369,6 +369,16 @@
desc = "A sink used for washing one's hands and face."
anchored = 1
var/busy = 0 //Something's being washed at the moment
var/amount_per_transfer_from_this = 10
var/possible_transfer_amounts = list(5,10,15,25,30,50,60,100,120,250,300)
/obj/structure/sink/verb/set_APTFT() //set amount_per_transfer_from_this
set name = "Set transfer amount"
set category = "Object"
set src in view(1)
var/N = input("Amount per transfer from this:","[src]") as null|anything in possible_transfer_amounts
if (N)
amount_per_transfer_from_this = N
/obj/structure/sink/attack_hand(mob/user as mob)
if (ishuman(user))
@@ -427,7 +437,7 @@
usr << "<span class='warning'>\The [RG] is already full.</span>"
return
RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, RG.amount_per_transfer_from_this))
RG.reagents.add_reagent("water", min(RG.volume - RG.reagents.total_volume, amount_per_transfer_from_this))
oviewers(3, usr) << "<span class='notice'>[usr] fills \the [RG] using \the [src].</span>"
usr << "<span class='notice'>You fill \the [RG] using \the [src].</span>"
if ("Empty")
@@ -435,9 +445,9 @@
usr << "<span class='warning'>\The [RG] is already empty.</span>"
return
RG.reagents.clear_reagents()
oviewers(3, usr) << "<span class='notice'>[usr] empties \the [RG] into \the [src].</span>"
usr << "<span class='notice'>You empty \the [RG] into \the [src].</span>"
var/empty_amount = RG.reagents.trans_to(src, RG.amount_per_transfer_from_this)
oviewers(3, usr) << "<span class='notice'>[usr] empties [empty_amount]u of \the [RG] into \the [src].</span>"
usr << "<span class='notice'>You empty [empty_amount]u of \the [RG] into \the [src].</span>"
return
// Filling/empying Syringes
+1 -1
View File
@@ -525,7 +525,7 @@
/obj/structure/window/reinforced/crescent/attackby()
return
/obj/structure/window/reinforced/crescent/ex_act()
/obj/structure/window/reinforced/crescent/ex_act(var/severity = 2.0)
return
/obj/structure/window/reinforced/crescent/hitby()