Files
VOREStation/code/game/objects/items/weapons/extinguisher.dm
T
Cameron Lennox d5849910e5 Begin clickcode attack_self fix (#18797)
* Begin clickcode attack_self fix

Begins the work to make everything call back to parent for attack_self so that signals are sacred.

* Makes MORE things call the attack_self() parent

Yes, I could make special_handling a var on obj/item HOWEVER i want it to be specific so it can be tracked down later and ONLY the objects that use it can be refactored instead of sitting there literally forever and it just becoming 'a thing'.

* Finishes making the rest of attack_self call parent.

As mentioned, things such as 'specialty_goggles' 'special_handling' and the such are only there to help with attack_self until the attack_self is recoded for those items.

* begone foul demon

* some more cleanup

* These

* GOD this was annoying

* yeh

* Fix this

* fLARES

* Thesee too

* toys!

* Even more!

* More fixes

* Even more

* rest of em

* these too

* Update syndie.dm

* hardref clear

* Update code/game/gamemodes/nuclear/pinpointer.dm

* Update code/game/objects/effects/mines.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/blueprints_vr.dm

* Update code/game/objects/items/contraband_vr.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/gunbox_vr.dm

* Update code/game/objects/items/weapons/gift_wrappaper.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/crayons.dm

* Update code/game/objects/items/gunbox.dm

* these too

* Update maintpanel_stack.dm

* angry warning

* Fixes packaged snacks.

Fixes improper var default.

* Special handling for these

* proper poly types

* Fixes magclaws

Makes the 'features' it had just part  of base magboots that can be adjusted via varswap.

* Fixes jackets

Fixes https://github.com/VOREStation/VOREStation/issues/18941

* Small bugfix

Makes p_Theyre properly capitialize
Makes examine show proper wording

* Update gift_wrappaper.dm
2025-12-29 13:21:10 -05:00

148 lines
4.1 KiB
Plaintext

/obj/item/extinguisher
name = "fire extinguisher"
desc = "A traditional red fire extinguisher."
icon = 'icons/obj/items.dmi'
icon_state = "fire_extinguisher0"
item_state = "fire_extinguisher"
hitsound = 'sound/weapons/smash.ogg'
throwforce = 10
w_class = ITEMSIZE_NORMAL
throw_speed = 2
throw_range = 10
force = 10
matter = list(MAT_STEEL = 90)
attack_verb = list("slammed", "whacked", "bashed", "thunked", "battered", "bludgeoned", "thrashed")
drop_sound = 'sound/items/drop/gascan.ogg'
pickup_sound = 'sound/items/pickup/gascan.ogg'
var/spray_particles = 3
var/spray_amount = 10 //units of liquid per particle
var/max_water = 300
var/last_use = 1.0
var/safety = 1
var/sprite_name = "fire_extinguisher"
var/rand_overlays = 6
/obj/item/extinguisher/mini
name = "fire extinguisher"
desc = "A light and compact fibreglass-framed model fire extinguisher."
icon_state = "miniFE0"
item_state = "miniFE"
hitsound = null //it is much lighter, after all.
throwforce = 2
w_class = ITEMSIZE_SMALL
force = 3.0
max_water = 150
spray_particles = 3
sprite_name = "miniFE"
rand_overlays = 0
/obj/item/extinguisher/atmo
name = "atmospheric fire extinguisher"
desc = "A heavy duty fire extinguisher meant to fight large fires."
icon_state = "atmos_extinguisher0"
item_state = "atmos_extinguisher"
throwforce = 12
force = 12
w_class = ITEMSIZE_LARGE
max_water = 600
spray_particles = 3
sprite_name = "atmos_extinguisher"
rand_overlays = 0
/obj/item/extinguisher/Initialize(mapload)
create_reagents(max_water)
reagents.add_reagent(REAGENT_ID_FIREFOAM, max_water)
if(rand_overlays)
var/choice = rand(1,rand_overlays)
add_overlay("[item_state]O[choice]")
. = ..()
/obj/item/extinguisher/examine(mob/user)
. = ..()
if(get_dist(user, src) == 0)
. += "[src] has [src.reagents.total_volume] units of foam left!"
/obj/item/extinguisher/attack_self(mob/user)
. = ..(user)
if(.)
return TRUE
safety = !safety
icon_state = "[sprite_name][!safety]"
desc = "The safety is [safety ? "on" : "off"]."
to_chat(user, "The safety is [safety ? "on" : "off"].")
/obj/item/extinguisher/proc/propel_object(var/obj/O, mob/user, movementdirection)
if(O.anchored) return
var/obj/structure/bed/chair/C
if(istype(O, /obj/structure/bed/chair))
C = O
var/list/move_speed = list(1, 1, 1, 2, 2, 3)
for(var/i in 1 to 6)
if(C) C.propelled = (6-i)
O.Move(get_step(user,movementdirection), movementdirection)
sleep(move_speed[i])
//additional movement
for(var/i in 1 to 3)
O.Move(get_step(user,movementdirection), movementdirection)
sleep(3)
/obj/item/extinguisher/afterattack(var/atom/target, var/mob/user, var/flag)
//TODO; Add support for reagents in water.
if( istype(target, /obj/structure/reagent_dispensers) && flag)
var/obj/o = target
var/amount = o.reagents.trans_to_obj(src, 50)
to_chat(user, span_notice("You fill [src] with [amount] units of the contents of [target]."))
playsound(src, 'sound/effects/refill.ogg', 50, 1, -6)
return
if (!safety)
if (src.reagents.total_volume < 1)
to_chat(user, span_notice("\The [src] is empty."))
return
if (world.time < src.last_use + 20)
return
src.last_use = world.time
playsound(src, 'sound/effects/extinguish.ogg', 75, 1, -3)
var/direction = get_dir(src,target)
if(user.buckled && isobj(user.buckled))
spawn(0)
propel_object(user.buckled, user, turn(direction,180))
var/turf/T = get_turf(target)
var/turf/T1 = get_step(T,turn(direction, 90))
var/turf/T2 = get_step(T,turn(direction, -90))
var/list/the_targets = list(T,T1,T2)
for(var/a = 1 to spray_particles)
spawn(0)
if(!src || !reagents.total_volume) return
var/obj/effect/effect/water/W = new /obj/effect/effect/water(get_turf(src))
var/turf/my_target
if(a <= the_targets.len)
my_target = the_targets[a]
else
my_target = pick(the_targets)
W.create_reagents(spray_amount)
reagents.trans_to_obj(W, spray_amount)
W.set_color()
W.set_up(my_target)
if((istype(user.loc, /turf/space)) || (user.lastarea.get_gravity() == 0))
user.inertia_dir = get_dir(target, user)
step(user, user.inertia_dir)
else
return ..()
return