Merge pull request #2621 from yogstation13/upstream-merge-40220

[MIRROR] Objective refactor
This commit is contained in:
Ling
2018-09-26 18:54:06 +02:00
committed by GitHub
52 changed files with 404 additions and 374 deletions

View File

@@ -510,10 +510,12 @@
return parts.Join()
/proc/printobjectives(datum/mind/ply)
/proc/printobjectives(list/objectives)
if(!objectives || !objectives.len)
return
var/list/objective_parts = list()
var/count = 1
for(var/datum/objective/objective in ply.objectives)
for(var/datum/objective/objective in objectives)
if(objective.check_completion())
objective_parts += "<b>Objective #[count]</b>: [objective.explanation_text] <span class='greentext'>Success!</span>"
else

View File

@@ -41,8 +41,6 @@
var/special_role
var/list/restricted_roles = list()
var/list/datum/objective/objectives = list()
var/list/spell_list = list() // Wizard mode & "Give Spell" badmin button.
var/linglink
@@ -347,13 +345,15 @@
output += memory
var/list/all_objectives = list()
for(var/datum/antagonist/A in antag_datums)
output += A.antag_memory
all_objectives |= A.objectives
if(objectives.len)
if(all_objectives.len)
output += "<B>Objectives:</B>"
var/obj_count = 1
for(var/datum/objective/objective in objectives)
for(var/datum/objective/objective in all_objectives)
output += "<br><B>Objective #[obj_count++]</B>: [objective.explanation_text]"
var/list/datum/mind/other_owners = objective.get_owners() - src
if(other_owners.len)
@@ -364,7 +364,7 @@
if(window)
recipient << browse(output,"window=memory")
else if(objectives.len || memory)
else if(all_objectives.len || memory)
to_chat(recipient, "<i>[output]</i>")
/datum/mind/Topic(href, href_list)
@@ -395,34 +395,23 @@
memory = new_memo
else if (href_list["obj_edit"] || href_list["obj_add"])
var/datum/objective/objective
var/objective_pos
var/objective_pos //Edited objectives need to keep same order in antag objective list
var/def_value
var/datum/antagonist/target_antag
var/datum/objective/old_objective //The old objective we're replacing/editing
var/datum/objective/new_objective //New objective we're be adding
if (href_list["obj_edit"])
objective = locate(href_list["obj_edit"])
if (!objective)
return
if(href_list["obj_edit"])
for(var/datum/antagonist/A in antag_datums)
if(objective in A.objectives)
old_objective = locate(href_list["obj_edit"]) in A.objectives
if(old_objective)
target_antag = A
objective_pos = A.objectives.Find(objective)
objective_pos = A.objectives.Find(old_objective)
break
if(!target_antag) //Shouldn't happen anymore
stack_trace("objective without antagonist found")
objective_pos = objectives.Find(objective)
//Text strings are easy to manipulate. Revised for simplicity.
var/temp_obj_type = "[objective.type]"//Convert path into a text string.
def_value = copytext(temp_obj_type, 19)//Convert last part of path into an objective keyword.
if(!def_value)//If it's a custom objective, it will be an empty string.
def_value = "custom"
if(!old_objective)
to_chat(usr,"Invalid objective.")
return
else
//We're adding this objective
if(href_list["target_antag"])
var/datum/antagonist/X = locate(href_list["target_antag"]) in antag_datums
if(X)
@@ -434,7 +423,7 @@
if(1)
target_antag = antag_datums[1]
else
var/datum/antagonist/target = input("Which antagonist gets the objective:", "Antagonist", def_value) as null|anything in antag_datums + "(new custom antag)"
var/datum/antagonist/target = input("Which antagonist gets the objective:", "Antagonist", "(new custom antag)") as null|anything in antag_datums + "(new custom antag)"
if (QDELETED(target))
return
else if(target == "(new custom antag)")
@@ -442,149 +431,89 @@
else
target_antag = target
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", "martyr", "steal", "download", "nuclear", "capture", "absorb", "custom")
if (!new_obj_type)
var/static/list/choices
if(!choices)
choices = list()
var/list/allowed_types = list(
/datum/objective/assassinate,
/datum/objective/maroon,
/datum/objective/debrain,
/datum/objective/protect,
/datum/objective/destroy,
/datum/objective/hijack,
/datum/objective/escape,
/datum/objective/survive,
/datum/objective/martyr,
/datum/objective/steal,
/datum/objective/download,
/datum/objective/nuclear,
/datum/objective/capture,
/datum/objective/absorb,
/datum/objective/custom
)
for(var/T in allowed_types)
var/datum/objective/X = T
choices[initial(X.name)] = T
if(old_objective)
if(old_objective.name in choices)
def_value = old_objective.name
var/selected_type = input("Select objective type:", "Objective type", def_value) as null|anything in choices
selected_type = choices[selected_type]
if (!selected_type)
return
var/datum/objective/new_objective = null
switch (new_obj_type)
if ("assassinate","protect","debrain","maroon")
var/list/possible_targets = list("Free objective")
for(var/datum/mind/possible_target in SSticker.minds)
if ((possible_target != src) && ishuman(possible_target.current))
possible_targets += possible_target.current
var/mob/def_target = null
var/list/objective_list = typecacheof(list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain, /datum/objective/maroon))
if (is_type_in_typecache(objective, objective_list) && objective.target)
def_target = objective.target.current
var/mob/new_target = input("Select target:", "Objective target", def_target) as null|anything in possible_targets
if (!new_target)
return
var/objective_path = text2path("/datum/objective/[new_obj_type]")
if (new_target == "Free objective")
new_objective = new objective_path
new_objective.owner = src
new_objective.target = null
new_objective.explanation_text = "Free objective"
else
new_objective = new objective_path
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.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
to_chat(usr, "No active AIs with minds")
if ("prevent")
new_objective = new /datum/objective/block
new_objective.owner = src
if ("hijack")
new_objective = new /datum/objective/hijack
new_objective.owner = src
if ("escape")
new_objective = new /datum/objective/escape
new_objective.owner = src
if ("survive")
new_objective = new /datum/objective/survive
new_objective.owner = src
if("martyr")
new_objective = new /datum/objective/martyr
new_objective.owner = src
if ("nuclear")
new_objective = new /datum/objective/nuclear
new_objective.owner = src
if ("steal")
if (!istype(objective, /datum/objective/steal))
new_objective = new /datum/objective/steal
new_objective.owner = src
else
new_objective = objective
var/datum/objective/steal/steal = new_objective
if (!steal.select_target())
return
if("download","capture","absorb")
var/def_num
if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]"))
def_num = objective.target_amount
var/target_number = input("Input target number:", "Objective", def_num) as num | null
if (isnull(target_number))//Ordinarily, you wouldn't need isnull. In this case, the value may already exist.
return
switch(new_obj_type)
if("download")
new_objective = new /datum/objective/download
new_objective.explanation_text = "Download [target_number] research node\s."
if("capture")
new_objective = new /datum/objective/capture
new_objective.explanation_text = "Capture [target_number] lifeforms with an energy net. Live, rare specimens are worth more."
if("absorb")
new_objective = new /datum/objective/absorb
new_objective.explanation_text = "Absorb [target_number] compatible genomes."
new_objective.owner = src
new_objective.target_amount = target_number
if ("custom")
var/expl = stripped_input(usr, "Custom objective:", "Objective", objective ? objective.explanation_text : "")
if (!expl)
return
new_objective = new /datum/objective
new_objective.owner = src
new_objective.explanation_text = expl
if (!new_objective)
return
if (objective)
if(target_antag)
target_antag.objectives -= objective
objectives -= objective
target_antag.objectives.Insert(objective_pos, new_objective)
message_admins("[key_name_admin(usr)] edited [current]'s objective to [new_objective.explanation_text]")
log_admin("[key_name(usr)] edited [current]'s objective to [new_objective.explanation_text]")
else
if(target_antag)
target_antag.objectives += new_objective
objectives += new_objective
if(!old_objective)
//Add new one
new_objective = new selected_type
new_objective.owner = src
new_objective.admin_edit(usr)
target_antag.objectives += new_objective
message_admins("[key_name_admin(usr)] added a new objective for [current]: [new_objective.explanation_text]")
log_admin("[key_name(usr)] added a new objective for [current]: [new_objective.explanation_text]")
else
if(old_objective.type == selected_type)
//Edit the old
old_objective.admin_edit(usr)
new_objective = old_objective
else
//Replace the old
new_objective = new selected_type
new_objective.owner = src
new_objective.admin_edit(usr)
target_antag.objectives -= old_objective
target_antag.objectives.Insert(objective_pos, new_objective)
message_admins("[key_name_admin(usr)] edited [current]'s objective to [new_objective.explanation_text]")
log_admin("[key_name(usr)] edited [current]'s objective to [new_objective.explanation_text]")
else if (href_list["obj_delete"])
var/datum/objective/objective = locate(href_list["obj_delete"])
if(!istype(objective))
return
var/datum/objective/objective
for(var/datum/antagonist/A in antag_datums)
if(objective in A.objectives)
objective = locate(href_list["obj_delete"]) in A.objectives
if(istype(objective))
A.objectives -= objective
break
objectives -= objective
if(!objective)
to_chat(usr,"Invalid objective.")
return
//qdel(objective) Needs cleaning objective destroys
message_admins("[key_name_admin(usr)] removed an objective for [current]: [objective.explanation_text]")
log_admin("[key_name(usr)] removed an objective for [current]: [objective.explanation_text]")
else if(href_list["obj_completed"])
var/datum/objective/objective = locate(href_list["obj_completed"])
if(!istype(objective))
var/datum/objective/objective
for(var/datum/antagonist/A in antag_datums)
objective = locate(href_list["obj_completed"]) in A.objectives
if(istype(objective))
objective = objective
break
if(!objective)
to_chat(usr,"Invalid objective.")
return
objective.completed = !objective.completed
log_admin("[key_name(usr)] toggled the win state for [current]'s objective: [objective.explanation_text]")
@@ -646,10 +575,17 @@
usr = current
traitor_panel()
/datum/mind/proc/get_all_objectives()
var/list/all_objectives = list()
for(var/datum/antagonist/A in antag_datums)
all_objectives |= A.objectives
return all_objectives
/datum/mind/proc/announce_objectives()
var/obj_count = 1
to_chat(current, "<span class='notice'>Your current objectives:</span>")
for(var/objective in objectives)
for(var/objective in get_all_objectives())
var/datum/objective/O = objective
to_chat(current, "<B>Objective #[obj_count]</B>: [O.explanation_text]")
obj_count++

