diff --git a/code/_onclick/hud/screen_objects.dm b/code/_onclick/hud/screen_objects.dm index a9cd859198d..1910b75133e 100644 --- a/code/_onclick/hud/screen_objects.dm +++ b/code/_onclick/hud/screen_objects.dm @@ -459,22 +459,22 @@ //This updates the run/walk button on the hud /obj/screen/movement_intent/proc/update_move_icon(var/mob/living/user) - if (!user.client) + if(!user.client) return - if (user.max_stamina == -1 || user.stamina == user.max_stamina) - if (user.stamina_bar) + if(user.max_stamina == -1 || user.stamina == user.max_stamina) + if(user.stamina_bar) user.stamina_bar.endProgress() user.stamina_bar = null else - if (!user.stamina_bar) + if(!user.stamina_bar) user.stamina_bar = new(user, user.max_stamina, src) user.stamina_bar.goal = user.max_stamina user.stamina_bar.update(user.stamina) - if (user.m_intent == M_RUN) + if(user.m_intent == M_RUN) icon_state = "running" - else if (user.m_intent == M_LAY) + else if(user.m_intent == M_LAY) icon_state = "lying" else icon_state = "walking" diff --git a/code/modules/mob/living/carbon/alien/diona/diona_nymph.dm b/code/modules/mob/living/carbon/alien/diona/diona_nymph.dm index 43c01c7ff45..9586a61fb95 100644 --- a/code/modules/mob/living/carbon/alien/diona/diona_nymph.dm +++ b/code/modules/mob/living/carbon/alien/diona/diona_nymph.dm @@ -26,6 +26,7 @@ meat_amount = 2 maxHealth = 50 health = 50 + max_stamina = -1 pass_flags = PASSTABLE // Decorative head flower. @@ -377,3 +378,9 @@ if (status_flags & GODMODE) return health = min(health - amount, maxHealth) + +/mob/living/carbon/alien/diona/getHalLoss() + if(status_flags & GODMODE) + return + + return max((maxHealth - health), 0) diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 9dc4f01c584..eec7702ac2e 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -668,7 +668,7 @@ if(H.is_drowsy()) cost *= 1.25 if (H.stamina == -1) - LOG_DEBUG("Error: Species with special sprint mechanics has not overridden cost function.") + stack_trace("Error: Species with special sprint mechanics has not overridden cost function.") return 0 var/obj/item/organ/internal/augment/calf_override/C = H.internal_organs_by_name[BP_AUG_CALF_OVERRIDE] diff --git a/code/modules/mob/living/carbon/human/species/station/diona/diona.dm b/code/modules/mob/living/carbon/human/species/station/diona/diona.dm index f75270a71c3..f8aace7b615 100644 --- a/code/modules/mob/living/carbon/human/species/station/diona/diona.dm +++ b/code/modules/mob/living/carbon/human/species/station/diona/diona.dm @@ -182,6 +182,23 @@ if((!D.client && !D.mind) || D.stat == DEAD) qdel(D) +//This handles nymphs, which are the only diona specie that can run, since they don't breathe they just take pain damage instead +/datum/species/diona/handle_sprint_cost(mob/living/carbon/human/H, cost, pre_move) + if(!pre_move) + H.adjustHalLoss(cost*0.3) + H.updatehealth() + + if(H.getHalLoss() > (H.maxHealth*0.6)) + var/shock = H.get_shock() + if(prob(shock * 2)) + to_chat(H, SPAN_DANGER("You feel a sharp pain in your nervous system! You can't run anymore, or you might die!")) + H.m_intent = M_WALK + + if(!pre_move) + H.hud_used.move_intent.update_move_icon(H) + return 1 + + /datum/species/diona/after_equip(mob/living/carbon/human/H, visualsOnly, datum/job/J) . = ..() var/obj/item/storage/box/survival/SB = locate() in H diff --git a/html/changelogs/fluffyghost-dionnympharunfixes.yml b/html/changelogs/fluffyghost-dionnympharunfixes.yml new file mode 100644 index 00000000000..fd775e1bda9 --- /dev/null +++ b/html/changelogs/fluffyghost-dionnympharunfixes.yml @@ -0,0 +1,58 @@ +################################ +# Example Changelog File +# +# Note: This file, and files beginning with ".", and files that don't end in ".yml" will not be read. If you change this file, you will look really dumb. +# +# Your changelog will be merged with a master changelog. (New stuff added only, and only on the date entry for the day it was merged.) +# When it is, any changes listed below will disappear. +# +# Valid Prefixes: +# bugfix +# - (fixes bugs) +# wip +# - (work in progress) +# qol +# - (quality of life) +# soundadd +# - (adds a sound) +# sounddel +# - (removes a sound) +# rscadd +# - (adds a feature) +# rscdel +# - (removes a feature) +# imageadd +# - (adds an image or sprite) +# imagedel +# - (removes an image or sprite) +# spellcheck +# - (fixes spelling or grammar) +# experiment +# - (experimental change) +# balance +# - (balance changes) +# code_imp +# - (misc internal code change) +# refactor +# - (refactors code) +# config +# - (makes a change to the config files) +# admin +# - (makes changes to administrator tools) +# server +# - (miscellaneous changes to server) +################################# + +# Your name. +author: FluffyGhost + +# Optional: Remove this file after generating master changelog. Useful for PR changelogs that won't get used again. +delete-after: True + +# Any changes you've made. See valid prefix list above. +# INDENT WITH TWO SPACES. NOT TABS. SPACES. +# SCREW THIS UP AND IT WON'T WORK. +# Also, this gets changed to [] after reading. Just remove the brackets when you add new shit. +# Please surround your changes in double quotes ("). It works without them, but if you use certain characters it screws up compiling. The quotes will not show up in the changelog. +changes: + - bugfix: "Diona nymphs can now run correctly, without a weird empty stamina bar, and stopping as appropriate when their stamina (health) is low, with a message."