|
|
|
@ -206,12 +206,6 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo |
|
|
|
|
// Character name
|
|
|
|
|
$scope.name = ""; |
|
|
|
|
|
|
|
|
|
// Character stock. One of man, dwarf, orc, elf
|
|
|
|
|
// if ( ! isValidStock(stock) ){
|
|
|
|
|
// console.log("Invalid stock '"+stock+"' passed to BurningCtrl.initialize. Defaulting to man");
|
|
|
|
|
// stock = "man";
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
$scope.stock = stock; |
|
|
|
|
|
|
|
|
|
// Character id (server side id)
|
|
|
|
@ -365,7 +359,18 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo |
|
|
|
|
|
|
|
|
|
$scope.onStockChange = function(){ |
|
|
|
|
if(!$scope.stock) return; |
|
|
|
|
if(!$scope.stockSelected) { |
|
|
|
|
$scope.stocks.shift(); |
|
|
|
|
$scope.stockSelected = true; |
|
|
|
|
} |
|
|
|
|
var oldName = $scope.name; |
|
|
|
|
if(!burningData.lifepaths[$scope.stock]) { |
|
|
|
|
burningData.loadLifepathsForStock($scope.stock); |
|
|
|
|
} |
|
|
|
|
if(!burningData.resources[$scope.stock]) { |
|
|
|
|
burningData.loadResourcesForStock($scope.stock); |
|
|
|
|
} |
|
|
|
|
// TODO: technically a bug — only want this registered once per stock...
|
|
|
|
|
burningData.registerStockEvent($scope.stock, "lifepathsLoaded", function () { |
|
|
|
|
// Make a blank character sheet
|
|
|
|
|
$scope.initialize($scope.stock); |
|
|
|
@ -379,14 +384,6 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo |
|
|
|
|
calculateCurrentSettingLifepathNames($scope, burningData); |
|
|
|
|
calculateSpecialTraitsForDisplay($scope, burningData); |
|
|
|
|
}); |
|
|
|
|
if(!burningData.lifepaths[$scope.stock]) { |
|
|
|
|
burningData.loadLifepathsForStock($scope.stock); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(!burningData.resources[$scope.stock]) { |
|
|
|
|
burningData.loadResourcesForStock($scope.stock); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
$scope.onSettingChange = function(){ |
|
|
|
@ -412,13 +409,11 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo |
|
|
|
|
calculateUnspentSkillPoints($scope); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// burningData.registerOnAllDatasetsLoaded(function(){
|
|
|
|
|
// onLifepathsLoad($scope, burningData);
|
|
|
|
|
// });
|
|
|
|
|
|
|
|
|
|
burningData.registerEvent("stocksLoaded", function() { |
|
|
|
|
$scope.stocks = [{ name: "Select a stock" }] |
|
|
|
|
$scope.stocks = $scope.stocks.concat(Object.values(burningData.stocks)); |
|
|
|
|
$scope.stockSelected = false; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
$scope.$on('$locationChangeStart', function(event, nextUrl, currentUrl) { |
|
|
|
@ -1038,7 +1033,8 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo |
|
|
|
|
return {"shade" : "", "exp" : 10 - $scope.statsByName["Will"].exp() + bonus}; |
|
|
|
|
} |
|
|
|
|
else if ( "Stride" == name ){ |
|
|
|
|
var stride = burningData.stocks[$scope.stock].stride; |
|
|
|
|
// This is a hack: if stock is unselected, use 0 for stride to not throw error; it shouldn't be displayed anyway
|
|
|
|
|
var stride = $scope.stock ? burningData.stocks[$scope.stock].stride : 0; |
|
|
|
|
stride += bonus; |
|
|
|
|
return {"shade" : "", "exp" : stride}; |
|
|
|
|
} |
|
|
|
|