From 0c431e95d1e4efeb32a574a55ae31b7620945084 Mon Sep 17 00:00:00 2001 From: "baloh.matevz@gmail.com" Date: Tue, 15 Jan 2013 08:19:35 +0000 Subject: [PATCH] - Recursive explosions are not available in a config option. I want to do some live testing. Once live testing is done, if they prove to be better, they can go live. Once that happens, the config option can be removed. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5555 316c924e-a436-60f5-8080-3fe189b3f50e --- code/controllers/configuration.dm | 5 +++++ code/game/objects/explosion.dm | 5 +++++ code/game/objects/explosion_recursive.dm | 6 +++++- config/config.txt | 3 +++ 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/code/controllers/configuration.dm b/code/controllers/configuration.dm index 350a1ea839d..e54ac11d389 100644 --- a/code/controllers/configuration.dm +++ b/code/controllers/configuration.dm @@ -96,6 +96,8 @@ var/ban_legacy_system = 0 //Defines whether the server uses the legacy banning system with the files in /data or the SQL system. Config option in config.txt var/use_age_restriction_for_jobs = 0 //Do jobs use account age restrictions? --requires database + var/use_recursive_explosions //Defines whether the server uses recursive or circular explosions. + 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. var/ghost_interaction = 0 @@ -158,6 +160,9 @@ if ("jobs_have_minimal_access") config.jobs_have_minimal_access = 1 + if ("use_recursive_explosions") + use_recursive_explosions = 1 + if ("log_ooc") config.log_ooc = 1 diff --git a/code/game/objects/explosion.dm b/code/game/objects/explosion.dm index e2975ad9d46..4c0557197b0 100644 --- a/code/game/objects/explosion.dm +++ b/code/game/objects/explosion.dm @@ -10,6 +10,11 @@ proc/explosion(turf/epicenter, devastation_range, heavy_impact_range, light_impact_range, flash_range, adminlog = 1) src = null //so we don't abort once src is deleted spawn(0) + if(config.use_recursive_explosions) + var/power = devastation_range * 2 + heavy_impact_range + light_impact_range //The ranges add up, ie light 14 includes both heavy 7 and devestation 3. So this calculation means devestation counts for 4, heavy for 2 and light for 1 power, giving us a cap of 27 power. + explosion_rec(epicenter, power) + return + var/start = world.timeofday epicenter = get_turf(epicenter) if(!epicenter) return diff --git a/code/game/objects/explosion_recursive.dm b/code/game/objects/explosion_recursive.dm index 80b52811800..cfa1d7e0e53 100644 --- a/code/game/objects/explosion_recursive.dm +++ b/code/game/objects/explosion_recursive.dm @@ -66,7 +66,11 @@ proc/explosion_rec(turf/epicenter, power) if(ET.max_power <= 0) continue if(!ET.turf) continue - var/severity = 4 - round(max(min( 3, (ET.max_power / 3) ) ,1), 1) + //Wow severity looks confusing to calculate... Fret not, I didn't leave you with any additional instructions or help. (just kidding, see the line under the calculation) + var/severity = 4 - round(max(min( 3, ((ET.max_power - ET.turf.explosion_resistance) / (max(3,(power/3)))) ) ,1), 1) + //sanity effective power on tile divided by either 3 or one third the total explosion power + // One third because there are three power levels and I + // want each one to take up a third of the crater var/x = ET.turf.x var/y = ET.turf.y var/z = ET.turf.z diff --git a/config/config.txt b/config/config.txt index caf1e968fb5..a07c23387f3 100644 --- a/config/config.txt +++ b/config/config.txt @@ -25,6 +25,9 @@ JOBS_HAVE_MINIMAL_ACCESS ## you have noone older than 0 days, since noone has been logged yet. Only turn this on once you have had the database up for 30 days. #USE_AGE_RESTRICTION_FOR_JOBS +## 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 + ## log OOC channel LOG_OOC