diff --git a/code/controllers/hooks-defs.dm b/code/controllers/hooks-defs.dm index 54aaf48626f..973da27ee48 100644 --- a/code/controllers/hooks-defs.dm +++ b/code/controllers/hooks-defs.dm @@ -19,7 +19,7 @@ /** * LateSpawn hook. * Called in newplayer.dm when a humanoid character joins the round after it started. - * Parameters: var/mob/living/carbon/human, var/rank + * Parameters: var/mob/living/carbon/human */ /hook/latespawn diff --git a/code/datums/helper_datums/teleport.dm b/code/datums/helper_datums/teleport.dm index cb67c3f5f17..21971d6cd27 100644 --- a/code/datums/helper_datums/teleport.dm +++ b/code/datums/helper_datums/teleport.dm @@ -162,6 +162,11 @@ teleatom.visible_message("\red The [teleatom] bounces off of the portal!") return 0 + if(istype(teleatom, /obj/item/flag/nation)) // Don't let nuke disks get teleported --NeoFite + teleatom.visible_message("\red The [teleatom] bounces off of the portal!") + return 0 + + if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/disk/nuclear))) if(istype(teleatom, /mob/living)) var/mob/living/MM = teleatom @@ -170,6 +175,14 @@ teleatom.visible_message("\red The [teleatom] bounces off of the portal!") return 0 + if(!isemptylist(teleatom.search_contents_for(/obj/item/flag/nation))) + if(istype(teleatom, /mob/living)) + var/mob/living/MM = teleatom + MM.visible_message("\red The [MM] bounces off of the portal!","\red Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through.") + else + teleatom.visible_message("\red The [teleatom] bounces off of the portal!") + return 0 + if(destination.z == 2) //centcomm z-level if(istype(teleatom, /obj/mecha)) var/obj/mecha/MM = teleatom diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index 0ca28e70165..cb68423a579 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -92,6 +92,9 @@ Implants; return 1 return 0 +//pre_pre_setup() For when you really don't want certain jobs ingame. +/datum/game_mode/proc/pre_pre_setup() + return 1 ///pre_setup() ///Attempts to select players for special roles the mode might have. diff --git a/code/game/gamemodes/gameticker.dm b/code/game/gamemodes/gameticker.dm index 571559b1c0b..b67e3d76681 100644 --- a/code/game/gamemodes/gameticker.dm +++ b/code/game/gamemodes/gameticker.dm @@ -103,6 +103,7 @@ var/global/datum/controller/gameticker/ticker return 0 //Configure mode and assign player to special mode stuff + src.mode.pre_pre_setup() job_master.DivideOccupations() //Distribute jobs var/can_continue = src.mode.pre_setup()//Setup special modes if(!can_continue) @@ -140,7 +141,7 @@ var/global/datum/controller/gameticker/ticker //Deleting Startpoints but we need the ai point to AI-ize people later if (S.name != "AI") del(S) - + // take care of random spesspod spawning var/list/obj/effect/landmark/spacepod/random/L = list() for(var/obj/effect/landmark/spacepod/random/SS in landmarks_list) @@ -151,7 +152,7 @@ var/global/datum/controller/gameticker/ticker new /obj/spacepod/random(S.loc) for(var/obj/effect/landmark/spacepod/random/R in L) del(R) - + world << "Enjoy the game!" world << sound('sound/AI/welcome.ogg') // Skie //Holiday Round-start stuff ~Carn diff --git a/code/game/gamemodes/nations/flagprocs.dm b/code/game/gamemodes/nations/flagprocs.dm index b8e27a5b9b7..eb4e204d9a1 100644 --- a/code/game/gamemodes/nations/flagprocs.dm +++ b/code/game/gamemodes/nations/flagprocs.dm @@ -3,6 +3,9 @@ anchored = 1 var/turf/startloc = null var/captured = 0 + var/list/vassals = list() + var/datum/nations/liege = null + var/datum/nations/nation = null /obj/item/flag/nation/New() ..() @@ -29,10 +32,11 @@ /obj/item/flag/nation/blob_act() return + /obj/item/flag/nation/attack_hand(mob/user as mob) if(user.mind) if(user.mind.nation) - if(user.mind.nation.flagpath == type) //Same team as flag + if(user.mind.nation == nation) //Same team as flag if(loc != startloc) loc = startloc user.visible_message("[user] sends [src] back to base!", "You return [src] to your base!") @@ -45,10 +49,22 @@ if(captured && Adjacent(F.startloc)) user << "This flag has already been captured by your team!" return - else + if(liege == F.liege) + user << "You can't steal your liege's flags!" + return + else if(..()) captured = 0 anchored = 0 - ..() + var/obj/item/flag/nation/N = locate(liege.flagpath) + for(var/mob/living/carbon/human/H in player_list) + if(H.mind && H.mind.nation) + if(H.mind.nation == liege) + H << "You are no longer the liege of [nation.name]!" + if(H.mind.nation == nation) + H << "You are no longer vassals of [liege.name]!" + + N.vassals -= nation + liege = null else user << "You are not part of a nation and therefore cannot pick up any flags!" return @@ -61,18 +77,26 @@ var/obj/item/flag/nation/F = locate(user.mind.nation.flagpath) if(F.loc == F.startloc && Adjacent(F.startloc)) captured = 1 + liege = F.nation + F.vassals += nation //Announce capture/vassalage here. - // + for(var/mob/living/carbon/human/H in player_list) + if(H.mind && H.mind.nation) + if(H.mind.nation == F.nation) + H << "You have just vassalized [nation.name]! They must now obey any memebrs of your nation!" + continue + else if(H.mind.nation == nation) + H << "You are now vassals of [liege.name]! You must now obey the orders of any of their members!" + continue //Check for Victory for(var/obj/item/flag/nation/N in flag_list) if(N == F) continue - if(N.captured && N.Adjacent(F)) + if(N.captured && (N.liege == F.nation) && N.Adjacent(F)) continue else - break - //announceVictory() - + return + ticker.mode.declare_completion(F.nation) @@ -81,28 +105,34 @@ name = "Cargonia flag" desc = "The flag of the independant, sovereign nation of Cargonia." icon_state = "cargoflag" + nation = /datum/nations/cargonia /obj/item/flag/nation/med name = "Medistan flag" desc = "The flag of the independant, sovereign nation of Medistan." icon_state = "medflag" + nation = /datum/nations/medistan /obj/item/flag/nation/sec name = "Brigston flag" desc = "The flag of the independant, sovereign nation of Brigston." icon_state = "secflag" + nation = /datum/nations/brigston /obj/item/flag/nation/rnd name = "Scientopia flag" desc = "The flag of the independant, sovereign nation of Scientopia." icon_state = "rndflag" + nation = /datum/nations/scientopia /obj/item/flag/nation/atmos name = "Atmosia flag" desc = "The flag of the independant, sovereign nation of Atmosia." icon_state = "atmosflag" + nation = /datum/nations/atmosia /obj/item/flag/nation/command name = "Command flag" desc = "The flag of the independant, sovereign nation of Command." - icon_state = "ntflag" \ No newline at end of file + icon_state = "ntflag" + nation = /datum/nations/command \ No newline at end of file diff --git a/code/game/gamemodes/nations/nationdatums.dm b/code/game/gamemodes/nations/nationdatums.dm index 1da1accd5c4..78837e3e68e 100644 --- a/code/game/gamemodes/nations/nationdatums.dm +++ b/code/game/gamemodes/nations/nationdatums.dm @@ -2,7 +2,6 @@ var/name var/flagpath - /datum/nations/atmosia name = "Atmosia" flagpath = /obj/item/flag/nation/atmos @@ -29,8 +28,3 @@ - - - - - diff --git a/code/game/gamemodes/nations/nations.dm b/code/game/gamemodes/nations/nations.dm index 4e707e65b1f..932c058e527 100644 --- a/code/game/gamemodes/nations/nations.dm +++ b/code/game/gamemodes/nations/nations.dm @@ -1,3 +1,4 @@ +var/global/no_synthetic = 0 datum/game_mode/nations name = "nations" @@ -5,11 +6,11 @@ datum/game_mode/nations required_players_secret = 25 var/const/waittime_l = 3000 //lower bound on time before intercept arrives (in tenths of seconds) var/const/waittime_h = 6000 //upper bound on time before intercept arrives (in tenths of seconds) - + var/victory = 0 var/list/cargonians = list("Quartermaster","Cargo Technician","Shaft Miner") - - +/datum/game_mode/nations/pre_pre_setup() + no_synthetic = 1 /datum/game_mode/nations/post_setup() spawn (rand(waittime_l, waittime_h)) @@ -56,39 +57,46 @@ datum/game_mode/nations for(var/mob/living/carbon/human/H in player_list) if(H.mind) if(H.mind.assigned_role in engineering_positions) - H.mind.nation = "Atmosia" + H.mind.nation = all_nations["Atmosia"] H.verbs += /mob/proc/respawn_self H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" continue else if(H.mind.assigned_role in medical_positions) - H.mind.nation = "Medistan" + H.mind.nation = all_nations["Medistan"] H.verbs += /mob/proc/respawn_self H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" continue else if(H.mind.assigned_role in science_positions) - H.mind.nation = "Scientopia" + H.mind.nation = all_nations["Scientopia"] H.verbs += /mob/proc/respawn_self H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" continue else if(H.mind.assigned_role in security_positions) - H.mind.nation = "Brigston" + H.mind.nation = all_nations["Brigston"] H.verbs += /mob/proc/respawn_self H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" continue else if(H.mind.assigned_role in cargonians) - H.mind.nation = "Cargonia" + H.mind.nation = all_nations["Cargonia"] H.verbs += /mob/proc/respawn_self H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" continue else if(H.mind.assigned_role in civilian_positions) - H.mind.nation = "Command" + H.mind.nation = all_nations["Command"] H.verbs += /mob/proc/respawn_self H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" continue else if(H.mind.assigned_role == "Captain") - H.mind.nation = "Command" + H.mind.nation = all_nations["Command"] H.verbs += /mob/proc/respawn_self H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" continue else message_admins("[H.name] with [H.mind.assigned_role] could not find any nation to assign!") @@ -122,6 +130,15 @@ datum/game_mode/nations S.startloc = get_turf(N) continue +/datum/game_mode/nations/check_finished() + if(victory) + return 1 + return 0 + +/datum/game_mode/nations/declare_completion(var/datum/nations/N) + world << "[N.name] has captured all of the station. All glory to [N.name]" + victory = 1 + /mob/proc/respawn_self() set category = "OOC" set name = "Respawn Character" @@ -224,4 +241,60 @@ datum/game_mode/nations data_core.manifest_inject(new_character) new_character << "You have been fully respawned. Get back in the fight!." - return new_character \ No newline at end of file + return new_character + + + +/** + * LateSpawn hook. + * Called in newplayer.dm when a humanoid character joins the round after it started. + * Parameters: var/mob/living/carbon/human, var/rank + */ +/hook/latespawn/proc/give_latejoiners_nations(var/mob/living/carbon/human/H) + var/list/cargonians = list("Quartermaster","Cargo Technician","Shaft Miner") + if(H.mind) + if(H.mind.assigned_role in engineering_positions) + H.mind.nation = all_nations["Atmosia"] + H.verbs += /mob/proc/respawn_self + H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + return + else if(H.mind.assigned_role in medical_positions) + H.mind.nation = all_nations["Medistan"] + H.verbs += /mob/proc/respawn_self + H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + return + else if(H.mind.assigned_role in science_positions) + H.mind.nation = all_nations["Scientopia"] + H.verbs += /mob/proc/respawn_self + H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + return + else if(H.mind.assigned_role in security_positions) + H.mind.nation = all_nations["Brigston"] + H.verbs += /mob/proc/respawn_self + H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + return + else if(H.mind.assigned_role in cargonians) + H.mind.nation = all_nations["Cargonia"] + H.verbs += /mob/proc/respawn_self + H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + return + else if(H.mind.assigned_role in civilian_positions) + H.mind.nation = all_nations["Command"] + H.verbs += /mob/proc/respawn_self + H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + return + else if(H.mind.assigned_role == "Captain") + H.mind.nation = all_nations["Command"] + H.verbs += /mob/proc/respawn_self + H.verbs -= /mob/living/verb/ghost + H << "You are now part of the great sovereign nation of [H.mind.nation.name]!" + return + else + message_admins("[H.name] with [H.mind.assigned_role] could not find any nation to assign!") + return \ No newline at end of file diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index c4f6e3c14ac..26bdc2d1be2 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -14,16 +14,19 @@ var/global/datum/controller/occupations/job_master proc/SetupOccupations(var/faction = "Station") - occupations = list() - var/list/all_jobs = typesof(/datum/job) - if(!all_jobs.len) - world << "\red \b Error setting up jobs, no job datums found" - return 0 - for(var/J in all_jobs) - var/datum/job/job = new J() - if(!job) continue - if(job.faction != faction) continue - occupations += job + if(no_synthetic) + occupations = joblist + else + occupations = list() + var/list/all_jobs = typesof(/datum/job) + if(!all_jobs.len) + world << "\red \b Error setting up jobs, no job datums found" + return 0 + for(var/J in all_jobs) + var/datum/job/job = new J() + if(!job) continue + if(job.faction != faction) continue + occupations += job return 1 diff --git a/code/game/machinery/recycler.dm b/code/game/machinery/recycler.dm index dc41d96860c..27e46c668b5 100644 --- a/code/game/machinery/recycler.dm +++ b/code/game/machinery/recycler.dm @@ -90,7 +90,7 @@ var/const/SAFETY_COOLDOWN = 100 /obj/machinery/recycler/proc/recycle(var/obj/item/I, var/sound = 1) I.loc = src.loc - if(!istype(I, /obj/item/weapon/disk/nuclear)) + if(!istype(I, /obj/item/weapon/disk/nuclear) && !istype(I,/obj/item/flag/nation)) del(I) if(prob(15)) new /obj/item/stack/sheet/metal(loc) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 75ad250491a..927cc0b11a2 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -134,14 +134,14 @@ return /obj/item/attack_hand(mob/user as mob) - if (!user) return + if (!user) return 0 if (hasorgans(user)) var/datum/organ/external/temp = user:organs_by_name["r_hand"] if (user.hand) temp = user:organs_by_name["l_hand"] if(temp && !temp.is_usable()) user << "You try to move your [temp.display_name], but cannot!" - return + return 0 if (istype(src.loc, /obj/item/weapon/storage)) //If the item is in a storage item, take it out @@ -152,17 +152,17 @@ if (src.loc == user) //canremove==0 means that object may not be removed. You can still wear it. This only applies to clothing. /N if(!src.canremove) - return + return 0 else user.u_equip(src) else if(isliving(src.loc)) - return + return 0 user.next_move = max(user.next_move+2,world.time + 2) src.pickup(user) add_fingerprint(user) user.put_in_active_hand(src) - return + return 1 /obj/item/attack_paw(mob/user as mob) diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm index 121cbd3dc94..631927f3ce8 100644 --- a/code/game/objects/items/weapons/storage/bags.dm +++ b/code/game/objects/items/weapons/storage/bags.dm @@ -36,7 +36,7 @@ max_w_class = 2 storage_slots = 21 can_hold = list() // any - cant_hold = list("/obj/item/weapon/disk/nuclear") + cant_hold = list("/obj/item/weapon/disk/nuclear","/obj/item/flag/nation") /obj/item/weapon/storage/bag/trash/update_icon() if(contents.len == 0) @@ -63,7 +63,7 @@ max_w_class = 2 storage_slots = 21 can_hold = list() // any - cant_hold = list("/obj/item/weapon/disk/nuclear") + cant_hold = list("/obj/item/weapon/disk/nuclear","/obj/item/flag/nation") // ----------------------------- // Mining Satchel diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm index 991c4bb873f..d574d22f859 100644 --- a/code/game/objects/structures/morgue.dm +++ b/code/game/objects/structures/morgue.dm @@ -322,7 +322,9 @@ if(!isemptylist(src.search_contents_for(/obj/item/weapon/disk/nuclear))) usr << "You get the feeling that you shouldn't cremate one of the items in the cremator." return - + if(!isemptylist(src.search_contents_for(/obj/item/flag/nation))) + usr << "You get the feeling that you shouldn't cremate one of the items in the cremator." + return for (var/mob/M in viewers(src)) M.show_message("\red You hear a roar as the crematorium activates.", 1) diff --git a/code/game/supplyshuttle.dm b/code/game/supplyshuttle.dm index cbc7bee50ea..8d1d009e54f 100644 --- a/code/game/supplyshuttle.dm +++ b/code/game/supplyshuttle.dm @@ -216,6 +216,8 @@ var/list/mechtoys = list( return 1 if(istype(A,/obj/item/weapon/disk/nuclear)) return 1 + if(istype(A,/obj/item/flag/nation)) + return 1 if(istype(A,/obj/machinery/nuclearbomb)) return 1 if(istype(A,/obj/item/device/radio/beacon)) diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm index 8d929eb6510..7d09fa4ad6a 100644 --- a/code/game/turfs/space/space.dm +++ b/code/game/turfs/space/space.dm @@ -93,9 +93,17 @@ if(istype(A, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks travel Z levels ... And moving this shit down here so it only fires when they're actually trying to change z-level. del(A) //The disk's Destroy() proc ensures a new one is created return - + if(istype(A, /obj/item/flag/nation)) // Don't letflags travel Z levels ... And moving this shit down here so it only fires when they're actually trying to change z-level. + var/obj/item/flag/nation/N = A + N.loc = N.startloc //The flag returns to base. + return var/mob/living/MM = null var/fukkendisk = A.GetTypeInAllContents(/obj/item/weapon/disk/nuclear) + var/obj/item/flag/nation/fukkenflag = A.GetTypeInAllContents(/obj/item/flag/nation) + if(fukkenflag) + fukkenflag.loc = fukkenflag.startloc + if(isliving(A)) + A << "The flag you were carrying was just returned to it's base. Nice try." if(fukkendisk) if(isliving(A)) MM = A @@ -115,6 +123,7 @@ qdel(fukkendisk)//Make the disk respawn if it is floating on its own return + //Check if it's a mob pulling an object. Have the object transition with the mob if it's not the nuke disk var/obj/was_pulling = null if(isliving(A)) @@ -125,7 +134,13 @@ qdel(MM.pulling) else was_pulling = MM.pulling + fukkenflag = null fukkendisk = was_pulling.GetTypeInAllContents(/obj/item/weapon/disk/nuclear) + fukkenflag = was_pulling.GetTypeInAllContents(/obj/item/flag/nation) + if(fukkenflag) + fukkenflag.loc = fukkenflag.startloc + if(isliving(A)) + A << "The flag you were carrying was just returned to it's base. Nice try." if(fukkendisk) MM << "You think you saw something slip out of [was_pulling], but you couldn't tell where it went..." qdel(fukkendisk) diff --git a/code/modules/food/customizables.dm b/code/modules/food/customizables.dm index 786719eeb32..69f63f33d15 100644 --- a/code/modules/food/customizables.dm +++ b/code/modules/food/customizables.dm @@ -301,6 +301,10 @@ if(istype(I, /obj/item/weapon/disk/nuclear)) user << "You think about it for a few seconds, then you realize Central Command likely doesn't find nuke disk sandwiches very funny, and so you decide not to turn the nuke disk into a foodstuff." return + if(istype(I, /obj/item/flag/nation)) + user << "That's not going to fit!" + return + else user << " You add [I] to [src]." if(istype(I, /obj/item/weapon/reagent_containers/)) diff --git a/code/modules/mob/new_player/new_player.dm b/code/modules/mob/new_player/new_player.dm index 124ab184686..9b28f2071e8 100644 --- a/code/modules/mob/new_player/new_player.dm +++ b/code/modules/mob/new_player/new_player.dm @@ -318,7 +318,7 @@ data_core.manifest_inject(character) ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn AnnounceArrival(character, rank) - callHook("latespawn", list(character, rank)) + callHook("latespawn", list(character)) else character.Robotize() del(src)