Carrrièes, stat patch et log
This commit is contained in:
@ -140,36 +140,38 @@ export class WH4FRPatchConfig {
|
||||
this.patch_subspecies();
|
||||
this.patch_career();
|
||||
|
||||
game.wfrp4e.config.conditionScripts = {
|
||||
"ablaze": async function (actor) {
|
||||
/*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;
|
||||
}
|
||||
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 = new Roll(`${rollString} - ${leastProtectedValue || 0}`).roll();
|
||||
|
||||
let msg = `<h2>En Flammes</h2><b>Formule</b>: ${rollString}<br><b>Lancer</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 } })
|
||||
|
||||
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} AP)`)
|
||||
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 } })
|
||||
messageData.speaker = {alias: actor.data.token.name}
|
||||
actor.runEffects("applyCondition", {effect, data : {messageData}})
|
||||
return messageData
|
||||
},
|
||||
"poisoned": async function (actor) {
|
||||
"poisoned": async function (actor) {
|
||||
let effect = actor.hasCondition("poisoned")
|
||||
let msg = `<h2>Empoisonné</h2>`
|
||||
|
||||
@ -217,7 +219,7 @@ export class WH4FRPatchConfig {
|
||||
actor.runEffects("applyCondition", { effect, data: { messageData, bleedingRoll } })
|
||||
return messageData
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
game.wfrp4e.config.statusEffects = [
|
||||
{
|
||||
@ -239,9 +241,9 @@ export class WH4FRPatchConfig {
|
||||
wfrp4e: {
|
||||
"trigger": "endRound",
|
||||
"effectTrigger": "prefillDialog",
|
||||
"script": "args.prefillModifiers.modifier -= 10 * getProperty(this.effect, 'flags.wfrp4e.value')",
|
||||
"script": "args.prefillModifiers.modifier -= 10 * this.effect.conditionValue",
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
},
|
||||
@ -280,7 +282,7 @@ export class WH4FRPatchConfig {
|
||||
wfrp4e: {
|
||||
"trigger": "endRound",
|
||||
"effectTrigger": "prefillDialog",
|
||||
"script": "args.prefillModifiers.modifier -= 10 * getProperty(this.effect, 'flags.wfrp4e.value')",
|
||||
"script": "args.prefillModifiers.modifier -= 10 * this.effect.conditionValue",
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
@ -308,8 +310,8 @@ export class WH4FRPatchConfig {
|
||||
flags: {
|
||||
wfrp4e: {
|
||||
"effectTrigger": "prefillDialog",
|
||||
"script": "args.prefillModifiers.modifier -= 10 * getProperty(this.effect, 'flags.wfrp4e.value')",
|
||||
"value": 1
|
||||
"script": "args.prefillModifiers.modifier -= 10 * this.effect.conditionValue",
|
||||
"value" : 1
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -321,14 +323,14 @@ export class WH4FRPatchConfig {
|
||||
wfrp4e: {
|
||||
"trigger": "endRound",
|
||||
"effectTrigger": "dialogChoice",
|
||||
"effectData": {
|
||||
"description": "Tests relatifs à la vue",
|
||||
"modifier": "-10 * this.flags.wfrp4e.value"
|
||||
"effectData" : {
|
||||
"description" : "Tests related to sight",
|
||||
"modifier" : "-10 * this.flags.wfrp4e.value"
|
||||
},
|
||||
"value": 1,
|
||||
"secondaryEffect": {
|
||||
"effectTrigger": "targetPrefillDialog",
|
||||
"script": "if (args.type == 'weapon' && args.item.attackType=='melee') args.prefillModifiers.modifier += 10 * getProperty(this.effect, 'flags.wfrp4e.value')",
|
||||
"secondaryEffect" :{
|
||||
"effectTrigger": "targetPrefillDialog",
|
||||
"script": "if (args.item && args.item.attackType=='melee') args.prefillModifiers.modifier += 10 * this.effect.conditionValue",
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -340,7 +342,7 @@ export class WH4FRPatchConfig {
|
||||
flags: {
|
||||
wfrp4e: {
|
||||
"effectTrigger": "prefillDialog",
|
||||
"script": "args.prefillModifiers.modifier -= 10 * getProperty(this.effect, 'flags.wfrp4e.value')",
|
||||
"script": "args.prefillModifiers.modifier -= 10 * this.effect.conditionValue",
|
||||
"value": 1
|
||||
}
|
||||
}
|
||||
@ -352,14 +354,14 @@ export class WH4FRPatchConfig {
|
||||
flags: {
|
||||
wfrp4e: {
|
||||
"effectTrigger": "dialogChoice",
|
||||
"effectData": {
|
||||
"description": "Tout les tests relatifs au mouvement",
|
||||
"modifier": "-20"
|
||||
"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",
|
||||
"secondaryEffect" :{
|
||||
"effectTrigger": "targetPrefillDialog",
|
||||
"script": "if (args.type == 'weapon' && args.item.attackType=='melee') args.prefillModifiers.modifier += 20",
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -371,16 +373,16 @@ export class WH4FRPatchConfig {
|
||||
flags: {
|
||||
wfrp4e: {
|
||||
"effectTrigger": "dialogChoice",
|
||||
"effectData": {
|
||||
"description": "Tests affectés ",
|
||||
"slBonus": "-1"
|
||||
"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 += " la source de la Peur"
|
||||
`,
|
||||
"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
|
||||
}
|
||||
}
|
||||
@ -392,9 +394,9 @@ export class WH4FRPatchConfig {
|
||||
flags: {
|
||||
wfrp4e: {
|
||||
"value": null,
|
||||
"secondaryEffect": {
|
||||
"effectTrigger": "targetPrefillDialog",
|
||||
"script": "if (args.type == 'weapon' && args.item.attackType=='melee') args.prefillModifiers.modifier += 20",
|
||||
"secondaryEffect" :{
|
||||
"effectTrigger": "targetPrefillDialog",
|
||||
"script": "if (args.type == 'weapon' && args.item.attackType=='melee') args.prefillModifiers.modifier += 20",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user