|
|
@ -409,7 +409,6 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo |
|
|
|
calculateUnspentSkillPoints($scope); |
|
|
|
calculateUnspentSkillPoints($scope); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
burningData.registerEvent("stocksLoaded", function() { |
|
|
|
burningData.registerEvent("stocksLoaded", function() { |
|
|
|
$scope.stocks = [{ name: "Select a stock" }] |
|
|
|
$scope.stocks = [{ name: "Select a stock" }] |
|
|
|
$scope.stocks = $scope.stocks.concat(Object.values(burningData.stocks)); |
|
|
|
$scope.stocks = $scope.stocks.concat(Object.values(burningData.stocks)); |
|
|
@ -938,7 +937,7 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo |
|
|
|
for(var key in burningData.skills){ |
|
|
|
for(var key in burningData.skills){ |
|
|
|
if ( !(key in $scope.lifepathSkills) && !(key in $scope.generalSkills) ){ |
|
|
|
if ( !(key in $scope.lifepathSkills) && !(key in $scope.generalSkills) ){ |
|
|
|
var displaySkill = burningData.skills[key]; |
|
|
|
var displaySkill = burningData.skills[key]; |
|
|
|
if ( !displaySkill.stock || restrictionStockToValidStock(displaySkill.stock) == $scope.stock ) { |
|
|
|
if ( !displaySkill.stock || restrictionStockToValidStock(burningData.stocks, displaySkill.stock) == $scope.stock ) { |
|
|
|
result.push(key); |
|
|
|
result.push(key); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -1187,30 +1186,6 @@ function BurningCtrl($scope, $http, $modal, $timeout, settings, appropriateWeapo |
|
|
|
|
|
|
|
|
|
|
|
return list; |
|
|
|
return list; |
|
|
|
} |
|
|
|
} |
|
|
|
/* |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.specialTraitsForDisplay = function(){ |
|
|
|
|
|
|
|
var list = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for(var traitName in burningData.traits) { |
|
|
|
|
|
|
|
var trait = burningData.traits[traitName]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ('restrict' in trait){ |
|
|
|
|
|
|
|
if ( trait.restrict.indexOf(validStockToRestrictionStock($scope.stock)) >= 0 && |
|
|
|
|
|
|
|
(trait.restrict.indexOf("special") >= 0 || trait.restrict.indexOf("character") >= 0) ){ |
|
|
|
|
|
|
|
list.push(new DisplayTrait(traitName, burningData.traits)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
// No restriction! As long as cost > 0 (cost 0 is for traits with no cost; not purchaseable)
|
|
|
|
|
|
|
|
if ( trait.cost > 0 ) { |
|
|
|
|
|
|
|
list.push(new DisplayTrait(traitName, burningData.traits)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return list; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.addLifepathTrait = function(traitName){ |
|
|
|
$scope.addLifepathTrait = function(traitName){ |
|
|
|
if ( $scope.unspentTraitPoints < 1 && $scope.enforcePointLimits ) |
|
|
|
if ( $scope.unspentTraitPoints < 1 && $scope.enforcePointLimits ) |
|
|
@ -2758,7 +2733,7 @@ function calculateSpecialTraitsForDisplay($scope, burningData){ |
|
|
|
var trait = burningData.traits[traitName]; |
|
|
|
var trait = burningData.traits[traitName]; |
|
|
|
|
|
|
|
|
|
|
|
if ('restrict' in trait){ |
|
|
|
if ('restrict' in trait){ |
|
|
|
if ( trait.restrict.indexOf(validStockToRestrictionStock($scope.stock)) >= 0 && |
|
|
|
if ( trait.restrict.indexOf(validStockToRestrictionStock(burningData.stocks, $scope.stock)) >= 0 && |
|
|
|
(trait.restrict.indexOf("special") >= 0 || trait.restrict.indexOf("character") >= 0) ){ |
|
|
|
(trait.restrict.indexOf("special") >= 0 || trait.restrict.indexOf("character") >= 0) ){ |
|
|
|
list.push(new DisplayTrait(traitName, burningData.traits)); |
|
|
|
list.push(new DisplayTrait(traitName, burningData.traits)); |
|
|
|
} |
|
|
|
} |
|
|
@ -2806,44 +2781,12 @@ function calculateUnspentResourcePoints($scope){ |
|
|
|
$scope.unspentResourcePoints = unspentResourcePoints; |
|
|
|
$scope.unspentResourcePoints = unspentResourcePoints; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function isValidStock(stock){ |
|
|
|
function restrictionStockToValidStock(stocks, stockAdjective){ |
|
|
|
return stock == "man" || stock == "elf" || stock == "orc" || stock == "dwarf" || stock == "roden" || stock == "wolf" || stock =="troll"; |
|
|
|
return Object.values(stocks).findLast(s => s.adjective == stockAdjective).key; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function restrictionStockToValidStock(stock){ |
|
|
|
function validStockToRestrictionStock(stocks, stockName){ |
|
|
|
|
|
|
|
return stocks[stockName].adjective; |
|
|
|
if ( stock == "mannish" ) |
|
|
|
|
|
|
|
return "man"; |
|
|
|
|
|
|
|
else if ( stock == "elven" ) |
|
|
|
|
|
|
|
return "elf"; |
|
|
|
|
|
|
|
else if ( stock == "orcish" ) |
|
|
|
|
|
|
|
return "orc"; |
|
|
|
|
|
|
|
else if ( stock == "dwarven" ) |
|
|
|
|
|
|
|
return "dwarf"; |
|
|
|
|
|
|
|
else if ( stock == "wolfish" ) |
|
|
|
|
|
|
|
return "wolf"; |
|
|
|
|
|
|
|
else if ( stock == "roden" ) |
|
|
|
|
|
|
|
return "roden"; |
|
|
|
|
|
|
|
else if ( stock == "trollish" ) |
|
|
|
|
|
|
|
return "troll"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function validStockToRestrictionStock(stock){ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ( stock == "man" ) |
|
|
|
|
|
|
|
return "mannish"; |
|
|
|
|
|
|
|
else if ( stock == "elf" ) |
|
|
|
|
|
|
|
return "elven"; |
|
|
|
|
|
|
|
else if ( stock == "orc" ) |
|
|
|
|
|
|
|
return "orcish"; |
|
|
|
|
|
|
|
else if ( stock == "dwarf" ) |
|
|
|
|
|
|
|
return "dwarven"; |
|
|
|
|
|
|
|
else if ( stock == "roden" ) |
|
|
|
|
|
|
|
return "roden"; |
|
|
|
|
|
|
|
else if ( stock == "wolf" ) |
|
|
|
|
|
|
|
return "wolfish"; |
|
|
|
|
|
|
|
else if ( stock == "troll" ) |
|
|
|
|
|
|
|
return "trollish"; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
function attributeModifyingQuestions($scope, attribute) |
|
|
|
function attributeModifyingQuestions($scope, attribute) |
|
|
|