From 15825997b86bc348ff3d0cd1b7d80edc489da4be Mon Sep 17 00:00:00 2001
From: 4dplanner <3combined@gmail.com>
Date: Mon, 3 Jun 2019 00:16:56 +0100
Subject: [PATCH] Stamina changes [TMC] (#43966)
About The Pull Request
Stamina damage no longer stacks with regular damage.
Stamina regen is paused for 10 seconds every time you take stamina damage
Stamina damage is purged if stamina regen resumes after you enter stamcrit
changes to make this work:
disablers knocked down to 30
punch damage changed to full raw, 1.5x stamina.
flesh-eating symptom deals 2x stamina damage
CQC unchanged
Bostaff manually stacks
Energised jelly blob deals full stamina damage
Pressurised slime blob deals full stamina damage
Blood boil deals 1.5x stamina damage to servants of ratvar (why do I bother?)
Revenant blight now deals 20 stamina damage
Space carp no longer deal stamina damage, but deal 20 brute.
Enchanted bullets deal 20 brute damage
Beanbags reduced to 55 stamina damage
Rubbershot damage untouched
Ebow stamina damage increased to 60
bone hurting juice deals 7.5 stamina damage per tick, down from 15
Why It's Good For The Game
Stamina damage not stacking with regular damage is meant to make disablers less good as a weapon for all-out firefights, but remain good for arresting criminals as a sec squad.
The stamina regen pause allows for chemicals that deal stamina damage to be effective even if they don't only target one body part (as in #43924), and gets rid of the counterintuitive speedy regeneration if multiple bodyparts are damaged. It also makes stamina damage calculations more straightforward - currently 4 damage/tick to the chest is really 1, and adding 25% more damage to the chem deals 100% more damage per tick.
The stamina purge is to make stamcrit less of a confirmed win - several times as sec officer I've succumbed to poison, run out of charge, etc only for the rest of sec to arrive before the perp awakes from his 3 hour sleep. Stamina damage is fully purged to make keeping someone down require more attention, since under the current system even if they somehow get up they'll be so slow it'll be trivial to put them down again. Basically, makes handcuffs more useful again.
Changelog
cl
add: stamina damage now pauses natural stamina regen for 10 seconds
add: stamina regenerates fully when it can.
balance: disabler damage reduced
tweak: stamina damage no longer stacks with normal damage for the purposes of damage slowdown and crit
balance: many sources of stamina damage have been adjusted, check PR for details
/cl
---
code/__DEFINES/mobs.dm | 2 ++
.../diseases/advance/symptoms/flesh_eating.dm | 4 ++--
code/game/objects/items/defib.dm | 2 +-
.../blob/blobstrains/energized_jelly.dm | 2 +-
.../blob/blobstrains/pressurized_slime.dm | 2 +-
code/modules/antagonists/cult/runes.dm | 2 +-
.../antagonists/revenant/revenant_blight.dm | 2 +-
code/modules/mob/living/carbon/carbon.dm | 3 ++-
.../modules/mob/living/carbon/carbon_defines.dm | 2 ++
code/modules/mob/living/carbon/human/human.dm | 2 +-
code/modules/mob/living/carbon/human/species.dm | 8 ++++----
code/modules/mob/living/carbon/life.dm | 9 ++++++++-
.../mob/living/simple_animal/hostile/carp.dm | 10 ++--------
code/modules/projectiles/projectile/beams.dm | 2 +-
.../projectiles/projectile/bullets/rifle.dm | 2 +-
.../projectiles/projectile/energy/ebow.dm | 2 +-
.../chemistry/reagents/toxin_reagents.dm | 2 +-
code/modules/surgery/bodyparts/bodyparts.dm | 17 +++++++----------
18 files changed, 39 insertions(+), 36 deletions(-)
diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm
index 97486374e99..7d0b57ded51 100644
--- a/code/__DEFINES/mobs.dm
+++ b/code/__DEFINES/mobs.dm
@@ -71,6 +71,8 @@
#define HUMAN_MAX_OXYLOSS 3
#define HUMAN_CRIT_MAX_OXYLOSS (SSmobs.wait/30)
+#define STAMINA_REGEN_BLOCK_TIME (10 SECONDS)
+
#define HEAT_DAMAGE_LEVEL_1 2 //Amount of damage applied when your body temperature just passes the 360.15k safety point
#define HEAT_DAMAGE_LEVEL_2 3 //Amount of damage applied when your body temperature passes the 400K point
#define HEAT_DAMAGE_LEVEL_3 8 //Amount of damage applied when your body temperature passes the 460K point and you are on fire
diff --git a/code/datums/diseases/advance/symptoms/flesh_eating.dm b/code/datums/diseases/advance/symptoms/flesh_eating.dm
index ecbf24dc8a7..2c4429be292 100644
--- a/code/datums/diseases/advance/symptoms/flesh_eating.dm
+++ b/code/datums/diseases/advance/symptoms/flesh_eating.dm
@@ -57,7 +57,7 @@ Bonus
var/get_damage = rand(15,25) * power
M.take_overall_damage(brute = get_damage, required_status = BODYPART_ORGANIC)
if(pain)
- M.adjustStaminaLoss(get_damage)
+ M.adjustStaminaLoss(get_damage * 2)
if(bleed)
if(ishuman(M))
var/mob/living/carbon/human/H = M
@@ -127,4 +127,4 @@ Bonus
M.reagents.add_reagent_list(list(/datum/reagent/toxin/heparin = 2, /datum/reagent/toxin/lipolicide = 2))
if(zombie)
M.reagents.add_reagent(/datum/reagent/romerol, 1)
- return 1
\ No newline at end of file
+ return 1
diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm
index ef8947da226..7fe8ec57872 100644
--- a/code/game/objects/items/defib.dm
+++ b/code/game/objects/items/defib.dm
@@ -467,7 +467,7 @@
"[user] has touched [M] with [src]!")
M.adjustStaminaLoss(50)
M.Paralyze(100)
- M.updatehealth() //forces health update before next life tick
+ M.updatehealth() //forces health update before next life tick //isn't this done by adjustStaminaLoss anyway?
playsound(src, 'sound/machines/defib_zap.ogg', 50, 1, -1)
M.emote("gasp")
log_combat(user, M, "stunned", src)
diff --git a/code/modules/antagonists/blob/blobstrains/energized_jelly.dm b/code/modules/antagonists/blob/blobstrains/energized_jelly.dm
index 66ce3c303d9..7c07103d625 100644
--- a/code/modules/antagonists/blob/blobstrains/energized_jelly.dm
+++ b/code/modules/antagonists/blob/blobstrains/energized_jelly.dm
@@ -29,6 +29,6 @@
/datum/reagent/blob/energized_jelly/reaction_mob(mob/living/M, method=TOUCH, reac_volume, show_message, touch_protection, mob/camera/blob/O)
reac_volume = ..()
M.losebreath += round(0.2*reac_volume)
- M.adjustStaminaLoss(0.4*reac_volume)
+ M.adjustStaminaLoss(reac_volume)
if(M)
M.apply_damage(0.6*reac_volume, OXY)
diff --git a/code/modules/antagonists/blob/blobstrains/pressurized_slime.dm b/code/modules/antagonists/blob/blobstrains/pressurized_slime.dm
index 6a984e66a23..e5754329979 100644
--- a/code/modules/antagonists/blob/blobstrains/pressurized_slime.dm
+++ b/code/modules/antagonists/blob/blobstrains/pressurized_slime.dm
@@ -48,4 +48,4 @@
if(M)
M.apply_damage(0.4*reac_volume, OXY)
if(M)
- M.adjustStaminaLoss(0.2*reac_volume)
+ M.adjustStaminaLoss(reac_volume)
diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm
index 5f1b1f59edd..4040dfc031a 100644
--- a/code/modules/antagonists/cult/runes.dm
+++ b/code/modules/antagonists/cult/runes.dm
@@ -800,7 +800,7 @@ structure_check() searches for nearby cultist structures required for the invoca
continue
L.take_overall_damage(tick_damage*multiplier, tick_damage*multiplier)
if(is_servant_of_ratvar(L))
- L.adjustStaminaLoss(tick_damage*0.5)
+ L.adjustStaminaLoss(tick_damage*multiplier*1.5)
//Rite of Spectral Manifestation: Summons a ghost on top of the rune as a cultist human with no items. User must stand on the rune at all times, and takes damage for each summoned ghost.
/obj/effect/rune/manifest
diff --git a/code/modules/antagonists/revenant/revenant_blight.dm b/code/modules/antagonists/revenant/revenant_blight.dm
index 36d0a2ef4d0..3c789f339f7 100644
--- a/code/modules/antagonists/revenant/revenant_blight.dm
+++ b/code/modules/antagonists/revenant/revenant_blight.dm
@@ -32,7 +32,7 @@
if(prob(stage*3))
to_chat(affected_mob, "You suddenly feel [pick("sick and tired", "disoriented", "tired and confused", "nauseated", "faint", "dizzy")]...")
affected_mob.confused += 8
- affected_mob.adjustStaminaLoss(8)
+ affected_mob.adjustStaminaLoss(20)
new /obj/effect/temp_visual/revenant(affected_mob.loc)
if(stagedamage < stage)
stagedamage++
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index a8fa0266b4e..e25f4f37c4c 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -530,11 +530,12 @@
/mob/living/carbon/update_stamina()
var/stam = getStaminaLoss()
if(stam > DAMAGE_PRECISION)
- var/total_health = (health - stam)
+ var/total_health = (maxHealth - stam)
if(total_health <= crit_threshold && !stat)
if(!IsParalyzed())
to_chat(src, "You're too exhausted to keep going...")
Paralyze(100)
+ stam_paralysed = TRUE
update_health_hud()
/mob/living/carbon/update_sight()
diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm
index 10389b32103..ae84700f492 100644
--- a/code/modules/mob/living/carbon/carbon_defines.dm
+++ b/code/modules/mob/living/carbon/carbon_defines.dm
@@ -61,3 +61,5 @@
var/damageoverlaytemp = 0
var/drunkenness = 0 //Overall drunkenness - check handle_alcohol() in life.dm for effects
+ var/stam_regen_start_time = 0 //used to halt stamina regen temporarily
+ var/stam_paralysed = FALSE //so we get back up if we regen during a paralyse
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index be172bcf0fb..35a17b8984a 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -732,7 +732,7 @@
return
else
if(hud_used.healths)
- var/health_amount = health - getStaminaLoss()
+ var/health_amount = min(health, maxHealth - getStaminaLoss())
if(..(health_amount)) //not dead
switch(hal_screwyhud)
if(SCREWYHUD_CRIT)
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index aa09b227456..b8a15478912 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -1102,7 +1102,7 @@ GLOBAL_LIST_EMPTY(roundstart_races)
if(I.item_flags & SLOWS_WHILE_IN_HAND)
. += I.slowdown
if(!HAS_TRAIT(H, TRAIT_IGNOREDAMAGESLOWDOWN))
- var/health_deficiency = (H.maxHealth - H.health + H.staminaloss)
+ var/health_deficiency = max(H.maxHealth - H.health, H.staminaloss)
if(health_deficiency >= 40)
if(flight)
. += (health_deficiency / 75)
@@ -1235,9 +1235,9 @@ GLOBAL_LIST_EMPTY(roundstart_races)
if(atk_verb == ATTACK_EFFECT_KICK)//kicks deal 1.5x raw damage
target.apply_damage(damage*1.5, attack_type, affecting, armor_block)
log_combat(user, target, "kicked")
- else//other attacks to 1/2 raw damage + full in stamina damage
- target.apply_damage(damage*0.5, attack_type, affecting, armor_block)
- target.apply_damage(damage, STAMINA, affecting, armor_block)
+ else//other attacks deal full raw damage + 1.5x in stamina damage
+ target.apply_damage(damage, attack_type, affecting, armor_block)
+ target.apply_damage(damage*1.5, STAMINA, affecting, armor_block)
log_combat(user, target, "punched")
if((target.stat != DEAD) && damage >= user.dna.species.punchstunthreshold)
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index c9bf7bce150..0e63ad65f96 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -312,10 +312,17 @@
return
/mob/living/carbon/proc/handle_bodyparts()
+ var/stam_regen = FALSE
+ if(stam_regen_start_time <= world.time)
+ stam_regen = TRUE
+ if(stam_paralysed)
+ stam_paralysed = FALSE
+ SetParalyzed(0) //Really we should have sources for status effects
+ update_health_hud()
for(var/I in bodyparts)
var/obj/item/bodypart/BP = I
if(BP.needs_processing)
- . |= BP.on_life()
+ . |= BP.on_life(stam_regen)
/mob/living/carbon/proc/handle_organs()
for(var/V in internal_organs)
diff --git a/code/modules/mob/living/simple_animal/hostile/carp.dm b/code/modules/mob/living/simple_animal/hostile/carp.dm
index 41644ec234a..447cbe339d3 100644
--- a/code/modules/mob/living/simple_animal/hostile/carp.dm
+++ b/code/modules/mob/living/simple_animal/hostile/carp.dm
@@ -23,8 +23,8 @@
harm_intent_damage = 8
obj_damage = 50
- melee_damage_lower = 15
- melee_damage_upper = 15
+ melee_damage_lower = 20
+ melee_damage_upper = 20
attacktext = "bites"
attack_sound = 'sound/weapons/bite.ogg'
speak_emote = list("gnashes")
@@ -38,12 +38,6 @@
pressure_resistance = 200
gold_core_spawnable = HOSTILE_SPAWN
-/mob/living/simple_animal/hostile/carp/AttackingTarget()
- . = ..()
- if(. && ishuman(target))
- var/mob/living/carbon/human/H = target
- H.adjustStaminaLoss(8)
-
/mob/living/simple_animal/hostile/carp/holocarp
icon_state = "holocarp"
icon_living = "holocarp"
diff --git a/code/modules/projectiles/projectile/beams.dm b/code/modules/projectiles/projectile/beams.dm
index ded512afcd9..92b83aeea00 100644
--- a/code/modules/projectiles/projectile/beams.dm
+++ b/code/modules/projectiles/projectile/beams.dm
@@ -69,7 +69,7 @@
/obj/item/projectile/beam/disabler
name = "disabler beam"
icon_state = "omnilaser"
- damage = 40
+ damage = 30
damage_type = STAMINA
flag = "energy"
hitsound = 'sound/weapons/tap.ogg'
diff --git a/code/modules/projectiles/projectile/bullets/rifle.dm b/code/modules/projectiles/projectile/bullets/rifle.dm
index a019c05ef19..1cd5a9f0bbb 100644
--- a/code/modules/projectiles/projectile/bullets/rifle.dm
+++ b/code/modules/projectiles/projectile/bullets/rifle.dm
@@ -12,5 +12,5 @@
/obj/item/projectile/bullet/a762_enchanted
name = "enchanted 7.62 bullet"
- damage = 5
+ damage = 20
stamina = 80
diff --git a/code/modules/projectiles/projectile/energy/ebow.dm b/code/modules/projectiles/projectile/energy/ebow.dm
index cf0e6f81dcc..c83668df16a 100644
--- a/code/modules/projectiles/projectile/energy/ebow.dm
+++ b/code/modules/projectiles/projectile/energy/ebow.dm
@@ -4,7 +4,7 @@
damage = 15
damage_type = TOX
nodamage = FALSE
- stamina = 50
+ stamina = 60
eyeblur = 10
knockdown = 10
slur = 5
diff --git a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
index 62264588997..a8374ddffaf 100644
--- a/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
+++ b/code/modules/reagents/chemistry/reagents/toxin_reagents.dm
@@ -852,7 +852,7 @@
M.say("oof ouch my bones", forced = /datum/reagent/toxin/bonehurtingjuice)
/datum/reagent/toxin/bonehurtingjuice/on_mob_life(mob/living/carbon/M)
- M.adjustStaminaLoss(15, 0)
+ M.adjustStaminaLoss(7.5, 0)
if(HAS_TRAIT(M, TRAIT_CALCIUM_HEALER))
M.adjustBruteLoss(0.5, 0)
if(prob(20))
diff --git a/code/modules/surgery/bodyparts/bodyparts.dm b/code/modules/surgery/bodyparts/bodyparts.dm
index 21b96404e32..fcaef81376f 100644
--- a/code/modules/surgery/bodyparts/bodyparts.dm
+++ b/code/modules/surgery/bodyparts/bodyparts.dm
@@ -31,7 +31,6 @@
var/stamina_dam = 0
var/max_stamina_damage = 0
var/max_damage = 0
- var/stam_heal_tick = 3 //per Life().
var/brute_reduction = 0 //Subtracted to brute damage taken
var/burn_reduction = 0 //Subtracted to burn damage taken
@@ -134,10 +133,10 @@
needs_processing = .
//Return TRUE to get whatever mob this is in to update health.
-/obj/item/bodypart/proc/on_life()
- if(stamina_dam > DAMAGE_PRECISION) //DO NOT update health here, it'll be done in the carbon's life.
- if(heal_damage(0, 0, stam_heal_tick, null, FALSE))
- . |= BODYPART_LIFE_UPDATE_HEALTH
+/obj/item/bodypart/proc/on_life(stam_regen)
+ if(stamina_dam > DAMAGE_PRECISION && stam_regen) //DO NOT update health here, it'll be done in the carbon's life.
+ heal_damage(0, 0, INFINITY, null, FALSE)
+ . |= BODYPART_LIFE_UPDATE_HEALTH
//Applies brute and burn damage to the organ. Returns 1 if the damage-icon states changed at all.
//Damage will not exceed max_damage using this proc
@@ -185,10 +184,12 @@
var/available_damage = max_damage - current_damage
stamina_dam += round(CLAMP(stamina, 0, min(max_stamina_damage - stamina_dam, available_damage)), DAMAGE_PRECISION)
+
if(owner && updating_health)
owner.updatehealth()
if(stamina > DAMAGE_PRECISION)
owner.update_stamina()
+ owner.stam_regen_start_time = world.time + STAMINA_REGEN_BLOCK_TIME
consider_processing()
update_disabled()
return update_bodypart_damage_state()
@@ -214,7 +215,7 @@
/obj/item/bodypart/proc/get_damage(include_stamina = FALSE)
var/total = brute_dam + burn_dam
if(include_stamina)
- total += stamina_dam
+ total = max(total, stamina_dam)
return total
//Checks disabled status thresholds
@@ -502,7 +503,6 @@
held_index = 1
px_x = -6
px_y = 0
- stam_heal_tick = 2
/obj/item/bodypart/l_arm/is_disabled()
if(HAS_TRAIT(owner, TRAIT_PARALYSIS_L_ARM))
@@ -566,7 +566,6 @@
held_index = 2
px_x = 6
px_y = 0
- stam_heal_tick = 2
max_stamina_damage = 50
/obj/item/bodypart/r_arm/is_disabled()
@@ -628,7 +627,6 @@
body_damage_coeff = 0.75
px_x = -2
px_y = 12
- stam_heal_tick = 2
max_stamina_damage = 50
/obj/item/bodypart/l_leg/is_disabled()
@@ -688,7 +686,6 @@
px_x = 2
px_y = 12
max_stamina_damage = 50
- stam_heal_tick = 2
/obj/item/bodypart/r_leg/is_disabled()
if(HAS_TRAIT(owner, TRAIT_PARALYSIS_R_LEG))