Final Nations patch before live testing. This is going to be painful.

This commit is contained in:
ZomgPonies
2014-05-27 20:09:10 -04:00
parent 386618f66b
commit 06bbfcf150
16 changed files with 190 additions and 50 deletions
+1 -1
View File
@@ -19,7 +19,7 @@
/**
* LateSpawn hook.
* Called in newplayer.dm when a humanoid character joins the round after it started.
* Parameters: var/mob/living/carbon/human, var/rank
* Parameters: var/mob/living/carbon/human
*/
/hook/latespawn
+13
View File
@@ -162,6 +162,11 @@
teleatom.visible_message("\red <B>The [teleatom] bounces off of the portal!</B>")
return 0
if(istype(teleatom, /obj/item/flag/nation)) // Don't let nuke disks get teleported --NeoFite
teleatom.visible_message("\red <B>The [teleatom] bounces off of the portal!</B>")
return 0
if(!isemptylist(teleatom.search_contents_for(/obj/item/weapon/disk/nuclear)))
if(istype(teleatom, /mob/living))
var/mob/living/MM = teleatom
@@ -170,6 +175,14 @@
teleatom.visible_message("\red <B>The [teleatom] bounces off of the portal!</B>")
return 0
if(!isemptylist(teleatom.search_contents_for(/obj/item/flag/nation)))
if(istype(teleatom, /mob/living))
var/mob/living/MM = teleatom
MM.visible_message("\red <B>The [MM] bounces off of the portal!</B>","\red Something you are carrying seems to be unable to pass through the portal. Better drop it if you want to go through.")
else
teleatom.visible_message("\red <B>The [teleatom] bounces off of the portal!</B>")
return 0
if(destination.z == 2) //centcomm z-level
if(istype(teleatom, /obj/mecha))
var/obj/mecha/MM = teleatom
+3
View File
@@ -92,6 +92,9 @@ Implants;
return 1
return 0
//pre_pre_setup() For when you really don't want certain jobs ingame.
/datum/game_mode/proc/pre_pre_setup()
return 1
///pre_setup()
///Attempts to select players for special roles the mode might have.
+3 -2
View File
@@ -103,6 +103,7 @@ var/global/datum/controller/gameticker/ticker
return 0
//Configure mode and assign player to special mode stuff
src.mode.pre_pre_setup()
job_master.DivideOccupations() //Distribute jobs
var/can_continue = src.mode.pre_setup()//Setup special modes
if(!can_continue)
@@ -140,7 +141,7 @@ var/global/datum/controller/gameticker/ticker
//Deleting Startpoints but we need the ai point to AI-ize people later
if (S.name != "AI")
del(S)
// take care of random spesspod spawning
var/list/obj/effect/landmark/spacepod/random/L = list()
for(var/obj/effect/landmark/spacepod/random/SS in landmarks_list)
@@ -151,7 +152,7 @@ var/global/datum/controller/gameticker/ticker
new /obj/spacepod/random(S.loc)
for(var/obj/effect/landmark/spacepod/random/R in L)
del(R)
world << "<FONT color='blue'><B>Enjoy the game!</B></FONT>"
world << sound('sound/AI/welcome.ogg') // Skie
//Holiday Round-start stuff ~Carn
+39 -9
View File
@@ -3,6 +3,9 @@
anchored = 1
var/turf/startloc = null
var/captured = 0
var/list/vassals = list()
var/datum/nations/liege = null
var/datum/nations/nation = null
/obj/item/flag/nation/New()
..()
@@ -29,10 +32,11 @@
/obj/item/flag/nation/blob_act()
return
/obj/item/flag/nation/attack_hand(mob/user as mob)
if(user.mind)
if(user.mind.nation)
if(user.mind.nation.flagpath == type) //Same team as flag
if(user.mind.nation == nation) //Same team as flag
if(loc != startloc)
loc = startloc
user.visible_message("[user] sends [src] back to base!", "You return [src] to your base!")
@@ -45,10 +49,22 @@
if(captured && Adjacent(F.startloc))
user << "<span class='warning'>This flag has already been captured by your team!</span>"
return
else
if(liege == F.liege)
user << "<span class='warning'>You can't steal your liege's flags!</span>"
return
else if(..())
captured = 0
anchored = 0
..()
var/obj/item/flag/nation/N = locate(liege.flagpath)
for(var/mob/living/carbon/human/H in player_list)
if(H.mind && H.mind.nation)
if(H.mind.nation == liege)
H << "<span class='warning'>You are no longer the liege of [nation.name]!</span>"
if(H.mind.nation == nation)
H << "<span class='warning'>You are no longer vassals of [liege.name]!</span>"
N.vassals -= nation
liege = null
else
user << "<span class='warning'>You are not part of a nation and therefore cannot pick up any flags!</span>"
return
@@ -61,18 +77,26 @@
var/obj/item/flag/nation/F = locate(user.mind.nation.flagpath)
if(F.loc == F.startloc && Adjacent(F.startloc))
captured = 1
liege = F.nation
F.vassals += nation
//Announce capture/vassalage here.
//
for(var/mob/living/carbon/human/H in player_list)
if(H.mind && H.mind.nation)
if(H.mind.nation == F.nation)
H << "<span class='warning'>You have just vassalized [nation.name]! They must now obey any memebrs of your nation!</span>"
continue
else if(H.mind.nation == nation)
H << "<span class='warning'>You are now vassals of [liege.name]! You must now obey the orders of any of their members!</span>"
continue
//Check for Victory
for(var/obj/item/flag/nation/N in flag_list)
if(N == F)
continue
if(N.captured && N.Adjacent(F))
if(N.captured && (N.liege == F.nation) && N.Adjacent(F))
continue
else
break
//announceVictory()
return
ticker.mode.declare_completion(F.nation)
@@ -81,28 +105,34 @@
name = "Cargonia flag"
desc = "The flag of the independant, sovereign nation of Cargonia."
icon_state = "cargoflag"
nation = /datum/nations/cargonia
/obj/item/flag/nation/med
name = "Medistan flag"
desc = "The flag of the independant, sovereign nation of Medistan."
icon_state = "medflag"
nation = /datum/nations/medistan
/obj/item/flag/nation/sec
name = "Brigston flag"
desc = "The flag of the independant, sovereign nation of Brigston."
icon_state = "secflag"
nation = /datum/nations/brigston
/obj/item/flag/nation/rnd
name = "Scientopia flag"
desc = "The flag of the independant, sovereign nation of Scientopia."
icon_state = "rndflag"
nation = /datum/nations/scientopia
/obj/item/flag/nation/atmos
name = "Atmosia flag"
desc = "The flag of the independant, sovereign nation of Atmosia."
icon_state = "atmosflag"
nation = /datum/nations/atmosia
/obj/item/flag/nation/command
name = "Command flag"
desc = "The flag of the independant, sovereign nation of Command."
icon_state = "ntflag"
icon_state = "ntflag"
nation = /datum/nations/command
@@ -2,7 +2,6 @@
var/name
var/flagpath
/datum/nations/atmosia
name = "Atmosia"
flagpath = /obj/item/flag/nation/atmos
@@ -29,8 +28,3 @@
+84 -11
View File
@@ -1,3 +1,4 @@
var/global/no_synthetic = 0
datum/game_mode/nations
name = "nations"
@@ -5,11 +6,11 @@ datum/game_mode/nations
required_players_secret = 25
var/const/waittime_l = 3000 //lower bound on time before intercept arrives (in tenths of seconds)
var/const/waittime_h = 6000 //upper bound on time before intercept arrives (in tenths of seconds)
var/victory = 0
var/list/cargonians = list("Quartermaster","Cargo Technician","Shaft Miner")
/datum/game_mode/nations/pre_pre_setup()
no_synthetic = 1
/datum/game_mode/nations/post_setup()
spawn (rand(waittime_l, waittime_h))
@@ -56,39 +57,46 @@ datum/game_mode/nations
for(var/mob/living/carbon/human/H in player_list)
if(H.mind)
if(H.mind.assigned_role in engineering_positions)
H.mind.nation = "Atmosia"
H.mind.nation = all_nations["Atmosia"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
continue
else if(H.mind.assigned_role in medical_positions)
H.mind.nation = "Medistan"
H.mind.nation = all_nations["Medistan"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
continue
else if(H.mind.assigned_role in science_positions)
H.mind.nation = "Scientopia"
H.mind.nation = all_nations["Scientopia"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
continue
else if(H.mind.assigned_role in security_positions)
H.mind.nation = "Brigston"
H.mind.nation = all_nations["Brigston"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
continue
else if(H.mind.assigned_role in cargonians)
H.mind.nation = "Cargonia"
H.mind.nation = all_nations["Cargonia"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
continue
else if(H.mind.assigned_role in civilian_positions)
H.mind.nation = "Command"
H.mind.nation = all_nations["Command"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
continue
else if(H.mind.assigned_role == "Captain")
H.mind.nation = "Command"
H.mind.nation = all_nations["Command"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
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!")
@@ -122,6 +130,15 @@ datum/game_mode/nations
S.startloc = get_turf(N)
continue
/datum/game_mode/nations/check_finished()
if(victory)
return 1
return 0
/datum/game_mode/nations/declare_completion(var/datum/nations/N)
world << "[N.name] has captured all of the station. All glory to [N.name]"
victory = 1
/mob/proc/respawn_self()
set category = "OOC"
set name = "Respawn Character"
@@ -224,4 +241,60 @@ datum/game_mode/nations
data_core.manifest_inject(new_character)
new_character << "You have been fully respawned. Get back in the fight!."
return new_character
return new_character
/**
* 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/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.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
return
else if(H.mind.assigned_role in medical_positions)
H.mind.nation = all_nations["Medistan"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
return
else if(H.mind.assigned_role in science_positions)
H.mind.nation = all_nations["Scientopia"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
return
else if(H.mind.assigned_role in security_positions)
H.mind.nation = all_nations["Brigston"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
return
else if(H.mind.assigned_role in cargonians)
H.mind.nation = all_nations["Cargonia"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
return
else if(H.mind.assigned_role in civilian_positions)
H.mind.nation = all_nations["Command"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
return
else if(H.mind.assigned_role == "Captain")
H.mind.nation = all_nations["Command"]
H.verbs += /mob/proc/respawn_self
H.verbs -= /mob/living/verb/ghost
H << "You are now part of the great sovereign nation of [H.mind.nation.name]!"
return
else
message_admins("[H.name] with [H.mind.assigned_role] could not find any nation to assign!")
return
+13 -10
View File
@@ -14,16 +14,19 @@ var/global/datum/controller/occupations/job_master
proc/SetupOccupations(var/faction = "Station")
occupations = list()
var/list/all_jobs = typesof(/datum/job)
if(!all_jobs.len)
world << "\red \b Error setting up jobs, no job datums found"
return 0
for(var/J in all_jobs)
var/datum/job/job = new J()
if(!job) continue
if(job.faction != faction) continue
occupations += job
if(no_synthetic)
occupations = joblist
else
occupations = list()
var/list/all_jobs = typesof(/datum/job)
if(!all_jobs.len)
world << "\red \b Error setting up jobs, no job datums found"
return 0
for(var/J in all_jobs)
var/datum/job/job = new J()
if(!job) continue
if(job.faction != faction) continue
occupations += job
return 1
+1 -1
View File
@@ -90,7 +90,7 @@ var/const/SAFETY_COOLDOWN = 100
/obj/machinery/recycler/proc/recycle(var/obj/item/I, var/sound = 1)
I.loc = src.loc
if(!istype(I, /obj/item/weapon/disk/nuclear))
if(!istype(I, /obj/item/weapon/disk/nuclear) && !istype(I,/obj/item/flag/nation))
del(I)
if(prob(15))
new /obj/item/stack/sheet/metal(loc)
+5 -5
View File
@@ -134,14 +134,14 @@
return
/obj/item/attack_hand(mob/user as mob)
if (!user) return
if (!user) return 0
if (hasorgans(user))
var/datum/organ/external/temp = user:organs_by_name["r_hand"]
if (user.hand)
temp = user:organs_by_name["l_hand"]
if(temp && !temp.is_usable())
user << "<span class='notice'>You try to move your [temp.display_name], but cannot!"
return
return 0
if (istype(src.loc, /obj/item/weapon/storage))
//If the item is in a storage item, take it out
@@ -152,17 +152,17 @@
if (src.loc == user)
//canremove==0 means that object may not be removed. You can still wear it. This only applies to clothing. /N
if(!src.canremove)
return
return 0
else
user.u_equip(src)
else
if(isliving(src.loc))
return
return 0
user.next_move = max(user.next_move+2,world.time + 2)
src.pickup(user)
add_fingerprint(user)
user.put_in_active_hand(src)
return
return 1
/obj/item/attack_paw(mob/user as mob)
@@ -36,7 +36,7 @@
max_w_class = 2
storage_slots = 21
can_hold = list() // any
cant_hold = list("/obj/item/weapon/disk/nuclear")
cant_hold = list("/obj/item/weapon/disk/nuclear","/obj/item/flag/nation")
/obj/item/weapon/storage/bag/trash/update_icon()
if(contents.len == 0)
@@ -63,7 +63,7 @@
max_w_class = 2
storage_slots = 21
can_hold = list() // any
cant_hold = list("/obj/item/weapon/disk/nuclear")
cant_hold = list("/obj/item/weapon/disk/nuclear","/obj/item/flag/nation")
// -----------------------------
// Mining Satchel
+3 -1
View File
@@ -322,7 +322,9 @@
if(!isemptylist(src.search_contents_for(/obj/item/weapon/disk/nuclear)))
usr << "You get the feeling that you shouldn't cremate one of the items in the cremator."
return
if(!isemptylist(src.search_contents_for(/obj/item/flag/nation)))
usr << "You get the feeling that you shouldn't cremate one of the items in the cremator."
return
for (var/mob/M in viewers(src))
M.show_message("\red You hear a roar as the crematorium activates.", 1)
+2
View File
@@ -216,6 +216,8 @@ var/list/mechtoys = list(
return 1
if(istype(A,/obj/item/weapon/disk/nuclear))
return 1
if(istype(A,/obj/item/flag/nation))
return 1
if(istype(A,/obj/machinery/nuclearbomb))
return 1
if(istype(A,/obj/item/device/radio/beacon))
+16 -1
View File
@@ -93,9 +93,17 @@
if(istype(A, /obj/item/weapon/disk/nuclear)) // Don't let nuke disks travel Z levels ... And moving this shit down here so it only fires when they're actually trying to change z-level.
del(A) //The disk's Destroy() proc ensures a new one is created
return
if(istype(A, /obj/item/flag/nation)) // Don't letflags travel Z levels ... And moving this shit down here so it only fires when they're actually trying to change z-level.
var/obj/item/flag/nation/N = A
N.loc = N.startloc //The flag returns to base.
return
var/mob/living/MM = null
var/fukkendisk = A.GetTypeInAllContents(/obj/item/weapon/disk/nuclear)
var/obj/item/flag/nation/fukkenflag = A.GetTypeInAllContents(/obj/item/flag/nation)
if(fukkenflag)
fukkenflag.loc = fukkenflag.startloc
if(isliving(A))
A << "<span class='warning'>The flag you were carrying was just returned to it's base. Nice try.</span>"
if(fukkendisk)
if(isliving(A))
MM = A
@@ -115,6 +123,7 @@
qdel(fukkendisk)//Make the disk respawn if it is floating on its own
return
//Check if it's a mob pulling an object. Have the object transition with the mob if it's not the nuke disk
var/obj/was_pulling = null
if(isliving(A))
@@ -125,7 +134,13 @@
qdel(MM.pulling)
else
was_pulling = MM.pulling
fukkenflag = null
fukkendisk = was_pulling.GetTypeInAllContents(/obj/item/weapon/disk/nuclear)
fukkenflag = was_pulling.GetTypeInAllContents(/obj/item/flag/nation)
if(fukkenflag)
fukkenflag.loc = fukkenflag.startloc
if(isliving(A))
A << "<span class='warning'>The flag you were carrying was just returned to it's base. Nice try.</span>"
if(fukkendisk)
MM << "<span class='warning'>You think you saw something slip out of [was_pulling], but you couldn't tell where it went...</span>"
qdel(fukkendisk)
+4
View File
@@ -301,6 +301,10 @@
if(istype(I, /obj/item/weapon/disk/nuclear))
user << "You think about it for a few seconds, then you realize Central Command likely doesn't find nuke disk sandwiches very funny, and so you decide not to turn the nuke disk into a foodstuff."
return
if(istype(I, /obj/item/flag/nation))
user << "That's not going to fit!"
return
else
user << "<span class='notice'> You add [I] to [src].</span>"
if(istype(I, /obj/item/weapon/reagent_containers/))
+1 -1
View File
@@ -318,7 +318,7 @@
data_core.manifest_inject(character)
ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn
AnnounceArrival(character, rank)
callHook("latespawn", list(character, rank))
callHook("latespawn", list(character))
else
character.Robotize()
del(src)