Began adding creature templates to libraries
This commit is contained in:
40
app/imports/api/properties/CreatureTemplates.ts
Normal file
40
app/imports/api/properties/CreatureTemplates.ts
Normal file
@@ -0,0 +1,40 @@
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import STORAGE_LIMITS from '/imports/constants/STORAGE_LIMITS';
|
||||
import createPropertySchema from '/imports/api/properties/subSchemas/createPropertySchema';
|
||||
|
||||
// Creature templates represent creatures that don't yet exist
|
||||
// Used to store creatures in the library, or as templates for another creature to summon
|
||||
const CreatureTemplateSchema = createPropertySchema({
|
||||
name: {
|
||||
type: String,
|
||||
max: STORAGE_LIMITS.name,
|
||||
optional: true,
|
||||
},
|
||||
description: {
|
||||
type: 'inlineCalculationFieldToCompute',
|
||||
optional: true,
|
||||
},
|
||||
picture: {
|
||||
type: String,
|
||||
optional: true,
|
||||
max: STORAGE_LIMITS.url,
|
||||
},
|
||||
avatarPicture: {
|
||||
type: String,
|
||||
optional: true,
|
||||
max: STORAGE_LIMITS.url,
|
||||
},
|
||||
});
|
||||
|
||||
const ComputedOnlyCreatureTemplateSchema = createPropertySchema({
|
||||
description: {
|
||||
type: 'computedOnlyInlineCalculationField',
|
||||
optional: true,
|
||||
},
|
||||
});
|
||||
|
||||
const ComputedCreatureTemplateSchema = new SimpleSchema({})
|
||||
.extend(CreatureTemplateSchema)
|
||||
.extend(ComputedOnlyCreatureTemplateSchema);
|
||||
|
||||
export { CreatureTemplateSchema, ComputedCreatureTemplateSchema, ComputedOnlyCreatureTemplateSchema };
|
||||
@@ -2,15 +2,16 @@ import SimpleSchema from 'simpl-schema';
|
||||
import { ComputedOnlyActionSchema } from '/imports/api/properties/Actions';
|
||||
import { ComputedOnlyAdjustmentSchema } from '/imports/api/properties/Adjustments';
|
||||
import { ComputedOnlyAttributeSchema } from '/imports/api/properties/Attributes';
|
||||
import { ComputedOnlyBuffSchema } from '/imports/api/properties/Buffs';
|
||||
import { ComputedOnlyBuffRemoverSchema } from '/imports/api/properties/BuffRemovers';
|
||||
import { ComputedOnlyBranchSchema } from '/imports/api/properties/Branches';
|
||||
import { ComputedOnlyClassSchema } from '/imports/api/properties/Classes';
|
||||
import { ComputedOnlyBuffRemoverSchema } from '/imports/api/properties/BuffRemovers';
|
||||
import { ComputedOnlyBuffSchema } from '/imports/api/properties/Buffs';
|
||||
import { ComputedOnlyClassLevelSchema } from '/imports/api/properties/ClassLevels';
|
||||
import { ComputedOnlyClassSchema } from '/imports/api/properties/Classes';
|
||||
import { ComputedOnlyConstantSchema } from '/imports/api/properties/Constants';
|
||||
import { ComputedOnlyContainerSchema } from '/imports/api/properties/Containers';
|
||||
import { ComputedOnlyDamageSchema } from '/imports/api/properties/Damages';
|
||||
import { ComputedOnlyCreatureTemplateSchema } from '/imports/api/properties/CreatureTemplates';
|
||||
import { ComputedOnlyDamageMultiplierSchema } from '/imports/api/properties/DamageMultipliers';
|
||||
import { ComputedOnlyDamageSchema } from '/imports/api/properties/Damages';
|
||||
import { ComputedOnlyEffectSchema } from '/imports/api/properties/Effects';
|
||||
import { ComputedOnlyFeatureSchema } from '/imports/api/properties/Features';
|
||||
import { ComputedOnlyFolderSchema } from '/imports/api/properties/Folders';
|
||||
@@ -23,8 +24,8 @@ import { ComputedOnlyRollSchema } from '/imports/api/properties/Rolls';
|
||||
import { ComputedOnlySavingThrowSchema } from '/imports/api/properties/SavingThrows';
|
||||
import { ComputedOnlySkillSchema } from '/imports/api/properties/Skills';
|
||||
import { ComputedOnlySlotSchema } from '/imports/api/properties/Slots';
|
||||
import { ComputedOnlySpellSchema } from '/imports/api/properties/Spells';
|
||||
import { ComputedOnlySpellListSchema } from '/imports/api/properties/SpellLists';
|
||||
import { ComputedOnlySpellSchema } from '/imports/api/properties/Spells';
|
||||
import { ComputedOnlyToggleSchema } from '/imports/api/properties/Toggles';
|
||||
import { ComputedOnlyTriggerSchema } from '/imports/api/properties/Triggers';
|
||||
|
||||
@@ -32,13 +33,14 @@ const propertySchemasIndex = {
|
||||
action: ComputedOnlyActionSchema,
|
||||
adjustment: ComputedOnlyAdjustmentSchema,
|
||||
attribute: ComputedOnlyAttributeSchema,
|
||||
branch: ComputedOnlyBranchSchema,
|
||||
buff: ComputedOnlyBuffSchema,
|
||||
buffRemover: ComputedOnlyBuffRemoverSchema,
|
||||
branch: ComputedOnlyBranchSchema,
|
||||
class: ComputedOnlyClassSchema,
|
||||
classLevel: ComputedOnlyClassLevelSchema,
|
||||
constant: ComputedOnlyConstantSchema,
|
||||
container: ComputedOnlyContainerSchema,
|
||||
creature: ComputedOnlyCreatureTemplateSchema,
|
||||
damage: ComputedOnlyDamageSchema,
|
||||
damageMultiplier: ComputedOnlyDamageMultiplierSchema,
|
||||
effect: ComputedOnlyEffectSchema,
|
||||
@@ -53,8 +55,8 @@ const propertySchemasIndex = {
|
||||
roll: ComputedOnlyRollSchema,
|
||||
savingThrow: ComputedOnlySavingThrowSchema,
|
||||
skill: ComputedOnlySkillSchema,
|
||||
spellList: ComputedOnlySpellListSchema,
|
||||
spell: ComputedOnlySpellSchema,
|
||||
spellList: ComputedOnlySpellListSchema,
|
||||
toggle: ComputedOnlyToggleSchema,
|
||||
trigger: ComputedOnlyTriggerSchema,
|
||||
any: new SimpleSchema({}),
|
||||
|
||||
@@ -10,6 +10,7 @@ import { ComputedClassSchema } from '/imports/api/properties/Classes';
|
||||
import { ComputedClassLevelSchema } from '/imports/api/properties/ClassLevels';
|
||||
import { ConstantSchema } from '/imports/api/properties/Constants';
|
||||
import { ComputedContainerSchema } from '/imports/api/properties/Containers';
|
||||
import { ComputedCreatureTemplateSchema } from '/imports/api/properties/CreatureTemplates';
|
||||
import { ComputedDamageSchema } from '/imports/api/properties/Damages';
|
||||
import { DamageMultiplierSchema } from '/imports/api/properties/DamageMultipliers';
|
||||
import { ComputedEffectSchema } from '/imports/api/properties/Effects';
|
||||
@@ -33,17 +34,20 @@ const propertySchemasIndex = {
|
||||
action: ComputedActionSchema,
|
||||
adjustment: ComputedAdjustmentSchema,
|
||||
attribute: ComputedAttributeSchema,
|
||||
branch: ComputedBranchSchema,
|
||||
buff: ComputedBuffSchema,
|
||||
buffRemover: ComputedBuffRemoverSchema,
|
||||
branch: ComputedBranchSchema,
|
||||
class: ComputedClassSchema,
|
||||
classLevel: ComputedClassLevelSchema,
|
||||
constant: ConstantSchema,
|
||||
container: ComputedContainerSchema,
|
||||
creature: ComputedCreatureTemplateSchema,
|
||||
damage: ComputedDamageSchema,
|
||||
damageMultiplier: DamageMultiplierSchema,
|
||||
effect: ComputedEffectSchema,
|
||||
feature: ComputedFeatureSchema,
|
||||
folder: ComputedFolderSchema,
|
||||
item: ComputedItemSchema,
|
||||
note: ComputedNoteSchema,
|
||||
pointBuy: ComputedPointBuySchema,
|
||||
proficiency: ProficiencySchema,
|
||||
@@ -52,12 +56,10 @@ const propertySchemasIndex = {
|
||||
roll: ComputedRollSchema,
|
||||
savingThrow: ComputedSavingThrowSchema,
|
||||
skill: ComputedSkillSchema,
|
||||
spellList: ComputedSpellListSchema,
|
||||
spell: ComputedSpellSchema,
|
||||
spellList: ComputedSpellListSchema,
|
||||
toggle: ComputedToggleSchema,
|
||||
trigger: ComputedTriggerSchema,
|
||||
container: ComputedContainerSchema,
|
||||
item: ComputedItemSchema,
|
||||
any: new SimpleSchema({}),
|
||||
};
|
||||
|
||||
|
||||
@@ -2,17 +2,20 @@ import SimpleSchema from 'simpl-schema';
|
||||
import { ActionSchema } from '/imports/api/properties/Actions';
|
||||
import { AdjustmentSchema } from '/imports/api/properties/Adjustments';
|
||||
import { AttributeSchema } from '/imports/api/properties/Attributes';
|
||||
import { BuffSchema } from '/imports/api/properties/Buffs';
|
||||
import { BuffRemoverSchema } from '/imports/api/properties/BuffRemovers';
|
||||
import { BranchSchema } from '/imports/api/properties/Branches';
|
||||
import { ClassSchema } from '/imports/api/properties/Classes';
|
||||
import { BuffRemoverSchema } from '/imports/api/properties/BuffRemovers';
|
||||
import { BuffSchema } from '/imports/api/properties/Buffs';
|
||||
import { ClassLevelSchema } from '/imports/api/properties/ClassLevels';
|
||||
import { ClassSchema } from '/imports/api/properties/Classes';
|
||||
import { ConstantSchema } from '/imports/api/properties/Constants';
|
||||
import { DamageSchema } from '/imports/api/properties/Damages';
|
||||
import { ContainerSchema } from '/imports/api/properties/Containers';
|
||||
import { CreatureTemplateSchema } from '/imports/api/properties/CreatureTemplates';
|
||||
import { DamageMultiplierSchema } from '/imports/api/properties/DamageMultipliers';
|
||||
import { DamageSchema } from '/imports/api/properties/Damages';
|
||||
import { EffectSchema } from '/imports/api/properties/Effects';
|
||||
import { FeatureSchema } from '/imports/api/properties/Features';
|
||||
import { FolderSchema } from '/imports/api/properties/Folders';
|
||||
import { ItemSchema } from '/imports/api/properties/Items';
|
||||
import { NoteSchema } from '/imports/api/properties/Notes';
|
||||
import { PointBuySchema } from '/imports/api/properties/PointBuys';
|
||||
import { ProficiencySchema } from '/imports/api/properties/Proficiencies';
|
||||
@@ -25,24 +28,25 @@ import { SpellListSchema } from '/imports/api/properties/SpellLists';
|
||||
import { SpellSchema } from '/imports/api/properties/Spells';
|
||||
import { ToggleSchema } from '/imports/api/properties/Toggles';
|
||||
import { TriggerSchema } from '/imports/api/properties/Triggers';
|
||||
import { ContainerSchema } from '/imports/api/properties/Containers';
|
||||
import { ItemSchema } from '/imports/api/properties/Items';
|
||||
|
||||
const propertySchemasIndex = {
|
||||
action: ActionSchema,
|
||||
adjustment: AdjustmentSchema,
|
||||
attribute: AttributeSchema,
|
||||
branch: BranchSchema,
|
||||
buff: BuffSchema,
|
||||
buffRemover: BuffRemoverSchema,
|
||||
branch: BranchSchema,
|
||||
class: ClassSchema,
|
||||
classLevel: ClassLevelSchema,
|
||||
constant: ConstantSchema,
|
||||
container: ContainerSchema,
|
||||
creature: CreatureTemplateSchema,
|
||||
damage: DamageSchema,
|
||||
damageMultiplier: DamageMultiplierSchema,
|
||||
effect: EffectSchema,
|
||||
feature: FeatureSchema,
|
||||
folder: FolderSchema,
|
||||
item: ItemSchema,
|
||||
note: NoteSchema,
|
||||
pointBuy: PointBuySchema,
|
||||
proficiency: ProficiencySchema,
|
||||
@@ -51,12 +55,10 @@ const propertySchemasIndex = {
|
||||
roll: RollSchema,
|
||||
savingThrow: SavingThrowSchema,
|
||||
skill: SkillSchema,
|
||||
spellList: SpellListSchema,
|
||||
spell: SpellSchema,
|
||||
spellList: SpellListSchema,
|
||||
toggle: ToggleSchema,
|
||||
trigger: TriggerSchema,
|
||||
container: ContainerSchema,
|
||||
item: ItemSchema,
|
||||
any: new SimpleSchema({}),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user