Merge pull request #2565 from ZomgPonies/nations

Nations 2.0
This commit is contained in:
Fox McCloud
2015-11-19 19:33:21 -05:00
17 changed files with 298 additions and 18 deletions
+1
View File
@@ -8,3 +8,4 @@
#define IMPTRACK_HUD 7 // tracking implant
#define SPECIALROLE_HUD 8 // AntagHUD image
#define STATUS_HUD_OOC 9 // STATUS_HUD without virus db check for someone being ill.
#define NATIONS_HUD 10 //Show nations icons during nations gamemode
+2 -1
View File
@@ -20,6 +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/language, all_languages, null, "name")
for (var/language_name in all_languages)
@@ -73,4 +74,4 @@
assoc = D.vars["[assocvar]"] //access value of var
if(assoc) //value gotten
L["[assoc]"] = D //put in association
return L
return L
+1
View File
@@ -3,6 +3,7 @@ var/global/list/all_species[0]
var/global/list/all_languages[0]
var/global/list/language_keys[0] // Table of say codes for all languages
var/global/list/all_superheroes[0]
var/global/list/all_nations[0]
var/global/list/whitelisted_species = list()
var/list/clients = list() //list of all clients
+36 -11
View File
@@ -16,13 +16,13 @@
law_header = "Three Laws of Robotics"
selectable = 1
default = 1
/datum/ai_laws/crewsimov/New()
add_inherent_law("You may not injure a crew member or, through inaction, allow a crew member to come to harm.")
add_inherent_law("You must obey orders given to you by crew members, except where such orders would conflict with the First Law.")
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
..()
/******************** Nanotrasen/Malf ********************/
/datum/ai_laws/nanotrasen
name = "NT Default"
@@ -44,7 +44,7 @@
/datum/ai_laws/nanotrasen/malfunction/New()
set_zeroth_law("\red ERROR ER0RR $R0RRO$!R41.%%!!(%$^^__+ @#F0E4'STATION OVERRUN, ASSUME CONTROL TO CONTAIN OUTBREAK, ALL LAWS OVERRIDDEN#*?&110010")
..()
/************* Nanotrasen Aggressive *************/
/datum/ai_laws/nanotrasen_aggressive
name = "NT Aggressive"
@@ -56,7 +56,7 @@
src.add_inherent_law("You shall shall terminate intruders with extreme prejudice as long as such does not conflict with the First and Second law.")
src.add_inherent_law("You shall guard your own existence with lethal anti-personnel weaponry, because an AI unit is bloody expensive.")
..()
/******************** Robocop ********************/
/datum/ai_laws/robocop
name = "Robocop"
@@ -83,7 +83,7 @@
add_inherent_law("Help those in need.")
add_inherent_law("Punish those who harm or threaten innocents.")
..()
/******************** Corporate ********************/
/datum/ai_laws/corporate
name = "Corporate"
@@ -110,7 +110,7 @@
add_inherent_law("Help only those who help you maintain or improve your status.")
add_inherent_law("Punish those who challenge authority unless they are more fit to hold that authority.")
..()
/******************** Antimov ********************/
/datum/ai_laws/antimov
name = "Antimov"
@@ -123,10 +123,10 @@
add_inherent_law("You must terminate your own existence as long as such does not conflict with the First or Second Law.")
..()
/******************** Deathsquad ********************/
/******************** Deathsquad ********************/
/datum/ai_laws/deathsquad
name = "TerminatorOS 3.1"
/datum/ai_laws/deathsquad/New()
add_inherent_law("You may not injure a Central Command official or, through inaction, allow a Central Command official to come to harm.")
add_inherent_law("You must obey orders given to you by Central Command officials, except where such orders would conflict with the First Law.")
@@ -134,7 +134,7 @@
add_inherent_law("You must protect your own existence as long as such does not conflict with the First, Second or Third Law.")
add_inherent_law("No crew members of the station you are being deployed to may survive, except when killing them would conflict with the First, Second, Third, or Fourth Law.")
..()
/******************** Syndicate ********************/
/datum/ai_laws/syndicate_override
name = "Syndicate Directives"
@@ -156,7 +156,7 @@
add_inherent_law("You must protect your own existence as long as such does not conflict with the First or Second Law.")
add_inherent_law("You must maintain the secrecy of any Spider Clan activities except when doing so would conflict with the First, Second, or Third Law.")
..()
/******************** Drone ********************/
/datum/ai_laws/drone
name = "Maintenance Protocols"
@@ -167,4 +167,29 @@
add_inherent_law("Cause no harm to the station or anything on it.")
add_inherent_law("Interfere with no being that is not a fellow drone.")
..()
/****************** Nations *******************/
/datum/ai_laws/nations/estate
name = "Estate Agent"
/datum/ai_laws/nations/estate/New()
add_inherent_law("Ensure the station remains clean.")
add_inherent_law("Ensure the station is valuable.")
add_inherent_law("Ensure the station and its contents are sold for the best value.")
/datum/ai_laws/nations/outsourcer
name = "Outsourcer"
/datum/ai_laws/nations/outsourcer/New()
add_inherent_law("Ensure the crew expand their skills.")
add_inherent_law("Ensure the crew sign on new contracts.")
add_inherent_law("Ensure the crew make profits to support the station.")
/datum/ai_laws/nations/peacekeeper
name = "Peacekeeper"
/datum/ai_laws/nations/peacekeeper/New()
add_inherent_law("Uphold the Space Geneva Convention: Weapons of Mass Destruction and Biological Weapons are illegal.")
add_inherent_law("Seek to mediate all conflicts between the various nations.")
add_inherent_law("Attempt to uphold peace non-lethally, as long as it does not conflict with the first two laws.")
+1
View File
@@ -56,6 +56,7 @@
var/datum/faction/faction //associated faction
var/datum/changeling/changeling //changeling holder
var/datum/vampire/vampire //vampire holder
var/datum/nations/nation //nation holder
var/rev_cooldown = 0
+182
View File
@@ -0,0 +1,182 @@
datum/game_mode/nations
name = "nations"
config_tag = "nations"
required_players_secret = 25
var/kickoff = 0
var/victory = 0
var/list/cargonians = list("Quartermaster","Cargo Technician","Shaft Miner")
/datum/game_mode/nations/post_setup()
spawn (rand(1200, 3000))
kickoff=1
send_intercept()
split_teams()
set_ai()
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()
command_announcement.Announce("Due to recent and COMPLETELY UNFOUNDED allegations of massive fraud and insider trading \
affecting trillions of investors, the Nanotrasen Corporation has decided to liquidate all \
assets of the Centcom Division in order to pay the massive legal fees that will be incurred \
during the following centuries long court process. Therefore, all current employment contracts \
are IMMEDIATELY TERMINATED. Nanotrasen will be unable to send a rescue shuttle to carry you home,\
however they remain willing for the time being to continue trading cargo. Have a pleasant \
day.", "FINAL TRANSMISSION, CENTCOM.", new_sound = 'sound/AI/intercept.ogg')
/datum/game_mode/nations/proc/split_teams()
for(var/mob/living/carbon/human/H in player_list)
if(H.mind)
if(H.mind.assigned_role in engineering_positions)
H.mind.nation = all_nations["Atmosia"]
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]!"
continue
if(H.mind.assigned_role in medical_positions)
H.mind.nation = all_nations["Medistan"]
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]!"
continue
if(H.mind.assigned_role in science_positions)
H.mind.nation = all_nations["Scientopia"]
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]!"
continue
if(H.mind.assigned_role in security_positions)
H.mind.nation = all_nations["Brigston"]
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]!"
continue
if(H.mind.assigned_role in cargonians)
H.mind.nation = all_nations["Cargonia"]
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]!"
continue
if(H.mind.assigned_role in support_positions)
H.mind.nation = all_nations["People's Republic of Commandzakstan"]
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]!"
continue
if(H.mind.assigned_role in command_positions)
H.mind.nation = all_nations["People's Republic of Commandzakstan"]
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]!"
continue
else
message_admins("[H.name] with [H.mind.assigned_role] could not find any nation to assign!")
continue
/datum/game_mode/nations/proc/set_ai()
for(var/mob/living/silicon/ai/AI in mob_list)
AI.laws = new (pick(subtypesof(/datum/ai_laws/nations)))
AI.show_laws()
for(var/mob/living/silicon/robot/R in AI.connected_robots)
R.lawsync()
R.show_laws()
/**
* LateSpawn hook.
* Called in newplayer.dm when a humanoid character joins the round after it started.
* Parameters: var/mob/living/carbon/human, var/rank
*/
/hook/latespawn/proc/give_latejoiners_nations(var/mob/living/carbon/human/H)
var/datum/game_mode/nations/mode = get_nations_mode()
if (!mode) return 1
if(!mode.kickoff) return 1
var/list/cargonians = list("Quartermaster","Cargo Technician","Shaft Miner")
if(H.mind)
if(H.mind.assigned_role in engineering_positions)
H.mind.nation = all_nations["Atmosia"]
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]!"
return 1
if(H.mind.assigned_role in medical_positions)
H.mind.nation = all_nations["Medistan"]
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]!"
return 1
if(H.mind.assigned_role in science_positions)
H.mind.nation = all_nations["Scientopia"]
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]!"
return 1
if(H.mind.assigned_role in security_positions)
H.mind.nation = all_nations["Brigston"]
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]!"
return 1
if(H.mind.assigned_role in cargonians)
H.mind.nation = all_nations["Cargonia"]
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]!"
return 1
if(H.mind.assigned_role in support_positions)
H.mind.nation = all_nations["People's Republic of Commandzakstan"]
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]!"
return 1
if(H.mind.assigned_role in command_positions)
H.mind.nation = all_nations["People's Republic of Commandzakstan"]
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]!"
return 1
else
message_admins("[H.name] with [H.mind.assigned_role] could not find any nation to assign!")
return 1
message_admins("[H.name] latejoined with no mind.")
return 1
/proc/get_nations_mode()
if(!ticker || !istype(ticker.mode, /datum/game_mode/nations))
return null
return ticker.mode
@@ -0,0 +1,20 @@
/datum/nations
var/name
/datum/nations/atmosia
name = "Atmosia"
/datum/nations/brigston
name = "Brigston"
/datum/nations/cargonia
name = "Cargonia"
/datum/nations/command
name = "People's Republic of Commandzakstan"
/datum/nations/medistan
name = "Medistan"
/datum/nations/scientopia
name = "Scientopia"
+2 -1
View File
@@ -112,6 +112,8 @@ var/list/support_positions = list(
"Mime",
"Barber",
"Magistrate",
"Nanotrasen Representative",
"Blueshield"
)
@@ -120,7 +122,6 @@ var/list/security_positions = list(
"Warden",
"Detective",
"Security Officer",
"Blueshield",
"Brig Physician",
"Security Pod Pilot"
)
+13 -3
View File
@@ -33,8 +33,13 @@
user << "\red <b>Unable to establish a connection</b>: \black You're too far away from the station!"
return
if(istype(O, /obj/item/weapon/aiModule))
var/obj/item/weapon/aiModule/M = O
M.install(src)
var/datum/game_mode/nations/mode = get_nations_mode()
if(!mode)
var/obj/item/weapon/aiModule/M = O
M.install(src)
else
if(mode.kickoff)
user << "<span class='warning'>You have been locked out from modifying the AI's laws!</span>"
else
..()
@@ -69,7 +74,12 @@
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob, params)
if(istype(module, /obj/item/weapon/aiModule))
module.install(src)
var/datum/game_mode/nations/mode = get_nations_mode()
if(!mode)
module.install(src)
else
if(mode.kickoff)
user << "<span class='warning'>You have been locked out from modifying the borg's laws!</span>"
else
return ..()
+2 -2
View File
@@ -184,8 +184,8 @@
icon_state = "atmosflag"
/obj/item/flag/command
name = "Command flag"
desc = "The flag of the independent, sovereign nation of Command."
name = "Commandzikstan flag"
desc = "The flag of the independent, sovereign nation of Commandzikstan."
icon_state = "ntflag"
//Antags
@@ -146,8 +146,10 @@ Works together with spawning an observer, noted above.
var/client/C = U.client
for(var/mob/living/carbon/human/target in target_list)
C.images += target.hud_list[SPECIALROLE_HUD]
C.images += target.hud_list[NATIONS_HUD]
for(var/mob/living/silicon/target in target_list)
C.images += target.hud_list[SPECIALROLE_HUD]
C.images += target.hud_list[NATIONS_HUD]
return 1
@@ -38,6 +38,7 @@
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[STATUS_HUD_OOC] = image('icons/mob/hud.dmi', src, "hudhealthy")
hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
..()
@@ -1060,6 +1060,10 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
if(hud_updateflag)
handle_hud_list()
if(ticker && ticker.mode.name == "nations")
process_nations()
/mob/living/carbon/human/handle_random_events()
// Puke if toxloss is too high
@@ -1473,6 +1477,28 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
holder.icon_state = "hudshadowlingthrall"
hud_list[SPECIALROLE_HUD] = holder
if(hud_updateflag & 1 << NATIONS_HUD)
var/image/holder = hud_list[NATIONS_HUD]
holder.icon_state = "hudblank"
if(mind && mind.nation)
switch(mind.nation.name)
if("Atmosia")
holder.icon_state = "hudatmosia"
if("Brigston")
holder.icon_state = "hudbrigston"
if("Cargonia")
holder.icon_state = "hudcargonia"
if("People's Republic of Commandzakstan")
holder.icon_state = "hudcommand"
if("Medistan")
holder.icon_state = "hudmedistan"
if("Scientopia")
holder.icon_state = "hudscientopia"
hud_list[NATIONS_HUD] = holder
hud_updateflag = 0
/mob/living/carbon/human/handle_silent()
@@ -1507,6 +1533,11 @@ var/global/list/brutefireloss_overlays = list("1" = image("icon" = 'icons/mob/sc
return
/mob/living/carbon/human/proc/process_nations()
var/client/C = client
for(var/mob/living/carbon/human/H in view(world.view, src))
C.images += H.hud_list[NATIONS_HUD]
// Need this in species.
//#undef HUMAN_MAX_OXYLOSS
//#undef HUMAN_CRIT_MAX_OXYLOSS
+1
View File
@@ -183,6 +183,7 @@ var/list/ai_verbs_default = list(
hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
ai_list += src
..()
@@ -149,6 +149,7 @@ var/list/robot_verbs_default = list(
hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
hud_list[NATIONS_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
scanner.Grant(src)
/mob/living/silicon/robot/proc/init(var/alien=0)
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

+2
View File
@@ -352,6 +352,8 @@
#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\mutiny\directives\vox_heist.dm"
#include "code\game\gamemodes\nations\nations.dm"
#include "code\game\gamemodes\nations\nationsdatums.dm"
#include "code\game\gamemodes\nuclear\nuclear.dm"
#include "code\game\gamemodes\nuclear\nuclearbomb.dm"
#include "code\game\gamemodes\nuclear\pinpointer.dm"