From 347e759b103185128e62613386d5031191e55abd Mon Sep 17 00:00:00 2001 From: Leshana Date: Thu, 4 May 2017 20:27:15 -0400 Subject: [PATCH] Make the multi-z explosion strength scalar configurable. * Its much easier to test out and decide what explosion scalar is nice if you can configure it. * As an added bonus, by setting it to zero this lets you disable multi-z explosions altogether without turning off all of multi-z. --- code/controllers/configuration.dm | 4 ++++ code/game/objects/explosion.dm | 8 ++++---- config/example/config.txt | 3 +++ html/changelogs/Leshana - MultiZAS.yml | 5 +++++ 4 files changed, 16 insertions(+), 4 deletions(-) create mode 100644 html/changelogs/Leshana - MultiZAS.yml diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 57f22472551..5021453462e 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -166,6 +166,7 @@ var/list/gamemode_cache = list() var/simultaneous_pm_warning_timeout = 100 var/use_recursive_explosions //Defines whether the server uses recursive or circular explosions. + var/multi_z_explosion_scalar = 0.5 //Multiplier for how much weaker explosions are on neighboring z levels. var/assistant_maint = 0 //Do assistants get maint access? var/gateway_delay = 18000 //How long the gateway takes before it activates. Default is half an hour. @@ -283,6 +284,9 @@ var/list/gamemode_cache = list() if ("use_recursive_explosions") use_recursive_explosions = 1 + if ("multi_z_explosion_scalar") + multi_z_explosion_scalar = text2num(value) + if ("log_ooc") config.log_ooc = 1 diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index 7940c964262..61e764b09ca 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -1,7 +1,7 @@ //TODO: Flash range does nothing currently proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1, z_transfer = UP|DOWN, shaped) - var/multi_z_scalar = 0.35 + var/multi_z_scalar = config.multi_z_explosion_scalar src = null //so we don't abort once src is deleted spawn(0) var/start = world.timeofday @@ -9,7 +9,7 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa if(!epicenter) return // Handles recursive propagation of explosions. - if(z_transfer) + if(z_transfer && multi_z_scalar) var/adj_dev = max(0, (multi_z_scalar * devastation_range) - (shaped ? 2 : 0) ) var/adj_heavy = max(0, (multi_z_scalar * heavy_impact_range) - (shaped ? 2 : 0) ) var/adj_light = max(0, (multi_z_scalar * light_impact_range) - (shaped ? 2 : 0) ) @@ -45,8 +45,8 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impa M.playsound_local(epicenter, 'sound/effects/explosionfar.ogg', far_volume, 1, frequency, falloff = 5) if(adminlog) - message_admins("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z]) (JMP)") - log_game("Explosion with size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ") + message_admins("Explosion with [shaped ? "shaped" : "non-shaped"] size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ([epicenter.x],[epicenter.y],[epicenter.z]) (JMP)") + log_game("Explosion with [shaped ? "shaped" : "non-shaped"] size ([devastation_range], [heavy_impact_range], [light_impact_range]) in area [epicenter.loc.name] ") var/approximate_intensity = (devastation_range * 3) + (heavy_impact_range * 2) + light_impact_range var/powernet_rebuild_was_deferred_already = defer_powernet_rebuild diff --git a/config/example/config.txt b/config/example/config.txt index 8437829fd38..232d3c66ad1 100644 --- a/config/example/config.txt +++ b/config/example/config.txt @@ -33,6 +33,9 @@ JOBS_HAVE_MINIMAL_ACCESS ## Unhash this to use recursive explosions, keep it hashed to use circle explosions. Recursive explosions react to walls, airlocks and blast doors, making them look a lot cooler than the boring old circular explosions. They require more CPU and are (as of january 2013) experimental #USE_RECURSIVE_EXPLOSIONS +Configure how fast explosion strength diminishes when travelling up/down z levels. All explosion distances are multiplied by this each time they go up/down z-levels. +#MULTI_Z_EXPLOSION_SCALAR 0.5 + ## log OOC channel LOG_OOC diff --git a/html/changelogs/Leshana - MultiZAS.yml b/html/changelogs/Leshana - MultiZAS.yml new file mode 100644 index 00000000000..891bf846c2e --- /dev/null +++ b/html/changelogs/Leshana - MultiZAS.yml @@ -0,0 +1,5 @@ +author: Leshana +delete-after: True +changes: + - tweak: "Optimized (but still not enabled) multi-z ZAS" + - rscadd: "Multi-Z explosion transfer coefficient is now configurable" \ No newline at end of file