rename the attackValue function
This commit is contained in:
parent
6f3f20e1b4
commit
3ffbadeb3a
|
@ -1,6 +1,6 @@
|
||||||
"use strict";
|
"use strict";
|
||||||
|
|
||||||
function attackValue(min, max) {
|
function getRandomValue(min, max) {
|
||||||
return Math.floor(Math.random() * (max - min)) + min;
|
return Math.floor(Math.random() * (max - min)) + min;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -27,12 +27,14 @@ const app = Vue.createApp({
|
||||||
methods: {
|
methods: {
|
||||||
attackMonster() {
|
attackMonster() {
|
||||||
this.currentRound++;
|
this.currentRound++;
|
||||||
this.monsterHealth -= attackValue(5, 12);
|
this.monsterHealth -= getRandomValue(5, 12);
|
||||||
this.attackPlayer();
|
this.attackPlayer();
|
||||||
},
|
},
|
||||||
specialAttackMonster() {
|
specialAttackMonster() {
|
||||||
this.currentRound++;
|
this.currentRound++;
|
||||||
this.monsterHealth -= attackValue(10, 25);
|
this.monsterHealth -= getRandomValue(10, 25);
|
||||||
|
this.attackPlayer();
|
||||||
|
},
|
||||||
this.attackPlayer();
|
this.attackPlayer();
|
||||||
},
|
},
|
||||||
healPlayer() {},
|
healPlayer() {},
|
||||||
|
|
Reference in New Issue