View File

@@ -34,11 +34,12 @@
//If you override this method, have it return the number of objectives added.
if(devil_target_list.len && devil_target_list[devil]) // Is a double agent
var/datum/mind/target_mind = devil_target_list[devil]
var/datum/antagonist/devil/D = target_mind.has_antag_datum(/datum/antagonist/devil)
var/datum/objective/devil/outsell/outsellobjective = new
outsellobjective.owner = devil
outsellobjective.target = target_mind
outsellobjective.update_explanation_text()
devil.objectives += outsellobjective
D.objectives += outsellobjective
return 1
return 0

View File

@@ -4,11 +4,12 @@
/datum/game_mode/proc/add_devil_objectives(datum/mind/devil_mind, quantity)
var/list/validtypes = list(/datum/objective/devil/soulquantity, /datum/objective/devil/soulquality, /datum/objective/devil/sintouch, /datum/objective/devil/buy_target)
var/datum/antagonist/devil/D = devil_mind.has_antag_datum(/datum/antagonist/devil)
for(var/i = 1 to quantity)
var/type = pick(validtypes)
var/datum/objective/devil/objective = new type(null)
objective.owner = devil_mind
devil_mind.objectives += objective
D.objectives += objective
if(!istype(objective, /datum/objective/devil/buy_target))
validtypes -= type //prevent duplicate objectives, EXCEPT for buy_target.
else

View File

