Skip to content

Commit

Permalink
It's a numbers game
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMelbert committed Feb 9, 2025
1 parent 29540a2 commit df7b194
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 9 deletions.
5 changes: 5 additions & 0 deletions code/_compile_options.dm
Original file line number Diff line number Diff line change
Expand Up @@ -142,3 +142,8 @@
#warn In order to build, run BUILD.bat in the root directory.
#warn Consider switching to VSCode editor instead, where you can press Ctrl+Shift+B to build.
#endif

// For balancing health
// #define HEALTH_DEBUG
// For debugging pain
// #define PAIN_DEBUG
2 changes: 1 addition & 1 deletion code/game/objects/items/stacks/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@
. = ..()
if(.)
return .
if(!(clean_types & CLEAN_TYPE_HARD_DECAL)) // gotta scrub realllly hard to clean gauze
if(!(clean_types & CLEAN_TYPE_BLOOD))
return .
times_cleaned += 1
var/clean_to = initial(absorption_capacity) * (3 / (times_cleaned + 3))
Expand Down
16 changes: 16 additions & 0 deletions code/modules/mob/living/carbon/carbon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -603,6 +603,22 @@
if(num_seared_parts >= 3)
become_husk(BURN)

#ifdef HEALTH_DEBUG
if(client && hud_used)
hud_used.healthdoll.maptext_x = -50
hud_used.healthdoll.maptext_height = 200
hud_used.healthdoll.maptext_width = 75
hud_used.healthdoll.maptext = MAPTEXT("Th: [health]\
<br>Br: [total_brute]\
<br>Bu: [total_burn]\
<br>O: [total_oxy]\
<br>T: [total_tox]\
<br>Con: [consciousness]\
<br>Pain: [pain_controller.get_total_pain()]\
<br>Shock: [pain_controller.traumatic_shock]\
")
#endif

SEND_SIGNAL(src, COMSIG_LIVING_HEALTH_UPDATE)

/datum/movespeed_modifier/carbon_consciousness
Expand Down
4 changes: 4 additions & 0 deletions code/modules/mob/living/carbon/human/human.dm
Original file line number Diff line number Diff line change
Expand Up @@ -879,10 +879,14 @@
picked += result
options -= result

if(!length(picked))
return
var/major = tgui_input_list(usr, "REALLY tanky or just a little tanky?", "Tanky", list("Little", "Lot"))
if(QDELETED(src) || !major)
return
major = (major == "Lot")
message_admins("[key_name(usr)] has made [key_name(src)] tanky with the following: [english_list(picked)]")
log_admin("[key_name(usr)] has made [key_name(src)] tanky with the following: [english_list(picked)]")

for(var/i in picked)
switch(i)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PROCESSING_SUBSYSTEM_DEF(pain)
name = "Pain"
flags = SS_NO_INIT | SS_BACKGROUND
priority = 20
priority = 90
wait = 2 SECONDS
11 changes: 4 additions & 7 deletions maplestation_modules/code/datums/pain/pain.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
// For debugging pain
// #define PAIN_DEBUG

/**
* # Pain controller
*
Expand Down Expand Up @@ -286,7 +283,7 @@
* * amount - the number of ticks of progress to remove. Note that one tick = two seconds for pain.
* * down_to - the minimum amount of pain shock the mob can have.
*/
/datum/pain/proc/adjust_traumatic_shock(amount, down_to = -20)
/datum/pain/proc/adjust_traumatic_shock(amount, down_to = 0)
if(amount > 0)
amount *= max(pain_modifier, 0.33)

Expand All @@ -295,7 +292,7 @@
if(traumatic_shock <= 0)
parent.remove_consciousness_modifier(PAINSHOCK)
else
parent.add_consciousness_modifier(PAINSHOCK, -0.33 * traumatic_shock)
parent.add_consciousness_modifier(PAINSHOCK, -0.15 * traumatic_shock)
// Soft crit
if(traumatic_shock >= SHOCK_DANGER_THRESHOLD)
if(!HAS_TRAIT_FROM(parent, TRAIT_SOFT_CRIT, PAINSHOCK))
Expand Down Expand Up @@ -512,9 +509,9 @@
shock_mod *= 0.5
if(parent.health > 0)
shock_mod *= 0.25
if(parent.health <= parent.maxHealth * -2 || (!HAS_TRAIT(parent, TRAIT_NOBLOOD) && parent.blood_volume < BLOOD_VOLUME_BAD))
if(parent.health <= parent.maxHealth * -2)
shock_mod *= 2
if(parent.health <= parent.maxHealth * -4 || (!HAS_TRAIT(parent, TRAIT_NOBLOOD) && parent.blood_volume < BLOOD_VOLUME_SURVIVE))
if(parent.health <= parent.maxHealth * -4)
shock_mod *= 3 // stacks with above
var/curr_pain = get_total_pain()
if(curr_pain < 25)
Expand Down
1 change: 1 addition & 0 deletions maplestation_modules/code/datums/pain/pain_effects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@
id = "recent_defib"
status_type = STATUS_EFFECT_REFRESH
alert_type = null
remove_on_fullheal = TRUE
/// Base amount of consciousness / max consciousness to give the patient
var/base_con = 15

Expand Down

0 comments on commit df7b194

Please sign in to comment.