Skip to content

Commit

Permalink
Voidsuits. (#417)
Browse files Browse the repository at this point in the history
* hardsuit files

* softsuit sprites

* hardsoots

* buff modsuits

* rename hardsuits

* teshari hardsuits

* suit cycler changes

* remove storage modules from most hardsuits

* remove storage design

* signal registration bug

* bruh

* box = null

* fix regression in labcoats

* fix actions

* better interaction
  • Loading branch information
Kapu1178 authored Jul 8, 2023
1 parent 5a3268c commit 66212c1
Show file tree
Hide file tree
Showing 42 changed files with 495 additions and 122 deletions.
8 changes: 4 additions & 4 deletions _maps/map_files/MetaStation/MetaStation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -15460,14 +15460,14 @@
/obj/effect/turf_decal/stripes/line{
dir = 8
},
/obj/machinery/space_heater,
/obj/effect/turf_decal/tile/yellow{
dir = 4
},
/obj/effect/turf_decal/tile/yellow{
dir = 8
},
/obj/effect/turf_decal/tile/neutral,
/obj/machinery/suit_storage_unit/atmos/mod,
/turf/open/floor/iron,
/area/station/engineering/atmos/storage/gas)
"exL" = (
Expand Down Expand Up @@ -36864,10 +36864,10 @@
/turf/open/floor/iron/checker,
/area/station/science/research)
"mrb" = (
/obj/machinery/suit_storage_unit/atmos,
/obj/effect/turf_decal/stripes/line{
dir = 8
},
/obj/machinery/space_heater,
/turf/open/floor/iron,
/area/station/engineering/atmos)
"mrd" = (
Expand Down Expand Up @@ -42990,10 +42990,10 @@
/turf/open/floor/plating,
/area/station/maintenance/starboard/lesser)
"oyN" = (
/obj/machinery/suit_storage_unit/engine,
/obj/effect/turf_decal/bot{
dir = 1
},
/obj/machinery/suit_storage_unit/engine/mod,
/turf/open/floor/iron{
dir = 1
},
Expand Down Expand Up @@ -44106,11 +44106,11 @@
/obj/structure/window/reinforced{
dir = 1
},
/obj/machinery/space_heater,
/obj/effect/turf_decal/tile/yellow{
dir = 4
},
/obj/effect/turf_decal/tile/neutral,
/obj/machinery/suit_storage_unit/atmos,
/turf/open/floor/iron,
/area/station/engineering/atmos/storage/gas)
"oUF" = (
Expand Down
22 changes: 18 additions & 4 deletions code/game/machinery/suit_storage_unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,21 @@

/obj/machinery/suit_storage_unit/engine
mask_type = /obj/item/clothing/mask/breath
mod_type = /obj/item/mod/control/pre_equipped/engineering
suit_type = /obj/item/clothing/suit/space/hardsuit/engine
storage_type = /obj/item/clothing/shoes/magboots

/obj/machinery/suit_storage_unit/engine/mod
suit_type = /obj/item/mod/control/pre_equipped/engineering
storage_type = null

/obj/machinery/suit_storage_unit/atmos
mask_type = /obj/item/clothing/mask/gas/atmos
storage_type = /obj/item/watertank/atmos
suit_type = /obj/item/clothing/suit/space/hardsuit/atmos
storage_type = /obj/item/clothing/shoes/magboots

/obj/machinery/suit_storage_unit/atmos/mod
mod_type = /obj/item/mod/control/pre_equipped/atmospheric
storage_type = /obj/item/watertank/atmos

/obj/machinery/suit_storage_unit/ce
mask_type = /obj/item/clothing/mask/breath
Expand All @@ -84,7 +93,7 @@

/obj/machinery/suit_storage_unit/security
mask_type = /obj/item/clothing/mask/gas/sechailer
mod_type = /obj/item/mod/control/pre_equipped/security
suit_type = /obj/item/clothing/suit/space/hardsuit/security

/obj/machinery/suit_storage_unit/hos
mask_type = /obj/item/clothing/mask/gas/sechailer
Expand All @@ -103,7 +112,7 @@
/obj/machinery/suit_storage_unit/medical
mask_type = /obj/item/clothing/mask/breath/medical
storage_type = /obj/item/tank/internals/oxygen
mod_type = /obj/item/mod/control/pre_equipped/medical
suit_type = /obj/item/clothing/suit/space/hardsuit/medical

/obj/machinery/suit_storage_unit/cmo
mask_type = /obj/item/clothing/mask/breath/medical
Expand All @@ -114,6 +123,11 @@
mask_type = /obj/item/clothing/mask/breath
mod_type = /obj/item/mod/control/pre_equipped/research

/obj/machinery/suit_storage_unit/toxins
mask_type = /obj/item/clothing/mask/breath
suit_type = /obj/item/clothing/suit/space/hardsuit/toxins
storage_type = /obj/item/tank/internals/oxygen

/obj/machinery/suit_storage_unit/syndicate
mask_type = /obj/item/clothing/mask/gas/syndicate
storage_type = /obj/item/tank/jetpack/oxygen/harness
Expand Down
6 changes: 4 additions & 2 deletions code/game/objects/items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
var/list/species_exception = null
///This is a bitfield that defines what variations exist for bodyparts like Digi legs. See: code\_DEFINES\inventory.dm
var/supports_variations_flags = NONE
///A blacklist of bodytypes that aren't allowed to equip this item
var/restricted_bodytypes = NONE

///A weakref to the mob who threw the item
var/datum/weakref/thrownby = null //I cannot verbally describe how much I hate this var
Expand Down Expand Up @@ -1311,9 +1313,9 @@ GLOBAL_DATUM_INIT(welding_sparks, /mutable_appearance, mutable_appearance('icons
* * status_only - Update only current availability status of the buttons to show if they are ready or not to use
* * force - Force buttons update even if the given button icon state has not changed
*/
/obj/item/proc/update_action_buttons(status_only = FALSE, force = FALSE)
/obj/item/proc/update_action_buttons(force = FALSE)
for(var/datum/action/current_action as anything in actions)
current_action.build_all_button_icons(status_only, force)
current_action.build_all_button_icons(null, force)

// Update icons if this is being carried by a mob
/obj/item/wash(clean_types)
Expand Down
6 changes: 0 additions & 6 deletions code/modules/clothing/head/helmet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -533,12 +533,6 @@
visible_message(span_warning("[src] falls off of [magnification]'s head as it changes shape!"))
magnification.dropItemToGround(src)

//LightToggle

/obj/item/clothing/head/helmet/Initialize(mapload)
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)

/obj/item/clothing/head/helmet/update_icon_state()
if(attached_light)
var/state = "[initial(icon_state)]"
Expand Down
28 changes: 8 additions & 20 deletions code/modules/clothing/spacesuits/_spacesuits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@
return TOOL_ACT_TOOLTYPE_SUCCESS

/obj/item/clothing/suit/space/screwdriver_act(mob/living/user, obj/item/tool)
if(cell_cover_open)
if(cell)
remove_cell(user)
return TOOL_ACT_TOOLTYPE_SUCCESS

var/range_low = 20 // Default min temp c
var/range_high = 45 // default max temp c
if(obj_flags & EMAGGED)
Expand All @@ -165,31 +170,14 @@
to_chat(user, span_notice("You successfully install \the [cell] into [src]."))
return

/// Open the cell cover when ALT+Click on the suit
/obj/item/clothing/suit/space/AltClick(mob/living/user)
if(!user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY, FALSE, !iscyborg(user)))
return ..()
toggle_spacesuit_cell(user)

/// Remove the cell whent he cover is open on CTRL+Click
/obj/item/clothing/suit/space/CtrlClick(mob/living/user)
if(user.canUseTopic(src, BE_CLOSE, NO_DEXTERITY, FALSE, !iscyborg(user)))
if(cell_cover_open && cell)
remove_cell(user)
return
return ..()

// Remove the cell when using the suit on its self
/obj/item/clothing/suit/space/attack_self(mob/user)
remove_cell(user)

/// Remove the cell from the suit if the cell cover is open
/obj/item/clothing/suit/space/proc/remove_cell(mob/user)
if(cell_cover_open && cell)
user.visible_message(span_notice("[user] removes \the [cell] from [src]!"), \
span_notice("You remove [cell]."))
span_notice("You remove [cell] from [src]."))
cell.add_fingerprint(user)
user.put_in_hands(cell)
if(!user.put_in_hands(cell))
cell.forceMove(user.drop_location())
cell = null

