diff --git a/scripts/common/migration.js b/scripts/common/migration.js index bbb2b7c..b6c6c2f 100644 --- a/scripts/common/migration.js +++ b/scripts/common/migration.js @@ -337,6 +337,13 @@ export default class Migration { { foundry.utils.setProperty(migrated, "system.archetype.id", archetype.id); } + + if (faction) + { + foundry.utils.setProperty(migrated, "system.bio.origin", faction.system.backgrounds.origin.find(i => i.active)?.description || ""); + foundry.utils.setProperty(migrated, "system.bio.accomplishment", faction.system.backgrounds.accomplishment.find(i => i.active)?.description || ""); + foundry.utils.setProperty(migrated, "system.bio.goal", faction.system.backgrounds.goal.find(i => i.active)?.description || ""); + } } return migrated; diff --git a/scripts/model/actor/agent.js b/scripts/model/actor/agent.js index fe2f11d..c46483f 100644 --- a/scripts/model/actor/agent.js +++ b/scripts/model/actor/agent.js @@ -30,18 +30,9 @@ export class AgentModel extends StandardWNGActorModel { height : new fields.StringField(), eye : new fields.StringField(), hair : new fields.StringField(), - origin : new fields.SchemaField({ - value : new fields.StringField(), - bonus : new fields.StringField() - }), - accomplishment : new fields.SchemaField({ - value : new fields.StringField(), - bonus : new fields.StringField() - }), - goal : new fields.SchemaField({ - value : new fields.StringField(), - bonus : new fields.StringField() - }), + origin : new fields.StringField(), + accomplishment : new fields.StringField(), + goal : new fields.StringField(), objective : new fields.StringField() }) @@ -90,7 +81,22 @@ export class AgentModel extends StandardWNGActorModel { } this.experience.current = this.experience.total - this.experience.spent; + } - + static migrateData(data) + { + super.migrateData(data); + if (typeof data.bio.origin == "object") + { + data.bio.origin = data.bio.origin.value; + } + if (typeof data.bio.accomplishment == "object") + { + data.bio.accomplishment = data.bio.accomplishment.value; + } + if (typeof data.bio.goal == "object") + { + data.bio.goal = data.bio.goal.value; + } } } diff --git a/static/template/actor/tab/notes.hbs b/static/template/actor/tab/notes.hbs index ecf5b4b..118dc09 100644 --- a/static/template/actor/tab/notes.hbs +++ b/static/template/actor/tab/notes.hbs @@ -52,19 +52,19 @@