@@ -1,6 +1,7 @@
/datum/objective
var/datum/mind/owner //The primary owner of the objective. !!SOMEWHAT DEPRECATED!! Prefer using 'team' for new code.
var/datum/team/team //An alternative to 'owner': a team. Use this when writing new code.
var/datum/team/team //An alternative to 'owner': a team. Use this when writing new code.
var/name = "generic objective" //Name for admin prompts
var/explanation_text = "Nothing" //What that person is supposed to do.
var/team_explanation_text //For when there are multiple owners.
var/datum/mind/target = null //If they are focused on a particular person.
@@ -17,6 +18,32 @@
if(owner)
. += owner
/datum/objective/proc/admin_edit(mob/admin)
return
//Shared by few objective types
/datum/objective/proc/admin_simple_target_pick(mob/admin)
var/list/possible_targets = list("Free objective")
var/def_value
for(var/datum/mind/possible_target in SSticker.minds)
if ((possible_target != src) && ishuman(possible_target.current))
possible_targets += possible_target.current
if(target && target.current)
def_value = target.current
var/mob/new_target = input(admin,"Select target:", "Objective target", def_value) as null|anything in possible_targets
if (!new_target)
return
if (new_target == "Free objective")
target = null
else
target = new_target.mind
update_explanation_text()
/datum/objective/proc/considered_escaped(datum/mind/M)
if(!considered_alive(M))
return FALSE
@@ -37,7 +64,7 @@
/datum/objective/proc/is_unique_objective(possible_target)
var/list/datum/mind/owners = get_owners()
for(var/datum/mind/M in owners)
for(var/datum/objective/O in M.objectives)
for(var/datum/objective/O in M.get_all_objectives()) //This scope is debatable, probably should be passed in by caller.
if(istype(O, type) && O.get_target() == possible_target)
return FALSE
return TRUE
@@ -115,6 +142,7 @@
H.equip_in_one_of_slots(O, slots)
/datum/objective/assassinate
name = "assasinate"
var/target_role_type=0
martyr_compatible = 1
@@ -134,6 +162,9 @@
else
explanation_text = "Free Objective"
/datum/objective/assassinate/admin_edit(mob/admin)
admin_simple_target_pick(admin)
/datum/objective/assassinate/internal
var/stolen = 0 //Have we already eliminated this target?
@@ -143,6 +174,7 @@
explanation_text = "Assassinate [target.name], who was obliterated"
/datum/objective/mutiny
name = "mutiny"
var/target_role_type=0
martyr_compatible = 1
@@ -166,6 +198,7 @@
explanation_text = "Free Objective"
/datum/objective/maroon
name = "maroon"
var/target_role_type=0
martyr_compatible = 1
@@ -184,7 +217,11 @@
else
explanation_text = "Free Objective"
/datum/objective/maroon/admin_edit(mob/admin)
admin_simple_target_pick(admin)
/datum/objective/debrain
name = "debrain"
var/target_role_type=0
/datum/objective/debrain/find_target_by_role(role, role_type=0, invert=0)
@@ -215,7 +252,11 @@
else
explanation_text = "Free Objective"
/datum/objective/debrain/admin_edit(mob/admin)
admin_simple_target_pick(admin)
/datum/objective/protect//The opposite of killing a dude.
name = "protect"
martyr_compatible = 1
var/target_role_type = 0
var/human_check = TRUE
@@ -236,10 +277,15 @@
else
explanation_text = "Free Objective"
/datum/objective/protect/admin_edit(mob/admin)
admin_simple_target_pick(admin)
/datum/objective/protect/nonhuman
name = "protect nonhuman"
human_check = FALSE
/datum/objective/hijack
name = "hijack"
explanation_text = "Hijack the shuttle to ensure no loyalist Nanotrasen crew escape alive and out of custody."
team_explanation_text = "Hijack the shuttle to ensure no loyalist Nanotrasen crew escape alive and out of custody. Leave no team member behind."
martyr_compatible = 0 //Technically you won't get both anyway.
@@ -254,6 +300,7 @@
return SSshuttle.emergency.is_hijacked()
/datum/objective/block
name = "no organics on shuttle"
explanation_text = "Do not allow any organic lifeforms to escape on the shuttle alive."
martyr_compatible = 1
@@ -267,6 +314,7 @@
return TRUE
/datum/objective/purge
name = "no mutants on shuttle"
explanation_text = "Ensure no mutant humanoid species are present aboard the escape shuttle."
martyr_compatible = 1
@@ -281,6 +329,7 @@
return TRUE
/datum/objective/robot_army
name = "robot army"
explanation_text = "Have at least eight active cyborgs synced to you."
martyr_compatible = 0
@@ -297,6 +346,7 @@
return counter >= 8
/datum/objective/escape
name = "escape"
explanation_text = "Escape on the shuttle or an escape pod alive and without being in custody."
team_explanation_text = "Have all members of your team escape on a shuttle or pod alive, without being in custody."
@@ -309,6 +359,7 @@
return TRUE
/datum/objective/escape/escape_with_identity
name = "escape with identity"
var/target_real_name // Has to be stored because the target's real_name can change over the course of the round
var/target_missing_id
@@ -344,7 +395,11 @@
return TRUE
return FALSE
/datum/objective/escape/escape_with_identity/admin_edit(mob/admin)
admin_simple_target_pick(admin)
/datum/objective/survive
name = "survive"
explanation_text = "Stay alive until the end."
/datum/objective/survive/check_completion()
@@ -355,6 +410,7 @@
return TRUE
/datum/objective/survive/exist //Like survive, but works for silicons and zombies and such.
name = "survive nonhuman"
/datum/objective/survive/exist/check_completion()
var/list/datum/mind/owners = get_owners()
@@ -364,6 +420,7 @@
return TRUE
/datum/objective/martyr
name = "martyr"
explanation_text = "Die a glorious death."
/datum/objective/martyr/check_completion()
@@ -374,6 +431,7 @@
return TRUE
/datum/objective/nuclear
name = "nuclear"
explanation_text = "Destroy the station with a nuclear device."
martyr_compatible = 1
@@ -384,6 +442,7 @@
GLOBAL_LIST_EMPTY(possible_items)
/datum/objective/steal
name = "steal"
var/datum/objective_item/targetinfo = null //Save the chosen item datum so we can access it later.
var/obj/item/steal_target = null //Needed for custom objectives (they're just items, not datums).
martyr_compatible = 0
@@ -421,18 +480,18 @@ GLOBAL_LIST_EMPTY(possible_items)
explanation_text = "Free objective"
return
/datum/objective/steal/proc/select_target() //For admins setting objectives manually.
/datum/objective/steal/admin_edit(mob/admin)
var/list/possible_items_all = GLOB.possible_items+"custom"
var/new_target = input("Select target:", "Objective target", steal_target) as null|anything in possible_items_all
var/new_target = input(admin,"Select target:", "Objective target", steal_target) as null|anything in possible_items_all
if (!new_target)
return
if (new_target == "custom") //Can set custom items.
var/obj/item/custom_target = input("Select type:","Type") as null|anything in typesof(/obj/item)
var/obj/item/custom_target = input(admin,"Select type:","Type") as null|anything in typesof(/obj/item)
if (!custom_target)
return
var/custom_name = initial(custom_target.name)
custom_name = stripped_input("Enter target name:", "Objective target", custom_name)
custom_name = stripped_input(admin,"Enter target name:", "Objective target", custom_name)
if (!custom_name)
return
steal_target = custom_target
@@ -440,7 +499,6 @@ GLOBAL_LIST_EMPTY(possible_items)
else
set_target(new_target)
return steal_target
/datum/objective/steal/check_completion()
var/list/datum/mind/owners = get_owners()
@@ -464,9 +522,9 @@ GLOBAL_LIST_EMPTY(possible_items)
return TRUE
return FALSE
GLOBAL_LIST_EMPTY(possible_items_special)
/datum/objective/steal/special //ninjas are so special they get their own subtype good for them
name = "steal special"
/datum/objective/steal/special/New()
..()
@@ -478,8 +536,12 @@ GLOBAL_LIST_EMPTY(possible_items_special)
return set_target(pick(GLOB.possible_items_special))
/datum/objective/steal/exchange
name = "exchange"
martyr_compatible = 0
/datum/objective/steal/exchange/admin_edit(mob/admin)
return
/datum/objective/steal/exchange/proc/set_faction(faction,otheragent)
target = otheragent
if(faction == "red")
@@ -499,6 +561,7 @@ GLOBAL_LIST_EMPTY(possible_items_special)
/datum/objective/steal/exchange/backstab
name = "prevent exchange"
/datum/objective/steal/exchange/backstab/set_faction(faction)
if(faction == "red")
@@ -510,12 +573,17 @@ GLOBAL_LIST_EMPTY(possible_items_special)
/datum/objective/download
name = "download"
/datum/objective/download/proc/gen_amount_goal()
target_amount = rand(20,40)
explanation_text = "Download [target_amount] research node\s."
update_explanation_text()
return target_amount
/datum/objective/download/update_explanation_text()
..()
explanation_text = "Download [target_amount] research node\s."
/datum/objective/download/check_completion()
var/datum/techweb/checking = new
var/list/datum/mind/owners = get_owners()
@@ -532,12 +600,23 @@ GLOBAL_LIST_EMPTY(possible_items_special)
TD.stored_research.copy_research_to(checking)
return checking.researched_nodes.len >= target_amount
/datum/objective/download/admin_edit(mob/admin)
var/count = input(admin,"How many nodes ?","Nodes",target_amount) as num|null
if(count)
target_amount = count
update_explanation_text()
/datum/objective/capture
name = "capture"
/datum/objective/capture/proc/gen_amount_goal()
target_amount = rand(5,10)
explanation_text = "Capture [target_amount] lifeform\s with an energy net. Live, rare specimens are worth more."
return target_amount
target_amount = rand(5,10)
update_explanation_text()
return target_amount
/datum/objective/capture/update_explanation_text()
. = ..()
explanation_text = "Capture [target_amount] lifeform\s with an energy net. Live, rare specimens are worth more."
/datum/objective/capture/check_completion()//Basically runs through all the mobs in the area to determine how much they are worth.
var/captured_amount = 0
@@ -567,10 +646,16 @@ GLOBAL_LIST_EMPTY(possible_items_special)
captured_amount+=2
return captured_amount >= target_amount
/datum/objective/capture/admin_edit(mob/admin)
var/count = input(admin,"How many mobs to capture ?","capture",target_amount) as num|null
if(count)
target_amount = count
update_explanation_text()
//Changeling Objectives
/datum/objective/absorb
name = "absorb"
/datum/objective/absorb/proc/gen_amount_goal(lowbound = 4, highbound = 6)
target_amount = rand (lowbound,highbound)
@@ -586,9 +671,19 @@ GLOBAL_LIST_EMPTY(possible_items_special)
n_p ++
target_amount = min(target_amount, n_p)
explanation_text = "Extract [target_amount] compatible genome\s."
update_explanation_text()
return target_amount
/datum/objective/absorb/update_explanation_text()
. = ..()
explanation_text = "Extract [target_amount] compatible genome\s."
/datum/objective/absorb/admin_edit(mob/admin)
var/count = input(admin,"How many people to absorb?","absorb",target_amount) as num|null
if(count)
target_amount = count
update_explanation_text()
/datum/objective/absorb/check_completion()
var/list/datum/mind/owners = get_owners()
var/absorbedcount = 0
@@ -602,6 +697,7 @@ GLOBAL_LIST_EMPTY(possible_items_special)
return absorbedcount >= target_amount
/datum/objective/absorb_most
name = "absorb most"
explanation_text = "Extract more compatible genomes than any other Changeling."
/datum/objective/absorb_most/check_completion()
@@ -622,6 +718,7 @@ GLOBAL_LIST_EMPTY(possible_items_special)
return TRUE
/datum/objective/absorb_changeling
name = "absorb changeling"
explanation_text = "Absorb another Changeling."
/datum/objective/absorb_changeling/check_completion()
@@ -644,6 +741,7 @@ GLOBAL_LIST_EMPTY(possible_items_special)
//End Changeling Objectives
/datum/objective/destroy
name = "destroy AI"
martyr_compatible = 1
/datum/objective/destroy/find_target()
@@ -665,10 +763,20 @@ GLOBAL_LIST_EMPTY(possible_items_special)
else
explanation_text = "Free Objective"
/datum/objective/destroy/admin_edit(mob/admin)
var/list/possible_targets = active_ais(1)
if(possible_targets.len)
var/mob/new_target = input(admin,"Select target:", "Objective target") as null|anything in possible_targets
target = new_target.mind
else
to_chat(admin, "No active AIs with minds")
update_explanation_text()
/datum/objective/destroy/internal
var/stolen = FALSE //Have we already eliminated this target?
/datum/objective/steal_five_of_type
name = "steal five of"
explanation_text = "Steal at least five items!"
var/list/wanted_items = list(/obj/item)
@@ -677,10 +785,12 @@ GLOBAL_LIST_EMPTY(possible_items_special)
wanted_items = typecacheof(wanted_items)
/datum/objective/steal_five_of_type/summon_guns
name = "steal guns"
explanation_text = "Steal at least five guns!"
wanted_items = list(/obj/item/gun)
/datum/objective/steal_five_of_type/summon_magic
name = "steal magic"
explanation_text = "Steal at least five magical artefacts!"
wanted_items = list(/obj/item/spellbook, /obj/item/gun/magic, /obj/item/clothing/suit/space/hardsuit/wizard, /obj/item/scrying, /obj/item/antag_spawner/contract, /obj/item/necromantic_stone)
@@ -696,6 +806,14 @@ GLOBAL_LIST_EMPTY(possible_items_special)
stolen_count++
return stolen_count >= 5
//Created by admin tools
/datum/objective/custom
name = "custom"
/datum/objective/custom/admin_edit(mob/admin)
var/expl = stripped_input(admin, "Custom objective:", "Objective", explanation_text)
if(expl)
explanation_text = expl
////////////////////////////////
// Changeling team objectives //

