Settling on a data structure to balance compatibility
with not being wrong
This commit is contained in:
@@ -199,14 +199,21 @@ let ComputedOnlyAttributeSchema = createPropertySchema({
|
||||
removeBeforeCompute: true,
|
||||
},
|
||||
// A list of effect ids targeting this attribute
|
||||
effects: {
|
||||
'effectIds': {
|
||||
type: Array,
|
||||
optional: true,
|
||||
removeBeforeCompute: true,
|
||||
},
|
||||
'effects.$': {
|
||||
type: Object,
|
||||
blackbox: true,
|
||||
'effectIds.$': {
|
||||
type: String,
|
||||
},
|
||||
'proficiencyIds': {
|
||||
type: Array,
|
||||
optional: true,
|
||||
removeBeforeCompute: true,
|
||||
},
|
||||
'proficiencyIds.$': {
|
||||
type: String,
|
||||
},
|
||||
});
|
||||
|
||||
|
||||
@@ -134,14 +134,21 @@ let ComputedOnlySkillSchema = createPropertySchema({
|
||||
removeBeforeCompute: true,
|
||||
},
|
||||
// A list of effect ids targeting this skill
|
||||
effects: {
|
||||
'effectIds': {
|
||||
type: Array,
|
||||
optional: true,
|
||||
removeBeforeCompute: true,
|
||||
},
|
||||
'effects.$': {
|
||||
type: Object,
|
||||
blackbox: true,
|
||||
'effectIds.$': {
|
||||
type: String,
|
||||
},
|
||||
'proficiencyIds': {
|
||||
type: Array,
|
||||
optional: true,
|
||||
removeBeforeCompute: true,
|
||||
},
|
||||
'proficiencyIds.$': {
|
||||
type: String,
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
@@ -19,29 +19,23 @@ function fieldToCompute(field) {
|
||||
|
||||
function computedOnlyField(field) {
|
||||
const schemaObj = {
|
||||
// The parseNode of the compiled value before any effects are applied or rolls made
|
||||
// The value (or calculation string) before any effects/proficiencies are applied or rolls made
|
||||
[`${field}.unaffected`]: {
|
||||
type: Object,
|
||||
type: SimpleSchema.oneOf(String, Number),
|
||||
optional: true,
|
||||
blackbox: true,
|
||||
},
|
||||
// toString(.unaffected)
|
||||
[`${field}.displayUnaffected`]: {
|
||||
type: SimpleSchema.oneOf(String, Number),
|
||||
optional: true,
|
||||
removeBeforeCompute: true,
|
||||
},
|
||||
// The compiled parseNode after applying all effects
|
||||
// The value (or calculation string) after applying all effects
|
||||
[`${field}.value`]: {
|
||||
type: Object,
|
||||
type: SimpleSchema.oneOf(String, Number),
|
||||
optional: true,
|
||||
blackbox: true,
|
||||
},
|
||||
// The displayed value of the calculation: toString(.value)
|
||||
[`${field}.displayValue`]: {
|
||||
// The value as a parse node, after applying all effects
|
||||
[`${field}.valueNode`]: {
|
||||
type: SimpleSchema.oneOf(String, Number),
|
||||
optional: true,
|
||||
removeBeforeCompute: true,
|
||||
blackbox: true,
|
||||
},
|
||||
// A list of effect Ids targeting this calculation
|
||||
[`${field}.effectIds`]: {
|
||||
|
||||
Reference in New Issue
Block a user