From 0ef0991d65c867ffa5e78681bf99094297d40b80 Mon Sep 17 00:00:00 2001 From: Putnam3145 Date: Fri, 26 Nov 2021 22:49:30 -0800 Subject: [PATCH] another tweak to it, for good measure --- code/__DEFINES/research.dm | 5 +++-- code/game/machinery/doppler_array.dm | 8 +++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/code/__DEFINES/research.dm b/code/__DEFINES/research.dm index 751b498eb4..4b8b2c797e 100644 --- a/code/__DEFINES/research.dm +++ b/code/__DEFINES/research.dm @@ -73,5 +73,6 @@ TECHWEB_POINT_TYPE_GENERIC = "General Research"\ ) -#define TECHWEB_BOMB_MIDPOINT 50000 //Adjust as needed. Actual hard cap is double this, but will never be reached due to hyperbolic curve. -#define TECHWEB_BOMB_SIZE 200 // The shockwave radius required for a bomb to get TECHWEB_BOMB_MIDPOINT points. +#define BOMB_TARGET_POINTS 50000 //Adjust as needed. Actual hard cap is double this, but will never be reached due to hyperbolic curve. +#define BOMB_TARGET_SIZE 200 // The shockwave radius required for a bomb to get TECHWEB_BOMB_MIDPOINT points. +#define BOMB_SUB_TARGET_EXPONENT 2 // The power of the points curve below the target size. Higher = less points for worse bombs, below target. diff --git a/code/game/machinery/doppler_array.dm b/code/game/machinery/doppler_array.dm index 05d278e98c..27b591d374 100644 --- a/code/game/machinery/doppler_array.dm +++ b/code/game/machinery/doppler_array.dm @@ -194,11 +194,13 @@ GLOBAL_LIST_EMPTY(doppler_arrays) /*****The Point Calculator*****/ - if(orig_light < 1) + if(orig_light < 5) say("Explosion not large enough for research calculations.") return - else - point_gain = (TECHWEB_BOMB_MIDPOINT * 2 * orig_light) / (orig_light + TECHWEB_BOMB_SIZE) + else if(orig_light < BOMB_TARGET_SIZE) // we want to give fewer points if below the target; this curve does that + point_gain = (BOMB_TARGET_POINTS * orig_light ** BOMB_SUB_TARGET_EXPONENT) / (BOMB_TARGET_SIZE**BOMB_SUB_TARGET_EXPONENT) + else // once we're at the target, switch to a hyperbolic function so we can't go too far above it, but bigger bombs always get more points + point_gain = (BOMB_TARGET_POINTS * 2 * orig_light) / (orig_light + BOMB_TARGET_SIZE) /*****The Point Capper*****/ if(point_gain > linked_techweb.largest_bomb_value)