Skip to content

Commit

Permalink
tweaks how slowdown applies to humanmobs
Browse files Browse the repository at this point in the history
  • Loading branch information
X0-11 committed Feb 29, 2024
1 parent acb19c4 commit c2c371d
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
2 changes: 2 additions & 0 deletions code/__defines/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,5 @@
#define SUPPRESSION_SCREAM_CHANCE 5
#define SUPPRESSION_SHAKE_CHANCE 10
#define SCREAM_COOLDOWN 1.5 SECOND
#define HEALTHDEFICIENCY_THRESHOLD 0.2 //20% health loss before we start feeling any sort of slowdown.
#define HEALTHDEFICIENCY_HPLOSS_ONEPOINTSLOWDOWN_MOD 0.175 //17.5% hp loss per slowdown point
13 changes: 9 additions & 4 deletions code/modules/mob/living/carbon/human/human_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
handle_embedded_and_stomach_objects() //Moving with objects stuck in you can cause bad times.

var/health_deficiency = (maxHealth - health)
if(health_deficiency >= 40) tally += (health_deficiency / 35)
//20% health loss, then we start giving slowdown.
if(health_deficiency >= (maxHealth*HEALTHDEFICIENCY_THRESHOLD)) tally += (health_deficiency / (maxHealth * HEALTHDEFICIENCY_HPLOSS_ONEPOINTSLOWDOWN_MOD))

if(can_feel_pain())
if(get_shock() >= 20) tally += (get_shock() / 30) //halloss shouldn't slow you down if you can't even feel it
Expand All @@ -44,7 +45,8 @@

if(ignore_equipment_threshold && equipment_slowdown > ignore_equipment_threshold)
equipment_slowdown -= ignore_equipment_threshold
equipment_slowdown *= species.equipment_slowdown_multiplier
if(equipment_slowdown > 0) //Only use our modifier if it's actually slowing us down. Speedups are unmodded.
equipment_slowdown *= species.equipment_slowdown_multiplier

tally += equipment_slowdown

Expand All @@ -61,10 +63,13 @@

if(aiming && aiming.aiming_at) tally += 5 // Iron sights make you slower, it's a well-known fact.

var/species_coldtemp = 283.222
if(species)
species_coldtemp = species.cold_discomfort_level
if(FAT in src.mutations)
tally += 1.5
if (bodytemperature < 283.222)
tally += (283.222 - bodytemperature) / 10 * 1.75
if (bodytemperature < species_coldtemp)
tally += (species_coldtemp - bodytemperature) / 10 * 1.75

tally += max(2 * stance_damage, 0) //damaged/missing feet or legs is slow

Expand Down
6 changes: 3 additions & 3 deletions code/modules/mob/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@

/mob/proc/movement_delay()
. = 0
if(istype(loc, /turf))
var/turf/T = loc
. += T.movement_delay
var/turf/T = get_turf(src)
if(src.elevation == T.elevation)
. += T.get_movement_delay()
. += currently_firing

if(pulling)
Expand Down

0 comments on commit c2c371d

Please sign in to comment.