Merge pull request #19958 from lzimann/removespell

Adds remove spell proc to the View Variables dropdown menu.
This commit is contained in:
Joan Lung
2016-08-19 20:38:41 -04:00
committed by GitHub
2 changed files with 28 additions and 1 deletions
+13
View File
@@ -262,6 +262,7 @@ var/global/list/internal_byond_list_vars = list("contents" = TRUE, "verbs" = TRU
if(ismob(D))
body += "<option value='?_src_=vars;give_spell=\ref[D]'>Give Spell</option>"
body += "<option value='?_src_=vars;remove_spell=\ref[D]'>Remove Spell</option>"
body += "<option value='?_src_=vars;give_disease=\ref[D]'>Give Disease</option>"
body += "<option value='?_src_=vars;ninja=\ref[D]'>Make Space Ninja</option>"
body += "<option value='?_src_=vars;godmode=\ref[D]'>Toggle Godmode</option>"
@@ -562,6 +563,18 @@ body
src.give_spell(M)
href_list["datumrefresh"] = href_list["give_spell"]
else if(href_list["remove_spell"])
if(!check_rights(0))
return
var/mob/M = locate(href_list["remove_spell"])
if(!istype(M))
usr << "This can only be used on instances of type /mob"
return
remove_spell(M)
href_list["datumrefresh"] = href_list["remove_spell"]
else if(href_list["give_disease"])
if(!check_rights(0))
return
+15 -1
View File
@@ -525,16 +525,30 @@ var/list/admin_verbs_hideable = list(
var/obj/effect/proc_holder/spell/S = input("Choose the spell to give to that guy", "ABRAKADABRA") as null|anything in spell_list
if(!S)
return
S = spell_list[S]
feedback_add_details("admin_verb","GS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
log_admin("[key_name(usr)] gave [key_name(T)] the spell [S].")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] gave [key_name(T)] the spell [S].</span>")
S = spell_list[S]
if(T.mind)
T.mind.AddSpell(new S)
else
T.AddSpell(new S)
message_admins("<span class='danger'>Spells given to mindless mobs will not be transferred in mindswap or cloning!</span>")
/client/proc/remove_spell(mob/T in mob_list)
set category = "Fun"
set name = "Remove Spell"
set desc = "Remove a spell from the selected mob."
if(T && T.mind)
var/obj/effect/proc_holder/spell/S = input("Choose the spell to remove", "NO ABRAKADABRA") as null|anything in T.mind.spell_list
if(S)
T.mind.RemoveSpell(S)
log_admin("[key_name(usr)] removed the spell [S] from [key_name(T)].")
message_admins("<span class='adminnotice'>[key_name_admin(usr)] removed the spell [S] from [key_name(T)].</span>")
feedback_add_details("admin_verb","RS") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/give_disease(mob/T in mob_list)
set category = "Fun"