Endgame tweaks.

Now instead calls the proper round-end proc when finishing the round, allowing admins to interrupt restart if desired.
None of the current end game variants currently use over/underlays, they are now content with coloring space.
On endgame start, the entire world is now updated in a spawn() instead, reducing crippling lag.
Adds support to designate APCs are critical, these are not drained during world end events.
Fixes a couple of potential runtime errors if no escape points have bee mapped in.
People in wheelchairs and mechas can now enter the world end rift.
Cult walls no longer cultify over and over, indefinitely.
This commit is contained in:
PsiOmega
2015-05-26 12:29:50 +02:00
parent 837af60946
commit bcb1ea5413
16 changed files with 113 additions and 101 deletions

View File

@@ -265,6 +265,7 @@
#include "code\game\gamemodes\cult\cult_items.dm" #include "code\game\gamemodes\cult\cult_items.dm"
#include "code\game\gamemodes\cult\cult_structures.dm" #include "code\game\gamemodes\cult\cult_structures.dm"
#include "code\game\gamemodes\cult\hell_universe.dm" #include "code\game\gamemodes\cult\hell_universe.dm"
#include "code\game\gamemodes\cult\narsie.dm"
#include "code\game\gamemodes\cult\ritual.dm" #include "code\game\gamemodes\cult\ritual.dm"
#include "code\game\gamemodes\cult\runes.dm" #include "code\game\gamemodes\cult\runes.dm"
#include "code\game\gamemodes\cult\talisman.dm" #include "code\game\gamemodes\cult\talisman.dm"
@@ -631,9 +632,9 @@
#include "code\game\objects\items\weapons\swords_axes_etc.dm" #include "code\game\objects\items\weapons\swords_axes_etc.dm"
#include "code\game\objects\items\weapons\tape.dm" #include "code\game\objects\items\weapons\tape.dm"
#include "code\game\objects\items\weapons\teleportation.dm" #include "code\game\objects\items\weapons\teleportation.dm"
#include "code\game\objects\items\weapons\tools.dm" #include "code\game\objects\items\weapons\tools.dm"
#include "code\game\objects\items\weapons\traps.dm"
#include "code\game\objects\items\weapons\trays.dm" #include "code\game\objects\items\weapons\trays.dm"
#include "code\game\objects\items\weapons\traps.dm"
#include "code\game\objects\items\weapons\weaponry.dm" #include "code\game\objects\items\weapons\weaponry.dm"
#include "code\game\objects\items\weapons\weldbackpack.dm" #include "code\game\objects\items\weapons\weldbackpack.dm"
#include "code\game\objects\items\weapons\wires.dm" #include "code\game\objects\items\weapons\wires.dm"
@@ -1417,7 +1418,6 @@
#include "code\modules\power\singularity\field_generator.dm" #include "code\modules\power\singularity\field_generator.dm"
#include "code\modules\power\singularity\generator.dm" #include "code\modules\power\singularity\generator.dm"
#include "code\modules\power\singularity\investigate.dm" #include "code\modules\power\singularity\investigate.dm"
#include "code\modules\power\singularity\narsie.dm"
#include "code\modules\power\singularity\singularity.dm" #include "code\modules\power\singularity\singularity.dm"
#include "code\modules\power\singularity\particle_accelerator\particle.dm" #include "code\modules\power\singularity\particle_accelerator\particle.dm"
#include "code\modules\power\singularity\particle_accelerator\particle_accelerator.dm" #include "code\modules\power\singularity\particle_accelerator\particle_accelerator.dm"

View File

@@ -92,16 +92,6 @@
turf += src turf += src
c.add(turf,3,1) c.add(turf,3,1)
/turf/space/New()
..()
var/turf/controller = locate(1, 1, z)
for(var/obj/effect/landmark/zcontroller/c in controller)
if(c.initialized)
var/list/turf = list()
turf += src
c.add(turf,3,1)
atom/movable/Move() //Hackish atom/movable/Move() //Hackish
. = ..() . = ..()

