Merge pull request #4538 from Ikarrus/maroon

Maroon and Destroy objectives for Traitor and Changeling
This commit is contained in:
Alex
2014-08-26 08:14:01 +01:00
5 changed files with 131 additions and 36 deletions
+4 -1
View File
@@ -418,13 +418,16 @@ Turf and target are seperate in case you want to teleport some distance from a t
. += R
//Returns a list of AI's
/proc/active_ais()
/proc/active_ais(var/check_mind=0)
. = list()
for(var/mob/living/silicon/ai/A in living_mob_list)
if(A.stat == DEAD)
continue
if(A.control_disabled == 1)
continue
if(check_mind)
if(!A.mind)
continue
. += A
return .
+15 -9
View File
@@ -479,25 +479,20 @@
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", "debrain", "protect", "prevent", "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", "maroon", "debrain", "protect", "destroy", "prevent", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "custom")
if (!new_obj_type) return
var/datum/objective/new_objective = null
switch (new_obj_type)
if ("assassinate","protect","debrain")
//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.
var/objective_type = "[objective_type_capital][objective_type_text]"//Add them together into a text string.
if ("assassinate","protect","debrain","maroon")
var/list/possible_targets = list("Free objective")
for(var/datum/mind/possible_target in ticker.minds)
if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human))
possible_targets += possible_target.current
var/mob/def_target = null
var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain)
var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain, /datum/objective/maroon)
if (objective&&(objective.type in objective_list) && objective:target)
def_target = objective:target.current
@@ -515,7 +510,18 @@
new_objective.owner = src
new_objective:target = new_target: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)]."
new_objective.update_explanation_text()
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.update_explanation_text()
else
usr << "No active AIs with minds"
if ("prevent")
new_objective = new /datum/objective/block
+27 -15
View File
@@ -100,22 +100,34 @@ var/list/possible_changeling_IDs = list("Alpha","Beta","Gamma","Delta","Epsilon"
absorb_objective.gen_amount_goal(6, 8)
changeling.objectives += absorb_objective
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = changeling
kill_objective.find_target()
changeling.objectives += kill_objective
switch(rand(1,100))
if(1 to 60)
var/datum/objective/steal/steal_objective = new
steal_objective.owner = changeling
steal_objective.find_target()
changeling.objectives += steal_objective
var/list/active_ais = active_ais()
if(active_ais.len && prob(2))
var/datum/objective/destroy/destroy_objective = new
destroy_objective.owner = changeling
destroy_objective.find_target()
changeling.objectives += destroy_objective
else
if(prob(70))
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = changeling
kill_objective.find_target()
changeling.objectives += kill_objective
else
var/datum/objective/debrain/debrain_objective = new
debrain_objective.owner = changeling
debrain_objective.find_target()
changeling.objectives += debrain_objective
var/datum/objective/maroon/maroon_objective = new
maroon_objective.owner = changeling
maroon_objective.find_target()
changeling.objectives += maroon_objective
if(prob(60))
var/datum/objective/steal/steal_objective = new
steal_objective.owner = changeling
steal_objective.find_target()
changeling.objectives += steal_objective
else
var/datum/objective/debrain/debrain_objective = new
debrain_objective.owner = changeling
debrain_objective.find_target()
changeling.objectives += debrain_objective
if (!(locate(/datum/objective/escape) in changeling.objectives))
var/datum/objective/escape/escape_objective = new
+63 -1
View File
@@ -96,6 +96,42 @@ datum/objective/mutiny/update_explanation_text()
datum/objective/maroon
var/target_role_type=0
dangerrating = 5
datum/objective/maroon/find_target_by_role(role, role_type=0)
target_role_type = role_type
..(role, role_type)
return target
datum/objective/maroon/check_completion()
if(target && target.current)
if(target.current.stat == DEAD || issilicon(target.current) || isbrain(target.current) || target.current.z > 6 || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite
return 1
var/area/A = get_area(target.current)
if(istype(A, /area/shuttle/escape/centcom))
return 0
if(istype(A, /area/shuttle/escape_pod1/centcom))
return 0
if(istype(A, /area/shuttle/escape_pod2/centcom))
return 0
if(istype(A, /area/shuttle/escape_pod3/centcom))
return 0
if(istype(A, /area/shuttle/escape_pod4/centcom))
return 0
else
return 1
return 1
datum/objective/maroon/update_explanation_text()
if(target && target.current)
explanation_text = "Prevent [target.current.real_name], the [!target_role_type ? target.assigned_role : target.special_role], from escaping alive."
else
explanation_text = "Free Objective"
datum/objective/debrain//I want braaaainssss
var/target_role_type=0
dangerrating = 20
@@ -466,4 +502,30 @@ datum/objective/absorb/check_completion()
if(owner && owner.changeling && owner.changeling.absorbed_dna && (owner.changeling.absorbedcount >= target_amount))
return 1
else
return 0
return 0
datum/objective/destroy
dangerrating = 10
datum/objective/destroy/find_target()
var/list/possible_targets = active_ais(1)
var/mob/living/silicon/ai/target_ai = pick(possible_targets)
target = target_ai.mind
update_explanation_text()
return target
datum/objective/destroy/check_completion()
if(target && target.current)
if(target.current.stat == DEAD || target.current.z > 6 || !target.current.ckey) //Borgs/brains/AIs count as dead for traitor objectives. --NeoFite
return 1
return 0
return 1
datum/objective/destroy/update_explanation_text()
..()
if(target && target.current)
explanation_text = "Destroy [target.current.real_name], the experimental AI."
else
explanation_text = "Free Objective"
+22 -10
View File
@@ -119,17 +119,29 @@
assign_exchange_role(exchange_red)
assign_exchange_role(exchange_blue)
objective_count += 1 //Exchange counts towards number of objectives
var/list/active_ais = active_ais()
for(var/i = objective_count, i < config.traitor_objectives_amount, i++)
if(prob(50))
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = traitor
kill_objective.find_target()
traitor.objectives += kill_objective
else
var/datum/objective/steal/steal_objective = new
steal_objective.owner = traitor
steal_objective.find_target()
traitor.objectives += steal_objective
if(active_ais.len && prob(1))
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 15)
var/datum/objective/maroon/maroon_objective = new
maroon_objective.owner = traitor
maroon_objective.find_target()
traitor.objectives += maroon_objective
if(16 to 50)
var/datum/objective/assassinate/kill_objective = new
kill_objective.owner = traitor
kill_objective.find_target()
traitor.objectives += kill_objective
else
var/datum/objective/steal/steal_objective = new
steal_objective.owner = traitor
steal_objective.find_target()
traitor.objectives += steal_objective
if(is_hijacker && objective_count <= config.traitor_objectives_amount) //Don't assign hijack if it would exceed the number of objectives set in config.traitor_objectives_amount
if (!(locate(/datum/objective/hijack) in traitor.objectives))