mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
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:
@@ -265,6 +265,7 @@
|
||||
#include "code\game\gamemodes\cult\cult_items.dm"
|
||||
#include "code\game\gamemodes\cult\cult_structures.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\runes.dm"
|
||||
#include "code\game\gamemodes\cult\talisman.dm"
|
||||
@@ -632,8 +633,8 @@
|
||||
#include "code\game\objects\items\weapons\tape.dm"
|
||||
#include "code\game\objects\items\weapons\teleportation.dm"
|
||||
#include "code\game\objects\items\weapons\tools.dm"
|
||||
#include "code\game\objects\items\weapons\trays.dm"
|
||||
#include "code\game\objects\items\weapons\traps.dm"
|
||||
#include "code\game\objects\items\weapons\trays.dm"
|
||||
#include "code\game\objects\items\weapons\weaponry.dm"
|
||||
#include "code\game\objects\items\weapons\weldbackpack.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\generator.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\particle_accelerator\particle.dm"
|
||||
#include "code\modules\power\singularity\particle_accelerator\particle_accelerator.dm"
|
||||
|
||||
@@ -92,16 +92,6 @@
|
||||
turf += src
|
||||
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
|
||||
. = ..()
|
||||
|
||||
|
||||
@@ -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/joblist = list() //list of all jobstypes, minus borg and AI
|
||||
|
||||
var/global/list/turfs = list() //list of all turfs
|
||||
|
||||
//Languages/species/whitelist.
|
||||
var/global/list/all_species[0]
|
||||
var/global/list/all_languages[0]
|
||||
|
||||
@@ -23,6 +23,9 @@
|
||||
/turf/simulated/wall/cult/cultify()
|
||||
return
|
||||
|
||||
/turf/unsimulated/wall/cult/cultify()
|
||||
return
|
||||
|
||||
/turf/unsimulated/beach/cultify()
|
||||
return
|
||||
|
||||
|
||||
@@ -33,51 +33,48 @@ In short:
|
||||
|
||||
|
||||
/datum/universal_state/hell/OnTurfChange(var/turf/T)
|
||||
var/turf/space/spess = T
|
||||
if(istype(spess))
|
||||
spess.overlays += "hell01"
|
||||
if(istype(T, /turf/space))
|
||||
T.color = "#FF0000"
|
||||
T.set_light(2, 2, "#FF0000")
|
||||
else
|
||||
T.color = initial(T.color)
|
||||
T.set_light(0)
|
||||
|
||||
// Apply changes when entering state
|
||||
/datum/universal_state/hell/OnEnter()
|
||||
set background = 1
|
||||
garbage_collector.garbage_collect = 0
|
||||
|
||||
escape_list = get_area_turfs(locate(/area/hallway/secondary/exit))
|
||||
|
||||
//Separated into separate procs for profiling
|
||||
AreaSet()
|
||||
OverlaySet()
|
||||
MiscSet()
|
||||
APCSet()
|
||||
KillMobs()
|
||||
AmbientSet()
|
||||
OverlayAndAmbientSet()
|
||||
|
||||
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.
|
||||
A.fire = null
|
||||
A.atmos = 1
|
||||
A.atmosalm = 0
|
||||
A.poweralm = 1
|
||||
A.party = null
|
||||
/datum/universal_state/hell/proc/AreaSet()
|
||||
for(var/area/A in all_areas)
|
||||
if(!istype(A,/area) || istype(A, /area/space))
|
||||
continue
|
||||
|
||||
A.updateicon()
|
||||
|
||||
/datum/universal_state/hell/proc/OverlaySet()
|
||||
var/image/I = image("icon" = 'icons/turf/space.dmi', "icon_state" = "hell01", "layer" = 10)
|
||||
for(var/turf/space/spess in world)
|
||||
spess.overlays += I
|
||||
/datum/universal_state/hell/OverlayAndAmbientSet()
|
||||
spawn(0)
|
||||
for(var/atom/movable/lighting_overlay/L in world)
|
||||
L.update_lumcount(1, 0, 0)
|
||||
|
||||
/datum/universal_state/hell/proc/AmbientSet()
|
||||
for(var/atom/movable/lighting_overlay/L in world)
|
||||
L.update_lumcount(1, 0, 0)
|
||||
for(var/turf/space/T in turfs)
|
||||
T.color = "#FF0000"
|
||||
T.set_light(2, 2, "#FF0000")
|
||||
|
||||
/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))
|
||||
new /obj/effect/gateway/active/cult(T)
|
||||
|
||||
@@ -87,7 +84,7 @@ In short:
|
||||
|
||||
/datum/universal_state/hell/proc/APCSet()
|
||||
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
|
||||
if(APC.cell)
|
||||
APC.cell.charge = 0
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
var/global/narsie_behaviour = "CultStation13"
|
||||
var/global/narsie_cometh = 0
|
||||
var/global/list/narsie_list = list()
|
||||
/obj/singularity/narsie //Moving narsie to its own file for the sake of being clearer
|
||||
name = "Nar-Sie"
|
||||
@@ -47,13 +48,15 @@ var/global/list/narsie_list = list()
|
||||
|
||||
narsie_spawn_animation()
|
||||
|
||||
if(narnar)
|
||||
SetUniversalState(/datum/universal_state/hell)
|
||||
if(!narsie_cometh)//so we don't initiate Hell more than one time.
|
||||
if(narnar)
|
||||
SetUniversalState(/datum/universal_state/hell)
|
||||
narsie_cometh = 1
|
||||
|
||||
spawn(10 SECONDS)
|
||||
if(emergency_shuttle && emergency_shuttle.can_call())
|
||||
emergency_shuttle.call_evac()
|
||||
emergency_shuttle.launch_time = 0 // Cannot recall
|
||||
spawn(10 SECONDS)
|
||||
if(emergency_shuttle)
|
||||
emergency_shuttle.call_evac()
|
||||
emergency_shuttle.launch_time = 0 // Cannot recall
|
||||
|
||||
/obj/singularity/narsie/process()
|
||||
eat()
|
||||
@@ -60,6 +60,9 @@
|
||||
/datum/universal_state/proc/OnTurfChange(var/turf/NT)
|
||||
return
|
||||
|
||||
/datum/universal_state/proc/OverlayAndAmbientSet()
|
||||
return
|
||||
|
||||
/proc/SetUniversalState(var/newstate,var/on_exit=1, var/on_enter=1)
|
||||
if(on_exit)
|
||||
universe.OnExit()
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
//luminosity = 5
|
||||
//l_color="#0066FF"
|
||||
layer = 11
|
||||
layer = LIGHTING_LAYER+1
|
||||
|
||||
var/spawned=0 // DIR mask
|
||||
var/next_check=0
|
||||
@@ -50,10 +50,10 @@
|
||||
if(A)
|
||||
if(istype(A,/mob/living))
|
||||
qdel(A)
|
||||
continue
|
||||
else if(istype(A,/mob)) // Observers, AI cameras.
|
||||
continue
|
||||
qdel(A)
|
||||
else
|
||||
qdel(A)
|
||||
T.ChangeTurf(type)
|
||||
|
||||
if((spawned & (NORTH|SOUTH|EAST|WEST)) == (NORTH|SOUTH|EAST|WEST))
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
announce=0
|
||||
narnar=0
|
||||
|
||||
layer=12 // ITS SO BRIGHT
|
||||
layer=LIGHTING_LAYER+2 // ITS SO BRIGHT
|
||||
|
||||
consume_range = 6
|
||||
|
||||
@@ -35,7 +35,17 @@
|
||||
return 0
|
||||
|
||||
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
|
||||
|
||||
else if (isturf(A))
|
||||
var/turf/T = A
|
||||
var/dist = get_dist(T, src)
|
||||
@@ -51,6 +61,9 @@
|
||||
continue
|
||||
|
||||
if (dist > consume_range)
|
||||
if(!(AM.singuloCanEat()))
|
||||
continue
|
||||
|
||||
if (101 == AM.invisibility)
|
||||
continue
|
||||
|
||||
@@ -63,19 +76,19 @@
|
||||
var/image/riftimage = null
|
||||
|
||||
/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)
|
||||
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
|
||||
|
||||
var/new_x = 32 * (R.x - src.x) + R.pixel_x
|
||||
var/new_y = 32 * (R.y - src.y) + R.pixel_y
|
||||
var/new_x = 32 * (R.x - T_mob.x) + R.pixel_x
|
||||
var/new_y = 32 * (R.y - T_mob.y) + R.pixel_y
|
||||
riftimage.pixel_x = new_x
|
||||
riftimage.pixel_y = new_y
|
||||
riftimage.loc = src.loc
|
||||
riftimage.loc = T_mob
|
||||
|
||||
src << riftimage
|
||||
|
||||
else
|
||||
if(riftimage)
|
||||
qdel(riftimage)
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
var/global/universe_has_ended = 0
|
||||
|
||||
|
||||
/datum/universal_state/supermatter_cascade
|
||||
name = "Supermatter Cascade"
|
||||
@@ -11,9 +13,13 @@
|
||||
return 0
|
||||
|
||||
/datum/universal_state/supermatter_cascade/OnTurfChange(var/turf/T)
|
||||
var/turf/space/spess = T
|
||||
if(istype(spess))
|
||||
spess.overlays += "end01"
|
||||
if(istype(T, /turf/space))
|
||||
T.color = "#0066FF"
|
||||
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)
|
||||
if(istype(T,/turf/simulated/wall))
|
||||
@@ -46,13 +52,13 @@
|
||||
emergency_shuttle.recall()
|
||||
|
||||
AreaSet()
|
||||
OverlaySet()
|
||||
MiscSet()
|
||||
APCSet()
|
||||
AmbientSet()
|
||||
OverlayAndAmbientSet()
|
||||
|
||||
// Disable Nar-Sie.
|
||||
cult.allow_narsie = 0
|
||||
|
||||
PlayerSet()
|
||||
|
||||
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\[\[###!!!-
|
||||
|
||||
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")
|
||||
|
||||
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)
|
||||
ticker.declare_completion()
|
||||
ticker.station_explosion_cinematic(0,null) // TODO: Custom cinematic
|
||||
|
||||
world << "<B>Resetting in 30 seconds!</B>"
|
||||
|
||||
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()
|
||||
universe_has_ended = 1
|
||||
return
|
||||
|
||||
/datum/universal_state/supermatter_cascade/proc/AreaSet()
|
||||
for(var/area/A in world)
|
||||
if(A.z in config.admin_levels)
|
||||
for(var/area/A in all_areas)
|
||||
if(!istype(A,/area) || istype(A, /area/space) || istype(A,/area/beach))
|
||||
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()
|
||||
|
||||
/datum/universal_state/supermatter_cascade/proc/OverlaySet()
|
||||
for(var/turf/space/spess in world)
|
||||
spess.overlays += "end01"
|
||||
/datum/universal_state/supermatter_cascade/OverlayAndAmbientSet()
|
||||
spawn(0)
|
||||
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/atom/movable/lighting_overlay/L in world)
|
||||
if(!(L.z in config.admin_levels))
|
||||
L.update_lumcount(0.5, 1, 0)
|
||||
for(var/turf/space/T in turfs)
|
||||
T.color = "#0066FF"
|
||||
T.set_light(2, 2, "#0066FF")
|
||||
|
||||
/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))
|
||||
alm.ex_act(2)
|
||||
|
||||
/datum/universal_state/supermatter_cascade/proc/APCSet()
|
||||
for (var/obj/machinery/power/apc/APC in world)
|
||||
if (!(APC.stat & BROKEN))
|
||||
for (var/obj/machinery/power/apc/APC in machines)
|
||||
if (!(APC.stat & BROKEN) && !APC.is_critical)
|
||||
APC.chargemode = 0
|
||||
if(APC.cell)
|
||||
APC.cell.charge = 0
|
||||
|
||||
@@ -312,7 +312,7 @@ var/global/datum/controller/gameticker/ticker
|
||||
game_finished = (emergency_shuttle.returned() || mode.station_was_nuked)
|
||||
mode_finished = (!post_game && mode.check_finished())
|
||||
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
|
||||
|
||||
if(!mode.explosion_in_progress && game_finished && (mode_finished || post_game))
|
||||
|
||||
@@ -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))
|
||||
icon_state = "[((x + y) ^ ~(x * y) + z) % 25]"
|
||||
update_starlight()
|
||||
..()
|
||||
|
||||
/turf/space/proc/update_starlight()
|
||||
if(!config.starlight)
|
||||
|
||||
@@ -40,8 +40,13 @@
|
||||
spawn( 0 )
|
||||
src.Entered(AM)
|
||||
return
|
||||
turfs |= src
|
||||
return
|
||||
|
||||
/turf/Destroy()
|
||||
turfs -= src
|
||||
..()
|
||||
|
||||
/turf/ex_act(severity)
|
||||
return 0
|
||||
|
||||
|
||||
@@ -214,8 +214,8 @@
|
||||
/mob/living/simple_animal/hostile/proc/check_horde()
|
||||
if(emergency_shuttle.shuttle.location)
|
||||
if(!enroute && !target_mob) //The shuttle docked, all monsters rush for the escape hallway
|
||||
if(!shuttletarget || (get_dist(src, shuttletarget) >= 2))
|
||||
shuttletarget = pick(escape_list)
|
||||
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) //Pick a shuttle target
|
||||
enroute = 1
|
||||
stop_automated_movement = 1
|
||||
spawn()
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
var/datum/wires/apc/wires = null
|
||||
var/update_state = -1
|
||||
var/update_overlay = -1
|
||||
var/is_critical = 0
|
||||
var/global/status_overlays = 0
|
||||
var/updating_icon = 0
|
||||
var/global/list/status_overlays_lock
|
||||
|
||||
@@ -865,6 +865,7 @@ var/list/be_special_flags = list(
|
||||
#define SLIME 16
|
||||
#define SIMPLE_ANIMAL 32
|
||||
|
||||
|
||||
#define ALLMOBS (HUMAN|MONKEY|ALIEN|ROBOT|SLIME|SIMPLE_ANIMAL)
|
||||
|
||||
#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.
|
||||
#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 LIGHTING_LAYER 11
|
||||
#define OBFUSCATION_LAYER 14 //Where images covering the view for eyes are put
|
||||
#define SCREEN_LAYER 17 //Mob HUD/effects layer
|
||||
|
||||
|
||||
Reference in New Issue
Block a user