diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index bdefee42c3e..985d1a41fef 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -125,6 +125,27 @@ GLOBAL_LIST_EMPTY(objectives) //SKYRAT EDIT ADDITION /datum/objective/proc/get_target() return target +/datum/objective/proc/is_valid_target(datum/mind/possible_target) + if(!ishuman(possible_target.current)) + return FALSE + + if(possible_target.current.stat == DEAD) + return FALSE + + var/target_area = get_area(possible_target.current) + if(!HAS_TRAIT(SSstation, STATION_TRAIT_LATE_ARRIVALS) && istype(target_area, /area/shuttle/arrival)) + return FALSE + + // SKYRAT EDIT ADDITION + if(SSticker.IsRoundInProgress() && istype(target_area, /area/centcom/interlink)) + return FALSE + if(!count_space_areas) + if(istype(target_area, /area/space) || istype(target_area, /area/ruin) || istype(target_area, /area/icemoon) || istype(target_area, /area/lavaland)) + return FALSE + // SKYRAT EDIT END + + return TRUE + //dupe_search_range is a list of antag datums / minds / teams /datum/objective/proc/find_target(dupe_search_range, list/blacklist) var/list/datum/mind/owners = get_owners() @@ -137,26 +158,14 @@ GLOBAL_LIST_EMPTY(objectives) //SKYRAT EDIT ADDITION if(O.late_joiner) try_target_late_joiners = TRUE for(var/datum/mind/possible_target in get_crewmember_minds()) - var/target_area = get_area(possible_target.current) if(possible_target in owners) continue - if(!ishuman(possible_target.current)) - continue - if(possible_target.current.stat == DEAD) - continue if(!is_unique_objective(possible_target,dupe_search_range)) continue - if(!HAS_TRAIT(SSstation, STATION_TRAIT_LATE_ARRIVALS) && istype(target_area, /area/shuttle/arrival)) - continue if(possible_target in blacklist) continue - // SKYRAT EDIT ADDITION - if(SSticker.IsRoundInProgress() && istype(target_area, /area/centcom/interlink)) + if(!is_valid_target(possible_target)) continue - if(!count_space_areas) - if(istype(target_area, /area/space) || istype(target_area, /area/ruin) || istype(target_area, /area/icemoon) || istype(target_area, /area/lavaland)) - continue - // SKYRAT EDIT END possible_targets += possible_target if(try_target_late_joiners) var/list/all_possible_targets = possible_targets.Copy() @@ -171,7 +180,6 @@ GLOBAL_LIST_EMPTY(objectives) //SKYRAT EDIT ADDITION update_explanation_text() return target - /datum/objective/proc/update_explanation_text() if(team_explanation_text && LAZYLEN(get_owners()) > 1) explanation_text = team_explanation_text @@ -217,7 +225,7 @@ GLOBAL_LIST_EMPTY(objectives) //SKYRAT EDIT ADDITION return TRUE /datum/objective/assassinate - name = "assasinate" + name = "assassinate" martyr_compatible = TRUE admin_grantable = TRUE var/target_role_type = FALSE @@ -516,6 +524,11 @@ GLOBAL_LIST_EMPTY(objectives) //SKYRAT EDIT ADDITION target = ..() update_explanation_text() +/datum/objective/escape/escape_with_identity/is_valid_target(datum/mind/possible_target) + if(HAS_TRAIT(possible_target.current, TRAIT_NO_DNA_COPY)) + return FALSE + return ..() + /datum/objective/escape/escape_with_identity/update_explanation_text() if(target?.current) target_real_name = target.current.real_name @@ -530,12 +543,12 @@ GLOBAL_LIST_EMPTY(objectives) //SKYRAT EDIT ADDITION explanation_text += "." //Proper punctuation is important! else - explanation_text = "Free objective." + explanation_text = "Escape on the shuttle or an escape pod alive and without being in custody." /datum/objective/escape/escape_with_identity/check_completion() - if(!target || !target_real_name) - return TRUE var/list/datum/mind/owners = get_owners() + if(!target || !target_real_name) + return ..() for(var/datum/mind/M in owners) if(!ishuman(M.current) || !considered_escaped(M)) continue diff --git a/code/modules/antagonists/changeling/changeling.dm b/code/modules/antagonists/changeling/changeling.dm index bd477c53794..2f6f6e99594 100644 --- a/code/modules/antagonists/changeling/changeling.dm +++ b/code/modules/antagonists/changeling/changeling.dm @@ -727,16 +727,21 @@ else var/datum/objective/maroon/maroon_objective = new maroon_objective.owner = owner - maroon_objective.find_target() - objectives += maroon_objective if (!(locate(/datum/objective/escape) in objectives) && escape_objective_possible) var/datum/objective/escape/escape_with_identity/identity_theft = new identity_theft.owner = owner - identity_theft.target = maroon_objective.target + identity_theft.find_target() identity_theft.update_explanation_text() - objectives += identity_theft escape_objective_possible = FALSE + maroon_objective.target = identity_theft.target || maroon_objective.find_target() + maroon_objective.update_explanation_text() + objectives += maroon_objective + objectives += identity_theft + else + maroon_objective.find_target() + objectives += maroon_objective + if (!(locate(/datum/objective/escape) in objectives) && escape_objective_possible) if(prob(50))