Change for supporting wfrp 9/ Foundry 13

This commit is contained in:
2025-05-17 16:47:21 +02:00
parent 79ba6a9666
commit 63abcf745d
45 changed files with 1248 additions and 1077 deletions

View File

@@ -17,7 +17,6 @@ export class WH4FRPatchConfig {
special = " (" + game.i18n.localize( res[2].trim() ) + ")"; // And the special keyword
}
let compNameFR = game.babele.translate( compendiumName, { name: compName }, true );
//console.log(">>>>> Skill ?", compName, special, compNameFR);
if (compNameFR.name != compName) { // Translation OK
newName = compNameFR.name + special;
}
@@ -48,7 +47,6 @@ export class WH4FRPatchConfig {
special = " (" + game.i18n.localize( res[2].trim() ) + ")"; // And the special keyword
}
let talentNameFR = game.babele.translate( compendiumName, { name: talentName }, true );
//console.log(">>>>> Talent ?", talentName, special, talentNameFR);
if (talentNameFR.name != talentName) { // Translation OK
newName2 = talentNameFR.name + special;
}
@@ -67,7 +65,6 @@ export class WH4FRPatchConfig {
let subspeciesList = game.wfrp4e.config.subspecies[speciesName];
for ( let subspeciesName in subspeciesList) {
let subspecies = subspeciesList[subspeciesName];
//console.log("Subpecies translate....", subspecies);
if ( subspecies.skills) {
subspecies.skills = this.translateSkillList(subspecies.skills);
}
@@ -77,7 +74,7 @@ export class WH4FRPatchConfig {
}
}
}
/************************************************************************************/
static patch_species_skills( ) {
console.log("Patching species skills....");
@@ -92,7 +89,7 @@ export class WH4FRPatchConfig {
static patch_species_talents( ) {
for (let speciesName in game.wfrp4e.config.speciesTalents) {
let speciesTalents = game.wfrp4e.config.speciesTalents[speciesName];
game.wfrp4e.config.speciesTalents[speciesName] = this.translateTalentList( speciesTalents);
game.wfrp4e.config.speciesTalents[speciesName] = this.translateTalentList( speciesTalents);
}
}
@@ -100,7 +97,7 @@ export class WH4FRPatchConfig {
static patch_career() {
let compendiumName = 'wfrp4e-core.items'
if ( game.wfrp4e.tables.career) {
if ( game.wfrp4e.tables.career) {
for( let row of game.wfrp4e.tables.career.rows) {
for ( let key in row) {
if (key != "range") {
@@ -108,7 +105,6 @@ export class WH4FRPatchConfig {
row[key].name = "Tueur Nains";
} else if ( row[key].name == 'Duelist' ) {
row[key].name = "Duelliste";
//console.log(">>>>> Career ?", key, row[key].name, career_fr.name );
} else {
let career_fr = game.babele.translate( compendiumName, {name: row[key].name}, true );
row[key].name = career_fr.name;
@@ -121,15 +117,15 @@ export class WH4FRPatchConfig {
/************************************************************************************/
static perform_patch() {
if (game.user.isGM) {
let coreC7 = game.modules.find(mod => mod.id == "wfrp4e-core")
if (!coreC7 || !coreC7.active) {
if (!coreC7?.active) {
ui.notifications.warn("Vous n'avez pas activé le module CoreC7 ! La traduction sera donc incomplète et inopérante.")
return
}
}
// Detect and patch as necessary
if (game.wfrp4e.config?.talentBonuses ) {
game.wfrp4e.config.qualityDescriptions["distract"] = game.i18n.localize("WFRP4E.Properties.Distract"); // Patch missing quality
@@ -146,7 +142,7 @@ export class WH4FRPatchConfig {
"doigts de fée": "dex",
"guerrier né": "ws"
}
if (game.wfrp4e.config.loreEffects) {
game.wfrp4e.config.loreEffects["beasts"].label = "Domaine des Bêtes"
game.wfrp4e.config.loreEffects["death"].label = "Domaine de la Mort"
@@ -168,8 +164,8 @@ export class WH4FRPatchConfig {
game.wfrp4e.config.species["welf"] = "Elfe Sylvain";
}
if (game.wfrp4e.config.charastericticsBonus) {
game.wfrp4e.config.charastericticsBonus =
if (game.wfrp4e.config.characteristicsBonus) {
game.wfrp4e.config.characteristicsBonus =
{
"ws": "Bonus de Capacité de Combat",
"bs": "Bonus de Capacité de Tir",
@@ -195,804 +191,6 @@ export class WH4FRPatchConfig {
this.patch_subspecies();
this.patch_career();
/*game.wfrp4e.config.conditionScripts = {
"ablaze" : async function (actor) {
let effect = actor.hasCondition("ablaze")
let value = effect.conditionValue;
let leastProtectedLoc;
let leastProtectedValue = 999;
for (let loc in actor.status.armour)
{
if (actor.status.armour[loc].value != undefined && actor.status.armour[loc].value < leastProtectedValue)
{
leastProtectedLoc = loc;
leastProtectedValue = actor.status.armour[loc].value;
}
}
let rollString = `1d10 + ${value - 1}`
let roll = await new Roll(`${rollString} - ${leastProtectedValue || 0}`).roll();
let msg = `<h2>${game.i18n.localize("WFRP4E.ConditionName.Ablaze")}</h2><b>${game.i18n.localize("Formula")}</b>: ${rollString}<br><b>${game.i18n.localize("Roll")}</b>: ${roll.terms.map(i => i.total).splice(0, 3).join(" ")}` // Don't show AP in the roll formula
actor.runEffects("preApplyCondition", {effect, data : {msg, roll, rollString}})
value = effect.conditionValue;
let damageMsg = (`<br>` + await actor.applyBasicDamage(roll.total, {damageType : game.wfrp4e.config.DAMAGE_TYPE.IGNORE_AP, suppressMsg : true})).split("")
damageMsg.splice(damageMsg.length-1, 1) // Removes the parentheses and adds + AP amount.
msg += damageMsg.join("").concat(` + ${leastProtectedValue} ${game.i18n.localize("AP")})`)
let messageData = game.wfrp4e.utility.chatDataSetup(msg);
messageData.speaker = {alias: actor.data.token.name}
actor.runEffects("applyCondition", {effect, data : {messageData}})
return messageData
},
"poisoned": async function (actor) {
let effect = actor.hasCondition("poisoned")
let msg = `<h2>Empoisonné</h2>`
actor.runEffects("preApplyCondition", { effect, data: { msg } })
let value = effect.conditionValue;
msg += await actor.applyBasicDamage(value, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, suppressMsg: true })
let messageData = game.wfrp4e.utility.chatDataSetup(msg);
messageData.speaker = { alias: actor.data.token.name }
actor.runEffects("applyCondition", { effect, data: { messageData } })
return messageData
},
"bleeding": async function (actor) {
let effect = actor.hasCondition("bleeding")
let bleedingAmt;
let bleedingRoll;
let msg = `<h2>Hémorragie</h2>`
actor.runEffects("preApplyCondition", { effect, data: { msg } })
let value = effect.conditionValue;
msg += await actor.applyBasicDamage(value, { damageType: game.wfrp4e.config.DAMAGE_TYPE.IGNORE_ALL, minimumOne: false, suppressMsg: true })
if (actor.status.wounds.value == 0 && !actor.hasCondition("unconscious")) {
await actor.addCondition("unconscious")
msg += `<br><b>${actor.data.token.name}</b> tombe inconscient!`
}
if (actor.hasCondition("unconscious")) {
bleedingAmt = value;
bleedingRoll = new Roll("1d100").roll().total;
if (bleedingRoll <= bleedingAmt * 10) {
msg += `<br><b>${actor.data.token.name}</b> meurt de la perte de sang! (Lancé ${bleedingRoll})`
actor.addCondition("dead")
}
else if (bleedingRoll % 11 == 0) {
msg += `<br><b>${actor.data.token.name}'s</b> cicatrise un peu et élimine 1 Etat Hémorragique (Lancé ${bleedingRoll})`
actor.removeCondition("bleeding")
}
else {
msg += `<br>Bleeding Roll: ${bleedingRoll}`
}
}
let messageData = game.wfrp4e.utility.chatDataSetup(msg);
messageData.speaker = { alias: actor.data.token.name }
actor.runEffects("applyCondition", { effect, data: { messageData, bleedingRoll } })
return messageData
}
}*/
/*game.wfrp4e.config.statusEffects = [
{
icon: "systems/wfrp4e/icons/conditions/bleeding.png",
id: "bleeding",
label: "Hémorragique",
flags: {
wfrp4e: {
"trigger": "endRound",
"value": 1
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/poisoned.png",
id: "poisoned",
label: "Empoisonné",
flags: {
wfrp4e: {
"trigger": "endRound",
"effectTrigger": "prefillDialog",
"script": "args.prefillModifiers.modifier -= 10 * this.effect.conditionValue",
"value": 1
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/ablaze.png",
id: "ablaze",
label: "En Flammes",
flags: {
wfrp4e: {
"trigger": "endRound",
"value": 1
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/deafened.png",
id: "deafened",
label: "Assourdi",
flags: {
wfrp4e: {
"trigger": "endRound",
"effectTrigger": "dialogChoice",
"effectData": {
"description": "Tests related to hearing",
"modifier": "-10 * this.flags.wfrp4e.value"
},
"value": 1
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/stunned.png",
id: "stunned",
label: "Assommé",
flags: {
wfrp4e: {
"trigger": "endRound",
"effectTrigger": "prefillDialog",
"script": "args.prefillModifiers.modifier -= 10 * this.effect.conditionValue",
"value": 1
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/entangled.png",
id: "entangled",
label: "Empêtré",
flags: {
wfrp4e: {
"trigger": "endRound",
"effectTrigger": "dialogChoice",
"effectData": {
"description": "Tout les tests relatifs au mouvement",
"modifier": "-10 * this.flags.wfrp4e.value"
},
"value": 1
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/fatigued.png",
id: "fatigued",
label: "Extenué",
flags: {
wfrp4e: {
"effectTrigger": "prefillDialog",
"script": "args.prefillModifiers.modifier -= 10 * this.effect.conditionValue",
"value" : 1
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/blinded.png",
id: "blinded",
label: "Aveuglé",
flags: {
wfrp4e: {
"trigger": "endRound",
"effectTrigger": "dialogChoice",
"effectData" : {
"description" : "Tests related to sight",
"modifier" : "-10 * this.flags.wfrp4e.value"
},
"value": 1,
"secondaryEffect" :{
"effectTrigger": "targetPrefillDialog",
"script": "if (args.item && args.item.attackType=='melee') args.prefillModifiers.modifier += 10 * this.effect.conditionValue",
}
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/broken.png",
id: "broken",
label: "Brisé",
flags: {
wfrp4e: {
"effectTrigger": "prefillDialog",
"script": "args.prefillModifiers.modifier -= 10 * this.effect.conditionValue",
"value": 1
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/prone.png",
id: "prone",
label: "A terre",
flags: {
wfrp4e: {
"effectTrigger": "dialogChoice",
"effectData" : {
"description" : "Tests related to movement of any kind",
"modifier" : "-20"
},
"value": null,
"secondaryEffect" :{
"effectTrigger": "targetPrefillDialog",
"script": "if (args.type == 'weapon' && args.item.attackType=='melee') args.prefillModifiers.modifier += 20",
}
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/fear.png",
id: "fear",
label: "Peur",
flags: {
wfrp4e: {
"effectTrigger": "dialogChoice",
"effectData" : {
"description" : "Tests to affect",
"slBonus" : "-1"
},
"script" : `
if (this.flags.wfrp4e.fearName)
this.flags.wfrp4e.effectData.description += " " + this.flags.wfrp4e.fearName
else
this.flags.wfrp4e.effectData.description += " the source of fear"
`,
"value": null
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/surprised.png",
id: "surprised",
label: "Surpris",
flags: {
wfrp4e: {
"value": null,
"secondaryEffect" :{
"effectTrigger": "targetPrefillDialog",
"script": "if (args.type == 'weapon' && args.item.attackType=='melee') args.prefillModifiers.modifier += 20",
}
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/unconscious.png",
id: "unconscious",
label: "Inconscient",
flags: {
wfrp4e: {
"value": null
}
}
},
{
icon: "systems/wfrp4e/icons/conditions/grappling.png",
id: "grappling",
label: "Empoigné",
flags: {
wfrp4e: {
"value": null
}
}
},
{
icon: "systems/wfrp4e/icons/defeated.png",
id: "dead",
label: "Mort",
flags: {
wfrp4e: {
"value": null
}
}
}
]*/
/*game.wfrp4e.config.systemEffects = {
"enc1": {
label: "Encombrement 1",
icon: "systems/wfrp4e/icons/effects/enc1.png",
flags: {
wfrp4e: {
"effectTrigger": "prePrepareData",
"effectApplication": "actor",
"script": `
args.actor.characteristics.ag.modifier -= 10;
args.actor.details.move.value -= 1;
if (args.actor.details.move.value < 3)
args.actor.details.move.value = 3`
}
}
},
"enc2": {
label: "Encombrement 2",
icon: "systems/wfrp4e/icons/effects/enc2.png",
flags: {
wfrp4e: {
"effectTrigger": "prePrepareData",
"effectApplication": "actor",
"script": `
args.actor.characteristics.ag.modifier -= 20;
args.actor.details.move.value -= 2;
if (args.actor.details.move.value < 2)
args.actor.details.move.value = 2`
}
}
},
"enc3": {
label: "Encombrement 3",
icon: "systems/wfrp4e/icons/effects/enc3.png",
flags: {
wfrp4e: {
"effectTrigger": "prePrepareData",
"effectApplication": "actor",
"script": `
args.actor.details.move.value = 0;`
}
}
},
"cold1": {
label: "Exposition au Froid 1",
icon: "",
changes: [
{ key: "data.characteristics.bs.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.ag.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.dex.modifier", mode: 2, value: -10 },
],
flags: {
wfrp4e: {
"effectTrigger": "",
"effectApplication": "actor",
"script": ``
}
}
},
"cold2": {
label: "Exposition au Froid 2",
icon: "",
changes: [
{ key: "data.characteristics.bs.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.ag.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.ws.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.s.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.t.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.i.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.dex.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.int.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.wp.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.fel.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.t.calculationBonusModifier", mode: 2, value: 1 },
{ key: "data.characteristics.s.calculationBonusModifier", mode: 2, value: 1 },
{ key: "data.characteristics.wp.calculationBonusModifier", mode: 2, value: 1 },
],
flags: {
wfrp4e: {
"effectTrigger": "",
"effectApplication": "actor",
"script": ``
}
}
},
"cold3": {
label: "Exposition au Froid 3",
icon: "",
flags: {
wfrp4e: {
"effectTrigger": "oneTime",
"effectApplication": "actor",
"script": `
let tb = this.actor.characteristics.t.bonus
let damage = new Roll("1d10").roll().total
damage -= tb
if (damage <= 0) damage = 1
if (this.actor.status.wounds.value <= damage)
{
this.actor.addCondition("unconscious")
}
this.actor.modifyWounds(-damage)
ui.notifications.notify("Encaisse " + damage + " dégats")
`
}
}
},
"heat1": {
label: "Exposition à la chaleur 1",
icon: "",
changes: [
{ key: "data.characteristics.int.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.wp.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.wp.calculationBonusModifier", mode: 2, value: 1 },
],
flags: {
wfrp4e: {
"effectTrigger": "",
"effectApplication": "actor",
"script": ``
}
}
},
"heat2": {
label: "Exposition à la chaleur 2",
icon: "",
changes: [
{ key: "data.characteristics.bs.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.ag.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.ws.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.s.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.t.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.i.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.dex.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.int.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.wp.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.fel.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.t.calculationBonusModifier", mode: 2, value: 1 },
{ key: "data.characteristics.s.calculationBonusModifier", mode: 2, value: 1 },
{ key: "data.characteristics.wp.calculationBonusModifier", mode: 2, value: 1 },
],
flags: {
wfrp4e: {
"effectTrigger": "",
"effectApplication": "actor",
"script": ``
}
}
},
"heat3": {
label: "Exposition à la chaleur 3",
icon: "",
flags: {
wfrp4e: {
"effectTrigger": "oneTime",
"effectApplication": "actor",
"script": `
let tb = this.actor.characteristics.t.bonus
let damage = new Roll("1d10").roll().total
damage -= tb
if (damage <= 0) damage = 1
this.actor.modifyWounds(-damage)
ui.notifications.notify("Encaisse " + damage + " dégats")
`
}
}
},
"thirst1": {
label: "Assoiffé 1",
icon: "",
changes: [
{ key: "data.characteristics.int.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.wp.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.fel.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.wp.calculationBonusModifier", mode: 2, value: 1 },
],
flags: {
wfrp4e: {
"effectTrigger": "",
"effectApplication": "actor",
"script": ``
}
}
},
"thirst2": {
label: "Assoiffé 2+",
icon: "",
changes: [
{ key: "data.characteristics.bs.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.ag.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.ws.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.s.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.t.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.i.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.int.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.dex.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.wp.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.fel.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.t.calculationBonusModifier", mode: 2, value: 1 },
{ key: "data.characteristics.s.calculationBonusModifier", mode: 2, value: 1 },
{ key: "data.characteristics.wp.calculationBonusModifier", mode: 2, value: 1 },
],
flags: {
wfrp4e: {
"effectTrigger": "invoke",
"effectApplication": "actor",
"script": `
let tb = this.actor.characteristics.t.bonus
let damage = new Roll("1d10").roll().total
damage -= tb
if (damage <= 0) damage = 1
this.actor.modifyWounds(-damage)
ui.notifications.notify("Encasse " + damage + " dégats")
`
}
}
},
"starvation1": {
label: "Affamé 1",
icon: "",
changes: [
{ key: "data.characteristics.s.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.t.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.t.calculationBonusModifier", mode: 2, value: 1 },
{ key: "data.characteristics.s.calculationBonusModifier", mode: 2, value: 1 },
],
flags: {
wfrp4e: {
"effectTrigger": "",
"effectApplication": "actor",
"script": ``
}
}
},
"starvation2": {
label: "Affamé 2",
icon: "",
changes: [
{ key: "data.characteristics.bs.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.ag.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.ws.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.s.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.t.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.i.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.int.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.dex.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.wp.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.fel.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.t.calculationBonusModifier", mode: 2, value: 1 },
{ key: "data.characteristics.s.calculationBonusModifier", mode: 2, value: 1 },
{ key: "data.characteristics.wp.calculationBonusModifier", mode: 2, value: 1 },
],
flags: {
wfrp4e: {
"effectTrigger": "invoke",
"effectApplication": "actor",
"script": `
let tb = this.actor.characteristics.t.bonus
let damage = new Roll("1d10").roll().total
damage -= tb
if (damage <= 0) damage = 1
this.actor.modifyWounds(-damage)
ui.notifications.notify("Encaisse " + damage + " dégats")
`
}
}
},
"infighting": {
label: "Combat au contact",
icon: "modules/wfrp4e-core/icons/talents/in-fighter.png",
flags: {
wfrp4e: {
"effectTrigger": "prePrepareItem",
"effectApplication": "actor",
"script": `
if (args.item.type == "weapon" && args.item.isEquipped)
{
let weaponLength = args.item.reachNum
if (weaponLength > 3)
{
let improv = duplicate(game.wfrp4e.config.systemItems.improv)
improv.system.twohanded.value = args.item.twohanded.value
improv.system.offhand.value = args.item.offhand.value
args.item.update({"system" : improv.system, name : args.item.name + " (Combat au Contact")})
}
}
`
}
}
},
"defensive": {
label: "Posture Défensive [Compétence]",
icon: "",
flags: {
wfrp4e: {
"effectTrigger": "prefillDialog",
"effectApplication": "actor",
"script": `
let skillName = this.effect.label.substring(this.effect.label.indexOf("[") + 1, this.effect.label.indexOf("]"))
if (!this.actor.isOpposing)
return
if ((args.type == "skill" && args.item.name == skillName) ||
(args.type == "weapon" && args.item.skillToUse.name == skillName) ||
(args.type == "cast" && skillName == "Langue (Magick)") ||
(args.type == "prayer" && skillName == "Prière") ||
(args.type == "trait" && args.item.rollable.skill == skillName))
args.prefillModifiers.modifier += 20`
}
}
},
"dualwielder": {
label: "Maniement de 2 armes",
icon: "modules/wfrp4e-core/icons/talents/dual-wielder.png",
flags: {
wfrp4e: {
"effectTrigger": "prefillDialog",
"effectApplication": "actor",
"script": `
if (this.actor.isOpposing)
args.prefillModifiers.modifier -= 10`
}
}
},
"consumealcohol1": {
label: "Résistance à l'alcool 1",
icon: "",
changes: [
{ key: "data.characteristics.bs.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.ag.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.ws.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.int.modifier", mode: 2, value: -10 },
{ key: "data.characteristics.dex.modifier", mode: 2, value: -10 },
]
},
"consumealcohol2": {
label: "Résistance à l'alcool 2",
icon: "",
changes: [
{ key: "data.characteristics.bs.modifier", mode: 2, value: -20 },
{ key: "data.characteristics.ag.modifier", mode: 2, value: -20 },
{ key: "data.characteristics.ws.modifier", mode: 2, value: -20 },
{ key: "data.characteristics.int.modifier", mode: 2, value: -20 },
{ key: "data.characteristics.dex.modifier", mode: 2, value: -20 },
]
},
"consumealcohol3": {
label: "Résistance à l'alcool 3",
icon: "",
changes: [
{ key: "data.characteristics.bs.modifier", mode: 2, value: -30 },
{ key: "data.characteristics.ag.modifier", mode: 2, value: -30 },
{ key: "data.characteristics.ws.modifier", mode: 2, value: -30 },
{ key: "data.characteristics.int.modifier", mode: 2, value: -30 },
{ key: "data.characteristics.dex.modifier", mode: 2, value: -30 },
]
},
"stinkingdrunk1": {
label: "Courage du Marienbourgeois",
icon: "",
flags: {
wfrp4e: {
"effectTrigger": "prefillDialog",
"effectApplication": "actor",
"script": `
if (args.type=="skill" && args.item.name=="Calme")
args.prefillModifiers.modifier += 20`
}
}
}
}*/
/*game.wfrp4e.config.systemItems = {
reload: {
type: "extendedTest",
name: "",
data: {
SL: {
},
test: {
value: ""
},
completion: {
value: "remove"
}
},
flags: {
wfrp4e: {
reloading: ""
}
}
},
improv: {
name: "Arme improvisée",
type: "weapon",
effects: [],
data: {
damage: { value: "SB + 1" },
reach: { value: "personal" },
weaponGroup: { value: "basic" },
twohanded: { value: false },
qualities: { value: "" },
flaws: { value: [{ name: "undamaging" }] },
special: { value: "" },
range: { value: "" },
ammunitionGroup: { value: "" },
offhand: { value: false },
}
},
stomp: {
name: "Piétiner",
type: "trait",
effects: [],
data: {
specification: { value: "4" },
rollable: { value: true, rollCharacteristic: "ws", bonusCharacteristic: "s", defaultDifficulty: "challenging", damage: true },
}
},
unarmed: {
name: "Désarmé",
type: "weapon",
effects: [],
data: {
damage: { value: "SB + 0" },
reach: { value: "personal" },
weaponGroup: { value: "brawling" },
twohanded: { value: false },
qualities: { value: "" },
flaws: { value: [{ name: "undamaging" }] },
special: { value: "" },
range: { value: "" },
ammunitionGroup: { value: "" },
offhand: { value: false },
}
},
fear: {
name: "Peur",
type: "extendedTest",
data: {
completion: { value: 'remove' },
description: { type: 'String', label: 'Description', value: '' },
failingDecreases: { value: true },
gmdescription: { type: 'String', label: 'Description', value: '' },
hide: { test: false, progress: false },
negativePossible: { value: false },
SL: { current: 0, target: 1 },
test: { value: 'Calme' }
},
effects:
[{
label: "Peur",
icon: "systems/wfrp4e/icons/conditions/fear.png",
transfer: true,
flags: {
core: {
statusId: "fear"
},
wfrp4e: {
"effectTrigger": "dialogChoice",
"effectData": {
"description": "Tests affectés",
"slBonus": "-1"
},
"script": `
if (this.flags.wfrp4e.fearName)
this.flags.wfrp4e.effectData.description += " " + this.flags.wfrp4e.fearName
else
this.flags.wfrp4e.effectData.description += " the source of fear"
`}
}
}
]
},
terror: {
label: "Terreur",
icon: "systems/wfrp4e/icons/conditions/terror.png",
transfer: true,
flags: {
wfrp4e: {
"effectTrigger": "oneTime",
"effectApplication": "actor",
"terrorValue": 1,
"script": `
args.actor.setupSkill("Calme").then(setupData =>{
args.actor.basicTest(setupData).then(test => {
if (test.result.outcome == "failure")
{
let terror = this.effect.flags.wfrp4e.terrorValue
if (test.result.SL < 0)
terror += Math.abs(test.result.SL)
args.actor.addCondition("broken", terror)
}
args.actor.applyFear(value, name)
})
})`
}
}
}
}*/
game.wfrp4e.config.symptomEffects = {
"blight": {
@@ -1016,7 +214,7 @@ export class WH4FRPatchConfig {
if (args.actor.isOwner)
{
args.actor.setupSkill("Résistance", {absolute: {difficulty}}).then(setupData => {
args.actor.basicTest(setupData).then(test =>
args.actor.basicTest(setupData).then(test =>
{
if (test.result.outcome == "failure")
args.actor.addCondition("dead")
@@ -1067,7 +265,7 @@ export class WH4FRPatchConfig {
modifier = -20
else
modifier = -10
let applicableCharacteristics = ["ws", "bs", "s", "ag", "t", "dex"]
if (args.type == "weapon")
args.prefillModifiers.modifier += modifier
@@ -1095,7 +293,7 @@ export class WH4FRPatchConfig {
"effectTrigger": "prefillDialog",
"symptom": true,
"script": `
let applicableCharacteristics = ["ws", "bs", "s", "fel", "ag", "t", "dex"]
if (args.type == "weapon")
@@ -1226,7 +424,7 @@ export class WH4FRPatchConfig {
"effectTrigger": "prefillDialog",
"symptom": true,
"script": `
if (args.type == "characteristic" && args.item == "fel")
args.prefillModifiers.modifier -= 10
else if (args.type == "skill")
@@ -1251,7 +449,7 @@ export class WH4FRPatchConfig {
if (args.actor.isOwner)
{
args.actor.setupSkill("Résistance", {absolute: {difficulty : "average"}}).then(setupData => {
args.actor.basicTest(setupData).then(test =>
args.actor.basicTest(setupData).then(test =>
{
if (test.result.outcome == "failure")
fromUuid("Compendium.wfrp4e-core.diseases.kKccDTGzWzSXCBOb").then(disease => {
@@ -1340,8 +538,8 @@ export class WH4FRPatchConfig {
type: string, 'weapon', 'skill' 'characteristic', etc.
item: l'objet du type sus-mentionné
options: Autres détails à propos du test (options.rest ou options.mutate par exemple)
Exemple:
Exemple:
if (args.type == "skill" && args.item.name == "Atléthisme") args.prefillModifiers.modifier += 10`,
"prePrepareData":
@@ -1399,7 +597,7 @@ export class WH4FRPatchConfig {
actor : l'acteur qui encaisse les dégâts
attacker : l'acteur qui porte l'attaque
opposedTest : l'objet qui détaille le Test Opposé
opposedTest : l'objet qui détaille le Test Opposé
damageType : le type de dégâts sélectionné (ignorer le Bonus d'Endurance, les PA, etc...)
`,
"applyDamage":
@@ -1409,7 +607,7 @@ export class WH4FRPatchConfig {
actor : l'acteur qui encaisse les dégâts
attacker : l'acteur qui porte l'attaque
opposedTest : l'objet qui détaille le Test Opposé
opposedTest : l'objet qui détaille le Test Opposé
damageType : le type de dégâts sélectionné (ignorer le Bonus d'Endurance, les PA, etc...)
totalWoundLoss : les Blessures perdues après calculs
AP : les données concernant les PA utilisés
@@ -1424,7 +622,7 @@ export class WH4FRPatchConfig {
actor : l'acteur qui encaisse les dégâts
attacker : l'acteur qui porte l'attaque
opposedTest : l'objet qui détaille le Test Opposé
opposedTest : l'objet qui détaille le Test Opposé
damageType : le type de dégâts sélectionné (ignorer le Bonus d'Endurance, les PA, etc...)
`,
@@ -1435,7 +633,7 @@ export class WH4FRPatchConfig {
actor : l'acteur qui encaisse les dégâts
attacker : l'acteur qui porte l'attaque
opposedTest : l'objet qui détaille le Test Opposé
opposedTest : l'objet qui détaille le Test Opposé
damageType : le type de dégâts sélectionné (ignorer le Bonus d'Endurance, les PA, etc...)
totalWoundLoss : les Blessures perdues après calculs
AP : les données concernant les PA utilisés
@@ -1661,8 +859,8 @@ export class WH4FRPatchConfig {
type: string, 'weapon', 'skill' 'characteristic', etc.
item: l'item du type sus-mentionné
options: autres détails à propos du test (options.rest ou options.mutate par exemple)
Example:
Example:
if (args.type == "skill" && args.item.name == "Atléthisme") args.prefillModifiers.modifier += 10`,
"endTurn":
@@ -1690,8 +888,8 @@ export class WH4FRPatchConfig {
"this":
`
Tout les effets ont accès à :
Tout les effets ont accès à :
this.actor : l'acteur executant l'effet
this.effect : l'effet à executer
this.item : l'item qui possède l'effet, si l'effet vient d'un item`