relatively small 71 file 700 lines changed refactor/rework to combat mode/sprint and some miscellaneous things that totally aren't important (#11376)
* combat refactoring * i hate this * mobility flags part 2 time xd * whew * stuff * a * ok * changes * Wew * k * add flags * FUCKYOUVORE * fixes * typo * no using this in hard stamcrit * update icon * woopsy * . = ..() * sigh * Update living_combat.dm * wew * wups * fix * i hate you * wrong button * k * ok * bet * k * Update code/modules/mob/living/living_combat.dm Co-Authored-By: Ghom <42542238+Ghommie@users.noreply.github.com> * Update code/modules/mob/living/living_combat.dm Co-Authored-By: Ghom <42542238+Ghommie@users.noreply.github.com> * Update code/modules/mob/living/living_combat.dm Co-Authored-By: Ghom <42542238+Ghommie@users.noreply.github.com> * early returns * skreee * agony * k * k * k * k * wack * compile * wack Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -1,32 +1,4 @@
|
||||
/mob/living
|
||||
var/sprinting = FALSE
|
||||
var/recoveringstam = FALSE
|
||||
var/incomingstammult = 1
|
||||
var/bufferedstam = 0
|
||||
var/stambuffer = 20
|
||||
var/stambufferregentime
|
||||
var/attemptingstandup = FALSE
|
||||
var/intentionalresting = FALSE
|
||||
var/attemptingcrawl = FALSE
|
||||
|
||||
//Sprint buffer---
|
||||
var/sprint_buffer = 42 //Tiles
|
||||
var/sprint_buffer_max = 42
|
||||
var/sprint_buffer_regen_ds = 0.3 //Tiles per world.time decisecond
|
||||
var/sprint_buffer_regen_last = 0 //last world.time this was regen'd for math.
|
||||
var/sprint_stamina_cost = 0.70 //stamina loss per tile while insufficient sprint buffer.
|
||||
//---End
|
||||
|
||||
/mob/living/update_config_movespeed()
|
||||
. = ..()
|
||||
sprint_buffer_max = CONFIG_GET(number/movedelay/sprint_buffer_max)
|
||||
sprint_buffer_regen_ds = CONFIG_GET(number/movedelay/sprint_buffer_regen_per_ds)
|
||||
sprint_stamina_cost = CONFIG_GET(number/movedelay/sprint_stamina_cost)
|
||||
|
||||
/mob/living/movement_delay(ignorewalk = 0)
|
||||
. = ..()
|
||||
if(!CHECK_MOBILITY(src, MOBILITY_STAND))
|
||||
. += 6
|
||||
|
||||
/atom
|
||||
var/pseudo_z_axis
|
||||
@@ -55,22 +27,23 @@
|
||||
|
||||
/mob/living/carbon/update_stamina()
|
||||
var/total_health = getStaminaLoss()
|
||||
if(total_health >= STAMINA_SOFTCRIT)
|
||||
if(!(combat_flags & COMBAT_FLAG_SOFT_STAMCRIT))
|
||||
ENABLE_BITFIELD(combat_flags, COMBAT_FLAG_SOFT_STAMCRIT)
|
||||
else
|
||||
if(combat_flags & COMBAT_FLAG_SOFT_STAMCRIT)
|
||||
DISABLE_BITFIELD(combat_flags, COMBAT_FLAG_SOFT_STAMCRIT)
|
||||
if(total_health)
|
||||
if(!recoveringstam && total_health >= STAMINA_CRIT && !stat)
|
||||
if(!(combat_flags & COMBAT_FLAG_HARD_STAMCRIT) && total_health >= STAMINA_CRIT && !stat)
|
||||
to_chat(src, "<span class='notice'>You're too exhausted to keep going...</span>")
|
||||
set_resting(TRUE, FALSE, FALSE)
|
||||
if(combatmode)
|
||||
toggle_combat_mode(TRUE)
|
||||
recoveringstam = TRUE
|
||||
disable_intentional_combat_mode(TRUE, FALSE)
|
||||
ENABLE_BITFIELD(combat_flags, COMBAT_FLAG_HARD_STAMCRIT)
|
||||
filters += CIT_FILTER_STAMINACRIT
|
||||
update_mobility()
|
||||
if(recoveringstam && total_health <= STAMINA_SOFTCRIT)
|
||||
if((combat_flags & COMBAT_FLAG_HARD_STAMCRIT) && total_health <= STAMINA_SOFTCRIT)
|
||||
to_chat(src, "<span class='notice'>You don't feel nearly as exhausted anymore.</span>")
|
||||
recoveringstam = FALSE
|
||||
DISABLE_BITFIELD(combat_flags, COMBAT_FLAG_HARD_STAMCRIT | COMBAT_FLAG_SOFT_STAMCRIT)
|
||||
filters -= CIT_FILTER_STAMINACRIT
|
||||
update_mobility()
|
||||
update_health_hud()
|
||||
|
||||
/mob/living/proc/update_hud_sprint_bar()
|
||||
if(hud_used && hud_used.sprint_buffer)
|
||||
hud_used.sprint_buffer.update_to_mob(src)
|
||||
|
||||
Reference in New Issue
Block a user