Began adding save-for-half to damage props

This commit is contained in:
Stefan Zermatten
2023-08-24 15:16:48 +02:00
parent cc3913db1d
commit 9537eaa3e6

View File

@@ -2,6 +2,7 @@ import SimpleSchema from 'simpl-schema';
import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema.js';
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS.js';
import VARIABLE_NAME_REGEX from '/imports/constants/VARIABLE_NAME_REGEX.js';
import { SavingThrowSchema, ComputedOnlySavingThrowSchema } from '/imports/api/properties/SavingThrows.js';
const DamageSchema = createPropertySchema({
// The roll that determines how much to damage the attribute
@@ -32,6 +33,15 @@ const DamageSchema = createPropertySchema({
type: Boolean,
optional: true,
},
save: {
type: SavingThrowSchema,
optional: true,
},
'save.damageFunction': {
type: 'fieldToCompute',
optional: true,
parseLevel: 'compile',
},
});
const ComputedOnlyDamageSchema = createPropertySchema({
@@ -40,6 +50,15 @@ const ComputedOnlyDamageSchema = createPropertySchema({
optional: true,
parseLevel: 'compile',
},
save: {
type: ComputedOnlySavingThrowSchema,
optional: true,
},
'save.damageFunction': {
type: 'computedOnlyField',
optional: true,
parseLevel: 'compile',
},
});
const ComputedDamageSchema = new SimpleSchema()