View File

@@ -96,7 +96,6 @@ GLOBAL_LIST_EMPTY(antagonists)
LAZYREMOVE(owner.antag_datums, src)
if(!silent && owner.current)
farewell()
owner.objectives -= objectives
var/datum/team/team = get_team()
if(team)
team.remove_member(owner)
@@ -132,14 +131,14 @@ GLOBAL_LIST_EMPTY(antagonists)
report += printplayer(owner)
var/objectives_complete = TRUE
if(owner.objectives.len)
report += printobjectives(owner)
for(var/datum/objective/objective in owner.objectives)
if(objectives.len)
report += printobjectives(objectives)
for(var/datum/objective/objective in objectives)
if(!objective.check_completion())
objectives_complete = FALSE
break
if(owner.objectives.len == 0 || objectives_complete)
if(objectives.len == 0 || objectives_complete)
report += "<span class='greentext big'>The [name] was successful!</span>"
else
report += "<span class='redtext big'>The [name] has failed!</span>"
@@ -216,25 +215,6 @@ GLOBAL_LIST_EMPTY(antagonists)
return
antag_memory = new_memo
//This datum will autofill the name with special_role
//Used as placeholder for minor antagonists, please create proper datums for these
/datum/antagonist/auto_custom
show_in_antagpanel = FALSE
antagpanel_category = "Other"
show_name_in_check_antagonists = TRUE
/datum/antagonist/auto_custom/on_gain()
..()
name = owner.special_role
//Add all objectives not already owned by other datums to this one.
var/list/already_registered_objectives = list()
for(var/datum/antagonist/A in owner.antag_datums)
if(A == src)
continue
else
already_registered_objectives |= A.objectives
objectives = owner.objectives - already_registered_objectives
//This one is created by admin tools for custom objectives
/datum/antagonist/custom
antagpanel_category = "Custom"

View File

@@ -42,12 +42,11 @@
/datum/antagonist/abductor/on_gain()
owner.special_role = "[name] [sub_role]"
owner.assigned_role = "[name] [sub_role]"
owner.objectives += team.objectives
objectives += team.objectives
finalize_abductor()
return ..()
/datum/antagonist/abductor/on_removal()
owner.objectives -= team.objectives
if(owner.current)
to_chat(owner.current,"<span class='userdanger'>You are no longer the [owner.special_role]!</span>")
owner.special_role = null
@@ -146,7 +145,7 @@
result += "<span class='header'>The abductors of [name] were:</span>"
for(var/datum/mind/abductor_mind in members)
result += printplayer(abductor_mind)
result += printobjectives(abductor_mind)
result += printobjectives(objectives)
return "<div class='panel redborder'>[result.Join("<br>")]</div>"
@@ -171,7 +170,6 @@
var/objtype = (prob(75) ? /datum/objective/abductee/random : pick(subtypesof(/datum/objective/abductee/) - /datum/objective/abductee/random))
var/datum/objective/abductee/O = new objtype()
objectives += O
owner.objectives += objectives
/datum/antagonist/abductee/apply_innate_effects(mob/living/mob_override)
update_abductor_icons_added(mob_override ? mob_override.mind : owner,"abductee")

View File

@@ -30,7 +30,6 @@
var/datum/objective/blob_takeover/main = new
main.owner = owner
objectives += main
owner.objectives |= objectives
/datum/antagonist/blob/apply_innate_effects(mob/living/mob_override)
if(!isovermind(owner.current))

View File

@@ -0,0 +1,32 @@
/datum/antagonist/blood_contract
name = "Blood Contract Target"
show_in_roundend = FALSE
show_in_antagpanel = FALSE
/datum/antagonist/blood_contract/on_gain()
. = ..()
give_objective()
start_the_hunt()
/datum/antagonist/blood_contract/proc/give_objective()
var/datum/objective/survive/survive = new
survive.owner = owner
objectives += survive
/datum/antagonist/blood_contract/greet()
. = ..()
to_chat(owner, "<span class='userdanger'>You've been marked for death! Don't let the demons get you! KILL THEM ALL!</span>")
/datum/antagonist/blood_contract/proc/start_the_hunt()
var/mob/living/carbon/human/H = owner.current
if(!istype(H))
return
H.add_atom_colour("#FF0000", ADMIN_COLOUR_PRIORITY)
var/obj/effect/mine/pickup/bloodbath/B = new(H)
INVOKE_ASYNC(B, /obj/effect/mine/pickup/bloodbath/.proc/mineEffect, H) //could use moving out from the mine
for(var/mob/living/carbon/human/P in GLOB.player_list)
if(P == H)
continue
to_chat(P, "<span class='userdanger'>You have an overwhelming desire to kill [H]. [H.p_theyve(TRUE)] been marked red! Whoever [H.p_they()] [H.p_were()], friend or foe, go kill [H.p_them()]!</span>")
P.put_in_hands(new /obj/item/kitchen/knife/butcher(P), TRUE)

