mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-25 22:12:58 +01:00
Diona nymphs can now run correctly (#19665)
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. Fixes #14038
This commit is contained in:
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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."
|
||||
Reference in New Issue
Block a user