View File

@@ -19,6 +19,8 @@ var/global/list/side_effects = list() //list of all medical sideeffects types
var/global/list/mechas_list = list() //list of all mechs. Used by hostile mobs target tracking. var/global/list/mechas_list = list() //list of all mechs. Used by hostile mobs target tracking.
var/global/list/joblist = list() //list of all jobstypes, minus borg and AI var/global/list/joblist = list() //list of all jobstypes, minus borg and AI
var/global/list/turfs = list() //list of all turfs
//Languages/species/whitelist. //Languages/species/whitelist.
var/global/list/all_species[0] var/global/list/all_species[0]
var/global/list/all_languages[0] var/global/list/all_languages[0]

View File

@@ -23,6 +23,9 @@
/turf/simulated/wall/cult/cultify() /turf/simulated/wall/cult/cultify()
return return
/turf/unsimulated/wall/cult/cultify()
return
/turf/unsimulated/beach/cultify() /turf/unsimulated/beach/cultify()
return return

View File

@@ -33,51 +33,48 @@ In short:
/datum/universal_state/hell/OnTurfChange(var/turf/T) /datum/universal_state/hell/OnTurfChange(var/turf/T)
var/turf/space/spess = T if(istype(T, /turf/space))
if(istype(spess)) T.color = "#FF0000"
spess.overlays += "hell01" T.set_light(2, 2, "#FF0000")
else
T.color = initial(T.color)
T.set_light(0)
// Apply changes when entering state // Apply changes when entering state
/datum/universal_state/hell/OnEnter() /datum/universal_state/hell/OnEnter()
set background = 1 set background = 1
garbage_collector.garbage_collect = 0 garbage_collector.garbage_collect = 0
escape_list = get_area_turfs(locate(/area/hallway/secondary/exit)) escape_list = get_area_turfs(locate(/area/hallway/secondary/exit))
//Separated into separate procs for profiling //Separated into separate procs for profiling
AreaSet() AreaSet()
OverlaySet()
MiscSet() MiscSet()
APCSet() APCSet()
KillMobs() KillMobs()
AmbientSet() OverlayAndAmbientSet()
runedec += 9000 //basically removing the rune cap runedec += 9000 //basically removing the rune cap
/datum/universal_state/hell/proc/AreaSet()
for(var/area/A in world)
if(A.name=="Space")
continue
// Reset all alarms. /datum/universal_state/hell/proc/AreaSet()
A.fire = null for(var/area/A in all_areas)
A.atmos = 1 if(!istype(A,/area) || istype(A, /area/space))
A.atmosalm = 0 continue
A.poweralm = 1
A.party = null
A.updateicon() A.updateicon()
/datum/universal_state/hell/proc/OverlaySet() /datum/universal_state/hell/OverlayAndAmbientSet()
var/image/I = image("icon" = 'icons/turf/space.dmi', "icon_state" = "hell01", "layer" = 10) spawn(0)
for(var/turf/space/spess in world) for(var/atom/movable/lighting_overlay/L in world)
spess.overlays += I L.update_lumcount(1, 0, 0)
/datum/universal_state/hell/proc/AmbientSet() for(var/turf/space/T in turfs)
for(var/atom/movable/lighting_overlay/L in world) T.color = "#FF0000"
L.update_lumcount(1, 0, 0) T.set_light(2, 2, "#FF0000")
/datum/universal_state/hell/proc/MiscSet() /datum/universal_state/hell/proc/MiscSet()
for(var/turf/simulated/floor/T in world) for(var/turf/simulated/floor/T in turfs)
if(!T.holy && prob(1)) if(!T.holy && prob(1))
new /obj/effect/gateway/active/cult(T) new /obj/effect/gateway/active/cult(T)
@@ -87,7 +84,7 @@ In short:
/datum/universal_state/hell/proc/APCSet() /datum/universal_state/hell/proc/APCSet()
for (var/obj/machinery/power/apc/APC in machines) for (var/obj/machinery/power/apc/APC in machines)
if (!(APC.stat & BROKEN) && !istype(APC.area,/area/turret_protected/ai)) if (!(APC.stat & BROKEN) && !APC.is_critical)
APC.chargemode = 0 APC.chargemode = 0
if(APC.cell) if(APC.cell)
APC.cell.charge = 0 APC.cell.charge = 0

