Added healing damage type

This commit is contained in:
Thaum Rystra
2020-05-28 15:41:46 +02:00
parent 70a6c817cb
commit 7a75d34246
3 changed files with 40 additions and 19 deletions

View File

@@ -1,17 +1,18 @@
const DAMAGE_TYPES = Object.freeze([
"bludgeoning",
"piercing",
"slashing",
"acid",
"cold",
"fire",
"force",
"lightning",
"necrotic",
"poison",
"psychic",
"radiant",
"thunder",
'healing',
'bludgeoning',
'piercing',
'slashing',
'acid',
'cold',
'fire',
'force',
'lightning',
'necrotic',
'poison',
'psychic',
'radiant',
'thunder',
]);
export default DAMAGE_TYPES;

View File

@@ -1,11 +1,12 @@
<template lang="html">
<div class="layout row align-center justify-start">
<property-icon
<v-icon
class="mr-2"
:type="model.type"
:class="selected && 'primary--text'"
:color="model.color"
/>
:class="selected && 'primary--text'"
>
{{ icon }}
</v-icon>
<div
class="text-no-wrap text-truncate"
>
@@ -14,7 +15,12 @@
:value="model.amount"
:expect-number="false"
/>
{{ model.damageType }} damage
<span class="mr-1">
{{ model.damageType }}
</span>
<span v-if="model.damageType !== 'healing'">
damage
</span>
</div>
</div>
</template>
@@ -22,11 +28,21 @@
<script>
import treeNodeViewMixin from '/imports/ui/properties/treeNodeViews/treeNodeViewMixin.js';
import ComputedForCreature from '/imports/ui/components/computation/ComputedForCreature.vue';
import { getPropertyIcon } from '/imports/constants/PROPERTIES.js';
export default {
components: {
Computed: ComputedForCreature,
},
mixins: [treeNodeViewMixin],
computed: {
icon(){
if (this.model.damageType === 'healing'){
return 'group_work'
} else {
return getPropertyIcon('damage');
}
},
},
}
</script>

View File

@@ -4,7 +4,11 @@
class="mr-2"
:value="model.amount"
:expect-number="false"
/> {{ model.damageType }} damage
/>
{{ model.damageType }}
<span v-if="model.damageType !== 'healing'">
damage
</span>
</div>
</template>