From 6d8d73add34af7e3117fc585dc6ad2d5ea78efdd Mon Sep 17 00:00:00 2001 From: Drulikar Date: Sat, 27 Jun 2026 21:04:44 -0500 Subject: [PATCH] more OB falloff when entering pylon protection --- code/__DEFINES/misc.dm | 2 ++ code/datums/autocells/explosion.dm | 40 +++++++++++++---------- code/modules/cm_marines/orbital_cannon.dm | 10 +++--- 3 files changed, 30 insertions(+), 22 deletions(-) diff --git a/code/__DEFINES/misc.dm b/code/__DEFINES/misc.dm index 9756f1888667..66a38981ad44 100644 --- a/code/__DEFINES/misc.dm +++ b/code/__DEFINES/misc.dm @@ -32,6 +32,8 @@ #define EXPLOSION_FALLOFF_SHAPE_LINEAR 0 #define EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL 1 #define EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_HALF 2 +#define EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_IN_PYLON 3 +#define EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_HALF_IN_PYLON 4 #define EXPLOSION_MAX_POWER 5000 //area flags diff --git a/code/datums/autocells/explosion.dm b/code/datums/autocells/explosion.dm index 706e75623b71..552b6316378f 100644 --- a/code/datums/autocells/explosion.dm +++ b/code/datums/autocells/explosion.dm @@ -194,28 +194,34 @@ if(new_power <= 0) continue - var/new_falloff = power_falloff - // Handle our falloff function. - switch(falloff_shape) - if(EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL) - new_falloff += new_falloff * dir_falloff - if(EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_HALF) - new_falloff += (new_falloff*0.5) * dir_falloff - - var/datum/automata_cell/explosion/E = propagate(dir) - if(E) - E.power = new_power - E.power_falloff = new_falloff - E.falloff_shape = falloff_shape - E.explosion_cause_data = explosion_cause_data + var/datum/automata_cell/explosion/new_cell = propagate(dir) + if(new_cell) + var/new_falloff = power_falloff + // Handle our falloff function. + switch(falloff_shape) + if(EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL) + new_falloff += new_falloff * dir_falloff + if(EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_HALF) + new_falloff += (new_falloff*0.5) * dir_falloff + if(EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_IN_PYLON) + if(new_cell.in_turf.get_pylon_protection_level() >= TURF_PROTECTION_OB) + new_falloff += new_falloff * dir_falloff + if(EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_HALF_IN_PYLON) + if(new_cell.in_turf.get_pylon_protection_level() >= TURF_PROTECTION_OB) + new_falloff += (new_falloff*0.5) * dir_falloff + + new_cell.power = new_power + new_cell.power_falloff = new_falloff + new_cell.falloff_shape = falloff_shape + new_cell.explosion_cause_data = explosion_cause_data // Set the direction the explosion is traveling in - E.direction = dir + new_cell.direction = dir //Diagonal cells have a small delay when branching off the center. This helps the explosion look circular if(!direction && (dir in GLOB.diagonals)) - E.delay = 1 + new_cell.delay = 1 - setup_new_cell(E) + setup_new_cell(new_cell) // We've done our duty, now die pls qdel(src) diff --git a/code/modules/cm_marines/orbital_cannon.dm b/code/modules/cm_marines/orbital_cannon.dm index c9de051fc7a6..36676471fe2b 100644 --- a/code/modules/cm_marines/orbital_cannon.dm +++ b/code/modules/cm_marines/orbital_cannon.dm @@ -477,27 +477,27 @@ GLOBAL_LIST_EMPTY(orbital_cannon_cancellation) new /obj/effect/overlay/temp/ob_impact (target, warhead, 1.5) sleep(10) var/datum/cause_data/cause_data = create_cause_data(name, source_mob) - cell_explosion(target, clear_power, clear_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) //break shit around + cell_explosion(target, clear_power, clear_falloff, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_IN_PYLON, null, cause_data) //break shit around sleep(clear_delay) // Explosion if turf is not a wall. if(!target.density) - cell_explosion(target, standard_power, standard_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) + cell_explosion(target, standard_power, standard_falloff, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_IN_PYLON, null, cause_data) handle_ob_shake(target) if(double_explosion_delay) sleep(double_explosion_delay) - cell_explosion(target, standard_power, standard_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) + cell_explosion(target, standard_power, standard_falloff, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_IN_PYLON, null, cause_data) qdel(src) return // Checks turf around the target for(var/turf/T in range(2, target)) if(!T.density) - cell_explosion(target, standard_power, standard_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) + cell_explosion(target, standard_power, standard_falloff, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_IN_PYLON, null, cause_data) handle_ob_shake(target) if(double_explosion_delay) sleep(double_explosion_delay) - cell_explosion(target, standard_power, standard_falloff, EXPLOSION_FALLOFF_SHAPE_LINEAR, null, cause_data) + cell_explosion(target, standard_power, standard_falloff, EXPLOSION_FALLOFF_SHAPE_EXPONENTIAL_IN_PYLON, null, cause_data) qdel(src) return