mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-27 14:07:51 +01:00
VV refactor: dropdown actions. (#29673)
* VV refactor: dropdown actions. * helps if it builds * append to list cuz we have multiple separators * fix datumrefresh * tiny cleanup * fix jump to turf * Apply suggestions from code review Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Signed-off-by: warriorstar-orion <orion@snowfrost.garden> * Apply suggestions from code review Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com> Signed-off-by: warriorstar-orion <orion@snowfrost.garden> * fix typo --------- Signed-off-by: warriorstar-orion <orion@snowfrost.garden> Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
This commit is contained in:
co-authored by
Burzah
parent
ce0a9924ea
commit
6c2aa06eb3
@@ -1152,6 +1152,68 @@
|
||||
if(A.light_range > 0)
|
||||
A.extinguish_light(force)
|
||||
|
||||
/mob/living/vv_get_header()
|
||||
. = ..()
|
||||
. += {"
|
||||
<br><font size='1'>
|
||||
BRUTE:<font size='1'><a href='byond://?_src_=vars;[VV_HK_TARGET]=[UID()];adjustDamage=brute'>[getBruteLoss()]</a>
|
||||
FIRE:<font size='1'><a href='byond://?_src_=vars;[VV_HK_TARGET]=[UID()];adjustDamage=fire'>[getFireLoss()]</a>
|
||||
TOXIN:<font size='1'><a href='byond://?_src_=vars;[VV_HK_TARGET]=[UID()];adjustDamage=toxin'>[getToxLoss()]</a>
|
||||
OXY:<font size='1'><a href='byond://?_src_=vars;[VV_HK_TARGET]=[UID()];adjustDamage=oxygen'>[getOxyLoss()]</a>
|
||||
CLONE:<font size='1'><a href='byond://?_src_=vars;[VV_HK_TARGET]=[UID()];adjustDamage=clone'>[getCloneLoss()]</a>
|
||||
BRAIN:<font size='1'><a href='byond://?_src_=vars;[VV_HK_TARGET]=[UID()];adjustDamage=brain'>[getBrainLoss()]</a>
|
||||
STAMINA:<font size='1'><a href='byond://?_src_=vars;[VV_HK_TARGET]=[UID()];adjustDamage=stamina'>[getStaminaLoss()]</a>
|
||||
</font>
|
||||
"}
|
||||
|
||||
/mob/living/vv_do_topic(list/href_list)
|
||||
. = ..()
|
||||
|
||||
if(!.)
|
||||
return
|
||||
|
||||
if(href_list["adjustDamage"])
|
||||
if(!check_rights(R_DEBUG|R_ADMIN|R_EVENT)) return
|
||||
|
||||
var/Text = href_list["adjustDamage"]
|
||||
var/amount = tgui_input_number(usr, "Deal how much damage to mob? (Negative values here heal)", "Adjust [Text]loss")
|
||||
|
||||
if(QDELETED(src))
|
||||
to_chat(usr, "<span class='notice'>Mob doesn't exist anymore.</span>")
|
||||
return
|
||||
|
||||
switch(Text)
|
||||
if("brute")
|
||||
if(ishuman(src))
|
||||
var/mob/living/carbon/human/H = src
|
||||
H.adjustBruteLoss(amount, robotic = TRUE)
|
||||
else
|
||||
adjustBruteLoss(amount)
|
||||
if("fire")
|
||||
if(ishuman(src))
|
||||
var/mob/living/carbon/human/H = src
|
||||
H.adjustFireLoss(amount, robotic = TRUE)
|
||||
else
|
||||
adjustFireLoss(amount)
|
||||
if("toxin")
|
||||
adjustToxLoss(amount)
|
||||
if("oxygen")
|
||||
adjustOxyLoss(amount)
|
||||
if("brain")
|
||||
adjustBrainLoss(amount)
|
||||
if("clone")
|
||||
adjustCloneLoss(amount)
|
||||
if("stamina")
|
||||
adjustStaminaLoss(amount)
|
||||
else
|
||||
to_chat(usr, "<span class='notice'>You caused an error. DEBUG: Text:[Text] Mob:[src]</span>")
|
||||
return
|
||||
|
||||
if(amount != 0)
|
||||
log_admin("[key_name(usr)] dealt [amount] amount of [Text] damage to [src]")
|
||||
message_admins("[key_name_admin(usr)] dealt [amount] amount of [Text] damage to [src]")
|
||||
href_list["datumrefresh"] = UID()
|
||||
|
||||
/mob/living/vv_edit_var(var_name, var_value)
|
||||
switch(var_name)
|
||||
if("stat")
|
||||
|
||||
Reference in New Issue
Block a user