From d2ef9a1fff702b85e4abd020a6e3e54f2ecae4b7 Mon Sep 17 00:00:00 2001 From: BinuDR <36463075+BinuDR@users.noreply.github.com> Date: Wed, 4 Oct 2023 19:33:17 -0500 Subject: [PATCH] tdps.lic - Corrected tdp cost calculation method The previous method gave some errors with certain racial modifiers, the correction fixes that and should now give exact calculations. --- tdps.lic | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tdps.lic b/tdps.lic index ca1e274595..d30f6b3e8f 100644 --- a/tdps.lic +++ b/tdps.lic @@ -20,9 +20,7 @@ def cost(current, modifier) cost = 0 start = 10 - 2 * modifier for i in start..current - 1 do - mult = i < 100 ? 3 : 15 - mod = (modifier.to_f * i / 2).truncate - cost += (i * mult) + mod + cost += i * (i < 100 ? 3 : 15) + modifier * (i / 2).floor(0) end return cost end @@ -52,7 +50,7 @@ else end # Calcuate total TDPs spent for each stat -costs = [] +costs = Array.new(8) for i in 0..7 costs[i] = cost(stats[i], mods[i]) end