mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-06-08 21:58:11 +02:00
Compare commits
6 commits
ab412367f9
...
4504379fcf
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4504379fcf | ||
|
|
d152bfc906 | ||
|
|
b91d943dd1 | ||
|
|
ac5f84fff7 | ||
|
|
d78c6b1183 | ||
|
|
98049bd76b |
8 changed files with 40 additions and 41 deletions
|
|
@ -57,6 +57,7 @@ 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: {
|
||||||
|
|
@ -64,7 +65,7 @@ export default class DhDeathMove extends HandlebarsApplicationMixin(ApplicationV
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (newScarAmount >= this.actor.system.resources.hope.max) {
|
if (newScarAmount >= maxHope) {
|
||||||
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,7 +124,9 @@ 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 => member.getDependentTokens({ scenes: scene }).filter(x => x._id));
|
const activeTokens = actors.flatMap(member =>
|
||||||
|
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,12 +840,13 @@ 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) {
|
||||||
if (!changes.system.resources.hope) changes.system.resources.hope = { value: 0 };
|
changes.system = foundry.utils.mergeObject(changes.system ?? {}, {
|
||||||
|
resources: {
|
||||||
changes.system.resources.hope = {
|
hope: {
|
||||||
...changes.system.resources.hope,
|
value: (changes.system?.resources?.hope?.value ?? 0) + newHopeMax
|
||||||
value: changes.system.resources.hope.value + newHopeValue
|
}
|
||||||
};
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -141,16 +141,6 @@ 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,10 +112,22 @@ 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.render({ parts: ['partyMembers'] });
|
party.renderDebounced({ parts: ['partyMembers'] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -134,7 +146,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.render({ parts: ['partyMembers'] });
|
party.renderDebounced({ parts: ['partyMembers'] });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,6 @@
|
||||||
@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.359",
|
"minimum": "14.361",
|
||||||
"verified": "14.361",
|
"verified": "14.361",
|
||||||
"maximum": "14"
|
"maximum": "14"
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -4,10 +4,6 @@
|
||||||
<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>
|
||||||
|
|
@ -20,6 +16,10 @@
|
||||||
</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="HUD.OpenConfig">
|
<button type="button" class="control-icon" data-action="config" data-tooltip aria-label="HUD.OpenConfig">
|
||||||
<i class="fa-solid fa-gear" inert></i>
|
<i class="fa-solid fa-gear" inert></i>
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
@ -49,8 +49,9 @@
|
||||||
|
|
||||||
<div class="col right">
|
<div class="col right">
|
||||||
{{#if isGM}}
|
{{#if isGM}}
|
||||||
<button type="button" class="control-icon {{visibilityClass}}" data-action="visibility" data-tooltip="HUD.ToggleVis">
|
<button type="button" class="control-icon {{visibilityClass}}" data-action="visibility"
|
||||||
<img src="{{icons.visibility}}">
|
data-tooltip aria-label="{{localize (ifThen visibilityClass "HUD.Show" "HUD.Hide")}}">
|
||||||
|
<i class="fa-solid {{ifThen hidden "fa-eye-slash" "fa-eye"}}" inert></i>
|
||||||
</button>
|
</button>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
|
@ -119,13 +120,15 @@
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<button type="button" class="control-icon {{targetClass}}" data-action="target" data-tooltip="HUD.ToggleTargetState">
|
<button type="button" class="control-icon {{targetClass}}" data-action="target"
|
||||||
|
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" data-tooltip="HUD.ToggleCombatState">
|
<button type="button" class="control-icon {{combatClass}}" data-action="combat"
|
||||||
<img src="{{icons.combat}}">
|
data-tooltip aria-label="{{localize (ifThen combatClass "HUD.ExitCombat" "HUD.EnterCombat")}}">
|
||||||
|
<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