Various fixes

This commit is contained in:
2022-02-16 12:14:34 +01:00
parent 6e8e1ec5a3
commit 8dd7217e69
9 changed files with 124 additions and 55 deletions

View File

@ -11,14 +11,16 @@ export class PegasusActorCreate {
name: "New Actor",
type: "character"
});
this.actor.sheet.render(true);
const racesPack = await PegasusUtility.loadCompendium("fvtt-pegasus-rpg.race");
this.races = racesPack.map(i => i.toObject());
const rolesPack = await PegasusUtility.loadCompendium("fvtt-pegasus-rpg.role");
this.roles = rolesPack.map(i => i.toObject());
const perksPack = await PegasusUtility.loadCompendium("fvtt-pegasus-rpg.perk");
this.perks = perksPack.map(i => i.toObject());
this.actor.sheet.render(true)
this.actor.computeValue = true // To force value computation
const racesPack = await PegasusUtility.loadCompendium("fvtt-pegasus-rpg.race")
this.races = racesPack.map(i => i.toObject())
const rolesPack = await PegasusUtility.loadCompendium("fvtt-pegasus-rpg.role")
this.roles = rolesPack.map(i => i.toObject())
const perksPack = await PegasusUtility.loadCompendium("fvtt-pegasus-rpg.perk")
this.perks = perksPack.map(i => i.toObject())
this.showRaces()
}
@ -239,12 +241,10 @@ export class PegasusActorCreate {
/* --------------- -------------------- --------- */
manageRacePerks(race) {
console.log("MANAG RACE PERKsS", this.currentRace)
if ( !this.currentRace.data.perksgained ) {
this.showRoles()
return;
}
console.log("MANAG RACE PERKsS 2", this.currentRace)
if ( !this.racePerks) { // First init
if ( this.currentRace.data.perksall) {
this.racePerks = duplicate(this.perks)
@ -337,7 +337,7 @@ export class PegasusActorCreate {
formData.rolestats.push( duplicate(this.actor.data.data.statistics[stat.name.toLowerCase()]) )
}
}
console.log("STAT", this.roleStats, formData)
//console.log("STAT", this.roleStats, formData)
this.renderChatMessage( formData)
}
@ -362,7 +362,8 @@ export class PegasusActorCreate {
/* -------------------------------------------- */
async showCharacterEnd() {
this.actor.computeNRGHealth()
await this.actor.computeNRGHealth()
this.actor.computeValue = false // To force value computation
let formData = this.createFormData("character-end")
this.renderChatMessage( formData)
}