#6 : Skill experience management

This commit is contained in:
2021-03-12 20:57:41 +01:00
parent 3285bd416e
commit 9d610215d4
12 changed files with 113 additions and 15 deletions

View File

@@ -43,6 +43,7 @@ export class SoSFlipDialog extends Dialog {
scoreBase += this.flipData.malusConsequence;
scoreBase += this.flipData.bonusConsequence;
scoreBase += this.flipData.woundMalus;
scoreBase += this.flipData.bonusSkillXP;
$('#wound-malus').text(this.flipData.woundMalus);
$('#score-base').text( scoreBase);
}
@@ -74,7 +75,18 @@ export class SoSFlipDialog extends Dialog {
});
}
/* -------------------------------------------- */
updateSkillXPBonus(event) {
this.flipData.skillXPSelected = $('#skillXPBonus').val();
let bonusSkillXP = 0;
for (let skillXPId of this.flipData.skillXPSelected) {
bonusSkillXP += 1;
}
$('#skillxp-bonus').text(bonusSkillXP);
this.flipData.bonusSkillXP = bonusSkillXP;
this.updateScoreBase();
}
/* -------------------------------------------- */
updateConsequenceMalus(event) {
this.flipData.consequencesSelected = $('#consequenceSelectMalus').val();
@@ -122,7 +134,9 @@ export class SoSFlipDialog extends Dialog {
html.find('#statSelect').change((event) => {
this.updateFlip(dialog.flipData );
} );
html.find('#skillXPBonus').change((event) => {
this.updateSkillXPBonus( event );
} );
html.find('#consequenceSelectMalus').change((event) => {
this.updateConsequenceMalus( event );
} );