From 9741799733963c69c0ca769792ad715a80a5898f Mon Sep 17 00:00:00 2001 From: ZomgPonies Date: Tue, 27 May 2014 10:35:09 -0400 Subject: [PATCH] More work on nations, got most of the flag procs ready. Really missing the vassalage system. --- baystation12.dme | 1 + code/game/gamemodes/nations/flagprocs.dm | 108 ++++++++++++++++++++ code/game/gamemodes/nations/nationdatums.dm | 56 ---------- code/game/gamemodes/nations/nations.dm | 71 +++++-------- code/modules/food/cereal_maker.dm | 3 + code/modules/food/deep_fryer.dm | 3 + 6 files changed, 142 insertions(+), 100 deletions(-) create mode 100644 code/game/gamemodes/nations/flagprocs.dm diff --git a/baystation12.dme b/baystation12.dme index fb0c401635a..5ba4d8d2c57 100644 --- a/baystation12.dme +++ b/baystation12.dme @@ -289,6 +289,7 @@ #include "code\game\gamemodes\mutiny\directives\research_to_ripleys_directive.dm" #include "code\game\gamemodes\mutiny\directives\tau_ceti_needs_women_directive.dm" #include "code\game\gamemodes\mutiny\directives\terminations_directive.dm" +#include "code\game\gamemodes\nations\flagprocs.dm" #include "code\game\gamemodes\nations\nationdatums.dm" #include "code\game\gamemodes\nations\nations.dm" #include "code\game\gamemodes\ninja\ninja.dm" diff --git a/code/game/gamemodes/nations/flagprocs.dm b/code/game/gamemodes/nations/flagprocs.dm new file mode 100644 index 00000000000..b8e27a5b9b7 --- /dev/null +++ b/code/game/gamemodes/nations/flagprocs.dm @@ -0,0 +1,108 @@ +/obj/item/flag/nation + density = 1 + anchored = 1 + var/turf/startloc = null + var/captured = 0 + +/obj/item/flag/nation/New() + ..() + flag_list += src + +/obj/item/flag/nation/fire_act() + return + +/obj/item/flag/nation/Ignite() + return + +/obj/item/flag/nation/light() + return + +/obj/item/flag/nation/attackby(var/obj/item/weapon/W, var/mob/user) + return + +/obj/item/flag/nation/attack_paw() + return + +/obj/item/flag/nation/ex_act() + return + +/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(loc != startloc) + loc = startloc + user.visible_message("[user] sends [src] back to base!", "You return [src] to your base!") + return + else + user << "You can't move your flag from it's home location!" + return + else + var/obj/item/flag/nation/F = locate(user.mind.nation.flagpath) + if(captured && Adjacent(F.startloc)) + user << "This flag has already been captured by your team!" + return + else + captured = 0 + anchored = 0 + ..() + else + user << "You are not part of a nation and therefore cannot pick up any flags!" + return + return + +/obj/item/flag/nation/dropped(mob/user as mob) + ..() + spawn(20) + anchored = 1 + var/obj/item/flag/nation/F = locate(user.mind.nation.flagpath) + if(F.loc == F.startloc && Adjacent(F.startloc)) + captured = 1 + //Announce capture/vassalage here. + // + //Check for Victory + for(var/obj/item/flag/nation/N in flag_list) + if(N == F) + continue + if(N.captured && N.Adjacent(F)) + continue + else + break + //announceVictory() + + + + +//Nations/Department flags --Nations Gamemode Specific +/obj/item/flag/nation/cargo + name = "Cargonia flag" + desc = "The flag of the independant, sovereign nation of Cargonia." + icon_state = "cargoflag" + +/obj/item/flag/nation/med + name = "Medistan flag" + desc = "The flag of the independant, sovereign nation of Medistan." + icon_state = "medflag" + +/obj/item/flag/nation/sec + name = "Brigston flag" + desc = "The flag of the independant, sovereign nation of Brigston." + icon_state = "secflag" + +/obj/item/flag/nation/rnd + name = "Scientopia flag" + desc = "The flag of the independant, sovereign nation of Scientopia." + icon_state = "rndflag" + +/obj/item/flag/nation/atmos + name = "Atmosia flag" + desc = "The flag of the independant, sovereign nation of Atmosia." + icon_state = "atmosflag" + +/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 diff --git a/code/game/gamemodes/nations/nationdatums.dm b/code/game/gamemodes/nations/nationdatums.dm index 1f9b54b2a74..1da1accd5c4 100644 --- a/code/game/gamemodes/nations/nationdatums.dm +++ b/code/game/gamemodes/nations/nationdatums.dm @@ -34,59 +34,3 @@ - -//Nations/Department flags --Nations Gamemode Specific -/obj/item/flag/nation - density = 1 - anchored = 1 - var/turf/startloc = null - -/obj/item/flag/nation/New() - ..() - flag_list += src - -/obj/item/flag/nation/fire_act() - return - -/obj/item/flag/nation/Ignite() - return - -/obj/item/flag/nation/light() - return - - - -/obj/item/flag/nation/attackby(var/obj/item/weapon/W, var/mob/user) - - - - -/obj/item/flag/nation/cargo - name = "Cargonia flag" - desc = "The flag of the independant, sovereign nation of Cargonia." - icon_state = "cargoflag" - -/obj/item/flag/nation/med - name = "Medistan flag" - desc = "The flag of the independant, sovereign nation of Medistan." - icon_state = "medflag" - -/obj/item/flag/nation/sec - name = "Brigston flag" - desc = "The flag of the independant, sovereign nation of Brigston." - icon_state = "secflag" - -/obj/item/flag/nation/rnd - name = "Scientopia flag" - desc = "The flag of the independant, sovereign nation of Scientopia." - icon_state = "rndflag" - -/obj/item/flag/nation/atmos - name = "Atmosia flag" - desc = "The flag of the independant, sovereign nation of Atmosia." - icon_state = "atmosflag" - -/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 diff --git a/code/game/gamemodes/nations/nations.dm b/code/game/gamemodes/nations/nations.dm index dc01ef6b61e..4e707e65b1f 100644 --- a/code/game/gamemodes/nations/nations.dm +++ b/code/game/gamemodes/nations/nations.dm @@ -125,14 +125,28 @@ datum/game_mode/nations /mob/proc/respawn_self() set category = "OOC" set name = "Respawn Character" - set desc = "Respawn yourself (10 minute cooldown)." + set desc = "Respawn yourself (15 minute cooldown)." - if ((stat != 2 || !( ticker ))) - usr << "\blue You must be dead to use this!" + if (!( ticker )) + usr << "\blue The round hasn't started!" return if (ticker.mode.name != "nations") usr << "\blue Respawn is disabled." return + if(!mind) + return + if(!mind.nation) + src << "It appears you're not part of a nation. Use Respawn as NPC instead." + return + if(!mind.assigned_role) + src << "It appears you're not part of a nation. Use Respawn as NPC instead." + return + if(!mind.assigned_role in get_all_jobs()) + src << "It appears you're not part of a nation. Use Respawn as NPC instead." + return + if(mind.special_role) + src << "It appears you beame an antag and are longer part of a nation. Use Respawn as NPC instead." + return else var/deathtime = world.time - src.timeofdeath var/deathtimeminutes = round(deathtime / 600) @@ -145,36 +159,19 @@ datum/game_mode/nations pluralcheck = " [deathtimeminutes] minutes and" var/deathtimeseconds = round((deathtime - deathtimeminutes * 600) / 10,1) usr << "You have been dead for[pluralcheck] [deathtimeseconds] seconds." - if (deathtime < 6000) + if (deathtime < 9000) usr << "You must wait 10 minutes to respawn!" return else - var/mob/G_found = src - - if(!G_found)//If a ghost was not found. - return - - if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something - //Check if they were an alien - if(G_found.mind.assigned_role=="Alien") - usr << "As an Alien, you're no longer part of a nation. Use Respawn as NPC instead." - return - - //check if they were a monkey - else if(findtext(G_found.real_name,"monkey")) - usr << "As a monkey, you're no longer part of a nation. Use Respawn as NPC instead." - return - - //Ok, it's not a xeno or a monkey. So, spawn a human. var/mob/living/carbon/human/new_character = new(pick(latejoin))//The mob being spawned. var/datum/data/record/record_found //Referenced to later to either randomize or not randomize the character. - if(G_found.mind && !G_found.mind.active) //mind isn't currently in use by someone/something + if(mind && !mind.active) //mind isn't currently in use by someone/something /*Try and locate a record for the person being respawned through data_core. This isn't an exact science but it does the trick more often than not.*/ - var/id = md5("[G_found.real_name][G_found.mind.assigned_role]") + var/id = md5("[real_name][mind.assigned_role]") for(var/datum/data/record/t in data_core.locked) if(t.fields["id"]==id) record_found = t//We shall now reference the record. @@ -189,7 +186,7 @@ datum/game_mode/nations new_character.gender = pick(MALE,FEMALE) var/datum/preferences/A = new() A.randomize_appearance_for(new_character) - new_character.real_name = G_found.real_name + new_character.real_name = real_name if(!new_character.real_name) if(new_character.gender == MALE) @@ -198,8 +195,8 @@ datum/game_mode/nations new_character.real_name = capitalize(pick(first_names_female)) + " " + capitalize(pick(last_names)) new_character.name = new_character.real_name - if(G_found.mind && !G_found.mind.active) - G_found.mind.transfer_to(new_character) //be careful when doing stuff like this! I've already checked the mind isn't in use + if(mind && !mind.active) + mind.transfer_to(new_character) //be careful when doing stuff like this! I've already checked the mind isn't in use new_character.mind.special_verbs = list() else new_character.mind_initialize() @@ -219,26 +216,12 @@ datum/game_mode/nations else//If they have no records, we just do a random DNA for them, based on their random appearance/savefile. new_character.dna.ready_dna(new_character) - new_character.key = G_found.key + new_character.key = key + job_master.EquipRank(new_character, new_character.mind.assigned_role, 1)//Or we simply equip them. - //Now for special roles and equipment. - if(new_character.mind.special_role) - usr << "It appears you're no longer part of a nation. Use Respawn as NPC instead." - return - else//They may also be a cyborg or AI. - switch(new_character.mind.assigned_role) - if("Cyborg")//More rigging to make em' work and check if they're traitor. - usr << "It appears you're not part of a nation. Use Respawn as NPC instead." - return - if("AI") - usr << "It appears you're not part of a nation. Use Respawn as NPC instead." - return - else - job_master.EquipRank(new_character, new_character.mind.assigned_role, 1)//Or we simply equip them. - - if(!record_found)//If there are no records for them. If they have a record, this info is already in there. MODE people are not announced anyway. - data_core.manifest_inject(new_character) + if(!record_found)//If there are no records for them. If they have a record, this info is already in there. MODE people are not announced anyway. + 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 diff --git a/code/modules/food/cereal_maker.dm b/code/modules/food/cereal_maker.dm index 287fd1b65e8..95f7fd25ea3 100644 --- a/code/modules/food/cereal_maker.dm +++ b/code/modules/food/cereal_maker.dm @@ -23,6 +23,9 @@ if(istype(I, /obj/item/weapon/disk/nuclear)) user << "Central command would kill you if you made nuke disk cereal." return + if(istype(I, /obj/item/flag)) + user << "That isn't going to fit." + return else user << "You put [I] into [src]." on = TRUE diff --git a/code/modules/food/deep_fryer.dm b/code/modules/food/deep_fryer.dm index 0d98e876328..7e31f0b5282 100644 --- a/code/modules/food/deep_fryer.dm +++ b/code/modules/food/deep_fryer.dm @@ -32,6 +32,9 @@ if(istype(I, /obj/item/weapon/disk/nuclear)) user << "Central command would kill you if you deep fried that." return + if(istype(I, /obj/item/flag)) + user << "That isn't going to fit." + return else user << "You put [I] into [src]." on = TRUE