View File

@@ -9,7 +9,6 @@
for(var/O in directives)
var/datum/objective/brainwashing/objective = new(O)
B.objectives += objective
M.objectives += objective
B.greet()
else
B = new()
@@ -32,10 +31,6 @@
antagpanel_category = "Other"
show_name_in_check_antagonists = TRUE
/datum/antagonist/brainwashed/on_gain()
owner.objectives |= objectives
. = ..()
/datum/antagonist/brainwashed/greet()
to_chat(owner, "<span class='warning'>Your mind reels as it begins focusing on a single purpose...</span>")
to_chat(owner, "<big><span class='warning'><b>Follow the Directives, at any cost!</b></span></big>")

View File

@@ -20,7 +20,6 @@
/datum/antagonist/brother/on_gain()
SSticker.mode.brothers += owner
objectives += team.objectives
owner.objectives += objectives
owner.special_role = special_role
finalize_brother()
return ..()

View File

@@ -446,8 +446,6 @@
objectives += identity_theft
escape_objective_possible = FALSE
owner.objectives |= objectives
/datum/antagonist/changeling/proc/update_changeling_icons_added()
var/datum/atom_hud/antag/hud = GLOB.huds[ANTAG_HUD_CHANGELING]
hud.join_hud(owner.current)

View File

@@ -35,7 +35,6 @@
/datum/antagonist/cult/proc/add_objectives()
objectives |= cult_team.objectives
owner.objectives |= objectives
/datum/antagonist/cult/Destroy()
QDEL_NULL(communion)

View File

@@ -549,7 +549,7 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master",
var/list/parts = list()
parts += printplayer(owner)
parts += printdevilinfo()
parts += printobjectives(owner)
parts += printobjectives(objectives)
return parts.Join("<br>")
//A simple super light weight datum for the codex gigas.

View File

@@ -57,3 +57,19 @@
visible_message("<span class='danger'>[src] screams in agony as it sublimates into a sulfurous smoke.</span>")
ghostize()
qdel(src)
/datum/antagonist/imp
name = "Imp"
antagpanel_category = "Devil"
show_in_roundend = FALSE
/datum/antagonist/imp/on_gain()
. = ..()
give_objectives()
/datum/antagonist/imp/proc/give_objectives()
var/datum/objective/newobjective = new
newobjective.explanation_text = "Try to get a promotion to a higher devilic rank."
newobjective.owner = owner
objectives += newobjective

View File

@@ -147,13 +147,9 @@
if(ascended || user.mind.soulOwner == src.mind)
var/mob/living/simple_animal/imp/S = new(get_turf(loc))
S.key = user.key
S.mind.assigned_role = "Imp"
S.mind.special_role = "Imp"
var/datum/objective/newobjective = new
newobjective.explanation_text = "Try to get a promotion to a higher devilic rank."
S.mind.objectives += newobjective
var/datum/antagonist/imp/A = new()
S.mind.add_antag_datum(A)
to_chat(S, S.playstyle_string)
to_chat(S, "<B>Objective #[1]</B>: [newobjective.explanation_text]")
else
return ..()

View File

@@ -10,12 +10,10 @@
var/datum/objective/O = new /datum/objective/disease_infect()
O.owner = owner
objectives += O
owner.objectives += O
O = new /datum/objective/disease_infect_centcom()
O.owner = owner
objectives += O
owner.objectives += O
. = ..()

View File

@@ -101,7 +101,6 @@
/datum/antagonist/ert/proc/forge_objectives()
if(ert_team)
objectives |= ert_team.objectives
owner.objectives |= objectives
/datum/antagonist/ert/proc/equipERT()
var/mob/living/carbon/human/H = owner.current

View File

@@ -8,7 +8,6 @@
O.completed = TRUE //YES!
O.owner = owner
objectives += O
owner.objectives += objectives
/datum/antagonist/greentext/on_gain()
forge_objectives()

View File

@@ -24,8 +24,6 @@
hijack_objective.owner = owner
objectives += hijack_objective
owner.objectives |= objectives
/datum/antagonist/highlander/on_gain()
forge_objectives()
owner.special_role = "highlander"

View File

@@ -0,0 +1,9 @@
/datum/antagonist/magic_servant
name = "Magic Servant"
show_in_roundend = FALSE
show_in_antagpanel = FALSE
/datum/antagonist/magic_servant/proc/setup_master(mob/M)
var/datum/objective/O = new("Serve [M.real_name].")
O.owner = owner
objectives |= O

View File

@@ -63,7 +63,6 @@
/datum/antagonist/monkey/proc/forge_objectives()
objectives |= monkey_team.objectives
owner.objectives |= objectives
/datum/antagonist/monkey/admin_remove(mob/admin)
var/mob/living/carbon/monkey/M = owner.current

View File

@@ -96,7 +96,6 @@
var/datum/objective/O = new /datum/objective/survive()
O.owner = owner
objectives += O
owner.objectives |= objectives
/proc/remove_ninja(mob/living/L)
if(!L || !L.mind)

View File

@@ -87,7 +87,7 @@
/datum/antagonist/nukeop/proc/forge_objectives()
if(nuke_team)
owner.objectives |= nuke_team.objectives
objectives |= nuke_team.objectives
/datum/antagonist/nukeop/proc/move_to_spawnpoint()
var/team_number = 1

View File

@@ -36,7 +36,6 @@
missionobj.completed = 1
mission = missionobj
objectives |= mission
owner.objectives |= objectives
/datum/antagonist/official/on_gain()

View File

@@ -26,7 +26,6 @@
// Sets objectives, equips all antags with the storage implant.
/datum/antagonist/overthrow/on_gain()
objectives += team.objectives
owner.objectives += objectives
..()
owner.announce_objectives()
equip_overthrow()
@@ -34,7 +33,6 @@
/datum/antagonist/overthrow/on_removal()
owner.special_role = null
owner.objectives -= objectives
..()
// Creates the overthrow team, or sets it. The objectives are static for all the team members.

View File

@@ -35,7 +35,9 @@
objectives += heads_obj
for(var/i in members)
var/datum/mind/M = i
M.objectives += heads_obj
var/datum/antagonist/overthrow/O = M.has_antag_datum(/datum/antagonist/overthrow)
if(O)
O.objectives += heads_obj
heads_obj.find_targets()
addtimer(CALLBACK(src,.proc/update_objectives),OBJECTIVE_UPDATING_TIME,TIMER_UNIQUE)

View File

@@ -31,12 +31,7 @@
/datum/antagonist/pirate/on_gain()
if(crew)
owner.objectives |= crew.objectives
. = ..()
/datum/antagonist/pirate/on_removal()
if(crew)
owner.objectives -= crew.objectives
objectives |= crew.objectives
. = ..()
/datum/team/pirate
@@ -53,7 +48,9 @@
getbooty.update_explanation_text()
objectives += getbooty
for(var/datum/mind/M in members)
M.objectives |= objectives
var/datum/antagonist/pirate/P = M.has_antag_datum(/datum/antagonist/pirate)
if(P)
P.objectives |= objectives
/datum/objective/loot

View File

@@ -14,8 +14,6 @@
objective2.owner = owner
objectives += objective2
owner.objectives |= objectives
/datum/antagonist/revenant/on_gain()
forge_objectives()
. = ..()

View File

@@ -66,10 +66,10 @@
return rev_team
/datum/antagonist/rev/proc/create_objectives()
owner.objectives |= rev_team.objectives
objectives |= rev_team.objectives
/datum/antagonist/rev/proc/remove_objectives()
owner.objectives -= rev_team.objectives
objectives -= rev_team.objectives
//Bump up to head_rev
/datum/antagonist/rev/proc/promote()
@@ -265,7 +265,8 @@
new_target.update_explanation_text()
objectives += new_target
for(var/datum/mind/M in members)
M.objectives |= objectives
var/datum/antagonist/rev/R = M.has_antag_datum(/datum/antagonist/rev)
R.objectives |= objectives
addtimer(CALLBACK(src,.proc/update_objectives),HEAD_UPDATE_PERIOD,TIMER_UNIQUE)

