From 80ceda266f4561e066060d1ecee07cb067680fef Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Thu, 15 Oct 2020 23:11:27 +0200 Subject: [PATCH] [MIRROR] Fixes heretic giving you both hijack and dagd, fixes protection objective. (#1333) * Fixes heretic giving you both hijack and dagd, fixes protection objective. (#54374) Heretic can no longer give you both hijack AND die a glorius death objective. Protection objective was broken for some time, it always suceeded. It should be fixed now. * Fixes heretic giving you both hijack and dagd, fixes protection objective. Co-authored-by: EdgeLordExe <42111655+EdgeLordExe@users.noreply.github.com> --- code/game/gamemodes/objective.dm | 2 +- .../eldritch_cult/eldritch_antag.dm | 64 ++++++++++--------- 2 files changed, 35 insertions(+), 31 deletions(-) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index 16ff4cfdfb1..9d642408f05 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -296,7 +296,7 @@ GLOBAL_LIST(admin_objective_list) //Prefilled admin assignable objective list if(human_check) brain_target = target.current.getorganslot(ORGAN_SLOT_BRAIN) //Protect will always suceed when someone suicides - return !target || considered_alive(target, enforce_human = human_check) || (human_check == TRUE && brain_target)? !brain_target.suicided : FALSE + return !target || considered_alive(target, enforce_human = human_check) || (human_check == TRUE && brain_target) ? brain_target.suicided : FALSE /datum/objective/protect/update_explanation_text() ..() diff --git a/code/modules/antagonists/eldritch_cult/eldritch_antag.dm b/code/modules/antagonists/eldritch_cult/eldritch_antag.dm index 517fa7a1d1a..bc94e6f3ef8 100644 --- a/code/modules/antagonists/eldritch_cult/eldritch_antag.dm +++ b/code/modules/antagonists/eldritch_cult/eldritch_antag.dm @@ -92,42 +92,46 @@ /datum/antagonist/heretic/proc/forge_primary_objectives() var/list/assasination = list() var/list/protection = list() - var/choose_list = list("assasinate","hjiack","protect","glory") - for(var/i in 1 to 2) - var/pck = pick(choose_list) - switch(pck) - if("assasinate") - var/datum/objective/assassinate/A = new - A.owner = owner - var/list/owners = A.get_owners() - A.find_target(owners,protection) - assasination += A.target - objectives += A - if("hjiack") - var/datum/objective/hijack/hijack = new - hijack.owner = owner - objectives += hijack - choose_list -= "hijack" - choose_list -= "glory" - if("glory") - var/datum/objective/martyr/martyrdom = new - martyrdom.owner = owner - objectives += martyrdom - choose_list -= "hijack" - choose_list -= "glory" - if("protect") - var/datum/objective/protect/P = new - P.owner = owner - var/list/owners = P.get_owners() - P.find_target(owners,assasination) - protection += P.target - objectives += P + + var/choose_list_begin = list("assassinate","protect") + var/choose_list_end = list("assassinate","hijack","protect","glory") + + var/pck1 = pick(choose_list_begin) + var/pck2 = pick(choose_list_end) + + forge_objective(pck1,assasination,protection) + forge_objective(pck2,assasination,protection) var/datum/objective/sacrifice_ecult/SE = new SE.owner = owner SE.update_explanation_text() objectives += SE +/datum/antagonist/heretic/proc/forge_objective(string,assasination,protection) + switch(string) + if("assassinate") + var/datum/objective/assassinate/A = new + A.owner = owner + var/list/owners = A.get_owners() + A.find_target(owners,protection) + assasination += A.target + objectives += A + if("hijack") + var/datum/objective/hijack/hijack = new + hijack.owner = owner + objectives += hijack + if("glory") + var/datum/objective/martyr/martyrdom = new + martyrdom.owner = owner + objectives += martyrdom + if("protect") + var/datum/objective/protect/P = new + P.owner = owner + var/list/owners = P.get_owners() + P.find_target(owners,assasination) + protection += P.target + objectives += P + /datum/antagonist/heretic/apply_innate_effects(mob/living/mob_override) . = ..() var/mob/living/current = owner.current