feat: magic game flow 1
This commit is contained in:
parent
45fc84b3db
commit
5029bb70fb
5 changed files with 278 additions and 61 deletions
50
components/PhilosophersStoneButton.vue
Normal file
50
components/PhilosophersStoneButton.vue
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
<template>
|
||||
<progress-button
|
||||
:label="action.name"
|
||||
:description="action.description"
|
||||
:max="100"
|
||||
:value="$store.state.mana"
|
||||
:current="current"
|
||||
:next="next"
|
||||
@click="doAction"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
action: { type: Object, required: true },
|
||||
},
|
||||
computed: {
|
||||
current() {
|
||||
return this.action.name === 'Empower the Stone'
|
||||
? this.$store.state.philosophersStoneIncrement
|
||||
: undefined
|
||||
},
|
||||
next() {
|
||||
return this.action.name === 'Empower the Stone'
|
||||
? this.$store.state.philosophersStoneIncrement + 6
|
||||
: undefined
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
doAction() {
|
||||
this.$store.commit('spendMana', 100)
|
||||
|
||||
if (this.action.name === 'Empower the Stone') {
|
||||
this.$store.commit('increasePhilosophersStoneIncrement', 6)
|
||||
} else if (this.action.name === 'Forever Young') {
|
||||
this.$store.commit(
|
||||
'decreaseAge',
|
||||
this.$store.state.philosophersStoneIncrement
|
||||
)
|
||||
} else if (this.action.name === 'Necromancy') {
|
||||
this.$store.commit(
|
||||
'extendLifespan',
|
||||
this.$store.state.philosophersStoneIncrement
|
||||
)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
34
components/SpellButton.vue
Normal file
34
components/SpellButton.vue
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<template>
|
||||
<progress-button
|
||||
:label="spell.name"
|
||||
:description="spell.description"
|
||||
:max="100"
|
||||
:value="$store.state.mana"
|
||||
:current="current"
|
||||
:next="next"
|
||||
@click="doAction"
|
||||
/>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
props: {
|
||||
spell: { type: Object, required: true },
|
||||
},
|
||||
computed: {
|
||||
current() {
|
||||
//
|
||||
return undefined
|
||||
},
|
||||
next() {
|
||||
//
|
||||
return undefined
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
cast() {
|
||||
//
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
Reference in a new issue