Added attack roll bonus and dc to spell list. Use them in spells with #spellList.dcResult and #spellList.attackRollBonusResult
This commit is contained in:
@@ -21,6 +21,8 @@ export default function computeEndStepProperty(prop, memo){
|
|||||||
break;
|
break;
|
||||||
case 'spellList':
|
case 'spellList':
|
||||||
computePropertyField(prop, memo, 'maxPrepared');
|
computePropertyField(prop, memo, 'maxPrepared');
|
||||||
|
computePropertyField(prop, memo, 'attackRollBonus');
|
||||||
|
computePropertyField(prop, memo, 'dc');
|
||||||
break;
|
break;
|
||||||
case 'propertySlot':
|
case 'propertySlot':
|
||||||
computePropertyField(prop, memo, 'quantityExpected');
|
computePropertyField(prop, memo, 'quantityExpected');
|
||||||
|
|||||||
@@ -23,6 +23,16 @@ let SpellListSchema = new SimpleSchema({
|
|||||||
type: String,
|
type: String,
|
||||||
optional: true,
|
optional: true,
|
||||||
},
|
},
|
||||||
|
// Calculation of The attack roll bonus used by spell attacks in this list
|
||||||
|
attackRollBonus: {
|
||||||
|
type: String,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
|
// Calculation of the save dc used by spells in this list
|
||||||
|
dc: {
|
||||||
|
type: String,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const ComputedOnlySpellListSchema = new SimpleSchema({
|
const ComputedOnlySpellListSchema = new SimpleSchema({
|
||||||
@@ -33,6 +43,7 @@ const ComputedOnlySpellListSchema = new SimpleSchema({
|
|||||||
},
|
},
|
||||||
'descriptionCalculations.$': InlineComputationSchema,
|
'descriptionCalculations.$': InlineComputationSchema,
|
||||||
|
|
||||||
|
// maxPrepared
|
||||||
maxPreparedResult: {
|
maxPreparedResult: {
|
||||||
type: Number,
|
type: Number,
|
||||||
optional: true,
|
optional: true,
|
||||||
@@ -44,6 +55,32 @@ const ComputedOnlySpellListSchema = new SimpleSchema({
|
|||||||
'maxPreparedErrors.$':{
|
'maxPreparedErrors.$':{
|
||||||
type: ErrorSchema,
|
type: ErrorSchema,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// attackRollBonus
|
||||||
|
attackRollBonusResult: {
|
||||||
|
type: Number,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
|
attackRollBonusErrors: {
|
||||||
|
type: Array,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
|
'attackRollBonusErrors.$':{
|
||||||
|
type: ErrorSchema,
|
||||||
|
},
|
||||||
|
|
||||||
|
// dc
|
||||||
|
dcResult: {
|
||||||
|
type: Number,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
|
dcErrors: {
|
||||||
|
type: Array,
|
||||||
|
optional: true,
|
||||||
|
},
|
||||||
|
'dcErrors.$':{
|
||||||
|
type: ErrorSchema,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const ComputedSpellListSchema = new SimpleSchema()
|
const ComputedSpellListSchema = new SimpleSchema()
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
@change="change('description', ...arguments)"
|
@change="change('description', ...arguments)"
|
||||||
/>
|
/>
|
||||||
<calculation-error-list :calculations="model.descriptionCalculations" />
|
<calculation-error-list :calculations="model.descriptionCalculations" />
|
||||||
|
|
||||||
<text-field
|
<text-field
|
||||||
label="Maximum prepared spells"
|
label="Maximum prepared spells"
|
||||||
:value="model.maxPrepared"
|
:value="model.maxPrepared"
|
||||||
@@ -35,6 +35,24 @@
|
|||||||
/>
|
/>
|
||||||
<calculation-error-list :errors="model.maxPreparedErrors" />
|
<calculation-error-list :errors="model.maxPreparedErrors" />
|
||||||
|
|
||||||
|
<text-field
|
||||||
|
label="Spell save DC"
|
||||||
|
:value="model.dc"
|
||||||
|
hint="The spell save DC of spells in this list"
|
||||||
|
:error-messages="errors.dc"
|
||||||
|
@change="change('dc', ...arguments)"
|
||||||
|
/>
|
||||||
|
<calculation-error-list :errors="model.dcErrors" />
|
||||||
|
|
||||||
|
<text-field
|
||||||
|
label="Attack roll bonus"
|
||||||
|
:value="model.attackRollBonus"
|
||||||
|
hint="The attack roll bonus of spell attacks made by spells in this list"
|
||||||
|
:error-messages="errors.attackRollBonus"
|
||||||
|
@change="change('attackRollBonus', ...arguments)"
|
||||||
|
/>
|
||||||
|
<calculation-error-list :errors="model.attackRollBonusErrors" />
|
||||||
|
|
||||||
<smart-combobox
|
<smart-combobox
|
||||||
label="Tags"
|
label="Tags"
|
||||||
multiple
|
multiple
|
||||||
|
|||||||
@@ -4,7 +4,15 @@
|
|||||||
<property-variable-name :value="model.variableName" />
|
<property-variable-name :value="model.variableName" />
|
||||||
<property-field
|
<property-field
|
||||||
name="Maximum prepared spells"
|
name="Maximum prepared spells"
|
||||||
:value="model.maxPreparedResult"
|
:value="'maxPreparedResult' in model ? model.maxPreparedResult : model.maxPrepared"
|
||||||
|
/>
|
||||||
|
<property-field
|
||||||
|
name="Spell Save DC"
|
||||||
|
:value="'dcResult' in model ? model.dcResult : model.dcResult"
|
||||||
|
/>
|
||||||
|
<property-field
|
||||||
|
name="Attack roll bonus"
|
||||||
|
:value="'attackRollBonusResult' in model ? model.attackRollBonusResult : model.attackRollBonus"
|
||||||
/>
|
/>
|
||||||
<property-description
|
<property-description
|
||||||
:string="model.description"
|
:string="model.description"
|
||||||
|
|||||||
Reference in New Issue
Block a user