From 09546b7fe0cfc429745306065cba060bba18e876 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Sat, 24 Mar 2012 21:50:17 -0700 Subject: [PATCH 1/2] First commit towards the new objective system. --- baystation12.dme | 2 +- code/datums/configuration.dm | 4 + code/datums/mind.dm | 17 +- code/defines/client.dm | 1 + code/defines/mob/mob.dm | 2 +- code/game/events/EventProcs/space_ninja.dm | 2 +- .../game/gamemodes/autotraitor/autotraitor.dm | 4 +- code/game/gamemodes/changeling/changeling.dm | 6 +- code/game/gamemodes/newobjective.dm | 1113 +++++++++++++++++ .../gamemodes/revolution/rp-revolution.dm | 2 +- code/game/gamemodes/traitor/traitor.dm | 98 +- code/game/gamemodes/wizard/wizard.dm | 45 +- code/game/jobs/jobs.dm | 15 + code/modules/admin/verbs/onlyone.dm | 3 +- code/modules/mob/living/living.dm | 20 + code/modules/mob/new_player/new_player.dm | 3 +- code/modules/mob/new_player/preferences.dm | 2 +- 17 files changed, 1174 insertions(+), 165 deletions(-) create mode 100644 code/game/gamemodes/newobjective.dm diff --git a/baystation12.dme b/baystation12.dme index 0d083ef85af..0724e2048b3 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -423,7 +423,7 @@ #include "code\game\gamemodes\game_mode.dm" #include "code\game\gamemodes\gameticker.dm" #include "code\game\gamemodes\intercept_report.dm" -#include "code\game\gamemodes\objective.dm" +#include "code\game\gamemodes\newobjective.dm" #include "code\game\gamemodes\setupgame.dm" #include "code\game\gamemodes\autotraitor\autotraitor.dm" #include "code\game\gamemodes\blob\blob.dm" diff --git a/code/datums/configuration.dm b/code/datums/configuration.dm index da8fb277c19..9e05d3f8541 100644 --- a/code/datums/configuration.dm +++ b/code/datums/configuration.dm @@ -57,6 +57,7 @@ var/revival_pod_plants = 1 var/revival_cloning = 1 var/revival_brain_life = -1 + var/require_heads_alive = 0 //For Rev. /datum/configuration/New() var/list/L = typesof(/datum/game_mode) - /datum/game_mode @@ -242,6 +243,9 @@ if("alert_delta") config.alert_desc_delta = value + if("require_heads_alive") + config.require_heads_alive = value + else diary << "Unknown setting in configuration: '[name]'" diff --git a/code/datums/mind.dm b/code/datums/mind.dm index afd7e566b97..f911be27433 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -330,7 +330,7 @@ datum/mind possible_targets += possible_target.current var/mob/def_target = null - var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain, /datum/objective/decapitate) + var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protection, /datum/objective/debrain, /datum/objective/decapitate) if (objective&&(objective.type in objective_list) && objective:target) def_target = objective:target.current @@ -367,19 +367,14 @@ datum/mind 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 + var/steal_type = pick(GetObjectives(assigned_role,src)) + new_objective = new steal_type + new_objective.owner = src if("download","capture","absorb") var/def_num if(objective&&objective.type==text2path("/datum/objective/[new_obj_type]")) - def_num = objective.target_amount + 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. @@ -396,7 +391,7 @@ datum/mind 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 + new_objective:target_amount = target_number if ("custom") var/expl = input("Custom objective:", "Objective", objective ? objective.explanation_text : "") as text|null diff --git a/code/defines/client.dm b/code/defines/client.dm index 177ae1dcdd5..d803c6a9e4a 100644 --- a/code/defines/client.dm +++ b/code/defines/client.dm @@ -27,6 +27,7 @@ var/played = 0 var/team = null var/warned = 0 + var/be_syndicate = 0 //Moving this into client vars, since I was silly when I made it. var/STFU_ghosts //80+ people rounds are fun to admin when text flies faster than airport security var/STFU_radio //80+ people rounds are fun to admin when text flies faster than airport security diff --git a/code/defines/mob/mob.dm b/code/defines/mob/mob.dm index 7bd41c64022..87112bf32d5 100644 --- a/code/defines/mob/mob.dm +++ b/code/defines/mob/mob.dm @@ -168,7 +168,7 @@ var/logged_in = 0 var/underwear = 1//Human - var/be_syndicate = 0 //This really should be a client variable. EDIT: Hijacked for my own nefarious purposes! --SkyMarshal +// var/be_syndicate = 0 //This really should be a client variable. EDIT: Hijacked for my own nefarious purposes! --SkyMarshal var/be_random_name = 0 var/const/blindness = 1//Carbon var/const/deafness = 2//Carbon diff --git a/code/game/events/EventProcs/space_ninja.dm b/code/game/events/EventProcs/space_ninja.dm index 2a25c7cfef2..f2a562a6988 100644 --- a/code/game/events/EventProcs/space_ninja.dm +++ b/code/game/events/EventProcs/space_ninja.dm @@ -252,7 +252,7 @@ In either case, it's a good idea to spawn the ninja with a semi-random set of ob current_mind = pick(friendly_targets) if(current_mind) - var/datum/objective/protect/ninja_objective = new + var/datum/objective/protection/ninja_objective = new ninja_objective.owner = ninja_mind ninja_objective.find_target_by_role((current_mind.special_role ? current_mind.special_role : current_mind.assigned_role),(current_mind.special_role?1:0)) ninja_mind.objectives += ninja_objective diff --git a/code/game/gamemodes/autotraitor/autotraitor.dm b/code/game/gamemodes/autotraitor/autotraitor.dm index 2459e87bc70..930fe363f8c 100644 --- a/code/game/gamemodes/autotraitor/autotraitor.dm +++ b/code/game/gamemodes/autotraitor/autotraitor.dm @@ -82,7 +82,7 @@ playercount += 1 if (player.client && player.mind && player.mind.special_role && player.stat != 2) traitorcount += 1 - if (player.client && player.mind && !player.mind.special_role && player.stat != 2 && (player.be_syndicate & BE_TRAITOR) && !jobban_isbanned(player, "Syndicate")) + if (player.client && player.mind && !player.mind.special_role && player.stat != 2 && (player.client && player.client.be_syndicate & BE_TRAITOR) && !jobban_isbanned(player, "Syndicate")) possible_traitors += player for(var/datum/mind/player in possible_traitors) for(var/job in restricted_jobs) @@ -170,7 +170,7 @@ if(emergency_shuttle.departed) return //message_admins("Late Join Check") - if((character.be_syndicate & BE_TRAITOR) && !jobban_isbanned(character, "Syndicate")) + if((character.client && character.client.be_syndicate & BE_TRAITOR) && !jobban_isbanned(character, "Syndicate")) //message_admins("Late Joiner has Be Syndicate") //message_admins("Checking number of players") var/playercount = 0 diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 2dd40e2299c..82a0e7c58c3 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -101,9 +101,8 @@ if(46 to 90) - var/datum/objective/steal/steal_objective = new + var/datum/objective/steal/steal_objective = new pick(GetObjectives(changeling.assigned_role,changeling)) steal_objective.owner = changeling - steal_objective.find_target() changeling.objectives += steal_objective if (!(locate(/datum/objective/escape) in changeling.objectives)) @@ -118,9 +117,8 @@ kill_objective.find_target() changeling.objectives += kill_objective - var/datum/objective/steal/steal_objective = new + var/datum/objective/steal/steal_objective = new pick(GetObjectives(changeling.assigned_role,changeling)) steal_objective.owner = changeling - steal_objective.find_target() changeling.objectives += steal_objective if (!(locate(/datum/objective/survive) in changeling.objectives)) diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm new file mode 100644 index 00000000000..014ad6a109c --- /dev/null +++ b/code/game/gamemodes/newobjective.dm @@ -0,0 +1,1113 @@ +/proc/GenerateTheft(var/job,var/datum/mind/traitor) + var/list/datum/objective/objectives = list() + + for(var/o in typesof(/datum/objective/steal)) + if(o != /datum/objective/steal) //Make sure not to get a blank steal objective. + objectives += new o(null,job) + + //objectives += GenerateAssassinate(job,traitor) + return objectives + +/proc/GenerateAssassinate(var/job,var/datum/mind/traitor) + var/list/datum/objective/assassinate/missions = list() + + for(var/datum/mind/target in ticker.minds) + if((target != traitor) && istype(target.current, /mob/living/carbon/human)) + if(target && target.current) + missions += new /datum/objective/assassinate(null,job,target) + return missions + +/proc/GenerateFrame(var/job,var/datum/mind/traitor) + var/list/datum/objective/frame/missions = list() + + for(var/datum/mind/target in ticker.minds) + if((target != traitor) && istype(target.current, /mob/living/carbon/human)) + if(target && target.current) + missions += new /datum/objective/frame(null,job,target) + return missions + +/proc/GenerateProtection(var/job,var/datum/mind/traitor) + var/list/datum/objective/frame/missions = list() + + for(var/datum/mind/target in ticker.minds) + if((target != traitor) && istype(target.current, /mob/living/carbon/human)) + if(target && target.current) + missions += new /datum/objective/protection(null,job,target) + return missions + + + +/proc/SelectObjectives(var/job,var/datum/mind/traitor,var/hijack = 0) + var/list/datum/objective/chosenobjectives = list() + var/list/datum/objective/theftobjectives = GetObjectives(job,traitor) //Separated all the objective types so they can be picked independantly of each other. + var/list/datum/objective/killobjectives = GenerateAssassinate(job,traitor) + var/list/datum/objective/frameobjectives = GenerateFrame(job,traitor) + var/list/datum/objective/protectobjectives = GenerateProtection(job,traitor) + //var/points + var/totalweight + var/selectobj + var/conflict + + while(totalweight < 100) + selectobj = rand(1,100) //Randomly determine the type of objective to be given. + if(!length(killobjectives) || !length(protectobjectives)) //If any of these lists are empty, just give them theft objectives. + var/datum/objective/objective = pick(theftobjectives) + chosenobjectives += objective + totalweight += objective.weight + theftobjectives -= objective + else switch(selectobj) + if(1 to 50) //Theft Objectives (50% chance) + var/datum/objective/objective = pick(theftobjectives) + chosenobjectives += objective + totalweight += objective.weight + theftobjectives -= objective + if(51 to 87) //Assassination Objectives (37% chance) + var/datum/objective/assassinate/objective = pick(killobjectives) + for(var/datum/objective/protection/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Assassinate somebody they need to Protect. + if(conflicttest.target == objective.target) + conflict = 1 + if(!conflict) + chosenobjectives += objective + totalweight += objective.weight + killobjectives -= objective + conflict = 0 + if(88 to 90) //Framing Objectives (3% chance) + var/datum/objective/objective = pick(frameobjectives) + chosenobjectives += objective + totalweight += objective.weight + frameobjectives -= objective + if(91 to 100) //Protection Objectives (5% chance) + var/datum/objective/protection/objective = pick(protectobjectives) + for(var/datum/objective/assassinate/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Protect somebody they need to Assassinate. + if(conflicttest.target == objective.target) + conflict = 1 + if(!conflict) + chosenobjectives += objective + totalweight += objective.weight + protectobjectives -= objective + conflict = 0 + + var/hasendgame = 0 + for(var/datum/objective/o in chosenobjectives) + if(o.type == /datum/objective/hijack || o.type == /datum/objective/escape) + hasendgame = 1 + break + for(var/datum/objective/o in chosenobjectives) + if(o.explanation_text == "Free Objective") + del(o) //Cleaning up any sillies. + if(hasendgame == 0) + if(hijack) + chosenobjectives += new /datum/objective/hijack(null,job) + else + chosenobjectives += new /datum/objective/escape(null,job) + return chosenobjectives + +datum + objective + var/datum/mind/owner + var/explanation_text = "text not set" + var/job +// var/points = INFINITY //If this isn't set to something else, the objective is bugged and should be ignored + var/weight = INFINITY + + New(var/text,var/joba) + if(text) + src.explanation_text = text + job=joba + weight = get_points(job) + + proc + check_completion() + return 1 + get_points(var/job) + return INFINITY + + + frame + var/datum/mind/target + + New(var/text,var/joba,var/datum/mind/targeta) + target = targeta + job = joba + weight = get_points(job) + explanation_text = "Frame [target.current.real_name], the [target.assigned_role] for a crime and make sure they are arrested and brought back to the Centcom station alive. We'll handle the rest from there." + + check_completion() + if(emergency_shuttle.location<2) + return 0 + if(target.current.stat == 2) + return 0 + var/turf/location = get_turf(target.current.loc) + if(!location) + return 0 + if(!target.current:handcuffed && !istype(location, /turf/simulated/shuttle/floor4)) + return 0 + + if(location in locate(/area/shuttle/escape/centcom)) + return 1 + + return 0 + + get_points() + if(target) + switch(GetRank(owner.assigned_role)) + if(4) + return 30 + if(3) + return 40 + if(2) + return 50 + if(1) + return 55 + if(0) + return 60 + else + return INFINITY + + + protection + var/datum/mind/target + New(var/text,var/joba,var/datum/mind/targeta) + target = targeta + job = joba + weight = get_points(job) + explanation_text = "[target.current.real_name], the [target.assigned_role] is a relative of a high ranking Syndicate Leader. Make sure they get off the ship safely, while minimizing intervention." + + check_completion() + if(emergency_shuttle.location<2) + return 0 + + if(target.current.stat == 2) + return 0 + + var/turf/location = get_turf(target.current.loc) + if(!location) + return 0 + + if(location in locate(/area/shuttle/escape/centcom)) + return 1 + + return 0 + + get_points() + return 30 + + + assassinate + var/datum/mind/target + + New(var/text,var/joba,var/datum/mind/targeta) + target = targeta + job = joba + weight = get_points(job) + explanation_text = "Assassinate [target.current.real_name], the [target.assigned_role]." + + check_completion() + if(target && target.current) + if(target.current.stat == 2) + return 1 + else + return 0 + else + return 1 + get_points() + if(target) + switch(GetRank(owner.assigned_role)) + if(4) + return 30 + if(3) + return 40 + if(2) + return 50 + if(1) + return 55 + if(0) + return 60 + else + return 0 + + proc/find_target_by_role(var/role) + for(var/datum/mind/possible_target in ticker.minds) + if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human) && (possible_target.assigned_role == role)) + target = possible_target + break + + if(target && target.current) + explanation_text = "Assassinate [target.current.real_name], the [target.assigned_role]." + else + explanation_text = "Free Objective" + + return target + + + proc/find_target() + var/list/possible_targets = list() + + for(var/datum/mind/possible_target in ticker.minds) + if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human)) + possible_targets += possible_target + + if(possible_targets.len > 0) + target = pick(possible_targets) + + if(target && target.current) + explanation_text = "Assassinate [target.current.real_name], the [target.assigned_role]." + else + explanation_text = "Free Objective" + + return target + + + capture + var/datum/mind/target + var/separation_time = 0 + var/almost_complete = 0 + + New(var/text,var/joba,var/datum/mind/targeta) + target = targeta + job = joba + explanation_text = "Capture [target.current.real_name], the [target.assigned_role]." + + check_completion() + if(target && target.current) + if(target.current.stat == 2) + if(config.require_heads_alive) return 0 + else + if(!target.current.handcuffed) + return 0 + else if(config.require_heads_alive) return 0 + return 1 + + proc/find_target_by_role(var/role) + for(var/datum/mind/possible_target in ticker.minds) + if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human) && (possible_target.assigned_role == role)) + target = possible_target + break + + if(target && target.current) + explanation_text = "Capture [target.current.real_name], the [target.assigned_role]." + else + explanation_text = "Free Objective" + + return target + + get_points() + if(target) + switch(GetRank(owner.assigned_role)) + if(4) + return 30 + if(3) + return 40 + if(2) + return 50 + if(1) + return 55 + if(0) + return 60 + else + return 0 + + + hijack + explanation_text = "Hijack the emergency shuttle by escaping alone." + + check_completion() + if(emergency_shuttle.location<2) + return 0 + + if(!owner.current || owner.current.stat == 2) + return 0 + var/turf/location = get_turf(owner.current.loc) + + if(location in locate(/area/shuttle/escape/centcom)) + for(var/mob/living/player in locate(/area/shuttle/escape/centcom)) + if (player.mind && (player.mind != owner)) + if (player.stat != 2) //they're not dead + return 0 + return 1 + + return 0 + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 65 + if(2) + return 65 + if(3) + return 50 + if(4) + return 35 + + + escape + explanation_text = "Escape on the shuttle alive, without being arrested." + + check_completion() + if(emergency_shuttle.location<2) + return 0 + + if(!owner.current || owner.current.stat ==2) + return 0 + + var/turf/location = get_turf(owner.current.loc) + if(!location) + return 0 + + if(owner.current:handcuffed || istype(location, /turf/simulated/shuttle/floor4)) + return 0 + + if(location in locate(/area/shuttle/escape/centcom)) + return 1 + + return 0 + get_points() + return INFINITY + + + survive + explanation_text = "Stay alive until the end." + + check_completion() + if(!owner.current || owner.current.stat == 2) + return 0 + + return 1 + get_points() + return INFINITY + + + steal + var/obj/item/steal_target + + check_completion() + if(steal_target) + if(owner.current.check_contents_for(steal_target)) + return 1 + else + return 0 + + + captainslaser + steal_target = /obj/item/weapon/gun/energy/laser/captain + explanation_text = "Steal the captain's antique laser gun." + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 60 + if(1) + return 50 + if(2) + return 40 + if(3) + return 30 + if(4) + return 20 + + + plasmatank + steal_target = /obj/item/weapon/tank/plasma + explanation_text = "Steal a small plasma tank." + weight = 20 + + get_points(var/job) + if(job in science_positions) + return 10 + return 20 + + + /*Removing this as an objective. Not necessary to have two theft objectives in the same room. + steal/captainssuit + steal_target = /obj/item/clothing/under/rank/captain + explanation_text = "Steal a captain's rank jumpsuit" + weight = 50 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return INFINITY + */ + + + handtele + steal_target = /obj/item/weapon/hand_tele + explanation_text = "Steal a hand teleporter." + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return 10 + + + RCD + steal_target = /obj/item/weapon/rcd + explanation_text = "Steal a rapid construction device." + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return 10 + + + burger + steal_target = /obj/item/weapon/reagent_containers/food/snacks/human/burger + explanation_text = "Steal a burger made out of human organs, this will be presented as proof of NanoTrasen's chronic lack of standards." + weight = 60 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return 10 + + + jetpack + steal_target = /obj/item/weapon/tank/jetpack + explanation_text = "Steal a jetpack.." + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return 10 + + + magboots + steal_target = /obj/item/clothing/shoes/magboots + explanation_text = "Steal a pair of NanoTrasen brand magboots. They're better than ours." + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return 10 + + + blueprints + steal_target = /obj/item/blueprints + explanation_text = "Steal the station's blueprints, for use by our \"demolition\" crews." + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return 10 + + + voidsuit + steal_target = /obj/item/clothing/suit/space/nasavoid + explanation_text = "Steal a voidsuit. Supposedly, these suits are better functioning than any produced today." + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return 10 + + + nuke_disk + steal_target = /obj/item/weapon/disk/nuclear + explanation_text = "Steal the station's nuclear authentication disk. We need it for... things. *cough*" + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 90 + if(1) + return 80 + if(2) + return 70 + if(3) + return 40 + if(4) + return 25 + + nuke_gun + steal_target = /obj/item/weapon/gun/energy/gun/nuclear + explanation_text = "Steal a nuclear powered gun. We may be able to get the upper hand..." + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 90 + if(1) + return 80 + if(2) + return 70 + if(3) + return 50 + if(4) + return 40 + + diamond_drill + steal_target = /obj/item/weapon/pickaxe/diamonddrill + explanation_text = "Steal a diamond drill. All the better to drill through a hull with, eh?" + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 90 + if(1) + return 80 + if(2) + return 70 + if(3) + return 50 + if(4) + return 40 + + boh + steal_target = /obj/item/weapon/storage/backpack/holding + explanation_text = "Steal a \"bag of holding.\" Apparently these things are extremely dangerous..." + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 90 + if(1) + return 80 + if(2) + return 70 + if(3) + return 50 + if(4) + return 40 + + hyper_cell + steal_target = /obj/item/weapon/cell/hyper + explanation_text = "Steal a hyper capacity power cell. Our head researcher is drooling at the thought of it." + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 90 + if(1) + return 80 + if(2) + return 70 + if(3) + return 50 + if(4) + return 40 + + lucy + steal_target = /obj/item/stack/sheet/diamond + explanation_text = "Steal 10 diamonds. It's not for an engagement ring, why do you ask?" + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 80 + if(1) + return 70 + if(2) + return 55 + if(3) + return 40 + if(4) + return 20 + + gold + steal_target = /obj/item/stack/sheet/gold + explanation_text = "Steal 50 gold bars. We need the cash." + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 80 + if(1) + return 70 + if(2) + return 55 + if(3) + return 40 + if(4) + return 20 + + uranium + steal_target = /obj/item/stack/sheet/uranium + explanation_text = "Steal 25 enriched uranium bars... no reason, we swear!" + weight = 20 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 80 + if(1) + return 70 + if(2) + return 55 + if(3) + return 40 + if(4) + return 20 + + + /*Needs some work before it can be put in the game to differentiate ship implanters from syndicate implanters. + steal/implanter + steal_target = /obj/item/weapon/implanter + explanation_text = "Steal an implanter" + weight = 50 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return INFINITY + */ + cyborg + steal_target = /obj/item/robot_parts/robot_suit + explanation_text = "Steal a completed cyborg shell (no brain)" + weight = 30 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return 10 + + check_completion() + if(steal_target) + for(var/obj/item/robot_parts/robot_suit/objective in owner.current.get_contents()) + if(istype(objective,/obj/item/robot_parts/robot_suit) && objective.check_completion()) + return 1 + return 0 + AI + steal_target = /obj/structure/AIcore + explanation_text = "Steal a finished AI Construct (with brain)" + weight = 50 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return 10 + + check_completion() + if(steal_target) + for(var/obj/item/device/aicard/C in owner.current.get_contents()) + for(var/mob/living/silicon/ai/M in C) + if(istype(M, /mob/living/silicon/ai) && M.stat != 2) + return 1 + for(var/mob/living/silicon/ai/M in world) + if(istype(M.loc, /turf)) + if(istype(get_area(M), /area/shuttle/escape)) + return 1 + for(var/obj/structure/AIcore/M in world) + if(istype(M.loc, /turf) && M.state == 4) + if(istype(get_area(M), /area/shuttle/escape)) + return 1 + return 0 + + drugs + steal_target = /datum/reagent/space_drugs + explanation_text = "Steal some space drugs" + weight = 40 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return 10 + + check_completion() + if(steal_target) + if(owner.current.check_contents_for_reagent(steal_target)) + return 1 + else + return 0 + + + pacid + steal_target = /datum/reagent/pacid + explanation_text = "Steal some polytrinic acid" + weight = 40 + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return 10 + + check_completion() + if(steal_target) + if(owner.current.check_contents_for_reagent(steal_target)) + return 1 + else + return 0 + + + reagent + var/target_name + var/reagent_name + proc/find_target() + var/list/items = list("Sulphuric acid", "Polytrinic acid", "Space Lube", "Unstable mutagen",\ + "Leporazine", "Cryptobiolin", "Lexorin ",\ + "Kelotane", "Dexalin", "Tricordrazine") + target_name = pick(items) + switch(target_name) + if("Sulphuric acid") + steal_target = /datum/reagent/acid + if("Polytrinic acid") + steal_target = /datum/reagent/pacid + if("Space Lube") + steal_target = /datum/reagent/lube + if("Unstable mutagen") + steal_target = /datum/reagent/mutagen + if("Leporazine") + steal_target = /datum/reagent/leporazine + if("Cryptobiolin") + steal_target =/datum/reagent/cryptobiolin + if("Lexorin") + steal_target = /datum/reagent/lexorin + if("Kelotane") + steal_target = /datum/reagent/kelotane + if("Dexalin") + steal_target = /datum/reagent/dexalin + if("Tricordrazine") + steal_target = /datum/reagent/tricordrazine + + explanation_text = "Steal a container filled with [target_name]." + + return steal_target + + get_points(var/job) + switch(GetRank(job)) + if(0) + return 75 + if(1) + return 60 + if(2) + return 50 + if(3) + return 30 + if(4) + return 10 + + check_completion() + if(steal_target) + if(owner.current.check_contents_for_reagent(steal_target)) + return 1 + else + return 0 + + + nuclear + explanation_text = "Destroy the station with a nuclear device." + + + block + explanation_text = "Do not allow any humans to escape on the shuttle alive." + + + check_completion() + if(!istype(owner.current, /mob/living/silicon)) + return 0 + if(emergency_shuttle.location<2) + return 0 + if(!owner.current) + return 0 + var/area/shuttle = locate(/area/shuttle/escape/centcom) + var/protected_mobs[] = list(/mob/living/silicon/ai, /mob/living/silicon/pai, /mob/living/silicon/robot) + for(var/mob/living/player in world) + if(player.type in protected_mobs) continue + if (player.mind) + if (player.stat != 2) + if (get_turf(player) in shuttle) + return 0 + return 1 + + decapitate + var/datum/mind/target + proc/find_target() + ..() + if(target && target.current) + explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : target.assigned_role], has defied us for the last time. Make an example of him, and bring us his severed head." + else + explanation_text = "Free Objective" + return target + + + proc/find_target_by_role(role, role_type=0) + ..(role, role_type) + if(target && target.current) + explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)], has defied us for the last time. Make an example of him, and bring us his severed head." + else + explanation_text = "Free Objective" + return target + + + check_completion() + if(target && target.current) + if(!owner.current||owner.current.stat==2)//If you're otherwise dead. + return 0 + var/list/all_items = owner.current.get_contents() + for(var/obj/item/weapon/organ/head/mmi in all_items) + if(mmi.brainmob&&mmi.brainmob.mind==target) + return 1 + return 0 + else + return 1 + + absorb + var/target_amount + proc/gen_amount_goal(var/lowbound = 4, var/highbound = 6) + target_amount = rand (lowbound,highbound) + if (ticker) + var/n_p = 1 //autowin + if (ticker.current_state == GAME_STATE_SETTING_UP) + for(var/mob/new_player/P in world) + if(P.client && P.ready && P.mind!=owner) + n_p ++ + else if (ticker.current_state == GAME_STATE_PLAYING) + for(var/mob/living/carbon/human/P in world) + if(P.client && !(P.mind in ticker.mode.changelings) && P.mind!=owner) + n_p ++ + target_amount = min(target_amount, n_p) + + explanation_text = "Absorb [target_amount] compatible genomes." + return target_amount + + check_completion() + if(owner && owner.current && owner.current.changeling && owner.current.changeling.absorbed_dna && ((owner.current.changeling.absorbed_dna.len - 1) >= target_amount)) + return 1 + else + return 0 + + download + var/target_amount + proc/gen_amount_goal() + target_amount = rand(10,20) + explanation_text = "Download [target_amount] research levels." + return target_amount + + + check_completion() + if(!ishuman(owner.current)) + return 0 + if(!owner.current || owner.current.stat == 2) + return 0 + if(!(istype(owner.current:wear_suit, /obj/item/clothing/suit/space/space_ninja)&&owner.current:wear_suit:s_initialized)) + return 0 + var/current_amount + var/obj/item/clothing/suit/space/space_ninja/S = owner.current:wear_suit + if(!S.stored_research.len) + return 0 + else + for(var/datum/tech/current_data in S.stored_research) + if(current_data.level>1) current_amount+=(current_data.level-1) + if(current_amountADMINHELP THIS AT ONCE." . = 0 else if (istype(R, /obj/item/device/radio)) diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index 3105aeb210b..b53d4686fe0 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -62,50 +62,7 @@ /datum/game_mode/proc/forge_wizard_objectives(var/datum/mind/wizard) - switch(rand(1,100)) - if(1 to 30) - - var/datum/objective/assassinate/kill_objective = new - kill_objective.owner = wizard - kill_objective.find_target() - wizard.objectives += kill_objective - - if (!(locate(/datum/objective/escape) in wizard.objectives)) - var/datum/objective/escape/escape_objective = new - escape_objective.owner = wizard - wizard.objectives += escape_objective - if(31 to 60) - var/datum/objective/steal/steal_objective = new - steal_objective.owner = wizard - steal_objective.find_target() - wizard.objectives += steal_objective - - if (!(locate(/datum/objective/escape) in wizard.objectives)) - var/datum/objective/escape/escape_objective = new - escape_objective.owner = wizard - wizard.objectives += escape_objective - - if(61 to 85) - var/datum/objective/assassinate/kill_objective = new - kill_objective.owner = wizard - kill_objective.find_target() - wizard.objectives += kill_objective - - var/datum/objective/steal/steal_objective = new - steal_objective.owner = wizard - steal_objective.find_target() - wizard.objectives += steal_objective - - if (!(locate(/datum/objective/survive) in wizard.objectives)) - var/datum/objective/survive/survive_objective = new - survive_objective.owner = wizard - wizard.objectives += survive_objective - - else - if (!(locate(/datum/objective/hijack) in wizard.objectives)) - var/datum/objective/hijack/hijack_objective = new - hijack_objective.owner = wizard - wizard.objectives += hijack_objective + wizard.objectives = SelectObjectives("Wizard",wizard,1) return diff --git a/code/game/jobs/jobs.dm b/code/game/jobs/jobs.dm index f8316255431..85933c7b972 100644 --- a/code/game/jobs/jobs.dm +++ b/code/game/jobs/jobs.dm @@ -117,3 +117,18 @@ var/list/nonhuman_positions = list( /proc/guest_jobbans(var/job) return ((job in command_positions) || (job in nonhuman_positions) || (job in security_positions)) + +/proc/GetRank(var/job) + switch(job) + if("Bartender","Chef","Lawyer","Librarian","Janitor","Assistant","Unassigned") + return 0 + if("Chaplain","Botanist","Hydroponicist","Medical Doctor","Atmospheric Technician","Geneticist") + return 1 + if("Quartermaster","Cargo Technician","Chemist", "Engineer","Roboticist", "Security Officer", "Forensic Technician","Detective", "Scientist","Shaft Miner") + return 2 + if("Research Director","Chief Medical Officer","Head of Security","Chief Engineer","Warden") + return 3 + if("Captain","Head of Personnel","Wizard") + return 4 + else + world << "\"[job]\" NOT GIVEN RANK, REPORT JOBS.DM ERROR TO SKYMARSHAL A CODER" \ No newline at end of file diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm index 90c43b6c4e8..65e09faf50c 100644 --- a/code/modules/admin/verbs/onlyone.dm +++ b/code/modules/admin/verbs/onlyone.dm @@ -15,9 +15,8 @@ ticker.mode.traitors += H.mind H.mind.special_role = "traitor" - var/datum/objective/steal/steal_objective = new + var/datum/objective/steal/nuke_disk/steal_objective = new steal_objective.owner = H.mind - steal_objective.set_target("nuclear authentication disk") H.mind.objectives += steal_objective var/datum/objective/hijack/hijack_objective = new diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index f95bf469a4d..c3607a1637e 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -101,6 +101,26 @@ return 1 return 0 +/mob/living/proc/check_contents_for_reagent(A) + var/list/L = list() + L += src.contents + for(var/obj/item/weapon/storage/S in L) + L |= S.return_inv() + for(var/obj/item/weapon/gift/G in L) + L |= G.gift + if (istype(G.gift, /obj/item/weapon/storage)) + L |= G.gift:return_inv() + for(var/obj/item/weapon/evidencebag/E in L) + L |= E:contents + for(var/obj/item/smallDelivery/S in L) + L |= S.wrapped + + for(var/obj/item/weapon/reagent_containers/B in L) + for(var/datum/reagent/R in B.reagents.reagent_list) + if(R.type == A) + return 1 + return 0 + /mob/living/proc/electrocute_act(var/shock_damage, var/obj/source, var/siemens_coeff = 1.0) return 0 //only carbon liveforms have this proc diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 419cca88114..5395d00f18b 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -265,7 +265,8 @@ job_master.EquipRank(character, rank, 1) EquipCustomItems(character) character.loc = pick(latejoin) - character.be_syndicate = src.preferences.be_special + if(character.client) + character.client.be_syndicate = preferences.be_special ticker.mode.latespawn(character) AnnounceArrival(character, rank) diff --git a/code/modules/mob/new_player/preferences.dm b/code/modules/mob/new_player/preferences.dm index 577c29d74e6..e5bff822c7f 100644 --- a/code/modules/mob/new_player/preferences.dm +++ b/code/modules/mob/new_player/preferences.dm @@ -862,7 +862,6 @@ datum/preferences character.age = age character.dna.b_type = b_type - character.be_syndicate = be_special character.r_eyes = r_eyes character.g_eyes = g_eyes @@ -906,6 +905,7 @@ datum/preferences character.client.ooccolor = ooccolor character.client.be_alien = be_special&BE_ALIEN character.client.be_pai = be_special&BE_PAI + character.client.be_syndicate = be_special proc/copydisabilities(mob/living/carbon/human/character) if(disabilities & 1) From a5a7df1c20c22cea14fdfad5dce872f57b187fe3 Mon Sep 17 00:00:00 2001 From: SkyMarshal Date: Sun, 25 Mar 2012 00:33:38 -0700 Subject: [PATCH 2/2] Part two of the objective system. Also fixed up AIs on the shuttle, bug #747, and interacting with windows. --- code/WorkInProgress/SkyMarshal/portalathe.dm | 5 +- code/datums/mind.dm | 3 +- code/game/atom_procs.dm | 7 +- code/game/events/EventProcs/space_ninja.dm | 7 +- code/game/gamemodes/changeling/changeling.dm | 6 +- code/game/gamemodes/newobjective.dm | 243 +++++++++++-------- code/game/gamemodes/traitor/traitor.dm | 4 +- code/game/machinery/computer/shuttle.dm | 20 +- code/modules/mob/living/silicon/ai/life.dm | 2 +- code/modules/power/singularity/emitter.dm | 2 +- 10 files changed, 176 insertions(+), 123 deletions(-) diff --git a/code/WorkInProgress/SkyMarshal/portalathe.dm b/code/WorkInProgress/SkyMarshal/portalathe.dm index d00c96a054b..4dcdb90b2cf 100644 --- a/code/WorkInProgress/SkyMarshal/portalathe.dm +++ b/code/WorkInProgress/SkyMarshal/portalathe.dm @@ -12,7 +12,8 @@ if(!istype(target, /obj/machinery/light)) return var/obj/machinery/light/L = target - if(L.stat > 1) //Burned or broke - L.stat = 0 + if(L.status > 1) //Burned or broke + L.status = 0 + L.update() user.visible_message("[user] repairs \the [target] on the spot with their [src]!","You repair the lightbulb!") return \ No newline at end of file diff --git a/code/datums/mind.dm b/code/datums/mind.dm index f911be27433..30ff780a118 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -367,8 +367,7 @@ datum/mind new_objective.owner = src if ("steal") - var/steal_type = pick(GetObjectives(assigned_role,src)) - new_objective = new steal_type + new_objective = pick(GenerateTheft(assigned_role,src)) new_objective.owner = src if("download","capture","absorb") diff --git a/code/game/atom_procs.dm b/code/game/atom_procs.dm index 771d8a1dd80..244ff000d6f 100644 --- a/code/game/atom_procs.dm +++ b/code/game/atom_procs.dm @@ -782,9 +782,6 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl ok = (check_1 || check_2) - - if(check_1 || check_2) - ok = 1 // ------- YOU CAN REACH THE ITEM THROUGH AT LEAST ONE OF THE TWO DIRECTIONS. GOOD. ------- /* @@ -914,7 +911,7 @@ var/using_new_click_proc = 0 //TODO ERRORAGE (This is temporary, while the DblCl return -proc/CanReachThrough(turf/srcturf, turf/targetturf, atom/target) +/proc/CanReachThrough(turf/srcturf, turf/targetturf, atom/target) var/obj/item/weapon/dummy/D = new /obj/item/weapon/dummy( srcturf ) if(targetturf.density && targetturf != get_turf(target)) @@ -929,7 +926,7 @@ proc/CanReachThrough(turf/srcturf, turf/targetturf, atom/target) //Next, check objects to block entry that are on the border for(var/obj/border_obstacle in targetturf) - if((border_obstacle.flags & ON_BORDER) && (src != border_obstacle)) + if((border_obstacle.flags & ON_BORDER) && (target != border_obstacle)) if(!border_obstacle.CanPass(D, srcturf, 1, 0)) del D return 0 diff --git a/code/game/events/EventProcs/space_ninja.dm b/code/game/events/EventProcs/space_ninja.dm index f2a562a6988..166bbade813 100644 --- a/code/game/events/EventProcs/space_ninja.dm +++ b/code/game/events/EventProcs/space_ninja.dm @@ -241,10 +241,9 @@ In either case, it's a good idea to spawn the ninja with a semi-random set of ob hostile_targets -= current_mind//Remove them from the list. if(2)//Steal - var/datum/objective/steal/ninja_objective = new - var/target_item = pick(ninja_objective.possible_items_special) - ninja_objective.set_target(target_item) - ninja_mind.objectives += ninja_objective + var/list/datum/objective/theft = GenerateTheft(ninja_mind.assigned_role,ninja_mind) + var/datum/objective/steal/steal_objective = pick(theft) + ninja_mind.objectives += steal_objective objective_list -= 2 if(3)//Protect. Keeping people alive can be pretty difficult. diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 82a0e7c58c3..ca9cc5a53e2 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -101,7 +101,8 @@ if(46 to 90) - var/datum/objective/steal/steal_objective = new pick(GetObjectives(changeling.assigned_role,changeling)) + var/list/datum/objective/theft = GenerateTheft(changeling.assigned_role,changeling) + var/datum/objective/steal/steal_objective = pick(theft) steal_objective.owner = changeling changeling.objectives += steal_objective @@ -117,7 +118,8 @@ kill_objective.find_target() changeling.objectives += kill_objective - var/datum/objective/steal/steal_objective = new pick(GetObjectives(changeling.assigned_role,changeling)) + var/list/datum/objective/theft = GenerateTheft(changeling.assigned_role,changeling) + var/datum/objective/steal/steal_objective = pick(theft) steal_objective.owner = changeling changeling.objectives += steal_objective diff --git a/code/game/gamemodes/newobjective.dm b/code/game/gamemodes/newobjective.dm index 014ad6a109c..730b6f8ea35 100644 --- a/code/game/gamemodes/newobjective.dm +++ b/code/game/gamemodes/newobjective.dm @@ -39,7 +39,7 @@ /proc/SelectObjectives(var/job,var/datum/mind/traitor,var/hijack = 0) var/list/datum/objective/chosenobjectives = list() - var/list/datum/objective/theftobjectives = GetObjectives(job,traitor) //Separated all the objective types so they can be picked independantly of each other. + var/list/datum/objective/theftobjectives = GenerateTheft(job,traitor) //Separated all the objective types so they can be picked independantly of each other. var/list/datum/objective/killobjectives = GenerateAssassinate(job,traitor) var/list/datum/objective/frameobjectives = GenerateFrame(job,traitor) var/list/datum/objective/protectobjectives = GenerateProtection(job,traitor) @@ -56,31 +56,57 @@ totalweight += objective.weight theftobjectives -= objective else switch(selectobj) - if(1 to 50) //Theft Objectives (50% chance) + if(1 to 55) //Theft Objectives (55% chance) var/datum/objective/objective = pick(theftobjectives) + for(1 to 10) + if(objective.weight + totalweight <= 110) + break + objective = pick(theftobjectives) chosenobjectives += objective totalweight += objective.weight theftobjectives -= objective - if(51 to 87) //Assassination Objectives (37% chance) + if(56 to 92) //Assassination Objectives (37% chance) var/datum/objective/assassinate/objective = pick(killobjectives) + for(1 to 10) + if(objective.weight + totalweight <= 110) + break + objective = pick(killobjectives) for(var/datum/objective/protection/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Assassinate somebody they need to Protect. if(conflicttest.target == objective.target) conflict = 1 + break + for(var/datum/objective/frame/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Protect somebody they need to Assassinate. + if(conflicttest.target == objective.target) + conflict = 1 + break if(!conflict) chosenobjectives += objective totalweight += objective.weight killobjectives -= objective conflict = 0 - if(88 to 90) //Framing Objectives (3% chance) + if(93 to 95) //Framing Objectives (3% chance) var/datum/objective/objective = pick(frameobjectives) + for(1 to 10) + if(objective.weight + totalweight <= 110) + break + objective = pick(frameobjectives) chosenobjectives += objective totalweight += objective.weight frameobjectives -= objective - if(91 to 100) //Protection Objectives (5% chance) + if(96 to 100) //Protection Objectives (5% chance) var/datum/objective/protection/objective = pick(protectobjectives) + for(1 to 10) + if(objective.weight + totalweight <= 110) + break + objective = pick(protectobjectives) for(var/datum/objective/assassinate/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Protect somebody they need to Assassinate. if(conflicttest.target == objective.target) conflict = 1 + break + for(var/datum/objective/frame/conflicttest in chosenobjectives) //Check to make sure we aren't telling them to Protect somebody they need to Assassinate. + if(conflicttest.target == objective.target) + conflict = 1 + break if(!conflict) chosenobjectives += objective totalweight += objective.weight @@ -105,6 +131,7 @@ datum objective var/datum/mind/owner + var/datum/mind/target var/explanation_text = "text not set" var/job // var/points = INFINITY //If this isn't set to something else, the objective is bugged and should be ignored @@ -116,16 +143,18 @@ datum job=joba weight = get_points(job) - proc - check_completion() - return 1 - get_points(var/job) - return INFINITY + proc/check_completion() + return 1 + proc/get_points(var/job) + return INFINITY + proc/find_target_by_role(role, role_type=0)//Option sets either to check assigned role or special role. Default to assigned. + for(var/datum/mind/possible_target in ticker.minds) + if((possible_target != owner) && ishuman(possible_target.current) && ((role_type ? possible_target.special_role : possible_target.assigned_role) == role) ) + target = possible_target + break frame - var/datum/mind/target - New(var/text,var/joba,var/datum/mind/targeta) target = targeta job = joba @@ -150,7 +179,7 @@ datum get_points() if(target) - switch(GetRank(owner.assigned_role)) + switch(GetRank(job)) if(4) return 30 if(3) @@ -166,7 +195,6 @@ datum protection - var/datum/mind/target New(var/text,var/joba,var/datum/mind/targeta) target = targeta job = joba @@ -192,9 +220,16 @@ datum get_points() return 30 + find_target_by_role(role, role_type=0) + ..(role, role_type) + if(target && target.current) + explanation_text = "Protect [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)]." + else + explanation_text = "Free Objective" + return target + assassinate - var/datum/mind/target New(var/text,var/joba,var/datum/mind/targeta) target = targeta @@ -212,7 +247,7 @@ datum return 1 get_points() if(target) - switch(GetRank(owner.assigned_role)) + switch(GetRank(job)) if(4) return 30 if(3) @@ -226,7 +261,7 @@ datum else return 0 - proc/find_target_by_role(var/role) + find_target_by_role(var/role) for(var/datum/mind/possible_target in ticker.minds) if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human) && (possible_target.assigned_role == role)) target = possible_target @@ -259,7 +294,6 @@ datum capture - var/datum/mind/target var/separation_time = 0 var/almost_complete = 0 @@ -278,7 +312,7 @@ datum else if(config.require_heads_alive) return 0 return 1 - proc/find_target_by_role(var/role) + find_target_by_role(var/role) for(var/datum/mind/possible_target in ticker.minds) if((possible_target != owner) && istype(possible_target.current, /mob/living/carbon/human) && (possible_target.assigned_role == role)) target = possible_target @@ -367,7 +401,7 @@ datum survive - explanation_text = "Stay alive until the end." + explanation_text = "Stay alive." check_completion() if(!owner.current || owner.current.stat == 2) @@ -414,9 +448,9 @@ datum weight = 20 get_points(var/job) - if(job in science_positions) - return 10 - return 20 + if(job in science_positions || job in command_positions) + return 20 + return 40 /*Removing this as an objective. Not necessary to have two theft objectives in the same room. @@ -456,7 +490,7 @@ datum if(3) return 30 if(4) - return 10 + return 20 RCD @@ -475,10 +509,10 @@ datum if(3) return 30 if(4) - return 10 + return 20 - burger + /*burger steal_target = /obj/item/weapon/reagent_containers/food/snacks/human/burger explanation_text = "Steal a burger made out of human organs, this will be presented as proof of NanoTrasen's chronic lack of standards." weight = 60 @@ -486,20 +520,20 @@ datum get_points(var/job) switch(GetRank(job)) if(0) - return 75 + return 80 if(1) - return 60 + return 65 if(2) - return 50 + return 55 if(3) - return 30 + return 40 if(4) - return 10 + return 25*/ jetpack steal_target = /obj/item/weapon/tank/jetpack - explanation_text = "Steal a jetpack.." + explanation_text = "Steal a jetpack." weight = 20 get_points(var/job) @@ -513,12 +547,12 @@ datum if(3) return 30 if(4) - return 10 + return 20 magboots steal_target = /obj/item/clothing/shoes/magboots - explanation_text = "Steal a pair of NanoTrasen brand magboots. They're better than ours." + explanation_text = "Steal a pair of \"NanoTrasen\" brand magboots." weight = 20 get_points(var/job) @@ -532,12 +566,12 @@ datum if(3) return 30 if(4) - return 10 + return 20 blueprints steal_target = /obj/item/blueprints - explanation_text = "Steal the station's blueprints, for use by our \"demolition\" crews." + explanation_text = "Steal the station's blueprints." weight = 20 get_points(var/job) @@ -551,12 +585,12 @@ datum if(3) return 30 if(4) - return 10 + return 20 voidsuit steal_target = /obj/item/clothing/suit/space/nasavoid - explanation_text = "Steal a voidsuit. Supposedly, these suits are better functioning than any produced today." + explanation_text = "Steal a voidsuit." weight = 20 get_points(var/job) @@ -570,12 +604,12 @@ datum if(3) return 30 if(4) - return 10 + return 20 nuke_disk steal_target = /obj/item/weapon/disk/nuclear - explanation_text = "Steal the station's nuclear authentication disk. We need it for... things. *cough*" + explanation_text = "Steal the station's nuclear authentication disk." weight = 20 get_points(var/job) @@ -593,7 +627,7 @@ datum nuke_gun steal_target = /obj/item/weapon/gun/energy/gun/nuclear - explanation_text = "Steal a nuclear powered gun. We may be able to get the upper hand..." + explanation_text = "Steal a nuclear powered gun." weight = 20 get_points(var/job) @@ -601,17 +635,17 @@ datum if(0) return 90 if(1) - return 80 + return 85 if(2) - return 70 + return 80 if(3) - return 50 + return 75 if(4) - return 40 + return 75 diamond_drill steal_target = /obj/item/weapon/pickaxe/diamonddrill - explanation_text = "Steal a diamond drill. All the better to drill through a hull with, eh?" + explanation_text = "Steal a diamond drill." weight = 20 get_points(var/job) @@ -619,17 +653,17 @@ datum if(0) return 90 if(1) - return 80 + return 85 if(2) return 70 if(3) - return 50 + return 75 if(4) - return 40 + return 75 boh steal_target = /obj/item/weapon/storage/backpack/holding - explanation_text = "Steal a \"bag of holding.\" Apparently these things are extremely dangerous..." + explanation_text = "Steal a \"bag of holding.\"" weight = 20 get_points(var/job) @@ -637,17 +671,17 @@ datum if(0) return 90 if(1) - return 80 + return 85 if(2) - return 70 + return 80 if(3) - return 50 + return 75 if(4) - return 40 + return 75 hyper_cell steal_target = /obj/item/weapon/cell/hyper - explanation_text = "Steal a hyper capacity power cell. Our head researcher is drooling at the thought of it." + explanation_text = "Steal a hyper capacity power cell." weight = 20 get_points(var/job) @@ -655,67 +689,91 @@ datum if(0) return 90 if(1) - return 80 + return 85 if(2) - return 70 + return 80 if(3) - return 50 + return 75 if(4) - return 40 + return 75 lucy steal_target = /obj/item/stack/sheet/diamond - explanation_text = "Steal 10 diamonds. It's not for an engagement ring, why do you ask?" + explanation_text = "Steal 10 diamonds." weight = 20 get_points(var/job) switch(GetRank(job)) if(0) - return 80 + return 90 if(1) - return 70 + return 85 if(2) - return 55 + return 80 if(3) - return 40 + return 75 if(4) - return 20 + return 75 + + check_completion() + var/target_amount = 10 + var/found_amount = 0.0//Always starts as zero. + for(var/obj/item/I in owner.current.get_contents()) + if(!istype(I, steal_target)) continue//If it's not actually that item. + found_amount += I:amount + return found_amount>=target_amount gold steal_target = /obj/item/stack/sheet/gold - explanation_text = "Steal 50 gold bars. We need the cash." + explanation_text = "Steal 50 gold bars." weight = 20 get_points(var/job) switch(GetRank(job)) if(0) - return 80 + return 90 if(1) - return 70 + return 85 if(2) - return 55 + return 80 if(3) - return 40 + return 75 if(4) - return 20 + return 70 + + check_completion() + var/target_amount = 50 + var/found_amount = 0.0//Always starts as zero. + for(var/obj/item/I in owner.current.get_contents()) + if(!istype(I, steal_target)) continue//If it's not actually that item. + found_amount += I:amount + return found_amount>=target_amount uranium steal_target = /obj/item/stack/sheet/uranium - explanation_text = "Steal 25 enriched uranium bars... no reason, we swear!" + explanation_text = "Steal 25 uranium bars." weight = 20 get_points(var/job) switch(GetRank(job)) if(0) - return 80 + return 90 if(1) - return 70 + return 85 if(2) - return 55 + return 80 if(3) - return 40 + return 75 if(4) - return 20 + return 70 + + check_completion() + var/target_amount = 25 + var/found_amount = 0.0//Always starts as zero. + for(var/obj/item/I in owner.current.get_contents()) + if(!istype(I, steal_target)) continue//If it's not actually that item. + found_amount += I:amount + return found_amount>=target_amount /*Needs some work before it can be put in the game to differentiate ship implanters from syndicate implanters. @@ -753,7 +811,7 @@ datum if(3) return 30 if(4) - return 10 + return 20 check_completion() if(steal_target) @@ -763,7 +821,7 @@ datum return 0 AI steal_target = /obj/structure/AIcore - explanation_text = "Steal a finished AI Construct (with brain)" + explanation_text = "Steal a finished AI, either by intellicard or stealing the whole construct." weight = 50 get_points(var/job) @@ -777,7 +835,7 @@ datum if(3) return 30 if(4) - return 10 + return 20 check_completion() if(steal_target) @@ -797,7 +855,7 @@ datum drugs steal_target = /datum/reagent/space_drugs - explanation_text = "Steal some space drugs" + explanation_text = "Steal some space drugs." weight = 40 get_points(var/job) @@ -811,7 +869,7 @@ datum if(3) return 30 if(4) - return 10 + return 20 check_completion() if(steal_target) @@ -823,7 +881,7 @@ datum pacid steal_target = /datum/reagent/pacid - explanation_text = "Steal some polytrinic acid" + explanation_text = "Steal some polytrinic acid." weight = 40 get_points(var/job) @@ -837,7 +895,7 @@ datum if(3) return 30 if(4) - return 10 + return 20 check_completion() if(steal_target) @@ -849,8 +907,8 @@ datum reagent var/target_name - var/reagent_name - proc/find_target() + New(var/text,var/joba) + ..() var/list/items = list("Sulphuric acid", "Polytrinic acid", "Space Lube", "Unstable mutagen",\ "Leporazine", "Cryptobiolin", "Lexorin ",\ "Kelotane", "Dexalin", "Tricordrazine") @@ -879,8 +937,6 @@ datum explanation_text = "Steal a container filled with [target_name]." - return steal_target - get_points(var/job) switch(GetRank(job)) if(0) @@ -892,7 +948,7 @@ datum if(3) return 30 if(4) - return 10 + return 20 check_completion() if(steal_target) @@ -928,7 +984,6 @@ datum return 1 decapitate - var/datum/mind/target proc/find_target() ..() if(target && target.current) @@ -938,7 +993,7 @@ datum return target - proc/find_target_by_role(role, role_type=0) + find_target_by_role(role, role_type=0) ..(role, role_type) if(target && target.current) explanation_text = "[target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)], has defied us for the last time. Make an example of him, and bring us his severed head." @@ -1011,7 +1066,6 @@ datum debrain//I want braaaainssss - var/datum/mind/target proc/find_target() ..() if(target && target.current) @@ -1021,7 +1075,7 @@ datum return target - proc/find_target_by_role(role, role_type=0) + find_target_by_role(role, role_type=0) ..(role, role_type) if(target && target.current) explanation_text = "Steal the brain of [target.current.real_name] the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)]." @@ -1043,7 +1097,6 @@ datum return 0 mutiny - var/datum/mind/target proc/find_target() ..() if(target && target.current) @@ -1053,7 +1106,7 @@ datum return target - proc/find_target_by_role(role, role_type=0) + find_target_by_role(role, role_type=0) ..(role, role_type) if(target && target.current) explanation_text = "Assassinate [target.current.real_name], the [target.role_alt_title ? target.role_alt_title : (!role_type ? target.assigned_role : target.special_role)]." diff --git a/code/game/gamemodes/traitor/traitor.dm b/code/game/gamemodes/traitor/traitor.dm index 7b3b8a9209b..59dea467592 100644 --- a/code/game/gamemodes/traitor/traitor.dm +++ b/code/game/gamemodes/traitor/traitor.dm @@ -88,7 +88,9 @@ traitor.objectives += block_objective else - traitor.objectives = SelectObjectives(traitor.assigned_role, traitor) + for(var/datum/objective/o in SelectObjectives((traitor.current:wear_id ? traitor.current:wear_id:assignment : traitor.assigned_role), traitor)) + o.owner = traitor + traitor.objectives += o return diff --git a/code/game/machinery/computer/shuttle.dm b/code/game/machinery/computer/shuttle.dm index 4f057e8eab7..e17df881298 100644 --- a/code/game/machinery/computer/shuttle.dm +++ b/code/game/machinery/computer/shuttle.dm @@ -6,7 +6,7 @@ var/list/authorized = list( ) -/* attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob) + attackby(var/obj/item/weapon/card/W as obj, var/mob/user as mob) if(stat & (BROKEN|NOPOWER)) return if ((!( istype(W, /obj/item/weapon/card) ) || !( ticker ) || emergency_shuttle.location != 1 || !( user ))) return if (istype(W, /obj/item/weapon/card/id)||istype(W, /obj/item/device/pda)) @@ -14,23 +14,23 @@ var/obj/item/device/pda/pda = W W = pda.id if (!W:access) //no access - user << "The access level of [W:registered]\'s card is not high enough. " + user << "The access level of [W:registered_name]\'s card is not high enough. " return var/list/cardaccess = W:access if(!istype(cardaccess, /list) || !cardaccess.len) //no access - user << "The access level of [W:registered]\'s card is not high enough. " + user << "The access level of [W:registered_name]\'s card is not high enough. " return if(!(access_heads in W:access)) //doesn't have this access - user << "The access level of [W:registered]\'s card is not high enough. " + user << "The access level of [W:registered_name]\'s card is not high enough. " return 0 var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort") switch(choice) if("Authorize") - src.authorized -= W:registered - src.authorized += W:registered + src.authorized -= W:registered_name + src.authorized += W:registered_name if (src.auth_need - src.authorized.len > 0) message_admins("[key_name_admin(user)] has authorized early shuttle launch") log_game("[user.ckey] has authorized early shuttle launch") @@ -45,7 +45,7 @@ src.authorized = list( ) if("Repeal") - src.authorized -= W:registered + src.authorized -= W:registered_name world << text("\blue Alert: [] authorizations needed until shuttle is launched early", src.auth_need - src.authorized.len) if("Abort") @@ -53,12 +53,12 @@ src.authorized.len = 0 src.authorized = list( ) - else if (istype(W, /obj/item/weapon/card/emag)) +/* else if (istype(W, /obj/item/weapon/card/emag)) var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel") switch(choice) if("Launch") world << "\blue Alert: Shuttle launch time shortened to 10 seconds!" emergency_shuttle.settimeleft( 10 ) if("Cancel") - return - return */ + return*/ + return diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm index bb795a63481..c6e4462c7de 100644 --- a/code/modules/mob/living/silicon/ai/life.dm +++ b/code/modules/mob/living/silicon/ai/life.dm @@ -106,7 +106,7 @@ src.see_in_dark = 0 src.see_invisible = 0 - if (((!loc.master.power_equip) || istype(T, /turf/space)) && !istype(src.loc,/obj/item)) + if (((!loc.master.power_equip) || istype(T, /turf/space)) && !istype(src.loc,/obj/item) && !istype(get_area(src), /area/shuttle)) if (src:aiRestorePowerRoutine==0) src:aiRestorePowerRoutine = 1 diff --git a/code/modules/power/singularity/emitter.dm b/code/modules/power/singularity/emitter.dm index 336478efb0f..580756f397c 100644 --- a/code/modules/power/singularity/emitter.dm +++ b/code/modules/power/singularity/emitter.dm @@ -109,7 +109,7 @@ else // Any other A.yo = -20 A.xo = 0 - A.process() + A.fired() attackby(obj/item/W, mob/user)