mirror of
https://github.com/Citadel-Station-13/Citadel-Station-13-RP.git
synced 2026-08-23 11:37:15 +01:00
143 lines
4.7 KiB
Plaintext
143 lines
4.7 KiB
Plaintext
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
|
|
|
|
/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"
|
|
gauge_icon = null
|
|
w_class = WEIGHT_CLASS_BULKY
|
|
item_icons = list(
|
|
SLOT_ID_LEFT_HAND = 'icons/mob/items/lefthand_storage.dmi',
|
|
SLOT_ID_RIGHT_HAND = 'icons/mob/items/righthand_storage.dmi',
|
|
)
|
|
item_state_slots = list(SLOT_ID_RIGHT_HAND = "jetpack", SLOT_ID_LEFT_HAND = "jetpack")
|
|
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
|
|
var/datum/effect_system/ion_trail_follow/ion_trail
|
|
var/on = 0.0
|
|
var/stabilization_on = 0
|
|
var/volume_rate = 500 //Needed for borg jetpack transfer
|
|
item_action_name = "Toggle Jetpack"
|
|
suit_storage_class = SUIT_STORAGE_CLASS_HARDWEAR
|
|
|
|
/obj/item/tank/jetpack/Initialize(mapload)
|
|
. = ..()
|
|
ion_trail = new /datum/effect_system/ion_trail_follow()
|
|
ion_trail.set_up(src)
|
|
|
|
/obj/item/tank/jetpack/Destroy()
|
|
QDEL_NULL(ion_trail)
|
|
return ..()
|
|
|
|
/obj/item/tank/jetpack/examine(mob/user, dist)
|
|
. = ..()
|
|
if(air_contents.total_moles < 5)
|
|
. += "<span class='danger'>The meter on \the [src] indicates you are almost out of gas!</span>"
|
|
// playsound(user, 'sound/effects/alert.ogg', 50, 1)
|
|
|
|
/obj/item/tank/jetpack/update_icon_state()
|
|
icon_state = "[base_icon_state || initial(icon_state)][on ? "-on" : ""]"
|
|
return ..()
|
|
|
|
/obj/item/tank/jetpack/verb/toggle_rockets()
|
|
set name = "Toggle Jetpack Stabilization"
|
|
set category = VERB_CATEGORY_OBJECT
|
|
stabilization_on = !( stabilization_on )
|
|
to_chat(usr, "You toggle the stabilization [stabilization_on? "on":"off"].")
|
|
|
|
/obj/item/tank/jetpack/verb/toggle()
|
|
set name = "Toggle Jetpack"
|
|
set category = VERB_CATEGORY_OBJECT
|
|
|
|
on = !on
|
|
if(on)
|
|
ion_trail.start()
|
|
else
|
|
ion_trail.stop()
|
|
|
|
update_full_icon()
|
|
|
|
to_chat(usr, "You toggle the thrusters [on? "on":"off"].")
|
|
|
|
/obj/item/tank/jetpack/proc/allow_thrust(num, mob/living/user as mob)
|
|
if(!on)
|
|
return 0
|
|
if((num < 0.005 || air_contents.total_moles < num))
|
|
ion_trail.stop()
|
|
return 0
|
|
|
|
var/datum/gas_mixture/G = air_contents.remove(num)
|
|
|
|
var/allgases = G.gas[GAS_ID_CARBON_DIOXIDE] + G.gas[GAS_ID_NITROGEN] + G.gas[GAS_ID_OXYGEN] + G.gas[GAS_ID_PHORON]
|
|
if(allgases >= 0.005)
|
|
return 1
|
|
|
|
qdel(G)
|
|
return
|
|
|
|
/obj/item/tank/jetpack/ui_action_click(datum/action/action, datum/event_args/actor/actor)
|
|
toggle()
|
|
|
|
/obj/item/tank/jetpack/void
|
|
name = "void jetpack (oxygen)"
|
|
desc = "It works well in a void."
|
|
icon_state = "jetpack-void"
|
|
item_state_slots = list(SLOT_ID_RIGHT_HAND = "jetpack-void", SLOT_ID_LEFT_HAND = "jetpack-void")
|
|
|
|
/obj/item/tank/jetpack/void/Initialize(mapload)
|
|
. = ..()
|
|
air_contents.adjust_gas(GAS_ID_OXYGEN, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
|
|
|
/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_slots = list(SLOT_ID_RIGHT_HAND = "jetpack", SLOT_ID_LEFT_HAND = "jetpack")
|
|
|
|
/obj/item/tank/jetpack/oxygen/Initialize(mapload)
|
|
. = ..()
|
|
air_contents.adjust_gas(GAS_ID_OXYGEN, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
|
|
|
/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."
|
|
distribute_pressure = 0
|
|
icon_state = "jetpack-black"
|
|
item_state_slots = list(SLOT_ID_RIGHT_HAND = "jetpack-black", SLOT_ID_LEFT_HAND = "jetpack-black")
|
|
|
|
/obj/item/tank/jetpack/carbondioxide/Initialize(mapload)
|
|
. = ..()
|
|
air_contents.adjust_gas(GAS_ID_CARBON_DIOXIDE, (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C))
|
|
|
|
/obj/item/tank/jetpack/hardsuit
|
|
name = "jetpack"
|
|
desc = "It's a jetpack. This description should not see the light of day (well, space-day.). If you can see this, report it on the bug tracker."
|
|
var/obj/item/hardsuit/holder
|
|
|
|
/obj/item/tank/jetpack/hardsuit/allow_thrust(num, mob/living/user as mob)
|
|
|
|
if(!(src.on))
|
|
return 0
|
|
|
|
if(!istype(holder) || !holder.air_supply)
|
|
return 0
|
|
|
|
var/obj/item/tank/pressure_vessel = holder.air_supply
|
|
|
|
if((num < 0.005 || pressure_vessel.air_contents.total_moles < num))
|
|
src.ion_trail.stop()
|
|
return 0
|
|
|
|
var/datum/gas_mixture/G = pressure_vessel.air_contents.remove(num)
|
|
|
|
var/allgases = G.gas[GAS_ID_CARBON_DIOXIDE] + G.gas[GAS_ID_NITROGEN] + G.gas[GAS_ID_OXYGEN] + G.gas[GAS_ID_PHORON]
|
|
if(allgases >= 0.005)
|
|
return 1
|
|
qdel(G)
|
|
return
|
|
|
|
/obj/item/tank/jetpack/improvised
|
|
name = "improvised jetpack"
|
|
desc = "A jetpack made from two air tanks, a fire extinguisher and some atmospherics equipment. It doesn't look like it can hold much."
|
|
icon_state = "jetpack-improvised"
|
|
volume_rate = 5000
|