Area cleanup, Minor BST tweaks, Nuke Fixes, Explosion fixes (#3164)

changes:

Ported some timer fixes from /tg/ (timerid overflow fix, invalid deltimer logging)
Removed pointless air alarm elections.
Cleaned up some area code and moved area var definitions into areas.dm.
The nuke now only destroys Zs connected to the Z it detonates on. (Fixes #2552)
The nuke no longer destroys CC.
Nukes now dust mobs.
Cascades now dust all mobs on all non-admin levels.
Fixed a bug where SSexplosives would not honor the is_rec var.
Improved the efficiency of /proc/random_station_area().
Bluespace Bugs can now teleport out again.
Bluespace Technicians can now turn off their x-ray vision without needing to remove their glasses.
Human-types no longer make footstep sounds when lying down, unconscious, or dead.
This commit is contained in:
Lohikar
2017-07-27 18:10:38 +03:00
committed by Erki
parent 8756ee6f68
commit cfb7357c6f
17 changed files with 176 additions and 191 deletions
+3 -3
View File
@@ -71,7 +71,7 @@ var/datum/controller/subsystem/explosives/SSexplosives
var/z_transfer = data.z_transfer
var/power = data.rec_pow
if(config.use_recursive_explosions)
if(data.is_rec)
explosion_rec(epicenter, power)
return
@@ -82,9 +82,9 @@ var/datum/controller/subsystem/explosives/SSexplosives
// Handles recursive propagation of explosions.
if(devastation_range > 2 || heavy_impact_range > 2)
if(HasAbove(epicenter.z) && z_transfer & UP)
global.explosion(GetAbove(epicenter), max(0, devastation_range - 2), max(0, heavy_impact_range - 2), max(0, light_impact_range - 2), max(0, flash_range - 2), 0, UP)
global.explosion(GetAbove(epicenter), max(0, devastation_range - 2), max(0, heavy_impact_range - 2), max(0, light_impact_range - 2), max(0, flash_range - 2), 0, UP, is_rec = FALSE)
if(HasBelow(epicenter.z) && z_transfer & DOWN)
global.explosion(GetAbove(epicenter), max(0, devastation_range - 2), max(0, heavy_impact_range - 2), max(0, light_impact_range - 2), max(0, flash_range - 2), 0, DOWN)
global.explosion(GetAbove(epicenter), max(0, devastation_range - 2), max(0, heavy_impact_range - 2), max(0, light_impact_range - 2), max(0, flash_range - 2), 0, DOWN, is_rec = FALSE)
var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flash_range)
+21 -21
View File
@@ -433,19 +433,20 @@ var/datum/controller/subsystem/ticker/SSticker
CHECK_TICK
/datum/controller/subsystem/ticker/proc/station_explosion_cinematic(station_missed = 0, override = null)
/datum/controller/subsystem/ticker/proc/station_explosion_cinematic(station_missed = 0, override = null, list/affected_levels = config.station_levels)
if (cinematic)
return //already a cinematic in progress!
//initialise our cinematic screen object
cinematic = new(src)
cinematic.icon = 'icons/effects/station_explosion.dmi'
cinematic.icon_state = "station_intact"
cinematic.layer = 20
cinematic.mouse_opacity = 0
cinematic.screen_loc = "1,0"
cinematic = new /obj/screen{
icon = 'icons/effects/station_explosion.dmi';
icon_state = "station_intact";
layer = 20;
mouse_opacity = 0;
screen_loc = "1,0"
}
var/obj/structure/bed/temp_buckle = new(src)
var/obj/structure/bed/temp_buckle = new
//Incredibly hackish. It creates a bed within the gameticker (lol) to stop mobs running around
if(station_missed)
for(var/mob/living/M in living_mob_list)
@@ -458,15 +459,17 @@ var/datum/controller/subsystem/ticker/SSticker
if(M.client)
M.client.screen += cinematic
switch(M.z)
if(0) //inside a crate or something
var/turf/T = get_turf(M)
if(T && T.z in config.station_levels) //we don't use M.death(0) because it calls a for(/mob) loop and
M.health = 0
M.stat = DEAD
if(1) //on a z-level 1 turf.
M.health = 0
M.stat = DEAD
var/turf/Mloc = M.loc
if (!Mloc)
continue
if (!istype(Mloc))
Mloc = get_turf(M)
if (Mloc.z in affected_levels)
M.dust()
CHECK_TICK
//Now animate the cinematic
switch(station_missed)
@@ -491,7 +494,6 @@ var/datum/controller/subsystem/ticker/SSticker
sleep(50)
world << sound('sound/effects/explosionfar.ogg')
else //station was destroyed
if( mode && !override )
override = mode.name
@@ -520,9 +522,7 @@ var/datum/controller/subsystem/ticker/SSticker
flick("station_explode_fade_red", cinematic)
world << sound('sound/effects/explosionfar.ogg')
cinematic.icon_state = "summary_selfdes"
for(var/mob/living/M in living_mob_list)
if(M.loc.z in config.station_levels)
M.death()//No mercy
//If its actually the end of the round, wait for it to end.
//Otherwise if its a verb it will continue on afterwards.
sleep(300)
+14 -5
View File
@@ -1,5 +1,7 @@
#define BUCKET_LEN (world.fps*1*60) //how many ticks should we keep in the bucket. (1 minutes worth)
#define BUCKET_POS(timer) (round((timer.timeToRun - SStimer.head_offset) / world.tick_lag) + 1)
#define TIMER_ID_MAX (2**24) //max float with integer precision
var/datum/controller/subsystem/timer/SStimer
/datum/controller/subsystem/timer
@@ -233,18 +235,23 @@ var/datum/controller/subsystem/timer/SStimer
var/static/nextid = 1
/datum/timedevent/New(datum/callback/callBack, timeToRun, flags, hash)
id = nextid++
id = TIMER_ID_NULL
src.callBack = callBack
src.timeToRun = timeToRun
src.flags = flags
src.hash = hash
name = "Timer: [id]: TTR: [timeToRun], Flags: [jointext(bitfield2list(flags, list("TIMER_UNIQUE", "TIMER_OVERRIDE", "TIMER_CLIENT_TIME", "TIMER_STOPPABLE", "TIMER_NO_HASH_WAIT")), ", ")], callBack: \ref[callBack], callBack.object: [callBack.object]\ref[callBack.object]([getcallingtype()]), callBack.delegate:[callBack.delegate]([callBack.arguments ? callBack.arguments.Join(", ") : ""])"
if (flags & TIMER_UNIQUE)
SStimer.hashes[hash] = src
if (flags & TIMER_STOPPABLE)
SStimer.timer_id_dict["timerid[id]"] = src
do
if (nextid >= TIMER_ID_MAX)
nextid = 1
id = nextid++
while(SStimer.timer_id_dict["timerid" + num2text(id, 8)])
SStimer.timer_id_dict["timerid" + num2text(id, 8)] = src
name = "Timer: " + num2text(id, 8) + ", TTR: [timeToRun], Flags: [jointext(bitfield2list(flags, list("TIMER_UNIQUE", "TIMER_OVERRIDE", "TIMER_CLIENT_TIME", "TIMER_STOPPABLE", "TIMER_NO_HASH_WAIT")), ", ")], callBack: \ref[callBack], callBack.object: [callBack.object]\ref[callBack.object]([getcallingtype()]), callBack.delegate:[callBack.delegate]([callBack.arguments ? callBack.arguments.Join(", ") : ""])"
if (callBack.object != GLOBAL_PROC)
LAZYADD(callBack.object.active_timers, src)
@@ -392,6 +399,8 @@ var/datum/controller/subsystem/timer/SStimer
/proc/deltimer(id)
if (!id)
return FALSE
if (id == TIMER_ID_NULL)
CRASH("Tried to delete a null timerid. Use the TIMER_STOPPABLE flag.")
if (!istext(id))
if (istype(id, /datum/timedevent))
qdel(id)