mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-16 17:43:35 +01:00
Merge pull request #2686 from ZomgPonies/nations22
Nations 2.2 -- Bookkeeping Boogaloo
This commit is contained in:
@@ -20,7 +20,7 @@
|
||||
|
||||
init_datum_subtypes(/datum/job, joblist, list(/datum/job/ai, /datum/job/cyborg), "title")
|
||||
init_datum_subtypes(/datum/superheroes, all_superheroes, null, "name")
|
||||
init_datum_subtypes(/datum/nations, all_nations, null, "name")
|
||||
init_datum_subtypes(/datum/nations, all_nations, null, "default_name")
|
||||
init_datum_subtypes(/datum/language, all_languages, null, "name")
|
||||
|
||||
for (var/language_name in all_languages)
|
||||
|
||||
@@ -13,6 +13,7 @@ datum/game_mode/nations
|
||||
kickoff=1
|
||||
send_intercept()
|
||||
split_teams()
|
||||
assign_leaders()
|
||||
set_ai()
|
||||
// remove_access()
|
||||
for(var/mob/M in player_list)
|
||||
@@ -39,7 +40,12 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudatmosia")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
if(H.mind.assigned_role == H.mind.nation.default_leader)
|
||||
H.mind.nation.current_leader = H.mind.current
|
||||
H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
|
||||
if(H.mind.assigned_role in medical_positions)
|
||||
@@ -47,7 +53,12 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudmedistan")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
if(H.mind.assigned_role == H.mind.nation.default_leader)
|
||||
H.mind.nation.current_leader = H.mind.current
|
||||
H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
|
||||
if(H.mind.assigned_role in science_positions)
|
||||
@@ -55,7 +66,12 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudscientopia")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
if(H.mind.assigned_role == H.mind.nation.default_leader)
|
||||
H.mind.nation.current_leader = H.mind.current
|
||||
H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
|
||||
if(H.mind.assigned_role in security_positions)
|
||||
@@ -63,7 +79,12 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudbrigston")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
if(H.mind.assigned_role == H.mind.nation.default_leader)
|
||||
H.mind.nation.current_leader = H.mind.current
|
||||
H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
|
||||
if(H.mind.assigned_role in cargonians)
|
||||
@@ -71,7 +92,12 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudcargonia")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
if(H.mind.assigned_role == H.mind.nation.default_leader)
|
||||
H.mind.nation.current_leader = H.mind.current
|
||||
H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
|
||||
if(H.mind.assigned_role in servicion)
|
||||
@@ -79,7 +105,12 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudservice")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
if(H.mind.assigned_role == H.mind.nation.default_leader)
|
||||
H.mind.nation.current_leader = H.mind.current
|
||||
H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
|
||||
if(H.mind.assigned_role in support_positions)
|
||||
@@ -87,7 +118,12 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudcommand")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
if(H.mind.assigned_role == H.mind.nation.default_leader)
|
||||
H.mind.nation.current_leader = H.mind.current
|
||||
H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
|
||||
if(H.mind.assigned_role in command_positions)
|
||||
@@ -95,7 +131,12 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudcommand")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
if(H.mind.assigned_role == H.mind.nation.default_leader)
|
||||
H.mind.nation.current_leader = H.mind.current
|
||||
H << "You have been chosen to lead the nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.default_name]!"
|
||||
continue
|
||||
|
||||
if(H.mind.assigned_role in civilian_positions)
|
||||
@@ -129,6 +170,20 @@ datum/game_mode/nations
|
||||
if(W.z in config.station_levels)
|
||||
W.req_access = list()
|
||||
|
||||
|
||||
/datum/game_mode/nations/proc/assign_leaders()
|
||||
for(var/datum/nations/N in all_nations)
|
||||
if(!N.current_name)
|
||||
N.current_name = N.default_name
|
||||
if(!N.current_leader)
|
||||
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
|
||||
N.update_nation_id()
|
||||
|
||||
/**
|
||||
* LateSpawn hook.
|
||||
* Called in newplayer.dm when a humanoid character joins the round after it started.
|
||||
@@ -148,7 +203,8 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudatmosia")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!"
|
||||
return 1
|
||||
|
||||
if(H.mind.assigned_role in medical_positions)
|
||||
@@ -156,7 +212,8 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudmedistan")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!"
|
||||
return 1
|
||||
|
||||
if(H.mind.assigned_role in science_positions)
|
||||
@@ -164,7 +221,8 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudscientopia")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!"
|
||||
return 1
|
||||
|
||||
if(H.mind.assigned_role in security_positions)
|
||||
@@ -172,7 +230,8 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudbrigston")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!"
|
||||
return 1
|
||||
|
||||
if(H.mind.assigned_role in cargonians)
|
||||
@@ -180,7 +239,8 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudcargonia")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!"
|
||||
return 1
|
||||
|
||||
if(H.mind.assigned_role in servicion)
|
||||
@@ -188,7 +248,8 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudservice")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!"
|
||||
return 1
|
||||
|
||||
if(H.mind.assigned_role in support_positions)
|
||||
@@ -196,7 +257,8 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudcommand")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!"
|
||||
return 1
|
||||
|
||||
if(H.mind.assigned_role in command_positions)
|
||||
@@ -204,7 +266,8 @@ datum/game_mode/nations
|
||||
H.hud_updateflag |= 1 << NATIONS_HUD
|
||||
var/I = image('icons/mob/hud.dmi', loc = H.mind.current, icon_state = "hudcommand")
|
||||
H.client.images += I
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
|
||||
H.mind.nation.membership += H.mind.current
|
||||
H << "You are now part of the great sovereign nation of [H.mind.nation.current_name]!"
|
||||
return 1
|
||||
|
||||
if(H.mind.assigned_role in civilian_positions)
|
||||
|
||||
@@ -1,23 +1,37 @@
|
||||
/datum/nations
|
||||
var/name
|
||||
var/default_name
|
||||
var/current_name
|
||||
var/default_leader
|
||||
var/current_leader
|
||||
var/list/membership = list()
|
||||
var/leader_rank = "Leader"
|
||||
var/member_rank = "Member"
|
||||
var/heir
|
||||
|
||||
/datum/nations/atmosia
|
||||
name = "Atmosia"
|
||||
default_name = "Atmosia"
|
||||
default_leader = "Chief Engineer"
|
||||
|
||||
/datum/nations/brigston
|
||||
name = "Brigston"
|
||||
default_name = "Brigston"
|
||||
default_leader = "Head of Security"
|
||||
|
||||
/datum/nations/cargonia
|
||||
name = "Cargonia"
|
||||
default_name = "Cargonia"
|
||||
default_leader = "Quartermaster"
|
||||
|
||||
/datum/nations/command
|
||||
name = "People's Republic of Commandzakstan"
|
||||
default_name = "People's Republic of Commandzakstan"
|
||||
default_leader = "Captain"
|
||||
|
||||
/datum/nations/medistan
|
||||
name = "Medistan"
|
||||
default_name = "Medistan"
|
||||
default_leader = "Chief Medical Officer"
|
||||
|
||||
/datum/nations/scientopia
|
||||
name = "Scientopia"
|
||||
default_name = "Scientopia"
|
||||
default_leader = "Research Director"
|
||||
|
||||
/datum/nations/service
|
||||
name = "Servicion"
|
||||
default_name = "Servicion"
|
||||
default_leader = "Bartender"
|
||||
@@ -0,0 +1,104 @@
|
||||
/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
|
||||
|
||||
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(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
|
||||
|
||||
|
||||
/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
|
||||
H.mind.nation.update_nation_id()
|
||||
|
||||
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
|
||||
|
||||
/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)
|
||||
for(var/obj/item/weapon/card/id/I in M.contents)
|
||||
if(I.registered_name == M.real_name)
|
||||
if(M == current_leader)
|
||||
I.name = "[I.registered_name]'s ID Card ([current_name] [leader_rank])"
|
||||
I.assignment = "[current_name] [leader_rank]"
|
||||
else
|
||||
I.name = "[I.registered_name]'s ID Card ([current_name] [member_rank])"
|
||||
I.assignment = "[current_name] [member_rank]"
|
||||
|
||||
@@ -245,6 +245,9 @@
|
||||
|
||||
stat(null, "Intent: [a_intent]")
|
||||
stat(null, "Move Mode: [m_intent]")
|
||||
|
||||
stat(null, "Station Time: [worldtime2text()]")
|
||||
|
||||
if(ticker && ticker.mode && ticker.mode.name == "AI malfunction")
|
||||
if(ticker.mode:malf_mode_declared)
|
||||
stat(null, "Time left: [max(ticker.mode:AI_win_timeleft/(ticker.mode:apcs/3), 0)]")
|
||||
@@ -275,7 +278,12 @@
|
||||
if(mind.changeling)
|
||||
stat("Chemical Storage", "[mind.changeling.chem_charges]/[mind.changeling.chem_storage]")
|
||||
stat("Absorbed DNA", mind.changeling.absorbedcount)
|
||||
stat(null, "Station Time: [worldtime2text()]")
|
||||
|
||||
if(mind.nation)
|
||||
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!
|
||||
var/obj/spacepod/S = loc
|
||||
|
||||
@@ -1488,7 +1488,7 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
|
||||
holder.icon_state = "hudblank"
|
||||
|
||||
if(mind && mind.nation)
|
||||
switch(mind.nation.name)
|
||||
switch(mind.nation.default_name)
|
||||
if("Atmosia")
|
||||
holder.icon_state = "hudatmosia"
|
||||
if("Brigston")
|
||||
|
||||
@@ -354,6 +354,7 @@
|
||||
#include "code\game\gamemodes\mutiny\directives\vox_heist.dm"
|
||||
#include "code\game\gamemodes\nations\nations.dm"
|
||||
#include "code\game\gamemodes\nations\nationsdatums.dm"
|
||||
#include "code\game\gamemodes\nations\nationsprocs.dm"
|
||||
#include "code\game\gamemodes\nuclear\nuclear.dm"
|
||||
#include "code\game\gamemodes\nuclear\nuclearbomb.dm"
|
||||
#include "code\game\gamemodes\nuclear\pinpointer.dm"
|
||||
|
||||
Reference in New Issue
Block a user