mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 07:36:26 +01:00
Corrected downtime buttons and actions
This commit is contained in:
parent
4b82169fbf
commit
82be5ecd0d
4 changed files with 35 additions and 21 deletions
|
|
@ -297,15 +297,16 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
||||||
await actor.useAction(action);
|
await actor.useAction(action);
|
||||||
};
|
};
|
||||||
|
|
||||||
actionUseButton = async (_, message) => {
|
actionUseButton = async (event, message) => {
|
||||||
|
const { moveIndex, actionIndex } = event.currentTarget.dataset;
|
||||||
const parent = await foundry.utils.fromUuid(message.system.actor);
|
const parent = await foundry.utils.fromUuid(message.system.actor);
|
||||||
const actionType = Object.values(message.system.moves)[0].actions[0];
|
const actionType = message.system.moves[moveIndex].actions[actionIndex];
|
||||||
const cls = CONFIG.DH.ACTIONS.actionTypes[actionType.type];
|
const cls = game.system.api.models.actions.actionsTypes[actionType.type];
|
||||||
const action = new cls(
|
const action = new cls(
|
||||||
{ ...actionType, _id: foundry.utils.randomID(), name: game.i18n.localize(actionType.name) },
|
{ ...actionType, _id: foundry.utils.randomID(), name: game.i18n.localize(actionType.name) },
|
||||||
{ parent: parent }
|
{ parent: parent.system }
|
||||||
);
|
);
|
||||||
|
|
||||||
action.use();
|
action.use(event);
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -145,11 +145,11 @@ export const defaultRestOptions = {
|
||||||
img: 'icons/magic/life/cross-worn-green.webp',
|
img: 'icons/magic/life/cross-worn-green.webp',
|
||||||
actionType: 'action',
|
actionType: 'action',
|
||||||
healing: {
|
healing: {
|
||||||
type: 'health',
|
applyTo: healingTypes.hitPoints.id,
|
||||||
value: {
|
value: {
|
||||||
custom: {
|
custom: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
formula: '1d4 + 1' // should be 1d4 + {tier}. How to use the roll param?
|
formula: '1d4 + @tier'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -169,11 +169,11 @@ export const defaultRestOptions = {
|
||||||
img: 'icons/magic/perception/eye-ringed-green.webp',
|
img: 'icons/magic/perception/eye-ringed-green.webp',
|
||||||
actionType: 'action',
|
actionType: 'action',
|
||||||
healing: {
|
healing: {
|
||||||
type: 'stress',
|
applyTo: healingTypes.stress.id,
|
||||||
value: {
|
value: {
|
||||||
custom: {
|
custom: {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
formula: '1d4 + 1' // should be 1d4 + {tier}. How to use the roll param?
|
formula: '1d4 + @tier'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -186,7 +186,23 @@ export const defaultRestOptions = {
|
||||||
icon: 'fa-solid fa-hammer',
|
icon: 'fa-solid fa-hammer',
|
||||||
img: 'icons/skills/trades/smithing-anvil-silver-red.webp',
|
img: 'icons/skills/trades/smithing-anvil-silver-red.webp',
|
||||||
description: game.i18n.localize('DAGGERHEART.APPLICATIONS.Downtime.shortRest.repairArmor.description'),
|
description: game.i18n.localize('DAGGERHEART.APPLICATIONS.Downtime.shortRest.repairArmor.description'),
|
||||||
actions: []
|
actions: [
|
||||||
|
{
|
||||||
|
type: 'healing',
|
||||||
|
name: game.i18n.localize('DAGGERHEART.APPLICATIONS.Downtime.shortRest.repairArmor.name'),
|
||||||
|
img: 'icons/skills/trades/smithing-anvil-silver-red.webp',
|
||||||
|
actionType: 'action',
|
||||||
|
healing: {
|
||||||
|
applyTo: healingTypes.armorStack.id,
|
||||||
|
value: {
|
||||||
|
custom: {
|
||||||
|
enabled: true,
|
||||||
|
formula: '1d4 + @tier'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
prepare: {
|
prepare: {
|
||||||
id: 'prepare',
|
id: 'prepare',
|
||||||
|
|
|
||||||
|
|
@ -21,13 +21,8 @@
|
||||||
width: 80px;
|
width: 80px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.downtime-refresh-container {
|
.action-use-button {
|
||||||
margin-top: @fullMargin;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.refresh-title {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,12 @@
|
||||||
<h2 class="downtime-title-container">
|
<h2 class="downtime-title-container">
|
||||||
<div>{{title}}</div>
|
<div>{{title}}</div>
|
||||||
</h2>
|
</h2>
|
||||||
{{#each moves}}
|
{{#each moves as | move index |}}
|
||||||
<strong>{{this.name}}</strong>
|
<strong>{{move.name}}</strong>
|
||||||
<img class="downtime-image" src="{{this.img}}" />
|
<img class="downtime-image" src="{{move.img}}" />
|
||||||
<div>{{{this.description}}}</div>
|
<div>{{{move.description}}}</div>
|
||||||
{{#if (gt this.actions.length 0)}}<button class="action-use-button">{{localize "Action"}}</button>{{/if}}
|
{{#each move.actions as | action index |}}
|
||||||
|
<button class="action-use-button" data-move-index="{{@../key}}" data-action-index="{{index}}">{{localize action.name}}</button>
|
||||||
|
{{/each}}
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue