Objective Finalization

- Adds destroy AI objective to traitor objective rotation.
- Adds maroon and destroy AI objectives to the traitor panel's "Add
Objectives" button.
This commit is contained in:
DZD
2015-01-31 20:49:36 -05:00
parent 4b31b3270a
commit a48abebc43
2 changed files with 71 additions and 53 deletions
+36 -25
View File
@@ -177,12 +177,12 @@ datum/mind
text += "<a href='?src=\ref[src];revolution=clear'>employee</a>|<a href='?src=\ref[src];revolution=headrev'>headrev</a>|<b>REV</b>"
else
text += "<b>EMPLOYEE</b>|<a href='?src=\ref[src];revolution=headrev'>headrev</a>|<a href='?src=\ref[src];revolution=rev'>rev</a>"
if(current && current.client && current.client.prefs.be_special & BE_REV)
text += "|Enabled in Prefs"
else
text += "|Disabled in Prefs"
sections["revolution"] = text
/** CULT ***/
@@ -201,13 +201,13 @@ datum/mind
*/
else
text += "<b>EMPLOYEE</b>|<a href='?src=\ref[src];cult=cultist'>cultist</a>"
if(current && current.client && current.client.prefs.be_special & BE_CULTIST)
text += "|Enabled in Prefs"
else
text += "|Disabled in Prefs"
sections["cult"] = text
/** WIZARD ***/
@@ -222,12 +222,12 @@ datum/mind
text += "<br>Objectives are empty! <a href='?src=\ref[src];wizard=autoobjectives'>Randomize!</a>"
else
text += "<a href='?src=\ref[src];wizard=wizard'>yes</a>|<b>NO</b>"
if(current && current.client && current.client.prefs.be_special & BE_WIZARD)
text += "|Enabled in Prefs"
else
text += "|Disabled in Prefs"
sections["wizard"] = text
/** CHANGELING ***/
@@ -243,12 +243,12 @@ datum/mind
text += "<br><a href='?src=\ref[src];changeling=initialdna'>Transform to initial appearance.</a>"
else
text += "<a href='?src=\ref[src];changeling=changeling'>yes</a>|<b>NO</b>"
if(current && current.client && current.client.prefs.be_special & BE_CHANGELING)
text += "|Enabled in Prefs"
else
text += "|Disabled in Prefs"
sections["changeling"] = text
/** NINJA ***/
@@ -263,12 +263,12 @@ datum/mind
//text += "<br>Objectives are empty! <a href='?src=\ref[src];wizard=autoobjectives'>Randomize!</a>"
else
text += "<a href='?src=\ref[src];ninja=ninja'>yes</a>|<b>NO</b>"
if(current && current.client && current.client.prefs.be_special & BE_NINJA)
text += "|Enabled in Prefs"
else
text += "|Disabled in Prefs"
text += "|Disabled in Prefs"
sections["ninja"] = text
/** VAMPIRE ***/
@@ -282,15 +282,15 @@ datum/mind
text += "<br>Objectives are empty! <a href='?src=\ref[src];vampire=autoobjectives'>Randomize!</a>"
else
text += "<a href='?src=\ref[src];vampire=vampire'>yes</a>|<b>NO</b>"
if(src in ticker.mode.enthralled)
text += "<b><font color='#FF0000'>YES</font></b>|no"
else
text += "yes|<font color='#00FF00'>NO</font></b>"
/** Enthralled ***/
text += "<br><b>enthralled</b>"
sections["vampire"] = text
@@ -311,12 +311,12 @@ datum/mind
text += " Code is [code]. <a href='?src=\ref[src];nuclear=tellcode'>tell the code.</a>"
else
text += "<a href='?src=\ref[src];nuclear=nuclear'>operative</a>|<b>NANOTRASEN</b>"
if(current && current.client && current.client.prefs.be_special & BE_OPERATIVE)
text += "|Enabled in Prefs"
else
text += "|Disabled in Prefs"
text += "|Disabled in Prefs"
sections["nuclear"] = text
/** TRAITOR ***/
@@ -333,12 +333,12 @@ datum/mind
text += "<br>Objectives are empty! <a href='?src=\ref[src];traitor=autoobjectives'>Randomize</a>!"
else
text += "<a href='?src=\ref[src];traitor=traitor'>traitor</a>|<b>EMPLOYEE</b>"
if(current && current.client && current.client.prefs.be_special & BE_TRAITOR)
text += "|Enabled in Prefs"
else
text += "|Disabled in Prefs"
text += "|Disabled in Prefs"
sections["traitor"] = text
/** MONKEY ***/
@@ -359,12 +359,12 @@ datum/mind
else
text += "healthy|infected|human|<b>OTHER</b>"
/*if(current && current.client && current.client.prefs.be_special & BE_MONKEY)
text += "|Enabled in Prefs"
else
text += "|Disabled in Prefs"*/
text += "|Disabled in Prefs"*/
sections["monkey"] = text
@@ -475,13 +475,13 @@ datum/mind
if(!def_value)//If it's a custom objective, it will be an empty string.
def_value = "custom"
var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "blood", "debrain", "protect", "prevent", "harm", "speciesist", "brig", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "custom")
var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "blood", "debrain", "protect", "prevent", "harm", "speciesist", "brig", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "destroy", "maroon", "custom")
if (!new_obj_type) return
var/datum/objective/new_objective = null
switch (new_obj_type)
if ("assassinate","protect","debrain", "harm", "brig")
if ("assassinate","protect","debrain", "harm", "brig", "maroon")
//To determine what to name the objective in explanation text.
var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter.
var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text.
@@ -513,6 +513,17 @@ datum/mind
//Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops.
new_objective.explanation_text = "[objective_type] [new_target:real_name], the [new_target:mind:assigned_role=="MODE" ? (new_target:mind:special_role) : (new_target:mind:assigned_role)]."
if ("destroy")
var/list/possible_targets = active_ais(1)
if(possible_targets.len)
var/mob/new_target = input("Select target:", "Objective target") as null|anything in possible_targets
new_objective = new /datum/objective/destroy
new_objective.target = new_target.mind
new_objective.owner = src
new_objective.explanation_text = "Destroy [new_target.name], the experimental AI."
else
usr << "No active AIs with minds"
if ("speciesist")
new_objective = new /datum/objective/speciesist
new_objective.owner = src
+35 -28
View File
@@ -106,34 +106,41 @@
assign_exchange_role(exchange_red)
assign_exchange_role(exchange_blue)
else
switch(rand(1,100))
if(1 to 30)
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = traitor
kill_objective.find_target()
traitor.objectives += kill_objective
if(31 to 40)
var/datum/objective/debrain/debrain_objective = new
debrain_objective.owner = traitor
debrain_objective.find_target()
traitor.objectives += debrain_objective
if(41 to 50)
var/datum/objective/protect/protect_objective = new
protect_objective.owner = traitor
protect_objective.find_target_with_special_role(null,0)
if (!protect_objective.target)
protect_objective.find_target() //We could not find any traitors, protect somebody
traitor.objectives += protect_objective
if(51 to 66)
var/datum/objective/harm/harm_objective = new
harm_objective.owner = traitor
harm_objective.find_target()
traitor.objectives += harm_objective
else
var/datum/objective/steal/steal_objective = new
steal_objective.owner = traitor
steal_objective.find_target()
traitor.objectives += steal_objective
var/list/active_ais = active_ais()
if(active_ais.len && prob(100/num_players()))
var/datum/objective/destroy/destroy_objective = new
destroy_objective.owner = traitor
destroy_objective.find_target()
traitor.objectives += destroy_objective
else
switch(rand(1,100))
if(1 to 30)
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = traitor
kill_objective.find_target()
traitor.objectives += kill_objective
if(31 to 40)
var/datum/objective/debrain/debrain_objective = new
debrain_objective.owner = traitor
debrain_objective.find_target()
traitor.objectives += debrain_objective
if(41 to 50)
var/datum/objective/protect/protect_objective = new
protect_objective.owner = traitor
protect_objective.find_target_with_special_role(null,0)
if (!protect_objective.target)
protect_objective.find_target() //We could not find any traitors, protect somebody
traitor.objectives += protect_objective
if(51 to 61)
var/datum/objective/harm/harm_objective = new
harm_objective.owner = traitor
harm_objective.find_target()
traitor.objectives += harm_objective
else
var/datum/objective/steal/steal_objective = new
steal_objective.owner = traitor
steal_objective.find_target()
traitor.objectives += steal_objective
switch(rand(1,100))
if(1 to 30) // Die glorious death
if (!(locate(/datum/objective/die) in traitor.objectives) && !(locate(/datum/objective/steal) in traitor.objectives))