Improved property viewers, added some new ones
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import SimpleSchema from 'simpl-schema';
|
||||
import { EffectSchema } from '/imports/api/properties/Effects.js';
|
||||
import { StoredEffectSchema } from '/imports/api/properties/Effects.js';
|
||||
|
||||
let BuffSchema = new SimpleSchema({
|
||||
name: {
|
||||
@@ -25,7 +25,7 @@ let StoredBuffSchema = new SimpleSchema({
|
||||
defaultValue: [],
|
||||
},
|
||||
'effects.$': {
|
||||
type: EffectSchema,
|
||||
type: StoredEffectSchema,
|
||||
},
|
||||
target: {
|
||||
type: String,
|
||||
|
||||
@@ -5,13 +5,6 @@ import SimpleSchema from 'simpl-schema';
|
||||
* that modify their final value or presentation in some way
|
||||
*/
|
||||
let EffectSchema = new SimpleSchema({
|
||||
_id: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
autoValue(){
|
||||
if (!this.isSet) return Random.id();
|
||||
}
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
optional: true,
|
||||
@@ -43,6 +36,16 @@ let EffectSchema = new SimpleSchema({
|
||||
},
|
||||
});
|
||||
|
||||
const StoredEffectSchema = new SimpleSchema({
|
||||
_id: {
|
||||
type: String,
|
||||
regEx: SimpleSchema.RegEx.Id,
|
||||
autoValue(){
|
||||
if (!this.isSet) return Random.id();
|
||||
}
|
||||
},
|
||||
}).extend(EffectSchema);
|
||||
|
||||
const ComputedEffectSchema = new SimpleSchema({
|
||||
// The computed result of the effect
|
||||
result: {
|
||||
@@ -51,4 +54,4 @@ const ComputedEffectSchema = new SimpleSchema({
|
||||
},
|
||||
}).extend(EffectSchema);
|
||||
|
||||
export { EffectSchema, ComputedEffectSchema };
|
||||
export { EffectSchema, StoredEffectSchema, ComputedEffectSchema };
|
||||
|
||||
@@ -20,7 +20,7 @@ let SkillSchema = new SimpleSchema({
|
||||
optional: true,
|
||||
},
|
||||
// What type of skill is this
|
||||
type: {
|
||||
skillType: {
|
||||
type: String,
|
||||
allowedValues: [
|
||||
"skill",
|
||||
@@ -43,6 +43,11 @@ let SkillSchema = new SimpleSchema({
|
||||
type: Number,
|
||||
optional: true,
|
||||
},
|
||||
// Description of what the skill is used for
|
||||
description: {
|
||||
type: String,
|
||||
optional: true,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user