Skip to content

Commit

Permalink
Modsuit prep: Bodyheat Audit & Hardsuit temperature regulators (#11174)
Browse files Browse the repository at this point in the history
* repairable-helmets

* hardsuit cells

* fix hardsuit cells

* thermal protection patch

* fix draining when off

* stat panel charge

* chat feedback

* bad number

* changeling suit hud fix

* Breathe does heat

* procRef, ninja hardsuit, hud icon

* verdammt

* Work!

* closer

* lets try something

* nulled
  • Loading branch information
Tsar-Salat authored Jul 30, 2024
1 parent f2c1faf commit b9a272d
Show file tree
Hide file tree
Showing 32 changed files with 484 additions and 109 deletions.
13 changes: 9 additions & 4 deletions code/__DEFINES/atmospherics.dm
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,15 @@
/// The temperature the blue icon is displayed.
#define BODYTEMP_COLD_WARNING_3 (BODYTEMP_COLD_DAMAGE_LIMIT - 150) //120k

#define SPACE_HELM_MIN_TEMP_PROTECT 2.0 //! what min_cold_protection_temperature is set to for space-helmet quality headwear. MUST NOT BE 0.
#define SPACE_HELM_MAX_TEMP_PROTECT 1500 //! Thermal insulation works both ways /Malkevin
#define SPACE_SUIT_MIN_TEMP_PROTECT 2.0 //! what min_cold_protection_temperature is set to for space-suit quality jumpsuits or suits. MUST NOT BE 0.
#define SPACE_SUIT_MAX_TEMP_PROTECT 1500
/// what min_cold_protection_temperature is set to for space-helmet quality headwear. MUST NOT BE 0.
#define SPACE_HELM_MIN_TEMP_PROTECT 2.0
/// Thermal insulation works both ways /Malkevin
#define SPACE_HELM_MAX_TEMP_PROTECT 1500
/// what min_cold_protection_temperature is set to for space-suit quality jumpsuits or suits. MUST NOT BE 0.
#define SPACE_SUIT_MIN_TEMP_PROTECT 2.0
/// The min cold protection of a space suit without the heater active
#define SPACE_SUIT_MIN_TEMP_PROTECT_OFF 72
#define SPACE_SUIT_MAX_TEMP_PROTECT 1500

#define FIRE_SUIT_MIN_TEMP_PROTECT 60 //! Cold protection for firesuits
#define FIRE_SUIT_MAX_TEMP_PROTECT 30000 //! what max_heat_protection_temperature is set to for firesuit quality suits. MUST NOT BE 0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@

///from [/mob/living/carbon/human/Move]: ()
#define COMSIG_SHOES_STEP_ACTION "shoes_step_action"
///from base of /obj/item/clothing/suit/space/proc/toggle_spacesuit(): (obj/item/clothing/suit/space/suit)
#define COMSIG_SUIT_SPACE_TOGGLE "suit_space_toggle"
5 changes: 3 additions & 2 deletions code/_onclick/hud/_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,9 @@
//Middle right (status indicators)
#define ui_healthdoll "EAST-1:28,CENTER-2:13"
#define ui_health "EAST-1:28,CENTER-1:15"
#define ui_internal "EAST-1:28,CENTER:17"
#define ui_mood "EAST-1:28,CENTER-3:10"
#define ui_internal "EAST-1:28,CENTER-3:10"
#define ui_mood "EAST-1:28,CENTER:17"
#define ui_spacesuit "EAST-1:28,CENTER-4:10"

//borgs
#define ui_borg_health "EAST-1:28,CENTER-1:15" //borgs have the health display where humans have the pressure damage indicator.
Expand Down
1 change: 1 addition & 0 deletions code/_onclick/hud/hud.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
var/atom/movable/screen/healths
var/atom/movable/screen/healthdoll
var/atom/movable/screen/internals
var/atom/movable/screen/spacesuit

// subtypes can override this to force a specific UI style
var/ui_style
Expand Down
4 changes: 4 additions & 0 deletions code/_onclick/hud/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,10 @@
internals.hud = src
infodisplay += internals

spacesuit = new /atom/movable/screen/spacesuit
spacesuit.hud = src
infodisplay += spacesuit

healths = new /atom/movable/screen/healths()
healths.hud = src
infodisplay += healths
Expand Down
17 changes: 0 additions & 17 deletions code/_onclick/hud/map_popups.dm
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,6 @@
*/
var/list/screen_maps = list()

/atom/movable/screen
/**
* Map name assigned to this object.
* Automatically set by /client/proc/add_obj_to_map.
*/
var/assigned_map
/**
* Mark this object as garbage-collectible after you clean the map
* it was registered on.
*
* This could probably be changed to be a proc, for conditional removal.
* But for now, this works.
*/
var/del_on_map_removal = TRUE
///Can we throw things at this
var/can_throw_target = FALSE

/**
* A screen object, which acts as a container for turfs and other things
* you want to show on the map, which you usually attach to "vis_contents".
Expand Down
20 changes: 20 additions & 0 deletions code/_onclick/hud/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,21 @@
appearance_flags = APPEARANCE_UI
/// A reference to the owner HUD, if any.
var/datum/hud/hud = null
/**
* Map name assigned to this object.
* Automatically set by /client/proc/add_obj_to_map.
*/
var/assigned_map
/**
* Mark this object as garbage-collectible after you clean the map
* it was registered on.
*
* This could probably be changed to be a proc, for conditional removal.
* But for now, this works.
*/
var/del_on_map_removal = TRUE
///Can we throw things at this
var/can_throw_target = FALSE

/atom/movable/screen/examine(mob/user)
return list()
Expand Down Expand Up @@ -341,6 +356,11 @@
return
C.update_action_buttons_icon()

/atom/movable/screen/spacesuit
name = "Space suit cell status"
icon_state = "spacesuit_0"
screen_loc = ui_spacesuit

/atom/movable/screen/mov_intent
name = "run/walk toggle"
icon = 'icons/mob/screen_midnight.dmi'
Expand Down
24 changes: 24 additions & 0 deletions code/datums/action.dm
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,30 @@
if(istype(H))
H.interact(owner)

/datum/action/item_action/toggle_spacesuit
name = "Toggle Suit Thermal Regulator"
icon_icon = 'icons/mob/actions/actions_spacesuit.dmi'
button_icon_state = "thermal_off"

/datum/action/item_action/toggle_spacesuit/New(Target)
. = ..()
RegisterSignal(target, COMSIG_SUIT_SPACE_TOGGLE, PROC_REF(toggle))

/datum/action/item_action/toggle_spacesuit/Destroy()
UnregisterSignal(target, COMSIG_SUIT_SPACE_TOGGLE)
return ..()

/datum/action/item_action/toggle_spacesuit/Trigger()
var/obj/item/clothing/suit/space/suit = target
if(!istype(suit))
return
suit.toggle_spacesuit()

/// Toggle the action icon for the space suit thermal regulator
/datum/action/item_action/toggle_spacesuit/proc/toggle(obj/item/clothing/suit/space/suit)
button_icon_state = "thermal_[suit.thermal_on ? "on" : "off"]"
UpdateButtonIcon()

/datum/action/item_action/toggle_unfriendly_fire
name = "Toggle Friendly Fire \[ON\]"
desc = "Toggles if the club's blasts cause friendly fire."
Expand Down
12 changes: 12 additions & 0 deletions code/game/machinery/suit_storage_unit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,18 @@
if(mob_occupant)
dump_inventory_contents()

/obj/machinery/suit_storage_unit/process()
if(!suit)
return
if(!istype(suit, /obj/item/clothing/suit/space))
return
if(!suit.cell)
return

var/obj/item/stock_parts/cell/C = suit.cell
use_power(charge_rate)
C.give(charge_rate)

/obj/machinery/suit_storage_unit/proc/shock(mob/user, prb)
if(!prob(prb))
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
Expand Down
5 changes: 4 additions & 1 deletion code/game/objects/items/inducer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@
var/coefficient = 1
var/obj/item/organ/stomach/battery/battery
if(istype(A, /obj/item/gun/energy))
to_chat(user,"Error unable to interface with device")
to_chat(user, "<span class='alert'>Error unable to interface with device.</span>")
return FALSE
if(istype(A, /obj/item/clothing/suit/space))
to_chat(user, "<span class='alert'>Error unable to interface with device.</span>")
return FALSE
if(istype(A, /obj))
O = A
Expand Down
8 changes: 8 additions & 0 deletions code/modules/antagonists/changeling/powers/mutations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,9 @@
armor = list(MELEE = 35, BULLET = 25, LASER = 25, ENERGY = 30, BOMB = 30, BIO = 20, RAD = 20, FIRE = 90, ACID = 90, STAMINA = 10, BLEED = 80)//Bit less armoured than the Syndicate space suit
slowdown = 0.2
var/datum/reagent/salbutamol = /datum/reagent/medicine/salbutamol
actions_types = list()
cell = null
show_hud = FALSE

/obj/item/clothing/suit/space/changeling/Initialize(mapload)
. = ..()
Expand All @@ -413,10 +416,15 @@
loc.visible_message("<span class='warning'>[loc.name]\'s flesh rapidly inflates, forming a bloated mass around [loc.p_their()] body!</span>", "<span class='warning'>We inflate our flesh, creating a spaceproof suit!</span>", "<span class='italics'>You hear organic matter ripping and tearing!</span>")
START_PROCESSING(SSobj, src)

// seal the cell door
/obj/item/clothing/suit/space/changeling/toggle_spacesuit_cell(mob/user)
return

/obj/item/clothing/suit/space/changeling/process(delta_time)
if(ishuman(loc))
var/mob/living/carbon/human/H = loc
H.reagents.add_reagent(salbutamol, initial(salbutamol.metabolization_rate) * (delta_time / SSMOBS_DT))
H.adjust_bodytemperature(temperature_setting - H.bodytemperature) // force changelings to normal temp step mode played badly

/obj/item/clothing/head/helmet/space/changeling
name = "flesh mass"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,7 @@
/datum/outfit/nuclear_operative
name = "Nuclear Operative (Preview only)"

suit = /obj/item/clothing/suit/space/hardsuit/syndi
suit = /obj/item/clothing/suit/space/hardsuit/syndipreview
head = /obj/item/clothing/head/helmet/space/hardsuit/syndi

/datum/role_preference/antagonist/wizard
Expand Down
2 changes: 1 addition & 1 deletion code/modules/antagonists/role_preference/role_midrounds.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
/datum/outfit/pirate_space_preview
name = "Space Pirate (Preview only)"
uniform = /obj/item/clothing/under/costume/pirate
suit = /obj/item/clothing/suit/space/pirate
suit = /obj/item/clothing/suit/costume/pirate
head = /obj/item/clothing/head/helmet/space/pirate/bandana
glasses = /obj/item/clothing/glasses/eyepatch

Expand Down
2 changes: 1 addition & 1 deletion code/modules/clothing/head/helmet.dm
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
item_state = "rus_ushanka"
body_parts_covered = HEAD
cold_protection = HEAD
min_cold_protection_temperature = SPACE_SUIT_MIN_TEMP_PROTECT
min_cold_protection_temperature = SPACE_HELM_MIN_TEMP_PROTECT
armor = list(MELEE = 25, BULLET = 20, LASER = 20, ENERGY = 10, BOMB = 20, BIO = 50, RAD = 20, FIRE = -10, ACID = 50, STAMINA = 20, BLEED = 15)

/obj/item/clothing/head/helmet/outlaw
Expand Down
Loading

0 comments on commit b9a272d

Please sign in to comment.