159 - Companion (#224)

* Initial datamodel

* Fixed attack

* Temp

* Fixed normal levelup

* Fixed showing summary of new experiences

* Touchups

* level sync fixes

* Reworked Action storage

* Companions now take stress when damaged

* Fixed Feature flow

* Removed retroactive companion levelup

* Restored delevel on partner removal

* PR fixes

* Added a check for card duplicates on character
This commit is contained in:
WBHarry 2025-07-01 17:19:41 +02:00 committed by GitHub
parent 6f1529fefe
commit b7e4169079
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 1682 additions and 1012 deletions

View file

@ -96,7 +96,10 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
} else {
this.config.experiences = [...this.config.experiences, button.dataset.key];
} */
this.config.experiences = this.config.experiences.indexOf(button.dataset.key) > -1 ? this.config.experiences.filter(x => x !== button.dataset.key) : [...this.config.experiences, button.dataset.key];
this.config.experiences =
this.config.experiences.indexOf(button.dataset.key) > -1
? this.config.experiences.filter(x => x !== button.dataset.key)
: [...this.config.experiences, button.dataset.key];
this.render();
}
@ -109,7 +112,7 @@ export default class D20RollDialog extends HandlebarsApplicationMixin(Applicatio
if (!options.submitted) this.config = false;
}
static async configure(roll, config = {}, options={}) {
static async configure(roll, config = {}, options = {}) {
return new Promise(resolve => {
const app = new this(roll, config, options);
app.addEventListener('close', () => resolve(app.config), { once: true });

View file

@ -1,7 +1,7 @@
const { ApplicationV2, HandlebarsApplicationMixin } = foundry.applications.api;
export default class DamageDialog extends HandlebarsApplicationMixin(ApplicationV2) {
constructor(roll, config={}, options={}) {
constructor(roll, config = {}, options = {}) {
super(options);
this.roll = roll;
@ -42,19 +42,19 @@ export default class DamageDialog extends HandlebarsApplicationMixin(Application
}
static async submitRoll() {
await this.close({ submitted: true });
await this.close({ submitted: true });
}
/** @override */
_onClose(options={}) {
if ( !options.submitted ) this.config = false;
_onClose(options = {}) {
if (!options.submitted) this.config = false;
}
static async configure(roll, config={}) {
static async configure(roll, config = {}) {
return new Promise(resolve => {
const app = new this(roll, config);
app.addEventListener("close", () => resolve(app.config), { once: true });
app.addEventListener('close', () => resolve(app.config), { once: true });
app.render({ force: true });
});
}
}
}