From 835118fa4957368574d618184ca851d7e4cdc23c Mon Sep 17 00:00:00 2001 From: "noisomehollow@lycos.com" Date: Mon, 20 Jun 2011 05:22:41 +0000 Subject: [PATCH] Ninjas are now a random event. They may appear in most game modes after about an hour, with an assigned objective list. Fixed aliens :a talking while dead. Disabled hand-tele on clown-planet z-level since people were still finding ways to abuse it. PDA menu will close properly if detomatrix fails and explodes own PDA. Late joiners are now added to minds. It's now possible to assassinate them, and so on, as an objective. Added a few more objectives (capture, steal brain of, protect, and download research) and new possible items to steal (also fixed admin-added steal objectives). Mostly focused on ninjas but admins can give them to regular traitors. Only research downloading is outright impossible for regular traitors (they must wear a ninja suit). Added a few revisions to mind/objective datums and a few other things. The game should now report any extra antagonists for most round types, excluding AI malfunction. Added two new words to station_name.dm. Other misc changes. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@1698 316c924e-a436-60f5-8080-3fe189b3f50e --- code/datums/mind.dm | 87 +++-- code/defines/procs/station_name.dm | 4 +- code/game/gamemodes/changeling/changeling.dm | 6 +- code/game/gamemodes/events.dm | 8 +- .../{extra => events}/ninja_abilities.dm | 1 - .../{extra => events}/ninja_equipment.dm | 44 ++- .../{extra => events}/space_ninja.dm | 306 +++++++++++++----- code/game/gamemodes/game_mode.dm | 46 ++- code/game/gamemodes/gameticker.dm | 5 +- .../game/gamemodes/malfunction/malfunction.dm | 14 +- code/game/gamemodes/nuclear/nuclearbomb.dm | 1 + code/game/gamemodes/objective.dm | 249 ++++++++++---- code/game/gamemodes/revolution/revolution.dm | 15 - code/game/gamemodes/traitor/traitor.dm | 2 +- code/game/objects/devices/PDA/PDA.dm | 1 + code/game/objects/devices/PDA/uplink.dm | 212 ++++++------ .../objects/items/weapons/teleportation.dm | 16 +- code/modules/admin/admin.dm | 15 +- code/modules/admin/admin_verbs.dm | 17 +- code/modules/admin/verbs/striketeam.dm | 1 + code/modules/mob/living/carbon/alien/say.dm | 25 +- code/modules/mob/living/silicon/ai/death.dm | 38 +-- code/modules/mob/new_player/new_player.dm | 2 + code/modules/mob/transform_procs.dm | 11 +- tgstation.dme | 7 +- 25 files changed, 742 insertions(+), 391 deletions(-) rename code/game/gamemodes/{extra => events}/ninja_abilities.dm (97%) rename code/game/gamemodes/{extra => events}/ninja_equipment.dm (96%) rename code/game/gamemodes/{extra => events}/space_ninja.dm (70%) diff --git a/code/datums/mind.dm b/code/datums/mind.dm index bd48d8fa3c9..c3dab7639dd 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -153,68 +153,58 @@ datum/mind memory = new_memo else if (href_list["obj_edit"] || href_list["obj_add"]) - var/datum/objective/objective = null - var/objective_pos = null - var/def_value = null + var/datum/objective/objective + var/objective_pos + var/def_value if (href_list["obj_edit"]) objective = locate(href_list["obj_edit"]) if (!objective) return objective_pos = objectives.Find(objective) - if (istype(objective, /datum/objective/assassinate)) - def_value = "assassinate" - else if (istype(objective, /datum/objective/hijack)) - def_value = "hijack" - else if (istype(objective, /datum/objective/escape)) - def_value = "escape" - else if (istype(objective, /datum/objective/survive)) - def_value = "survive" - else if (istype(objective, /datum/objective/steal)) - def_value = "steal" - else if (istype(objective, /datum/objective/nuclear)) - def_value = "nuclear" - else if (istype(objective, /datum/objective/absorb)) - def_value = "absorb" - else if (istype(objective, /datum/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" - // TODO: cult objectives - //else if (istype(objective, /datum/objective/eldergod)) - // def_value = "eldergod" - //else if (istype(objective, /datum/objective/survivecult)) - // def_value = "survivecult" - //else if (istype(objective, /datum/objective/sacrifice)) - // def_value = "sacrifice" - var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "hijack", "escape", "survive", "steal", "nuclear", "absorb", "custom") + var/new_obj_type = input("Select objective type:", "Objective type", def_value) as null|anything in list("assassinate", "debrain", "protect", "hijack", "escape", "survive", "steal", "download", "nuclear", "capture", "absorb", "custom") if (!new_obj_type) return var/datum/objective/new_objective = null switch (new_obj_type) - if ("assassinate") + if ("assassinate","protect","debrain") + //To determine what to name the objective in explanation text. + var/objective_type_capital = uppertext(copytext(new_obj_type, 1,2))//Capitalize first letter. + var/objective_type_text = copytext(new_obj_type, 2)//Leave the rest of the text. + var/objective_type = "[objective_type_capital][objective_type_text]"//Add them together into a text string. + var/list/possible_targets = list("Free objective") for(var/datum/mind/possible_target in ticker.minds) if ((possible_target != src) && istype(possible_target.current, /mob/living/carbon/human)) possible_targets += possible_target.current var/mob/def_target = null - if (istype(objective, /datum/objective/assassinate) && objective:target) + var/objective_list[] = list(/datum/objective/assassinate, /datum/objective/protect, /datum/objective/debrain) + if (objective&&(objective.type in objective_list) && objective:target) def_target = objective:target.current var/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 /datum/objective/assassinate + new_objective = new objective_path new_objective.owner = src new_objective:target = null new_objective.explanation_text = "Free objective" else - new_objective = new /datum/objective/assassinate + new_objective = new objective_path new_objective.owner = src new_objective:target = new_target:mind - new_objective.explanation_text = "Assassinate [new_target:real_name], the [new_target:mind:assigned_role]." + //Will display as special role if the target is set as MODE. Ninjas/commandos/nuke ops. + new_objective.explanation_text = "[objective_type] [new_target:real_name], the [new_target:mind:assigned_role=="MODE" ? (new_target:mind:special_role) : (new_target:mind:assigned_role)]." if ("hijack") new_objective = new /datum/objective/hijack @@ -228,6 +218,10 @@ datum/mind new_objective = new /datum/objective/survive 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 @@ -238,22 +232,27 @@ datum/mind if (!steal.select_target()) return - if ("nuclear") - new_objective = new /datum/objective/nuclear - 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 - if ("absorb") - var/def_num = null - if (istype(objective, /datum/objective/absorb)) - def_num = objective:num_to_eat - - var/num_to_eat = input("Number to eat:", "Objective", def_num) as num|null - if (isnull(num_to_eat)) + 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 - new_objective = new /datum/objective/absorb + + switch(new_obj_type) + if("download") + new_objective = new /datum/objective/download + new_objective.explanation_text = "Download [target_number] research levels." + if("capture") + new_objective = new /datum/objective/capture + new_objective.explanation_text = "Accumulate [target_number] capture points." + if("absorb") + new_objective = new /datum/objective/absorb + new_objective.explanation_text = "Absorb [target_number] compatible genomes." new_objective.owner = src - new_objective:num_to_eat = num_to_eat - new_objective.explanation_text = "Absorb [num_to_eat] compatible genomes." + 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/procs/station_name.dm b/code/defines/procs/station_name.dm index 79cc4459516..024c3678e8a 100644 --- a/code/defines/procs/station_name.dm +++ b/code/defines/procs/station_name.dm @@ -9,12 +9,12 @@ name += " " // Prefix - name += pick("", "Dorf", "Alium", "Prefix", "Clowning", "Aegis", "Ishimura", "Scaredy", "Death-World", "Mime", "Honk", "Rogue", "Pony", "MacRagge", "Ultrameens", "Safety", "Paranoia", "Explosive", "Neckbear", "Donk", "Muppet", "North", "West", "East", "South", "Slant-ways", "Widdershins", "Rimward", "Expensive", "Procreatory", "Imperial", "Unidentified", "Immoral", "Carp", "Ork", "Pete", "Control", "Nettle", "Aspie", "Class", "Crab", "Fist","Corrogated","Skeleton","Race", "Fatguy", "Gentleman", "Touhou", "Capitalist", "Communist", "Bear", "Beard", "Derp", "Space", "Star", "Moon", "System", "Mining", "Neckbeard", "Research", "Supply", "Military", "Orbital", "Battle", "Science", "Asteroid", "Home", "Production", "Transport", "Delivery", "Extraplanetary", "Orbital", "Correctional", "Robot") + name += pick("", "Dorf", "Alium", "Prefix", "Clowning", "Aegis", "Ishimura", "Scaredy", "Death-World", "Mime", "Honk", "Rogue", "Pony", "MacRagge", "Ultrameens", "Safety", "Paranoia", "Explosive", "Neckbear", "Donk", "Muppet", "North", "West", "East", "South", "Slant-ways", "Widdershins", "Rimward", "Expensive", "Procreatory", "Imperial", "Unidentified", "Immoral", "Carp", "Ork", "Pete", "Control", "Nettle", "Aspie", "Class", "Crab", "Fist","Corrogated","Skeleton","Race", "Fatguy", "Gentleman", "Touhou", "Capitalist", "Communist", "Bear", "Beard", "Derp", "Space", "Star", "Moon", "System", "Mining", "Neckbeard", "Research", "Supply", "Military", "Orbital", "Battle", "Science", "Asteroid", "Home", "Production", "Transport", "Delivery", "Extraplanetary", "Orbital", "Correctional", "Robot", "Gryphon") if (name) name += " " // Suffix - name += pick("Station", "Fortress", "Frontier", "Suffix", "Death-trap", "Space-hulk", "Lab", "Hazard","Spess Junk", "Fishery", "No-Moon", "Tomb", "Crypt", "Hut", "Monkey", "Bomb", "Trade Post", "Fortress", "Village", "Town", "City", "Edition", "Hive", "Complex", "Base", "Facility", "Depot", "Outpost", "Installation", "Drydock", "Observatory", "Array", "Relay", "Monitor", "Platform", "Construct", "Hangar", "Prison", "Center", "Port", "Waystation", "Factory", "Waypoint", "Stopover", "Hub", "HQ", "Office", "Object", "Fortification", "Colony", "Planet-Cracker") + name += pick("Station", "Fortress", "Frontier", "Suffix", "Death-trap", "Space-hulk", "Lab", "Hazard","Spess Junk", "Fishery", "No-Moon", "Tomb", "Crypt", "Hut", "Monkey", "Bomb", "Trade Post", "Fortress", "Village", "Town", "City", "Edition", "Hive", "Complex", "Base", "Facility", "Depot", "Outpost", "Installation", "Drydock", "Observatory", "Array", "Relay", "Monitor", "Platform", "Construct", "Hangar", "Prison", "Center", "Port", "Waystation", "Factory", "Waypoint", "Stopover", "Hub", "HQ", "Office", "Object", "Fortification", "Colony", "Planet-Cracker", "Roost") name += " " // ID Number diff --git a/code/game/gamemodes/changeling/changeling.dm b/code/game/gamemodes/changeling/changeling.dm index 22f18879c5a..4e88210c054 100644 --- a/code/game/gamemodes/changeling/changeling.dm +++ b/code/game/gamemodes/changeling/changeling.dm @@ -76,7 +76,7 @@ var/datum/objective/absorb/absorb_objective = new absorb_objective.owner = changeling - absorb_objective.gen_num_to_eat() + absorb_objective.gen_amount_goal() changeling.objectives += absorb_objective var/datum/objective/assassinate/kill_objective = new @@ -92,7 +92,7 @@ var/datum/objective/absorb/absorb_objective = new absorb_objective.owner = changeling - absorb_objective.gen_num_to_eat() + absorb_objective.gen_amount_goal() changeling.objectives += absorb_objective var/datum/objective/steal/steal_objective = new @@ -108,7 +108,7 @@ var/datum/objective/absorb/absorb_objective = new absorb_objective.owner = changeling - absorb_objective.gen_num_to_eat() + absorb_objective.gen_amount_goal() changeling.objectives += absorb_objective var/datum/objective/assassinate/kill_objective = new diff --git a/code/game/gamemodes/events.dm b/code/game/gamemodes/events.dm index c59543d492a..9a7f1e7d0a2 100644 --- a/code/game/gamemodes/events.dm +++ b/code/game/gamemodes/events.dm @@ -13,7 +13,7 @@ /proc/event() event = 1 - switch(pick(1,2,4,5,6,7,8,9,10,11)) + switch(rand(1,11)) if(1) command_alert("Meteors have been detected on collision course with the station.", "Meteor Alert") world << sound('meteors.ogg') @@ -31,7 +31,7 @@ var/obj/bhole/bh = new /obj/bhole( T.loc, 30 ) spawn(rand(50, 300)) del(bh) - + /* if(3) //Leaving the code in so someone can try and delag it, but this event can no longer occur randomly, per SoS's request. --NEO command_alert("Space-time anomalies detected on the station. There is no additional data.", "Anomaly Alert") world << sound('spanomalies.ogg') @@ -53,6 +53,10 @@ P.name = "wormhole" spawn(rand(300,600)) del(P) + */ + if(3) + if((world.time/10)>=3600&&toggle_space_ninja&&!sent_ninja_to_station)//If an hour has passed, relatively speaking. Also, if ninjas are allowed to spawn and if there is not already a ninja for the round. + space_ninja_arrival()//Handled in space_ninja.dm. Doesn't announce arrival, all sneaky-like. if(4) command_alert("Confirmed anomaly type SPC-MGM-152 aboard [station_name()]. All personnel must destroy the anomaly.", "Anomaly Alert") world << sound('outbreak5.ogg') diff --git a/code/game/gamemodes/extra/ninja_abilities.dm b/code/game/gamemodes/events/ninja_abilities.dm similarity index 97% rename from code/game/gamemodes/extra/ninja_abilities.dm rename to code/game/gamemodes/events/ninja_abilities.dm index c9d2f217004..374e1f4cf37 100644 --- a/code/game/gamemodes/extra/ninja_abilities.dm +++ b/code/game/gamemodes/events/ninja_abilities.dm @@ -282,7 +282,6 @@ Movement impairing would indicate drugs and the like.*/ s_coold = 3 return - /* =================================================================================== <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> diff --git a/code/game/gamemodes/extra/ninja_equipment.dm b/code/game/gamemodes/events/ninja_equipment.dm similarity index 96% rename from code/game/gamemodes/extra/ninja_equipment.dm rename to code/game/gamemodes/events/ninja_equipment.dm index 50da908d0a1..eb86421c09c 100644 --- a/code/game/gamemodes/extra/ninja_equipment.dm +++ b/code/game/gamemodes/events/ninja_equipment.dm @@ -240,10 +240,8 @@ ________________________________________________________________________________ var/display_to = s_control ? U : A//Who do we want to display certain messages to? var/dat = "SpiderOS" - if(spideros==0) - dat += " Refresh" - else - dat += " Refresh" + dat += " Refresh" + if(spideros) dat += " | Return" dat += " | Close" dat += "
" @@ -413,16 +411,16 @@ ________________________________________________________________________________ dat += "Stored AI: [A.name]
" dat += "System integrity: [(A.health+100)/2]%
" + //I personally think this makes things a little more fun. Ninjas can override all but law 0. + //if (A.laws.zeroth) + // laws += "
  • 0: [A.laws.zeroth]
  • " + for (var/index = 1, index <= A.laws.ion.len, index++) var/law = A.laws.ion[index] if (length(law) > 0) var/num = ionnum() laws += "
  • [num]. [law]
  • " - //I personally think this makes things a little more fun. Ninjas can override all but law 0. - //if (A.laws.zeroth) - // laws += "
  • 0: [A.laws.zeroth]
  • " - var/number = 1 for (var/index = 1, index <= A.laws.inherent.len, index++) var/law = A.laws.inherent[index] @@ -462,7 +460,7 @@ ________________________________________________________________________________ if(t_disk) dat += "Eject Disk
    " dat += "