mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-07 14:36:13 +01:00
[Fix] 1535 - Toggle Bonuses (#1538)
* Fixed all SRD instances of Powerful and Massive * Fixed suppressed effects being added to roll formula options * Fixed weapon effects being presented when it's no the weapon itself * . * . * Fixed secondary weapons effects * Raised system version * Update module/data/action/baseAction.mjs Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com> * Update module/documents/chatMessage.mjs Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com> --------- Co-authored-by: Carlos Fernandez <CarlosFdez@users.noreply.github.com>
This commit is contained in:
parent
fad09a1b3a
commit
822c522f61
18 changed files with 38 additions and 171 deletions
|
|
@ -712,7 +712,7 @@ export default class CharacterSheet extends DHBaseActorSheet {
|
||||||
headerTitle: game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle', {
|
headerTitle: game.i18n.format('DAGGERHEART.UI.Chat.dualityRoll.abilityCheckTitle', {
|
||||||
ability: abilityLabel
|
ability: abilityLabel
|
||||||
}),
|
}),
|
||||||
effects: Array.from(await this.document.allApplicableEffects()),
|
effects: await await game.system.api.data.actions.actionsTypes.base.getEffects(this.document),
|
||||||
roll: {
|
roll: {
|
||||||
trait: button.dataset.attribute,
|
trait: button.dataset.attribute,
|
||||||
type: 'trait'
|
type: 'trait'
|
||||||
|
|
|
||||||
|
|
@ -505,7 +505,10 @@ export default function DHApplicationMixin(Base) {
|
||||||
const doc = await getDocFromElement(target),
|
const doc = await getDocFromElement(target),
|
||||||
action = doc?.system?.attack ?? doc;
|
action = doc?.system?.attack ?? doc;
|
||||||
const config = action.prepareConfig(event);
|
const config = action.prepareConfig(event);
|
||||||
config.effects = Array.from(await this.document.allApplicableEffects());
|
config.effects = await game.system.api.data.actions.actionsTypes.base.getEffects(
|
||||||
|
this.document,
|
||||||
|
doc
|
||||||
|
);
|
||||||
config.hasRoll = false;
|
config.hasRoll = false;
|
||||||
return action && action.workflow.get('damage').execute(config, null, true);
|
return action && action.workflow.get('damage').execute(config, null, true);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -198,7 +198,7 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
let config = this.prepareConfig(event);
|
let config = this.prepareConfig(event);
|
||||||
if (!config) return;
|
if (!config) return;
|
||||||
|
|
||||||
await this.addEffects(config);
|
config.effects = await game.system.api.data.actions.actionsTypes.base.getEffects(this.actor, this.item);
|
||||||
|
|
||||||
if (Hooks.call(`${CONFIG.DH.id}.preUseAction`, this, config) === false) return;
|
if (Hooks.call(`${CONFIG.DH.id}.preUseAction`, this, config) === false) return;
|
||||||
|
|
||||||
|
|
@ -266,14 +266,26 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** */
|
/**
|
||||||
async addEffects(config) {
|
* Get the all potentially applicable effects on the actor
|
||||||
let effects = [];
|
* @param {DHActor} actor The actor performing the action
|
||||||
if (this.actor) {
|
* @param {DHItem|DhActor} effectParent The parent of the effect
|
||||||
effects = Array.from(await this.actor.allApplicableEffects());
|
* @returns {DhActiveEffect[]}
|
||||||
}
|
*/
|
||||||
|
static async getEffects(actor, effectParent) {
|
||||||
|
if (!actor) return [];
|
||||||
|
|
||||||
|
return Array.from(await actor.allApplicableEffects()).filter(effect => {
|
||||||
|
/* Effects on weapons only ever apply for the weapon itself */
|
||||||
|
if (effect.parent.type === 'weapon') {
|
||||||
|
/* Unless they're secondary - then they apply only to other primary weapons */
|
||||||
|
if (effect.parent.system.secondary) {
|
||||||
|
if (effectParent.type !== 'weapon' || effectParent.system.secondary) return false;
|
||||||
|
} else if (effectParent?.id !== effect.parent.id) return false;
|
||||||
|
}
|
||||||
|
|
||||||
config.effects = effects;
|
return !effect.isSuppressed;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -158,7 +158,9 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
const config = foundry.utils.deepClone(this.system);
|
const config = foundry.utils.deepClone(this.system);
|
||||||
config.event = event;
|
config.event = event;
|
||||||
if (this.system.action) {
|
if (this.system.action) {
|
||||||
await this.system.action.addEffects(config);
|
const actor = await foundry.utils.fromUuid(config.source.actor);
|
||||||
|
const item = actor?.items.get(config.source.item) ?? null;
|
||||||
|
config.effects = await game.system.api.data.actions.actionsTypes.base.getEffects(actor, item);
|
||||||
await this.system.action.workflow.get('damage')?.execute(config, this._id, true);
|
await this.system.action.workflow.get('damage')?.execute(config, this._id, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -113,18 +113,7 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [
|
"changes": [],
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"_id": "sGVVxSM68Fmr1sSM",
|
"_id": "sGVVxSM68Fmr1sSM",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -118,16 +118,6 @@
|
||||||
"key": "system.evasion",
|
"key": "system.evasion",
|
||||||
"mode": 2,
|
"mode": 2,
|
||||||
"value": "-1"
|
"value": "-1"
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_id": "E0PjC15OP55vIype",
|
"_id": "E0PjC15OP55vIype",
|
||||||
|
|
|
||||||
|
|
@ -113,18 +113,7 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [
|
"changes": [],
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"_id": "DCie5eR1dZH2Qvln",
|
"_id": "DCie5eR1dZH2Qvln",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -113,18 +113,7 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [
|
"changes": [],
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"_id": "sZ1XotFlGdkPPDG4",
|
"_id": "sZ1XotFlGdkPPDG4",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -113,18 +113,7 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [
|
"changes": [],
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"_id": "T831j6kZiMnpMNmv",
|
"_id": "T831j6kZiMnpMNmv",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -113,18 +113,7 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [
|
"changes": [],
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"_id": "ir4iKLIQ4CH1Qckn",
|
"_id": "ir4iKLIQ4CH1Qckn",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -113,18 +113,7 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [
|
"changes": [],
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"_id": "K4VgrDjVj1U1m9Ie",
|
"_id": "K4VgrDjVj1U1m9Ie",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -113,18 +113,7 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [
|
"changes": [],
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"_id": "904orawScurM9GjG",
|
"_id": "904orawScurM9GjG",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -118,16 +118,6 @@
|
||||||
"key": "system.evasion",
|
"key": "system.evasion",
|
||||||
"mode": 2,
|
"mode": 2,
|
||||||
"value": "-1"
|
"value": "-1"
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_id": "cffkpiwGpEGhjiUC",
|
"_id": "cffkpiwGpEGhjiUC",
|
||||||
|
|
|
||||||
|
|
@ -113,18 +113,7 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [
|
"changes": [],
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"_id": "hnayB09P25ZW3gVY",
|
"_id": "hnayB09P25ZW3gVY",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -118,16 +118,6 @@
|
||||||
"key": "system.evasion",
|
"key": "system.evasion",
|
||||||
"mode": 2,
|
"mode": 2,
|
||||||
"value": "-1"
|
"value": "-1"
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_id": "2nl35v8sPAudiOIb",
|
"_id": "2nl35v8sPAudiOIb",
|
||||||
|
|
|
||||||
|
|
@ -113,18 +113,7 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [
|
"changes": [],
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"_id": "OV1Ly7vX4owBUgLQ",
|
"_id": "OV1Ly7vX4owBUgLQ",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
|
|
@ -118,16 +118,6 @@
|
||||||
"key": "system.evasion",
|
"key": "system.evasion",
|
||||||
"mode": 2,
|
"mode": 2,
|
||||||
"value": "-1"
|
"value": "-1"
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"_id": "oRCiXSElN5xufUfn",
|
"_id": "oRCiXSElN5xufUfn",
|
||||||
|
|
|
||||||
|
|
@ -113,18 +113,7 @@
|
||||||
"name": "Powerful",
|
"name": "Powerful",
|
||||||
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
"description": "On a successful attack, roll an additional damage die and discard the lowest result.",
|
||||||
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
"img": "icons/magic/control/buff-flight-wings-runes-red-yellow.webp",
|
||||||
"changes": [
|
"changes": [],
|
||||||
{
|
|
||||||
"key": "system.bonuses.damage.primaryWeapon.extraDice",
|
|
||||||
"mode": 2,
|
|
||||||
"value": "1"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "system.rules.weapon.dropLowestDamageDice",
|
|
||||||
"mode": 5,
|
|
||||||
"value": "1"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"_id": "2J6vzNUel78JFypp",
|
"_id": "2J6vzNUel78JFypp",
|
||||||
"type": "base",
|
"type": "base",
|
||||||
"system": {},
|
"system": {},
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue