mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 03:27:05 +01:00
Explosion Overhaul
This commit is contained in:
@@ -35,7 +35,7 @@
|
||||
if(!epicenter) return
|
||||
|
||||
var/max_range = max(devastation_range, heavy_impact_range, light_impact_range, flame_range)
|
||||
var/list/cached_exp_block = new
|
||||
var/list/cached_exp_block = list()
|
||||
|
||||
if(adminlog)
|
||||
message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range], [flame_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z]) (<A HREF='?_src_=holder;adminplayerobservecoodjump=1;X=[epicenter.x];Y=[epicenter.y];Z=[epicenter.z]'>JMP</a>)")
|
||||
@@ -84,10 +84,10 @@
|
||||
var/y0 = epicenter.y
|
||||
var/z0 = epicenter.z
|
||||
|
||||
var/list/affected_turfs = trange(max_range, epicenter)
|
||||
|
||||
if(config.reactionary_explosions)
|
||||
// Cache the explosion block rating of every turf in the explosion area so
|
||||
// exploded turfs don't leave the explosion lopsided
|
||||
for(var/turf/T in trange(max_range, epicenter))
|
||||
for(var/turf/T in affected_turfs) // we cache the explosion block rating of every turf in the explosion area
|
||||
cached_exp_block[T] = 0
|
||||
if(T.density && T.explosion_block)
|
||||
cached_exp_block[T] += T.explosion_block
|
||||
@@ -96,7 +96,7 @@
|
||||
if(D.density && D.explosion_block)
|
||||
cached_exp_block[T] += D.explosion_block
|
||||
|
||||
for(var/turf/T in trange(max_range, epicenter))
|
||||
for(var/turf/T in affected_turfs)
|
||||
|
||||
var/dist = cheap_hypotenuse(T.x, T.y, x0, y0)
|
||||
|
||||
@@ -123,9 +123,23 @@
|
||||
if(flame_dist && prob(40) && !istype(T, /turf/space) && !T.density)
|
||||
new /obj/effect/hotspot(T) //Mostly for ambience!
|
||||
if(dist > 0)
|
||||
for(var/atom_movable in T.contents) //bypass type checking since only atom/movable can be contained by turfs anyway
|
||||
var/atom/movable/AM = atom_movable
|
||||
if(AM && AM.simulated) AM.ex_act(dist)
|
||||
if(istype(T, /turf/simulated))
|
||||
var/turf/simulated/S = T
|
||||
var/affecting_level
|
||||
if(dist == 1)
|
||||
affecting_level = 1
|
||||
else
|
||||
affecting_level = S.is_shielded() ? 2 : (S.intact ? 2 : 1)
|
||||
for(var/atom_movable in S.contents) //bypass type checking since only atom/movable can be contained by turfs anyway
|
||||
var/atom/movable/AM = atom_movable
|
||||
if(AM && AM.simulated)
|
||||
if(AM.level >= affecting_level)
|
||||
AM.ex_act(dist)
|
||||
else
|
||||
for(var/atom_movable in T.contents) //bypass type checking since only atom/movable can be contained by turfs anyway
|
||||
var/atom/movable/AM = atom_movable
|
||||
if(AM && AM.simulated)
|
||||
AM.ex_act(dist)
|
||||
T.ex_act(dist)
|
||||
|
||||
//--- THROW ITEMS AROUND ---
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/obj/structure/window/full
|
||||
sheets = 2
|
||||
dir=SOUTHWEST
|
||||
level = 3
|
||||
|
||||
/obj/structure/window/full/CheckExit(atom/movable/O as mob|obj, target as turf)
|
||||
return 1
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
layer = 2.9
|
||||
var/health = 10
|
||||
var/destroyed = 0
|
||||
level = 3
|
||||
|
||||
|
||||
/obj/structure/grille/fence/
|
||||
|
||||
@@ -167,4 +167,6 @@
|
||||
|
||||
/turf/simulated/ChangeTurf(var/path)
|
||||
. = ..()
|
||||
smooth_icon_neighbors(src)
|
||||
smooth_icon_neighbors(src)
|
||||
|
||||
/turf/simulated/proc/is_shielded()
|
||||
@@ -64,7 +64,8 @@ var/list/wood_icons = list("wood","wood-broken")
|
||||
// return ..()
|
||||
|
||||
/turf/simulated/floor/ex_act(severity)
|
||||
//set src in oview(1)
|
||||
if(is_shielded())
|
||||
return
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
src.ChangeTurf(/turf/space)
|
||||
@@ -100,6 +101,11 @@ var/list/wood_icons = list("wood","wood-broken")
|
||||
if(W.dir == dir_to || W.is_fulltile()) //Same direction or diagonal (full tile)
|
||||
W.fire_act(adj_air, adj_temp, adj_volume)
|
||||
|
||||
/turf/simulated/floor/is_shielded()
|
||||
for(var/obj/structure/A in contents)
|
||||
if(A.level == 3)
|
||||
return 1
|
||||
|
||||
/turf/simulated/floor/blob_act()
|
||||
return
|
||||
|
||||
@@ -217,4 +223,4 @@ var/list/wood_icons = list("wood","wood-broken")
|
||||
ChangeTurf(/turf/simulated/floor/engine/cult)
|
||||
|
||||
/turf/simulated/floor/can_have_cabling()
|
||||
return !burnt & !broken
|
||||
return !burnt && !broken
|
||||
|
||||
@@ -198,3 +198,6 @@
|
||||
|
||||
/turf/space/singularity_act()
|
||||
return
|
||||
|
||||
/turf/space/can_have_cabling()
|
||||
return 0
|
||||
@@ -170,6 +170,10 @@
|
||||
|
||||
W.levelupdate()
|
||||
W.CalculateAdjacentTurfs()
|
||||
|
||||
if(!can_have_cabling())
|
||||
for(var/obj/structure/cable/C in contents)
|
||||
qdel(C)
|
||||
return W
|
||||
|
||||
//////Assimilate Air//////
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
|
||||
author: Fox McCloud
|
||||
|
||||
delete-after: True
|
||||
|
||||
changes:
|
||||
- tweak: "Explosions will no longer destroy things underneath turfs until the turf is exposed."
|
||||
Reference in New Issue
Block a user