| | |
| | | this.monsterHealth -= attackValue; |
| | | this.attackPlayer(); |
| | | }, |
| | | healPlayer() { |
| | | this.currentRound++; |
| | | const healValue = getRandomValue(8, 20); |
| | | if (this.playerHealth + healValue > 100) { |
| | | this.playerHealth = 100; |
| | | } else { |
| | | this.playerHealth += healValue; |
| | | } |
| | | this.attackPlayer(); |
| | | }, |
| | | }, |
| | | }); |
| | | |
| | |
| | | <button @click="specialAttackMonster" :disabled="mayUseSpecialAttack"> |
| | | SPECIAL ATTACK |
| | | </button> |
| | | <button>HEAL</button> |
| | | <button @click="healPlayer">HEAL</button> |
| | | <button>SURRENDER</button> |
| | | </section> |
| | | <section id="log" class="container"> |