/// Toggle the space suit's cell cover
Expand Down
65 changes: 65 additions & 0 deletions code/modules/clothing/spacesuits/hardsuits/_hardsuit_helmets.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/obj/item/clothing/head/helmet/space/hardsuit
name = "voidsuit helmet"
desc = "A special helmet designed for work in a hazardous, low-pressure environment. Has radiation shielding."
icon = 'icons/obj/clothing/hardsuits/helmet.dmi'
worn_icon = 'icons/mob/clothing/hardsuit/hardsuit_helm.dmi'
icon_state = "hardsuit0-engineering"
inhand_icon_state = "eng_helm"
max_integrity = 300
armor = list(MELEE = 10, BULLET = 5, LASER = 10, ENERGY = 20, BOMB = 10, BIO = 100, FIRE = 50, ACID = 75)
light_system = MOVABLE_LIGHT_DIRECTIONAL
light_outer_range = 4
light_power = 1
light_on = FALSE
actions_types = list(/datum/action/item_action/toggle_helmet_light)
flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH | PEPPERPROOF
visor_flags_cover = HEADCOVERSEYES | HEADCOVERSMOUTH | PEPPERPROOF
supports_variations_flags = CLOTHING_TESHARI_VARIATION

var/basestate = "hardsuit"
var/on = FALSE
var/obj/item/clothing/suit/space/hardsuit/suit
var/hardsuit_type = "engineering" //Determines used sprites: hardsuit[on]-[type]

