migration to 7.1.6 system schema, migration to leveldb, sample waaagh effect
This commit is contained in:
63
main.mjs
Normal file
63
main.mjs
Normal file
@@ -0,0 +1,63 @@
|
||||
Hooks.on("init", () => {
|
||||
const config = {
|
||||
|
||||
magicLores: {
|
||||
waaagh: "Da Big Waaagh!"
|
||||
},
|
||||
|
||||
magicWind: {
|
||||
waaagh: "Da Big Waaagh!"
|
||||
},
|
||||
|
||||
loreEffectDescriptions: {
|
||||
waaagh: "Waaagh! Gorka Morka!"
|
||||
},
|
||||
|
||||
loreEffects: {
|
||||
waaagh: {
|
||||
name: "Da Big Waaagh!",
|
||||
icon: "modules/wfrp4e-unofficial-grimoire/icons/spell_waaaaaagh!.jpg",
|
||||
transfer: true,
|
||||
flags: {
|
||||
wfrp4e: {
|
||||
lore: true,
|
||||
applicationData: {
|
||||
type: "target"
|
||||
},
|
||||
scriptData: [
|
||||
{
|
||||
trigger: "immediate",
|
||||
label : "@effect.name",
|
||||
script : `
|
||||
if (game.settings.get("wfrp4e","useGroupAdvantage")) {
|
||||
let advantage = game.settings.get("wfrp4e", "groupAdvantageValues")
|
||||
let playersAdvantage = advantage["players"];
|
||||
let enemiesAdvantage = advantage["enemies"];
|
||||
if (playersAdvantage > 0) {
|
||||
playersAdvantage -= 1;
|
||||
enemiesAdvantage += 1;
|
||||
ChatMessage.create({ content: "Gorka Morka takes your advantages!" });
|
||||
await game.wfrp4e.utility.updateGroupAdvantage({"players" : playersAdvantage, "enemies" : enemiesAdvantage});
|
||||
}
|
||||
} else {
|
||||
ChatMessage.create({ content: "Gorka Morka takes your advantages!" });
|
||||
this.actor.update({ "system.status.advantage.value": Math.max(this.actor.status.advantage.value -1, 0) }, {skipGroupAdvantage: true});
|
||||
this.effect.sourceTest.actor.update({ "system.status.advantage.value": this.effect.sourceTest.actor.status.advantage.value + 1}, {skipGroupAdvantage: true});
|
||||
}
|
||||
`,
|
||||
options : {
|
||||
immediate : {
|
||||
deleteEffect : true
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
foundry.utils.mergeObject(game.wfrp4e.config, config);
|
||||
});
|
||||
|
||||
|
Reference in New Issue
Block a user