mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-21 23:13:39 +02:00
Fix conflict
This commit is contained in:
commit
f949e859ee
6 changed files with 23 additions and 16 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() {
|
||||
|
|
|
|||
|
|
@ -757,7 +757,6 @@ export default class DhCharacter extends DhCreature {
|
|||
|
||||
static migrateData(source) {
|
||||
if (typeof source.scars === 'object') source.scars = 0;
|
||||
if (source.resources?.hope?.max) source.scars = Math.max(6 - source.resources.hope.max, 0);
|
||||
|
||||
return super.migrateData(source);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -143,6 +143,7 @@ export default class DHRoll extends Roll {
|
|||
return foundry.applications.handlebars.renderTemplate(template, {
|
||||
...chatData,
|
||||
parent: chatData.parent,
|
||||
targetMode: chatData.targetMode,
|
||||
metagamingSettings
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,8 @@ export default class RegisterHandlebarsHelpers {
|
|||
}
|
||||
|
||||
static damageSymbols(damageParts) {
|
||||
const symbols = new Set(...damageParts.map(x => x.type)).map(p => CONFIG.DH.GENERAL.damageTypes[p].icon);
|
||||
const allTypes = [...new Set([...damageParts].flatMap(x => Array.from(x.type)))];
|
||||
const symbols = allTypes.map(p => CONFIG.DH.GENERAL.damageTypes[p].icon);
|
||||
return new Handlebars.SafeString(Array.from(symbols).map(symbol => `<i class="fa-solid ${symbol}"></i>`));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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