From de3227e3e0e4831b8c9efdfd9919a90bc7bf085e Mon Sep 17 00:00:00 2001
From: silicons <2003111+silicons@users.noreply.github.com>
Date: Tue, 4 Aug 2020 22:55:33 -0700
Subject: [PATCH] fix
---
code/__DEFINES/combat/stamina_combat.dm | 24 ++++++++-----------
code/_onclick/item_attack.dm | 9 -------
code/game/objects/items.dm | 2 +-
code/game/objects/items/melee/misc.dm | 3 ++-
code/game/objects/items/mop.dm | 6 ++---
code/modules/mob/living/carbon/human/human.dm | 3 +--
6 files changed, 16 insertions(+), 31 deletions(-)
diff --git a/code/__DEFINES/combat/stamina_combat.dm b/code/__DEFINES/combat/stamina_combat.dm
index 09dbc7253b..b35329d84d 100644
--- a/code/__DEFINES/combat/stamina_combat.dm
+++ b/code/__DEFINES/combat/stamina_combat.dm
@@ -1,12 +1,14 @@
+// Stamina Buffer
/// Stamina buffer amount
-#define STAMINA_BUFFER_CAPACITY 50
-
-
-
-
-
-
-
+#define STAMINA_BUFFER_CAPACITY 35
+/// Stamina buffer regen per decisecond
+#define STAMINA_BUFFER_REGEN_DS 0.1
+/// Stamina buffer regen multiplier while in combat mode
+#define STAMINA_BUFFER_REGEN_COMBAT_MULT 3
+/// Linear scaling minimum for stamina buffer regen in percentage at stamcrit
+#define STAMINA_BUFFER_STAMCRIT_PENALTY_REGEN 0.75
+/// Linear scaling minimum for stamina buffer capacity in percentage at stamcrit
+#define STAMINA_BUFFER_STAMCRIT_PENALTY_CAPACITY 0.5
// Standard amounts for stamina usage
@@ -39,11 +41,5 @@
#define STAM_COST_THROW_MULT 2
#define STAM_COST_THROW_MOB 2.5 //multiplied by (mob size + 1)^2.
-///Multiplier of the (STAMINA_NEAR_CRIT - user current stamina loss) : (STAMINA_NEAR_CRIT - STAMINA_SOFTCRIT) ratio used in damage penalties when stam soft-critted.
-#define STAM_CRIT_ITEM_ATTACK_PENALTY 0.66
-/// changeNext_move penalty multiplier of the above.
-#define STAM_CRIT_ITEM_ATTACK_DELAY 1.75
/// Damage penalty when fighting prone.
#define LYING_DAMAGE_PENALTY 0.7
-/// Added delay when firing guns stam-softcritted. Summed with a hardset CLICK_CD_RANGE delay, similar to STAM_CRIT_DAMAGE_DELAY otherwise.
-#define STAM_CRIT_GUN_DELAY 2.75
diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm
index 307b476e2b..54cd4e1fd3 100644
--- a/code/_onclick/item_attack.dm
+++ b/code/_onclick/item_attack.dm
@@ -131,11 +131,6 @@
/obj/attacked_by(obj/item/I, mob/living/user, attackchain_flags = NONE, damage_multiplier = 1)
var/totitemdamage = I.force * damage_multiplier
- var/stamloss = user.getStaminaLoss()
- if(stamloss > STAMINA_NEAR_SOFTCRIT) //The more tired you are, the less damage you do.
- var/penalty = (stamloss - STAMINA_NEAR_SOFTCRIT)/(STAMINA_NEAR_CRIT - STAMINA_NEAR_SOFTCRIT)*STAM_CRIT_ITEM_ATTACK_PENALTY
- totitemdamage *= 1 - penalty
-
if(I.used_skills && user.mind)
if(totitemdamage)
totitemdamage = user.mind.item_action_skills_mod(I, totitemdamage, I.skill_difficulty, SKILL_ATTACK_OBJ, bad_trait)
@@ -181,11 +176,7 @@
if(!.)
return
- var/stamloss = user.getStaminaLoss()
var/stam_mobility_mult = 1
- if(stamloss > STAMINA_NEAR_SOFTCRIT) //The more tired you are, the less damage you do.
- var/penalty = (stamloss - STAMINA_NEAR_SOFTCRIT)/(STAMINA_NEAR_CRIT - STAMINA_NEAR_SOFTCRIT)*STAM_CRIT_ITEM_ATTACK_PENALTY
- stam_mobility_mult -= penalty
if(stam_mobility_mult > LYING_DAMAGE_PENALTY && !CHECK_MOBILITY(user, MOBILITY_STAND)) //damage penalty for fighting prone, doesn't stack with the above.
stam_mobility_mult = LYING_DAMAGE_PENALTY
. *= stam_mobility_mult
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 2617ba2768..71aff1562c 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -565,7 +565,7 @@ GLOBAL_VAR_INIT(embedpocalypse, FALSE) // if true, all items will be able to emb
to_chat(user, "You cannot locate any organic eyes on this brain!")
return
- if(IS_STAMCRIT(user) || !user.UseStaminaBuffer(STAMINA_COST_ITEM_EYESTAB, warn = TRUR))//CIT CHANGE - makes eyestabbing impossible if you're in stamina softcrit
+ if(IS_STAMCRIT(user) || !user.UseStaminaBuffer(STAMINA_COST_ITEM_EYESTAB, warn = TRUE))//CIT CHANGE - makes eyestabbing impossible if you're in stamina softcrit
to_chat(user, "You're too exhausted for that.")//CIT CHANGE - ditto
return //CIT CHANGE - ditto
diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm
index 9a7d455df6..f90f484513 100644
--- a/code/game/objects/items/melee/misc.dm
+++ b/code/game/objects/items/melee/misc.dm
@@ -349,6 +349,8 @@
return
else
if(cooldown_check < world.time)
+ if(!UseStaminaBufferStandard(user, STAM_COST_BATON_MOB_MULT, warn = TRUE))
+ return DISCARD_LAST_ACTION
if(target.mob_run_block(src, 0, "[user]'s [name]", ATTACK_TYPE_MELEE, 0, user, null, null) & BLOCK_SUCCESS)
playsound(target, 'sound/weapons/genhit.ogg', 50, 1)
return
@@ -370,7 +372,6 @@
else
target.LAssailant = WEAKREF(user)
cooldown_check = world.time + cooldown
- user.adjustStaminaLossBuffered(getweight(user, STAM_COST_BATON_MOB_MULT))
else
var/wait_desc = get_wait_description()
if(wait_desc)
diff --git a/code/game/objects/items/mop.dm b/code/game/objects/items/mop.dm
index b420bfc002..01ef96b7e8 100644
--- a/code/game/objects/items/mop.dm
+++ b/code/game/objects/items/mop.dm
@@ -56,22 +56,20 @@
return
if(T)
+ if(!L.UseStaminaBuffer(stamusage, warn = TRUE))
+ return
user.visible_message("[user] cleans \the [T] with [src].", "You clean \the [T] with [src].")
clean(T)
user.DelayNextAction(CLICK_CD_MELEE)
user.do_attack_animation(T, used_item = src)
- if(istype(L))
- L.adjustStaminaLossBuffered(stamusage)
playsound(T, "slosh", 50, 1)
-
/obj/effect/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/mop) || istype(I, /obj/item/soap))
return
else
return ..()
-
/obj/item/mop/proc/janicart_insert(mob/user, obj/structure/janitorialcart/J)
if(insertable)
J.put_in_cart(src, user)
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 145db1be1e..b76f3139bd 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -1053,9 +1053,8 @@
remove_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown)
remove_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown_flying)
return
- var/stambufferinfluence = (bufferedstam*(100/stambuffer))*0.2 //CIT CHANGE - makes stamina buffer influence movedelay
if(!HAS_TRAIT(src, TRAIT_IGNOREDAMAGESLOWDOWN)) //if we want to ignore slowdown from damage, but not from equipment
- var/health_deficiency = ((maxHealth + stambufferinfluence) - health + (getStaminaLoss()*0.75))//CIT CHANGE - reduces the impact of staminaloss and makes stamina buffer influence it
+ var/health_deficiency = ((maxHealth) - health + (getStaminaLoss()*0.75))//CIT CHANGE - reduces the impact of staminaloss and makes stamina buffer influence it
if(health_deficiency >= 40)
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown, TRUE, (health_deficiency-39) / 75)
add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/damage_slowdown_flying, TRUE, (health_deficiency-39) / 25)