This commit is contained in:
Kearel
2015-11-28 11:21:07 -06:00
176 changed files with 9954 additions and 9190 deletions
@@ -10,6 +10,7 @@
default_material = "wood"
force_divisor = 1.1 // 22 when wielded with weight 20 (steel)
unwielded_force_divisor = 0.7 // 15 when unwielded based on above.
slot_flags = SLOT_BACK
//Predefined materials go here.
/obj/item/weapon/material/twohanded/baseballbat/metal/New(var/newloc)
@@ -4,6 +4,7 @@
name = "jetpack (empty)"
desc = "A tank of compressed gas for use as propulsion in zero-gravity areas. Use with caution."
icon_state = "jetpack"
gauge_icon = null
w_class = 4.0
item_state = "jetpack"
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
@@ -85,6 +85,7 @@
name = "phoron tank"
desc = "Contains dangerous phoron. Do not inhale. Warning: extremely flammable."
icon_state = "phoron"
gauge_icon = null
flags = CONDUCT
slot_flags = null //they have no straps!
@@ -114,6 +115,8 @@
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"
gauge_icon = "indicator_emergency"
gauge_cap = 4
flags = CONDUCT
slot_flags = SLOT_BELT
w_class = 2.0
@@ -142,12 +145,15 @@
/obj/item/weapon/tank/emergency_oxygen/double
name = "double emergency oxygen tank"
icon_state = "emergency_double"
gauge_icon = "indicator_emergency_double"
volume = 10
/obj/item/weapon/tank/emergency_nitrogen
name = "emergency nitrogen tank"
desc = "An emergency air tank hastily painted red and issued to Vox crewmembers."
icon_state = "emergency_nitro"
gauge_icon = "indicator_emergency"
gauge_cap = 4
flags = CONDUCT
slot_flags = SLOT_BELT
w_class = 2.0
+29 -1
View File
@@ -1,9 +1,17 @@
#define TANK_MAX_RELEASE_PRESSURE (3*ONE_ATMOSPHERE)
#define TANK_DEFAULT_RELEASE_PRESSURE 24
#define TANK_IDEAL_PRESSURE 1015 //Arbitrary.
var/list/global/tank_gauge_cache = list()
/obj/item/weapon/tank
name = "tank"
icon = 'icons/obj/tank.dmi'
var/gauge_icon = "indicator_tank"
var/last_gauge_pressure
var/gauge_cap = 6
flags = CONDUCT
slot_flags = SLOT_BACK
w_class = 3
@@ -31,8 +39,8 @@
src.air_contents = new /datum/gas_mixture()
src.air_contents.volume = volume //liters
src.air_contents.temperature = T20C
processing_objects.Add(src)
update_gauge()
return
/obj/item/weapon/tank/Destroy()
@@ -220,8 +228,28 @@
/obj/item/weapon/tank/process()
//Allow for reactions
air_contents.react() //cooking up air tanks - add phoron and oxygen, then heat above PHORON_MINIMUM_BURN_TEMPERATURE
if(gauge_icon)
update_gauge()
check_status()
/obj/item/weapon/tank/proc/update_gauge()
var/gauge_pressure = 0
if(air_contents)
gauge_pressure = air_contents.return_pressure()
if(gauge_pressure > TANK_IDEAL_PRESSURE)
gauge_pressure = -1
else
gauge_pressure = round((gauge_pressure/TANK_IDEAL_PRESSURE)*gauge_cap)
if(gauge_pressure == last_gauge_pressure)
return
last_gauge_pressure = gauge_pressure
overlays.Cut()
var/indicator = "[gauge_icon][(gauge_pressure == -1) ? "overload" : gauge_pressure]"
if(!tank_gauge_cache[indicator])
tank_gauge_cache[indicator] = image(icon, indicator)
overlays += tank_gauge_cache[indicator]
/obj/item/weapon/tank/proc/check_status()
//Handle exploding, leaking, and rupturing of the tank