Merge pull request #14928 from Youtubeboy139/voidsuit-upgrade

The Suits of the Void
This commit is contained in:
Heroman3003
2023-06-02 04:52:44 +10:00
committed by CHOMPStation2
parent f5ab670839
commit f80bf21dff
2 changed files with 40 additions and 22 deletions

View File

@@ -32,7 +32,7 @@
max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECTION_TEMPERATURE max_heat_protection_temperature = SPACE_SUIT_MAX_HEAT_PROTECTION_TEMPERATURE
min_pressure_protection = 0 * ONE_ATMOSPHERE min_pressure_protection = 0 * ONE_ATMOSPHERE
max_pressure_protection = 10 * ONE_ATMOSPHERE max_pressure_protection = 10 * ONE_ATMOSPHERE
action_button_name = "Toggle Helmet"
species_restricted = list("Human", SPECIES_SKRELL, "Promethean") species_restricted = list("Human", SPECIES_SKRELL, "Promethean")
sprite_sheets = VR_SPECIES_SPRITE_SHEETS_SUIT_MOB sprite_sheets = VR_SPECIES_SPRITE_SHEETS_SUIT_MOB
sprite_sheets_obj = VR_SPECIES_SPRITE_SHEETS_SUIT_ITEM sprite_sheets_obj = VR_SPECIES_SPRITE_SHEETS_SUIT_ITEM
@@ -47,12 +47,23 @@
var/obj/item/clothing/head/helmet/helmet = null // Deployable helmet, if any. var/obj/item/clothing/head/helmet/helmet = null // Deployable helmet, if any.
var/obj/item/weapon/tank/tank = null // Deployable tank, if any. var/obj/item/weapon/tank/tank = null // Deployable tank, if any.
var/obj/item/device/suit_cooling_unit/cooler = null// Cooling unit, for FBPs. Cannot be installed alongside a tank. var/obj/item/device/suit_cooling_unit/cooler = null// Cooling unit, for FBPs. Cannot be installed alongside a tank.
//Cycler settings //Cycler settings
var/no_cycle = FALSE //stop this item from being put in a cycler var/no_cycle = FALSE //stop this item from being put in a cycler
//Does it spawn with any Inbuilt devices?
/obj/item/clothing/suit/space/void/Initialize()
. = ..()
if(boots && ispath(boots))
boots = new boots(src)
if(helmet && ispath(helmet))
helmet = new helmet(src)
if(tank && ispath(tank))
tank = new tank(src)
/obj/item/clothing/suit/space/void/examine(user) /obj/item/clothing/suit/space/void/examine(user)
. = ..() . = ..()
. += to_chat(usr, "<span class='notice'>Alt-click to relase Tank/Cooling unit if installed.</span>")
for(var/obj/item/I in list(helmet,boots,tank,cooler)) for(var/obj/item/I in list(helmet,boots,tank,cooler))
. += "It has \a [I] installed." . += "It has \a [I] installed."
if(tank && in_range(src,user)) if(tank && in_range(src,user))
@@ -145,13 +156,18 @@
helmet.set_light_flags(helmet.light_flags & ~LIGHT_ATTACHED) helmet.set_light_flags(helmet.light_flags & ~LIGHT_ATTACHED)
helmet = null helmet = null
/obj/item/clothing/suit/space/void/verb/toggle_helmet() /obj/item/clothing/suit/space/void/ui_action_click(mob/living/user, action_name)
if(..())
return TRUE
toggle_helmet()
/obj/item/clothing/suit/space/void/verb/toggle_helmet()
set name = "Toggle Helmet" set name = "Toggle Helmet"
set category = "Object" set category = "Object"
set src in usr set src in usr
if(!istype(src.loc,/mob/living)) return if(!isliving(loc))
return
if(!helmet) if(!helmet)
to_chat(usr, "There is no helmet installed.") to_chat(usr, "There is no helmet installed.")
@@ -159,44 +175,45 @@
var/mob/living/carbon/human/H = usr var/mob/living/carbon/human/H = usr
if(!istype(H)) if(!istype(H)) return
return if(H.stat) return
if(H.stat) if(H.wear_suit != src) return
return
if(H.wear_suit != src) if(helmet.light_on)
return to_chat(H, SPAN_NOTICE("The helmet light shuts off as it retracts."))
helmet.update_flashlight(H)
if(H.head == helmet) if(H.head == helmet)
to_chat(H, "<span class='notice'>You retract your suit helmet.</span>") to_chat(H, SPAN_NOTICE("You retract your suit helmet."))
helmet.canremove = TRUE helmet.canremove = TRUE
H.drop_from_inventory(helmet) H.drop_from_inventory(helmet)
helmet.forceMove(src) helmet.forceMove(src)
playsound(src.loc, 'sound/machines/click2.ogg', 75, 1)
else else
if(H.head) if(H.head)
to_chat(H, "<span class='danger'>You cannot deploy your helmet while wearing \the [H.head].</span>") to_chat(H, SPAN_DANGER("You cannot deploy your helmet while wearing \the [H.head]."))
return return
if(H.equip_to_slot_if_possible(helmet, slot_head)) if(H.equip_to_slot_if_possible(helmet, slot_head))
helmet.pickup(H)
helmet.canremove = FALSE helmet.canremove = FALSE
to_chat(H, "<span class='info'>You deploy your suit helmet, sealing you off from the world.</span>") to_chat(H, "<span class='info'>You deploy your suit helmet, sealing you off from the world.</span>")
playsound(src.loc, 'sound/machines/click2.ogg', 75, 1)
if(helmet.light_system == STATIC_LIGHT)
helmet.update_light() /obj/item/clothing/suit/space/void/AltClick(mob/living/user)
eject_tank()
/obj/item/clothing/suit/space/void/verb/eject_tank() /obj/item/clothing/suit/space/void/verb/eject_tank()
set name = "Eject Voidsuit Tank/Cooler" set name = "Eject Voidsuit Tank/Cooler"
set category = "Object" set category = "Object"
set src in usr set src in usr
if(!istype(src.loc,/mob/living)) return if(!istype(src.loc,/mob/living)) return
if(!tank && !cooler)
to_chat(usr, "There is no tank or cooling unit inserted.")
return
var/mob/living/carbon/human/H = usr var/mob/living/carbon/human/H = usr
if(!tank && !cooler)
to_chat(H, SPAN_NOTICE("There is no tank or cooling unit inserted."))
return
if(!istype(H)) return if(!istype(H)) return
if(H.stat) return if(H.stat) return
if(H.wear_suit != src) return if(H.wear_suit != src) return
@@ -208,7 +225,8 @@
else else
removing = cooler removing = cooler
cooler = null cooler = null
to_chat(H, "<span class='info'>You press the emergency release, ejecting \the [removing] from your suit.</span>") to_chat(H, SPAN_DANGER("You press the emergency release, ejecting \the [removing] from your suit."))
playsound(src.loc, 'sound/machines/click.ogg', 75, 1)
removing.canremove = TRUE removing.canremove = TRUE
H.drop_from_inventory(removing) H.drop_from_inventory(removing)

BIN
sound/machines/click2.ogg Normal file

Binary file not shown.