New source found from dndbeyond.com

This commit is contained in:
2025-07-09 01:00:11 -07:00
parent b7f7f4a655
commit 151590af7a
18 changed files with 150 additions and 45 deletions
@@ -124,7 +124,7 @@ export function generateVehicleMeta(vehicle, ruleData) {
}
let type = VehicleAccessors.getType(vehicle);
let typeName = type === null ? '' : RuleDataUtils.getObjectTypeName(type, ruleData);
typeName = typeName ? typeName.toLowerCase() : '';
typeName = typeName || '';
let primaryText = `${size} ${typeName}`.trim();
let movementTypesText = VehicleAccessors.getMovementNames(vehicle).join(', ');
metaText.push(`${primaryText}${movementTypesText ? ` (${movementTypesText})` : ''}`.trim());
@@ -109,12 +109,15 @@ export function stripTooltipTags(str, fallback = '') {
* Formats the specified number as a distance with the appropriate unit
* @param distance The distance measured in feet to format
*/
export function renderDistance(distance) {
export function renderDistance(distance, useMph) {
let displayNumber = distance;
let label = 'ft.';
if (distance !== 0 && distance % FEET_IN_MILES === 0) {
displayNumber = CoreUtils.convertFeetToMiles(distance);
label = `mile${Math.abs(displayNumber) === 1 ? '' : 's'}`;
if (useMph) {
label = `mph`;
}
}
return `${displayNumber} ${label}`;
}
@@ -25,6 +25,7 @@ export var VehicleConfigurationDisplayTypeEnum;
VehicleConfigurationDisplayTypeEnum["SHIP"] = "ship";
VehicleConfigurationDisplayTypeEnum["INFERNAL_WAR_MACHINE"] = "infernal-war-machine";
VehicleConfigurationDisplayTypeEnum["SPELLJAMMER"] = "spelljammer";
VehicleConfigurationDisplayTypeEnum["ELEMENTAL_AIRSHIP"] = "elemental-airship";
})(VehicleConfigurationDisplayTypeEnum || (VehicleConfigurationDisplayTypeEnum = {}));
export var VehicleConfigurationPrimaryComponentManageTypeEnum;
(function (VehicleConfigurationPrimaryComponentManageTypeEnum) {
@@ -2,7 +2,6 @@ export var ComponentAdjustmentEnum;
(function (ComponentAdjustmentEnum) {
ComponentAdjustmentEnum["HIT_POINT_SPEED_ADJUSTMENT"] = "speed";
})(ComponentAdjustmentEnum || (ComponentAdjustmentEnum = {}));
//TODO new for spelljammers
export var ComponentCostTypeEnum;
(function (ComponentCostTypeEnum) {
ComponentCostTypeEnum["COMPONENT"] = "component";