mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-11 19:25:21 +01:00
[Fix] Party Fixes (#1284)
* Fixed deletion of characters in the world locking up the party actor * . * Fixed so leader in group roll gains resourcse * Fixed so party.inventory has the right controls * Corrected for added character purning * .
This commit is contained in:
parent
7df43d71e0
commit
481ce46edf
12 changed files with 104 additions and 67 deletions
|
|
@ -2624,7 +2624,7 @@
|
|||
"cardTooHighLevel": "The card is too high level!",
|
||||
"duplicateCard": "You cannot select the same card more than once.",
|
||||
"duplicateCharacter": "This actor is already registered in the party members list.",
|
||||
"onlyCharactersInPartySheet": "You can drag only characters to a party sheet.",
|
||||
"onlyCharactersInPartySheet": "You can only drag characters, companions and adverasries to the party sheet.",
|
||||
"notPrimary": "The weapon is not a primary weapon!",
|
||||
"notSecondary": "The weapon is not a secondary weapon!",
|
||||
"itemTooHighTier": "The item must be from Tier1",
|
||||
|
|
@ -2661,7 +2661,8 @@
|
|||
"subclassAlreadyLinked": "{name} is already a subclass in the class {class}. Remove it from there if you want it to be a subclass to this class.",
|
||||
"gmRequired": "This action requires an online GM",
|
||||
"gmOnly": "This can only be accessed by the GM",
|
||||
"noActorOwnership": "You do not have permissions for this character"
|
||||
"noActorOwnership": "You do not have permissions for this character",
|
||||
"documentIsMissing": "The {documentType} is missing from the world."
|
||||
},
|
||||
"Sidebar": {
|
||||
"daggerheartMenu": {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import { socketEvent } from '../../../systemRegistration/socket.mjs';
|
|||
import GroupRollDialog from '../../dialogs/group-roll-dialog.mjs';
|
||||
import DhpActor from '../../../documents/actor.mjs';
|
||||
import DHItem from '../../../documents/item.mjs';
|
||||
import DhParty from '../../../data/actor/party.mjs';
|
||||
|
||||
export default class Party extends DHBaseActorSheet {
|
||||
constructor(options) {
|
||||
|
|
@ -79,6 +80,9 @@ export default class Party extends DHBaseActorSheet {
|
|||
}
|
||||
};
|
||||
|
||||
static ALLOWED_ACTOR_TYPES = ['character', 'companion', 'adversary'];
|
||||
static DICE_ROLL_ACTOR_TYPES = ['character'];
|
||||
|
||||
async _onRender(context, options) {
|
||||
await super._onRender(context, options);
|
||||
this._createFilterMenus();
|
||||
|
|
@ -277,13 +281,17 @@ export default class Party extends DHBaseActorSheet {
|
|||
}
|
||||
|
||||
static async #tagTeamRoll() {
|
||||
new game.system.api.applications.dialogs.TagTeamDialog(this.document.system.partyMembers).render({
|
||||
new game.system.api.applications.dialogs.TagTeamDialog(
|
||||
this.document.system.partyMembers.filter(x => Party.DICE_ROLL_ACTOR_TYPES.includes(x.type))
|
||||
).render({
|
||||
force: true
|
||||
});
|
||||
}
|
||||
|
||||
static async #groupRoll(params) {
|
||||
new GroupRollDialog(this.document.system.partyMembers).render({ force: true });
|
||||
static async #groupRoll(_params) {
|
||||
new GroupRollDialog(
|
||||
this.document.system.partyMembers.filter(x => Party.DICE_ROLL_ACTOR_TYPES.includes(x.type))
|
||||
).render({ force: true });
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -453,17 +461,17 @@ export default class Party extends DHBaseActorSheet {
|
|||
event.stopPropagation();
|
||||
|
||||
const data = foundry.applications.ux.TextEditor.implementation.getDragEventData(event);
|
||||
const item = await foundry.utils.fromUuid(data.uuid);
|
||||
const document = await foundry.utils.fromUuid(data.uuid);
|
||||
|
||||
if (item instanceof DhpActor) {
|
||||
if (document instanceof DhpActor && Party.ALLOWED_ACTOR_TYPES.includes(document.type)) {
|
||||
const currentMembers = this.document.system.partyMembers.map(x => x.uuid);
|
||||
if (currentMembers.includes(data.uuid)) {
|
||||
return ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.duplicateCharacter'));
|
||||
}
|
||||
|
||||
await this.document.update({ 'system.partyMembers': [...currentMembers, item.uuid] });
|
||||
} else if (item instanceof DHItem) {
|
||||
this.document.createEmbeddedDocuments('Item', [item.toObject()]);
|
||||
await this.document.update({ 'system.partyMembers': [...currentMembers, document.uuid] });
|
||||
} else if (document instanceof DHItem) {
|
||||
this.document.createEmbeddedDocuments('Item', [document.toObject()]);
|
||||
} else {
|
||||
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.onlyCharactersInPartySheet'));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -192,9 +192,18 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
|||
|
||||
async groupRollButton(event, message) {
|
||||
const path = event.currentTarget.dataset.path;
|
||||
const isLeader = path === 'leader';
|
||||
const { actor: actorData, trait } = foundry.utils.getProperty(message.system, path);
|
||||
const actor = game.actors.get(actorData._id);
|
||||
|
||||
if (!actor) {
|
||||
return ui.notifications.error(
|
||||
game.i18n.format('DAGGERHEART.UI.Notifications.documentIsMissing', {
|
||||
documentType: game.i18n.localize('TYPES.Actor.character')
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
if (!actor.testUserPermission(game.user, 'OWNER')) {
|
||||
return ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.noActorOwnership'));
|
||||
}
|
||||
|
|
@ -214,7 +223,7 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
|||
hasRoll: true,
|
||||
skips: {
|
||||
createMessage: true,
|
||||
resources: true
|
||||
resources: !isLeader
|
||||
}
|
||||
};
|
||||
const result = await actor.diceRoll({
|
||||
|
|
@ -225,6 +234,9 @@ export default class DhpChatLog extends foundry.applications.sidebar.tabs.ChatLo
|
|||
})
|
||||
});
|
||||
|
||||
if (!result) return;
|
||||
await game.system.api.fields.ActionFields.CostField.execute.call({ actor }, result);
|
||||
|
||||
const newMessageData = foundry.utils.deepClone(message.system);
|
||||
foundry.utils.setProperty(newMessageData, `${path}.result`, result.roll);
|
||||
const renderData = { system: new game.system.api.models.chatMessages.config.groupRoll(newMessageData) };
|
||||
|
|
|
|||
|
|
@ -675,6 +675,8 @@ export default class DhCharacter extends BaseDataActor {
|
|||
}
|
||||
|
||||
_getTags() {
|
||||
return [this.class.value?.name, this.class.subclass?.name, this.community?.name, this.ancestry?.name].filter((t) => !!t);
|
||||
return [this.class.value?.name, this.class.subclass?.name, this.community?.name, this.ancestry?.name].filter(
|
||||
t => !!t
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ export default class DhParty extends BaseDataActor {
|
|||
|
||||
// Clear this party from all members that aren't deleted
|
||||
for (const member of this.partyMembers) {
|
||||
member.parties?.delete(this.parent);
|
||||
member?.parties?.delete(this.parent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@ export async function runMigrations() {
|
|||
let lastMigrationVersion = game.settings.get(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion);
|
||||
if (!lastMigrationVersion) lastMigrationVersion = game.system.version;
|
||||
|
||||
//#region old migrations
|
||||
if (foundry.utils.isNewerVersion('1.1.0', lastMigrationVersion)) {
|
||||
const lockedPacks = [];
|
||||
const compendiumActors = [];
|
||||
|
|
@ -190,6 +191,7 @@ export async function runMigrations() {
|
|||
|
||||
lastMigrationVersion = '1.2.0';
|
||||
}
|
||||
//#endregion
|
||||
|
||||
await game.settings.set(CONFIG.DH.id, CONFIG.DH.SETTINGS.gameSettings.LastMigrationVersion, lastMigrationVersion);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ body.game:is(.performance-low, .noblur) {
|
|||
background: light-dark(@dark-blue-40, @dark-golden-40);
|
||||
border-radius: 6px;
|
||||
border: 1px solid light-dark(@dark-blue, @golden);
|
||||
max-width: 230px;
|
||||
width: 230px;
|
||||
height: -webkit-fill-available;
|
||||
|
||||
.actor-name {
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@
|
|||
"id": "daggerheart",
|
||||
"title": "Daggerheart",
|
||||
"description": "An unofficial implementation of the Daggerheart system",
|
||||
"version": "1.2.1",
|
||||
"version": "1.2.2",
|
||||
"compatibility": {
|
||||
"minimum": "13",
|
||||
"verified": "13.350",
|
||||
"verified": "13.351",
|
||||
"maximum": "13"
|
||||
},
|
||||
"authors": [
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
item=actor
|
||||
type='character'
|
||||
isActor=true
|
||||
hideContextMenu=true
|
||||
}}
|
||||
{{/each}}
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -22,19 +22,21 @@
|
|||
<h2 class="actor-name">{{actor.name}}</h2>
|
||||
<img class="actor-img" src="{{actor.img}}">
|
||||
<div class="resources">
|
||||
<div class="slot-section">
|
||||
<div class="slot-bar">
|
||||
{{#times actor.system.resources.hitPoints.max}}
|
||||
<span class='slot {{#if (gte actor.system.resources.hitPoints.value (add this 1))}}filled{{/if}}'
|
||||
data-action='toggleHitPoints' data-actor-id="{{actor.uuid}}" data-value="{{add this 1}}">
|
||||
</span>
|
||||
{{/times}}
|
||||
{{#unless (eq actor.type 'companion') }}
|
||||
<div class="slot-section">
|
||||
<div class="slot-bar">
|
||||
{{#times actor.system.resources.hitPoints.max}}
|
||||
<span class='slot {{#if (gte actor.system.resources.hitPoints.value (add this 1))}}filled{{/if}}'
|
||||
data-action='toggleHitPoints' data-actor-id="{{actor.uuid}}" data-value="{{add this 1}}">
|
||||
</span>
|
||||
{{/times}}
|
||||
</div>
|
||||
<div class="slot-label">
|
||||
<span class="label">{{localize "DAGGERHEART.GENERAL.HitPoints.short"}}</span>
|
||||
<span class="value">{{actor.system.resources.hitPoints.value}} / {{actor.system.resources.hitPoints.max}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="slot-label">
|
||||
<span class="label">{{localize "DAGGERHEART.GENERAL.HitPoints.short"}}</span>
|
||||
<span class="value">{{actor.system.resources.hitPoints.value}} / {{actor.system.resources.hitPoints.max}}</span>
|
||||
</div>
|
||||
</div>
|
||||
{{/unless}}
|
||||
|
||||
<div class="slot-section">
|
||||
<div class="slot-bar">
|
||||
|
|
@ -71,26 +73,30 @@
|
|||
</div>
|
||||
{{/if}}
|
||||
|
||||
{{#unless (or (eq actor.type 'companion') (eq actor.type 'adversary')) }}
|
||||
<div class="hope-section">
|
||||
<h4>{{localize "DAGGERHEART.GENERAL.hope"}}</h4>
|
||||
{{#times actor.system.resources.hope.max}}
|
||||
<span class='hope-value' data-action='toggleHope' data-actor-id="{{actor.uuid}}" data-value="{{add this 1}}">
|
||||
{{#if (gte actor.system.resources.hope.value (add this 1))}}
|
||||
<i class='fa-solid fa-diamond'></i>
|
||||
{{else}}
|
||||
<i class='fa-regular fa-circle'></i>
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/times}}
|
||||
</div>
|
||||
{{/unless}}
|
||||
|
||||
<div class="hope-section">
|
||||
<h4>{{localize "DAGGERHEART.GENERAL.hope"}}</h4>
|
||||
{{#times actor.system.resources.hope.max}}
|
||||
<span class='hope-value' data-action='toggleHope' data-actor-id="{{actor.uuid}}" data-value="{{add this 1}}">
|
||||
{{#if (gte actor.system.resources.hope.value (add this 1))}}
|
||||
<i class='fa-solid fa-diamond'></i>
|
||||
{{else}}
|
||||
<i class='fa-regular fa-circle'></i>
|
||||
{{/if}}
|
||||
</span>
|
||||
{{/times}}
|
||||
</div>
|
||||
<div class="threshold-section">
|
||||
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.minor"}}</h4>
|
||||
<h4 class="threshold-value">{{actor.system.damageThresholds.major}}</h4>
|
||||
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.major"}}</h4>
|
||||
<h4 class="threshold-value">{{actor.system.damageThresholds.severe}}</h4>
|
||||
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.severe"}}</h4>
|
||||
</div>
|
||||
{{#unless (eq actor.type 'companion')}}
|
||||
<div class="threshold-section">
|
||||
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.minor"}}</h4>
|
||||
<h4 class="threshold-value">{{actor.system.damageThresholds.major}}</h4>
|
||||
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.major"}}</h4>
|
||||
<h4 class="threshold-value">{{actor.system.damageThresholds.severe}}</h4>
|
||||
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.severe"}}</h4>
|
||||
</div>
|
||||
{{/unless}}
|
||||
</div>
|
||||
</li>
|
||||
{{/each}}
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ Parameters:
|
|||
- isGlassy {boolean} : If true, applies the 'glassy' class to the fieldset.
|
||||
- cardView {boolean} : If true and type is 'domainCard', renders using domain card layout.
|
||||
- isActor {boolean} : Passed through to inventory-item partials.
|
||||
- isItem {boolean} : Passed through to inventory-item partials
|
||||
- actorType {boolean} : The actor type of the parent actor
|
||||
- canCreate {boolean} : If true, show createDoc anchor on legend
|
||||
- inVault {boolean} : If true, the domainCard is created with inVault=true
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
Parameters:
|
||||
- type {string} : The type of items in the list
|
||||
- isActor {boolean} : Passed through to inventory-item partials.
|
||||
- isItem {boolean} : Passed through to inventory-item partials
|
||||
- actorType {boolean} : The actor type of the parent actor
|
||||
- categoryAdversary {string} : Category adversary id.
|
||||
- noExtensible {boolean} : If true, the inventory-item-content would be collapsable/extendible else it always be showed
|
||||
|
|
@ -18,7 +19,7 @@ Parameters:
|
|||
|
||||
<li class="inventory-item" data-item-id="{{item.id}}" {{#if (or (eq type 'action' ) (eq type 'attack' ))}}
|
||||
data-action-id="{{item.id}}" {{/if}} data-item-uuid="{{item.uuid}}" data-type="{{type}}" data-no-compendium-edit="{{noCompendiumEdit}}" draggable="true">
|
||||
<div class="inventory-item-header {{#if (eq actorType 'party')}}padded{{/if}}" {{#unless noExtensible}}data-action="toggleExtended" {{/unless}}>
|
||||
<div class="inventory-item-header {{#if hideContextMenu}}padded{{/if}}" {{#unless noExtensible}}data-action="toggleExtended" {{/unless}}>
|
||||
{{!-- Image --}}
|
||||
<div class="img-portait" data-action='{{ifThen (or (hasProperty item "use") (eq type "attack")) "useItem" (ifThen
|
||||
(hasProperty item "toChat" ) "toChat" "editDoc" ) }}' {{#unless hideTooltip}} {{#if (eq type 'attack' )}}
|
||||
|
|
@ -67,7 +68,7 @@ Parameters:
|
|||
{{!-- Controls --}}
|
||||
{{#unless hideControls}}
|
||||
<div class="controls">
|
||||
{{#if isActor}}
|
||||
{{#if isActor}}
|
||||
<a data-action="editDoc" data-tooltip="DAGGERHEART.UI.Tooltip.openActorWorld">
|
||||
<i class="fa-solid fa-globe"></i>
|
||||
</a>
|
||||
|
|
@ -81,7 +82,7 @@ Parameters:
|
|||
<i class='fas fa-trash'></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
{{else}}
|
||||
{{#unless (eq actorType 'party')}}
|
||||
{{#if (eq type 'weapon')}}
|
||||
<a class="{{#unless item.system.equipped}}unequipped{{/unless}}" data-action="toggleEquipItem"
|
||||
|
|
@ -94,27 +95,30 @@ Parameters:
|
|||
<i class="fa-solid fa-shield"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
{{#if (eq type 'domainCard')}}
|
||||
<a data-action="toggleVault"
|
||||
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.inVault 'sendToLoadout' 'sendToVault' }}">
|
||||
<i class="fa-solid {{ifThen item.system.inVault 'fa-arrow-up' 'fa-arrow-down'}}"></i>
|
||||
</a>
|
||||
{{else if (eq type 'effect')}}
|
||||
<a data-action="toggleEffect"
|
||||
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.disabled 'enableEffect' 'disableEffect' }}">
|
||||
<i class="{{ifThen item.disabled 'fa-solid fa-toggle-off' 'fa-solid fa-toggle-on'}}"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
{{#if (hasProperty item "toChat")}}
|
||||
<a data-action="toChat" data-tooltip="DAGGERHEART.UI.Tooltip.sendToChat">
|
||||
<i class="fa-regular fa-message"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
{{else}}
|
||||
<a data-action="editDoc" data-tooltip="DAGGERHEART.UI.Tooltip.openActorWorld">
|
||||
<i class="fa-solid fa-globe"></i>
|
||||
</a>
|
||||
<a data-action="deleteItem" data-tooltip="DAGGERHEART.UI.Tooltip.deleteItem">
|
||||
<i class="fa-solid fa-trash"></i>
|
||||
</a>
|
||||
{{/unless}}
|
||||
{{#if (eq type 'domainCard')}}
|
||||
<a data-action="toggleVault"
|
||||
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.system.inVault 'sendToLoadout' 'sendToVault' }}">
|
||||
<i class="fa-solid {{ifThen item.system.inVault 'fa-arrow-up' 'fa-arrow-down'}}"></i>
|
||||
</a>
|
||||
{{else if (eq type 'effect')}}
|
||||
<a data-action="toggleEffect"
|
||||
data-tooltip="DAGGERHEART.UI.Tooltip.{{ifThen item.disabled 'enableEffect' 'disableEffect' }}">
|
||||
<i class="{{ifThen item.disabled 'fa-solid fa-toggle-off' 'fa-solid fa-toggle-on'}}"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
{{#if (and (hasProperty item "toChat") (not (eq actorType 'party')))}}
|
||||
<a data-action="toChat" data-tooltip="DAGGERHEART.UI.Tooltip.sendToChat">
|
||||
<i class="fa-regular fa-message"></i>
|
||||
</a>
|
||||
{{/if}}
|
||||
{{#unless hideContextMenu}}
|
||||
<a data-action="triggerContextMenu" data-tooltip="DAGGERHEART.UI.Tooltip.moreOptions">
|
||||
<i class="fa-solid fa-ellipsis-vertical"></i>
|
||||
|
|
@ -122,7 +126,7 @@ Parameters:
|
|||
{{/unless}}
|
||||
{{/if}}
|
||||
</div>
|
||||
{{/unless}}
|
||||
{{/unless}}
|
||||
</div>
|
||||
<div class="inventory-item-content{{#unless noExtensible}} extensible{{/unless}}">
|
||||
{{!-- Description --}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue