Enforce stat caps from new data

pull/29/head
Daniel Asher Resnick 2 months ago
parent 08f647e513
commit 635cb598a5
  1. 3
      src/lib/stock.rb
  2. 12
      src/public/js/burning.js

@ -6,6 +6,7 @@ module Charred
attr :name
attr :stride
attr :common_traits
attr :stat_caps
attr :starting_stats
attr_accessor :setting_short_names
@ -15,6 +16,7 @@ module Charred
@stride = h["stride"] || @@default_stride
@adjective = h["adjective"] || @key+"ish"
@common_traits = h["common_traits"]
@stat_caps = h["stat_caps"]
@starting_stats = h["starting_stats"]
@setting_short_names = {}
end
@ -26,6 +28,7 @@ module Charred
"stride" => @stride,
"adjective" => @adjective,
"common_traits" => @common_traits,
"stat_caps" => @stat_caps,
"starting_stats" => @starting_stats,
"setting_short_names" => @setting_short_names
}

@ -575,14 +575,10 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo
$scope.incrementStat = function(stat){
// Man stock has max 8 pts in any stat
if ( $scope.stock == "troll" && (stat.name == "Power" || stat.name == "Forte" ) ) {
if ( stat.exp() == 9 )
return;
} else {
if ( stat.exp() == 8 )
return;
}
console.log(burningData.stocks[$scope.stock]);
if (stat.exp() == burningData.stocks[$scope.stock].stat_caps[stat.name]) {
return;
}
var specificStatPoints = 0;
var eitherStatPoints = $scope.unspentStatPoints.either;

Loading…
Cancel
Save