mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 15:03:37 +02:00
TagTeam Fixes
This commit is contained in:
parent
3031531b14
commit
ad8caabf71
3 changed files with 20 additions and 14 deletions
|
|
@ -1,6 +1,6 @@
|
|||
import { MemberData } from '../../data/tagTeamData.mjs';
|
||||
import { getCritDamageBonus } from '../../helpers/utils.mjs';
|
||||
import { RefreshType, socketEvent } from '../../systemRegistration/socket.mjs';
|
||||
import { emitAsGM, GMUpdateEvent, RefreshType, socketEvent } from '../../systemRegistration/socket.mjs';
|
||||
import Party from '../sheets/actors/party.mjs';
|
||||
|
||||
const { HandlebarsApplicationMixin, ApplicationV2 } = foundry.applications.api;
|
||||
|
|
@ -133,8 +133,9 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
|
|||
group: item.name,
|
||||
baseAction: action.baseAction
|
||||
};
|
||||
rollOptions.push(actionItem);
|
||||
|
||||
if (action.hasDamage) damageRollOptions.push(actionItem);
|
||||
else rollOptions.push(actionItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -179,16 +180,23 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
|
|||
this.updatePartyData(partyData);
|
||||
}
|
||||
|
||||
async updatePartyData(updata, options = { render: true }) {
|
||||
await this.party.update(updata);
|
||||
|
||||
if (options.render) {
|
||||
this.render(true);
|
||||
async updatePartyData(update, options = { render: true }) {
|
||||
const gmUpdate = async update => {
|
||||
await this.party.update(update);
|
||||
this.render();
|
||||
game.socket.emit(`system.${CONFIG.DH.id}`, {
|
||||
action: socketEvent.Refresh,
|
||||
data: { refreshType: RefreshType.TagTeamRoll, action: 'refresh' }
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
await emitAsGM(
|
||||
GMUpdateEvent.UpdateDocument,
|
||||
gmUpdate,
|
||||
update,
|
||||
this.party.uuid,
|
||||
options.render ? { refreshType: RefreshType.TagTeamRoll, action: 'refresh' } : undefined
|
||||
);
|
||||
}
|
||||
|
||||
getIsEditable() {
|
||||
|
|
@ -414,8 +422,6 @@ export default class TagTeamDialog extends HandlebarsApplicationMixin(Applicatio
|
|||
await action.workflow.get('damage').execute(config, null, true);
|
||||
if (!config.damage) return;
|
||||
|
||||
// const damage = config.roll.isCritical ? await this.getNonCriticalDamage(config, actor) : config.damage;
|
||||
|
||||
const current = this.party.system.tagTeam.members[memberKey].rollData;
|
||||
await this.updatePartyData({
|
||||
[`system.tagTeam.members.${memberKey}.rollData`]: {
|
||||
|
|
|
|||
|
|
@ -355,11 +355,11 @@ export default class DHBaseAction extends ActionMixin(foundry.abstract.DataModel
|
|||
}
|
||||
|
||||
get hasDamage() {
|
||||
return !foundry.utils.isEmpty(this.damage?.parts) && this.type !== 'healing';
|
||||
return Boolean(Object.keys(this.damage?.parts ?? {}).length) && this.type !== 'healing';
|
||||
}
|
||||
|
||||
get hasHealing() {
|
||||
return !foundry.utils.isEmpty(this.damage?.parts) && this.type === 'healing';
|
||||
return Boolean(Object.keys(this.damage?.parts ?? {}).length) && this.type === 'healing';
|
||||
}
|
||||
|
||||
get hasSave() {
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{else if (eq member.rollType 'abilityDamage')}}
|
||||
{{else if (eq member.rollType 'damageAbility')}}
|
||||
<div class="form-group">
|
||||
<div class="form-fields">
|
||||
<label>{{localize "DAGGERHEART.CONFIG.TagTeamRollTypes.damageAbility"}}</label>
|
||||
|
|
@ -79,7 +79,7 @@
|
|||
<span class="dice-label">{{this.fear.value}}</span>
|
||||
<img src="{{concat "systems/daggerheart/assets/icons/dice/fear/" this.fear.dice ".svg"}}" />
|
||||
</a>
|
||||
{{#if this.advantage}}
|
||||
{{#if this.advantage.type}}
|
||||
<span class="roll-operator">{{#if (eq this.advantage.type 1)}}+{{else}}-{{/if}}</span>
|
||||
<span class="roll-dice">
|
||||
<span class="dice-label">{{this.advantage.value}}</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue