Merge pull request #9483 from PsiOmegaDelta/150526-EndGameTweaks

End game tweaks
This commit is contained in:
Chinsky
2015-05-31 23:55:08 +03:00
20 changed files with 125 additions and 112 deletions
-10
View File
@@ -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
. = ..()
+2
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/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]
+3
View File
@@ -23,6 +23,9 @@
/turf/simulated/wall/cult/cultify()
return
/turf/unsimulated/wall/cult/cultify()
return
/turf/unsimulated/beach/cultify()
return
+19 -24
View File
@@ -33,51 +33,46 @@ In short:
/datum/universal_state/hell/OnTurfChange(var/turf/T)
var/turf/space/spess = T
if(istype(spess))
spess.overlays += "hell01"
var/turf/space/S = T
if(istype(S))
S.color = "#FF0000"
else
S.color = initial(S.color)
// 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)
OnTurfChange(T)
/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 +82,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"
@@ -37,7 +38,7 @@ var/global/list/narsie_list = list()
current_size = 12
consume_range = 12 // How many tiles out do we eat.
var/announce=1
var/narnar = 1
var/cause_hell = 1
/obj/singularity/narsie/large/New()
..()
@@ -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(cause_hell)
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()
@@ -83,14 +86,14 @@ var/global/list/narsie_list = list()
/obj/singularity/narsie/large/Bump(atom/A)
if(!narnar) return
if(!cause_hell) return
if(isturf(A))
narsiewall(A)
else if(istype(A, /obj/structure/cult))
qdel(A)
/obj/singularity/narsie/large/Bumped(atom/A)
if(!narnar) return
if(!cause_hell) return
if(isturf(A))
narsiewall(A)
else if(istype(A, /obj/structure/cult))
+3
View File
@@ -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))
@@ -8,9 +8,9 @@
move_self = 0
announce=0
narnar=0
cause_hell=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,11 @@
return 0
/datum/universal_state/supermatter_cascade/OnTurfChange(var/turf/T)
var/turf/space/spess = T
if(istype(spess))
spess.overlays += "end01"
var/turf/space/S = T
if(istype(S))
S.color = "#0066FF"
else
S.color = initial(S.color)
/datum/universal_state/supermatter_cascade/DecayTurf(var/turf/T)
if(istype(T,/turf/simulated/wall))
@@ -46,13 +50,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 +68,49 @@ 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)
OnTurfChange(T)
/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
+1 -1
View File
@@ -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))
+1
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))
icon_state = "[((x + y) ^ ~(x * y) + z) % 25]"
update_starlight()
..()
/turf/space/proc/update_starlight()
if(!config.starlight)
+5
View File
@@ -40,8 +40,13 @@
spawn( 0 )
src.Entered(AM)
return
turfs |= src
return
/turf/Destroy()
turfs -= src
..()
/turf/ex_act(severity)
return 0
+2 -2
View File
@@ -2270,14 +2270,14 @@
if("hellonearth")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","NS")
var/choice = input("You sure you want to end the round and summon narsie at your location? Misuse of this could result in removal of flags or halarity.") in list("PRAISE SATAN", "Cancel")
var/choice = input("You sure you want to end the round and summon narsie at your location? Misuse of this could result in removal of flags or hilarity.") in list("PRAISE SATAN", "Cancel")
if(choice == "PRAISE SATAN")
new /obj/singularity/narsie/large(get_turf(usr))
message_admins("[key_name_admin(usr)] has summoned narsie and brought about a new realm of suffering.")
if("supermattercascade")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","SC")
var/choice = input("You sure you want to destroy the universe and create a large explosion at your location? Misuse of this could result in removal of flags or halarity.") in list("NO TIME TO EXPLAIN", "Cancel")
var/choice = input("You sure you want to destroy the universe and create a large explosion at your location? Misuse of this could result in removal of flags or hilarity.") in list("NO TIME TO EXPLAIN", "Cancel")
if(choice == "NO TIME TO EXPLAIN")
explosion(get_turf(usr), 8, 16, 24, 32, 1)
new /turf/unsimulated/wall/supermatter(get_turf(usr))
@@ -240,11 +240,12 @@
////////////////Glow//////////////////
/mob/living/simple_animal/construct/proc/add_glow()
overlays = 0
var/overlay_layer = 11
var/overlay_layer = LIGHTING_LAYER+0.1
if(layer != MOB_LAYER)
overlay_layer=TURF_LAYER+0.2
overlays += image(icon,"glow-[icon_state]",overlay_layer)
set_light(2, -2, l_color = "#FFFFFF")
////////////////HUD//////////////////////
@@ -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()
+5 -2
View File
@@ -37,6 +37,8 @@
//NOTE: STUFF STOLEN FROM AIRLOCK.DM thx
/obj/machinery/power/apc/critical
is_critical = 1
/obj/machinery/power/apc/high
cell_type = /obj/item/weapon/cell/high
@@ -44,8 +46,8 @@
/obj/machinery/power/apc/super
cell_type = /obj/item/weapon/cell/super
/obj/machinery/power/apc/super/equipment
equipment = 2
/obj/machinery/power/apc/super/critical
is_critical = 1
/obj/machinery/power/apc/hyper
cell_type = /obj/item/weapon/cell/hyper
@@ -94,6 +96,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
+3
View File
@@ -78,6 +78,9 @@
return 5000
/obj/machinery/power/supermatter/singularity_act()
if(!src.loc)
return
var/prints = ""
if(src.fingerprintshidden)
prints = ", all touchers : " + src.fingerprintshidden
+2
View File
@@ -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