Browse Source

Update class title setting map

master
Brandon Cornejo 4 years ago
parent
commit
21b3e1ff2c
  1. 41
      roll20/char_sheet.html

41
roll20/char_sheet.html

@ -747,35 +747,16 @@ const repeatingSum = (destinations, section, fields, ...extras) => {
return saves;
};
on("change:level change:class", function(e) {
console.log('calculate saves and throws for class/level');
getAttrs(["level", "class"], function(v) {
let saves = calculateSavesThrows(v.level, v.class);
setAttrs({
save_pp: saves[0],
save_pd: saves[1],
save_bb: saves[2],
save_sw: saves[3],
save_sp: saves[4],
attack_throw: saves[5]
});
let title = getClassLevelTitle(v.level, v.class);
setAttr({classtitle: title});
});
});
/* PC Class Default Titles */
/* PC Class Default Titles (Class: 0-14) */
const class_titles = {
// 1,2,3,4,5,6,7,8,9,10,11,12,13,14
'Fighter': ["Man-at-Arms", "Warrior", "Swordmaster", "Hero", "Exemplar", "Myrmidon", "Champion", "Epic Hero", "Warlord", "Warlord", "Warlord", "Warlord", "Warlord", "Overlord"],
'Assassin': ["Thug", "Enforcer", "Torturer", "Slayer", "Destroyer", "Executioner", "Blackguard", "Assassin", "Master Assassin", "Master Assassin", "Master Assassin", "Master Assassin", "Master Assassin", "Grandfather of Assassins"],
'Explorer': ["Scout", "Outrider", "Forester", "Explorer", "Guide", "Tracker", "Pathfinder", "Ranger", "Warden", "Warden", "Warden", "Warden", "Warden", "Lord Warden"],
'Mage': ["Arcanist", "Seer", "Theurgist", "Magician", "Thaumaturge", "Enchanter", "Sorcerer", "Mage", "Wizard", "Wizard", "Wizard", "Wizard", "Wizard", "Archmage"],
'Cleric': ["Catechist", "Acolyte", "Priest", "Curate", "Vicar", "Rector", "Prelate", "Bishop", "Patriarch", "Patriarch", "Patriarch", "Patriarch", "Patriarch", "Theocrat"],
'Bladedancer': ["Blade-Initiate", "Blade-Daughter", "Blade-Singer", "Blade-Weaver", "Blade-Sister", "Blade-Adept", "Blade-Dancer", "Blade-Priestess", "Blade-Mistress", "Blade-Mistress", "Blade-Mistress", "Blade-Mistress", "Blade-Mistress", "Mistress of All Blades"],
'Thief': ["Footpad", "Hood", "Robber", "Burglar", "Rogue", 'Scoundrel", "Pilferer", "Thief", "Master Thief", "Master Thief", "Master Thief", "Master Thief", "Master Thief", "Prince of Thieves"],
'Thief': ["Footpad", "Hood", "Robber", "Burglar", "Rogue", "Scoundrel", "Pilferer", "Thief", "Master Thief", "Master Thief", "Master Thief", "Master Thief", "Master Thief", "Prince of Thieves"],
'Bard': ["Reciter", "Versifier", "Archivist", "Annalist", "Chronicler", "Panegyrist", "Skald", "Rhapsodist", "Bard", "Bard", "Bard", "Bard", "Bard", "Master Bard"],
};
@ -783,6 +764,24 @@ const repeatingSum = (destinations, section, fields, ...extras) => {
return class_titles[class_name][level - 1] || "the Unknown";
};
on("change:level change:class", function(e) {
console.log('calculate saves and throws for class/level');
getAttrs(["level", "class"], function(v) {
let saves = calculateSavesThrows(v.level, v.class);
let title = getClassLevelTitle(v.level, v.class);
setAttrs({
save_pp: saves[0],
save_pd: saves[1],
save_bb: saves[2],
save_sw: saves[3],
save_sp: saves[4],
attack_throw: saves[5],
classtitle: title,
});
});
});
/* NPC Attack Throw */
const calculateNpcHit = function(hd) {
switch(hd.toString().replace(/(d\d+[+\-0-9]*)/, '')) {

Loading…
Cancel
Save