mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Copies extinguisher code to exosuit extinguisher, fixes #7603
This commit is contained in:
@@ -186,46 +186,51 @@
|
|||||||
if(get_dist(chassis, target)>2) return
|
if(get_dist(chassis, target)>2) return
|
||||||
set_ready_state(0)
|
set_ready_state(0)
|
||||||
if(do_after_cooldown(target))
|
if(do_after_cooldown(target))
|
||||||
if(istype(target, /obj/structure/reagent_dispensers/watertank) && get_dist(chassis,target) <= 1)
|
if( istype(target, /obj/structure/reagent_dispensers/watertank) && get_dist(chassis,target) <= 1)
|
||||||
var/obj/o = target
|
var/obj/o = target
|
||||||
o.reagents.trans_to(src, 200)
|
o.reagents.trans_to(src, 200)
|
||||||
occupant_message("\blue Extinguisher refilled")
|
occupant_message("\blue \The [src] is now refilled")
|
||||||
playsound(chassis, 'sound/effects/refill.ogg', 50, 1, -6)
|
playsound(chassis, 'sound/effects/refill.ogg', 50, 1, -6)
|
||||||
else
|
return
|
||||||
if(src.reagents.total_volume > 0)
|
|
||||||
playsound(chassis, 'sound/effects/extinguish.ogg', 75, 1, -3)
|
|
||||||
var/direction = get_dir(chassis,target)
|
|
||||||
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)
|
if (src.reagents.total_volume < 1)
|
||||||
spawn(0)
|
occupant_message("\red \The [src] is empty.")
|
||||||
for(var/a=0, a<5, a++)
|
return
|
||||||
var/obj/effect/effect/water/W = new /obj/effect/effect/water(get_turf(chassis))
|
|
||||||
|
playsound(chassis, 'sound/effects/extinguish.ogg', 75, 1, -3)
|
||||||
|
|
||||||
|
var/direction = get_dir(chassis,target)
|
||||||
|
|
||||||
|
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=0, a<5, a++)
|
||||||
|
spawn(0)
|
||||||
|
var/obj/effect/effect/water/W = new /obj/effect/effect/water( get_turf(chassis) )
|
||||||
|
var/turf/my_target = pick(the_targets)
|
||||||
|
var/datum/reagents/R = new/datum/reagents(5)
|
||||||
|
if(!W) return
|
||||||
|
W.reagents = R
|
||||||
|
R.my_atom = W
|
||||||
|
if(!W || !src) return
|
||||||
|
src.reagents.trans_to(W,1)
|
||||||
|
for(var/b=0, b<5, b++)
|
||||||
|
step_towards(W,my_target)
|
||||||
|
if(!W || !W.reagents) return
|
||||||
|
W.reagents.reaction(get_turf(W))
|
||||||
|
for(var/atom/atm in get_turf(W))
|
||||||
if(!W)
|
if(!W)
|
||||||
return
|
return
|
||||||
var/turf/my_target = pick(the_targets)
|
if(!W.reagents)
|
||||||
var/datum/reagents/R = new/datum/reagents(5)
|
break
|
||||||
W.reagents = R
|
W.reagents.reaction(atm)
|
||||||
R.my_atom = W
|
if(W.loc == my_target) break
|
||||||
src.reagents.trans_to(W,1)
|
sleep(2)
|
||||||
for(var/b=0, b<4, b++)
|
W.delete()
|
||||||
if(!W)
|
return 1
|
||||||
return
|
|
||||||
step_towards(W,my_target)
|
|
||||||
if(!W)
|
|
||||||
return
|
|
||||||
if(!W.reagents)
|
|
||||||
break
|
|
||||||
var/turf/W_turf = get_turf(W)
|
|
||||||
W.reagents.reaction(W_turf)
|
|
||||||
for(var/atom/atm in W_turf)
|
|
||||||
W.reagents.reaction(atm)
|
|
||||||
if(W.loc == my_target)
|
|
||||||
break
|
|
||||||
sleep(2)
|
|
||||||
return 1
|
|
||||||
|
|
||||||
get_equip_info()
|
get_equip_info()
|
||||||
return "[..()] \[[src.reagents.total_volume]\]"
|
return "[..()] \[[src.reagents.total_volume]\]"
|
||||||
@@ -1100,7 +1105,7 @@
|
|||||||
set category = "Exosuit Interface"
|
set category = "Exosuit Interface"
|
||||||
set src = usr.loc
|
set src = usr.loc
|
||||||
set popup_menu = 0
|
set popup_menu = 0
|
||||||
|
|
||||||
if(usr != occupant)
|
if(usr != occupant)
|
||||||
return
|
return
|
||||||
occupant << "You climb out from \the [src]."
|
occupant << "You climb out from \the [src]."
|
||||||
@@ -1131,7 +1136,7 @@
|
|||||||
if(occupant)
|
if(occupant)
|
||||||
occupant_message("Unable to detach [src] - equipment occupied.")
|
occupant_message("Unable to detach [src] - equipment occupied.")
|
||||||
return
|
return
|
||||||
|
|
||||||
var/obj/mecha/M = chassis
|
var/obj/mecha/M = chassis
|
||||||
..()
|
..()
|
||||||
if (M && !(locate(/obj/item/mecha_parts/mecha_equipment/tool/passenger) in M))
|
if (M && !(locate(/obj/item/mecha_parts/mecha_equipment/tool/passenger) in M))
|
||||||
@@ -1147,7 +1152,7 @@
|
|||||||
occupant_message("Passenger compartment hatch [door_locked? "locked" : "unlocked"].")
|
occupant_message("Passenger compartment hatch [door_locked? "locked" : "unlocked"].")
|
||||||
if (chassis)
|
if (chassis)
|
||||||
chassis.visible_message("The hatch on \the [chassis] [door_locked? "locks" : "unlocks"].", "You hear something latching.")
|
chassis.visible_message("The hatch on \the [chassis] [door_locked? "locks" : "unlocks"].", "You hear something latching.")
|
||||||
|
|
||||||
|
|
||||||
#define LOCKED 1
|
#define LOCKED 1
|
||||||
#define OCCUPIED 2
|
#define OCCUPIED 2
|
||||||
@@ -1161,20 +1166,20 @@
|
|||||||
//check that usr can climb in
|
//check that usr can climb in
|
||||||
if (usr.stat || !ishuman(usr))
|
if (usr.stat || !ishuman(usr))
|
||||||
return
|
return
|
||||||
|
|
||||||
if (!usr.Adjacent(src))
|
if (!usr.Adjacent(src))
|
||||||
return
|
return
|
||||||
|
|
||||||
if (!isturf(usr.loc))
|
if (!isturf(usr.loc))
|
||||||
usr << "\red You can't reach the passenger compartment from here."
|
usr << "\red You can't reach the passenger compartment from here."
|
||||||
return
|
return
|
||||||
|
|
||||||
if(iscarbon(usr))
|
if(iscarbon(usr))
|
||||||
var/mob/living/carbon/C = usr
|
var/mob/living/carbon/C = usr
|
||||||
if(C.handcuffed)
|
if(C.handcuffed)
|
||||||
usr << "\red Kinda hard to climb in while handcuffed don't you think?"
|
usr << "\red Kinda hard to climb in while handcuffed don't you think?"
|
||||||
return
|
return
|
||||||
|
|
||||||
for(var/mob/living/carbon/slime/M in range(1,usr))
|
for(var/mob/living/carbon/slime/M in range(1,usr))
|
||||||
if(M.Victim == usr)
|
if(M.Victim == usr)
|
||||||
usr << "\red You're too busy getting your life sucked out of you."
|
usr << "\red You're too busy getting your life sucked out of you."
|
||||||
@@ -1189,11 +1194,11 @@
|
|||||||
if (P.door_locked)
|
if (P.door_locked)
|
||||||
feedback |= LOCKED
|
feedback |= LOCKED
|
||||||
continue
|
continue
|
||||||
|
|
||||||
//found a boardable compartment
|
//found a boardable compartment
|
||||||
P.move_inside(usr)
|
P.move_inside(usr)
|
||||||
return
|
return
|
||||||
|
|
||||||
//didn't find anything
|
//didn't find anything
|
||||||
switch (feedback)
|
switch (feedback)
|
||||||
if (OCCUPIED)
|
if (OCCUPIED)
|
||||||
|
|||||||
Reference in New Issue
Block a user