mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-19 02:54:41 +01:00
Bug fixes, add atmos watertank
This commit is contained in:
@@ -11,6 +11,17 @@ would spawn and follow the beaker, even if it is carried or thrown.
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
mouse_opacity = 0
|
||||
unacidable = 1//So effect are not targeted by alien acid.
|
||||
|
||||
/datum/effect/effect/proc/fadeOut(var/atom/A, var/frames = 16)
|
||||
if(A.alpha == 0) //Handle already transparent case
|
||||
return
|
||||
if(frames == 0)
|
||||
frames = 1 //We will just assume that by 0 frames, the coder meant "during one frame".
|
||||
var/step = A.alpha / frames
|
||||
for(var/i = 0, i < frames, i++)
|
||||
A.alpha -= step
|
||||
sleep(world.tick_lag)
|
||||
return
|
||||
|
||||
/obj/effect/effect/water
|
||||
name = "water"
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/obj/item/weapon/extinguisher
|
||||
name = "fire extinguisher"
|
||||
desc = "A traditional red fire extinguisher."
|
||||
@@ -18,19 +17,17 @@
|
||||
var/last_use = 1.0
|
||||
var/safety = 1
|
||||
var/sprite_name = "fire_extinguisher"
|
||||
|
||||
reagents_to_log=list(
|
||||
"plasma"= "plasma",
|
||||
"pacid" = "polytrinic acid",
|
||||
"sacid" = "sulphuric acid"
|
||||
)
|
||||
var/power = 5 //Maximum distance launched water will travel
|
||||
var/precision = 0 //By default, turfs picked from a spray are random, set to 1 to make it always have at least one water effect per row
|
||||
var/cooling_power = 2 //Sets the cooling_temperature of the water reagent datum inside of the extinguisher when it is refilled
|
||||
|
||||
/obj/item/weapon/extinguisher/mini
|
||||
name = "fire extinguisher"
|
||||
name = "pocket 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.
|
||||
flags = null //doesn't CONDUCT
|
||||
throwforce = 2
|
||||
w_class = 2.0
|
||||
force = 3.0
|
||||
@@ -39,22 +36,8 @@
|
||||
sprite_name = "miniFE"
|
||||
|
||||
/obj/item/weapon/extinguisher/New()
|
||||
var/datum/reagents/R = new/datum/reagents(max_water)
|
||||
reagents = R
|
||||
R.my_atom = src
|
||||
R.add_reagent("water", max_water)
|
||||
|
||||
/obj/item/weapon/extinguisher/examine()
|
||||
set src in usr
|
||||
|
||||
usr << "\icon[src] [src.name] contains:"
|
||||
if(reagents && reagents.reagent_list.len)
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
usr << "\blue [R.volume] units of [R.name]"
|
||||
for(var/thing in src)
|
||||
usr << "\red \A [thing] is jammed into the nozzle!"
|
||||
..()
|
||||
return
|
||||
create_reagents(max_water)
|
||||
reagents.add_reagent("water", max_water)
|
||||
|
||||
/obj/item/weapon/extinguisher/attack_self(mob/user as mob)
|
||||
safety = !safety
|
||||
@@ -63,81 +46,43 @@
|
||||
user << "The safety is [safety ? "on" : "off"]."
|
||||
return
|
||||
|
||||
/*
|
||||
/obj/item/weapon/extinguisher/attackby(obj/item/W, mob/user, params)
|
||||
if(user.stat || user.restrained() || user.lying) return
|
||||
|
||||
if (istype(W, /obj/item/weapon/wrench))
|
||||
if(!is_open_container())
|
||||
user.visible_message("[user] begins to unwrench the fill cap on \the [src].","\blue You begin to unwrench the fill cap on \the [src].")
|
||||
if(do_after(user, 25))
|
||||
user.visible_message("[user] removes the fill cap on \the [src].","\blue You remove the fill cap on \the [src].")
|
||||
playsound(get_turf(src),'sound/items/Ratchet.ogg', 100, 1)
|
||||
flags |= OPENCONTAINER
|
||||
/obj/item/weapon/extinguisher/proc/AttemptRefill(atom/target, mob/user)
|
||||
if(istype(target, /obj/structure/reagent_dispensers/watertank) && target.Adjacent(user))
|
||||
var/safety_save = safety
|
||||
safety = 1
|
||||
if(reagents.total_volume == reagents.maximum_volume)
|
||||
user << "<span class='notice'>\The [src] is already full!</span>"
|
||||
safety = safety_save
|
||||
return 1
|
||||
var/obj/structure/reagent_dispensers/watertank/W = target
|
||||
var/transferred = W.reagents.trans_to(src, max_water)
|
||||
if(transferred > 0)
|
||||
user << "<span class='notice'>\The [src] has been refilled by [transferred] units</span>"
|
||||
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
|
||||
for(var/datum/reagent/water/R in reagents.reagent_list)
|
||||
R.cooling_temperature = cooling_power
|
||||
else
|
||||
user.visible_message("[user] begins to seal the fill cap on \the [src].","\blue You begin to seal the fill cap on \the [src].")
|
||||
if(do_after(user, 25))
|
||||
user.visible_message("[user] fastens the fill cap on \the [src].","\blue You fasten the fill cap on \the [src].")
|
||||
playsound(get_turf(src),'sound/items/Ratchet.ogg', 100, 1)
|
||||
flags &= ~OPENCONTAINER
|
||||
return
|
||||
|
||||
if (istype(W, /obj/item) && !is_open_container())
|
||||
if(W.w_class>1)
|
||||
user << "\The [W] won't fit into the nozzle!"
|
||||
return
|
||||
if(locate(/obj) in src)
|
||||
user << "There's already something crammed into the nozzle."
|
||||
return
|
||||
user.drop_item()
|
||||
W.loc=src
|
||||
user << "You cram \the [W] into the nozzle of \the [src]."
|
||||
msg_admin_attack("[user]/[user.ckey] has crammed \a [W] into a [src].")
|
||||
*/
|
||||
|
||||
user << "<span class='notice'>\The [W] is empty!</span>"
|
||||
safety = safety_save
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/item/weapon/extinguisher/afterattack(atom/target, mob/user , flag)
|
||||
if(get_dist(src,target) <= 1)
|
||||
if((istype(target, /obj/structure/reagent_dispensers)))
|
||||
var/obj/o = target
|
||||
var/list/badshit=list()
|
||||
for(var/bad_reagent in src.reagents_to_log)
|
||||
if(o.reagents.has_reagent(bad_reagent))
|
||||
badshit += reagents_to_log[bad_reagent]
|
||||
if(badshit.len)
|
||||
var/hl="\red <b>([english_list(badshit)])</b> \black"
|
||||
message_admins("[user.name] ([user.ckey]) filled \a [src] with [o.reagents.get_reagent_ids()] [hl]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
log_game("[user.name] ([user.ckey]) filled \a [src] with [o.reagents.get_reagent_ids()] [hl]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
o.reagents.trans_to(src, 50)
|
||||
user << "\blue \The [src] is now refilled"
|
||||
playsound(src.loc, 'sound/effects/refill.ogg', 50, 1, -6)
|
||||
return
|
||||
|
||||
if(is_open_container() && reagents.total_volume)
|
||||
user << "\blue You empty \the [src] onto [target]."
|
||||
if(reagents.has_reagent("fuel"))
|
||||
message_admins("[user.name] ([user.ckey]) poured Welder Fuel onto [target]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
log_game("[user.name] ([user.ckey]) poured Welder Fuel onto [target]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
src.reagents.reaction(target, TOUCH)
|
||||
spawn(5) src.reagents.clear_reagents()
|
||||
return
|
||||
if (!safety && !is_open_container())
|
||||
//TODO; Add support for reagents in water.
|
||||
if(target.loc == user)//No more spraying yourself when putting your extinguisher away
|
||||
return
|
||||
var/Refill = AttemptRefill(target, user)
|
||||
if(Refill)
|
||||
return
|
||||
if (!safety)
|
||||
if (src.reagents.total_volume < 1)
|
||||
usr << "\red \The [src] is empty."
|
||||
usr << "<span class='danger'>\The [src] is empty.</span>"
|
||||
return
|
||||
|
||||
if (world.time < src.last_use + 20)
|
||||
return
|
||||
|
||||
var/list/badshit=list()
|
||||
for(var/bad_reagent in src.reagents_to_log)
|
||||
if(reagents.has_reagent(bad_reagent))
|
||||
badshit += reagents_to_log[bad_reagent]
|
||||
if(badshit.len)
|
||||
var/hl="\red <b>([english_list(badshit)])</b> \black"
|
||||
message_admins("[user.name] ([user.ckey]) used \a [src] filled with [reagents.get_reagent_ids(1)] [hl]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
log_game("[user.name] ([user.ckey]) used \a [src] filled with [reagents.get_reagent_ids(1)] [hl]. (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[user.x];Y=[user.y];Z=[user.z]'>JMP</a>)")
|
||||
|
||||
src.last_use = world.time
|
||||
|
||||
playsound(src.loc, 'sound/effects/extinguish.ogg', 75, 1, -3)
|
||||
@@ -146,27 +91,19 @@
|
||||
|
||||
if(usr.buckled && isobj(usr.buckled) && !usr.buckled.anchored )
|
||||
spawn(0)
|
||||
var/obj/structure/stool/bed/chair/C = null
|
||||
if(istype(usr.buckled, /obj/structure/stool/bed/chair))
|
||||
C = usr.buckled
|
||||
var/obj/B = usr.buckled
|
||||
var/movementdirection = turn(direction,180)
|
||||
if(C) C.propelled = 4
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
sleep(1)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
if(C) C.propelled = 3
|
||||
sleep(1)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
sleep(1)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
if(C) C.propelled = 2
|
||||
sleep(2)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
if(C) C.propelled = 1
|
||||
sleep(2)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
if(C) C.propelled = 0
|
||||
sleep(3)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
sleep(3)
|
||||
@@ -174,16 +111,6 @@
|
||||
sleep(3)
|
||||
B.Move(get_step(usr,movementdirection), movementdirection)
|
||||
|
||||
if(locate(/obj) in src)
|
||||
for(var/obj/thing in src)
|
||||
thing.loc = get_turf(src)
|
||||
thing.throw_at(target,thing.throw_range*2,throw_speed*2)
|
||||
user.visible_message(
|
||||
"<span class='danger'>[user] fires [src] and launches [thing] at [target]!</span>",
|
||||
"<span class='danger'>You fire [src] and launch [thing] at [target]!</span>")
|
||||
break
|
||||
|
||||
|
||||
var/turf/T = get_turf(target)
|
||||
var/turf/T1 = get_step(T,turn(direction, 90))
|
||||
var/turf/T2 = get_step(T,turn(direction, -90))
|
||||
@@ -202,21 +129,20 @@
|
||||
src.reagents.trans_to(W,1)
|
||||
for(var/b=0, b<5, b++)
|
||||
step_towards(W,my_target)
|
||||
if(!W) return
|
||||
if(!W.reagents) return
|
||||
if(!W || !W.reagents) return
|
||||
W.reagents.reaction(get_turf(W))
|
||||
for(var/atom/atm in get_turf(W))
|
||||
if(!W) return
|
||||
W.reagents.reaction(atm, TOUCH) // Touch, since we sprayed it.
|
||||
if(isliving(atm) && W.reagents.has_reagent("water")) // For extinguishing mobs on fire
|
||||
var/mob/living/M = atm // Why isn't this handled by the reagent? - N3X
|
||||
W.reagents.reaction(atm)
|
||||
if(isliving(atm)) //For extinguishing mobs on fire
|
||||
var/mob/living/M = atm
|
||||
M.ExtinguishMob()
|
||||
if(W.loc == my_target) break
|
||||
sleep(2)
|
||||
|
||||
if((istype(usr.loc, /turf/space)) || (usr.lastarea.has_gravity == 0))
|
||||
if(!has_gravity(user))
|
||||
user.inertia_dir = get_dir(target, user)
|
||||
step(user, user.inertia_dir)
|
||||
else
|
||||
return ..()
|
||||
return
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
/obj/item/weapon/watertank
|
||||
name = "backpack water tank"
|
||||
desc = "A S.U.N.S.H.I.N.E. brand watertank backpack with nozzle to water plants."
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon = 'icons/obj/watertank.dmi'
|
||||
icon_state = "waterbackpack"
|
||||
item_state = "waterbackpack"
|
||||
w_class = 4.0
|
||||
@@ -18,39 +18,34 @@
|
||||
..()
|
||||
create_reagents(volume)
|
||||
noz = make_noz()
|
||||
return
|
||||
|
||||
/obj/item/weapon/watertank/examine()
|
||||
set src in usr
|
||||
..()
|
||||
for(var/datum/reagent/R in reagents.reagent_list)
|
||||
usr << "[round(R.volume)] units of [R.name] left."
|
||||
return
|
||||
|
||||
/obj/item/weapon/watertank/ui_action_click()
|
||||
if (usr.get_item_by_slot(slot_back) == src)
|
||||
toggle_mister()
|
||||
else
|
||||
usr << "<span class='notice'>The watertank needs to be on your back to use!</span>"
|
||||
return
|
||||
toggle_mister()
|
||||
|
||||
/obj/item/weapon/watertank/verb/toggle_mister()
|
||||
set name = "Toggle Mister"
|
||||
set category = "Object"
|
||||
if (usr.get_item_by_slot(slot_back) != src)
|
||||
usr << "<span class='notice'>The watertank needs to be on your back to use.</span>"
|
||||
return
|
||||
if(usr.stat || !usr.canmove || usr.restrained())
|
||||
return
|
||||
on = !on
|
||||
|
||||
var/mob/living/carbon/human/user = usr
|
||||
if(on)
|
||||
if(noz == null)
|
||||
noz = make_noz()
|
||||
|
||||
//Detach the nozzle into the user's hands
|
||||
var/list/L = list("left hand" = slot_l_hand,"right hand" = slot_r_hand)
|
||||
if(!user.equip_in_one_of_slots(noz, L))
|
||||
if(!user.put_in_hands(noz))
|
||||
on = 0
|
||||
user << "<span class='notice'>You need a free hand to hold the mister!</span>"
|
||||
user << "<span class='notice'>You need a free hand to hold the mister.</span>"
|
||||
return
|
||||
noz.loc = user
|
||||
else
|
||||
//Remove from their hands and put back "into" the tank
|
||||
remove_noz(user)
|
||||
remove_noz()
|
||||
return
|
||||
|
||||
/obj/item/weapon/watertank/proc/make_noz()
|
||||
@@ -58,21 +53,52 @@
|
||||
|
||||
/obj/item/weapon/watertank/equipped(mob/user, slot)
|
||||
if (slot != slot_back)
|
||||
remove_noz(user)
|
||||
remove_noz()
|
||||
|
||||
/obj/item/weapon/watertank/proc/remove_noz(mob/user)
|
||||
var/mob/living/carbon/human/M = user
|
||||
if(noz in get_both_hands(M))
|
||||
M.unEquip(noz)
|
||||
/obj/item/weapon/watertank/proc/remove_noz()
|
||||
if(ismob(noz.loc))
|
||||
var/mob/M = noz.loc
|
||||
M.unEquip(noz, 1)
|
||||
return
|
||||
|
||||
/obj/item/weapon/watertank/Destroy()
|
||||
if (on)
|
||||
var/M = get(noz, /mob)
|
||||
remove_noz(M)
|
||||
remove_noz()
|
||||
qdel(noz)
|
||||
noz = null
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/weapon/watertank/attack_hand(mob/user as mob)
|
||||
if(src.loc == user)
|
||||
ui_action_click()
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/weapon/watertank/MouseDrop(obj/over_object)
|
||||
if(ishuman(src.loc))
|
||||
var/mob/living/carbon/human/H = src.loc
|
||||
switch(over_object.name)
|
||||
if("r_hand")
|
||||
if(H.r_hand)
|
||||
return
|
||||
if(!H.unEquip(src))
|
||||
return
|
||||
H.put_in_r_hand(src)
|
||||
if("l_hand")
|
||||
if(H.l_hand)
|
||||
return
|
||||
if(!H.unEquip(src))
|
||||
return
|
||||
H.put_in_l_hand(src)
|
||||
return
|
||||
|
||||
/obj/item/weapon/watertank/attackby(obj/item/W, mob/user, params)
|
||||
if(W == noz)
|
||||
remove_noz()
|
||||
return
|
||||
..()
|
||||
|
||||
// This mister item is intended as an extension of the watertank and always attached to it.
|
||||
// Therefore, it's designed to be "locked" to the player's hands or extended back onto
|
||||
// the watertank backpack. Allowing it to be placed elsewhere or created without a parent
|
||||
@@ -80,13 +106,14 @@
|
||||
/obj/item/weapon/reagent_containers/spray/mister
|
||||
name = "water mister"
|
||||
desc = "A mister nozzle attached to a water tank."
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon = 'icons/obj/watertank.dmi'
|
||||
icon_state = "mister"
|
||||
item_state = "mister"
|
||||
w_class = 4.0
|
||||
amount_per_transfer_from_this = 50
|
||||
possible_transfer_amounts = list(25,50,100)
|
||||
volume = 500
|
||||
flags = NODROP | OPENCONTAINER | NOBLUDGEON
|
||||
|
||||
var/obj/item/weapon/watertank/tank
|
||||
|
||||
@@ -99,7 +126,7 @@
|
||||
return
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/mister/dropped(mob/user as mob)
|
||||
user << "<span class='notice'>The mister snaps back onto the watertank!</span>"
|
||||
user << "<span class='notice'>The mister snaps back onto the watertank.</span>"
|
||||
tank.on = 0
|
||||
loc = tank
|
||||
|
||||
@@ -114,6 +141,16 @@
|
||||
else
|
||||
return 1
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/mister/Move()
|
||||
..()
|
||||
if(loc != tank.loc)
|
||||
loc = tank.loc
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/mister/afterattack(obj/target, mob/user, proximity)
|
||||
if(target.loc == loc || target == tank) //Safety check so you don't fill your mister with mutagen or something and then blast yourself in the face with it putting it away
|
||||
return
|
||||
..()
|
||||
|
||||
//Janitor tank
|
||||
/obj/item/weapon/watertank/janitor
|
||||
name = "backpack water tank"
|
||||
@@ -123,13 +160,12 @@
|
||||
|
||||
/obj/item/weapon/watertank/janitor/New()
|
||||
..()
|
||||
reagents.add_reagent("cleaner", 250)
|
||||
|
||||
reagents.add_reagent("cleaner", 500)
|
||||
|
||||
/obj/item/weapon/reagent_containers/spray/mister/janitor
|
||||
name = "janitor spray nozzle"
|
||||
desc = "A janitorial spray nozzle attached to a watertank, designed to clean up large messes."
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon = 'icons/obj/watertank.dmi'
|
||||
icon_state = "misterjani"
|
||||
item_state = "misterjani"
|
||||
amount_per_transfer_from_this = 5
|
||||
@@ -142,25 +178,45 @@
|
||||
amount_per_transfer_from_this = (amount_per_transfer_from_this == 10 ? 5 : 10)
|
||||
user << "<span class='notice'>You [amount_per_transfer_from_this == 10 ? "remove" : "fix"] the nozzle. You'll now use [amount_per_transfer_from_this] units per spray.</span>"
|
||||
|
||||
//Atmos tank
|
||||
//ATMOS FIRE FIGHTING BACKPACK
|
||||
|
||||
#define EXTINGUISHER 0
|
||||
#define NANOFROST 1
|
||||
#define METAL_FOAM 2
|
||||
|
||||
/obj/item/weapon/watertank/atmos
|
||||
name = "backpack water tank"
|
||||
desc = "A backpack watertank with fire extinguisher nozzle, intended to fight fires. Shouldn't toxins have one of these?"
|
||||
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"
|
||||
item_state = "waterbackpackatmos"
|
||||
volume = 100
|
||||
volume = 200
|
||||
|
||||
/obj/item/weapon/watertank/atmos/make_noz()
|
||||
return new /obj/item/weapon/extinguisher/mini/nozzle(src)
|
||||
|
||||
/obj/item/weapon/watertank/atmos/dropped(mob/user as mob)
|
||||
icon_state = "waterbackpackatmos"
|
||||
if(istype(noz, /obj/item/weapon/extinguisher/mini/nozzle))
|
||||
var/obj/item/weapon/extinguisher/mini/nozzle/N = noz
|
||||
N.nozzle_mode = 0
|
||||
|
||||
/obj/item/weapon/extinguisher/mini/nozzle
|
||||
name = "fire extinguisher nozzle"
|
||||
desc = "A fire extinguisher nozzle attached to a water tank."
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
icon_state = "misteratmos"
|
||||
item_state = "misteratmos"
|
||||
name = "extinguisher nozzle"
|
||||
desc = "A heavy duty nozzle attached to a firefighter's backpack tank."
|
||||
icon = 'icons/obj/watertank.dmi'
|
||||
icon_state = "atmos_nozzle"
|
||||
item_state = "nozzleatmos"
|
||||
safety = 0
|
||||
max_water = 200
|
||||
power = 8
|
||||
precision = 1
|
||||
cooling_power = 5
|
||||
w_class = 5
|
||||
flags = NODROP //Necessary to ensure that the nozzle and tank never seperate
|
||||
var/obj/item/weapon/watertank/tank
|
||||
var/nozzle_mode = 0
|
||||
var/metal_synthesis_cooldown = 0
|
||||
var/nanofrost_cooldown = 0
|
||||
|
||||
/obj/item/weapon/extinguisher/mini/nozzle/New(parent_tank)
|
||||
if(check_tank_exists(parent_tank, src))
|
||||
@@ -170,10 +226,174 @@
|
||||
loc = tank
|
||||
return
|
||||
|
||||
/obj/item/weapon/extinguisher/mini/nozzle/Move()
|
||||
..()
|
||||
if(tank && loc != tank.loc)
|
||||
loc = tank
|
||||
return
|
||||
|
||||
/obj/item/weapon/extinguisher/mini/nozzle/attack_self(mob/user as mob)
|
||||
switch(nozzle_mode)
|
||||
if(EXTINGUISHER)
|
||||
nozzle_mode = NANOFROST
|
||||
tank.icon_state = "waterbackpackatmos_1"
|
||||
user << "Swapped to nanofrost launcher"
|
||||
return
|
||||
if(NANOFROST)
|
||||
nozzle_mode = METAL_FOAM
|
||||
tank.icon_state = "waterbackpackatmos_2"
|
||||
user << "Swapped to metal foam synthesizer"
|
||||
return
|
||||
if(METAL_FOAM)
|
||||
nozzle_mode = EXTINGUISHER
|
||||
tank.icon_state = "waterbackpackatmos_0"
|
||||
user << "Swapped to water extinguisher"
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/extinguisher/mini/nozzle/dropped(mob/user as mob)
|
||||
user << "<span class='notice'>The nozzle snaps back onto the watertank!</span>"
|
||||
user << "<span class='notice'>The nozzle snaps back onto the tank!</span>"
|
||||
tank.on = 0
|
||||
loc = tank
|
||||
|
||||
/obj/item/weapon/extinguisher/mini/nozzle/attack_self()
|
||||
/obj/item/weapon/extinguisher/mini/nozzle/afterattack(atom/target, mob/user)
|
||||
if(nozzle_mode == EXTINGUISHER)
|
||||
..()
|
||||
return
|
||||
var/Adj = user.Adjacent(target)
|
||||
if(Adj)
|
||||
AttemptRefill(target, user)
|
||||
if(nozzle_mode == NANOFROST)
|
||||
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)
|
||||
user << "You need at least 100 units of water to use the nanofrost launcher!"
|
||||
return
|
||||
if(nanofrost_cooldown)
|
||||
user << "Nanofrost launcher is still recharging"
|
||||
return
|
||||
nanofrost_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]).")
|
||||
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
|
||||
return
|
||||
if(nozzle_mode == METAL_FOAM)
|
||||
if(!Adj|| !istype(target, /turf))
|
||||
return
|
||||
if(metal_synthesis_cooldown < 5)
|
||||
var/obj/effect/effect/foam/F = new /obj/effect/effect/foam(get_turf(target), 1)
|
||||
F.amount = 0
|
||||
metal_synthesis_cooldown++
|
||||
spawn(100)
|
||||
if(src)
|
||||
metal_synthesis_cooldown--
|
||||
else
|
||||
user << "Metal foam mix is still being synthesized."
|
||||
return
|
||||
|
||||
/obj/effect/nanofrost_container
|
||||
name = "nanofrost container"
|
||||
desc = "A frozen shell of ice containing nanofrost that freezes the surrounding area after activation."
|
||||
icon = 'icons/effects/effects.dmi'
|
||||
icon_state = "frozen_smoke_capsule"
|
||||
mouse_opacity = 0
|
||||
pass_flags = PASSTABLE
|
||||
|
||||
/obj/effect/nanofrost_container/proc/Smoke()
|
||||
new /obj/effect/effect/freezing_smoke(src.loc, 6, 1)
|
||||
var/obj/effect/decal/cleanable/flour/F = new /obj/effect/decal/cleanable/flour(src.loc)
|
||||
F.color = "#B2FFFF"
|
||||
F.name = "nanofrost residue"
|
||||
F.desc = "Residue left behind from a nanofrost detonation. Perhaps there was a fire here?"
|
||||
playsound(src,'sound/effects/bamf.ogg',100,1)
|
||||
qdel(src)
|
||||
|
||||
/obj/effect/effect/freezing_smoke
|
||||
name = "nanofrost smoke"
|
||||
icon_state = "smoke"
|
||||
opacity = 0
|
||||
anchored = 0.0
|
||||
mouse_opacity = 0
|
||||
icon = 'icons/effects/96x96.dmi'
|
||||
pixel_x = -32
|
||||
pixel_y = -32
|
||||
color = "#B2FFFF"
|
||||
var/amount = 0
|
||||
|
||||
/obj/effect/effect/freezing_smoke/New(loc, var/amt, var/blast)
|
||||
..()
|
||||
spawn(100+rand(10,30))
|
||||
delete()
|
||||
amount = amt
|
||||
if(amount)
|
||||
var/datum/effect/effect/system/freezing_smoke_spread/F = new /datum/effect/effect/system/freezing_smoke_spread
|
||||
F.set_up(amount, 0, src.loc)
|
||||
F.start()
|
||||
if(blast)
|
||||
for(var/turf/T in trange(2, src.loc))
|
||||
Chilled(T)
|
||||
return
|
||||
|
||||
/obj/effect/effect/freezing_smoke/proc/Chilled(atom/A)
|
||||
if(istype(A, /turf/simulated))
|
||||
var/turf/simulated/T = A
|
||||
if(T.air)
|
||||
var/datum/gas_mixture/G = T.air
|
||||
if(get_dist(T, src) < 2) // Otherwise we'll get silliness like people using Nanofrost to kill people through walls with cold air
|
||||
G.temperature = 2
|
||||
update_nearby_tiles()
|
||||
var/hotspot = (locate(/obj/fire) in T)
|
||||
if(hotspot && !istype(T, /turf/space))
|
||||
var/CT = 10
|
||||
var/datum/gas_mixture/lowertemp = T.remove_air( T:air:total_moles() )
|
||||
lowertemp.temperature = max( min(lowertemp.temperature-(CT*1000),lowertemp.temperature / CT) ,0)
|
||||
lowertemp.react()
|
||||
T.assume_air(lowertemp)
|
||||
qdel(hotspot)
|
||||
if(G.toxins)
|
||||
G.nitrogen += (G.toxins)
|
||||
G.toxins = 0
|
||||
for(var/obj/machinery/atmospherics/unary/vent_pump/V in T)
|
||||
V.welded = 1
|
||||
V.update_icon()
|
||||
V.visible_message("<span class='danger'>[V] was frozen shut!</span>")
|
||||
for(var/mob/living/L in T)
|
||||
L.ExtinguishMob()
|
||||
return
|
||||
|
||||
/datum/effect/effect/system/freezing_smoke_spread
|
||||
|
||||
/datum/effect/effect/system/freezing_smoke_spread/set_up(n = 6, c = 0, loca)
|
||||
number = n
|
||||
if(istype(loca, /turf/))
|
||||
location = loca
|
||||
else
|
||||
location = get_turf(loca)
|
||||
|
||||
/datum/effect/effect/system/freezing_smoke_spread/start()
|
||||
var/i = 0
|
||||
for(i=0, i<number, i++)
|
||||
spawn(0)
|
||||
var/obj/effect/effect/freezing_smoke/smoke = new /obj/effect/effect/freezing_smoke(location, 0, 0)
|
||||
smoke.amount = 0
|
||||
var/direction = pick(alldirs)
|
||||
for(i=0, i<rand(1,3), i++)
|
||||
sleep(5)
|
||||
step(smoke,direction)
|
||||
spawn(150+rand(10,30))
|
||||
if(smoke)
|
||||
fadeOut(smoke)
|
||||
smoke.delete()
|
||||
|
||||
#undef EXTINGUISHER
|
||||
#undef NANOFROST
|
||||
#undef METAL_FOAM
|
||||
|
||||
@@ -85,6 +85,7 @@
|
||||
new /obj/item/weapon/holosign_creator(src)
|
||||
new /obj/item/clothing/gloves/black(src)
|
||||
new /obj/item/clothing/head/soft/purple(src)
|
||||
new /obj/item/weapon/watertank/janitor(src)
|
||||
new /obj/item/weapon/storage/belt/janitor(src)
|
||||
|
||||
/*
|
||||
|
||||
@@ -144,6 +144,7 @@
|
||||
new /obj/item/clothing/suit/storage/hazardvest(src)
|
||||
new /obj/item/clothing/mask/gas(src)
|
||||
new /obj/item/weapon/tank/emergency_oxygen/engi(src)
|
||||
new /obj/item/weapon/watertank/atmos(src)
|
||||
new /obj/item/clothing/suit/fire/atmos(src)
|
||||
new /obj/item/clothing/head/hardhat/atmos(src)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user