Ajout de la commande /voyage et grosse MAJK de la commande /auberge

This commit is contained in:
2026-01-07 15:04:49 +01:00
parent c8119601d8
commit f525b6c07a
1329 changed files with 24138 additions and 4397 deletions

View File

@@ -1 +1 @@
return args.item?.system?.isRanged && args.data.targets[0]?.actor?.sizeNum < 3
return args.item?.system?.isProjectiles && args.data.targets[0]?.actor?.sizeNum < 3

View File

@@ -2,24 +2,24 @@
// takes 3 Poisoned Conditions that cannot be resisted at first,
await this.actor.addCondition("poisoned", 3)
// recovers a number of Wounds equal to their Toughness Bonus,
// recovers a number of Wounds equal to their Toughness Bonus,
await this.actor.modifyWounds(this.actor.system.characteristics.t.bonus)
// and acquires the Regenerate Creature Trait.
const hasRegenerate = this.actor.has("Régénération")
if (hasRegenerate === undefined) {
// and acquires the Régénération Creature Trait.
const hasRégénération = this.actor.has("Régénération")
if (hasRégénération === undefined) {
fromUuid("Compendium.wfrp4e-core.items.SfUUdOGjdYpr3KSR").then(trait => {
let traitItem = trait.toObject()
this.actor.createEmbeddedDocuments("Item", [traitItem], {fromEffect: this.effect.id})
})
}
this.script.scriptMessage(`<p><strong>${this.actor.prototypeToken.name}</strong> :
this.script.message(`<p><strong>${this.actor.prototypeToken.name}</strong> a :
<ul>
<li>Reçoit 3 états Empoisonnés, sans Test de Résistance possible</li>
<li>Récupère ${this.actor.system.characteristics.t.bonus} Blessures</li>
<li>Acuiert le Trait de Creature Régénération.</li>
<li>Acquis 3 états Empoisonné qui ne peuvent pas être résistés au début du round.</li>
<li>Récupération de ${this.actor.system.characteristics.t.bonus} Blessures</li>
<li>Acquisition du Trait de Créature Régénération.</li>
</ul>
C'est à Ranaldde choisir si la régénératin peut guérir de l'empoisonnement.</p>
<p>Lorsque tout les états Empoisonnés sont terminés, le Trait Régénération est perdu également.</p>`,
{ whisper: ChatMessage.getWhisperRecipients("GM"), blind: true })
Cest à Ranald de décider si leur régénération peut dépasser leur empoisonnement.</p>
<p>Lorsque tous les états Empoisonné sont perdus, la Régénération lest aussi.</p>`,
{ whisper: ChatMessage.getWhisperRecipients("GM"), blind: true })

View File

@@ -0,0 +1,3 @@
if (args.test.result.misfire && args.test.result.roll !== 100) {
delete args.test.result.misfire
}

View File

@@ -1 +1 @@
return !args.options.terror && !args.extendedTest?.flags.wfrp4e?.fear
return !args.context.terror && !args.extendedTest?.flags.wfrp4e?.fear

View File

@@ -1 +0,0 @@
return !args.skill?.name.includes(game.i18n.localize("NAME.Row")) && !args.skill?.name.includes(game.i18n.localize("NAME.Sail"));

View File

@@ -1,4 +1,4 @@
let spells = await warhammer.utility.findAllItems("spell", "Chargement des sorts")
let spells = await warhammer.utility.findAllItems("spell", "Chargement des sorts", true, ["system.lore.value"])
let text = (await game.wfrp4e.tables.rollTable("random-caster", {hideDSN: true})).result
@@ -6,15 +6,15 @@ lore = Array.from(text.matchAll(/{(.+?)}/gm))[0][1]
if (text == "GM's Choice")
{
return this.script.scriptNotification(text)
return this.script.notification(text)
}
if (spellsWithLore.length > 0)
{
let spellsWithLore = spells.filter(i => game.wfrp4e.config.magicLores[i.system.lore.value] == lore)
let selectedSpell = spellsWithLore[Math.floor(CONFIG.Dice.randomUniform() * spellsWithLore.length)]
this.script.scriptNotification(selectedSpell.name);
this.actor.createEmbeddedDocuments("Item", [selectedSpell])
this.script.notification(selectedSpell.name);
this.actor.createEmbeddedDocuments("Item", [(await fromUuid(selectedSpell)).toObject()])
}
else
{

View File

@@ -0,0 +1,4 @@
if ( args.actor.has(game.i18n.localize("NAME.AA"), "talent") ||
args.actor.has(game.i18n.localize("NAME.SecondSight"), "talent") ) {
args.modifiers.other.push({label : this.effect.name, value : 5, details : "La Cible possède Harmonisation Aethyrique ou Seconde Vue"});
}

View File

@@ -0,0 +1 @@
return args.characteristic != "int" || args.type != "characteristic"

View File

@@ -0,0 +1 @@
return args.skill?.name !== game.i18n.localize("NAME.Cool") && args.skill?.name !== game.i18n.localize("NAME.Résistance");

View File

@@ -0,0 +1 @@
this.item.update({"system.AP" : {lArm : 0, rArm : 0, lLeg : 0, rLeg: 0}});

View File

@@ -1,7 +1,7 @@
let table = game.wfrp4e.tables.findTable("mutatephys");
if (!table)
{
return ui.notifications.error("La table des Mutations n'a pas été trouvée. Assurez vous que la table avec la clé `mutatephys` est bien importée dans le monde.")
return ui.notifications.error("Table de Mutation introuvable, veuillez vous assurer qu'une table avec la clé `mutatephys` est importée dans le monde.")
}
let result = (await table.roll()).results[0];
let uuid = `Compendium.${result.documentCollection}.${result.documentId}`
@@ -9,10 +9,10 @@ let item = await fromUuid(uuid);
if (item)
{
this.script.scriptNotification(`${item.name} added`)
this.script.notification(`${item.name} added`)
this.actor.createEmbeddedDocuments("Item", [item])
}
else
else
{
ui.notifications.error("L'item ne peut être trouvé: " + uuid)
ui.notifications.error("Impossible de trouver l'objet : " + uuid)
}

View File

@@ -6,7 +6,7 @@ if (location)
if (dropped.length)
{
this.script.scriptNotification(`Lache ${dropped.map(i => i.name).join(", ")}!`)
this.script.notification(`Lache ${dropped.map(i => i.name).join(", ")}!`)
for(let weapon of dropped)
{
await weapon.system.toggleEquip();
@@ -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.effect.name} (Durée)`}));
roll.toMessage(this.script.getChatData({flavor : `${this.effet.name} (Durée)`}));
this.effect.updateSource({"duration.rounds" : roll.total})
this.effet.updateSource({"duration.rounds" : roll.total})

View File

@@ -1,9 +0,0 @@
if (args.skill?.name != game.i18n.localize("NAME.Gossip"))
{
return true;
}
else
{
args.data.canReverse = true; // Kind of a kludge here, the talent Tests has a specific condition, but the description simply says "any gossip test can be reversed" so check it here instead of submission
}

View File

@@ -1,6 +1,6 @@
if (args.applyAP && args.modifiers.ap.metal)
if (args.applyAP && args.modifiers.ap.metal)
{
args.modifiers.ap.ignored += args.modifiers.ap.metal
args.modifiers.ap.details.push("<strong>" + this.effect.name + "</strong>: Ignore le m<>tal (" + args.modifiers.ap.metal + ")");
args.modifiers.ap.details.push("<strong>" + this.effect.name + "</strong>: Ignorer Métal (" + args.modifiers.ap.metal + ")");
args.modifiers.ap.metal = 0
}

View File

@@ -0,0 +1,3 @@
let wounds = this.effect.sourceActor.system.characteristics.wp.bonus;
this.actor.modifyWounds(wounds);
this.script.message(`Soigne ${wounds} Blessures`);

View File

@@ -0,0 +1 @@
if (!this.actor.has(game.i18n.localize("NAME.SecondSight"),"talent")) this.actor.addEffectItems("Compendium.wfrp4e-core.items.Item.OEjUvJKi0xmBwbS2", this.effect)

View File

@@ -0,0 +1,5 @@
let fearCounter = this.item.effects.filter(i => i.name == this.effect.name).length;
fearCounter += Number(this.actor.has("Peur")?.system.specification.value) || 0
game.wfrp4e.utility.postPeur(fearCounter || 1, this.effect.name)

View File

@@ -1,4 +1,4 @@
if (args.test.spell)
{
args.test.result.other.push(`<strong>${this.effect.name}</strong>: Automatic Failure`)
args.test.result.other.push(`<strong>${this.effect.name}</strong>: Echec Automatique`)
}

View File

@@ -0,0 +1 @@
return args.item?.system?.attackType == "ranged" && !this.actor.system.canFly.effects.filter(e => e.name == "Flying")[0].disabled

View File

@@ -1,7 +0,0 @@
this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {
await test.roll()
if (test.failed)
{
this.actor.addCondition("stunned")
}
})

View File

@@ -0,0 +1,3 @@
let species = await ValueDialog.create({text : "Saisir l'espèce cible (singulier)", title : this.effect.name})
this.effect.updateSource({name : this.effect.setSpecifier(species)});

View File

@@ -0,0 +1,7 @@
let value = await ValueDialog.create({
title : this.script.label,
text: "Notes de Victoire pour le Journal d'Expérience"
});
value
? this.actor.system.awardExp(50, value)
: this.actor.system.awardExp(50, this.script.label)

View File

@@ -0,0 +1,4 @@
if (args.test.options.doomboltRolled)
{
args.test.result.damage += 4;
}

View File

@@ -1 +1 @@
return args.options.terror || args.extendedTest?.flags.wfrp4e?.fear
return args.context.terror || args.extendedTest?.flags.wfrp4e?.fear

View File

@@ -1,6 +1,6 @@
let type = this.item.getFlag("wfrp4e", "breath");
if (["feu", "electricité", "poison"].includes(type))
if (["fire", "electricity", "poison"].includes(type))
{
args.applyAP = false;
}

View File

@@ -2,6 +2,6 @@ let state = !this.effect.disabled;
this.effect.update({"disabled": state});
if (state)
return ui.notifications.info("EFFECT.CreatureBackInWater", {localize: true})
return ui.notifications.info("Effet.CreatureBackInWater", {localize: true})
return ui.notifications.info("EFFECT.CreatureOutOfWater", {localize: true});
return ui.notifications.info("Effet.CreatureOutOfWater", {localize: true});

View File

@@ -1,31 +1,31 @@
if (!this.item.name.includes("(") || this.item.system.tests.value.includes("Terrain"))
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
if (name.includes("("))
// If name already specifies, make sure Tests value reflects that
if (name.includes("(") && !name.toLowerCase().includes("(any)"))
{
let terrain = name.split("(")[1].split(")")[0]
tests = tests.replace("Terrain", terrain)
tests = tests.replace("the Terrain", terrain)
}
else // If no sense specified, provide dialog choice
{
let choice = await ItemDialog.create(ItemDialog.objectToArray({
coastal : "Côtes",
coastal : "Littoral",
deserts : "Déserts",
marshes : "Marches",
rocky : "Rocailles",
tundra : "Tundra",
woodlands : "Forêts"
}, this.item.img), 1, "Choisir le Terrain");
marshes : "Marécages",
rocky : "Rocailleux",
tundra : "Toundra",
woodlands : "Régions boisées"
}, this.item.img), 1, "Choisissez un Terrain");
if (choice[0])
{
name = `${name.split("(")[0].trim()} (${choice[0].name})`
tests = tests.replace("Terrain", "Terrain " + choice[0].name )
tests = tests.replace("Terrain", choice[0].name + " Terrain")
}
}
this.effect.updateSource({name})
this.effet.updateSource({name})
this.item.updateSource({name, "system.tests.value" : tests})
}

View File

@@ -1 +0,0 @@
return !args.skill?.name.includes(game.i18n.localize("NAME.Language"));

View File

@@ -14,13 +14,13 @@
let updateObj = this.actor.toObject();
let talents = (await Promise.all([game.wfrp4e.tables.rollTable("talents"), game.wfrp4e.tables.rollTable("talents"), game.wfrp4e.tables.rollTable("talents")])).map(i => i.text)
let talents = (await Promise.tout([game.wfrp4e.tables.rollTable("talents"), game.wfrp4e.tables.rollTable("talents"), game.wfrp4e.tables.rollTable("talents")])).map(i => i.text)
for (let ch in characteristics)
{
updateObj.system.characteristics[ch].modifier += characteristics[ch];
}
for (let talent of talents)
{
let talentItem = await game.wfrp4e.utility.findTalent(talent)
@@ -28,13 +28,12 @@
{
items.push(talentItem.toObject());
}
else
else
{
ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})
}
}
await this.actor.update(updateObj)
this.actor.createEmbeddedDocuments("Item", items);

View File

@@ -10,12 +10,12 @@ let characteristics = {
"wp" : 10,
"fel" : 10
}
let skills = ["Intimidate", "Commandement" , "Perception"]
let skills = ["Intimidation", "Commandement", "Perception"]
let skillAdvancements = [10, 10, 10]
let talents = ["Combat Aware", "Drilled", "Menaçant", "Robust"]
let trappings = ["Arme simple", "Mail Coat", "Mail Chausses"]
let specialItems = [
]
let talents = ["Vigilance", "Coude-à-coude", "Menaçant", "Robuste"]
let trappings = ["Arme simple", "Cotte de Mailles", "Chausses de Mailles"]
let specialItems = [
]
let items = [];
let updateObj = this.actor.toObject();
@@ -28,11 +28,11 @@ for (let ch in characteristics)
for (let item of specialItems) {
let newItem
if (item.type == "weapon") {
newItem = new ItemWfrp4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })
newItem = new ItemWFRP4e({ name: item.name, type: item.type, system: { equipped: true, damage: {value: item.damage}} })
} else if (item.type == "trapping") {
newItem = new ItemWfrp4e({ img: "systems/wfrp4e/icons/blank.png", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )
newItem = new ItemWFRP4e({ img: "systems/wfrp4e/icons/blank.png", name: item.name, type: item.type, system: { worn: true, trappingType: { value: item.trappingType} } } )
} else {
newItem = new ItemWfrp4e({ img: "systems/wfrp4e/icons/blank.png", name: item.name, type: item.type })
newItem = new ItemWFRP4e({ img: "systems/wfrp4e/icons/blank.png", name: item.name, type: item.type })
}
items.push(newItem.toObject())
}
@@ -44,7 +44,7 @@ for (let index = 0; index < skills.length; index++)
skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill")
if (skillItem)
skillItem.system.advances.value += skillAdvancements[index]
else
else
{
skillItem = await game.wfrp4e.utility.findSkill(skill)
skillItem = skillItem.toObject();
@@ -60,13 +60,13 @@ for (let talent of talents)
{
items.push(talentItem.toObject());
}
else
else
{
ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})
}
}
for (let trapping of trappings)
for (let trapping of trappings)
{
let trappingItem = await game.wfrp4e.utility.findItem(trapping)
if (trappingItem)
@@ -77,13 +77,13 @@ for (let trapping of trappings)
items.push(trappingItem);
}
else
else
{
ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})
ui.notifications.warn(`Could not find ${trapping}`, {permanent : true})
}
}
updateObj.name = updateObj.name += " " + this.effect.name
updateObj.name = updateObj.name += " " + this.effet.name
await this.actor.update(updateObj)
this.actor.createEmbeddedDocuments("Item", items);

View File

@@ -0,0 +1,10 @@
if (args.equipped === true && this.actor.name !== "Kurgorn Three-eyes")
{
this.actor.addCondition("blinded", 1, {"statuses" : ["blinded", "blind"]})
this.script.notification(`Aveuglé en portant ${this.item.name}`);
}
if (args.equipped === false && this.actor.name !== "Kurgorn Three-eyes")
{
this.actor.removeCondition("blinded")
}

View File

@@ -1,2 +1,2 @@
await this.actor.addCondition("ablaze", 2)
await this.script.scriptMessage(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg: true}))
await this.script.message(await this.actor.applyBasicDamage(this.effect.sourceTest.result.damage, {suppressMsg: true}))

View File

@@ -1 +0,0 @@
return args.skill?.name.includes(game.i18n.localize("NAME.Channelling")) || args.skill?.name == `${game.i18n.localize("NAME.Language")} (${game.i18n.localize("SPEC.Magick")})`

View File

@@ -1 +1 @@
args.options.cardsharp = true;
args.context.cardsharp = true;

View File

@@ -0,0 +1 @@
this.actor.addEffectItems("Compendium.wfrp4e-core.items.Item.eowbsW6oHGSNJmxV", this.effect)

View File

@@ -0,0 +1,8 @@
let effects = this.item.effects.contents.filter(i => i.id != this.effect.id);
let choice = await ItemDialog.create(effects, 1, {title : this.effect.name, text: "Choisissez une Rune"});
if (choice[0])
{
choice[0].performEffectApplication();
}

View File

@@ -1,7 +1,6 @@
let test = await args.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : " - " + this.effect.name, context : {failure: "Gain d'un état Assomé"}})
await test.roll();
if (test.failed)
let test = await args.actor.setupCharacteristic("wp", {skipTargets: true, appendTitle : " - " + this.effet.name, context : {failure: "Gain de 1 état Sonné"}})
await Test.roll();
if (Test.Échoué)
{
args.actor.addCondition("stunned")
}

View File

@@ -1 +1 @@
this.script.scriptNotification(`Ne peut saisir ${this.effect.name}!`);
this.script.notification(`Impossible d'entrer dans ${this.effect.name} !`);

View File

@@ -1,3 +1,3 @@
let healed = parseInt(this.effect.sourceTest.result.SL)
this.actor.modifyWounds(healed)
this.script.scriptMessage(`Soins de ${healed} Blessures`)
this.script.message(`Soin de ${healed} Blessures`)

View File

@@ -11,10 +11,10 @@ let APused = Math.max(0, APatLoc.value - metalAP); // remove metal AP at locatio
damage -= (APused + this.actor.system.characteristics.t.bonus)
let msg = await this.actor.applyBasicDamage(damage, {suppressMsg : true, damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL});
msg += ` (ignore ${metalAP} PA de métal sur ${game.wfrp4e.config.locations[loc]})`
this.script.scriptMessage(msg)
msg += ` (Ignore ${metalAP} PA de métal sur ${game.wfrp4e.config.locations[loc]})`
this.script.message(msg)
let test = await this.actor.setupSkill("Résistance", {fields : {difficulty : "difficult"}, appendTitle : ` - ${this.effect.name}`});
let Test = await this.actor.setupSkill("Résistance", {fields : {difficulty : "difficult"}, appendTitle : ` - ${this.effect.name}`});
await test.roll();
if (test.failed)
this.actor.addCondition("stunned");

View File

@@ -1,19 +0,0 @@
let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : " - " + this.effect.name})
await test.roll();
if (!test.succeeded)
{
let item = await fromUuid("Compendium.wfrp4e-core.items.ZhMADOqoo0y8Q9bx")
let data = item.toObject();
if (this.item.system.location.key == "rLeg")
{
data.system.location.value = "Pied droit"
data.system.location.key = "rToe";
}
else if (this.item.system.location.key == "lLeg")
{
data.system.location.value = "Pied gauche"
data.system.location.key = "lToe";
}
this.actor.createEmbeddedDocuments("Item", [data])
}
this.effect.delete();

View File

@@ -1 +1 @@
args.options.ballockKnife = true;
args.context.ballockKnife = true;

View File

@@ -1,7 +0,0 @@
this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`}).then(async test => {
await test.roll();
if (test.failed)
{
this.actor.addCondition("stunned", 3)
}
})

View File

@@ -1 +0,0 @@
return !args.skill?.name?.includes(game.i18n.localize("NAME.Sail"))

View File

@@ -1,4 +1,4 @@
let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.locations), 1, "Choisir une localisation");
let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.locations), 1, "Choisir la localisation");
let location = choice[0].id;

View File

@@ -1 +1 @@
return args.options.reload
return args.context.reload

View File

@@ -0,0 +1,8 @@
if ( args.totalWoundLoss > 0 ) {
let test = await this.actor.setupSkill(game.i18n.localize("NAME.Résistance"), {difficulty: "average"})
await test.roll();
if (!test.succeeded)
{
this.actor.addSystemEffect("gangrene");
}
}

View File

@@ -0,0 +1,4 @@
let fear = await fromUuid("Compendium.wfrp4e-core.items.Item.pTorrE0l3VybAbtn")
fear = fear.toObject();
fear.system.specification.value = 1;
await this.actor.createEmbeddedDocuments("Item", [fear], {fromEffect : this.effect.id})

View File

@@ -1 +0,0 @@
return args.type != "channelling" && !args.skill?.name.includes(game.i18n.localize("NAME.Channelling"))

View File

@@ -1,5 +0,0 @@
if (args.item.range && args.item.range.bands)
{
args.item.range.bands[game.i18n.localize("Long Range")].modifier = 0
args.item.range.bands[game.i18n.localize("Extreme")].modifier /= 2
}

View File

@@ -1,4 +1,4 @@
let item = await fromUuid("Compendium.wfrp4e-core.items.eWPN3CV2Eddwz8aM")
let data = item.toObject();
data.system.location.value = "Dos"
data.system.location.value = "Back"
this.actor.createEmbeddedDocuments("Item", [data], {fromEffect: this.effect.id})

View File

@@ -1 +1 @@
game.wfrp4e.utility.postCorruptionTest(this.item.system.specification.value, {speaker : {alias: this.actor.prototypeToken.name}})
CorruptionMessageModel.createCorruptionMessage(this.item.system.specification.value, {speaker : {alias: this.actor.prototypeToken.name}})

View File

@@ -1 +0,0 @@
return args.skill?.name == game.i18n.localize("NAME.Bribery") || args.skill?.name.includes(game.i18n.localize("NAME.Stealth"));

View File

@@ -0,0 +1,6 @@
let broken = this.actor.hasCondition("broken");
if (broken) {
broken.delete();
this.script.notification("Etat Brisé supprimé.");
}

View File

@@ -1,6 +1,6 @@
let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"))
let test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {difficulty: "hard"})
await test.roll();
if (!test.succeeded)
{
args.actor.addCondition("stunned")
await this.actor.addCondition("unconscious");
}

View File

@@ -0,0 +1,3 @@
return !this.item.equipped.value
|| !args?.weapon
|| !(["goblin"].includes(args.target.Species.toLowerCase()))

View File

@@ -1 +0,0 @@
return args.item?.name != game.i18n.localize("NAME.Navigation")

View File

@@ -3,7 +3,7 @@ if (isNaN(parseInt(this.item.system.specification.value)))
let value = this.item.specifier;
if (!value)
{
value = await ValueDialog.create({text : "Enter Armour value", title : this.effect.name});
value = await ValueDialog.create({text : "Entrez la valeur d'Armure", title : this.effect.name});
}
if (value)
{

View File

@@ -1,7 +1,7 @@
if (!["rLeg", "lLeg"].includes(this.effect.getFlag("wfrp4e", "location")))
return true;
if (args.options.dodge)
if (args.context.dodge)
{
args.abort = true;
this.script.scriptNotification("Impossible d'Esquiver!")

View File

@@ -0,0 +1 @@
this.actor.system.status.corruption.value += 1

View File

@@ -1,9 +0,0 @@
if (args.totalWoundLoss > 0)
{
let test = await args.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {skipTargets: true, appendTitle : ` - ${this.effect.name}`})
await test.roll();
if (test.failed && parseInt(args.opposedTest.attackerTest.result.SL) > 0)
{
args.actor.addCondition("stunned", parseInt(args.opposedTest.attackerTest.result.SL))
}
}

View File

@@ -1,19 +0,0 @@
let skill = `${game.i18n.localize("NAME.Trade")} (${this.item.parenthesesText})`
let currentCareer = this.actor.system.currentCareer;
let existingSkill = this.actor.itemTypes.skill.find(i => i.name == skill);
if (!currentCareer) return
let inCurrentCareer = currentCareer.system.skills.concat(currentCareer.system.addedSkills).includes(skill);
let craftsmanAdded = this.actor.getFlag("wfrp4e", "craftsmanAdded") || {};
if (existingSkill && inCurrentCareer && !craftsmanAdded[existingSkill.name])
{
existingSkill.system.advances.costModifier = -5;
}
else
{
craftsmanAdded[skill] = true;
currentCareer.system.addedSkills.push(skill);
foundry.utils.setProperty(this.actor, "flags.wfrp4e.craftsmanAdded", craftsmanAdded)
}

View File

@@ -1,4 +0,0 @@
let item = await fromUuid("Compendium.wfrp4e-core.items.9h82z72XGo9tfgQS")
let data = item.toObject();
data.name = data.name += " (Ouïe)"
this.actor.createEmbeddedDocuments("Item", [data], {fromEffect : this.effect.id})

View File

@@ -0,0 +1 @@
this.actor.system.status.corruption.value += 2

View File

@@ -0,0 +1,9 @@
const {targetUuid} = this.effect.flags.wfrp4e;
if (args.attacker.uuid !== targetUuid) return;
let recordedWounds = this.effect.getFlag("wfrp4e", "damageToReturn") ?? 0;
recordedWounds += args.totalWoundLoss;
this.effect.setFlag("wfrp4e", "damageToReturn", recordedWounds);

View File

@@ -0,0 +1 @@
return !args.skill?.name.includes("Focalisation");

View File

@@ -6,5 +6,5 @@ if (this.item.system.quantity.value)
}
else
{
this.script.scriptNotification("Vide !", "error")
this.script.notification("Plus rien !", "error")
}

View File

@@ -1 +0,0 @@
return args.skill?.name.includes(game.i18n.localize("NAME.Lore"));

View File

@@ -0,0 +1 @@
CorruptionMessageModel.createCorruptionMessage("major", this.script.getChatData());

View File

@@ -1,6 +1,6 @@
if (args.opposedTest.result.winner == "attacker") {
if (args.opposedTest.defenderTest.weapon && args.opposedTest.defenderTest.item.properties.qualities.shield) {
ui.notifications.notify(`<b>${this.effect.name}</b>: Gain de ${this.item.Advances} Avantages`)
ui.notifications.notify(`<b>${this.effect.name}</b>: Gain de ${this.item.Advances} Avantage(s)`)
this.actor.setAdvantage(this.item.Advances)
}
}

View File

@@ -1,20 +0,0 @@
if (!["Goblin", "Orc"].includes(this.actor.system.details.species.value)) {
let test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), { appendTitle: ` - ${this.effect.name}` })
await test.roll();
if (test.failed) {
let infection = await fromUuid("Compendium.wfrp4e-core.items.Item.1hQuVFZt9QnnbWzg")
this.actor.createEmbeddedDocuments("Item", [infection])
}
}
// Since wounds change when the effect is deleted, need to wait until after
// the max wounds have been recalculated to apply damage
game.wfrp4e.utility.sleep(1000).then(async () => {
let roll = await new Roll("1d10").roll();
roll.toMessage(this.script.getChatData());
this.script.scriptMessage(await this.actor.applyBasicDamage(roll.total, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true }))
})

View File

@@ -0,0 +1 @@
return args.skill?.name == "Voile (Aéronavale)"

View File

@@ -1,18 +0,0 @@
let currentCareer = this.actor.system.currentCareer;
if (!currentCareer)
{
return;
}
let talents = ["Harmonisation Aethyrique",
"Magie des Arcanes (Domaine)",
"Magie du Chaos (Tzeentch)",
"Mains agiles",
"Diction Instinctive",
"Sens de la Magie",
"Magie Mineure",
"Seconde Vue",
"Mage de guerre",
"Sorcier!"].filter(t => !currentCareer.system.talents.includes(t))
currentCareer.system.talents = currentCareer.system.talents.concat(talents)

View File

@@ -0,0 +1,2 @@
const duration = 3600 * (1 + Number(this.effect.sourceTest.result.SL));
this.effect.update({"duration.seconds": duration});

View File

@@ -1,2 +1,2 @@
args.data.canReverse = true;
args.options.fieldDressing = true;
args.data.reversal = {allowed : true, if: "success"};
args.context.fieldDressing = true;

View File

@@ -1,6 +1,6 @@
let wounds = this.actor.system.status.wounds
if (wounds.value == 0)
return this.script.scriptNotification("Aucun effet à 0 Blessures", "error")
return this.script.notification("Aucun effet à 0 Blessures", "error")
this.script.scriptNotification(`Soin de ${this.actor.characteristics.t.bonus} Blessures`)
this.script.notification(`Soin de ${this.actor.characteristics.t.bonus} Blessures`)
await this.actor.modifyWounds(this.actor.characteristics.t.bonus)

View File

@@ -1 +1 @@
return !args.options.handling
return !args.context.handling

View File

@@ -1 +1 @@
this.script.scriptMessage(await this.actor.applyBasicDamage(8, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))
this.script.message(await this.actor.applyBasicDamage(8, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg: true}))

View File

@@ -0,0 +1 @@
await this.actor.addEffectItems("Compendium.wfrp4e-core.items.Item.5hH73j2NgPdsLCZN", this.effect, {name: "Haine (Tous les ennemis)"});

View File

@@ -5,5 +5,5 @@ let SL = Math.floor(args.test.target / 10) - Math.floor(args.test.result.roll /
let ones = Number(args.test.result.roll.toString().split("").pop())
if (ones > SL)
args.test.result.other.push(`<span class="hide-option"><b>${this.effect.name}</b>: ${ones + args.test.successBonus + args.test.slBonus} DR</span>`)
args.Test.result.other.push(`<span class="hide-option"><b>${this.effect.name}</b>: ${ones + args.test.successBonus + args.test.slBonus} DR</span>`)
}

View File

@@ -1,7 +1,7 @@
let fatigue = this.actor.hasCondition("fatigued")
if (fatigue)
{
this.script.scriptNotification("Suppression de l'état Fatigué, effet désactivé.")
this.script.notification("Etat Extenué - Suppression de la condition Extenué, effet désactivé")
this.effect.update({disabled : true})
await this.actor.removeCondition("fatigued")
}

View File

@@ -1,44 +0,0 @@
let choice = await ItemDialog.create(ItemDialog.objectToArray(game.wfrp4e.config.locations, this.effect.img), 1, "Choisissez Location");
if (choice[0])
{
this.effect.updateSource({name : `${this.effect.name} (${choice[0].name})`})
this.effect.updateSource({"flags.wfrp4e.location" : choice[0].id})
}
let location = choice[0].id;
if (["lArm", "rArm"].includes(location))
{
let dropped = this.actor.itemTypes.weapon.filter(i => i.isEquipped & i.system.usesHands.includes(location));
if (dropped.length)
{
this.script.scriptNotification(`Lache ${dropped.map(i => i.name).join(", ")}!`)
for(let weapon of dropped)
{
await weapon.system.toggleEquip();
}
}
}
if (location == "body")
{
await this.actor.addCondition("fatigued");
test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "hard"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})
await test.roll();
if (test.failed)
{
this.actor.addCondition("prone");
}
}
if (location == "head")
{
await this.actor.addCondition("stunned");
test = await this.actor.setupSkill(game.i18n.localize("NAME.Endurance"), {fields : {difficulty : "average"}, skipTargets: true, appendTitle : ` - ${this.effect.name}`})
await test.roll();
if (test.failed)
{
this.actor.addCondition("unconscious");
}
}

View File

@@ -0,0 +1,5 @@
if (["dragon"].includes(args.opposedTest.defender.details.species.value.toLowerCase()))
{
args.applyTB = false;
args.opposedTest.result.other.push("<b>Wyrmslayer</b>: Ignore le BE contre les Dragons")
}

View File

@@ -0,0 +1 @@
args.context.doombolt = true;

View File

@@ -1 +1 @@
return args.options.mutate
return args.context.mutate

View File

@@ -1 +0,0 @@
return args.skill?.name != game.i18n.localize("NAME.CharmAnimal") && !args.skill?.name.includes(game.i18n.localize("NAME.AnimalTraining"));

View File

@@ -0,0 +1,12 @@
const test = await this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {
difficulty: "challenging",
context: {
failure: "Subi l'état @Condition[Fatigued] à cause de cauchemars.",
success: "A souffert de cauchemars, mais a assez bien dormi."
}
});
await test.roll();
if (test.failed) {
await this.actor.addCondition("fatigued");
}

View File

@@ -0,0 +1,21 @@
let weaponData = await this.effect.setFlag("wfrp4e", "weaponData", this.item.system.toObject());
try {
await this.item.update({
system: {
"weaponGroup.value": "throwing",
"qualities.value": this.item.system.qualities.value.concat([{ name: "accurate" }]),
"range.value": "SB * 3",
"consumesAmmo.value" : false
}
})
let test = await this.actor.setupWeapon(this.item, {}, {resolveClose : true});
await test?.roll();
this.item.update({ system: this.effect.getFlag("wfrp4e", "weaponData") })
}
catch (e) {
this.item.update({ system: this.effect.getFlag("wfrp4e", "weaponData") })
}

View File

@@ -1 +1 @@
args.options.useOnesAttractive = true;
args.context.useOnesAttractive = true;

View File

@@ -1,2 +1,2 @@
this.script.scriptMessage(await this.actor.applyBasicDamage(Math.ceil(CONFIG.Dice.randomUniform() * 10) + 6, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))
this.script.message(await this.actor.applyBasicDamage(Math.ceil(CONFIG.Dice.randomUniform() * 10) + 6, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true}))
this.actor.addCondition("ablaze");

View File

@@ -0,0 +1,3 @@
const blinded = this.actor.hasCondition("blinded");
if (!blinded)
this.actor.addCondition("blinded");

View File

@@ -1 +0,0 @@
return !["NAME.Evaluate", "NAME.Gamble"].map(i => game.i18n.localize(i)).includes(args.skill?.name)

View File

@@ -1,4 +0,0 @@
if (this.actor.hasCondition("surprised"))
{
this.actor.setupSkill(game.i18n.localize("NAME.Cool"), {fields : {difficulty : "average"}, skipTargets: true, appendTitle : " - " + this.effect.name}).then(test => test.roll())
}

View File

@@ -0,0 +1,3 @@
if ( !this.actor.hasCondition("poisoned") ) {
this.effect.delete();
}

View File

@@ -1 +0,0 @@
return args.skill?.name == game.i18n.localize("NAME.ConsumeAlcohol");

View File

@@ -0,0 +1,14 @@
const venomUUID = "Compendium.wfrp4e-core.items.gFkRm9wS65qe18Xv";
const venom = this.actor.itemTags.trait.find(t => t.name === "Venin");
if (venom) {
await this.effect.setFlag("wfrp4e-tribes", "venom", {
_id: venom.id,
"system.specification.value": venom.system.specification.value
});
await venom.update({"system.specification.value": "Difficult"});
} else {
await this.actor.addEffectItems(venomUUID, this.effect, {
"system.specification.value": "Challenging"
});
}

View File

@@ -1 +0,0 @@
return args.skill?.name != game.i18n.localize("NAME.Research") && !args.skill?.name?.includes(game.i18n.localize("NAME.Language"));

View File

@@ -0,0 +1,4 @@
if (this.item.equipped.value && args.totalWoundLoss > 10) {
args.totalWoundLoss = Math.min(10, args.totalWoundLoss)
args.extraMessages.push(`<strong>${this.effect.name}</strong>: Perte de Blessures limitée à 10`)
}

View File

@@ -10,10 +10,10 @@ let characteristics = {
"wp" : 25,
"fel" : 10
}
let skills = ["Calme", "Esquive", "Intimidate", "Intuition", "Commandement" , "Lore (Warfare)", "Perception"]
let skills = ["Calme", "Esquive", "Intimidation", "Intuition", "Commandement", "Savoir (Guerre)", "Perception"]
let skillAdvancements = [15, 15, 15, 15, 15, 10, 10]
let talents = ["Combat Aware", "Combat Reflexes", "Feint", "Inspiring", "Resolute", "War Leader"]
let trappings = ["Arme simple", "Shield"]
let talents = ["Vigilance", "Combat Instinctif", "Feinte", "Inspiring", "Déterminé", "Seigneur de guerre"]
let trappings = ["Arme simple", "Bouclier"]
let items = [];
let updateObj = this.actor.toObject();
@@ -30,7 +30,7 @@ for (let index = 0; index < skills.length; index++)
skillItem = updateObj.items.find(i => i.name == skill && i.type == "skill")
if (skillItem)
skillItem.system.advances.value += skillAdvancements[index]
else
else
{
skillItem = await game.wfrp4e.utility.findSkill(skill)
skillItem = skillItem.toObject();
@@ -46,13 +46,13 @@ for (let talent of talents)
{
items.push(talentItem.toObject());
}
else
else
{
ui.notifications.warn(`Impossible de trouver ${talent}`, {permanent : true})
}
}
for (let trapping of trappings)
for (let trapping of trappings)
{
let trappingItem = await game.wfrp4e.utility.findItem(trapping)
if (trappingItem)
@@ -63,13 +63,13 @@ for (let trapping of trappings)
items.push(trappingItem);
}
else
else
{
ui.notifications.warn(`Impossible de trouver ${trapping}`, {permanent : true})
}
}
updateObj.name = updateObj.name += " " + this.effect.name
updateObj.name = updateObj.name += " " + this.effet.name
await this.actor.update(updateObj)
this.actor.createEmbeddedDocuments("Item", items);

View File

@@ -1,6 +1,6 @@
const target = args.actor;
if (target.has("Ethereal") || target.has("Corruption")) {
if (target.has("Éthéré") || target.has("Corruption")) {
args.totalWoundLoss += 6;
args.modifiers.other.push({label: this.effect.name, value: 6})
}

Some files were not shown because too many files have changed in this diff Show More