View File

@@ -1,4 +1,5 @@
var/global/narsie_behaviour = "CultStation13" var/global/narsie_behaviour = "CultStation13"
var/global/narsie_cometh = 0
var/global/list/narsie_list = list() var/global/list/narsie_list = list()
/obj/singularity/narsie //Moving narsie to its own file for the sake of being clearer /obj/singularity/narsie //Moving narsie to its own file for the sake of being clearer
name = "Nar-Sie" name = "Nar-Sie"
@@ -47,13 +48,15 @@ var/global/list/narsie_list = list()
narsie_spawn_animation() narsie_spawn_animation()
if(narnar) if(!narsie_cometh)//so we don't initiate Hell more than one time.
SetUniversalState(/datum/universal_state/hell) if(narnar)
SetUniversalState(/datum/universal_state/hell)
narsie_cometh = 1
spawn(10 SECONDS) spawn(10 SECONDS)
if(emergency_shuttle && emergency_shuttle.can_call()) if(emergency_shuttle)
emergency_shuttle.call_evac() emergency_shuttle.call_evac()
emergency_shuttle.launch_time = 0 // Cannot recall emergency_shuttle.launch_time = 0 // Cannot recall
/obj/singularity/narsie/process() /obj/singularity/narsie/process()
eat() eat()

View File

@@ -60,6 +60,9 @@
/datum/universal_state/proc/OnTurfChange(var/turf/NT) /datum/universal_state/proc/OnTurfChange(var/turf/NT)
return return
/datum/universal_state/proc/OverlayAndAmbientSet()
return
/proc/SetUniversalState(var/newstate,var/on_exit=1, var/on_enter=1) /proc/SetUniversalState(var/newstate,var/on_exit=1, var/on_enter=1)
if(on_exit) if(on_exit)
universe.OnExit() universe.OnExit()

View File

@@ -8,7 +8,7 @@
//luminosity = 5 //luminosity = 5
//l_color="#0066FF" //l_color="#0066FF"
layer = 11 layer = LIGHTING_LAYER+1
var/spawned=0 // DIR mask var/spawned=0 // DIR mask
var/next_check=0 var/next_check=0
@@ -50,10 +50,10 @@
if(A) if(A)
if(istype(A,/mob/living)) if(istype(A,/mob/living))
qdel(A) qdel(A)
continue
else if(istype(A,/mob)) // Observers, AI cameras. else if(istype(A,/mob)) // Observers, AI cameras.
continue continue
qdel(A) else
qdel(A)
T.ChangeTurf(type) T.ChangeTurf(type)
if((spawned & (NORTH|SOUTH|EAST|WEST)) == (NORTH|SOUTH|EAST|WEST)) if((spawned & (NORTH|SOUTH|EAST|WEST)) == (NORTH|SOUTH|EAST|WEST))

View File