View File

@@ -0,0 +1,30 @@
/datum/antagonist/santa
name = "Santa"
show_in_antagpanel = FALSE
/datum/antagonist/santa/on_gain()
. = ..()
give_equipment()
give_objective()
/datum/antagonist/santa/greet()
. = ..()
to_chat(owner, "<span class='boldannounce'>You are Santa! Your objective is to bring joy to the people on this station. You can conjure more presents using a spell, and there are several presents in your bag.</span>")
/datum/antagonist/santa/proc/give_equipment()
var/mob/living/carbon/human/H = owner.current
if(istype(H))
H.equipOutfit(/datum/outfit/santa)
owner.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/conjure/presents)
var/obj/effect/proc_holder/spell/targeted/area_teleport/teleport/telespell = new
telespell.clothes_req = 0 //santa robes aren't actually magical.
owner.AddSpell(telespell) //does the station have chimneys? WHO KNOWS!
/datum/antagonist/santa/proc/give_objective()
var/datum/objective/santa_objective = new()
santa_objective.explanation_text = "Bring joy and presents to the station!"
santa_objective.completed = 1 //lets cut our santas some slack.
santa_objective.owner = owner
objectives |= santa_objective

View File

@@ -26,8 +26,6 @@
new_objective2.explanation_text = "[objective_verb] everyone[summoner ? " else while you're at it":""]."
objectives += new_objective2
owner.objectives |= objectives
/datum/antagonist/slaughter/laughter
name = "Laughter demon"
objective_verb = "Hug and Tickle"

View File

@@ -8,7 +8,6 @@
var/datum/objective/survive/survive = new
survive.owner = owner
objectives += survive
owner.objectives |= objectives
/datum/antagonist/survivalist/on_gain()
owner.special_role = "survivalist"

View File

@@ -78,15 +78,14 @@
scan_target = null
if(owner)
if(owner.mind)
if(owner.mind.objectives)
for(var/datum/objective/objective_ in owner.mind.objectives)
if(!is_internal_objective(objective_))
continue
var/datum/objective/assassinate/internal/objective = objective_
var/mob/current = objective.target.current
if(current&&current.stat!=DEAD)
scan_target = current
break
for(var/datum/objective/objective_ in owner.mind.get_all_objectives())
if(!is_internal_objective(objective_))
continue
var/datum/objective/assassinate/internal/objective = objective_
var/mob/current = objective.target.current
if(current&&current.stat!=DEAD)
scan_target = current
break
/datum/status_effect/agent_pinpointer/tick()
if(!owner)
@@ -100,9 +99,9 @@
return (istype(O, /datum/objective/assassinate/internal)||istype(O, /datum/objective/destroy/internal))
/datum/antagonist/traitor/proc/replace_escape_objective()
if(!owner||!owner.objectives)
if(!owner || !objectives.len)
return
for (var/objective_ in owner.objectives)
for (var/objective_ in objectives)
if(!(istype(objective_, /datum/objective/escape)||istype(objective_, /datum/objective/survive)))
continue
remove_objective(objective_)
@@ -112,9 +111,9 @@
add_objective(martyr_objective)
/datum/antagonist/traitor/proc/reinstate_escape_objective()
if(!owner||!owner.objectives)
if(!owner||!objectives.len)
return
for (var/objective_ in owner.objectives)
for (var/objective_ in objectives)
if(!istype(objective_, /datum/objective/martyr))
continue
remove_objective(objective_)
@@ -130,7 +129,7 @@
if(!owner.current||owner.current.stat==DEAD)
return
to_chat(owner.current, "<span class='userdanger'> Target eliminated: [victim.name]</span>")
for(var/objective_ in victim.objectives)
for(var/objective_ in victim.get_all_objectives())
if(istype(objective_, /datum/objective/assassinate/internal))
var/datum/objective/assassinate/internal/objective = objective_
if(objective.target==owner)
@@ -158,7 +157,7 @@
var/status_text = objective.check_completion() ? "neutralised" : "active"
to_chat(owner.current, "<span class='userdanger'> New target added to database: [objective.target.name] ([status_text]) </span>")
last_man_standing = TRUE
for(var/objective_ in owner.objectives)
for(var/objective_ in objectives)
if(!is_internal_objective(objective_))
continue
var/datum/objective/assassinate/internal/objective = objective_
@@ -174,7 +173,7 @@
/datum/antagonist/traitor/internal_affairs/proc/iaa_process()
if(owner&&owner.current&&owner.current.stat!=DEAD)
for(var/objective_ in owner.objectives)
for(var/objective_ in objectives)
if(!is_internal_objective(objective_))
continue
var/datum/objective/assassinate/internal/objective = objective_

View File

@@ -55,12 +55,10 @@
owner.special_role = null
..()
/datum/antagonist/traitor/proc/add_objective(var/datum/objective/O)
owner.objectives += O
/datum/antagonist/traitor/proc/add_objective(datum/objective/O)
objectives += O
/datum/antagonist/traitor/proc/remove_objective(var/datum/objective/O)
owner.objectives -= O
/datum/antagonist/traitor/proc/remove_objective(datum/objective/O)
objectives -= O
/datum/antagonist/traitor/proc/forge_traitor_objectives()
@@ -89,7 +87,7 @@
forge_single_objective()
if(is_hijacker && objective_count <= toa) //Don't assign hijack if it would exceed the number of objectives set in config.traitor_objectives_amount
if (!(locate(/datum/objective/hijack) in owner.objectives))
if (!(locate(/datum/objective/hijack) in objectives))
var/datum/objective/hijack/hijack_objective = new
hijack_objective.owner = owner
add_objective(hijack_objective)
@@ -97,7 +95,7 @@
var/martyr_compatibility = 1 //You can't succeed in stealing if you're dead.
for(var/datum/objective/O in owner.objectives)
for(var/datum/objective/O in objectives)
if(!O.martyr_compatible)
martyr_compatibility = 0
break
@@ -109,7 +107,7 @@
return
else
if(!(locate(/datum/objective/escape) in owner.objectives))
if(!(locate(/datum/objective/escape) in objectives))
var/datum/objective/escape/escape_objective = new
escape_objective.owner = owner
add_objective(escape_objective)
@@ -159,7 +157,7 @@
kill_objective.find_target()
add_objective(kill_objective)
else
if(prob(15) && !(locate(/datum/objective/download) in owner.objectives) && !(owner.assigned_role in list("Research Director", "Scientist", "Roboticist")))
if(prob(15) && !(locate(/datum/objective/download) in objectives) && !(owner.assigned_role in list("Research Director", "Scientist", "Roboticist")))
var/datum/objective/download/download_objective = new
download_objective.owner = owner
download_objective.gen_amount_goal()

View File

@@ -9,7 +9,6 @@
var/datum/objective/martyr/normiesgetout = new
normiesgetout.owner = owner
objectives += normiesgetout
owner.objectives += objectives
/datum/antagonist/heartbreaker/on_gain()
forge_objectives()

View File

@@ -12,7 +12,6 @@
protect_objective.human_check = FALSE
protect_objective.explanation_text = "Protect [date.name], your date."
objectives += protect_objective
owner.objectives += objectives
/datum/antagonist/valentine/on_gain()
forge_objectives()
@@ -33,8 +32,8 @@
//Squashed up a bit
/datum/antagonist/valentine/roundend_report()
var/objectives_complete = TRUE
if(owner.objectives.len)
for(var/datum/objective/objective in owner.objectives)
if(objectives.len)
for(var/datum/objective/objective in objectives)
if(!objective.check_completion())
objectives_complete = FALSE
break

