mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-03-08 06:56:12 +01:00
Fox conflicts
This commit is contained in:
commit
3b3de19384
35 changed files with 724 additions and 1254 deletions
|
|
@ -4,12 +4,23 @@ import DamageReductionDialog from '../applications/dialogs/damageReductionDialog
|
|||
import { LevelOptionType } from '../data/levelTier.mjs';
|
||||
import DHFeature from '../data/item/feature.mjs';
|
||||
|
||||
<<<<<<< HEAD
|
||||
export default class DhpActor extends Actor {
|
||||
// Return the first active player with the ownership
|
||||
get owner() {
|
||||
const user = this.hasPlayerOwner && game.users?.players.find(p => p.active && this.ownership[p.id ?? ""] === CONST.DOCUMENT_OWNERSHIP_LEVELS.OWNER);
|
||||
if(!user) return game.user.isGM ? game.user : null;
|
||||
return user;
|
||||
=======
|
||||
export default class DhpActor extends foundry.documents.Actor {
|
||||
|
||||
/**
|
||||
* Whether this actor is an NPC.
|
||||
* @returns {boolean}
|
||||
*/
|
||||
get isNPC() {
|
||||
return this.system.metadata.isNPC;
|
||||
>>>>>>> main
|
||||
}
|
||||
|
||||
async _preCreate(data, options, user) {
|
||||
|
|
@ -358,16 +369,16 @@ export default class DhpActor extends Actor {
|
|||
const modifier = roll.modifier !== null ? Number.parseInt(roll.modifier) : null;
|
||||
return modifier !== null
|
||||
? [
|
||||
{
|
||||
value: modifier,
|
||||
label: roll.label
|
||||
? modifier >= 0
|
||||
? `${roll.label} +${modifier}`
|
||||
: `${roll.label} ${modifier}`
|
||||
: null,
|
||||
title: roll.label
|
||||
}
|
||||
]
|
||||
{
|
||||
value: modifier,
|
||||
label: roll.label
|
||||
? modifier >= 0
|
||||
? `${roll.label} +${modifier}`
|
||||
: `${roll.label} ${modifier}`
|
||||
: null,
|
||||
title: roll.label
|
||||
}
|
||||
]
|
||||
: [];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ export default class DHItem extends foundry.documents.Item {
|
|||
* @returns {boolean} Returns `true` if the item is an inventory item.
|
||||
*/
|
||||
get isInventoryItem() {
|
||||
return this.system.constructor.metadata.isInventoryItem ?? false;
|
||||
return this.system.metadata.isInventoryItem ?? false;
|
||||
}
|
||||
|
||||
/** @inheritdoc */
|
||||
|
|
@ -53,17 +53,17 @@ export default class DHItem extends foundry.documents.Item {
|
|||
const isInventoryItem = CONFIG.Item.dataModels[type]?.metadata?.isInventoryItem;
|
||||
const group =
|
||||
isInventoryItem === true
|
||||
? 'Inventory Items'
|
||||
? 'Inventory Items' //TODO localize
|
||||
: isInventoryItem === false
|
||||
? 'Character Items'
|
||||
: 'Other';
|
||||
? 'Character Items' //TODO localize
|
||||
: 'Other'; //TODO localize
|
||||
|
||||
return { value: type, label, group };
|
||||
}
|
||||
);
|
||||
|
||||
if (!documentTypes.length) {
|
||||
throw new Error('No document types were permitted to be created.');
|
||||
throw new Error('No document types were permitted to be created.'); //TODO localize
|
||||
}
|
||||
|
||||
const sortedTypes = documentTypes.sort((a, b) => a.label.localeCompare(b.label, game.i18n.lang));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue