Merge pull request #2702 from ZomgPonies/nations221

Nations 2.2.1
This commit is contained in:
TheDZD
2015-12-01 15:03:35 -05:00
2 changed files with 82 additions and 71 deletions
+10 -7
View File
@@ -13,12 +13,13 @@ datum/game_mode/nations
kickoff=1
send_intercept()
split_teams()
assign_leaders()
set_ai()
assign_leaders()
// remove_access()
for(var/mob/M in player_list)
if(!istype(M,/mob/new_player))
M << sound('sound/effects/purge_siren.ogg')
return ..()
/datum/game_mode/nations/proc/send_intercept()
@@ -172,16 +173,18 @@ datum/game_mode/nations
/datum/game_mode/nations/proc/assign_leaders()
for(var/datum/nations/N in all_nations)
for(var/name in all_nations)
var/datum/nations/N = all_nations[name]
if(!N.current_name)
N.current_name = N.default_name
if(!N.current_leader)
if(!N.current_leader && N.membership.len)
N.current_leader = pick(N.membership)
N.current_leader << "You have been chosen to lead the nation of [N.current_name]!"
var/mob/living/carbon/human/H = N.current_leader
H.verbs += /datum/game_mode/nations/proc/set_nation_name
H.verbs += /datum/game_mode/nations/proc/set_ranks
H.verbs += /datum/game_mode/nations/proc/choose_heir
if(N.current_leader)
var/mob/living/carbon/human/H = N.current_leader
H.verbs += /mob/living/carbon/human/proc/set_nation_name
H.verbs += /mob/living/carbon/human/proc/set_ranks
H.verbs += /mob/living/carbon/human/proc/choose_heir
N.update_nation_id()
/**
+72 -64
View File
@@ -1,94 +1,102 @@
/datum/game_mode/nations/proc/set_nation_name()
/mob/living/carbon/human/proc/set_nation_name()
set name = "Rename Nation"
set category = "Nations"
set desc = "Click to rename your nation. You are only able to do this once."
if(!kickoff) return 1
var/datum/game_mode/nations/mode = get_nations_mode()
if (!mode) return 1
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
if(H.mind && H.mind.nation && H.mind.nation.current_leader == H)
var/input = stripped_input(H,"What do you want to name your nation?", ,"", MAX_NAME_LEN)
if(!mode.kickoff) return 1
if(input)
H.mind.nation.current_name = input
H.mind.nation.update_nation_id()
H << "You rename your nation to [input]."
H.verbs -= /datum/game_mode/nations/proc/set_nation_name
return 1
var/mob/living/carbon/human/H = src
if(H.mind && H.mind.nation && H.mind.nation.current_leader == H)
var/input = stripped_input(H,"What do you want to name your nation?", ,"", MAX_NAME_LEN)
if(input)
H.mind.nation.current_name = input
H.mind.nation.update_nation_id()
H << "You rename your nation to [input]."
H.verbs -= /mob/living/carbon/human/proc/set_nation_name
return 1
/datum/game_mode/nations/proc/set_ranks()
/mob/living/carbon/human/proc/set_ranks()
set name = "Set Ranks"
set category = "Nations"
set desc = "Click to set a rank for Leaders and Members."
if(!kickoff) return 1
var/datum/game_mode/nations/mode = get_nations_mode()
if (!mode) return 1
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
if(H.mind && H.mind.nation && H.mind.nation.current_leader == H)
var/type = input(H, "What rank do you want to change?", "Rename Rank", "") in list("Leader","Member")
var/input = stripped_input(H,"What rank do you want?", ,"", MAX_NAME_LEN)
if(input)
if(type == "Leader")
H.mind.nation.leader_rank = input
H.mind.nation.update_nation_id()
if(!mode.kickoff) return 1
if(type == "Member")
H.mind.nation.member_rank = input
H.mind.nation.update_nation_id()
H << "You changed the [type] rank of your nation to [input]."
return 1
var/mob/living/carbon/human/H = src
if(H.mind && H.mind.nation && H.mind.nation.current_leader == H)
var/type = input(H, "What rank do you want to change?", "Rename Rank", "") in list("Leader","Member")
var/input = stripped_input(H,"What rank do you want?", ,"", MAX_NAME_LEN)
if(input)
if(type == "Leader")
H.mind.nation.leader_rank = input
H.mind.nation.update_nation_id()
/datum/game_mode/nations/proc/choose_heir()
if(type == "Member")
H.mind.nation.member_rank = input
H.mind.nation.update_nation_id()
H << "You changed the [type] rank of your nation to [input]."
return 1
/mob/living/carbon/human/proc/choose_heir()
set name = "Choose Heir"
set category = "Nations"
set desc = "Click to pick a Heir. Note that the Heir has the ability to take over your role at ANY TIME. Choose carefully."
if(!kickoff) return 1
var/datum/game_mode/nations/mode = get_nations_mode()
if (!mode) return 1
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
if(H.mind && H.mind.nation && H.mind.nation.current_leader == H)
var/heir = input(H, "Who do you wish to make your heir?", "Choose Heir", "") as null|anything in H.mind.nation.membership
if(heir)
if(H.mind.nation.heir)
var/mob/living/carbon/human/oldheir = H.mind.nation.heir
oldheir << "You are no longer the heir to your nation!"
oldheir.verbs -= /datum/game_mode/nations/proc/takeover
var/mob/living/carbon/human/newheir = heir
H.mind.nation.heir = newheir
newheir.verbs += /datum/game_mode/nations/proc/takeover
newheir << "You have been selected to be the heir to your nation's leadership!"
H << "You have selected [heir] to be your heir!"
if(!mode.kickoff) return 1
var/mob/living/carbon/human/H = src
if(H.mind && H.mind.nation && H.mind.nation.current_leader == H)
var/heir = input(H, "Who do you wish to make your heir?", "Choose Heir", "") as null|anything in H.mind.nation.membership
if(heir)
if(H.mind.nation.heir)
var/mob/living/carbon/human/oldheir = H.mind.nation.heir
oldheir << "You are no longer the heir to your nation!"
oldheir.verbs -= /mob/living/carbon/human/proc/takeover
var/mob/living/carbon/human/newheir = heir
H.mind.nation.heir = newheir
newheir.verbs += /mob/living/carbon/human/proc/takeover
newheir << "You have been selected to be the heir to your nation's leadership!"
H << "You have selected [heir] to be your heir!"
/datum/game_mode/nations/proc/takeover()
/mob/living/carbon/human/proc/takeover()
set name = "Become Leader"
set category = "Nations"
set desc = "Click to replace your current nation's leader with yourself."
if(!kickoff) return 1
var/datum/game_mode/nations/mode = get_nations_mode()
if (!mode) return 1
if(ishuman(usr))
var/mob/living/carbon/human/H = usr
if(H.mind && H.mind.nation && H.mind.nation.heir == H)
var/confirmation = input(H, "Are you sure you want to take over leadership?", "Become Leader", "") as null|anything in list("Yes", "No")
if(confirmation == "Yes")
var/mob/living/carbon/human/oldleader = H.mind.nation.current_leader
oldleader << "You have been replaced by [H.name] as the leader of [H.mind.nation.current_name]!"
oldleader.verbs -= /datum/game_mode/nations/proc/set_nation_name
oldleader.verbs -= /datum/game_mode/nations/proc/set_ranks
oldleader.verbs -= /datum/game_mode/nations/proc/choose_heir
H.mind.nation.current_leader = H
H.mind.nation.heir = null
H.verbs -= /datum/game_mode/nations/proc/takeover
H.verbs += /datum/game_mode/nations/proc/set_nation_name
H.verbs += /datum/game_mode/nations/proc/set_ranks
H.verbs += /datum/game_mode/nations/proc/choose_heir
H << "You have replaced [oldleader.name] as the leader of [H.mind.nation.current_name]!"
H.mind.nation.update_nation_id()
if(!mode.kickoff) return 1
var/mob/living/carbon/human/H = src
if(H.mind && H.mind.nation && H.mind.nation.heir == H)
var/confirmation = input(H, "Are you sure you want to take over leadership?", "Become Leader", "") as null|anything in list("Yes", "No")
if(confirmation == "Yes")
var/mob/living/carbon/human/oldleader = H.mind.nation.current_leader
oldleader << "You have been replaced by [H.name] as the leader of [H.mind.nation.current_name]!"
oldleader.verbs -= /mob/living/carbon/human/proc/set_nation_name
oldleader.verbs -= /mob/living/carbon/human/proc/set_ranks
oldleader.verbs -= /mob/living/carbon/human/proc/choose_heir
H.mind.nation.current_leader = H
H.mind.nation.heir = null
H.verbs -= /mob/living/carbon/human/proc/takeover
H.verbs += /mob/living/carbon/human/proc/set_nation_name
H.verbs += /mob/living/carbon/human/proc/set_ranks
H.verbs += /mob/living/carbon/human/proc/choose_heir
H << "You have replaced [oldleader.name] as the leader of [H.mind.nation.current_name]!"
H.mind.nation.update_nation_id()
/datum/nations/proc/update_nation_id()