/obj/item/clothing/head/helmet/space/hardsuit/Destroy()
if(!QDELETED(suit))
QDEL_NULL(suit)
return ..()

/obj/item/clothing/head/helmet/space/hardsuit/update_icon_state()
. = ..()
icon_state = "[basestate][on]-[hardsuit_type]"

/obj/item/clothing/head/helmet/space/hardsuit/attack_self(mob/user)
on = !on
update_icon(UPDATE_ICON_STATE)

set_light_on(on)

update_action_buttons()

/obj/item/clothing/head/helmet/space/hardsuit/dropped(mob/user)
..()
if(suit)
suit.RemoveHelmet()

/obj/item/clothing/head/helmet/space/hardsuit/item_action_slot_check(slot)
if(slot == ITEM_SLOT_HEAD)
return 1

/obj/item/clothing/head/helmet/space/hardsuit/equipped(mob/user, slot)
..()
if(slot != ITEM_SLOT_HEAD)
if(suit)
suit.RemoveHelmet()
else
qdel(src)

/obj/item/clothing/head/helmet/space/hardsuit/proc/display_visor_message(msg)
var/mob/wearer = loc
if(msg && ishuman(wearer))
wearer.play_screen_text(msg, /atom/movable/screen/text/screen_text/picture/hardsuit_visor)

/obj/item/clothing/head/helmet/space/hardsuit/emp_act(severity)
. = ..()
display_visor_message("<b>[severity > 1 ? "LIGHT" : "STRONG"] ELECTROMAGNETIC PULSE DETECTED!</b>")
136 changes: 136 additions & 0 deletions code/modules/clothing/spacesuits/hardsuits/_hardsuits.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
/// How much damage you take from an emp when wearing a hardsuit
#define HARDSUIT_EMP_BURN 2 // a very orange number

/obj/item/clothing/suit/space/hardsuit
name = "voidsuit"
desc = "A special suit that protects against hazardous, low pressure environments. Has radiation shielding."
icon = 'icons/obj/clothing/hardsuits/suit.dmi'
worn_icon = 'icons/mob/clothing/hardsuit/hardsuit_body.dmi'
icon_state = "hardsuit-engineering"
inhand_icon_state = "eng_hardsuit"
max_integrity = 300
armor = list(MELEE = 10, BULLET = 5, LASER = 10, ENERGY = 20, BOMB = 10, BIO = 100, FIRE = 50, ACID = 75, WOUND = 10)
allowed = list(/obj/item/flashlight, /obj/item/tank/internals, /obj/item/t_scanner, /obj/item/construction/rcd, /obj/item/pipe_dispenser)
siemens_coefficient = 0
actions_types = list(/datum/action/item_action/toggle_spacesuit, /datum/action/item_action/toggle_helmet)
supports_variations_flags = CLOTHING_TESHARI_VARIATION
slowdown = 1

var/obj/item/clothing/head/helmet/space/hardsuit/helmet
var/helmettype = /obj/item/clothing/head/helmet/space/hardsuit
/// Whether the helmet is on.
var/helmet_on = FALSE

