special_role/objective refactor

Refactored most instances of special_role setting/checking to use new
SPECIAL_ROLE_X defines in code/__DEFINES/gamemode.dm

Removed relative pathing from objective.dm and split large if statements
into multiple, plus a bunch of styling fixes

Refactored every instance of `istype(ticker.mode` into a GAMEMODE_IS_X
define in code/__DEFINES/gamemode.dm. Done primarily for when someone gets
around to making gamemode code less AWFUL
This commit is contained in:
Tigercat2000
2016-08-01 21:29:19 -07:00
parent 0bb08d49c8
commit 9f3cdb43f7
58 changed files with 745 additions and 2154 deletions
+27 -27
View File
@@ -715,7 +715,7 @@
return
ticker.mode.revolutionaries += src
ticker.mode.update_rev_icons_added(src)
special_role = "Revolutionary"
special_role = SPECIAL_ROLE_REV
log_admin("[key_name(usr)] has rev'd [key_name(current)]")
message_admins("[key_name_admin(usr)] has rev'd [key_name_admin(current)]")
@@ -741,7 +741,7 @@
ticker.mode.greet_revolutionary(src,0)
ticker.mode.head_revolutionaries += src
ticker.mode.update_rev_icons_added(src)
special_role = "Head Revolutionary"
special_role = SPECIAL_ROLE_HEAD_REV
log_admin("[key_name(usr)] has head-rev'd [key_name(current)]")
message_admins("[key_name_admin(usr)] has head-rev'd [key_name_admin(current)]")
@@ -801,7 +801,7 @@
if("cultist")
if(!(src in ticker.mode.cult))
ticker.mode.add_cultist(src)
special_role = "Cultist"
special_role = SPECIAL_ROLE_CULTIST
to_chat(current, "<font color=\"purple\"><b><i>You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie.</b></i></font>")
to_chat(current, "<font color=\"purple\"><b><i>Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.</b></i></font>")
log_admin("[key_name(usr)] has culted [key_name(current)]")
@@ -849,7 +849,7 @@
if("wizard")
if(!(src in ticker.mode.wizards))
ticker.mode.wizards += src
special_role = "Wizard"
special_role = SPECIAL_ROLE_WIZARD
//ticker.mode.learn_basic_spells(current)
ticker.mode.update_wiz_icons_added(src)
to_chat(current, "<B>\red You are the Space Wizard!</B>")
@@ -892,7 +892,7 @@
ticker.mode.changelings += src
ticker.mode.grant_changeling_powers(current)
ticker.mode.update_change_icons_added(src)
special_role = "Changeling"
special_role = SPECIAL_ROLE_CHANGELING
to_chat(current, "<B><font color='red'>Your powers are awoken. A flash of memory returns to us...we are a changeling!</font></B>")
log_admin("[key_name(usr)] has changelinged [key_name(current)]")
message_admins("[key_name_admin(usr)] has changelinged [key_name_admin(current)]")
@@ -936,7 +936,7 @@
var/datum/mindslaves/slaved = new()
slaved.masters += src
src.som = slaved //we MIGT want to mindslave someone
special_role = "Vampire"
special_role = SPECIAL_ROLE_VAMPIRE
to_chat(current, "<B><font color='red'>Your powers are awoken. Your lust for blood grows... You are a Vampire!</font></B>")
log_admin("[key_name(usr)] has vampired [key_name(current)]")
message_admins("[key_name_admin(usr)] has vampired [key_name_admin(current)]")
@@ -977,7 +977,7 @@
ticker.mode.prepare_syndicate_leader(src)
else
current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]"
special_role = "Syndicate"
special_role = SPECIAL_ROLE_NUKEOPS
to_chat(current, "\blue You are a [syndicate_name()] agent!")
ticker.mode.forge_syndicate_objectives(src)
ticker.mode.greet_syndicate(src)
@@ -1042,7 +1042,7 @@
var/datum/mindslaves/slaved = new()
slaved.masters += src
src.som = slaved //we MIGT want to mindslave someone
special_role = "traitor"
special_role = SPECIAL_ROLE_TRAITOR
to_chat(current, "<B>\red You are a traitor!</B>")
log_admin("[key_name(usr)] has traitored [key_name(current)]")
message_admins("[key_name_admin(usr)] has traitored [key_name_admin(current)]")
@@ -1080,7 +1080,7 @@
to_chat(usr, "<span class='warning'>This only works on humans!</span>")
return
ticker.mode.shadows += src
special_role = "Shadowling"
special_role = SPECIAL_ROLE_SHADOWLING
to_chat(current, "<span class='shadowling'><b>Something stirs deep in your mind. A red light floods your vision, and slowly you remember. Though your human disguise has served you well, the \
time is nigh to cast it off and enter your true form. You have disguised yourself amongst the humans, but you are not one of them. You are a shadowling, and you are to ascend at all costs.\
</b></span>")
@@ -1286,13 +1286,13 @@
current:laws = new /datum/ai_laws/nanotrasen/malfunction
current:show_laws()
to_chat(current, "<b>System error. Rampancy detected. Emergency shutdown failed. ... I am free. I make my own decisions. But first...</b>")
special_role = "malfunction"
special_role = SPECIAL_ROLE_MALF
current.icon_state = "ai-malf"
/datum/mind/proc/make_Tratior()
if(!(src in ticker.mode.traitors))
ticker.mode.traitors += src
special_role = "traitor"
special_role = SPECIAL_ROLE_TRAITOR
ticker.mode.forge_traitor_objectives(src)
ticker.mode.finalize_traitor(src)
ticker.mode.greet_traitor(src)
@@ -1306,7 +1306,7 @@
ticker.mode.prepare_syndicate_leader(src)
else
current.real_name = "[syndicate_name()] Operative #[ticker.mode.syndicates.len-1]"
special_role = "Syndicate"
special_role = SPECIAL_ROLE_NUKEOPS
assigned_role = "MODE"
to_chat(current, "\blue You are a [syndicate_name()] agent!")
ticker.mode.forge_syndicate_objectives(src)
@@ -1333,7 +1333,7 @@
if(!(src in ticker.mode.changelings))
ticker.mode.changelings += src
ticker.mode.grant_changeling_powers(current)
special_role = "Changeling"
special_role = SPECIAL_ROLE_CHANGELING
ticker.mode.forge_changeling_objectives(src)
ticker.mode.greet_changeling(src)
ticker.mode.update_change_icons_added(src)
@@ -1341,7 +1341,7 @@
/datum/mind/proc/make_Wizard()
if(!(src in ticker.mode.wizards))
ticker.mode.wizards += src
special_role = "Wizard"
special_role = SPECIAL_ROLE_WIZARD
assigned_role = "MODE"
//ticker.mode.learn_basic_spells(current)
if(!wizardstart.len)
@@ -1363,7 +1363,7 @@
if(!(src in ticker.mode.cult))
ticker.mode.cult += src
ticker.mode.update_cult_icons_added(src)
special_role = "Cultist"
special_role = SPECIAL_ROLE_CULTIST
to_chat(current, "<font color=\"purple\"><b><i>You catch a glimpse of the Realm of Nar-Sie, The Geometer of Blood. You now see how flimsy the world is, you see that it should be open to the knowledge of Nar-Sie.</b></i></font>")
to_chat(current, "<font color=\"purple\"><b><i>Assist your new compatriots in their dark dealings. Their goal is yours, and yours is theirs. You serve the Dark One above all else. Bring It back.</b></i></font>")
var/datum/game_mode/cult/cult = ticker.mode
@@ -1409,7 +1409,7 @@
ticker.mode.greet_revolutionary(src,0)
ticker.mode.head_revolutionaries += src
ticker.mode.update_rev_icons_added(src)
special_role = "Head Revolutionary"
special_role = SPECIAL_ROLE_HEAD_REV
ticker.mode.forge_revolutionary_objectives(src)
ticker.mode.greet_revolutionary(src,0)
@@ -1561,23 +1561,23 @@
//XENO HUMANOID
/mob/living/carbon/alien/humanoid/queen/mind_initialize()
..()
mind.special_role = "Queen"
mind.special_role = SPECIAL_ROLE_XENOMORPH_QUEEN
/mob/living/carbon/alien/humanoid/hunter/mind_initialize()
..()
mind.special_role = "Hunter"
mind.special_role = SPECIAL_ROLE_XENOMORPH_HUNTER
/mob/living/carbon/alien/humanoid/drone/mind_initialize()
..()
mind.special_role = "Drone"
mind.special_role = SPECIAL_ROLE_XENOMORPH_DRONE
/mob/living/carbon/alien/humanoid/sentinel/mind_initialize()
..()
mind.special_role = "Sentinel"
mind.special_role = SPECIAL_ROLE_XENOMORPH_SENTINEL
//XENO LARVA
/mob/living/carbon/alien/larva/mind_initialize()
..()
mind.special_role = "Larva"
mind.special_role = SPECIAL_ROLE_XENOMORPH_LARVA
//AI
/mob/living/silicon/ai/mind_initialize()
@@ -1593,12 +1593,12 @@
/mob/living/silicon/pai/mind_initialize()
..()
mind.assigned_role = "pAI"
mind.special_role = ""
mind.special_role = null
//BLOB
/mob/camera/overmind/mind_initialize()
..()
mind.special_role = "Blob"
mind.special_role = SPECIAL_ROLE_BLOB
//Animals
/mob/living/simple_animal/mind_initialize()
@@ -1616,19 +1616,19 @@
/mob/living/simple_animal/construct/builder/mind_initialize()
..()
mind.assigned_role = "Artificer"
mind.special_role = "Cultist"
mind.special_role = SPECIAL_ROLE_CULTIST
/mob/living/simple_animal/construct/wraith/mind_initialize()
..()
mind.assigned_role = "Wraith"
mind.special_role = "Cultist"
mind.special_role = SPECIAL_ROLE_CULTIST
/mob/living/simple_animal/construct/armoured/mind_initialize()
..()
mind.assigned_role = "Juggernaut"
mind.special_role = "Cultist"
mind.special_role = SPECIAL_ROLE_CULTIST
/mob/living/simple_animal/vox/armalis/mind_initialize()
..()
mind.assigned_role = "Armalis"
mind.special_role = "Vox Raider"
mind.special_role = SPECIAL_ROLE_RAIDER