View File

@@ -8,7 +8,6 @@
var/datum/objective/hijack/hijack = new
hijack.owner = owner
objectives += hijack
owner.objectives |= objectives
/datum/antagonist/wishgranter/on_gain()
owner.special_role = "Avatar of the Wish Granter"

View File

@@ -67,7 +67,7 @@
kill_objective.find_target()
objectives += kill_objective
if (!(locate(/datum/objective/escape) in owner.objectives))
if (!(locate(/datum/objective/escape) in objectives))
var/datum/objective/escape/escape_objective = new
escape_objective.owner = owner
objectives += escape_objective
@@ -78,7 +78,7 @@
steal_objective.find_target()
objectives += steal_objective
if (!(locate(/datum/objective/escape) in owner.objectives))
if (!(locate(/datum/objective/escape) in objectives))
var/datum/objective/escape/escape_objective = new
escape_objective.owner = owner
objectives += escape_objective
@@ -94,20 +94,17 @@
steal_objective.find_target()
objectives += steal_objective
if (!(locate(/datum/objective/survive) in owner.objectives))
if (!(locate(/datum/objective/survive) in objectives))
var/datum/objective/survive/survive_objective = new
survive_objective.owner = owner
objectives += survive_objective
else
if (!(locate(/datum/objective/hijack) in owner.objectives))
if (!(locate(/datum/objective/hijack) in objectives))
var/datum/objective/hijack/hijack_objective = new
hijack_objective.owner = owner
objectives += hijack_objective
for(var/datum/objective/O in objectives)
owner.objectives += O
/datum/antagonist/wizard/on_removal()
unregister()
owner.RemoveAllSpells() // TODO keep track which spells are wizard spells which innate stuff
@@ -220,7 +217,6 @@
new_objective.owner = owner
new_objective.target = master
new_objective.explanation_text = "Protect [master.current.real_name], the wizard."
owner.objectives += new_objective
objectives += new_objective
//Random event wizard
@@ -288,7 +284,6 @@
/datum/antagonist/wizard/academy/create_objectives()
var/datum/objective/new_objective = new("Protect Wizard Academy from the intruders")
new_objective.owner = owner
owner.objectives += new_objective
objectives += new_objective
//Solo wizard report

View File

@@ -17,6 +17,7 @@
var/faction = null
var/permanent = FALSE //If true, the spawner will not disappear upon running out of uses.
var/random = FALSE //Don't set a name or gender, just go random
var/antagonist_type
var/objectives = null
var/uses = 1 //how many times can we spawn from it. set to -1 for infinite.
var/brute_damage = 0
@@ -101,9 +102,16 @@
if(show_flavour)
to_chat(M, "[flavour_text]")
var/datum/mind/MM = M.mind
var/datum/antagonist/A
if(antagonist_type)
A = MM.add_antag_datum(antagonist_type)
if(objectives)
if(!A)
A = MM.add_antag_datum(/datum/antagonist/custom)
for(var/objective in objectives)
MM.objectives += new/datum/objective(objective)
var/datum/objective/O = new/datum/objective(objective)
O.owner = MM
A.objectives += O
if(assignedrole)
M.mind.assigned_role = assignedrole
special(M, name)

View File

@@ -266,8 +266,9 @@
var/mob/living/carbon/human/H = new(drop_location())
H.equipOutfit(/datum/outfit/butler)
var/datum/mind/servant_mind = new /datum/mind()
var/datum/objective/O = new("Serve [user.real_name].")
servant_mind.objectives += O
var/datum/antagonist/magic_servant/A = new
servant_mind.add_antag_datum(A)
A.setup_master(user)
servant_mind.transfer_to(H)
var/list/mob/dead/observer/candidates = pollCandidatesForMob("Do you want to play as [user.real_name] Servant?", ROLE_WIZARD, null, ROLE_WIZARD, 50, H)
@@ -297,7 +298,6 @@
//Free wizard!
user.mind.make_Wizard()
/datum/outfit/butler
name = "Butler"
uniform = /obj/item/clothing/under/suit_jacket/really_black

View File

@@ -79,17 +79,6 @@
santa = new /mob/living/carbon/human(pick(GLOB.blobstart))
santa.key = C.key
santa.equipOutfit(/datum/outfit/santa)
santa.update_icons()
var/datum/antagonist/santa/A = new
santa.mind.add_antag_datum(A)
var/datum/objective/santa_objective = new()
santa_objective.explanation_text = "Bring joy and presents to the station!"
santa_objective.completed = 1 //lets cut our santas some slack.
santa_objective.owner = santa.mind
santa.mind.objectives += santa_objective
santa.mind.AddSpell(new /obj/effect/proc_holder/spell/aoe_turf/conjure/presents)
var/obj/effect/proc_holder/spell/targeted/area_teleport/teleport/telespell = new(santa)
telespell.clothes_req = 0 //santa robes aren't actually magical.
santa.mind.AddSpell(telespell) //does the station have chimneys? WHO KNOWS!
to_chat(santa, "<span class='boldannounce'>You are Santa! Your objective is to bring joy to the people on this station. You can conjure more presents using a spell, and there are several presents in your bag.</span>")

View File

@@ -40,7 +40,8 @@
/obj/item/greentext/equipped(mob/living/user as mob)
to_chat(user, "<font color='green'>So long as you leave this place with greentext in hand you know will be happy...</font>")
if(user.mind && user.mind.objectives.len > 0)
var/list/other_objectives = user.mind.get_all_objectives()
if(user.mind && other_objectives.len > 0)
to_chat(user, "<span class='warning'>... so long as you still perform your other objectives that is!</span>")
new_holder = user
if(!last_holder)

View File

@@ -1013,21 +1013,10 @@
message_admins("<span class='adminnotice'>[ADMIN_LOOKUPFLW(L)] has been marked for death by [ADMIN_LOOKUPFLW(user)]!</span>")
var/datum/objective/survive/survive = new
survive.owner = L.mind
L.mind.objectives += survive
var/datum/antagonist/blood_contract/A = new
L.mind.add_antag_datum(A)
log_combat(user, L, "took out a blood contract on", src)
to_chat(L, "<span class='userdanger'>You've been marked for death! Don't let the demons get you! KILL THEM ALL!</span>")
L.add_atom_colour("#FF0000", ADMIN_COLOUR_PRIORITY)
var/obj/effect/mine/pickup/bloodbath/B = new(L)
INVOKE_ASYNC(B, /obj/effect/mine/pickup/bloodbath/.proc/mineEffect, L)
for(var/mob/living/carbon/human/H in GLOB.player_list)
if(H == L)
continue
to_chat(H, "<span class='userdanger'>You have an overwhelming desire to kill [L]. [L.p_theyve(TRUE)] been marked red! Whoever [L.p_they()] [L.p_were()], friend or foe, go kill [L.p_them()]!</span>")
H.put_in_hands(new /obj/item/kitchen/knife/butcher(H), TRUE)
qdel(src)
//Colossus

View File

@@ -820,7 +820,7 @@
replace_identification_name(oldname,newname)
for(var/datum/mind/T in SSticker.minds)
for(var/datum/objective/obj in T.objectives)
for(var/datum/objective/obj in T.get_all_objectives())
// Only update if this player is a target
if(obj.target && obj.target.current && obj.target.current.real_name == name)
obj.update_explanation_text()

View File

