From 76b0ce1a8ab16e6bd363aad98078a6406061a154 Mon Sep 17 00:00:00 2001 From: ikarrus Date: Fri, 22 Aug 2014 21:58:25 -0600 Subject: [PATCH 1/3] Maroon and Destroy objectives for Traitor and Changeling Maroon -Maroon objectives are a variation of assassination, where preventing the escape of the person also counts as a success. -Aprox. 30% of assasinations will be maroonings instead -Disincentivizes players from staying behind on the station when the shuttle leaves simply because "it's more safe" Destroy -Basically an assasination objective where the AI is the target -All traitors have a 1% of getting this objective. Changelings have 2% chance. -Adds variety, counterplay between those who want to destroy the AI and save/restore/steal it -It is entirely possible to get Destroy AI and Steal AI at the same time. While it would be difficult, it's still entirely possible to destroy your target and steal a different AI. The chances of getting both are very slim, however. -Encourages restoring the AI over killing it wherever possible. Discourages AIs from cooperating with antagonists. And there you go, my hamhanded attempts at some new objective types. --- code/game/gamemodes/changeling/changeling.dm | 42 ++++++++----- code/game/gamemodes/objective.dm | 63 +++++++++++++++++++- code/game/gamemodes/traitor/traitor.dm | 32 ++++++---- 3 files changed, 111 insertions(+), 26 deletions(-) diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 177ee48f567..3144258f625 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -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 diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 30cc57e9c7f..f7dea1f6c99 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -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,29 @@ datum/objective/absorb/check_completion() if(owner && owner.changeling && owner.changeling.absorbed_dna && (owner.changeling.absorbedcount >= target_amount)) return 1 else - return 0 \ No newline at end of file + return 0 + + + +datum/objective/destroy + dangerrating = 10 + +datum/objective/destroy/find_target() + var/list/possible_targets = active_ais() + target = pick(possible_targets) + 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" \ No newline at end of file diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 795a2976e1b..d7315ce94b8 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -115,17 +115,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)) From 06a6a21864f654935425027682503576defc9455 Mon Sep 17 00:00:00 2001 From: ikarrus Date: Fri, 22 Aug 2014 22:22:44 -0600 Subject: [PATCH 2/3] Can add maroon and destroy via Traitor Panel --- code/datums/mind.dm | 22 +++++++++++++--------- code/game/gamemodes/objective.dm | 3 ++- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index 02e8692a53d..cf4188b5402 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -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,16 @@ 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() + 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() if ("prevent") new_objective = new /datum/objective/block diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index f7dea1f6c99..5c28be2910c 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -511,7 +511,8 @@ datum/objective/destroy datum/objective/destroy/find_target() var/list/possible_targets = active_ais() - target = pick(possible_targets) + var/mob/living/silicon/ai/target_ai = pick(possible_targets) + target = target_ai.mind update_explanation_text() return target From f8df362da0525fd463d492d6a584245ce87a2ddc Mon Sep 17 00:00:00 2001 From: ikarrus Date: Sat, 23 Aug 2014 09:46:28 -0600 Subject: [PATCH 3/3] Checks for minds before adding AIs to the list of destroy candidates --- code/__HELPERS/unsorted.dm | 5 ++++- code/datums/mind.dm | 4 +++- code/game/gamemodes/objective.dm | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 2cf7ce75c49..79023f386a1 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -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 . diff --git a/code/datums/mind.dm b/code/datums/mind.dm index cf4188b5402..9a18a3d8c32 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -513,13 +513,15 @@ new_objective.update_explanation_text() if ("destroy") - var/list/possible_targets = active_ais() + 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 diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 5c28be2910c..5657ca52683 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -510,7 +510,7 @@ datum/objective/destroy dangerrating = 10 datum/objective/destroy/find_target() - var/list/possible_targets = active_ais() + var/list/possible_targets = active_ais(1) var/mob/living/silicon/ai/target_ai = pick(possible_targets) target = target_ai.mind update_explanation_text()