41 files changed, original only had 4. SPACES.

This commit is contained in:
LetterJay
2017-05-30 14:36:11 -05:00
parent 11344c4682
commit ae22a1876a
14 changed files with 43 additions and 222 deletions
+10 -6
View File
@@ -43,6 +43,10 @@ GLOBAL_LIST_EMPTY(explosions)
return
GLOB.explosions += src
if(isnull(flame_range))
flame_range = light_impact_range
if(isnull(flash_range))
flash_range = devastation_range
// Archive the uncapped explosion for the doppler array
var/orig_dev_range = devastation_range
@@ -121,7 +125,7 @@ GLOBAL_LIST_EMPTY(explosions)
E = new
E.set_up(epicenter)
E.start()
EX_PREPROCESS_CHECK_TICK
//flash mobs
@@ -188,7 +192,7 @@ GLOBAL_LIST_EMPTY(explosions)
var/throw_range = rand(throw_dist, max_range)
var/turf/throw_at = get_ranged_target_turf(I, throw_dir, throw_range)
I.throw_speed = EXPLOSION_THROW_SPEED //Temporarily change their throw_speed for embedding purposes (Reset when it finishes throwing, regardless of hitting anything)
I.throw_at(throw_at, throw_range, EXPLOSION_THROW_SPEED)
I.throw_at(throw_at, throw_range, EXPLOSION_THROW_SPEED)
//wait for the lists to repop
var/break_condition
@@ -204,7 +208,7 @@ GLOBAL_LIST_EMPTY(explosions)
if(!running)
break
//update the trackers
affTurfLen = affected_turfs.len
expBlockLen = cached_exp_block.len
@@ -270,7 +274,7 @@ GLOBAL_LIST_EMPTY(explosions)
. = list()
var/processed = 0
while(!stopped && running)
var/I
var/I
for(I in (processed + 1) to affected_turfs.len) // we cache the explosion block rating of every turf in the explosion area
var/turf/T = affected_turfs[I]
var/current_exp_block = T.density ? T.explosion_block : 0
@@ -285,12 +289,12 @@ GLOBAL_LIST_EMPTY(explosions)
for(var/obj/structure/blob/B in T)
current_exp_block += B.explosion_block
.[T] = current_exp_block
if(TICK_CHECK)
break
processed = I
stoplag()
-53
View File
@@ -1,53 +0,0 @@
diff a/code/datums/explosion.dm b/code/datums/explosion.dm (rejected hunks)
@@ -1,10 +1,48 @@
-/proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, ignorecap = 0, flame_range = 0 ,silent = 0, smoke = 1)
- set waitfor = 0
- src = null //so we don't abort once src is deleted
+GLOBAL_LIST_EMPTY(explosions)
+//Against my better judgement, I will return the explosion datum
+//If I see any GC errors for it I will find you
+//and I will gib you
+// --Cyberboss
+/proc/explosion(atom/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = TRUE, ignorecap = FALSE, flame_range = 0 , silent = FALSE, smoke = FALSE)
+ return new /datum/explosion(epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog, ignorecap, flame_range, silent, smoke)
+
+//This datum creates 3 threads
+//1 GatherSpiralTurfsProc runs spiral_range_turfs(tick_checked = TRUE) to populate the affected_turfs list
+//2 CaculateExplosionBlock adds the blockings to the cached_exp_block list
+//3 The main thread explodes the prepared turfs
+
+/datum/explosion
+ var/explosion_id
+ var/started_at
+ var/running = TRUE
+ var/stopped = 0 //This is the number of threads stopped !DOESN'T COUNT THREAD 2!
+ var/static/id_counter = 0
+
+#define EX_PREPROCESS_EXIT_CHECK \
+ if(!running) {\
+ stopped = 2;\
+ qdel(src);\
+ return;\
+ }
+
+#define EX_PREPROCESS_CHECK_TICK \
+ if(TICK_CHECK) {\
+ stoplag();\
+ EX_PREPROCESS_EXIT_CHECK\
+ }
+
+/datum/explosion/New(atom/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog, ignorecap, flame_range, silent, smoke)
+ set waitfor = FALSE
+
+ var/id = ++id_counter
+ explosion_id = id
+
epicenter = get_turf(epicenter)
if(!epicenter)
return
+ GLOB.explosions += src
+
// Archive the uncapped explosion for the doppler array
var/orig_dev_range = devastation_range
var/orig_heavy_range = heavy_impact_range
+32 -32
View File
@@ -28,8 +28,8 @@
var/list/our_overlays //our local copy of (non-priority) overlays without byond magic. Use procs in SSoverlays to manipulate
var/list/priority_overlays //overlays that should remain on top and not normally removed when using cut_overlay functions, like c4.
var/datum/proximity_monitor/proximity_monitor
var/datum/proximity_monitor/proximity_monitor
/atom/New(loc, ...)
//atom creation method that preloads variables at creation
if(GLOB.use_preloader && (src.type == GLOB._preloader.target_path))//in case the instanciated atom is creating other atoms in New()
@@ -39,21 +39,21 @@
var/do_initialize = SSatoms.initialized
if(do_initialize > INITIALIZATION_INSSATOMS)
args[1] = do_initialize == INITIALIZATION_INNEW_MAPLOAD
if(SSatoms.InitAtom(src, args))
//we were deleted
return
var/list/created = SSatoms.created_atoms
if(created)
created += src
args[1] = do_initialize == INITIALIZATION_INNEW_MAPLOAD
if(SSatoms.InitAtom(src, args))
//we were deleted
return
var/list/created = SSatoms.created_atoms
if(created)
created += src
//Called after New if the map is being loaded. mapload = TRUE
//Called from base of New if the map is being loaded. mapload = FALSE
//This base must be called or derivatives must set initialized to TRUE
//must not sleep
//This base must be called or derivatives must set initialized to TRUE
//must not sleep
//Other parameters are passed from New (excluding loc), this does not happen if mapload is TRUE
//Must return an Initialize hint. Defined in __DEFINES/subsystems.dm
//Must return an Initialize hint. Defined in __DEFINES/subsystems.dm
//Note: the following functions don't call the base for optimization and must copypasta:
// /turf/Initialize
@@ -76,23 +76,23 @@
if (opacity && isturf(loc))
var/turf/T = loc
T.has_opaque_atom = TRUE // No need to recalculate it in this case, it's guaranteed to be on afterwards anyways.
return INITIALIZE_HINT_NORMAL
return INITIALIZE_HINT_NORMAL
//called if Initialize returns INITIALIZE_HINT_LATELOAD
//This version shouldn't be called
/atom/proc/LateInitialize()
var/static/list/warned_types = list()
if(!warned_types[type])
WARNING("Old style LateInitialize behaviour detected in [type]!")
warned_types[type] = TRUE
Initialize(FALSE)
//called if Initialize returns INITIALIZE_HINT_LATELOAD
//This version shouldn't be called
/atom/proc/LateInitialize()
var/static/list/warned_types = list()
if(!warned_types[type])
WARNING("Old style LateInitialize behaviour detected in [type]!")
warned_types[type] = TRUE
Initialize(FALSE)
/atom/Destroy()
if(alternate_appearances)
for(var/K in alternate_appearances)
var/datum/atom_hud/alternate_appearance/AA = alternate_appearances[K]
AA.remove_from_hud(src)
for(var/K in alternate_appearances)
var/datum/atom_hud/alternate_appearance/AA = alternate_appearances[K]
AA.remove_from_hud(src)
if(reagents)
qdel(reagents)
@@ -100,8 +100,8 @@
LAZYCLEARLIST(priority_overlays)
//SSoverlays.processing -= src //we COULD do this, but it's better to just let it fall out of the processing queue
QDEL_NULL(light)
QDEL_NULL(light)
return ..()
/atom/proc/CanPass(atom/movable/mover, turf/target, height=1.5)
@@ -505,10 +505,10 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons)
/atom/proc/mech_melee_attack(obj/mecha/M)
return
//If a mob logouts/logins in side of an object you can use this proc
/atom/proc/on_log(login)
if(loc)
loc.on_log(login)
//If a mob logouts/logins in side of an object you can use this proc
/atom/proc/on_log(login)
if(loc)
loc.on_log(login)
/*
-9
View File
@@ -1,9 +0,0 @@
diff a/code/game/atoms.dm b/code/game/atoms.dm (rejected hunks)
@@ -267,6 +267,7 @@
return
/atom/proc/ex_act(severity, target)
+ set waitfor = FALSE
contents_explosion(severity, target)
/atom/proc/blob_act(obj/structure/blob/B)
@@ -1,10 +0,0 @@
diff a/code/game/objects/items/weapons/implants/implant_explosive.dm b/code/game/objects/items/weapons/implants/implant_explosive.dm (rejected hunks)
@@ -47,7 +47,7 @@
message_admins("[key_name_admin(imp_in)]<A HREF='?_src_=holder;adminmoreinfo=\ref[imp_in]'>?</A> (<A HREF='?_src_=holder;adminplayerobservefollow=\ref[imp_in]'>FLW</A>) has activated their [name] at <A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[imp_in.x];Y=[imp_in.y];Z=[imp_in.z]'>[A.name] (JMP)</a>.")
//If the delay is short, just blow up already jeez
if(delay <= 7)
- SSexplosion.Create(src,heavy,medium,weak,weak, flame_range = weak)
+ explosion(src,heavy,medium,weak,weak, flame_range = weak)
if(imp_in)
imp_in.gib(1)
qdel(src)
-24
View File
@@ -1,24 +0,0 @@
diff a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm (rejected hunks)
@@ -515,11 +515,11 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, AVerbsHideable())
var/flash_range = input("Flash range (in tiles):") as null|num
if(flash_range == null)
return
- if(devastation_range > SSexplosion.devastation_cap || heavy_impact_range > SSexplosion.heavy_cap || light_impact_range > SSexplosion.light_cap || flash_range > SSexplosion.flash_cap)
+ if(devastation_range > GLOB.MAX_EX_DEVESTATION_RANGE || heavy_impact_range > GLOB.MAX_EX_HEAVY_RANGE || light_impact_range > GLOB.MAX_EX_LIGHT_RANGE || flash_range > GLOB.MAX_EX_FLASH_RANGE)
if(alert("Bomb is bigger than the maxcap. Continue?",,"Yes","No") != "Yes")
return
epicenter = mob.loc //We need to reupdate as they may have moved again
- SSexplosion.Create(epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, TRUE, TRUE)
+ explosion(epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, TRUE, TRUE)
message_admins("[ADMIN_LOOKUPFLW(usr)] creating an admin explosion at [epicenter.loc].")
log_admin("[key_name(usr)] created an admin explosion at [epicenter.loc].")
feedback_add_details("admin_verb","Drop Bomb") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -532,7 +532,7 @@ GLOBAL_LIST_INIT(admin_verbs_hideable, AVerbsHideable())
var/ex_power = input("Explosive Power:") as null|num
var/turf/epicenter = mob.loc
if(ex_power && epicenter)
- SSexplosion.CreateDynamic(epicenter, ex_power)
+ dyn_explosion(epicenter, ex_power)
message_admins("[ADMIN_LOOKUPFLW(usr)] creating an admin explosion at [epicenter.loc].")
log_admin("[key_name(usr)] created an admin explosion at [epicenter.loc].")
feedback_add_details("admin_verb","Drop Dynamic Bomb") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
-29
View File
@@ -1,29 +0,0 @@
diff a/code/modules/admin/secrets.dm b/code/modules/admin/secrets.dm (rejected hunks)
@@ -386,19 +386,19 @@
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","BC")
- var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be above 4)", "New Bomb Cap", SSexplosion.light_cap) as num|null
+ var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be above 4)", "New Bomb Cap", GLOB.MAX_EX_LIGHT_RANGE) as num|null
if (newBombCap < 4)
return
- SSexplosion.devastation_cap = round(newBombCap/4)
- SSexplosion.heavy_cap = round(newBombCap/2)
- SSexplosion.light_cap = newBombCap
+ GLOB.MAX_EX_DEVESTATION_RANGE = round(newBombCap/4)
+ GLOB.MAX_EX_HEAVY_RANGE = round(newBombCap/2)
+ GLOB.MAX_EX_LIGHT_RANGE = newBombCap
//I don't know why these are their own variables, but fuck it, they are.
- SSexplosion.flash_cap = newBombCap
- SSexplosion.flame_cap = newBombCap
+ GLOB.MAX_EX_FLASH_RANGE = newBombCap
+ GLOB.MAX_EX_FLAME_RANGE = newBombCap
- message_admins("<span class='boldannounce'>[key_name_admin(usr)] changed the bomb cap to [SSexplosion.devastation_cap], [SSexplosion.heavy_cap], [SSexplosion.light_cap]</span>")
- log_admin("[key_name(usr)] changed the bomb cap to [SSexplosion.devastation_cap], [SSexplosion.heavy_cap], [SSexplosion.light_cap]")
+ message_admins("<span class='boldannounce'>[key_name_admin(usr)] changed the bomb cap to [GLOB.MAX_EX_DEVESTATION_RANGE], [GLOB.MAX_EX_HEAVY_RANGE], [GLOB.MAX_EX_LIGHT_RANGE]</span>")
+ log_admin("[key_name(usr)] changed the bomb cap to [GLOB.MAX_EX_DEVESTATION_RANGE], [GLOB.MAX_EX_HEAVY_RANGE], [GLOB.MAX_EX_LIGHT_RANGE]")
if("lightsout")
@@ -1,10 +0,0 @@
diff a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm (rejected hunks)
@@ -557,7 +557,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if (alert(src, "Are you sure you want to do this? It will laaag.", "Confirmation", "Yes", "No") == "No")
return
- SSexplosion.Create(O, devastation, heavy, light, flash, null, null,flames)
+ explosion(O, devastation, heavy, light, flash, null, null,flames)
log_admin("[key_name(usr)] created an explosion ([devastation],[heavy],[light],[flames]) at ([O.x],[O.y],[O.z])")
message_admins("[key_name_admin(usr)] created an explosion ([devastation],[heavy],[light],[flames]) at ([O.x],[O.y],[O.z])")
feedback_add_details("admin_verb","Explosion") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -1,10 +0,0 @@
diff a/code/modules/mob/living/carbon/human/species_types/golems.dm b/code/modules/mob/living/carbon/human/species_types/golems.dm (rejected hunks)
@@ -72,7 +72,7 @@
special_names = list("Flood","Fire","Bar","Man")
/datum/species/golem/plasma/spec_death(gibbed, mob/living/carbon/human/H)
- SSexplosion.Create(get_turf(H),0,1,2,flame_range = 5)
+ explosion(get_turf(H),0,1,2,flame_range = 5)
if(H)
H.gib()
@@ -1,10 +0,0 @@
diff a/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/dragon.dm (rejected hunks)
@@ -130,7 +130,7 @@ Difficulty: Medium
playsound(T,'sound/magic/Fireball.ogg', 200, 1)
new /obj/effect/overlay/temp/fireball(T)
sleep(12)
- SSexplosion.Create(T, 0, 0, 1, 0, 0, 0, 1)
+ explosion(T, 0, 0, 1, 0, 0, 0, 1)
/mob/living/simple_animal/hostile/megafauna/dragon/OpenFire()
anger_modifier = Clamp(((maxHealth - health)/50),0,20)
@@ -1,10 +0,0 @@
diff a/code/modules/power/supermatter/supermatter.dm b/code/modules/power/supermatter/supermatter.dm (rejected hunks)
@@ -174,7 +174,7 @@
S.consume(src)
else
investigate_log("has exploded.", "supermatter")
- SSexplosion.Create(get_turf(T), explosion_power * max(gasmix_power_ratio, 0.205) * 0.5 , explosion_power * max(gasmix_power_ratio, 0.205) + 2, explosion_power * max(gasmix_power_ratio, 0.205) + 4 , explosion_power * max(gasmix_power_ratio, 0.205) + 6, 1, 1)
+ explosion(get_turf(T), explosion_power * max(gasmix_power_ratio, 0.205) * 0.5 , explosion_power * max(gasmix_power_ratio, 0.205) + 2, explosion_power * max(gasmix_power_ratio, 0.205) + 4 , explosion_power * max(gasmix_power_ratio, 0.205) + 6, 1, 1)
if(power > CRITICAL_POWER_PENALTY_THRESHOLD)
investigate_log("has spawned additional energy balls.", "supermatter")
var/obj/singularity/energy_ball/E = new(T)
-10
View File
@@ -1,10 +0,0 @@
diff a/code/modules/research/experimentor.dm b/code/modules/research/experimentor.dm (rejected hunks)
@@ -352,7 +352,7 @@
FB.fire()
else if(prob(EFFECT_PROB_LOW-badThingCoeff))
visible_message("<span class='danger'>[src] malfunctions, melting [exp_on] and releasing a burst of flame!</span>")
- SSexplosion.Create(src.loc, -1, 0, 0, 0, 0, flame_range = 2)
+ explosion(src.loc, -1, 0, 0, 0, 0, flame_range = 2)
investigate_log("Experimentor started a fire.", "experimentor")
ejectItem(TRUE)
else if(prob(EFFECT_PROB_MEDIUM-badThingCoeff))
+1
View File
@@ -246,6 +246,7 @@
#include "code\datums\dna.dm"
#include "code\datums\dog_fashion.dm"
#include "code\datums\emotes.dm"
#include "code\datums\explosion.dm"
#include "code\datums\forced_movement.dm"
#include "code\datums\holocall.dm"
#include "code\datums\hud.dm"
-9
View File
@@ -1,9 +0,0 @@
diff a/tgstation.dme b/tgstation.dme (rejected hunks)
@@ -212,6 +211,7 @@
#include "code\datums\dna.dm"
#include "code\datums\dog_fashion.dm"
#include "code\datums\emotes.dm"
+#include "code\datums\explosion.dm"
#include "code\datums\forced_movement.dm"
#include "code\datums\hud.dm"
#include "code\datums\map_config.dm"