New source found from dndbeyond.com

This commit is contained in:
2026-07-08 01:00:09 -07:00
parent 9a983a6d7b
commit dcefa0d2f2
2865 changed files with 222467 additions and 49053 deletions
@@ -2,6 +2,7 @@ import { isFinite, toNumber } from 'lodash';
import { TypeScriptUtils } from '../../utils';
import { AbilityAccessors } from '../Ability';
import { CharacterDerivers } from '../Character';
import { SpeedMovementKeyEnum } from '../Core';
import { DiceRenderers } from '../Dice';
import { FormatUtils } from '../Format';
import { LimitedUseDerivers } from '../LimitedUse';
@@ -90,6 +91,7 @@ export function isSnippetPostProcessTypeEnum(key) {
*/
export function isSnippetTagValueTypeEnum(key) {
switch (key) {
case SnippetTagValueTypeEnum.SPEED:
case SnippetTagValueTypeEnum.SCALE_VALUE:
case SnippetTagValueTypeEnum.LIMITED_USE:
case SnippetTagValueTypeEnum.CLASS_LEVEL:
@@ -107,6 +109,23 @@ export function isSnippetTagValueTypeEnum(key) {
}
return false;
}
/**
*
* @param type
*/
export function isSnippetSpeedMovementKeyEnum(key) {
switch (key) {
case SpeedMovementKeyEnum.WALK:
case SpeedMovementKeyEnum.FLY:
case SpeedMovementKeyEnum.BURROW:
case SpeedMovementKeyEnum.SWIM:
case SpeedMovementKeyEnum.CLIMB:
return true;
default:
// not implemented
}
return false;
}
/**
*
* @param type
@@ -207,6 +226,7 @@ export function throwInvalidSnippetCharacters(str) {
keywordMatches === null || keywordMatches === void 0 ? void 0 : keywordMatches.forEach((keyword) => {
if (isSnippetTagValueTypeEnum(keyword) ||
isSnippetAbilityKeyEnum(keyword) ||
isSnippetSpeedMovementKeyEnum(keyword) ||
isSnippetValueModifierTypeEnum(keyword) ||
isSnippetPostProcessTypeEnum(keyword)) {
return;
@@ -323,9 +343,21 @@ export function deriveStringTagValue(tagValue, contextData) {
* @param proficiencyBonus
*/
export function deriveNumericTagValue(tagValue, contextData, snippetData, proficiencyBonus) {
var _a;
const { type, params } = tagValue;
let value = 0;
switch (type) {
case SnippetTagValueTypeEnum.SPEED: {
const movementType = (_a = params[0]) !== null && _a !== void 0 ? _a : SpeedMovementKeyEnum.WALK;
if (!isSnippetSpeedMovementKeyEnum(movementType)) {
throw new Error(`Invalid speed type: ${movementType}`);
}
const speed = snippetData.speedInfo[movementType];
if (speed === null) {
throw new Error(`No speed data available for ${movementType}`);
}
return speed;
}
case SnippetTagValueTypeEnum.SAVE_DC:
if (params.length < 1) {
throw new Error('Save DC missing ability key');