Skip to content

Commit 18639c1

Browse files
Replaces internals button with stamina bar (PentestSS13#122)
<!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> <!-- You can view Contributing.MD for a detailed description of the pull request process. --> ## About The Pull Request Ports stamina bar from tg and replaces internals button with it <!-- Describe The Pull Request. Please be sure every change is documented or this can delay review and even discourage maintainers from merging your PR! --> ## Why It's Good For The Game Makes it easier to see if you are actually dying or if you're just tired. Internals button isn't really needed considering that you can just click the o2 tank at top left. <!-- Please add a short description of why you think these changes would benefit the game. If you can't justify it in words, it might not be worth adding. --> ## Changelog :cl: add: Ported stamina bar from tg del: Removed internals button from the hud /:cl: <!-- Both :cl:'s are required for the changelog to work! You can put your name to the right of the first :cl: if you want to overwrite your GitHub username as author ingame. --> <!-- You can use multiple of the same prefix (they're only used for the icon ingame) and delete the unneeded ones. Despite some of the tags, changelogs should generally represent how a player might be affected by the changes rather than a summary of the PR's contents. --> --------- Co-authored-by: KnighTheThrasher <[email protected]> Co-authored-by: Ossa88 (SYNAPSE) <[email protected]>
1 parent d8d2b94 commit 18639c1

File tree

17 files changed

+80
-24
lines changed

17 files changed

+80
-24
lines changed

code/_onclick/hud/_defines.dm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@
7070
//Middle right (status indicators)
7171
#define ui_healthdoll "EAST-1:28,CENTER-2:13"
7272
#define ui_health "EAST-1:28,CENTER-1:15"
73-
#define ui_internal "EAST-1:28,CENTER:17"
73+
//#define ui_internal "EAST-1:28,CENTER:17" //PENTEST REMOVAL
74+
#define ui_stamina "EAST-1:28,CENTER:17" //PENTEST ADDITION
7475
#define ui_mood "EAST-1:28,CENTER-3:10"
7576

7677
//Pop-up inventory

code/_onclick/hud/hud.dm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
5858

5959
var/atom/movable/screen/healths
6060
var/atom/movable/screen/healthdoll
61-
var/atom/movable/screen/internals
61+
var/atom/movable/screen/stamina //PENTEST EDIT - START
62+
//var/atom/movable/screen/internals //PENTEST EDIT - END
6263

6364
var/atom/movable/screen/progbar_container/use_timer
6465
// subtypes can override this to force a specific UI style
@@ -107,8 +108,9 @@ GLOBAL_LIST_INIT(available_ui_styles, list(
107108
QDEL_LIST(infodisplay)
108109

109110
healths = null
111+
stamina = null //PENTEST ADDITION
110112
healthdoll = null
111-
internals = null
113+
//internals = null //PENTEST REMOVAL
112114
lingchemdisplay = null
113115
lingstingdisplay = null
114116
alien_plasma_display = null

code/_onclick/hud/human.dm

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,9 +282,9 @@
282282
rest_icon.hud = src
283283
static_inventory += rest_icon
284284

285-
internals = new /atom/movable/screen/internals()
285+
/* internals = new /atom/movable/screen/internals() //PENTEST REMOVAL
286286
internals.hud = src
287-
infodisplay += internals
287+
infodisplay += internals */
288288

289289
healths = new /atom/movable/screen/healths()
290290
healths.hud = src
@@ -294,6 +294,10 @@
294294
healthdoll.hud = src
295295
infodisplay += healthdoll
296296

297+
stamina = new /atom/movable/screen/stamina() //PENTEST ADDITION - START
298+
stamina.hud = src
299+
infodisplay += stamina //PENTEST ADDITION - END
300+
297301
pull_icon = new /atom/movable/screen/pull()
298302
pull_icon.icon = ui_style
299303
pull_icon.update_appearance()

code/_onclick/hud/monkey.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@
8989
throw_icon.hud = src
9090
hotkeybuttons += throw_icon
9191

92-
internals = new /atom/movable/screen/internals()
92+
/* internals = new /atom/movable/screen/internals() //PENTEST REMOVAL
9393
internals.hud = src
94-
infodisplay += internals
94+
infodisplay += internals*/
9595

9696
healths = new /atom/movable/screen/healths()
9797
healths.hud = src

code/_onclick/hud/screen_objects.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,7 +302,7 @@
302302
icon = 'icons/hud/screen_cyborg.dmi'
303303
screen_loc = ui_borg_intents
304304

305-
/atom/movable/screen/internals
305+
/* /atom/movable/screen/internals //PENTEST REMOVAL
306306
name = "toggle internals"
307307
icon_state = "internal0"
308308
screen_loc = ui_internal
@@ -367,7 +367,7 @@
367367
else
368368
to_chat(breather, "<span class='warning'>You don't have an oxygen tank!</span>")
369369
return
370-
breather.update_action_buttons_icon()
370+
breather.update_action_buttons_icon()*/
371371

372372
/atom/movable/screen/mov_intent
373373
name = "run/walk toggle"

code/game/gamemodes/sandbox/h_sandbox.dm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,8 @@ GLOBAL_VAR_INIT(hsboxspawn, TRUE)
175175
P.back.plane = ABOVE_HUD_PLANE
176176
P.update_inv_back()
177177
P.internal = P.back
178-
P.update_internals_hud_icon(1)
178+
P.update_action_buttons_icon() //PENTEST EDIT
179+
//P.update_internals_hud_icon(1) //PENTEST REMOVE
179180

180181
if("hsbscrubber") // This is beyond its normal capability but this is sandbox and you spawned one, I assume you need it
181182
var/obj/hsb = new/obj/machinery/portable_atmospherics/scrubber{volume_rate=50*ONE_ATMOSPHERE;on=1}(usr.loc)

code/game/objects/items/tanks/tanks.dm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
if(breather.internal == src)
3434
to_chat(breather, "<span class='notice'>You close [src] valve.</span>")
3535
breather.internal = null
36-
breather.update_internals_hud_icon(0)
36+
//breather.update_internals_hud_icon(0) //PENTEST REMOVAL
3737
else
3838
if(!breather.getorganslot(ORGAN_SLOT_BREATHING_TUBE))
3939
var/obj/item/clothing/clothes_check = breather.wear_mask
@@ -59,7 +59,7 @@
5959
else
6060
to_chat(breather, "<span class='notice'>You open [src] valve.</span>")
6161
breather.internal = src
62-
breather.update_internals_hud_icon(1)
62+
//breather.update_internals_hud_icon(1) //PENTEST REMOVAL
6363
breather.update_action_buttons_icon()
6464

6565

code/modules/mob/living/carbon/carbon.dm

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -206,11 +206,13 @@
206206
if(do_after(usr, POCKET_STRIP_DELAY, src))
207207
if(internal)
208208
internal = null
209-
update_internals_hud_icon(0)
209+
//update_internals_hud_icon(0) //PENTEST EDIT
210+
update_action_buttons_icon()
210211
else if(ITEM && istype(ITEM, /obj/item/tank))
211212
if((wear_mask && (wear_mask.clothing_flags & ALLOWINTERNALS)) || getorganslot(ORGAN_SLOT_BREATHING_TUBE))
212213
internal = ITEM
213-
update_internals_hud_icon(1)
214+
//update_internals_hud_icon(1)
215+
update_action_buttons_icon() //PENTEST EDIT
214216

215217
visible_message("<span class='danger'>[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM.name].</span>", \
216218
"<span class='userdanger'>[usr] [internal ? "opens" : "closes"] the valve on your [ITEM.name].</span>", null, null, usr)
@@ -543,7 +545,7 @@
543545
REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, STAMINA)
544546
else
545547
return
546-
update_health_hud()
548+
update_stamina_hud() //PENTEST EDIT HEALTH TO STAMINA
547549

548550
/mob/living/carbon/update_sight()
549551
if(!client)
@@ -768,9 +770,9 @@
768770
else
769771
hud_used.healths.icon_state = "health7"
770772

771-
/mob/living/carbon/proc/update_internals_hud_icon(internal_state = 0)
773+
/*/mob/living/carbon/proc/update_internals_hud_icon(internal_state = 0) //PENTEST REMOVAL
772774
if(hud_used && hud_used.internals)
773-
hud_used.internals.icon_state = "internal[internal_state]"
775+
hud_used.internals.icon_state = "internal[internal_state]"*/
774776

775777
/*WS revert
776778
/mob/living/carbon/proc/update_spacesuit_hud_icon(cell_state = "empty")
@@ -810,6 +812,7 @@
810812
set_stat(CONSCIOUS)
811813
update_damage_hud()
812814
update_health_hud()
815+
update_stamina_hud()
813816
med_hud_set_status()
814817

815818

code/modules/mob/living/carbon/human/human.dm

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -843,8 +843,9 @@
843843
return
844844
else
845845
if(hud_used.healths)
846-
var/health_amount = min(health, maxHealth - getStaminaLoss())
847-
if(..(health_amount)) //not dead
846+
if(..()) //not dead
847+
/* var/health_amount = min(health, maxHealth - getStaminaLoss()) //PENTEST EDIT
848+
if(..(health_amount))*/
848849
switch(hal_screwyhud)
849850
if(SCREWYHUD_CRIT)
850851
hud_used.healths.icon_state = "health6"

code/modules/mob/living/carbon/human/inventory.dm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,8 @@
317317
if((I.flags_inv & (HIDEHAIR|HIDEFACIALHAIR)) || (initial(I.flags_inv) & (HIDEHAIR|HIDEFACIALHAIR)))
318318
update_hair()
319319
if(toggle_off && internal && !getorganslot(ORGAN_SLOT_BREATHING_TUBE))
320-
update_internals_hud_icon(0)
320+
update_action_buttons_icon() //PENTEST EDIT
321+
//update_internals_hud_icon(0)
321322
internal = null
322323
if(I.flags_inv & HIDEEYES)
323324
update_inv_glasses()

code/modules/mob/living/carbon/human/species_types/plasmamen.dm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@
184184

185185
H.equipOutfit(O, visualsOnly)
186186
H.internal = H.get_item_for_held_index(2)
187-
H.update_internals_hud_icon(1)
187+
H.update_action_buttons_icon()
188+
//H.update_internals_hud_icon(1) //PENTEST EDIT
188189
return 0
189190

190191
/datum/species/plasmaman/random_name(gender,unique,lastname)

code/modules/mob/living/carbon/life.dm

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,12 +288,15 @@
288288
if(internal)
289289
if(internal.loc != src)
290290
internal = null
291-
update_internals_hud_icon(0)
291+
update_action_buttons_icon() //PENTEST EDIT
292+
//update_internals_hud_icon(0)
292293
else if (!internals && !getorganslot(ORGAN_SLOT_BREATHING_TUBE)) //WS Port - Citadel Internals
293294
internal = null
294-
update_internals_hud_icon(0)
295+
update_action_buttons_icon() //PENTEST EDIT
296+
//update_internals_hud_icon(0)
295297
else
296-
update_internals_hud_icon(1)
298+
update_action_buttons_icon() //PENTEST EDIT
299+
//update_internals_hud_icon(1)
297300
. = internal.remove_air_volume(volume_needed)
298301
if(!.)
299302
return FALSE //to differentiate between no internals and active, but empty internals
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/atom/movable/screen/stamina
2+
icon = 'modular_pentest/master_files/icons/hud/screen_gen.dmi'
3+
name = "stamina"
4+
icon_state = "stamina0"
5+
screen_loc = ui_stamina
6+
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/mob/living/carbon/update_stamina_hud(shown_stamina_loss)
2+
if(!client || !hud_used?.stamina)
3+
return
4+
5+
var/stam_crit_threshold = maxHealth - crit_threshold
6+
7+
if(stat == DEAD)
8+
hud_used.stamina.icon_state = "stamina_dead"
9+
else
10+
11+
if(shown_stamina_loss == null)
12+
shown_stamina_loss = getStaminaLoss()
13+
14+
if(shown_stamina_loss >= stam_crit_threshold)
15+
hud_used.stamina.icon_state = "stamina_crit"
16+
else if(shown_stamina_loss > maxHealth*0.8)
17+
hud_used.stamina.icon_state = "stamina_5"
18+
else if(shown_stamina_loss > maxHealth*0.6)
19+
hud_used.stamina.icon_state = "stamina_4"
20+
else if(shown_stamina_loss > maxHealth*0.4)
21+
hud_used.stamina.icon_state = "stamina_3"
22+
else if(shown_stamina_loss > maxHealth*0.2)
23+
hud_used.stamina.icon_state = "stamina_2"
24+
else if(shown_stamina_loss > 0)
25+
hud_used.stamina.icon_state = "stamina_1"
26+
else
27+
hud_used.stamina.icon_state = "stamina_full"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/// Changes the stamina HUD based on new information
2+
/mob/proc/update_stamina_hud()
3+
return
Binary file not shown.

modular_pentest/~pentest.dme

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@
107107
#include "master_files\code\modules\language\language_holder.dm"
108108
#include "master_files\code\modules\mining\lavaland\necropolis_chests.dm"
109109
#include "master_files\code\modules\mining\machine_vending.dm"
110+
#include "master_files\code\_onclick\hud\screen_objects.dm"
111+
#include "master_files\code\modules\mob\living\carbon\carbon.dm"
112+
#include "master_files\code\modules\mob\mob.dm"
110113
#include "master_files\code\modules\mob\dead\new_player\ship_select.dm"
111114
#include "master_files\code\modules\mob\dead\observer\observer.dm"
112115
#include "master_files\code\modules\mob\living\carbon\human\species_types\jellypeople.dm"

0 commit comments

Comments
 (0)