statOrder is now set programatically from an array

This makes it far easier to add new stats, as we don't have to update
every single number manually.
This commit is contained in:
Jacob
2017-07-29 19:20:26 +01:00
parent 73d1419ee9
commit 2389768234

View File

@@ -1,71 +1,82 @@
statOrder = {
"strength": 1,
"dexterity": 2,
"constitution": 3,
"intelligence": 4,
"wisdom": 5,
"charisma": 6,
"strengthSave": 7,
"dexteritySave": 8,
"constitutionSave": 9,
"intelligenceSave": 10,
"wisdomSave": 11,
"charismaSave": 12,
"acrobatics": 13,
"animalHandling": 14,
"arcana": 15,
"athletics": 16,
"deception": 17,
"history": 18,
"insight": 19,
"intimidation": 20,
"investigation": 21,
"medicine": 22,
"nature": 23,
"perception": 24,
"performance": 25,
"persuasion": 26,
"religion": 27,
"sleightOfHand": 28,
"stealth": 29,
"survival": 30,
"initiative": 31,
"hitPoints": 32,
"armor": 33,
"dexterityArmor": 34,
"speed": 35,
"proficiencyBonus": 36,
"ki": 37,
"sorceryPoints": 38,
"rages": 39,
"rageDamage": 40,
"expertiseDice": 41,
"superiorityDice": 42,
"carryMultiplier": 43,
"level1SpellSlots": 44,
"level2SpellSlots": 45,
"level3SpellSlots": 46,
"level4SpellSlots": 47,
"level5SpellSlots": 48,
"level6SpellSlots": 49,
"level7SpellSlots": 50,
"level8SpellSlots": 51,
"level9SpellSlots": 52,
"d6HitDice": 53,
"d8HitDice": 54,
"d10HitDice": 55,
"d12HitDice": 56,
"acidMultiplier": 57,
"bludgeoningMultiplier": 58,
"coldMultiplier": 59,
"fireMultiplier": 60,
"forceMultiplier": 61,
"lightningMultiplier": 62,
"necroticMultiplier": 63,
"piercingMultiplier": 64,
"poisonMultiplier": 65,
"psychicMultiplier": 66,
"radiantMultiplier": 67,
"slashingMultiplier": 68,
"thunderMultiplier": 69,
};
var statsInOrder = [
"strength",
"dexterity",
"constitution",
"intelligence",
"wisdom",
"charisma",
"strengthSave",
"dexteritySave",
"constitutionSave",
"intelligenceSave",
"wisdomSave",
"charismaSave",
"acrobatics",
"animalHandling",
"arcana",
"athletics",
"deception",
"history",
"insight",
"intimidation",
"investigation",
"medicine",
"nature",
"perception",
"performance",
"persuasion",
"religion",
"sleightOfHand",
"stealth",
"survival",
"initiative",
"hitPoints",
"armor",
"dexterityArmor",
"speed",
"proficiencyBonus",
"ki",
"sorceryPoints",
"rages",
"rageDamage",
"expertiseDice",
"superiorityDice",
"carryMultiplier",
"level1SpellSlots",
"level2SpellSlots",
"level3SpellSlots",
"level4SpellSlots",
"level5SpellSlots",
"level6SpellSlots",
"level7SpellSlots",
"level8SpellSlots",
"level9SpellSlots",
"d6HitDice",
"d8HitDice",
"d10HitDice",
"d12HitDice",
"acidMultiplier",
"bludgeoningMultiplier",
"coldMultiplier",
"fireMultiplier",
"forceMultiplier",
"lightningMultiplier",
"necroticMultiplier",
"piercingMultiplier",
"poisonMultiplier",
"psychicMultiplier",
"radiantMultiplier",
"slashingMultiplier",
"thunderMultiplier",
];
statOrder = {};
_.each(statsInOrder, function(element, index){
statOrder[element] = index;
});