/obj/item/clothing/suit/space/hardsuit/Initialize(mapload)
. = ..()

MakeHelmet()

/obj/item/clothing/suit/space/hardsuit/Destroy()
if(!QDELETED(helmet))
QDEL_NULL(helmet)
return ..()

/obj/item/clothing/suit/space/hardsuit/proc/MakeHelmet()
if(!helmettype)
return
if(!helmet)
var/obj/item/clothing/head/helmet/space/hardsuit/W = new helmettype(src)
W.suit = src
helmet = W

/obj/item/clothing/suit/space/hardsuit/proc/RemoveHelmet()
if(!helmet)
return
helmet_on = FALSE
if(ishuman(helmet.loc))
var/mob/living/carbon/H = helmet.loc
if(helmet.on)
helmet.attack_self(H)
H.transferItemToLoc(helmet, src, TRUE)
H.update_worn_oversuit()
to_chat(H, span_notice("The helmet on the hardsuit disengages."))
playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, TRUE)
else
helmet.forceMove(src)

/obj/item/clothing/suit/space/hardsuit/proc/ToggleHelmet()
var/mob/living/carbon/human/H = src.loc
if(!istype(src.loc) || !helmettype)
return
if(!helmet)
to_chat(H, span_warning("The helmet's lightbulb seems to be damaged! You'll need a replacement bulb."))
return
if(!helmet_on)
if(H.wear_suit != src)
to_chat(H, span_warning("You must be wearing [src] to engage the helmet!"))
return
if(H.head)
to_chat(H, span_warning("You're already wearing something on your head!"))
return
else if(H.equip_to_slot_if_possible(helmet,ITEM_SLOT_HEAD,0,0,1))
to_chat(H, span_notice("You engage the helmet on the hardsuit."))
helmet_on = TRUE
H.update_worn_oversuit()
playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, TRUE)
else
RemoveHelmet()

/obj/item/clothing/suit/space/hardsuit/ui_action_click(mob/user, actiontype)
if(istype(actiontype, /datum/action/item_action/toggle_helmet))
ToggleHelmet()
else
return ..()

/obj/item/clothing/suit/space/hardsuit/attack_self(mob/user)
user.changeNext_move(CLICK_CD_MELEE)
..()

/obj/item/clothing/suit/space/hardsuit/examine(mob/user)
. = ..()
if(!helmet && helmettype)
. += span_notice("The helmet on [src] seems to be malfunctioning. Its light bulb needs to be replaced.")

/obj/item/clothing/suit/space/hardsuit/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/light) && helmettype)
if(src == user.get_item_by_slot(ITEM_SLOT_OCLOTHING))
to_chat(user, span_warning("You cannot replace the bulb in the helmet of [src] while wearing it."))
return
if(helmet)
to_chat(user, span_warning("The helmet of [src] does not require a new bulb."))
return
var/obj/item/light/L = I
if(L.status)
to_chat(user, span_warning("This bulb is too damaged to use as a replacement!"))
return
if(do_after(user, 5 SECONDS, src))
qdel(I)
helmet = new helmettype(src)
to_chat(user, span_notice("You have successfully repaired [src]'s helmet."))
new /obj/item/light/bulb/broken(drop_location())
return ..()

/obj/item/clothing/suit/space/hardsuit/equipped(mob/user, slot)
..()
if(helmet && slot != ITEM_SLOT_OCLOTHING)
RemoveHelmet()

/obj/item/clothing/suit/space/hardsuit/dropped(mob/user)
..()
RemoveHelmet()

/obj/item/clothing/suit/space/hardsuit/item_action_slot_check(slot)
if(slot == ITEM_SLOT_OCLOTHING) //we only give the mob the ability to toggle the helmet if he's wearing the hardsuit.
return 1

/// Burn the person inside the hard suit just a little, the suit got really hot for a moment
/obj/item/clothing/suit/space/emp_act(severity)
. = ..()
var/mob/living/carbon/human/user = src.loc
if(istype(user))
user.apply_damage(HARDSUIT_EMP_BURN, BURN, spread_damage=TRUE)
to_chat(user, span_warning("You feel \the [src] heat up from the EMP burning you slightly."))

// Chance to scream
if (user.stat < UNCONSCIOUS && prob(10))
user.emote("scream")
Loading

0 comments on commit 66212c1

Please sign in to comment.