@@ -10,7 +10,7 @@
announce=0 announce=0
narnar=0 narnar=0
layer=12 // ITS SO BRIGHT layer=LIGHTING_LAYER+2 // ITS SO BRIGHT
consume_range = 6 consume_range = 6
@@ -35,7 +35,17 @@
return 0 return 0
if (istype(A, /mob/living/)) if (istype(A, /mob/living/))
var/mob/living/L = A
if(L.buckled && istype(L.buckled,/obj/structure/bed/))
var/turf/O = L.buckled
do_teleport(O, pick(endgame_safespawns))
L.loc = O.loc
else
do_teleport(L, pick(endgame_safespawns)) //dead-on precision
else if (istype(A, /obj/mecha/))
do_teleport(A, pick(endgame_safespawns)) //dead-on precision do_teleport(A, pick(endgame_safespawns)) //dead-on precision
else if (isturf(A)) else if (isturf(A))
var/turf/T = A var/turf/T = A
var/dist = get_dist(T, src) var/dist = get_dist(T, src)
@@ -51,6 +61,9 @@
continue continue
if (dist > consume_range) if (dist > consume_range)
if(!(AM.singuloCanEat()))
continue
if (101 == AM.invisibility) if (101 == AM.invisibility)
continue continue
@@ -63,19 +76,19 @@
var/image/riftimage = null var/image/riftimage = null
/mob/proc/see_rift(var/obj/singularity/narsie/large/exit/R) /mob/proc/see_rift(var/obj/singularity/narsie/large/exit/R)
if((R.z == src.z) && (get_dist(R,src) <= (R.consume_range+10)) && !(R in view(src))) var/turf/T_mob = get_turf(src)
if((R.z == T_mob.z) && (get_dist(R,T_mob) <= (R.consume_range+10)) && !(R in view(T_mob)))
if(!riftimage) if(!riftimage)
riftimage = image('icons/obj/rift.dmi',src.loc,"rift",12,1) riftimage = image('icons/obj/rift.dmi',T_mob,"rift",LIGHTING_LAYER+2,1)
riftimage.mouse_opacity = 0 riftimage.mouse_opacity = 0
var/new_x = 32 * (R.x - src.x) + R.pixel_x var/new_x = 32 * (R.x - T_mob.x) + R.pixel_x
var/new_y = 32 * (R.y - src.y) + R.pixel_y var/new_y = 32 * (R.y - T_mob.y) + R.pixel_y
riftimage.pixel_x = new_x riftimage.pixel_x = new_x
riftimage.pixel_y = new_y riftimage.pixel_y = new_y
riftimage.loc = src.loc riftimage.loc = T_mob
src << riftimage src << riftimage
else else
if(riftimage) if(riftimage)
qdel(riftimage) qdel(riftimage)

View File

