Syncs maps, and a bunch of other things that no one will care about/notice/give fucks about until they break. Welcome to conflict hell. (#2460)
* fuck pubby * fuck you too ceres * ree * this is going to be a disaster isn't it * disaster * dme * -_- * tg * woops * proper sync * Welcome to conflict hell. * lets hope this fixes more things than it breaks * gdi * goddamnit
This commit is contained in:
@@ -0,0 +1,211 @@
|
||||
/obj/item/tank/jetpack
|
||||
name = "jetpack (empty)"
|
||||
desc = "A tank of compressed gas for use as propulsion in zero-gravity areas. Use with caution."
|
||||
icon_state = "jetpack"
|
||||
item_state = "jetpack"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/jetpacks_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/jetpacks_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
distribute_pressure = ONE_ATMOSPHERE * O2STANDARD
|
||||
actions_types = list(/datum/action/item_action/set_internals, /datum/action/item_action/toggle_jetpack, /datum/action/item_action/jetpack_stabilization)
|
||||
var/gas_type = "o2"
|
||||
var/on = FALSE
|
||||
var/stabilizers = FALSE
|
||||
var/full_speed = TRUE // If the jetpack will have a speedboost in space/nograv or not
|
||||
var/datum/effect_system/trail_follow/ion/ion_trail
|
||||
|
||||
/obj/item/tank/jetpack/New()
|
||||
..()
|
||||
if(gas_type)
|
||||
air_contents.assert_gas(gas_type)
|
||||
air_contents.gases[gas_type][MOLES] = (6 * ONE_ATMOSPHERE) * volume / (R_IDEAL_GAS_EQUATION * T20C)
|
||||
|
||||
ion_trail = new
|
||||
ion_trail.set_up(src)
|
||||
|
||||
/obj/item/tank/jetpack/ui_action_click(mob/user, action)
|
||||
if(istype(action, /datum/action/item_action/toggle_jetpack))
|
||||
cycle(user)
|
||||
else if(istype(action, /datum/action/item_action/jetpack_stabilization))
|
||||
if(on)
|
||||
stabilizers = !stabilizers
|
||||
to_chat(user, "<span class='notice'>You turn the jetpack stabilization [stabilizers ? "on" : "off"].</span>")
|
||||
else
|
||||
toggle_internals(user)
|
||||
|
||||
|
||||
/obj/item/tank/jetpack/proc/cycle(mob/user)
|
||||
if(user.incapacitated())
|
||||
return
|
||||
|
||||
if(!on)
|
||||
turn_on()
|
||||
to_chat(user, "<span class='notice'>You turn the jetpack on.</span>")
|
||||
else
|
||||
turn_off()
|
||||
to_chat(user, "<span class='notice'>You turn the jetpack off.</span>")
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.UpdateButtonIcon()
|
||||
|
||||
|
||||
/obj/item/tank/jetpack/proc/turn_on()
|
||||
on = TRUE
|
||||
icon_state = "[initial(icon_state)]-on"
|
||||
ion_trail.start()
|
||||
|
||||
/obj/item/tank/jetpack/proc/turn_off()
|
||||
on = FALSE
|
||||
stabilizers = FALSE
|
||||
icon_state = initial(icon_state)
|
||||
ion_trail.stop()
|
||||
|
||||
/obj/item/tank/jetpack/proc/allow_thrust(num, mob/living/user)
|
||||
if(!on)
|
||||
return
|
||||
if((num < 0.005 || air_contents.total_moles() < num))
|
||||
turn_off()
|
||||
return
|
||||
|
||||
var/datum/gas_mixture/removed = air_contents.remove(num)
|
||||
if(removed.total_moles() < 0.005)
|
||||
turn_off()
|
||||
return
|
||||
|
||||
var/turf/T = get_turf(user)
|
||||
T.assume_air(removed)
|
||||
|
||||
return 1
|
||||
|
||||
/obj/item/tank/jetpack/suicide_act(mob/user)
|
||||
if (istype(user, /mob/living/carbon/human/))
|
||||
var/mob/living/carbon/human/H = user
|
||||
H.forcesay("WHAT THE FUCK IS CARBON DIOXIDE?")
|
||||
H.visible_message("<span class='suicide'>[user] is suffocating [user.p_them()]self with [src]! It looks like [user.p_they()] didn't read what that jetpack says!</span>")
|
||||
return (OXYLOSS)
|
||||
else
|
||||
..()
|
||||
|
||||
/obj/item/tank/jetpack/void
|
||||
name = "void jetpack (oxygen)"
|
||||
desc = "It works well in a void."
|
||||
icon_state = "jetpack-void"
|
||||
item_state = "jetpack-void"
|
||||
|
||||
/obj/item/tank/jetpack/oxygen
|
||||
name = "jetpack (oxygen)"
|
||||
desc = "A tank of compressed oxygen for use as propulsion in zero-gravity areas. Use with caution."
|
||||
icon_state = "jetpack"
|
||||
item_state = "jetpack"
|
||||
|
||||
/obj/item/tank/jetpack/oxygen/harness
|
||||
name = "jet harness (oxygen)"
|
||||
desc = "A lightweight tactical harness, used by those who don't want to be weighed down by traditional jetpacks."
|
||||
icon_state = "jetpack-mini"
|
||||
item_state = "jetpack-mini"
|
||||
volume = 40
|
||||
throw_range = 7
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
|
||||
/obj/item/tank/jetpack/oxygen/captain
|
||||
name = "\improper Captain's jetpack"
|
||||
desc = "A compact, lightweight jetpack containing a high amount of compressed oxygen."
|
||||
icon_state = "jetpack-captain"
|
||||
item_state = "jetpack-captain"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
volume = 90
|
||||
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | ACID_PROOF //steal objective items are hard to destroy.
|
||||
|
||||
/obj/item/tank/jetpack/oxygen/security
|
||||
name = "security jetpack (oxygen)"
|
||||
desc = "A tank of compressed oxygen for use as propulsion in zero-gravity areas by security forces."
|
||||
icon_state = "jetpack-sec"
|
||||
item_state = "jetpack-sec"
|
||||
|
||||
/obj/item/tank/jetpack/carbondioxide
|
||||
name = "jetpack (carbon dioxide)"
|
||||
desc = "A tank of compressed carbon dioxide for use as propulsion in zero-gravity areas. Painted black to indicate that it should not be used as a source for internals."
|
||||
icon_state = "jetpack-black"
|
||||
item_state = "jetpack-black"
|
||||
distribute_pressure = 0
|
||||
gas_type = "co2"
|
||||
|
||||
|
||||
/obj/item/tank/jetpack/suit
|
||||
name = "hardsuit jetpack upgrade"
|
||||
desc = "A modular, compact set of thrusters designed to integrate with a hardsuit. It is fueled by a tank inserted into the suit's storage compartment."
|
||||
origin_tech = "materials=4;magnets=4;engineering=5"
|
||||
icon_state = "jetpack-mining"
|
||||
item_state = "jetpack-black"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
actions_types = list(/datum/action/item_action/toggle_jetpack, /datum/action/item_action/jetpack_stabilization)
|
||||
volume = 1
|
||||
slot_flags = null
|
||||
gas_type = null
|
||||
full_speed = FALSE
|
||||
var/datum/gas_mixture/temp_air_contents
|
||||
var/obj/item/tank/internals/tank = null
|
||||
|
||||
/obj/item/tank/jetpack/suit/New()
|
||||
..()
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
temp_air_contents = air_contents
|
||||
|
||||
/obj/item/tank/jetpack/suit/attack_self()
|
||||
return
|
||||
|
||||
/obj/item/tank/jetpack/suit/cycle(mob/user)
|
||||
if(!istype(loc, /obj/item/clothing/suit/space/hardsuit))
|
||||
to_chat(user, "<span class='warning'>\The [src] must be connected to a hardsuit!</span>")
|
||||
return
|
||||
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(!istype(H.s_store, /obj/item/tank/internals))
|
||||
to_chat(user, "<span class='warning'>You need a tank in your suit storage!</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/tank/jetpack/suit/turn_on()
|
||||
if(!istype(loc, /obj/item/clothing/suit/space/hardsuit) || !ishuman(loc.loc))
|
||||
return
|
||||
var/mob/living/carbon/human/H = loc.loc
|
||||
tank = H.s_store
|
||||
air_contents = tank.air_contents
|
||||
START_PROCESSING(SSobj, src)
|
||||
..()
|
||||
|
||||
/obj/item/tank/jetpack/suit/turn_off()
|
||||
tank = null
|
||||
air_contents = temp_air_contents
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
..()
|
||||
|
||||
/obj/item/tank/jetpack/suit/process()
|
||||
if(!istype(loc, /obj/item/clothing/suit/space/hardsuit) || !ishuman(loc.loc))
|
||||
turn_off()
|
||||
return
|
||||
var/mob/living/carbon/human/H = loc.loc
|
||||
if(!tank || tank != H.s_store)
|
||||
turn_off()
|
||||
return
|
||||
..()
|
||||
|
||||
|
||||
//Return a jetpack that the mob can use
|
||||
//Back worn jetpacks, hardsuit internal packs, and so on.
|
||||
//Used in Process_Spacemove() and wherever you want to check for/get a jetpack
|
||||
|
||||
/mob/proc/get_jetpack()
|
||||
return
|
||||
|
||||
/mob/living/carbon/get_jetpack()
|
||||
var/obj/item/tank/jetpack/J = back
|
||||
if(istype(J))
|
||||
return J
|
||||
|
||||
/mob/living/carbon/human/get_jetpack()
|
||||
var/obj/item/tank/jetpack/J = ..()
|
||||
if(!istype(J) && istype(wear_suit, /obj/item/clothing/suit/space/hardsuit))
|
||||
var/obj/item/clothing/suit/space/hardsuit/C = wear_suit
|
||||
J = C.jetpack
|
||||
return J
|
||||
@@ -0,0 +1,183 @@
|
||||
/* Types of tanks!
|
||||
* Contains:
|
||||
* Oxygen
|
||||
* Anesthetic
|
||||
* Air
|
||||
* Plasma
|
||||
* Emergency Oxygen
|
||||
*/
|
||||
|
||||
/*
|
||||
* Oxygen
|
||||
*/
|
||||
/obj/item/tank/internals/oxygen
|
||||
name = "oxygen tank"
|
||||
desc = "A tank of oxygen."
|
||||
icon_state = "oxygen"
|
||||
distribute_pressure = TANK_DEFAULT_RELEASE_PRESSURE
|
||||
force = 10
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
|
||||
/obj/item/tank/internals/oxygen/New()
|
||||
..()
|
||||
air_contents.assert_gas("o2")
|
||||
air_contents.gases["o2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/tank/internals/oxygen/yellow
|
||||
desc = "A tank of oxygen, this one is yellow."
|
||||
icon_state = "oxygen_f"
|
||||
dog_fashion = null
|
||||
|
||||
/obj/item/tank/internals/oxygen/red
|
||||
desc = "A tank of oxygen, this one is red."
|
||||
icon_state = "oxygen_fr"
|
||||
dog_fashion = null
|
||||
|
||||
|
||||
/*
|
||||
* Anesthetic
|
||||
*/
|
||||
/obj/item/tank/internals/anesthetic
|
||||
name = "anesthetic tank"
|
||||
desc = "A tank with an N2O/O2 gas mix."
|
||||
icon_state = "anesthetic"
|
||||
item_state = "an_tank"
|
||||
force = 10
|
||||
|
||||
/obj/item/tank/internals/anesthetic/New()
|
||||
..()
|
||||
air_contents.assert_gases("o2", "n2o")
|
||||
air_contents.gases["o2"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
air_contents.gases["n2o"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
return
|
||||
|
||||
/*
|
||||
* Air
|
||||
*/
|
||||
/obj/item/tank/internals/air
|
||||
name = "air tank"
|
||||
desc = "Mixed anyone?"
|
||||
icon_state = "oxygen"
|
||||
force = 10
|
||||
dog_fashion = /datum/dog_fashion/back
|
||||
|
||||
/obj/item/tank/internals/air/New()
|
||||
..()
|
||||
air_contents.assert_gases("o2","n2")
|
||||
air_contents.gases["o2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * O2STANDARD
|
||||
air_contents.gases["n2"][MOLES] = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C) * N2STANDARD
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
* Plasma
|
||||
*/
|
||||
/obj/item/tank/internals/plasma
|
||||
name = "plasma tank"
|
||||
desc = "Contains dangerous plasma. Do not inhale. Warning: extremely flammable."
|
||||
icon_state = "plasma"
|
||||
flags_1 = CONDUCT_1
|
||||
slot_flags = null //they have no straps!
|
||||
force = 8
|
||||
|
||||
|
||||
/obj/item/tank/internals/plasma/New()
|
||||
..()
|
||||
air_contents.assert_gas("plasma")
|
||||
air_contents.gases["plasma"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
/obj/item/tank/internals/plasma/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/flamethrower))
|
||||
var/obj/item/flamethrower/F = W
|
||||
if ((!F.status)||(F.ptank))
|
||||
return
|
||||
if(!user.transferItemToLoc(src, F))
|
||||
return
|
||||
src.master = F
|
||||
F.ptank = src
|
||||
F.update_icon()
|
||||
else
|
||||
return ..()
|
||||
|
||||
/obj/item/tank/internals/plasma/full/New()
|
||||
..()
|
||||
air_contents.assert_gas("plasma")
|
||||
air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
|
||||
/*
|
||||
* Plasmaman Plasma Tank
|
||||
*/
|
||||
|
||||
/obj/item/tank/internals/plasmaman
|
||||
name = "plasma internals tank"
|
||||
desc = "A tank of plasma gas designed specifically for use as internals, particularly for plasma-based lifeforms. If you're not a Plasmaman, you probably shouldn't use this."
|
||||
icon_state = "plasmaman_tank"
|
||||
item_state = "plasmaman_tank"
|
||||
force = 10
|
||||
distribute_pressure = TANK_DEFAULT_RELEASE_PRESSURE
|
||||
|
||||
/obj/item/tank/internals/plasmaman/New()
|
||||
..()
|
||||
air_contents.assert_gas("plasma")
|
||||
air_contents.gases["plasma"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
/obj/item/tank/internals/plasmaman/full/New()
|
||||
..()
|
||||
air_contents.assert_gas("plasma")
|
||||
air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
|
||||
/obj/item/tank/internals/plasmaman/belt
|
||||
icon_state = "plasmaman_tank_belt"
|
||||
item_state = "plasmaman_tank_belt"
|
||||
slot_flags = SLOT_BELT
|
||||
force = 5
|
||||
volume = 6
|
||||
w_class = WEIGHT_CLASS_SMALL //thanks i forgot this
|
||||
|
||||
/obj/item/tank/internals/plasmaman/belt/full/New()
|
||||
..()
|
||||
air_contents.assert_gas("plasma")
|
||||
air_contents.gases["plasma"][MOLES] = (10*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Emergency Oxygen
|
||||
*/
|
||||
/obj/item/tank/internals/emergency_oxygen
|
||||
name = "emergency oxygen tank"
|
||||
desc = "Used for emergencies. Contains very little oxygen, so try to conserve it until you actually need it."
|
||||
icon_state = "emergency"
|
||||
flags_1 = CONDUCT_1
|
||||
slot_flags = SLOT_BELT
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
force = 4
|
||||
distribute_pressure = TANK_DEFAULT_RELEASE_PRESSURE
|
||||
volume = 3 //Tiny. Real life equivalents only have 21 breaths of oxygen in them. They're EMERGENCY tanks anyway -errorage (dangercon 2011)
|
||||
|
||||
|
||||
/obj/item/tank/internals/emergency_oxygen/New()
|
||||
..()
|
||||
air_contents.assert_gas("o2")
|
||||
air_contents.gases["o2"][MOLES] = (3*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
|
||||
return
|
||||
|
||||
/obj/item/tank/internals/emergency_oxygen/engi
|
||||
name = "extended-capacity emergency oxygen tank"
|
||||
icon_state = "emergency_engi"
|
||||
volume = 6
|
||||
|
||||
/obj/item/tank/internals/emergency_oxygen/double
|
||||
name = "double emergency oxygen tank"
|
||||
icon_state = "emergency_engi"
|
||||
volume = 10
|
||||
@@ -0,0 +1,280 @@
|
||||
/obj/item/tank
|
||||
name = "tank"
|
||||
icon = 'icons/obj/tank.dmi'
|
||||
lefthand_file = 'icons/mob/inhands/equipment/tanks_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/tanks_righthand.dmi'
|
||||
flags_1 = CONDUCT_1
|
||||
slot_flags = SLOT_BACK
|
||||
hitsound = 'sound/weapons/smash.ogg'
|
||||
pressure_resistance = ONE_ATMOSPHERE * 5
|
||||
force = 5
|
||||
throwforce = 10
|
||||
throw_speed = 1
|
||||
throw_range = 4
|
||||
actions_types = list(/datum/action/item_action/set_internals)
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 10, bio = 0, rad = 0, fire = 80, acid = 30)
|
||||
var/datum/gas_mixture/air_contents = null
|
||||
var/distribute_pressure = ONE_ATMOSPHERE
|
||||
var/integrity = 3
|
||||
var/volume = 70
|
||||
|
||||
/obj/item/tank/ui_action_click(mob/user)
|
||||
toggle_internals(user)
|
||||
|
||||
/obj/item/tank/proc/toggle_internals(mob/user)
|
||||
var/mob/living/carbon/human/H = user
|
||||
if(!istype(H))
|
||||
return
|
||||
|
||||
if(H.internal == src)
|
||||
to_chat(H, "<span class='notice'>You close [src] valve.</span>")
|
||||
H.internal = null
|
||||
H.update_internals_hud_icon(0)
|
||||
else
|
||||
if(!H.getorganslot("breathing_tube"))
|
||||
if(!H.wear_mask)
|
||||
to_chat(H, "<span class='warning'>You need a mask!</span>")
|
||||
return
|
||||
if(H.wear_mask.mask_adjusted)
|
||||
H.wear_mask.adjustmask(H)
|
||||
if(!(H.wear_mask.flags_1 & MASKINTERNALS_1))
|
||||
to_chat(H, "<span class='warning'>[H.wear_mask] can't use [src]!</span>")
|
||||
return
|
||||
|
||||
if(H.internal)
|
||||
to_chat(H, "<span class='notice'>You switch your internals to [src].</span>")
|
||||
else
|
||||
to_chat(H, "<span class='notice'>You open [src] valve.</span>")
|
||||
H.internal = src
|
||||
H.update_internals_hud_icon(1)
|
||||
H.update_action_buttons_icon()
|
||||
|
||||
|
||||
/obj/item/tank/New()
|
||||
..()
|
||||
|
||||
air_contents = new(volume) //liters
|
||||
air_contents.temperature = T20C
|
||||
|
||||
START_PROCESSING(SSobj, src)
|
||||
|
||||
/obj/item/tank/Destroy()
|
||||
if(air_contents)
|
||||
qdel(air_contents)
|
||||
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
. = ..()
|
||||
|
||||
/obj/item/tank/examine(mob/user)
|
||||
var/obj/icon = src
|
||||
..()
|
||||
if (istype(src.loc, /obj/item/assembly))
|
||||
icon = src.loc
|
||||
if(!in_range(src, user))
|
||||
if (icon == src) to_chat(user, "<span class='notice'>If you want any more information you'll need to get closer.</span>")
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>The pressure gauge reads [src.air_contents.return_pressure()] kPa.</span>")
|
||||
|
||||
var/celsius_temperature = src.air_contents.temperature-T0C
|
||||
var/descriptive
|
||||
|
||||
if (celsius_temperature < 20)
|
||||
descriptive = "cold"
|
||||
else if (celsius_temperature < 40)
|
||||
descriptive = "room temperature"
|
||||
else if (celsius_temperature < 80)
|
||||
descriptive = "lukewarm"
|
||||
else if (celsius_temperature < 100)
|
||||
descriptive = "warm"
|
||||
else if (celsius_temperature < 300)
|
||||
descriptive = "hot"
|
||||
else
|
||||
descriptive = "furiously hot"
|
||||
|
||||
to_chat(user, "<span class='notice'>It feels [descriptive].</span>")
|
||||
|
||||
/obj/item/tank/blob_act(obj/structure/blob/B)
|
||||
if(B && B.loc == loc)
|
||||
var/turf/location = get_turf(src)
|
||||
if(!location)
|
||||
qdel(src)
|
||||
|
||||
if(air_contents)
|
||||
location.assume_air(air_contents)
|
||||
|
||||
qdel(src)
|
||||
|
||||
/obj/item/tank/deconstruct(disassembled = TRUE)
|
||||
if(!disassembled)
|
||||
var/turf/T = get_turf(src)
|
||||
if(T)
|
||||
T.assume_air(air_contents)
|
||||
air_update_turf()
|
||||
playsound(src.loc, 'sound/effects/spray.ogg', 10, 1, -3)
|
||||
qdel(src)
|
||||
|
||||
/obj/item/tank/suicide_act(mob/user)
|
||||
var/mob/living/carbon/human/H = user
|
||||
user.visible_message("<span class='suicide'>[user] is putting [src]'s valve to [user.p_their()] lips! It looks like [user.p_theyre()] trying to commit suicide!</span>")
|
||||
playsound(loc, 'sound/effects/spray.ogg', 10, 1, -3)
|
||||
if (!QDELETED(H) && air_contents && air_contents.return_pressure() >= 1000)
|
||||
for(var/obj/item/W in H)
|
||||
H.dropItemToGround(W)
|
||||
if(prob(50))
|
||||
step(W, pick(GLOB.alldirs))
|
||||
H.status_flags |= DISFIGURED
|
||||
H.bleed_rate = 5
|
||||
H.gib_animation()
|
||||
sleep(3)
|
||||
H.adjustBruteLoss(1000) //to make the body super-bloody
|
||||
H.spawn_gibs()
|
||||
H.spill_organs()
|
||||
H.spread_bodyparts()
|
||||
|
||||
return (BRUTELOSS)
|
||||
|
||||
/obj/item/tank/attackby(obj/item/W, mob/user, params)
|
||||
add_fingerprint(user)
|
||||
if((istype(W, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
|
||||
atmosanalyzer_scan(air_contents, user)
|
||||
|
||||
else if(istype(W, /obj/item/device/assembly_holder))
|
||||
bomb_assemble(W,user)
|
||||
else
|
||||
. = ..()
|
||||
|
||||
/obj/item/tank/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "tanks", name, 420, 200, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/item/tank/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
|
||||
data["releasePressure"] = round(distribute_pressure ? distribute_pressure : 0)
|
||||
data["defaultReleasePressure"] = round(TANK_DEFAULT_RELEASE_PRESSURE)
|
||||
data["minReleasePressure"] = round(TANK_MIN_RELEASE_PRESSURE)
|
||||
data["maxReleasePressure"] = round(TANK_MAX_RELEASE_PRESSURE)
|
||||
|
||||
var/mob/living/carbon/C = user
|
||||
if(!istype(C))
|
||||
C = loc.loc
|
||||
if(!istype(C))
|
||||
return data
|
||||
|
||||
if(C.internal == src)
|
||||
data["connected"] = TRUE
|
||||
|
||||
return data
|
||||
|
||||
/obj/item/tank/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("pressure")
|
||||
var/pressure = params["pressure"]
|
||||
if(pressure == "reset")
|
||||
pressure = TANK_DEFAULT_RELEASE_PRESSURE
|
||||
. = TRUE
|
||||
else if(pressure == "min")
|
||||
pressure = TANK_MIN_RELEASE_PRESSURE
|
||||
. = TRUE
|
||||
else if(pressure == "max")
|
||||
pressure = TANK_MAX_RELEASE_PRESSURE
|
||||
. = TRUE
|
||||
else if(pressure == "input")
|
||||
pressure = input("New release pressure ([TANK_MIN_RELEASE_PRESSURE]-[TANK_MAX_RELEASE_PRESSURE] kPa):", name, distribute_pressure) as num|null
|
||||
if(!isnull(pressure) && !..())
|
||||
. = TRUE
|
||||
else if(text2num(pressure) != null)
|
||||
pressure = text2num(pressure)
|
||||
. = TRUE
|
||||
if(.)
|
||||
distribute_pressure = Clamp(round(pressure), TANK_MIN_RELEASE_PRESSURE, TANK_MAX_RELEASE_PRESSURE)
|
||||
|
||||
/obj/item/tank/remove_air(amount)
|
||||
return air_contents.remove(amount)
|
||||
|
||||
/obj/item/tank/return_air()
|
||||
return air_contents
|
||||
|
||||
/obj/item/tank/assume_air(datum/gas_mixture/giver)
|
||||
air_contents.merge(giver)
|
||||
|
||||
check_status()
|
||||
return 1
|
||||
|
||||
/obj/item/tank/proc/remove_air_volume(volume_to_return)
|
||||
if(!air_contents)
|
||||
return null
|
||||
|
||||
var/tank_pressure = air_contents.return_pressure()
|
||||
if(tank_pressure < distribute_pressure)
|
||||
distribute_pressure = tank_pressure
|
||||
|
||||
var/moles_needed = distribute_pressure*volume_to_return/(R_IDEAL_GAS_EQUATION*air_contents.temperature)
|
||||
|
||||
return remove_air(moles_needed)
|
||||
|
||||
/obj/item/tank/process()
|
||||
//Allow for reactions
|
||||
air_contents.react()
|
||||
check_status()
|
||||
|
||||
|
||||
/obj/item/tank/proc/check_status()
|
||||
//Handle exploding, leaking, and rupturing of the tank
|
||||
|
||||
if(!air_contents)
|
||||
return 0
|
||||
|
||||
var/pressure = air_contents.return_pressure()
|
||||
if(pressure > TANK_FRAGMENT_PRESSURE)
|
||||
if(!istype(src.loc, /obj/item/device/transfer_valve))
|
||||
message_admins("Explosive tank rupture! Last key to touch the tank was [src.fingerprintslast].")
|
||||
log_game("Explosive tank rupture! Last key to touch the tank was [src.fingerprintslast].")
|
||||
//to_chat(world, "\blue[x],[y] tank is exploding: [pressure] kPa")
|
||||
//Give the gas a chance to build up more pressure through reacting
|
||||
air_contents.react()
|
||||
air_contents.react()
|
||||
air_contents.react()
|
||||
pressure = air_contents.return_pressure()
|
||||
var/range = (pressure-TANK_FRAGMENT_PRESSURE)/TANK_FRAGMENT_SCALE
|
||||
var/turf/epicenter = get_turf(loc)
|
||||
|
||||
//to_chat(world, "\blue Exploding Pressure: [pressure] kPa, intensity: [range]")
|
||||
|
||||
explosion(epicenter, round(range*0.25), round(range*0.5), round(range), round(range*1.5))
|
||||
if(istype(src.loc, /obj/item/device/transfer_valve))
|
||||
qdel(src.loc)
|
||||
else
|
||||
qdel(src)
|
||||
|
||||
else if(pressure > TANK_RUPTURE_PRESSURE)
|
||||
//to_chat(world, "\blue[x],[y] tank is rupturing: [pressure] kPa, integrity [integrity]")
|
||||
if(integrity <= 0)
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return
|
||||
T.assume_air(air_contents)
|
||||
playsound(src.loc, 'sound/effects/spray.ogg', 10, 1, -3)
|
||||
qdel(src)
|
||||
else
|
||||
integrity--
|
||||
|
||||
else if(pressure > TANK_LEAK_PRESSURE)
|
||||
//to_chat(world, "\blue[x],[y] tank is leaking: [pressure] kPa, integrity [integrity]")
|
||||
if(integrity <= 0)
|
||||
var/turf/T = get_turf(src)
|
||||
if(!T)
|
||||
return
|
||||
var/datum/gas_mixture/leaked_gas = air_contents.remove_ratio(0.25)
|
||||
T.assume_air(leaked_gas)
|
||||
else
|
||||
integrity--
|
||||
|
||||
else if(integrity < 3)
|
||||
integrity++
|
||||
@@ -0,0 +1,474 @@
|
||||
//Hydroponics tank and base code
|
||||
/obj/item/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/equipment.dmi'
|
||||
icon_state = "waterbackpack"
|
||||
item_state = "waterbackpack"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
slot_flags = SLOT_BACK
|
||||
slowdown = 1
|
||||
actions_types = list(/datum/action/item_action/toggle_mister)
|
||||
max_integrity = 200
|
||||
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0, fire = 100, acid = 30)
|
||||
resistance_flags = FIRE_PROOF
|
||||
|
||||
var/obj/item/noz
|
||||
var/on = FALSE
|
||||
var/volume = 500
|
||||
|
||||
/obj/item/watertank/New()
|
||||
..()
|
||||
create_reagents(volume)
|
||||
noz = make_noz()
|
||||
|
||||
/obj/item/watertank/ui_action_click()
|
||||
toggle_mister()
|
||||
|
||||
/obj/item/watertank/item_action_slot_check(slot, mob/user)
|
||||
if(slot == user.getBackSlot())
|
||||
return 1
|
||||
|
||||
/obj/item/watertank/verb/toggle_mister()
|
||||
set name = "Toggle Mister"
|
||||
set category = "Object"
|
||||
if (usr.get_item_by_slot(usr.getBackSlot()) != src)
|
||||
to_chat(usr, "<span class='warning'>The watertank must be worn properly to use!</span>")
|
||||
return
|
||||
if(usr.incapacitated())
|
||||
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
|
||||
if(!user.put_in_hands(noz))
|
||||
on = FALSE
|
||||
to_chat(user, "<span class='warning'>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()
|
||||
return
|
||||
|
||||
/obj/item/watertank/proc/make_noz()
|
||||
return new /obj/item/reagent_containers/spray/mister(src)
|
||||
|
||||
/obj/item/watertank/equipped(mob/user, slot)
|
||||
..()
|
||||
if(slot != slot_back)
|
||||
remove_noz()
|
||||
|
||||
/obj/item/watertank/proc/remove_noz()
|
||||
if(ismob(noz.loc))
|
||||
var/mob/M = noz.loc
|
||||
M.temporarilyRemoveItemFromInventory(noz, TRUE)
|
||||
return
|
||||
|
||||
/obj/item/watertank/Destroy()
|
||||
if (on)
|
||||
qdel(noz)
|
||||
return ..()
|
||||
|
||||
/obj/item/watertank/attack_hand(mob/user)
|
||||
if(src.loc == user)
|
||||
ui_action_click()
|
||||
return
|
||||
..()
|
||||
|
||||
/obj/item/watertank/MouseDrop(obj/over_object)
|
||||
var/mob/M = src.loc
|
||||
if(istype(M) && istype(over_object, /obj/screen/inventory/hand))
|
||||
var/obj/screen/inventory/hand/H = over_object
|
||||
M.putItemFromInventoryInHandIfPossible(src, H.held_index)
|
||||
|
||||
/obj/item/watertank/attackby(obj/item/W, mob/user, params)
|
||||
if(W == noz)
|
||||
remove_noz()
|
||||
return 1
|
||||
else
|
||||
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
|
||||
// watertank object will likely lead to weird behaviour or runtimes.
|
||||
/obj/item/reagent_containers/spray/mister
|
||||
name = "water mister"
|
||||
desc = "A mister nozzle attached to a water tank."
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "mister"
|
||||
item_state = "mister"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/mister_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/mister_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
amount_per_transfer_from_this = 50
|
||||
possible_transfer_amounts = list(25,50,100)
|
||||
volume = 500
|
||||
flags_1 = NODROP_1 | NOBLUDGEON_1
|
||||
container_type = OPENCONTAINER_1
|
||||
slot_flags = 0
|
||||
|
||||
var/obj/item/watertank/tank
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/New(parent_tank)
|
||||
..()
|
||||
if(check_tank_exists(parent_tank, src))
|
||||
tank = parent_tank
|
||||
reagents = tank.reagents //This mister is really just a proxy for the tank's reagents
|
||||
loc = tank
|
||||
return
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/dropped(mob/user)
|
||||
..()
|
||||
to_chat(user, "<span class='notice'>The mister snaps back onto the watertank.</span>")
|
||||
tank.on = 0
|
||||
loc = tank
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/attack_self()
|
||||
return
|
||||
|
||||
/proc/check_tank_exists(parent_tank, mob/living/carbon/human/M, obj/O)
|
||||
if (!parent_tank || !istype(parent_tank, /obj/item/watertank)) //To avoid weird issues from admin spawns
|
||||
qdel(O)
|
||||
return 0
|
||||
else
|
||||
return 1
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/Move()
|
||||
..()
|
||||
if(loc != tank.loc)
|
||||
loc = tank.loc
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/afterattack(obj/target, mob/user, proximity)
|
||||
if(target.loc == loc) //Safety check so you don't fill your mister with mutagen or something and then blast yourself in the face with it
|
||||
return
|
||||
..()
|
||||
|
||||
//Janitor tank
|
||||
/obj/item/watertank/janitor
|
||||
name = "backpack water tank"
|
||||
desc = "A janitorial watertank backpack with nozzle to clean dirt and graffiti."
|
||||
icon_state = "waterbackpackjani"
|
||||
item_state = "waterbackpackjani"
|
||||
|
||||
/obj/item/watertank/janitor/New()
|
||||
..()
|
||||
reagents.add_reagent("cleaner", 500)
|
||||
|
||||
/obj/item/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/equipment.dmi'
|
||||
icon_state = "misterjani"
|
||||
item_state = "misterjani"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/mister_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/mister_righthand.dmi'
|
||||
amount_per_transfer_from_this = 5
|
||||
possible_transfer_amounts = list()
|
||||
|
||||
/obj/item/watertank/janitor/make_noz()
|
||||
return new /obj/item/reagent_containers/spray/mister/janitor(src)
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/janitor/attack_self(var/mob/user)
|
||||
amount_per_transfer_from_this = (amount_per_transfer_from_this == 10 ? 5 : 10)
|
||||
to_chat(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 FIRE FIGHTING BACKPACK
|
||||
|
||||
#define EXTINGUISHER 0
|
||||
#define RESIN_LAUNCHER 1
|
||||
#define RESIN_FOAM 2
|
||||
|
||||
/obj/item/watertank/atmos
|
||||
name = "backpack firefighter tank"
|
||||
desc = "A refrigerated 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/watertank/atmos/New()
|
||||
..()
|
||||
reagents.add_reagent("water", 200)
|
||||
|
||||
/obj/item/watertank/atmos/make_noz()
|
||||
return new /obj/item/extinguisher/mini/nozzle(src)
|
||||
|
||||
/obj/item/watertank/atmos/dropped(mob/user)
|
||||
..()
|
||||
icon_state = "waterbackpackatmos"
|
||||
if(istype(noz, /obj/item/extinguisher/mini/nozzle))
|
||||
var/obj/item/extinguisher/mini/nozzle/N = noz
|
||||
N.nozzle_mode = 0
|
||||
|
||||
/obj/item/extinguisher/mini/nozzle
|
||||
name = "extinguisher nozzle"
|
||||
desc = "A heavy duty nozzle attached to a firefighter's backpack tank."
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "atmos_nozzle"
|
||||
item_state = "nozzleatmos"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/mister_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/mister_righthand.dmi'
|
||||
safety = 0
|
||||
max_water = 200
|
||||
power = 8
|
||||
force = 10
|
||||
precision = 1
|
||||
cooling_power = 5
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
flags_1 = NODROP_1 //Necessary to ensure that the nozzle and tank never separate
|
||||
var/obj/item/watertank/tank
|
||||
var/nozzle_mode = 0
|
||||
var/metal_synthesis_cooldown = 0
|
||||
var/resin_cooldown = 0
|
||||
|
||||
/obj/item/extinguisher/mini/nozzle/New(parent_tank)
|
||||
..()
|
||||
if(check_tank_exists(parent_tank, src))
|
||||
tank = parent_tank
|
||||
reagents = tank.reagents
|
||||
max_water = tank.volume
|
||||
loc = tank
|
||||
|
||||
|
||||
/obj/item/extinguisher/mini/nozzle/Move()
|
||||
..()
|
||||
if(loc != tank.loc)
|
||||
loc = tank
|
||||
return
|
||||
|
||||
/obj/item/extinguisher/mini/nozzle/attack_self(mob/user)
|
||||
switch(nozzle_mode)
|
||||
if(EXTINGUISHER)
|
||||
nozzle_mode = RESIN_LAUNCHER
|
||||
tank.icon_state = "waterbackpackatmos_1"
|
||||
to_chat(user, "Swapped to resin launcher")
|
||||
return
|
||||
if(RESIN_LAUNCHER)
|
||||
nozzle_mode = RESIN_FOAM
|
||||
tank.icon_state = "waterbackpackatmos_2"
|
||||
to_chat(user, "Swapped to resin foamer")
|
||||
return
|
||||
if(RESIN_FOAM)
|
||||
nozzle_mode = EXTINGUISHER
|
||||
tank.icon_state = "waterbackpackatmos_0"
|
||||
to_chat(user, "Swapped to water extinguisher")
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/extinguisher/mini/nozzle/dropped(mob/user)
|
||||
..()
|
||||
to_chat(user, "<span class='notice'>The nozzle snaps back onto the tank!</span>")
|
||||
tank.on = 0
|
||||
loc = tank
|
||||
|
||||
/obj/item/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 == 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 resin launcher!</span>")
|
||||
return
|
||||
if(resin_cooldown)
|
||||
to_chat(user, "<span class='warning'>Resin launcher is still recharging...</span>")
|
||||
return
|
||||
resin_cooldown = TRUE
|
||||
R.remove_any(100)
|
||||
var/obj/effect/resin_container/A = new (get_turf(src))
|
||||
log_game("[key_name_admin(user)] used Resin Launcher at [get_area(user)] [COORD(user)].")
|
||||
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)
|
||||
resin_cooldown = FALSE
|
||||
return
|
||||
if(nozzle_mode == RESIN_FOAM)
|
||||
if(!Adj|| !isturf(target))
|
||||
return
|
||||
for(var/S in target)
|
||||
if(istype(S, /obj/effect/particle_effect/foam/metal/resin) || istype(S, /obj/structure/foamedmetal/resin))
|
||||
to_chat(user, "<span class='warning'>There's already resin here!</span>")
|
||||
return
|
||||
if(metal_synthesis_cooldown < 5)
|
||||
var/obj/effect/particle_effect/foam/metal/resin/F = new (get_turf(target))
|
||||
F.amount = 0
|
||||
metal_synthesis_cooldown++
|
||||
spawn(100)
|
||||
metal_synthesis_cooldown--
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Resin foam mix is still being synthesized...</span>")
|
||||
return
|
||||
|
||||
/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 = MOUSE_OPACITY_TRANSPARENT
|
||||
pass_flags = PASSTABLE
|
||||
|
||||
/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 RESIN_LAUNCHER
|
||||
#undef RESIN_FOAM
|
||||
|
||||
/obj/item/reagent_containers/chemtank
|
||||
name = "backpack chemical injector"
|
||||
desc = "A chemical autoinjector that can be carried on your back."
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "waterbackpackatmos"
|
||||
item_state = "waterbackpackatmos"
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
slot_flags = SLOT_BACK
|
||||
slowdown = 1
|
||||
actions_types = list(/datum/action/item_action/activate_injector)
|
||||
|
||||
var/on = FALSE
|
||||
volume = 300
|
||||
var/usage_ratio = 5 //5 unit added per 1 removed
|
||||
var/injection_amount = 1
|
||||
amount_per_transfer_from_this = 5
|
||||
container_type = OPENCONTAINER_1
|
||||
spillable = 0
|
||||
possible_transfer_amounts = list(5,10,15)
|
||||
|
||||
/obj/item/reagent_containers/chemtank/ui_action_click()
|
||||
toggle_injection()
|
||||
|
||||
/obj/item/reagent_containers/chemtank/item_action_slot_check(slot, mob/user)
|
||||
if(slot == slot_back)
|
||||
return 1
|
||||
|
||||
/obj/item/reagent_containers/chemtank/proc/toggle_injection()
|
||||
var/mob/living/carbon/human/user = usr
|
||||
if(!istype(user))
|
||||
return
|
||||
if (user.get_item_by_slot(slot_back) != src)
|
||||
to_chat(user, "<span class='warning'>The chemtank needs to be on your back before you can activate it!</span>")
|
||||
return
|
||||
if(on)
|
||||
turn_off()
|
||||
else
|
||||
turn_on()
|
||||
|
||||
//Todo : cache these.
|
||||
/obj/item/reagent_containers/chemtank/proc/update_filling()
|
||||
cut_overlays()
|
||||
|
||||
if(reagents.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "backpack-10")
|
||||
|
||||
var/percent = round((reagents.total_volume / volume) * 100)
|
||||
switch(percent)
|
||||
if(0 to 15)
|
||||
filling.icon_state = "backpack-10"
|
||||
if(16 to 60)
|
||||
filling.icon_state = "backpack50"
|
||||
if(61 to INFINITY)
|
||||
filling.icon_state = "backpack100"
|
||||
|
||||
filling.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
add_overlay(filling)
|
||||
|
||||
/obj/item/reagent_containers/chemtank/worn_overlays(var/isinhands = FALSE) //apply chemcolor and level
|
||||
. = list()
|
||||
//inhands + reagent_filling
|
||||
if(!isinhands && reagents.total_volume)
|
||||
var/mutable_appearance/filling = mutable_appearance('icons/obj/reagentfillings.dmi', "backpackmob-10")
|
||||
|
||||
var/percent = round((reagents.total_volume / volume) * 100)
|
||||
switch(percent)
|
||||
if(0 to 15)
|
||||
filling.icon_state = "backpackmob-10"
|
||||
if(16 to 60)
|
||||
filling.icon_state = "backpackmob50"
|
||||
if(61 to INFINITY)
|
||||
filling.icon_state = "backpackmob100"
|
||||
|
||||
filling.color = mix_color_from_reagents(reagents.reagent_list)
|
||||
. += filling
|
||||
|
||||
/obj/item/reagent_containers/chemtank/proc/turn_on()
|
||||
on = TRUE
|
||||
START_PROCESSING(SSobj, src)
|
||||
if(ismob(loc))
|
||||
to_chat(loc, "<span class='notice'>[src] turns on.</span>")
|
||||
|
||||
/obj/item/reagent_containers/chemtank/proc/turn_off()
|
||||
on = FALSE
|
||||
STOP_PROCESSING(SSobj, src)
|
||||
if(ismob(loc))
|
||||
to_chat(loc, "<span class='notice'>[src] turns off.</span>")
|
||||
|
||||
/obj/item/reagent_containers/chemtank/process()
|
||||
if(!ishuman(loc))
|
||||
turn_off()
|
||||
return
|
||||
if(!reagents.total_volume)
|
||||
turn_off()
|
||||
return
|
||||
var/mob/living/carbon/human/user = loc
|
||||
if(user.back != src)
|
||||
turn_off()
|
||||
return
|
||||
|
||||
var/used_amount = injection_amount/usage_ratio
|
||||
reagents.reaction(user, INJECT,injection_amount,0)
|
||||
reagents.trans_to(user,used_amount,multiplier=usage_ratio)
|
||||
update_filling()
|
||||
user.update_inv_back() //for overlays update
|
||||
|
||||
//Operator backpack spray
|
||||
/obj/item/watertank/operator
|
||||
name = "backpack water tank"
|
||||
desc = "A New Russian backpack spray for systematic cleansing of carbon lifeforms."
|
||||
icon_state = "waterbackpackjani"
|
||||
item_state = "waterbackpackjani"
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
volume = 2000
|
||||
slowdown = 0
|
||||
|
||||
/obj/item/watertank/operator/New()
|
||||
..()
|
||||
reagents.add_reagent("mutagen",350)
|
||||
reagents.add_reagent("napalm",125)
|
||||
reagents.add_reagent("welding_fuel",125)
|
||||
reagents.add_reagent("clf3",300)
|
||||
reagents.add_reagent("cryptobiolin",350)
|
||||
reagents.add_reagent("plasma",250)
|
||||
reagents.add_reagent("condensedcapsaicin",500)
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/operator
|
||||
name = "janitor spray nozzle"
|
||||
desc = "A mister nozzle attached to several extended water tanks. It suspiciously has a compressor in the system and is labelled entirely in New Cyrillic."
|
||||
icon = 'icons/obj/hydroponics/equipment.dmi'
|
||||
icon_state = "misterjani"
|
||||
item_state = "misterjani"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/mister_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/mister_righthand.dmi'
|
||||
w_class = WEIGHT_CLASS_BULKY
|
||||
amount_per_transfer_from_this = 100
|
||||
possible_transfer_amounts = list(75,100,150)
|
||||
|
||||
/obj/item/watertank/operator/make_noz()
|
||||
return new /obj/item/reagent_containers/spray/mister/operator(src)
|
||||
Reference in New Issue
Block a user