mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Merge fae7efd023 into 0b343c9f52
This commit is contained in:
commit
54b0cda45a
20 changed files with 647 additions and 155 deletions
|
|
@ -8,8 +8,9 @@ import * as fields from './module/data/fields/_module.mjs';
|
|||
import RegisterHandlebarsHelpers from './module/helpers/handlebarsHelper.mjs';
|
||||
import { enricherConfig, enricherRenderSetup } from './module/enrichers/_module.mjs';
|
||||
import { getCommandTarget, rollCommandToJSON } from './module/helpers/utils.mjs';
|
||||
import { BaseRoll, DHRoll, DualityRoll, D20Roll, DamageRoll } from './module/dice/_module.mjs';
|
||||
import { BaseRoll, DHRoll, DualityRoll, D20Roll, DamageRoll, FateRoll } from './module/dice/_module.mjs';
|
||||
import { enrichedDualityRoll } from './module/enrichers/DualityRollEnricher.mjs';
|
||||
import { enrichedFateRoll, getFateType } from './module/enrichers/FateRollEnricher.mjs';
|
||||
import {
|
||||
handlebarsRegistration,
|
||||
runMigrations,
|
||||
|
|
@ -23,12 +24,13 @@ import TemplateManager from './module/documents/templateManager.mjs';
|
|||
CONFIG.DH = SYSTEM;
|
||||
CONFIG.TextEditor.enrichers.push(...enricherConfig);
|
||||
|
||||
CONFIG.Dice.rolls = [BaseRoll, DHRoll, DualityRoll, D20Roll, DamageRoll];
|
||||
CONFIG.Dice.rolls = [BaseRoll, DHRoll, DualityRoll, D20Roll, DamageRoll, FateRoll];
|
||||
CONFIG.Dice.daggerheart = {
|
||||
DHRoll: DHRoll,
|
||||
DualityRoll: DualityRoll,
|
||||
D20Roll: D20Roll,
|
||||
DamageRoll: DamageRoll
|
||||
DamageRoll: DamageRoll,
|
||||
FateRoll: FateRoll
|
||||
};
|
||||
|
||||
CONFIG.Actor.documentClass = documents.DhpActor;
|
||||
|
|
@ -308,6 +310,38 @@ Hooks.on('chatMessage', (_, message) => {
|
|||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (message.startsWith('/fr')) {
|
||||
const result =
|
||||
message.trim().toLowerCase() === '/fr' ? { result: {} } : rollCommandToJSON(message.replace(/\/fr\s?/, ''));
|
||||
if (!result) {
|
||||
ui.notifications.error(game.i18n.localize('DAGGERHEART.UI.Notifications.fateParsing'));
|
||||
return false;
|
||||
}
|
||||
|
||||
const { result: rollCommand, flavor } = result;
|
||||
|
||||
const fateTypeFromRollCommand = getFateType(rollCommand?.type);
|
||||
|
||||
if (fateTypeFromRollCommand == "BAD") {
|
||||
ui.notifications.error(game.i18n.localize('DAGGERHEART.UI.Notifications.fateTypeParsing'));
|
||||
return false;
|
||||
}
|
||||
|
||||
const fateType = fateTypeFromRollCommand;
|
||||
|
||||
const target = getCommandTarget({ allowNull: true });
|
||||
const title = fateType + ' Fate Roll';
|
||||
|
||||
enrichedFateRoll({
|
||||
target,
|
||||
title,
|
||||
label: 'test',
|
||||
fateType
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
const updateActorsRangeDependentEffects = async token => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue