mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-25 08:53:39 +02:00
Compare commits
No commits in common. "70e21f34db33f884d315af0c2729d17723f2b44f" and "01619ef0672ef913f41af05f81b25d49d8131309" have entirely different histories.
70e21f34db
...
01619ef067
11 changed files with 21 additions and 79 deletions
|
|
@ -44,8 +44,7 @@ export default class ArmorChange extends foundry.abstract.DataModel {
|
||||||
label: 'Armor',
|
label: 'Armor',
|
||||||
defaultPriority: 20,
|
defaultPriority: 20,
|
||||||
handler: (actor, change, _options, _field, replacementData) => {
|
handler: (actor, change, _options, _field, replacementData) => {
|
||||||
const baseParsedMax = itemAbleRollParse(change.value.max, actor, change.effect.parent);
|
const parsedMax = itemAbleRollParse(change.value.max, actor, change.effect.parent);
|
||||||
const parsedMax = new Roll(baseParsedMax).evaluateSync().total;
|
|
||||||
game.system.api.documents.DhActiveEffect.applyChange(
|
game.system.api.documents.DhActiveEffect.applyChange(
|
||||||
actor,
|
actor,
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -256,7 +256,7 @@ export default class DHRoll extends Roll {
|
||||||
if (!roll.terms[i].isDeterministic) continue;
|
if (!roll.terms[i].isDeterministic) continue;
|
||||||
const termTotal = roll.terms[i].total;
|
const termTotal = roll.terms[i].total;
|
||||||
if (typeof termTotal === 'number') {
|
if (typeof termTotal === 'number') {
|
||||||
const multiplier = roll.terms[i - 1]?.operator === ' - ' ? -1 : 1;
|
const multiplier = roll.terms[i - 1]?.operator === " - " ? -1 : 1;
|
||||||
modifierTotal += multiplier * termTotal;
|
modifierTotal += multiplier * termTotal;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -272,7 +272,7 @@ export default class DHRoll extends Roll {
|
||||||
const changeKeys = this.getActionChangeKeys();
|
const changeKeys = this.getActionChangeKeys();
|
||||||
return (
|
return (
|
||||||
this.options.effects?.reduce((acc, effect) => {
|
this.options.effects?.reduce((acc, effect) => {
|
||||||
if (effect.system.changes.some(x => changeKeys.some(key => x.key?.includes(key)))) {
|
if (effect.system.changes.some(x => changeKeys.some(key => x.key.includes(key)))) {
|
||||||
acc[effect.id] = {
|
acc[effect.id] = {
|
||||||
id: effect.id,
|
id: effect.id,
|
||||||
name: effect.name,
|
name: effect.name,
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,9 @@
|
||||||
import DualityDie from './dualityDie.mjs';
|
import DualityDie from './dualityDie.mjs';
|
||||||
import HopeDie from './hopeDie.mjs';
|
|
||||||
import FearDie from './fearDie.mjs';
|
|
||||||
import AdvantageDie from './advantageDie.mjs';
|
import AdvantageDie from './advantageDie.mjs';
|
||||||
import DisadvantageDie from './disadvantageDie.mjs';
|
import DisadvantageDie from './disadvantageDie.mjs';
|
||||||
|
|
||||||
export const diceTypes = {
|
export const diceTypes = {
|
||||||
DualityDie,
|
DualityDie,
|
||||||
HopeDie,
|
|
||||||
FearDie,
|
|
||||||
AdvantageDie,
|
AdvantageDie,
|
||||||
DisadvantageDie
|
DisadvantageDie
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -43,10 +43,9 @@ export default class DualityDie extends foundry.dice.terms.Die {
|
||||||
options: { appearance: {} }
|
options: { appearance: {} }
|
||||||
};
|
};
|
||||||
|
|
||||||
const diceAppearance = await this.getDiceSoNiceAppearance(options.liveRoll.roll);
|
const preset = await getDiceSoNicePreset(diceSoNice[key], faces);
|
||||||
diceSoNiceRoll.dice[0].options.appearance = diceAppearance.appearance;
|
diceSoNiceRoll.dice[0].options.appearance = preset.appearance;
|
||||||
diceSoNiceRoll.dice[0].options.modelFile = diceAppearance.modelFile;
|
diceSoNiceRoll.dice[0].options.modelFile = preset.modelFile;
|
||||||
diceSoNiceRoll.dice[0].results = diceSoNiceRoll.dice[0].results.filter(x => x.active);
|
|
||||||
|
|
||||||
await game.dice3d.showForRoll(diceSoNiceRoll, game.user, true);
|
await game.dice3d.showForRoll(diceSoNiceRoll, game.user, true);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -60,11 +59,4 @@ export default class DualityDie extends foundry.dice.terms.Die {
|
||||||
this.#updateResources(oldDuality, newDuality, options.liveRoll.actor);
|
this.#updateResources(oldDuality, newDuality, options.liveRoll.actor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Overridden by extending classes HopeDie and FearDie
|
|
||||||
*/
|
|
||||||
async getDiceSoNiceAppearance() {
|
|
||||||
return {};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
import { getDiceSoNicePresets } from '../../config/generalConfig.mjs';
|
|
||||||
import DualityDie from './dualityDie.mjs';
|
|
||||||
|
|
||||||
export default class FearDie extends DualityDie {
|
|
||||||
async getDiceSoNiceAppearance(roll) {
|
|
||||||
const { fear } = await getDiceSoNicePresets(roll, this.denomination, this.denomination);
|
|
||||||
return fear;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
import { getDiceSoNicePresets } from '../../config/generalConfig.mjs';
|
|
||||||
import DualityDie from './dualityDie.mjs';
|
|
||||||
|
|
||||||
export default class HopeDie extends DualityDie {
|
|
||||||
async getDiceSoNiceAppearance(roll) {
|
|
||||||
const { hope } = await getDiceSoNicePresets(roll, this.denomination, this.denomination);
|
|
||||||
return hope;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -24,7 +24,7 @@ export default class DualityRoll extends D20Roll {
|
||||||
}
|
}
|
||||||
|
|
||||||
get dHope() {
|
get dHope() {
|
||||||
if (!(this.dice[0] instanceof game.system.api.dice.diceTypes.HopeDie)) this.createBaseDice();
|
if (!(this.dice[0] instanceof game.system.api.dice.diceTypes.DualityDie)) this.createBaseDice();
|
||||||
return this.dice[0];
|
return this.dice[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -34,7 +34,7 @@ export default class DualityRoll extends D20Roll {
|
||||||
}
|
}
|
||||||
|
|
||||||
get dFear() {
|
get dFear() {
|
||||||
if (!(this.dice[1] instanceof game.system.api.dice.diceTypes.FearDie)) this.createBaseDice();
|
if (!(this.dice[1] instanceof game.system.api.dice.diceTypes.DualityDie)) this.createBaseDice();
|
||||||
return this.dice[1];
|
return this.dice[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -68,8 +68,8 @@ export default class DualityRoll extends D20Roll {
|
||||||
}
|
}
|
||||||
|
|
||||||
get extraDice() {
|
get extraDice() {
|
||||||
const { HopeDie, FearDie, AdvantageDie, DisadvantageDie } = game.system.api.dice.diceTypes;
|
const { DualityDie, AdvantageDie, DisadvantageDie } = game.system.api.dice.diceTypes;
|
||||||
return this.dice.filter(x => ![HopeDie, FearDie, AdvantageDie, DisadvantageDie].some(die => x instanceof die));
|
return this.dice.filter(x => ![DualityDie, AdvantageDie, DisadvantageDie].some(die => x instanceof die));
|
||||||
}
|
}
|
||||||
|
|
||||||
setRallyChoices() {
|
setRallyChoices() {
|
||||||
|
|
@ -125,8 +125,8 @@ export default class DualityRoll extends D20Roll {
|
||||||
|
|
||||||
/** @inheritDoc */
|
/** @inheritDoc */
|
||||||
static fromData(data) {
|
static fromData(data) {
|
||||||
data.terms[0].class = 'HopeDie';
|
data.terms[0].class = 'DualityDie';
|
||||||
data.terms[2].class = 'FearDie';
|
data.terms[2].class = 'DualityDie';
|
||||||
if (data.options.roll.advantage?.type && data.terms[4]?.faces) {
|
if (data.options.roll.advantage?.type && data.terms[4]?.faces) {
|
||||||
data.terms[4].class = data.options.roll.advantage.type === 1 ? 'AdvantageDie' : 'DisadvantageDie';
|
data.terms[4].class = data.options.roll.advantage.type === 1 ? 'AdvantageDie' : 'DisadvantageDie';
|
||||||
}
|
}
|
||||||
|
|
@ -135,18 +135,18 @@ export default class DualityRoll extends D20Roll {
|
||||||
|
|
||||||
createBaseDice() {
|
createBaseDice() {
|
||||||
if (
|
if (
|
||||||
this.dice[0] instanceof game.system.api.dice.diceTypes.HopeDie &&
|
this.dice[0] instanceof game.system.api.dice.diceTypes.DualityDie &&
|
||||||
this.dice[1] instanceof game.system.api.dice.diceTypes.FearDie
|
this.dice[1] instanceof game.system.api.dice.diceTypes.DualityDie
|
||||||
) {
|
) {
|
||||||
this.terms = [this.terms[0], this.terms[1], this.terms[2]];
|
this.terms = [this.terms[0], this.terms[1], this.terms[2]];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.terms[0] = new game.system.api.dice.diceTypes.HopeDie({
|
this.terms[0] = new game.system.api.dice.diceTypes.DualityDie({
|
||||||
faces: this.data.rules.dualityRoll?.defaultHopeDice ?? 12
|
faces: this.data.rules.dualityRoll?.defaultHopeDice ?? 12
|
||||||
});
|
});
|
||||||
this.terms[1] = new foundry.dice.terms.OperatorTerm({ operator: '+' });
|
this.terms[1] = new foundry.dice.terms.OperatorTerm({ operator: '+' });
|
||||||
this.terms[2] = new game.system.api.dice.diceTypes.FearDie({
|
this.terms[2] = new game.system.api.dice.diceTypes.DualityDie({
|
||||||
faces: this.data.rules.dualityRoll?.defaultFearDice ?? 12
|
faces: this.data.rules.dualityRoll?.defaultFearDice ?? 12
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
.application.daggerheart {
|
.application.daggerheart {
|
||||||
prose-mirror {
|
prose-mirror {
|
||||||
height: 100% !important;
|
height: 100% !important;
|
||||||
width: 100%;
|
|
||||||
|
|
||||||
.editor-menu {
|
.editor-menu {
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
|
|
|
||||||
|
|
@ -155,26 +155,6 @@ body.game:is(.performance-low, .noblur) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.stat-section {
|
|
||||||
position: relative;
|
|
||||||
display: flex;
|
|
||||||
gap: 10px;
|
|
||||||
background-color: light-dark(transparent, @dark-blue);
|
|
||||||
color: light-dark(@dark-blue, @golden);
|
|
||||||
padding: 5px 10px;
|
|
||||||
border: 1px solid light-dark(@dark-blue, @golden);
|
|
||||||
border-radius: 3px;
|
|
||||||
align-items: center;
|
|
||||||
width: fit-content;
|
|
||||||
|
|
||||||
h4 {
|
|
||||||
font-size: var(--font-size-12);
|
|
||||||
font-weight: bold;
|
|
||||||
text-transform: uppercase;
|
|
||||||
color: light-dark(@dark-blue, @golden);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.threshold-section {
|
.threshold-section {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-self: center;
|
align-self: center;
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
"id": "daggerheart",
|
"id": "daggerheart",
|
||||||
"title": "Daggerheart",
|
"title": "Daggerheart",
|
||||||
"description": "An unofficial implementation of the Daggerheart system",
|
"description": "An unofficial implementation of the Daggerheart system",
|
||||||
"version": "2.0.3",
|
"version": "2.0.1",
|
||||||
"compatibility": {
|
"compatibility": {
|
||||||
"minimum": "14.359",
|
"minimum": "14.359",
|
||||||
"verified": "14.359",
|
"verified": "14.359",
|
||||||
|
|
@ -297,7 +297,7 @@
|
||||||
"background": "systems/daggerheart/assets/logos/FoundrybornBackgroundLogo.png",
|
"background": "systems/daggerheart/assets/logos/FoundrybornBackgroundLogo.png",
|
||||||
"primaryTokenAttribute": "resources.hitPoints",
|
"primaryTokenAttribute": "resources.hitPoints",
|
||||||
"secondaryTokenAttribute": "resources.stress",
|
"secondaryTokenAttribute": "resources.stress",
|
||||||
"url": "https://github.com/Foundryborne/daggerheart",
|
"url": "https://your/hosted/system/repo/",
|
||||||
"manifest": "https://raw.githubusercontent.com/Foundryborne/daggerheart/main/system.json",
|
"manifest": "https://your/hosted/system/repo/system.json",
|
||||||
"download": "https://github.com/Foundryborne/daggerheart/releases/download/2.0.3/system.zip"
|
"download": "https://your/packaged/download/archive.zip"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -87,12 +87,6 @@
|
||||||
</div>
|
</div>
|
||||||
{{/unless}}
|
{{/unless}}
|
||||||
|
|
||||||
{{#if (eq actor.type 'character')}}
|
|
||||||
<div class="stat-section">
|
|
||||||
<h4>{{localize "DAGGERHEART.GENERAL.evasion"}}: {{actor.system.evasion}}</h4>
|
|
||||||
</div>
|
|
||||||
{{/if}}
|
|
||||||
|
|
||||||
{{#unless (eq actor.type 'companion')}}
|
{{#unless (eq actor.type 'companion')}}
|
||||||
<div class="threshold-section">
|
<div class="threshold-section">
|
||||||
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.minor"}}</h4>
|
<h4 class="threshold-label">{{localize "DAGGERHEART.GENERAL.DamageThresholds.minor"}}</h4>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue