diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index e512fefc53a..a25c43cbbaf 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -62,6 +62,7 @@ var/automute_on = 0 //enables automuting/spam prevention var/jobs_have_minimal_access = 0 //determines whether jobs use minimal access or expanded access. + var/reactionary_explosions = 0 //If we use reactionary explosions, explosions that react to walls and doors var/assistantlimit = 0 //enables assistant limiting var/assistantratio = 2 //how many assistants to security members @@ -340,6 +341,9 @@ if("protect_roles_from_antagonist") config.protect_roles_from_antagonist = 1 + if("reactionary_explosions") + config.reactionary_explosions = 1 + if ("probability") var/prob_pos = findtext(value, " ") var/prob_name = null diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 108c4c8b2f6..d5317a1586d 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -22,6 +22,10 @@ var/global/list/ghdel_profiling = list() // replaced by OPENCONTAINER flags and atom/proc/is_open_container() ///Chemistry. + + //Value used to increment ex_act() if reactionary_explosions is on + var/explosion_block = 0 + //Detective Work, used for the duplicate data points kept in the scanners var/list/original_atom diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm index 64f9bc02add..ec8b45ef78b 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -49,6 +49,7 @@ var/hasShocked = 0 //Prevents multiple shocks from happening var/frozen = 0 //special condition for airlocks that are frozen shut, this will look weird on not normal airlocks because of a lack of special overlays. autoclose = 1 + explosion_block = 1 /obj/machinery/door/airlock/command name = "Airlock" @@ -283,6 +284,7 @@ name = "High Tech Security Airlock" icon = 'icons/obj/doors/hightechsecurity.dmi' assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity + explosion_block = 2 /obj/machinery/door/airlock/highsecurity/red name = "Secure Armory Airlock" diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm index 7348a57181c..36f62d6befd 100644 --- a/code/game/machinery/doors/poddoor.dm +++ b/code/game/machinery/doors/poddoor.dm @@ -4,6 +4,7 @@ icon = 'icons/obj/doors/rapid_pdoor.dmi' icon_state = "pdoor1" var/id = 1.0 + explosion_block = 3 /obj/machinery/door/poddoor/preopen icon_state = "pdoor0" @@ -24,6 +25,30 @@ else return 0 +//"BLAST" doors are obviously stronger than regular doors when it comes to BLASTS. +/obj/machinery/door/poddoor/ex_act(severity, target) + switch(severity) + if(1.0) + if(prob(80)) + qdel(src) + else + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(2, 1, src) + s.start() + if(2.0) + if(prob(20)) + qdel(src) + else + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(2, 1, src) + s.start() + + if(3.0) + if(prob(80)) + var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread + s.set_up(2, 1, src) + s.start() + /obj/machinery/door/poddoor/attackby(obj/item/weapon/C as obj, mob/user as mob, params) src.add_fingerprint(user) if (!( istype(C, /obj/item/weapon/crowbar) || (istype(C, /obj/item/weapon/twohanded/fireaxe) && C:wielded == 1) )) diff --git a/code/game/machinery/doors/unpowered.dm b/code/game/machinery/doors/unpowered.dm index 8e03e874a71..90e71dc7b83 100644 --- a/code/game/machinery/doors/unpowered.dm +++ b/code/game/machinery/doors/unpowered.dm @@ -1,7 +1,7 @@ /obj/machinery/door/unpowered autoclose = 0 var/locked = 0 - + explosion_block = 1 Bumped(atom/AM) if(src.locked) diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index d8a5172888f..139788890b9 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -74,16 +74,40 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa for(var/turf/T in trange(max_range, epicenter)) var/dist = cheap_pythag(T.x - x0,T.y - y0) + if(config.reactionary_explosions) + var/turf/Trajectory = T + while(Trajectory != epicenter) + Trajectory = get_step_towards(Trajectory, epicenter) + if(Trajectory.density && Trajectory.explosion_block) + dist += Trajectory.explosion_block + + for(var/obj/machinery/door/D in Trajectory) + if(D.density && D.explosion_block) + dist += D.explosion_block + + var/throw_dist = dist + if(dist < devastation_range) dist = 1 else if(dist < heavy_impact_range) dist = 2 else if(dist < light_impact_range) dist = 3 - else continue + else dist = 0 - T.ex_act(dist) if(T) - 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.ex_act(dist) +// if(flame_dist && prob(40) && !istype(T, /turf/space) && !T.density) +// PoolOrNew(/obj/effect/hotspot, T) //Mostly for ambience! + if(dist > 0) + T.ex_act(dist) + + //--- THROW ITEMS AROUND --- + + var/throw_dir = get_dir(epicenter,T) + for(var/obj/item/I in T) + spawn(0) //Simultaneously not one at a time + if(I) + var/throw_range = rand(throw_dist, max_range) + var/turf/throw_at = get_ranged_target_turf(I, throw_dir, throw_range) + I.throw_speed = 4 //Temporarily change their throw_speed for embedding purposes (Reset when it finishes throwing, regardless of hitting anything) + I.throw_at(throw_at, throw_range, 2)//Throw it at 2 speed, this is purely visual anyway. var/took = (world.timeofday-start)/10 //You need to press the DebugGame verb to see these now....they were getting annoying and we've collected a fair bit of data. Just -test- changes to explosion code using this please so we can compare @@ -109,3 +133,71 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa proc/secondaryexplosion(turf/epicenter, range) for(var/turf/tile in trange(range, epicenter)) tile.ex_act(2) + +/client/proc/check_bomb_impacts() + set name = "Check Bomb Impact" + set category = "Debug" + + var/newmode = alert("Use reactionary explosions?","Check Bomb Impact", "Yes", "No") + + var/turf/epicenter = get_turf(src) + var/dev = 0 + var/heavy = 0 + var/light = 0 + var/list/choices = list("Small Bomb","Medium Bomb","Big Bomb","Custom Bomb") + var/choice = input("Bomb Size?") in choices + switch(choice) + if(null) + return 0 + if("Small Bomb") + dev = 1 + heavy = 2 + light = 3 + if("Medium Bomb") + dev = 2 + heavy = 3 + light = 4 + if("Big Bomb") + dev = 3 + heavy = 5 + light = 7 + if("Custom Bomb") + dev = input("Devestation range (Tiles):") as num + heavy = input("Heavy impact range (Tiles):") as num + light = input("Light impact range (Tiles):") as num + + var/max_range = max(dev, heavy, light) + var/x0 = epicenter.x + var/y0 = epicenter.y + var/list/wipe_colours = list() + for(var/turf/T in trange(max_range, epicenter)) + wipe_colours += T + var/dist = cheap_pythag(T.x - x0, T.y - y0) + + if(newmode == "Yes") + var/turf/TT = T + while(TT != epicenter) + TT = get_step_towards(TT,epicenter) + if(TT.density && TT.explosion_block) + dist += TT.explosion_block + + for(var/obj/machinery/door/D in TT) + if(D.density && D.explosion_block) + dist += D.explosion_block + + if(dist < dev) + T.color = "red" + T.maptext = "Dev" + else if (dist < heavy) + T.color = "yellow" + T.maptext = "Heavy" + else if (dist < light) + T.color = "blue" + T.maptext = "Light" + else + continue + + sleep(100) + for(var/turf/T in wipe_colours) + T.color = null + T.maptext = "" diff --git a/code/game/turfs/simulated/floor_types.dm b/code/game/turfs/simulated/floor_types.dm index 91e4fd2a9b9..5ea347aa51e 100644 --- a/code/game/turfs/simulated/floor_types.dm +++ b/code/game/turfs/simulated/floor_types.dm @@ -66,6 +66,19 @@ F.make_plating() return +/turf/simulated/floor/engine/ex_act(severity,target) + switch(severity) + if(1.0) + if(prob(80)) + ReplaceWithLattice() + else if(prob(50)) + qdel(src) + else + make_plating(1) + if(2.0) + if(prob(50)) + make_plating(1) + /turf/simulated/floor/engine/cult name = "engraved floor" icon_state = "cult" diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm index 7dbaa7b2492..e4c61e1c754 100644 --- a/code/game/turfs/simulated/walls.dm +++ b/code/game/turfs/simulated/walls.dm @@ -16,6 +16,7 @@ opacity = 1 density = 1 blocks_air = 1 + explosion_block = 1 thermal_conductivity = WALL_HEAT_TRANSFER_COEFFICIENT heat_capacity = 312500 //a little over 5 cm thick , 312500 for 1 m by 2.5 m by 0.25 m plasteel wall diff --git a/code/game/turfs/simulated/walls_mineral.dm b/code/game/turfs/simulated/walls_mineral.dm index 393ff4beb8e..6e5aa0c33a8 100644 --- a/code/game/turfs/simulated/walls_mineral.dm +++ b/code/game/turfs/simulated/walls_mineral.dm @@ -11,6 +11,7 @@ icon_state = "gold0" walltype = "gold" mineral = "gold" + explosion_block = 0 //gold is a soft metal you dingus. //var/electro = 1 //var/shocked = null @@ -29,6 +30,7 @@ icon_state = "diamond0" walltype = "diamond" mineral = "diamond" + explosion_block = 3 /turf/simulated/wall/mineral/clown name = "bananium wall" @@ -43,6 +45,7 @@ icon_state = "sandstone0" walltype = "sandstone" mineral = "sandstone" + explosion_block = 0 /turf/simulated/wall/mineral/uranium name = "uranium wall" @@ -50,6 +53,7 @@ icon_state = "uranium0" walltype = "uranium" mineral = "uranium" + explosion_block = 0 /turf/simulated/wall/mineral/uranium/proc/radiate() if(!active) diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm index 2ef06abefae..bf79c84e7c0 100644 --- a/code/game/turfs/simulated/walls_reinforced.dm +++ b/code/game/turfs/simulated/walls_reinforced.dm @@ -4,7 +4,7 @@ icon_state = "r_wall" opacity = 1 density = 1 - + explosion_block = 2 damage_cap = 200 max_temperature = 6000 diff --git a/code/game/turfs/unsimulated/walls.dm b/code/game/turfs/unsimulated/walls.dm index ca422c46cd6..27b057e5fce 100644 --- a/code/game/turfs/unsimulated/walls.dm +++ b/code/game/turfs/unsimulated/walls.dm @@ -4,6 +4,7 @@ icon_state = "riveted" opacity = 1 density = 1 + explosion_block = 2 /turf/unsimulated/wall/fakeglass name = "window" diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm index 5b151c850c2..ae3f2c2a5d9 100644 --- a/code/modules/admin/admin_verbs.dm +++ b/code/modules/admin/admin_verbs.dm @@ -144,7 +144,8 @@ var/list/admin_verbs_debug = list( /client/proc/toggledebuglogs, /client/proc/qdel_toggle, // /vg/ /client/proc/gc_dump_hdl, - /client/proc/debugNatureMapGenerator + /client/proc/debugNatureMapGenerator, + /client/proc/check_bomb_impacts ) var/list/admin_verbs_possess = list( /proc/possess,