forked from public/foundryvtt-wh4-lang-fr-fr
Fix scripts !
This commit is contained in:
@@ -16,6 +16,6 @@ if (location)
|
||||
|
||||
let roll = await new Roll("max(1, 1d10 - @system.characteristics.t.bonus)", this.actor).roll()
|
||||
|
||||
roll.toMessage(this.script.getChatData({flavor : `${this.effet.name} (Durée)`}));
|
||||
roll.toMessage(this.script.getChatData({flavor : `${this.effect.name} (Durée)`}));
|
||||
|
||||
this.effet.updateSource({"duration.rounds" : roll.total})
|
||||
this.effect.updateSource({"duration.rounds" : roll.total})
|
||||
@@ -1,6 +1,6 @@
|
||||
if (!this.item.name.includes("(") || this.item.system.Tests.value.includes("Terrain") || this.item.system.Tests.value.toLowerCase().includes("(any)"))
|
||||
if (!this.item.name.includes("(") || this.item.system.tests.value.includes("Terrain") || this.item.system.tests.value.toLowerCase().includes("(any)"))
|
||||
{
|
||||
let Tests = this.item.system.Tests.value
|
||||
let Tests = this.item.system.tests.value
|
||||
let name = this.item.name
|
||||
|
||||
// If name already specifies, make sure Tests value reflects that
|
||||
@@ -26,6 +26,6 @@ if (!this.item.name.includes("(") || this.item.system.Tests.value.includes("Terr
|
||||
}
|
||||
}
|
||||
|
||||
this.effet.updateSource({name})
|
||||
this.effect.updateSource({name})
|
||||
this.item.updateSource({name, "system.tests.value" : tests})
|
||||
}
|
||||
@@ -83,7 +83,7 @@ for (let trapping of trappings)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await args.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : " - " + this.effet.name, context : {failure: "Gain de 1 état Sonné"}})
|
||||
let test = await args.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : " - " + this.effect.name, context : {failure: "Gain de 1 état Sonné"}})
|
||||
await Test.roll();
|
||||
if (Test.Échoué)
|
||||
{
|
||||
|
||||
@@ -69,7 +69,7 @@ for (let trapping of trappings)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
@@ -44,7 +44,7 @@ for (let trait of traits)
|
||||
|
||||
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("ag", {skipTargets: true, appendTitle : ` - ${this.effet.name}`});
|
||||
let test = await this.actor.setupCharacteristic("ag", {skipTargets: true, appendTitle : ` - ${this.effect.name}`});
|
||||
await Test.roll();
|
||||
if (Test.Échoué)
|
||||
{
|
||||
|
||||
@@ -106,7 +106,7 @@ if (ride)
|
||||
items = items.concat({name : "Chaos Steed", type: "trapping", "system.trappingType.value" : "misc"}, skill)
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
@@ -69,7 +69,7 @@ for (let trapping of trappings)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
|
||||
@@ -69,7 +69,7 @@ for (let trapping of trappings)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : " - " + this.effet.name, context : {failure: "GAin d'1 état Sonné"}})
|
||||
let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : " - " + this.effect.name, context : {failure: "GAin d'1 état Sonné"}})
|
||||
await Test.roll();
|
||||
if (Test.Échoué)
|
||||
{
|
||||
|
||||
@@ -17,7 +17,7 @@ if (actor.itemTypes.skill.find(s => s.name === "Savoir (Océans)")) {
|
||||
}
|
||||
|
||||
let Test = await actor.setupSkill('Calme', {
|
||||
appendTitle: ` – ${this.effet.name}`,
|
||||
appendTitle: ` – ${this.effect.name}`,
|
||||
skipTargets: true,
|
||||
fields: {difficulty: 'easy'},
|
||||
characteristic: 'wp',
|
||||
|
||||
@@ -2,4 +2,4 @@ let roll = await new Roll("1d10").roll()
|
||||
|
||||
roll.toMessage(this.script.getChatData({flavor : `Lâche ${dropped.map(i => i.name).join(", ")}!`}));
|
||||
|
||||
this.effet.updateSource({"duration.rounds" : roll.total})
|
||||
this.effect.updateSource({"duration.rounds" : roll.total})
|
||||
@@ -16,13 +16,13 @@ let test = await actor.setupCharacteristic("s", {
|
||||
await Test.roll();
|
||||
if (Test.succeeded) {
|
||||
let SL = parseInt(Test.result.SL);
|
||||
let name = this.effet.name.replace(/\d+/, rating => parseInt(rating) - SL);
|
||||
await this.effet.update({name});
|
||||
let name = this.effect.name.replace(/\d+/, rating => parseInt(rating) - SL);
|
||||
await this.effect.update({name});
|
||||
}
|
||||
|
||||
let rating = parseInt(this.effet.name.match(/\d+/)?.[0]);
|
||||
let rating = parseInt(this.effect.name.match(/\d+/)?.[0]);
|
||||
if (rating <= 1) {
|
||||
const scriptData = this.effet.system.scriptData
|
||||
const scriptData = this.effect.system.scriptData
|
||||
scriptData[2].trigger = '';
|
||||
await this.effet.update({disabled: true, "system.scriptData": scriptData});
|
||||
await this.effect.update({disabled: true, "system.scriptData": scriptData});
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("s", {appendTitle : ` - ${this.effet.name}`, fields : {difficulty : "difficult"}});
|
||||
let test = await this.actor.setupCharacteristic("s", {appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "difficult"}});
|
||||
|
||||
await Test.roll();
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ let traits = [ {name:`, {permanent : true})
|
||||
}
|
||||
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effet.name}`})
|
||||
let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})
|
||||
await Test.roll();
|
||||
if (Test.succeeded)
|
||||
{
|
||||
|
||||
@@ -3,12 +3,12 @@ if (args.attackerTest.data.preData.characteristic !== "s") return;
|
||||
|
||||
const SL = args.opposedTest.data.opposeResult.differenceSL;
|
||||
|
||||
const targetId = this.effet.getFlag("wfrp4e", "target");
|
||||
const targetId = this.effect.getFlag("wfrp4e", "target");
|
||||
const target = canvas.scene.tokens.get(targetId);
|
||||
|
||||
if (SL > 4) {
|
||||
args.opposedTest.data.opposeResult.other.push(`<b>${args.defenderTest.actor.name}</b> a été forcé de laisser partir <b>${target.name}</b>.`);
|
||||
return await this.effet.delete();
|
||||
return await this.effect.delete();
|
||||
}
|
||||
|
||||
if (SL > 0) {
|
||||
|
||||
@@ -24,7 +24,7 @@ async function rollTable(characteristics, formula, name) {
|
||||
}
|
||||
|
||||
const characteristics = new Set();
|
||||
await rollTable(characteristics, "2d10", this.effet.name)
|
||||
await rollTable(characteristics, "2d10", this.effect.name)
|
||||
|
||||
if (characteristics.has("*")) {
|
||||
characteristics.delete("*");
|
||||
@@ -41,4 +41,4 @@ if (characteristics.has("*")) {
|
||||
characteristics.add(result);
|
||||
}
|
||||
|
||||
this.effet.setFlag("wfrp4e", "characteristicsToSwap", Array.from(characteristics));
|
||||
this.effect.setFlag("wfrp4e", "characteristicsToSwap", Array.from(characteristics));
|
||||
@@ -18,4 +18,4 @@ let roll = await new Roll("1d10").roll()
|
||||
|
||||
roll.toMessage(this.script.getChatData({flavor : `Lâche ${dropped.map(i => i.name).join(", ")}!`}));
|
||||
|
||||
this.effet.updateSource({"duration.rounds" : roll.total})
|
||||
this.effect.updateSource({"duration.rounds" : roll.total})
|
||||
@@ -27,7 +27,7 @@ else
|
||||
|
||||
if (choice.length)
|
||||
{
|
||||
let changes = foundry.utils.deepClone(this.effet.changes);
|
||||
let changes = foundry.utils.deepClone(this.effect.changes);
|
||||
|
||||
for(let training of choice)
|
||||
{
|
||||
@@ -62,7 +62,7 @@ if (choice.length)
|
||||
|
||||
case "guard" :
|
||||
let territorial = await fromUuid("Compendium.wfrp4e-core.items.Item.JIAe7i7dqTQBu4do");
|
||||
await this.actor.createEmbeddedDocuments("Item", [territorial], {fromEffect: this.effet.id})
|
||||
await this.actor.createEmbeddedDocuments("Item", [territorial], {fromEffect: this.effect.id})
|
||||
foundry.utils.setProperty(args, "options.keepId", true);
|
||||
break;
|
||||
|
||||
@@ -83,6 +83,6 @@ if (choice.length)
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.effet.updateSource({name : `${this.effet.name} (${choice.map(i => i.name).join(", ")})`, changes, "flags.wfrp4e.trained" : choice.map(i => i.id)})
|
||||
this.effect.updateSource({name : `${this.effect.name} (${choice.map(i => i.name).join(", ")})`, changes, "flags.wfrp4e.trained" : choice.map(i => i.id)})
|
||||
this.item.updateSource({"system.specification.value" : `${choice.map(i => i.name).join(", ")}`})
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effet.name}`})
|
||||
let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})
|
||||
await Test.roll();
|
||||
if (Test.Échoué)
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
if (this.actor.Species.toLowerCase() != "skaven") {
|
||||
this.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - Utilise ${this.effet.name}`, fields: { difficulty: "difficult" } }).then(async Test => {
|
||||
this.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - Utilise ${this.effect.name}`, fields: { difficulty: "difficult" } }).then(async Test => {
|
||||
await Test.roll()
|
||||
if (Test.Échoué)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("wp", {fields: {difficulty : "average"}, skipTargets: true, appendTitle : ` - ${this.effet.name}`})
|
||||
let test = await this.actor.setupCharacteristic("wp", {fields: {difficulty : "average"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})
|
||||
await Test.roll();
|
||||
if (Test.Échoué)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - ${this.effet.name}`, fields : {difficulty : "difficult"}})
|
||||
let test = await this.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "difficult"}})
|
||||
await test.roll();
|
||||
if (test.failed)
|
||||
{
|
||||
|
||||
@@ -8,7 +8,7 @@ if (test.failed && (test.result.roll % 11 == 0 || test.result.roll == 100))
|
||||
}
|
||||
else
|
||||
{
|
||||
let points = this.effet.sourceTest.result.overcast.usage.other.current;
|
||||
let points = this.effect.sourceTest.result.overcast.usage.other.current;
|
||||
this.actor.update({"system.status.corruption.value" : this.actor.system.status.corruption.value - points})
|
||||
this.script.message(`Perd de ${points} de Corruption`)
|
||||
}
|
||||
@@ -70,7 +70,7 @@ for (let trapping of trappings)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("ag", {skipTargets: true, appendTitle : ` - ${this.effet.name}`, context: { failure: "Goes Prone" }})
|
||||
let test = await this.actor.setupCharacteristic("ag", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, context: { failure: "Goes Prone" }})
|
||||
await Test.roll();
|
||||
if (Test.Échoué)
|
||||
{
|
||||
|
||||
@@ -12,4 +12,4 @@ while (locations.length < 2)
|
||||
locationText = locations.map(i => game.wfrp4e.config.locations[i]).join(", ")
|
||||
|
||||
this.item.updateSource({name : this.item.name += ` (${locationText})`, "flags.wfrp4e.locations" : locations})
|
||||
this.effet.updateSource({"flags.wfrp4e.locations" : locations})
|
||||
this.effect.updateSource({"flags.wfrp4e.locations" : locations})
|
||||
@@ -138,6 +138,6 @@ arcane.forEach(i => {
|
||||
})
|
||||
let spells = [...petty, ...necromancy, ...arcane];
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items.concat(spells));
|
||||
|
||||
@@ -8,7 +8,7 @@ if (stunned > this.actor.system.characteristics.t.bonus) {
|
||||
|
||||
const Test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {
|
||||
skipTargets: true,
|
||||
appendTitle: ` - ${this.effet.name}`,
|
||||
appendTitle: ` - ${this.effect.name}`,
|
||||
fields: {difficulty: "average"},
|
||||
context: {failure: `Encaisse ${crit} à la tête.`}
|
||||
})
|
||||
|
||||
@@ -142,7 +142,7 @@ for (let spell of spells)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
@@ -25,7 +25,7 @@ filters = [
|
||||
}
|
||||
]
|
||||
|
||||
let arcane = await ItemDialog.createFromFilters(filters, 12, {title : this.effet.name, text : "Choisissez 12 Sorts d'Arcane"})
|
||||
let arcane = await ItemDialog.createFromFilters(filters, 12, {title : this.effect.name, text : "Choisissez 12 Sorts d'Arcane"})
|
||||
|
||||
let items = petty.map(i => i.toObject()).concat(arcane.map(i => {
|
||||
let spell = i.toObject();
|
||||
|
||||
@@ -96,7 +96,7 @@ if (ride)
|
||||
}
|
||||
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("i", {skipTargets: true, appendTitle : ` - ${this.effet.name}`, fields : {difficulty : "easy"}})
|
||||
let test = await this.actor.setupCharacteristic("i", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "easy"}})
|
||||
await Test.roll();
|
||||
|
||||
if (!Test.succeeded)
|
||||
|
||||
@@ -83,7 +83,7 @@ for (let trapping of trappings)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
console.log(">>>>>>><", items)
|
||||
|
||||
@@ -70,7 +70,7 @@ for (let trapping of trappings)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
|
||||
@@ -11,8 +11,8 @@ else
|
||||
{
|
||||
group = await ValueDialog.create({text : "Entrez le Groupe de Haine", title : "Groupe de Haine"})
|
||||
|
||||
this.item.updateSource({name : this.item.name + ` (${group})`, "system.tests.value" : this.item.system.Tests.value.replace("Group", group)})
|
||||
this.effet.updateSource({name : this.effet.name + ` (${group})`})
|
||||
this.item.updateSource({name : this.item.name + ` (${group})`, "system.tests.value" : this.item.system.tests.value.replace("Group", group)})
|
||||
this.effect.updateSource({name : this.effect.name + ` (${group})`})
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if (args.effect.conditionId == "ablaze")
|
||||
{
|
||||
args.data.formula += ` + parseInt(this.effet.sourceTest.result.SL)`
|
||||
args.data.formula += ` + parseInt(this.effect.sourceTest.result.SL)`
|
||||
}
|
||||
@@ -4,6 +4,6 @@ this.script.notification(`Utilisé ${uses} fois`)
|
||||
this.item.setFlag("wfrp4e", "uses", uses);
|
||||
if (uses >= 3)
|
||||
{
|
||||
this.effet.update({"system.transferData.type" : "other"})
|
||||
this.effect.update({"system.transferData.type" : "other"})
|
||||
this.script.notification(`Utilisé`);
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ if (SL >= 3)
|
||||
difficulty = "vhard"
|
||||
|
||||
|
||||
let test = await args.actor.setupCharacteristic("wp", {fields: {difficulty}, skipTargets: true, appendTitle : " - " + this.effet.name, context : {failure: "Reçoit un état Sonné"}})
|
||||
let test = await args.actor.setupCharacteristic("wp", {fields: {difficulty}, skipTargets: true, appendTitle : " - " + this.effect.name, context : {failure: "Reçoit un état Sonné"}})
|
||||
await Test.roll();
|
||||
if (Test.Échoué)
|
||||
{
|
||||
|
||||
@@ -41,7 +41,7 @@ let traits = [ {name:`, {permanent : true})
|
||||
}
|
||||
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
|
||||
@@ -11,7 +11,7 @@ if (this.item.system.tests.value.includes("(Groupe social)"))
|
||||
}
|
||||
else
|
||||
{
|
||||
let value = await ValueDialog.create({text : "Entrez le Groupe d'Étiquette", title : this.effet.name});
|
||||
let value = await ValueDialog.create({text : "Entrez le Groupe d'Étiquette", title : this.effect.name});
|
||||
if (value)
|
||||
{
|
||||
name = `${name.split("(")[0].trim()} (${value})`
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
let amberTalons = foundry.utils.deepClone(game.wfrp4e.config.systemItems.unarmed);
|
||||
amberTalons.name = "Serres d'ambre";
|
||||
amberTalons.img = this.effet.img;
|
||||
amberTalons.img = this.effect.img;
|
||||
amberTalons.system.damage.value = "SB + WPB"
|
||||
amberTalons.system.equipped = true;
|
||||
amberTalons.system.qualities.value.push({name : "magical"})
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
if (args.totalWoundLoss > 0)
|
||||
{
|
||||
|
||||
let test = await args.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - ${this.effet.name}`, fields : {difficulty : "hard"}})
|
||||
let test = await args.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "hard"}})
|
||||
await test.roll()
|
||||
if (test.failed)
|
||||
{
|
||||
|
||||
@@ -12,15 +12,15 @@ if (turns > 0) {
|
||||
return this.script.message(`<p><b>${speaker.alias}</b> continue de s'enrouler autour de <b>${target.name}</b>. Il pourra commencer à écraser dans ${turns} tours.</p>`);
|
||||
}
|
||||
|
||||
if (this.actor.items.find(i => i.type === "extendedTest" && i.name === this.effet.name)) {
|
||||
if (this.actor.items.find(i => i.type === "extendedTest" && i.name === this.effect.name)) {
|
||||
this.script.message(`<p><b>${speaker.alias}</b> peut reprendre l'écrasement de <b>${target.name}</b> avec le Test Étendu.</p>`);
|
||||
return;
|
||||
}
|
||||
|
||||
const extendedTestData = {
|
||||
name: this.effet.name,
|
||||
name: this.effect.name,
|
||||
type: "extendedTest",
|
||||
img: this.effet.img,
|
||||
img: this.effect.img,
|
||||
system: {
|
||||
SL: {
|
||||
current: 0,
|
||||
@@ -38,7 +38,7 @@ const extendedTestData = {
|
||||
}
|
||||
};
|
||||
|
||||
const extendedTests = await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effet.id});
|
||||
const extendedTests = await this.actor.createEmbeddedDocuments("Item", [extendedTestData], {fromEffect: this.effect.id});
|
||||
const extendedTest = extendedTests[0];
|
||||
|
||||
this.script.message(`<p><b>${speaker.alias}</b> a fini de s'enrouler autour de <b>${target.name}</b>. Il peut maintenant commencer à écraser via le Test Étendu @UUID[${extendedTest.uuid}].</p>`);
|
||||
|
||||
@@ -116,7 +116,7 @@ for (let spell of spells)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
@@ -2,7 +2,7 @@ if (this.sourceActor.uuid === this.actor.uuid) return;
|
||||
|
||||
const test = await this.actor.setupCharacteristic("t", {
|
||||
skipTargets: true,
|
||||
appendTitle: ` — ${this.effet.name}`,
|
||||
appendTitle: ` — ${this.effect.name}`,
|
||||
fields: {
|
||||
difficulty: "difficult"
|
||||
},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effet.name}`})
|
||||
let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})
|
||||
await Test.roll();
|
||||
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
let tokenImg = ""; // Put path to token image here, inbetween the quotation marks
|
||||
if (tokenImg)
|
||||
{
|
||||
if (this.effet.getFlag("wfrp4e", "transformed"))
|
||||
if (this.effect.getFlag("wfrp4e", "transformed"))
|
||||
{
|
||||
await this.effect.setFlag("wfrp4e", "transformed", false);
|
||||
this.actor.getActiveTokens().forEach(t => t.document.update({texture : {src: this.actor.prototypeToken.texture.src}}));
|
||||
|
||||
@@ -116,7 +116,7 @@ for (let spell of spells)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
@@ -18,7 +18,7 @@ do {
|
||||
if (!choice) break;
|
||||
|
||||
const roll = new Roll("1d10");
|
||||
await roll.toMessage({flavor: this.effet.name});
|
||||
await roll.toMessage({flavor: this.effect.name});
|
||||
|
||||
if (roll.total >= 7) {
|
||||
SL = -1;
|
||||
@@ -28,4 +28,4 @@ do {
|
||||
SL++;
|
||||
} while (true);
|
||||
|
||||
this.effet.setFlag("wfrp4e", "SL", SL);
|
||||
this.effect.setFlag("wfrp4e", "SL", SL);
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("t", { appendTitle: ` - ${this.effet.name}`, fields: { difficulty: "challenging" } })
|
||||
let test = await this.actor.setupCharacteristic("t", { appendTitle: ` - ${this.effect.name}`, fields: { difficulty: "challenging" } })
|
||||
await Test.roll();
|
||||
|
||||
if (Test.Échoué)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effet.name}`})
|
||||
let test = await this.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : ` - ${this.effect.name}`})
|
||||
await Test.roll();
|
||||
|
||||
// Kind of insane but whatever
|
||||
|
||||
@@ -108,7 +108,7 @@ if (ride)
|
||||
items = items.concat({name : "Chaos Steed", type: "trapping", "system.trappingType.value" : "misc"}, skill)
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
console.log(">>>>>>><", items)
|
||||
|
||||
@@ -69,7 +69,7 @@ for (let trapping of trappings)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
let location = this.item.system.location.key
|
||||
let test = await this.actor.setupCharacteristic("dex", {context : {failure : `<strong>${this.effect.name}</strong>: Lâchez l'objet!`}, skipTargets: true, appendTitle : " - " + this.effet.name, fields : {difficulty : "average"}})
|
||||
let test = await this.actor.setupCharacteristic("dex", {context : {failure : `<strong>${this.effect.name}</strong>: Lâchez l'objet!`}, skipTargets: true, appendTitle : " - " + this.effect.name, fields : {difficulty : "average"}})
|
||||
await Test.roll();
|
||||
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ if (ride)
|
||||
}
|
||||
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
|
||||
@@ -9,7 +9,7 @@ else if (location == "rArm")
|
||||
this.script.notification("Bras Droit")
|
||||
}
|
||||
|
||||
this.effet.updateSource({"flags.wfrp4e.location" : location});
|
||||
this.effect.updateSource({"flags.wfrp4e.location" : location});
|
||||
|
||||
if (location)
|
||||
{
|
||||
@@ -29,4 +29,4 @@ let roll = await new Roll("1d10").roll()
|
||||
|
||||
roll.toMessage(this.script.getChatData({flavor : `Lâche ${dropped.map(i => i.name).join(", ")}!`}));
|
||||
|
||||
this.effet.updateSource({"duration.rounds" : roll.total})
|
||||
this.effect.updateSource({"duration.rounds" : roll.total})
|
||||
@@ -83,7 +83,7 @@ for (let trapping of trappings)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
console.log(">>>>>>><", items)
|
||||
|
||||
@@ -3,19 +3,19 @@ if (this.item.name.includes("(") && !this.item.name.toLowerCase().includes("(any
|
||||
{
|
||||
resistance = this.item.parenthesesText
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
resistance = await ValueDialog.create({text : "Entrez la Résistance", title : "Résistance"})
|
||||
|
||||
resistance = await ValueDialog.create({text : "Entrez la Résistance", title : "Résistance"})
|
||||
|
||||
if (resistance)
|
||||
{
|
||||
this.item.updateSource({name : `${this.item.name.split("(")[0].trim()} (${resistance})`})
|
||||
this.effet.updateSource({name : this.effet.name + ` (${resistance})`})
|
||||
this.effect.updateSource({name : this.effect.name + ` (${resistance})`})
|
||||
}
|
||||
}
|
||||
this.item.updateSource({"system.tests.value" : this.item.system.Tests.value.replace("the associated Threat", resistance)})
|
||||
}
|
||||
this.item.updateSource({"system.tests.value" : this.item.system.tests.value?.replace("la Menace associée", resistance) || resistance})
|
||||
|
||||
if (resistance && !this.effet.name.includes("("))
|
||||
if (resistance && !this.effect.name.includes("("))
|
||||
{
|
||||
this.effect.updateSource({name : this.effect.name += ` (${resistance})`})
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "difficult", slBonus : -1 * this.effet.sourceTest.result.SL}})
|
||||
let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "difficult", slBonus : -1 * this.effect.sourceTest.result.SL}})
|
||||
await Test.roll();
|
||||
if (Test.succeeded)
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
if (args.totalWoundLoss > 0)
|
||||
{
|
||||
args.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - ${this.effet.name}`, fields: { difficulty: "difficult" } }).then(async Test => {
|
||||
args.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields: { difficulty: "difficult" } }).then(async Test => {
|
||||
await Test.roll();
|
||||
if (Test.Échoué)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - ${this.effet.name}`, fields : {difficulty : "hard"}})
|
||||
let test = await this.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "hard"}})
|
||||
await Test.roll();
|
||||
if (Test.Échoué)
|
||||
{
|
||||
|
||||
@@ -142,7 +142,7 @@ for (let spell of spells)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
this.actor.createEmbeddedDocuments("Item", items);
|
||||
@@ -2,7 +2,7 @@ if (!this.item.equipped.value) {
|
||||
return this.script.notification(`Vous devez équiper le ${this.item.name} pour récupérer des points de blessures.`,"info")
|
||||
}
|
||||
|
||||
const runesOfRestoration = this.item.effects.contents.filter(e => e.name == this.effet.name)
|
||||
const runesOfRestoration = this.item.effects.contents.filter(e => e.name == this.effect.name)
|
||||
const restorationWounds = parseInt(runesOfRestoration.length * this.actor.system.characteristics.t.bonus)
|
||||
|
||||
this.actor.modifyWounds(restorationWounds)
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
let test = await this.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - ${this.effet.name}`, fields : {difficulty : "vhard"}});
|
||||
let test = await this.actor.setupCharacteristic("t", {skipTargets: true, appendTitle : ` - ${this.effect.name}`, fields : {difficulty : "vhard"}});
|
||||
await Test.roll();
|
||||
CorruptionMessageModel.createCorruptionMessage("minor", this.script.getChatData())
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ for (let trapping of trappings)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
console.log(">>>>>>><", items)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
if (!this.item.name.includes("(") || this.item.system.Tests.value.includes("(Sense)") || this.item.system.Tests.value.toLowerCase().includes("(any)"))
|
||||
if (!this.item.name.includes("(") || this.item.system.tests.value.includes("(Sense)") || this.item.system.tests.value.toLowerCase().includes("(any)"))
|
||||
{
|
||||
let Tests = this.item.system.Tests.value
|
||||
let Tests = this.item.system.tests.value
|
||||
let name = this.item.name
|
||||
|
||||
// If name already specifies, make sure Tests value reflects that
|
||||
|
||||
@@ -19,7 +19,7 @@ let hitloc = await game.wfrp4e.tables.rollTable("hitloc")
|
||||
let value = hitloc.result
|
||||
let desc = hitloc.description
|
||||
|
||||
this.effet.updateSource({"flags.wfrp4e.location" : value})
|
||||
this.effect.updateSource({"flags.wfrp4e.location" : value})
|
||||
|
||||
msg += ` alors que des yeux sortent de leur ${desc}`
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ for (let trapping of trappings)
|
||||
}
|
||||
}
|
||||
|
||||
updateObj.name = updateObj.name += " " + this.effet.name
|
||||
updateObj.name = updateObj.name += " " + this.effect.name
|
||||
|
||||
await this.actor.update(updateObj)
|
||||
console.log(">>>>>>><", items)
|
||||
|
||||
Reference in New Issue
Block a user