Skills can now apply to calcs by tag

This commit is contained in:
Stefan Zermatten
2023-06-14 13:56:44 +02:00
parent 442aea2bbe
commit 04de76d20e
9 changed files with 131 additions and 40 deletions

View File

@@ -7,7 +7,7 @@
>
<div class="effect-icon">
<proficiency-icon
:value="model.value"
:value="model.proficiency"
class="prof-icon"
/>
</div>
@@ -16,7 +16,7 @@
<span
class="effect-value mr-2"
>
{{ proficiencyValue }}
{{ displayedValue }}
</span>
{{ displayedText }}
</v-list-item-title>
@@ -26,34 +26,25 @@
<script lang="js">
import ProficiencyIcon from '/imports/client/ui/properties/shared/ProficiencyIcon.vue';
import numberToSignedString from '/imports/api/utility/numberToSignedString.js';
export default {
components: {
ProficiencyIcon,
},
props: {
hideBreadcrumbs: Boolean,
model: {
type: Object,
required: true,
},
proficiencyBonus: {
type: Number,
default: 0,
},
},
computed: {
displayedText(){
return this.model.name || 'Proficiency'
return this.model.name || (this.model.type == 'proficiency' ? 'Proficiency' : 'Skill')
},
displayedValue() {
return numberToSignedString(this.model.value);
},
proficiencyValue(){
if (!this.proficiencyBonus) return;
if (this.model.value === 0.49){
return Math.floor(0.5 * this.proficiencyBonus);
} else {
return Math.ceil(this.model.value * this.proficiencyBonus);
}
},
},
methods: {
click(e){