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;
|
||||
case 'spellList':
|
||||
computePropertyField(prop, memo, 'maxPrepared');
|
||||
computePropertyField(prop, memo, 'attackRollBonus');
|
||||
computePropertyField(prop, memo, 'dc');
|
||||
break;
|
||||
case 'propertySlot':
|
||||
computePropertyField(prop, memo, 'quantityExpected');
|
||||
|
||||
@@ -23,6 +23,16 @@ let SpellListSchema = new SimpleSchema({
|
||||
type: String,
|
||||
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({
|
||||
@@ -33,6 +43,7 @@ const ComputedOnlySpellListSchema = new SimpleSchema({
|
||||
},
|
||||
'descriptionCalculations.$': InlineComputationSchema,
|
||||
|
||||
// maxPrepared
|
||||
maxPreparedResult: {
|
||||
type: Number,
|
||||
optional: true,
|
||||
@@ -44,6 +55,32 @@ const ComputedOnlySpellListSchema = new SimpleSchema({
|
||||
'maxPreparedErrors.$':{
|
||||
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()
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
@change="change('description', ...arguments)"
|
||||
/>
|
||||
<calculation-error-list :calculations="model.descriptionCalculations" />
|
||||
|
||||
|
||||
<text-field
|
||||
label="Maximum prepared spells"
|
||||
:value="model.maxPrepared"
|
||||
@@ -35,6 +35,24 @@
|
||||
/>
|
||||
<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
|
||||
label="Tags"
|
||||
multiple
|
||||
|
||||
@@ -4,7 +4,15 @@
|
||||
<property-variable-name :value="model.variableName" />
|
||||
<property-field
|
||||
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
|
||||
:string="model.description"
|
||||
|
||||
Reference in New Issue
Block a user