Fixes inaccuracy in changeling chemical storage UI element. (#21583)

* Fixes error in changeling chemical storage UI element.

* Fixed argument path.
This commit is contained in:
Divulf
2023-07-16 11:26:28 -05:00
committed by GitHub
parent 809335b3b9
commit d1ee476eac
2 changed files with 7 additions and 3 deletions
@@ -69,6 +69,7 @@
/datum/action/changeling/proc/take_chemical_cost()
cling.chem_charges -= chemical_cost
cling.update_chem_charges_ui()
/datum/action/changeling/proc/can_sting(mob/user, mob/target)
SHOULD_CALL_PARENT(TRUE)
@@ -183,15 +183,18 @@
if(!owner || !owner.current)
return PROCESS_KILL
var/mob/living/carbon/human/H = owner.current
if(H.hud_used?.lingchemdisplay)
H.hud_used.lingchemdisplay.invisibility = 0
H.hud_used.lingchemdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font face='Small Fonts' color='#dd66dd'>[round(chem_charges)]</font></div>"
if(H.stat == DEAD)
chem_charges = clamp(0, chem_charges + chem_recharge_rate - chem_recharge_slowdown, chem_storage * 0.5)
genetic_damage = directional_bounded_sum(genetic_damage, -1, LING_DEAD_GENETIC_DAMAGE_HEAL_CAP, 0)
else // Not dead? no chem/genetic_damage caps.
chem_charges = clamp(0, chem_charges + chem_recharge_rate - chem_recharge_slowdown, chem_storage)
genetic_damage = max(0, genetic_damage - 1)
update_chem_charges_ui(H)
/datum/antagonist/changeling/proc/update_chem_charges_ui(mob/living/carbon/human/H = owner.current)
if(H.hud_used?.lingchemdisplay)
H.hud_used.lingchemdisplay.invisibility = 0
H.hud_used.lingchemdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'><font face='Small Fonts' color='#dd66dd'>[round(chem_charges)]</font></div>"
/**
* Respec the changeling's powers after first checking if they're able to respec.