You've already forked obsidian-visualiser
Completed ability editor
This commit is contained in:
@@ -135,23 +135,23 @@ function compileCharacter(character: Character & { username?: string }): Compile
|
||||
misc: [],
|
||||
},
|
||||
abilities: {
|
||||
athletics: [0, 0],
|
||||
acrobatics: [0, 0],
|
||||
intimidation: [0, 0],
|
||||
sleightofhand: [0, 0],
|
||||
stealth: [0, 0],
|
||||
survival: [0, 0],
|
||||
investigation: [0, 0],
|
||||
history: [0, 0],
|
||||
religion: [0, 0],
|
||||
arcana: [0, 0],
|
||||
understanding: [0, 0],
|
||||
perception: [0, 0],
|
||||
performance: [0, 0],
|
||||
medecine: [0, 0],
|
||||
persuasion: [0, 0],
|
||||
animalhandling: [0, 0],
|
||||
deception: [0, 0]
|
||||
athletics: 0,
|
||||
acrobatics: 0,
|
||||
intimidation: 0,
|
||||
sleightofhand: 0,
|
||||
stealth: 0,
|
||||
survival: 0,
|
||||
investigation: 0,
|
||||
history: 0,
|
||||
religion: 0,
|
||||
arcana: 0,
|
||||
understanding: 0,
|
||||
perception: 0,
|
||||
performance: 0,
|
||||
medecine: 0,
|
||||
persuasion: 0,
|
||||
animalhandling: 0,
|
||||
deception: 0
|
||||
},
|
||||
spellslots: 0,
|
||||
spellranks: {
|
||||
@@ -195,14 +195,15 @@ function compileCharacter(character: Character & { username?: string }): Compile
|
||||
|
||||
features.forEach(e => e[1].forEach((_e, i) => applyTrainingOption(e[0], _e, compiled, i === e[1].length - 1)));
|
||||
specialFeatures(compiled, character.progress.training);
|
||||
|
||||
Object.entries(character.progress.abilities).forEach(e => compiled.abilities[e[0]] += e[1][0]);
|
||||
|
||||
return compiled;
|
||||
}
|
||||
function applyTrainingOption(stat: MainStat, option: TrainingOption, character: CompiledCharacter, last: boolean)
|
||||
{
|
||||
if(option.health) character.health += option.health;
|
||||
if(option.mana) character.mana += option.mana;
|
||||
if(option.modifier) option.modifier.forEach(e => character.modifier[e[0]] += e[1]);
|
||||
if(option.ability) option.ability.forEach(e => character.abilities[e[0]]![0] += e[1]);
|
||||
if(option.mastery) character.mastery[option.mastery]++;
|
||||
if(option.speed) character.speed = option.speed;
|
||||
if(option.initiative) character.initiative += option.initiative;
|
||||
|
||||
Reference in New Issue
Block a user