forked from public/foundryvtt-wh4-lang-fr-fr
Sync to v7.2.0
This commit is contained in:
53
reference_scripts/H85k4L3yICm7cfIk.js
Normal file
53
reference_scripts/H85k4L3yICm7cfIk.js
Normal file
@ -0,0 +1,53 @@
|
||||
const repaired_message = `<p>Finished repairing <em>${this.item.name}</em>.</p>`;
|
||||
const test = 'Sail';
|
||||
const difficulty = 'easy';
|
||||
const target = 10;
|
||||
|
||||
const extendedTestData = {
|
||||
name: this.item.name,
|
||||
type: "extendedTest",
|
||||
img: this.item.img,
|
||||
system: {
|
||||
SL: {
|
||||
current: 0,
|
||||
target: target
|
||||
},
|
||||
test: {
|
||||
value: test
|
||||
},
|
||||
completion: {
|
||||
value: "remove"
|
||||
},
|
||||
difficulty: {
|
||||
value: difficulty
|
||||
}
|
||||
},
|
||||
effects: [
|
||||
{
|
||||
name: `Repair the ${this.item.name}`,
|
||||
icon: this.item.img,
|
||||
flags: {
|
||||
wfrp4e: {
|
||||
applicationData: {
|
||||
type: "document",
|
||||
documentType: "Item"
|
||||
},
|
||||
scriptData: [
|
||||
{
|
||||
label: this.item.name,
|
||||
script: `
|
||||
let id = this.item.flags.wfrp4e.fromEffect;
|
||||
let effect = this.actor.appliedEffects.find(e => e.id === id);
|
||||
this.script.scriptMessage("${repaired_message}");
|
||||
await effect.item.delete();
|
||||
`,
|
||||
trigger: "deleteEffect"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id});
|
Reference in New Issue
Block a user