mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-23 04:51:32 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user