#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

@@ -160,6 +160,11 @@ export class SoSActor extends Actor {
return Math.ceil( (this.data.data.stats.strength.value + this.data.data.stats.endurance.value) / 2) + this.data.data.scores.wound.bonusmalus;
}
/* -------------------------------------------- */
getSkillExperience( skillName ) {
return this.data.items.filter( item => item.type == 'skillexperience' && item.data.skill == skillName);
}
/* -------------------------------------------- */
async wornObject( itemID) {
let item = this.getOwnedItem(itemID);
@@ -262,13 +267,15 @@ export class SoSActor extends Actor {
selectedStat: 'strength',
consequencesList: duplicate( this.getApplicableConsequences() ),
wounds: duplicate( this.data.data.wounds),
skillExperienceList: this.getSkillExperience( skill.name),
skill: duplicate(skill),
actor: this,
modifierList: SoSUtility.fillRange(-10, +10),
tnList: SoSUtility.fillRange(6, 20),
malusConsequence: 0,
bonusConsequence: 0,
woundMalus: 0
woundMalus: 0,
bonusSkillXP: 0
}
flipData.statList['nostat'] = { label: "No stat (ie defaulting skills)", value: 0, cardsuit: "none" }
let html = await renderTemplate('systems/foundryvtt-shadows-over-sol/templates/dialog-flip.html', flipData);
@@ -297,6 +304,7 @@ export class SoSActor extends Actor {
target: target,
selectedStat: selectedStatName,
consequencesList: duplicate( this.getApplicableConsequences() ),
skillExperienceList: this.getSkillExperience( skill.name),
wounds: duplicate( this.data.data.wounds),
skill: duplicate(skill),
actor: this,
@@ -304,7 +312,8 @@ export class SoSActor extends Actor {
tnList: SoSUtility.fillRange(6, 20),
malusConsequence: 0,
bonusConsequence: 0,
woundMalus: 0
woundMalus: 0,
bonusSkillXP: 0
}
console.log(flipData);