mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-13 08:03:43 +01:00
Add the ability to choose a heir and for heir to takeover
This commit is contained in:
@@ -181,6 +181,7 @@ datum/game_mode/nations
|
||||
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
|
||||
N.update_nation_id()
|
||||
|
||||
/**
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
var/list/membership = list()
|
||||
var/leader_rank = "Leader"
|
||||
var/member_rank = "Member"
|
||||
var/heir
|
||||
|
||||
/datum/nations/atmosia
|
||||
default_name = "Atmosia"
|
||||
|
||||
@@ -41,6 +41,55 @@
|
||||
H << "You changed the [type] rank of your nation to [input]."
|
||||
return 1
|
||||
|
||||
/datum/game_mode/nations/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
|
||||
|
||||
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!"
|
||||
|
||||
|
||||
/datum/game_mode/nations/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
|
||||
|
||||
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()
|
||||
|
||||
|
||||
/datum/nations/proc/update_nation_id()
|
||||
for(var/mob/living/carbon/human/M in membership)
|
||||
|
||||
@@ -280,8 +280,9 @@
|
||||
stat("Absorbed DNA", mind.changeling.absorbedcount)
|
||||
|
||||
if(mind.nation)
|
||||
stat("Nation Name", mind.nation.current_name)
|
||||
stat("Nation Leader", mind.nation.current_leader)
|
||||
stat("Nation Name", "[mind.nation.current_name ? "[mind.nation.current_name]" : "mind.nation.default_name"]")
|
||||
stat("Nation Leader", "[mind.nation.current_leader ? "[mind.nation.current_leader]" : "None"]")
|
||||
stat("Nation Heir", "[mind.nation.heir ? "[mind.nation.heir]" : "None"]")
|
||||
|
||||
|
||||
if(istype(loc, /obj/spacepod)) // Spacdpods!
|
||||
|
||||
Reference in New Issue
Block a user