@@ -1146,6 +1146,7 @@
#include "code\modules\antagonists\blob\blob\blobs\node.dm"
#include "code\modules\antagonists\blob\blob\blobs\resource.dm"
#include "code\modules\antagonists\blob\blob\blobs\shield.dm"
#include "code\modules\antagonists\blood_contract\blood_contract.dm"
#include "code\modules\antagonists\brainwashing\brainwashing.dm"
#include "code\modules\antagonists\brother\brother.dm"
#include "code\modules\antagonists\changeling\cellular_emporium.dm"
@@ -1251,6 +1252,7 @@
#include "code\modules\antagonists\ert\ert.dm"
#include "code\modules\antagonists\greentext\greentext.dm"
#include "code\modules\antagonists\highlander\highlander.dm"
#include "code\modules\antagonists\magic_servant\servant.dm"
#include "code\modules\antagonists\monkey\monkey.dm"
#include "code\modules\antagonists\morph\morph.dm"
#include "code\modules\antagonists\morph\morph_antag.dm"
@@ -1273,6 +1275,7 @@
#include "code\modules\antagonists\revenant\revenant_blight.dm"
#include "code\modules\antagonists\revenant\revenant_spawn_event.dm"
#include "code\modules\antagonists\revolution\revolution.dm"
#include "code\modules\antagonists\santa\santa.dm"
#include "code\modules\antagonists\separatist\separatist.dm"
#include "code\modules\antagonists\slaughter\slaughter.dm"
#include "code\modules\antagonists\slaughter\slaughter_antag.dm"

View File

@@ -1151,6 +1151,7 @@
#include "code\modules\antagonists\blob\blob\blobs\node.dm"
#include "code\modules\antagonists\blob\blob\blobs\resource.dm"
#include "code\modules\antagonists\blob\blob\blobs\shield.dm"
#include "code\modules\antagonists\blood_contract\blood_contract.dm"
#include "code\modules\antagonists\brainwashing\brainwashing.dm"
#include "code\modules\antagonists\brother\brother.dm"
#include "code\modules\antagonists\changeling\cellular_emporium.dm"
@@ -1256,6 +1257,7 @@
#include "code\modules\antagonists\ert\ert.dm"
#include "code\modules\antagonists\greentext\greentext.dm"
#include "code\modules\antagonists\highlander\highlander.dm"
#include "code\modules\antagonists\magic_servant\servant.dm"
#include "code\modules\antagonists\monkey\monkey.dm"
#include "code\modules\antagonists\morph\morph.dm"
#include "code\modules\antagonists\morph\morph_antag.dm"
@@ -1278,6 +1280,7 @@
#include "code\modules\antagonists\revenant\revenant_blight.dm"
#include "code\modules\antagonists\revenant\revenant_spawn_event.dm"
#include "code\modules\antagonists\revolution\revolution.dm"
#include "code\modules\antagonists\santa\santa.dm"
#include "code\modules\antagonists\separatist\separatist.dm"
#include "code\modules\antagonists\slaughter\slaughter_antag.dm"
#include "code\modules\antagonists\slaughter\slaughterevent.dm"

View File

@@ -81,7 +81,7 @@
H.hud_used.vamp_blood_display.invisibility = INVISIBILITY_ABSTRACT
SSticker.mode.update_vampire_icons_removed(owner)
for(var/O in objectives_given)
owner.objectives -= O
objectives -= O
LAZYCLEARLIST(objectives_given)
if(owner.current)
to_chat(owner.current,"<span class='userdanger'>Your powers have been quenched! You are no longer a vampire</span>")
@@ -112,14 +112,14 @@
for(var/i = 1, i < CONFIG_GET(number/traitor_objectives_amount), i++)
forge_single_objective()
if(!(locate(/datum/objective/escape) in owner.objectives))
if(!(locate(/datum/objective/escape) in objectives))
var/datum/objective/escape/escape_objective = new
escape_objective.owner = owner
add_objective(escape_objective)
return
/datum/antagonist/vampire/proc/add_objective(var/datum/objective/O)
owner.objectives += O
objectives += O
objectives_given += O
/datum/antagonist/vampire/proc/forge_single_objective() //Returns how many objectives are added

View File

@@ -3,7 +3,7 @@
if(U.include_objectives.len)
for(var/O in U.include_objectives)
if(locate(O) in user.mind.objectives)
if(locate(O) in user.mind.get_all_objectives())
canBuy = TRUE
break
else
@@ -11,7 +11,7 @@
if(canBuy && U.exclude_objectives.len)
for(var/O in U.exclude_objectives)
if(locate(O) in user.mind.objectives)
if(locate(O) in user.mind.get_all_objectives())
canBuy = FALSE
break

View File

@@ -1,7 +1,7 @@
/datum/antagonist/traitor/internal_affairs/iaa_process()
if(owner && owner.current && !iscyborg(owner.current) && owner.current.stat!=DEAD)
var/new_objective = TRUE
for(var/objective_ in owner.objectives)
for(var/objective_ in objectives)
if(istype(objective_, /datum/objective/hijack) || istype(objective_, /datum/objective/martyr) || istype(objective_, /datum/objective/block))
new_objective = FALSE
break
@@ -14,7 +14,7 @@
if(new_objective)
var/list/other_traitors = SSticker.mode.traitors - owner
for(var/objective_ in owner.objectives)
for(var/objective_ in objectives)
if(!is_internal_objective(objective_))
continue
var/datum/objective/assassinate/internal/objective = objective_
@@ -40,7 +40,7 @@
kill_objective.update_explanation_text()
add_objective(kill_objective)
else
for(var/objective_ in owner.objectives)
for(var/objective_ in objectives)
remove_objective(objective_)
if(issilicon(owner))

View File

@@ -70,51 +70,6 @@
..()
return TRUE
/datum/game_mode/proc/auto_declare_completion_vampire()
if(vampires.len)
var/text = "<br><font size=3><b>The vampires were:</b></font>"
for(var/datum/mind/vamp in vampires)
var/vampwin = 1
if(!vamp.current)
vampwin = 0
var/datum/antagonist/vampire/V = vamp.has_antag_datum(/datum/antagonist/vampire)
if(!V)
continue
text += printplayer(vamp)
//Removed sanity if(vampire) because we -want- a runtime to inform us that the vampire list is incorrect and needs to be fixed.
text += "<br><b>Usable Blood:</b> [V.usable_blood]."
text += "<br><b>Total Blood:</b> [V.total_blood]"
if(vamp.objectives.len)
var/count = 1
for(var/datum/objective/objective in vamp.objectives)
if(objective.check_completion())
text += "<br><b>Objective #[count]</b>: [objective.explanation_text] <font color='green'><b>Success!</b></font>"
SSblackbox.record_feedback("tally", "vampire_objective", 1, "[objective.type]|SUCCESS")
else
text += "<br><b>Objective #[count]</b>: [objective.explanation_text] <span class='danger'>Fail.</span>"
SSblackbox.record_feedback("tally", "vampire_objective", 1, "[objective.type]|FAIL")
vampwin = 0
count++
if(vampwin)
text += "<br><font color='green'><b>The vampire was successful!</b></font>"
SSblackbox.record_feedback("tally", "vampire_success", 1, "SUCCESS")
else
text += "<br><span class='boldannounce'>The vampire has failed.</span>"
SSblackbox.record_feedback("tally", "vampire_success", 1, "FAIL")
text += "<br>"
to_chat(world, text)
return 1
/proc/add_vampire(mob/living/L)
if(!L || !L.mind || is_vampire(L))
return FALSE

View File

@@ -21,13 +21,13 @@
S.dna.remove_mutation(CLOWNMUT)
var/datum/objective/ascend/O = new
O.update_explanation_text()
owner.objectives += O
objectives += O
objectives_given += O
owner.announce_objectives()
/datum/antagonist/shadowling/on_removal()
for(var/O in objectives_given)
owner.objectives -= O
objectives -= O
SSticker.mode.update_shadow_icons_removed(owner)
SSticker.mode.shadows -= owner
message_admins("[key_name_admin(owner.current)] was de-shadowlinged!")