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
@@ -97,7 +97,7 @@
ticker.mode.xenos += new_xeno.mind
new_xeno.mind.name = new_xeno.name
new_xeno.mind.assigned_role = "MODE"
new_xeno.mind.special_role = "Alien"
new_xeno.mind.special_role = SPECIAL_ROLE_XENOMORPH
new_xeno << sound('sound/voice/hiss5.ogg',0,0,0,100)//To get the player's attention
if(gib_on_success)
@@ -364,7 +364,7 @@
traitorType = inPers
ticker.mode.traitors += mind
mind.special_role = "traitor"
mind.special_role = SPECIAL_ROLE_TRAITOR
var/datum/mindslaves/slaved = new()
slaved.masters += mind
mind.som = slaved
@@ -45,7 +45,7 @@
/datum/species/golem/handle_post_spawn(var/mob/living/carbon/human/H)
if(H.mind)
H.mind.assigned_role = "Golem"
H.mind.special_role = "Golem"
H.mind.special_role = SPECIAL_ROLE_GOLEM
H.real_name = "adamantine golem ([rand(1, 1000)])"
H.name = H.real_name
H.equip_to_slot_or_del(new /obj/item/clothing/under/golem(H), slot_w_uniform)
+1 -1
View File
@@ -1044,7 +1044,7 @@ var/list/ai_verbs_default = list(
to_chat(user, "<span class='warning'>No intelligence patterns detected.</span>")//No more magical carding of empty cores, AI RETURN TO BODY!!!11
return
if(mind.special_role == "malfunction") //AI MALF!!
if(mind.special_role == SPECIAL_ROLE_MALF) //AI MALF!!
to_chat(user, "<span class='boldannounce'>ERROR</span>: Remote transfer interface disabled.")//Do ho ho ho~
return
@@ -21,7 +21,7 @@
photosync()
to_chat(src, "<b>Laws synced with AI, be sure to note any changes.</b>")
// TODO: Update to new antagonist system.
if(mind && mind.special_role == "traitor" && mind.original == src)
if(mind && mind.special_role == SPECIAL_ROLE_TRAITOR && mind.original == src)
to_chat(src, "<b>Remember, your AI does NOT share or know about your law 0.")
else
to_chat(src, "<b>No AI selected to sync laws with, disabling lawsync protocol.</b>")
@@ -30,7 +30,7 @@
to_chat(who, "<b>Obey these laws:</b>")
laws.show_laws(who)
// TODO: Update to new antagonist system.
if(mind && (mind.special_role == "traitor" && mind.original == src) && connected_ai)
if(mind && (mind.special_role == SPECIAL_ROLE_TRAITOR && mind.original == src) && connected_ai)
to_chat(who, "<b>Remember, [connected_ai.name] is technically your master, but your objective comes first.</b>")
else if(connected_ai)
to_chat(who, "<b>Remember, [connected_ai.name] is your master, other AIs can be ignored.</b>")
@@ -1383,7 +1383,7 @@ var/list/robot_verbs_default = list(
var/mob/M = pick(borg_candidates)
M.mind.transfer_to(src)
M.mind.assigned_role = "MODE"
M.mind.special_role = "Death Commando"
M.mind.special_role = SPECIAL_ROLE_DEATHSQUAD
ticker.mode.traitors |= M.mind // Adds them to current traitor list. Which is really the extra antagonist list.
key = M.key
else
+15 -2
View File
@@ -50,8 +50,21 @@ proc/isNonCrewAntag(A)
var/mob/living/carbon/C = A
var/special_role = C.mind.special_role
var/list/crew_roles = list("traitor", "Changeling", "Vampire", "Cultist", "Head Revolutionary", "Revolutionary", "malfunctioning AI", "Shadowling", "loyalist", "mutineer", "Response Team")
if((special_role in crew_roles))
var/list/crew_roles = list(
SPECIAL_ROLE_BLOB,
SPECIAL_ROLE_CULTIST,
SPECIAL_ROLE_CHANGELING,
SPECIAL_ROLE_ERT,
SPECIAL_ROLE_HEAD_REV,
SPECIAL_ROLE_MALF,
SPECIAL_ROLE_REV,
SPECIAL_ROLE_SHADOWLING,
SPECIAL_ROLE_SHADOWLING_THRALL,
SPECIAL_ROLE_TRAITOR,
SPECIAL_ROLE_VAMPIRE,
SPECIAL_ROLE_VAMPIRE_THRALL
)
if(special_role in crew_roles)
return 0
return 1