Makes Explosion and Singulo Defer Based on CPU

This commit is contained in:
Fox-McCloud
2016-04-30 05:17:45 -04:00
parent 12b6b22aad
commit 2d90585ecc
10 changed files with 100 additions and 88 deletions
+8 -17
View File
@@ -1,18 +1,5 @@
//TODO: Flash range does nothing currently
/proc/trange(var/Dist=0,var/turf/Center=null)//alternative to range (ONLY processes turfs and thus less intensive)
if(Center==null) return
//var/x1=((Center.x-Dist)<1 ? 1 : Center.x-Dist)
//var/y1=((Center.y-Dist)<1 ? 1 : Center.y-Dist)
//var/x2=((Center.x+Dist)>world.maxx ? world.maxx : Center.x+Dist)
//var/y2=((Center.y+Dist)>world.maxy ? world.maxy : Center.y+Dist)
var/turf/x1y1 = locate(((Center.x-Dist)<1 ? 1 : Center.x-Dist),((Center.y-Dist)<1 ? 1 : Center.y-Dist),Center.z)
var/turf/x2y2 = locate(((Center.x+Dist)>world.maxx ? world.maxx : Center.x+Dist),((Center.y+Dist)>world.maxy ? world.maxy : Center.y+Dist),Center.z)
return block(x1y1,x2y2)
/proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, ignorecap = 0, flame_range = 0 ,silent = 0)
src = null //so we don't abort once src is deleted
epicenter = get_turf(epicenter)
@@ -84,7 +71,7 @@
var/y0 = epicenter.y
var/z0 = epicenter.z
var/list/affected_turfs = trange(max_range, epicenter)
var/list/affected_turfs = spiral_range_turfs(max_range, epicenter)
if(config.reactionary_explosions)
for(var/A in affected_turfs) // we cache the explosion block rating of every turf in the explosion area
@@ -96,10 +83,12 @@
for(var/obj/machinery/door/D in T)
if(D.density && D.explosion_block)
cached_exp_block[T] += D.explosion_block
CHECK_TICK
for(var/A in affected_turfs)
var/turf/T = A
if(!T)
continue
var/dist = cheap_hypotenuse(T.x, T.y, x0, y0)
if(config.reactionary_explosions)
@@ -142,8 +131,10 @@
var/atom/AM = atom
if(AM && AM.simulated)
AM.ex_act(dist)
CHECK_TICK
T.ex_act(dist)
CHECK_TICK
//--- THROW ITEMS AROUND ---
/*
if(throw_dist > 0)
@@ -172,7 +163,7 @@
/proc/secondaryexplosion(turf/epicenter, range)
for(var/turf/tile in trange(range, epicenter))
for(var/turf/tile in spiral_range_turfs(range, epicenter))
tile.ex_act(2)
/client/proc/check_bomb_impacts()
@@ -213,7 +204,7 @@
var/x0 = epicenter.x
var/y0 = epicenter.y
var/list/wipe_colours = list()
for(var/turf/T in trange(max_range, epicenter))
for(var/turf/T in spiral_range_turfs(max_range, epicenter))
wipe_colours += T
var/dist = cheap_hypotenuse(T.x, T.y, x0, y0)
@@ -342,7 +342,7 @@
F.set_up(amount, 0, src.loc)
F.start()
if(blast)
for(var/turf/T in trange(2, src.loc))
for(var/turf/T in spiral_range_turfs(2, src.loc))
Chilled(T)
return
+1
View File
@@ -53,6 +53,7 @@
/obj/item/proc/is_used_on(obj/O, mob/user)
/obj/proc/process()
set waitfor = 0
processing_objects.Remove(src)
return 0