@@ -1,3 +1,5 @@
var/global/universe_has_ended = 0
/datum/universal_state/supermatter_cascade /datum/universal_state/supermatter_cascade
name = "Supermatter Cascade" name = "Supermatter Cascade"
@@ -11,9 +13,13 @@
return 0 return 0
/datum/universal_state/supermatter_cascade/OnTurfChange(var/turf/T) /datum/universal_state/supermatter_cascade/OnTurfChange(var/turf/T)
var/turf/space/spess = T if(istype(T, /turf/space))
if(istype(spess)) T.color = "#0066FF"
spess.overlays += "end01" T.set_light(2, 2, "#0066FF")
else
T.color = initial(T.color)
T.set_light(0)
/datum/universal_state/supermatter_cascade/DecayTurf(var/turf/T) /datum/universal_state/supermatter_cascade/DecayTurf(var/turf/T)
if(istype(T,/turf/simulated/wall)) if(istype(T,/turf/simulated/wall))
@@ -46,13 +52,13 @@
emergency_shuttle.recall() emergency_shuttle.recall()
AreaSet() AreaSet()
OverlaySet()
MiscSet() MiscSet()
APCSet() APCSet()
AmbientSet() OverlayAndAmbientSet()
// Disable Nar-Sie. // Disable Nar-Sie.
cult.allow_narsie = 0 cult.allow_narsie = 0
PlayerSet() PlayerSet()
new /obj/singularity/narsie/large/exit(pick(endgame_exits)) new /obj/singularity/narsie/large/exit(pick(endgame_exits))
@@ -64,64 +70,50 @@ There's been a galaxy-wide electromagnetic pulse. All of our systems are heavil
You have five minutes before the universe collapses. Good l\[\[###!!!- You have five minutes before the universe collapses. Good l\[\[###!!!-
AUTOMATED ALERT: Link to [command_name()] lost."} AUTOMATED ALERT: Link to [command_name()] lost.
The access requirements on the Asteroid Shuttles' consoles have now been revoked.
"}
priority_announcement.Announce(txt,"SUPERMATTER CASCADE DETECTED") priority_announcement.Announce(txt,"SUPERMATTER CASCADE DETECTED")
for(var/obj/machinery/computer/shuttle_control/C in machines)
if(istype(C, /obj/machinery/computer/shuttle_control/research) || istype(C, /obj/machinery/computer/shuttle_control/mining))
C.req_access = list()
C.req_one_access = list()
sleep(5 MINUTES) sleep(5 MINUTES)
ticker.declare_completion()
ticker.station_explosion_cinematic(0,null) // TODO: Custom cinematic ticker.station_explosion_cinematic(0,null) // TODO: Custom cinematic
world << "<B>Resetting in 30 seconds!</B>" universe_has_ended = 1
feedback_set_details("end_error","Universe ended")
if(blackbox)
blackbox.save_all_data_to_sql()
sleep(300)
log_game("Rebooting due to universal collapse")
world.Reboot()
return return
/datum/universal_state/supermatter_cascade/proc/AreaSet() /datum/universal_state/supermatter_cascade/proc/AreaSet()
for(var/area/A in world) for(var/area/A in all_areas)
if(A.z in config.admin_levels) if(!istype(A,/area) || istype(A, /area/space) || istype(A,/area/beach))
continue continue
if(istype(A,/area/space))
continue
// Reset all alarms.
A.fire = null
A.atmos = 1
A.atmosalm = 0
A.poweralm = 1
// Slap on random alerts
if(prob(25))
switch(rand(1,4))
if(1)
A.fire=1
if(2)
A.atmosalm=1
A.updateicon() A.updateicon()
/datum/universal_state/supermatter_cascade/proc/OverlaySet() /datum/universal_state/supermatter_cascade/OverlayAndAmbientSet()
for(var/turf/space/spess in world) spawn(0)
spess.overlays += "end01" for(var/atom/movable/lighting_overlay/L in world)
if(L.z in config.admin_levels)
L.update_lumcount(1,1,1)
else
L.update_lumcount(0.0, 0.4, 1)
/datum/universal_state/supermatter_cascade/proc/AmbientSet() for(var/turf/space/T in turfs)
for(var/atom/movable/lighting_overlay/L in world) T.color = "#0066FF"
if(!(L.z in config.admin_levels)) T.set_light(2, 2, "#0066FF")
L.update_lumcount(0.5, 1, 0)
/datum/universal_state/supermatter_cascade/proc/MiscSet() /datum/universal_state/supermatter_cascade/proc/MiscSet()
for (var/obj/machinery/firealarm/alm in world) for (var/obj/machinery/firealarm/alm in machines)
if (!(alm.stat & BROKEN)) if (!(alm.stat & BROKEN))
alm.ex_act(2) alm.ex_act(2)
/datum/universal_state/supermatter_cascade/proc/APCSet() /datum/universal_state/supermatter_cascade/proc/APCSet()
for (var/obj/machinery/power/apc/APC in world) for (var/obj/machinery/power/apc/APC in machines)
if (!(APC.stat & BROKEN)) if (!(APC.stat & BROKEN) && !APC.is_critical)
APC.chargemode = 0 APC.chargemode = 0
if(APC.cell) if(APC.cell)
APC.cell.charge = 0 APC.cell.charge = 0

View File

@@ -312,7 +312,7 @@ var/global/datum/controller/gameticker/ticker
game_finished = (emergency_shuttle.returned() || mode.station_was_nuked) game_finished = (emergency_shuttle.returned() || mode.station_was_nuked)
mode_finished = (!post_game && mode.check_finished()) mode_finished = (!post_game && mode.check_finished())
else else
game_finished = (mode.check_finished() || (emergency_shuttle.returned() && emergency_shuttle.evac == 1)) game_finished = (mode.check_finished() || (emergency_shuttle.returned() && emergency_shuttle.evac == 1)) || universe_has_ended
mode_finished = game_finished mode_finished = game_finished
if(!mode.explosion_in_progress && game_finished && (mode_finished || post_game)) if(!mode.explosion_in_progress && game_finished && (mode_finished || post_game))

View File

@@ -16,6 +16,7 @@ var/list/accessible_z_levels = list("1" = 5, "3" = 10, "4" = 15, "5" = 10, "6" =
if(!istype(src, /turf/space/transit)) if(!istype(src, /turf/space/transit))
icon_state = "[((x + y) ^ ~(x * y) + z) % 25]" icon_state = "[((x + y) ^ ~(x * y) + z) % 25]"
update_starlight() update_starlight()
..()
/turf/space/proc/update_starlight() /turf/space/proc/update_starlight()
if(!config.starlight) if(!config.starlight)

View File

@@ -40,8 +40,13 @@
spawn( 0 ) spawn( 0 )
src.Entered(AM) src.Entered(AM)
return return
turfs |= src
return return
/turf/Destroy()
turfs -= src
..()
/turf/ex_act(severity) /turf/ex_act(severity)
return 0 return 0

View File

@@ -214,8 +214,8 @@
/mob/living/simple_animal/hostile/proc/check_horde() /mob/living/simple_animal/hostile/proc/check_horde()
if(emergency_shuttle.shuttle.location) if(emergency_shuttle.shuttle.location)
if(!enroute && !target_mob) //The shuttle docked, all monsters rush for the escape hallway if(!enroute && !target_mob) //The shuttle docked, all monsters rush for the escape hallway
if(!shuttletarget || (get_dist(src, shuttletarget) >= 2)) if(!shuttletarget && escape_list.len) //Make sure we didn't already assign it a target, and that there are targets to pick
shuttletarget = pick(escape_list) shuttletarget = pick(escape_list) //Pick a shuttle target
enroute = 1 enroute = 1
stop_automated_movement = 1 stop_automated_movement = 1
spawn() spawn()

View File

@@ -98,6 +98,7 @@
var/datum/wires/apc/wires = null var/datum/wires/apc/wires = null
var/update_state = -1 var/update_state = -1
var/update_overlay = -1 var/update_overlay = -1
var/is_critical = 0
var/global/status_overlays = 0 var/global/status_overlays = 0
var/updating_icon = 0 var/updating_icon = 0
var/global/list/status_overlays_lock var/global/list/status_overlays_lock

View File

@@ -865,6 +865,7 @@ var/list/be_special_flags = list(
#define SLIME 16 #define SLIME 16
#define SIMPLE_ANIMAL 32 #define SIMPLE_ANIMAL 32
#define ALLMOBS (HUMAN|MONKEY|ALIEN|ROBOT|SLIME|SIMPLE_ANIMAL) #define ALLMOBS (HUMAN|MONKEY|ALIEN|ROBOT|SLIME|SIMPLE_ANIMAL)
#define NEXT_MOVE_DELAY 8 #define NEXT_MOVE_DELAY 8
@@ -876,6 +877,7 @@ var/list/be_special_flags = list(
// Custom layer definitions, supplementing the default TURF_LAYER, MOB_LAYER, etc. // Custom layer definitions, supplementing the default TURF_LAYER, MOB_LAYER, etc.
#define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6 #define DOOR_OPEN_LAYER 2.7 //Under all objects if opened. 2.7 due to tables being at 2.6
#define DOOR_CLOSED_LAYER 3.1 //Above most items if closed #define DOOR_CLOSED_LAYER 3.1 //Above most items if closed
#define LIGHTING_LAYER 11
#define OBFUSCATION_LAYER 14 //Where images covering the view for eyes are put #define OBFUSCATION_LAYER 14 //Where images covering the view for eyes are put
#define SCREEN_LAYER 17 //Mob HUD/effects layer #define SCREEN_LAYER 17 //Mob HUD/effects layer