From d4596c9934ff4317d7066625e3618765517d5865 Mon Sep 17 00:00:00 2001 From: Daniel Asher Resnick Date: Sun, 25 Dec 2022 00:53:54 -0600 Subject: [PATCH] Fix spite shade calculation Greying Grief now greys Spite, and similarly blacking Spite blacks Grief. When calculating Spite, if Grief is greyed, the exponent is already reduced and the Spite exponent doesn't need to be reduced further. --- src/public/js/burning.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/public/js/burning.js b/src/public/js/burning.js index 5de227d..dac790c 100644 --- a/src/public/js/burning.js +++ b/src/public/js/burning.js @@ -742,13 +742,18 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo return; $scope.attributeShade[attrName] = 'G'; + if('Grief' == attrName) { + $scope.attributeShade['Spite'] = 'G'; + } } else if (attr.shade == 'G'){ $scope.attributeShade[attrName] = 'B'; + if('Spite' == attrName) { + $scope.attributeShade['Grief'] = 'B'; + } } else console.log("Error: changing shade of attribute failed: unknown shade " + stat.shade); - } $scope.incrementSkill = function(skill){ @@ -1105,7 +1110,8 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo } else if ( "Spite" == name ){ var spite = computeModifiers(name); - if($scope.attributeShade[name] == 'G'){ + // If Grief is grey, the shadeshift cost has already been payed in the Grief exponent calculation + if($scope.attributeShade[name] == 'G' && $scope.attributeShade["Grief"] == 'B'){ spite -= 5; } spite += bonus; -- 2.37.3