diff --git a/code/game/gamemodes/nations/nations.dm b/code/game/gamemodes/nations/nations.dm index cff052cc737..ec871341bd4 100644 --- a/code/game/gamemodes/nations/nations.dm +++ b/code/game/gamemodes/nations/nations.dm @@ -179,7 +179,8 @@ datum/game_mode/nations 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 += /mob/living/carbon/human/proc/set_nation_name + H.verbs += /datum/game_mode/nations/proc/set_nation_name + H.verbs += /datum/game_mode/nations/proc/set_ranks /** * LateSpawn hook. diff --git a/code/game/gamemodes/nations/nationsdatums.dm b/code/game/gamemodes/nations/nationsdatums.dm index 5e9373b2ac6..5ee305a193b 100644 --- a/code/game/gamemodes/nations/nationsdatums.dm +++ b/code/game/gamemodes/nations/nationsdatums.dm @@ -4,6 +4,8 @@ var/default_leader var/current_leader var/list/membership = list() + var/leader_rank + var/member_rank /datum/nations/atmosia default_name = "Atmosia" diff --git a/code/game/gamemodes/nations/nationsprocs.dm b/code/game/gamemodes/nations/nationsprocs.dm index 7f42fcc4294..e61436a3452 100644 --- a/code/game/gamemodes/nations/nationsprocs.dm +++ b/code/game/gamemodes/nations/nationsprocs.dm @@ -1,18 +1,46 @@ -/mob/living/carbon/human/proc/set_nation_name() +/datum/game_mode/nations/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(!mode.kickoff) 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(mind && mind.nation && mind.nation.current_leader == src) - var/input = stripped_input(src,"What do you want to name your nation?", ,"", MAX_NAME_LEN) + if(input) + H.mind.nation.current_name = input + H << "You rename your nation to [input]." + H.verbs -= /datum/game_mode/nations/proc/set_nation_name + return 1 - if(input) - mind.nation.current_name = input - src << "You rename your nation to [input]." - verbs -= /mob/living/carbon/human/proc/set_nation_name - return 1 \ No newline at end of file + +/datum/game_mode/nations/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 + + 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 + for(var/obj/item/weapon/card/id/I in H) + if(I.registered_name == H.real_name) + I.update_label(I.registered_name, input) + if(type == "Member") + H.mind.nation.member_rank = input + for(var/mob/living/carbon/human/M in H.mind.nation.membership) + if(M == H) continue + for(var/obj/item/weapon/card/id/I in M) + if(I.registered_name == M.real_name) + I.update_label(I.registered_name, input) + H << "You changed the [type] rank of your nation to [input]." + return 1 \ No newline at end of file