mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-08 21:58:11 +02:00
Compare commits
No commits in common. "4504379fcf6df8682acd6df2c7cf5525215a2e6b" and "ab412367f997079911bd031ead92abed1268932c" have entirely different histories.
4504379fcf
...
ab412367f9
8 changed files with 41 additions and 40 deletions
|
|
@ -57,7 +57,6 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
|
||||||
|
|
||||||
let returnMessage = game.i18n.localize('DAGGERHEART.UI.Chat.deathMove.avoidScar');
|
let returnMessage = game.i18n.localize('DAGGERHEART.UI.Chat.deathMove.avoidScar');
|
||||||
if (config.roll.fate.value <= this.actor.system.levelData.level.current) {
|
if (config.roll.fate.value <= this.actor.system.levelData.level.current) {
|
||||||
const maxHope = this.actor.system.resources.hope.max + this.actor.system.scars;
|
|
||||||
const newScarAmount = this.actor.system.scars + 1;
|
const newScarAmount = this.actor.system.scars + 1;
|
||||||
await this.actor.update({
|
await this.actor.update({
|
||||||
system: {
|
system: {
|
||||||
|
|
@ -65,7 +64,7 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (newScarAmount >= maxHope) {
|
if (newScarAmount >= this.actor.system.resources.hope.max) {
|
||||||
await this.actor.setDeathMoveDefeated(CONFIG.DH.GENERAL.defeatedConditionChoices.dead.id);
|
await this.actor.setDeathMoveDefeated(CONFIG.DH.GENERAL.defeatedConditionChoices.dead.id);
|
||||||
return game.i18n.format('DAGGERHEART.UI.Chat.deathMove.journeysEnd', { scars: newScarAmount });
|
return game.i18n.format('DAGGERHEART.UI.Chat.deathMove.journeysEnd', { scars: newScarAmount });
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -124,9 +124,7 @@ export default class DHTokenHUD extends foundry.applications.hud.TokenHUD {
|
||||||
const animationDuration = 500;
|
const animationDuration = 500;
|
||||||
const scene = game.scenes.get(game.user.viewedScene);
|
const scene = game.scenes.get(game.user.viewedScene);
|
||||||
/* getDependentTokens returns already removed tokens with id = null. Need to filter that until it's potentially fixed from Foundry */
|
/* getDependentTokens returns already removed tokens with id = null. Need to filter that until it's potentially fixed from Foundry */
|
||||||
const activeTokens = actors.flatMap(member =>
|
const activeTokens = actors.flatMap(member => member.getDependentTokens({ scenes: scene }).filter(x => x._id));
|
||||||
member.getDependentTokens({ scenes: scene }).filter(x => x._id && !x._destroyed)
|
|
||||||
);
|
|
||||||
const { x: actorX, y: actorY } = this.document;
|
const { x: actorX, y: actorY } = this.document;
|
||||||
if (activeTokens.length > 0) {
|
if (activeTokens.length > 0) {
|
||||||
for (let token of activeTokens) {
|
for (let token of activeTokens) {
|
||||||
|
|
|
||||||
|
|
@ -840,13 +840,12 @@ export default class DhCharacter extends DhCreature {
|
||||||
const newHopeMax = this.resources.hope.max + diff;
|
const newHopeMax = this.resources.hope.max + diff;
|
||||||
const newHopeValue = Math.min(newHopeMax, this.resources.hope.value);
|
const newHopeValue = Math.min(newHopeMax, this.resources.hope.value);
|
||||||
if (newHopeValue != this.resources.hope.value) {
|
if (newHopeValue != this.resources.hope.value) {
|
||||||
changes.system = foundry.utils.mergeObject(changes.system ?? {}, {
|
if (!changes.system.resources.hope) changes.system.resources.hope = { value: 0 };
|
||||||
resources: {
|
|
||||||
hope: {
|
changes.system.resources.hope = {
|
||||||
value: (changes.system?.resources?.hope?.value ?? 0) + newHopeMax
|
...changes.system.resources.hope,
|
||||||
}
|
value: changes.system.resources.hope.value + newHopeValue
|
||||||
}
|
};
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,6 +141,16 @@ export default class DHArmor extends AttachableItem {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_onUpdate(a, b, c) {
|
||||||
|
super._onUpdate(a, b, c);
|
||||||
|
|
||||||
|
if (this.actor?.type === 'character') {
|
||||||
|
for (const party of this.actor.parties) {
|
||||||
|
party.render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
static migrateDocumentData(source) {
|
static migrateDocumentData(source) {
|
||||||
if (!source.system.armor) {
|
if (!source.system.armor) {
|
||||||
|
|
|
||||||
|
|
@ -112,22 +112,10 @@ export default class DhpActor extends Actor {
|
||||||
this.updateSource(update);
|
this.updateSource(update);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Perform a render, debounced in order to prevent overloading repeat render requests */
|
|
||||||
renderDebounced = foundry.utils.debounce(options => {
|
|
||||||
return this.render(options);
|
|
||||||
}, 10);
|
|
||||||
|
|
||||||
_onUpdateDescendantDocuments(parent, collection, documents, changes, options, userId) {
|
|
||||||
super._onUpdateDescendantDocuments(parent, collection, documents, changes, options, userId);
|
|
||||||
for (const party of this.parties) {
|
|
||||||
party.renderDebounced({ parts: ['partyMembers'] });
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_onUpdate(changes, options, userId) {
|
_onUpdate(changes, options, userId) {
|
||||||
super._onUpdate(changes, options, userId);
|
super._onUpdate(changes, options, userId);
|
||||||
for (const party of this.parties) {
|
for (const party of this.parties) {
|
||||||
party.renderDebounced({ parts: ['partyMembers'] });
|
party.render({ parts: ['partyMembers'] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -146,7 +134,7 @@ export default class DhpActor extends Actor {
|
||||||
_onDelete(options, userId) {
|
_onDelete(options, userId) {
|
||||||
super._onDelete(options, userId);
|
super._onDelete(options, userId);
|
||||||
for (const party of this.parties) {
|
for (const party of this.parties) {
|
||||||
party.renderDebounced({ parts: ['partyMembers'] });
|
party.render({ parts: ['partyMembers'] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,16 @@
|
||||||
@import '../../../utils/fonts.less';
|
@import '../../../utils/fonts.less';
|
||||||
@import '../../../utils/mixin.less';
|
@import '../../../utils/mixin.less';
|
||||||
|
|
||||||
|
body.game:is(.performance-low, .noblur) {
|
||||||
|
.application.sheet.daggerheart.actor.dh-style.party .tab.resources .actors-list .actor-resources {
|
||||||
|
background: light-dark(@dark-blue, @dark-golden);
|
||||||
|
|
||||||
|
.actor-name {
|
||||||
|
background: light-dark(@dark-blue, @dark-golden);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.application.sheet.daggerheart.actor.dh-style.party .tab.partyMembers {
|
.application.sheet.daggerheart.actor.dh-style.party .tab.partyMembers {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
"description": "An unofficial implementation of the Daggerheart system",
|
"description": "An unofficial implementation of the Daggerheart system",
|
||||||
"version": "2.2.5",
|
"version": "2.2.5",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "14.361",
|
"minimum": "14.359",
|
||||||
"verified": "14.361",
|
"verified": "14.361",
|
||||||
"maximum": "14"
|
"maximum": "14"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,10 @@
|
||||||
<input type="text" name="elevation" value="{{elevation}}" {{disabled (or locked (and isGamePaused (not isGM)))}}>
|
<input type="text" name="elevation" value="{{elevation}}" {{disabled (or locked (and isGamePaused (not isGM)))}}>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<button type="button" class="control-icon" data-action="sort" data-tooltip="HUD.ToFrontOrBack">
|
||||||
|
<i class="fa-solid fa-arrow-down-arrow-up" inert></i>
|
||||||
|
</button>
|
||||||
|
|
||||||
{{#if canChangeLevel}}
|
{{#if canChangeLevel}}
|
||||||
<button type="button" class="control-icon" data-action="togglePalette" data-palette="levels"
|
<button type="button" class="control-icon" data-action="togglePalette" data-palette="levels"
|
||||||
aria-label="{{ localize "HUD.ChangeLevel" }}" data-tooltip>
|
aria-label="{{ localize "HUD.ChangeLevel" }}" data-tooltip>
|
||||||
|
|
@ -16,10 +20,6 @@
|
||||||
</div>
|
</div>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
<button type="button" class="control-icon" data-action="sort" data-tooltip aria-label="HUD.ToFrontOrBack">
|
|
||||||
<i class="fa-solid fa-arrow-down-arrow-up" inert></i>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
{{#if hasCompanion}}
|
{{#if hasCompanion}}
|
||||||
<button type="button" class="control-icon clown-car" data-action="toggleCompanions" data-tooltip="{{#if companionOnCanvas}}{{localize "DAGGERHEART.APPLICATIONS.HUD.tokenHUD.retrieveCompanionTokens"}}{{else}}{{localize "DAGGERHEART.APPLICATIONS.HUD.tokenHUD.depositCompanionTokens"}}{{/if}}">
|
<button type="button" class="control-icon clown-car" data-action="toggleCompanions" data-tooltip="{{#if companionOnCanvas}}{{localize "DAGGERHEART.APPLICATIONS.HUD.tokenHUD.retrieveCompanionTokens"}}{{else}}{{localize "DAGGERHEART.APPLICATIONS.HUD.tokenHUD.depositCompanionTokens"}}{{/if}}">
|
||||||
<img {{#if companionOnCanvas}}class="flipped"{{/if}} src="{{icons.toggleClowncar}}">
|
<img {{#if companionOnCanvas}}class="flipped"{{/if}} src="{{icons.toggleClowncar}}">
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if canConfigure}}
|
{{#if canConfigure}}
|
||||||
<button type="button" class="control-icon" data-action="config" data-tooltip aria-label="HUD.OpenConfig">
|
<button type="button" class="control-icon" data-action="config" data-tooltip="HUD.OpenConfig">
|
||||||
<i class="fa-solid fa-gear" inert></i>
|
<i class="fa-solid fa-gear" inert></i>
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
@ -49,9 +49,8 @@
|
||||||
|
|
||||||
<div class="col right">
|
<div class="col right">
|
||||||
{{#if isGM}}
|
{{#if isGM}}
|
||||||
<button type="button" class="control-icon {{visibilityClass}}" data-action="visibility"
|
<button type="button" class="control-icon {{visibilityClass}}" data-action="visibility" data-tooltip="HUD.ToggleVis">
|
||||||
data-tooltip aria-label="{{localize (ifThen visibilityClass "HUD.Show" "HUD.Hide")}}">
|
<img src="{{icons.visibility}}">
|
||||||
<i class="fa-solid {{ifThen hidden "fa-eye-slash" "fa-eye"}}" inert></i>
|
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
@ -120,15 +119,13 @@
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" class="control-icon {{targetClass}}" data-action="target"
|
<button type="button" class="control-icon {{targetClass}}" data-action="target" data-tooltip="HUD.ToggleTargetState">
|
||||||
data-tooltip aria-label="{{localize (ifThen targetClass "HUD.Untarget" "HUD.Target")}}">
|
|
||||||
<i class="fa-solid fa-bullseye" inert></i>
|
<i class="fa-solid fa-bullseye" inert></i>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{{#if canToggleCombat}}
|
{{#if canToggleCombat}}
|
||||||
<button type="button" class="control-icon {{combatClass}}" data-action="combat"
|
<button type="button" class="control-icon {{combatClass}}" data-action="combat" data-tooltip="HUD.ToggleCombatState">
|
||||||
data-tooltip aria-label="{{localize (ifThen combatClass "HUD.ExitCombat" "HUD.EnterCombat")}}">
|
<img src="{{icons.combat}}">
|
||||||
<i class="fa-solid fa-swords" inert></i>
|
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue