Fixed advantage with new action scope prefix: '~'

This commit is contained in:
Stefan Zermatten
2023-06-07 12:29:54 +02:00
parent 4d6c6b6094
commit 6bc737f850
9 changed files with 42 additions and 8 deletions

View File

@@ -173,6 +173,13 @@ let ComputedOnlyAttributeSchema = createPropertySchema({
optional: true,
removeBeforeCompute: true,
},
// Attributes with advantage grant it to all skills based on the attribute
advantage: {
type: SimpleSchema.Integer,
optional: true,
allowedValues: [-1, 0, 1],
removeBeforeCompute: true,
},
// The computed creature constitution modifier for hit dice
constitutionMod: {
type: Number,

View File

@@ -19,7 +19,10 @@
</v-btn>
</template>
<v-sheet class="d-flex flex-column align-center justify-center">
<v-btn-toggle v-model="dataAdvantage">
<v-btn-toggle
v-model="dataAdvantage"
color="accent"
>
<v-btn :value="-1">
Disadvantage
</v-btn>

View File

@@ -211,7 +211,7 @@ export default {
doAction.call({
actionId: this.model._id,
scope: {
$attackAdvantage: advantage,
'~attackAdvantage': { value: advantage },
}
}, error => {
this.doActionLoading = false;

View File

@@ -53,7 +53,7 @@ export default {
doAction.call({
actionId: this.model._id,
scope: {
$attackAdvantage: advantage,
'~attackAdvantage': { value: advantage },
}
}, error => {
this.doActionLoading = false;

View File

@@ -46,6 +46,18 @@
<v-list-item-content>
<v-list-item-title>
{{ model.name }}
<v-icon
v-if="model.advantage > 0"
right
>
mdi-chevron-double-up
</v-icon>
<v-icon
v-if="model.advantage < 0"
right
>
mdi-chevron-double-down
</v-icon>
</v-list-item-title>
</v-list-item-content>
</v-list-item>
@@ -89,7 +101,7 @@ export default {
doCheck.call({
propId: this.model._id,
scope: {
$checkAdvantage: advantage,
'~checkAdvantage': { value: advantage },
},
}, error => {
this.checkLoading = false;

View File

@@ -30,6 +30,18 @@
</v-card-title>
<v-card-title class="name text-subtitle-1 text-truncate d-block pl-0">
{{ model.name }}
<v-icon
v-if="model.advantage > 0"
right
>
mdi-chevron-double-up
</v-icon>
<v-icon
v-if="model.advantage < 0"
right
>
mdi-chevron-double-down
</v-icon>
</v-card-title>
</div>
</template>
@@ -75,7 +87,7 @@ export default {
doCheck.call({
propId: this.model._id,
scope: {
$checkAdvantage: advantage,
'~checkAdvantage': { value: advantage },
},
}, error => {
this.checkLoading = false;

View File

@@ -65,7 +65,7 @@ export default {
slotId,
ritual,
scope: {
$attackAdvantage: advantage,
'~attackAdvantage': { value: advantage },
},
}, error => {
if (!error) return;

View File

@@ -111,7 +111,7 @@ export default {
doCheck.call({
propId: this.model._id,
scope: {
$checkAdvantage: advantage,
'~checkAdvantage': { value: advantage },
},
}, error => {
this.checkLoading = false;

View File

@@ -197,7 +197,7 @@ export default {
slotId,
ritual,
scope: {
$attackAdvantage: advantage,
'~attackAdvantage': { value: advantage },
},
}, error => {
if (!error) return;