Datum antag wizard.

This commit is contained in:
AnturK
2017-10-11 12:23:26 +02:00
committed by CitadelStationBot
parent 6b10a53724
commit 5be4669924
19 changed files with 664 additions and 308 deletions
+19 -41
View File
@@ -75,7 +75,7 @@
if(islist(antag_datums))
for(var/i in antag_datums)
var/datum/antagonist/antag_datum = i
if(antag_datum.delete_on_death)
if(antag_datum.delete_on_mind_deletion)
qdel(i)
antag_datums = null
return ..()
@@ -133,10 +133,16 @@
memory = null
// Datum antag mind procs
/datum/mind/proc/add_antag_datum(datum_type, team)
if(!datum_type)
/datum/mind/proc/add_antag_datum(datum_type_or_instance, team)
if(!datum_type_or_instance)
return
var/datum/antagonist/A = new datum_type(src, team)
var/datum/antagonist/A
if(!ispath(datum_type_or_instance))
A = datum_type_or_instance
if(!istype(A))
return
else
A = new datum_type_or_instance(src, team)
if(!A.can_be_owned(src))
qdel(A)
return
@@ -193,12 +199,12 @@
/datum/mind/proc/remove_traitor()
if(src in SSticker.mode.traitors)
src.remove_antag_datum(ANTAG_DATUM_TRAITOR)
remove_antag_datum(ANTAG_DATUM_TRAITOR)
SSticker.mode.update_traitor_icons_removed(src)
/datum/mind/proc/remove_brother()
if(src in SSticker.mode.brothers)
src.remove_antag_datum(ANTAG_DATUM_BROTHER)
remove_antag_datum(ANTAG_DATUM_BROTHER)
SSticker.mode.update_brother_icons_removed(src)
/datum/mind/proc/remove_nukeop()
@@ -210,11 +216,8 @@
remove_antag_equip()
/datum/mind/proc/remove_wizard()
if(src in SSticker.mode.wizards)
SSticker.mode.wizards -= src
RemoveAllSpells()
remove_antag_datum(/datum/antagonist/wizard)
special_role = null
remove_antag_equip()
/datum/mind/proc/remove_cultist()
if(src in SSticker.mode.cult)
@@ -254,7 +257,6 @@
remove_rev()
SSticker.mode.update_changeling_icons_removed(src)
SSticker.mode.update_traitor_icons_removed(src)
SSticker.mode.update_wiz_icons_removed(src)
SSticker.mode.update_cult_icons_removed(src)
SSticker.mode.update_rev_icons_removed(src)
@@ -526,11 +528,9 @@
if (SSticker.mode.config_tag=="wizard")
text = uppertext(text)
text = "<i><b>[text]</b></i>: "
if ((src in SSticker.mode.wizards) || (src in SSticker.mode.apprentices))
if (has_antag_datum(/datum/antagonist/wizard))
text += "<b>YES</b> | <a href='?src=\ref[src];wizard=clear'>no</a>"
text += "<br><a href='?src=\ref[src];wizard=lair'>To lair</a>, <a href='?src=\ref[src];common=undress'>undress</a>, <a href='?src=\ref[src];wizard=dressup'>dress up</a>, <a href='?src=\ref[src];wizard=name'>let choose name</a>."
if (objectives.len==0)
text += "<br>Objectives are empty! <a href='?src=\ref[src];wizard=autoobjectives'>Randomize!</a>"
text += "<br><a href='?src=\ref[src];wizard=lair'>To lair</a>, <a href='?src=\ref[src];common=undress'>undress</a>"
else
text += "<a href='?src=\ref[src];wizard=wizard'>yes</a> | <b>NO</b>"
@@ -1049,27 +1049,15 @@
switch(href_list["wizard"])
if("clear")
remove_wizard()
to_chat(current, "<span class='userdanger'>You have been brainwashed! You are no longer a wizard!</span>")
log_admin("[key_name(usr)] has de-wizard'ed [current].")
SSticker.mode.update_wiz_icons_removed(src)
if("wizard")
if(!(src in SSticker.mode.wizards))
SSticker.mode.wizards += src
if(has_antag_datum(/datum/antagonist/wizard))
special_role = "Wizard"
//SSticker.mode.learn_basic_spells(current)
to_chat(current, "<span class='boldannounce'>You are the Space Wizard!</span>")
add_antag_datum(/datum/antagonist/wizard)
message_admins("[key_name_admin(usr)] has wizard'ed [current].")
log_admin("[key_name(usr)] has wizard'ed [current].")
SSticker.mode.update_wiz_icons_added(src)
if("lair")
current.forceMove(pick(GLOB.wizardstart))
if("dressup")
SSticker.mode.equip_wizard(current)
if("name")
SSticker.mode.name_wizard(current)
if("autoobjectives")
SSticker.mode.forge_wizard_objectives(src)
to_chat(usr, "<span class='notice'>The objectives for wizard [key] have been generated. You can edit them and anounce manually.</span>")
else if (href_list["changeling"])
switch(href_list["changeling"])
@@ -1440,20 +1428,10 @@
SSticker.mode.update_changeling_icons_added(src)
/datum/mind/proc/make_Wizard()
if(!(src in SSticker.mode.wizards))
SSticker.mode.wizards += src
if(!has_antag_datum(/datum/antagonist/wizard))
special_role = "Wizard"
assigned_role = "Wizard"
if(!GLOB.wizardstart.len)
SSjob.SendToLateJoin(current)
to_chat(current, "HOT INSERTION, GO GO GO")
else
current.forceMove(pick(GLOB.wizardstart))
SSticker.mode.equip_wizard(current)
SSticker.mode.name_wizard(current)
SSticker.mode.forge_wizard_objectives(src)
SSticker.mode.greet_wizard(src)
add_antag_datum(/datum/antagonist/wizard)
/datum/mind/proc/make_Cultist()