mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-31 00:58:26 +01:00
Upgrades GODMODE from a flag to a trait. (#86596)
## About The Pull Request GODMODE has a lot of sources that toggle it. From admin-stuff to status effects, components, actions and mobs which are supposed to be invincible. It's better off as a trait than a flag, so we can manage these sources. ## Why It's Good For The Game See above. ## Changelog 🆑 admin: godmode is now a datum trait instead of a bitflag. This means the process for toggling it is a little different now. /🆑
This commit is contained in:
@@ -150,20 +150,24 @@ ADMIN_VERB_ONLY_CONTEXT_MENU(show_player_panel, R_ADMIN, "Show Player Panel", mo
|
||||
user << browse(body, "window=adminplayeropts-[REF(player)];size=550x515")
|
||||
BLACKBOX_LOG_ADMIN_VERB("Player Panel")
|
||||
|
||||
/client/proc/cmd_admin_godmode(mob/M in GLOB.mob_list)
|
||||
/client/proc/cmd_admin_godmode(mob/mob in GLOB.mob_list)
|
||||
set category = "Admin.Game"
|
||||
set name = "Godmode"
|
||||
if(!check_rights(R_ADMIN))
|
||||
return
|
||||
|
||||
M.status_flags ^= GODMODE
|
||||
to_chat(usr, span_adminnotice("Toggled [(M.status_flags & GODMODE) ? "ON" : "OFF"]"), confidential = TRUE)
|
||||
var/had_trait = HAS_TRAIT_FROM(mob, TRAIT_GODMODE, ADMIN_TRAIT)
|
||||
if(had_trait)
|
||||
REMOVE_TRAIT(mob, TRAIT_GODMODE, ADMIN_TRAIT)
|
||||
else
|
||||
ADD_TRAIT(mob, TRAIT_GODMODE, ADMIN_TRAIT)
|
||||
to_chat(usr, span_adminnotice("Toggled [had_trait ? "OFF" : "ON"]"), confidential = TRUE)
|
||||
|
||||
log_admin("[key_name(usr)] has toggled [key_name(M)]'s nodamage to [(M.status_flags & GODMODE) ? "On" : "Off"]")
|
||||
var/msg = "[key_name_admin(usr)] has toggled [ADMIN_LOOKUPFLW(M)]'s nodamage to [(M.status_flags & GODMODE) ? "On" : "Off"]"
|
||||
log_admin("[key_name(usr)] has toggled [key_name(mob)]'s nodamage to [had_trait ? "Off" : "On"]")
|
||||
var/msg = "[key_name_admin(usr)] has toggled [ADMIN_LOOKUPFLW(mob)]'s nodamage to [had_trait ? "Off" : "On"]"
|
||||
message_admins(msg)
|
||||
admin_ticket_log(M, msg)
|
||||
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Godmode", "[M.status_flags & GODMODE ? "Enabled" : "Disabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
||||
admin_ticket_log(mob, msg)
|
||||
SSblackbox.record_feedback("nested tally", "admin_toggle", 1, list("Godmode", "[had_trait ? "Disabled" : "Enabled"]")) // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
|
||||
|
||||
/*
|
||||
If a guy was gibbed and you want to revive him, this is a good way to do so.
|
||||
|
||||
Reference in New Issue
Block a user