mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-26 06:29:23 +01:00
Reworks invisimin variable to a trait (#80121)
## About The Pull Request This was a variable that existed on the `/mob` level despite only ever being altered in one place. Perfect to just make a trait since it's all managed in one spot anyways (and no other code is really reliant on this flag being flipped, it's just for the code to know to add/remove invisimin status). I also tweaked some messages so they could be more consistent, lmk if that should be changed ## Why It's Good For The Game Less not-useful stuff to scroll through in View Variables, better scoping of a variable to an intended location. ## Changelog Not necessary
This commit is contained in:
@@ -354,18 +354,21 @@ GLOBAL_PROTECT(admin_verbs_poll)
|
||||
set name = "Invisimin"
|
||||
set category = "Admin.Game"
|
||||
set desc = "Toggles ghost-like invisibility (Don't abuse this)"
|
||||
|
||||
if(isnull(holder) || isnull(mob))
|
||||
return
|
||||
if(mob.invisimin)
|
||||
|
||||
if(HAS_TRAIT(mob, TRAIT_INVISIMIN))
|
||||
REMOVE_TRAIT(mob, TRAIT_INVISIMIN, ADMIN_TRAIT)
|
||||
mob.add_to_all_human_data_huds()
|
||||
mob.invisimin = FALSE
|
||||
mob.RemoveInvisibility(INVISIBILITY_SOURCE_INVISIMIN)
|
||||
to_chat(mob, span_boldannounce("Invisimin off. Invisibility reset."), confidential = TRUE)
|
||||
else
|
||||
mob.remove_from_all_data_huds()
|
||||
mob.invisimin = TRUE
|
||||
mob.SetInvisibility(INVISIBILITY_OBSERVER, INVISIBILITY_SOURCE_INVISIMIN, INVISIBILITY_PRIORITY_ADMIN)
|
||||
to_chat(mob, span_adminnotice("<b>Invisimin on. You are now as invisible as a ghost.</b>"), confidential = TRUE)
|
||||
to_chat(mob, span_adminnotice(span_bold("Invisimin off. Invisibility reset.")), confidential = TRUE)
|
||||
return
|
||||
|
||||
ADD_TRAIT(mob, TRAIT_INVISIMIN, ADMIN_TRAIT)
|
||||
mob.remove_from_all_data_huds()
|
||||
mob.SetInvisibility(INVISIBILITY_OBSERVER, INVISIBILITY_SOURCE_INVISIMIN, INVISIBILITY_PRIORITY_ADMIN)
|
||||
to_chat(mob, span_adminnotice(span_bold("Invisimin on. You are now as invisible as a ghost.")), confidential = TRUE)
|
||||
|
||||
/client/proc/check_antagonists()
|
||||
set name = "Check Antagonists"
|
||||
|
||||
Reference in New Issue
Block a user