This commit is contained in:
Tyrel Souza 2018-04-14 00:56:26 -04:00
parent c4d5b97bb1
commit 24ab7f8e53
No known key found for this signature in database
GPG Key ID: 5A9394D4C30AEAC0

View File

@ -31,21 +31,18 @@ var app = new Vue({
this.logs = []; this.logs = [];
}, },
playerAttack(){ playerAttack(){
console.log("player Attack");
var dmg = this.getRandomInt(3, 10); var dmg = this.getRandomInt(3, 10);
this.mHP -= dmg; this.mHP -= dmg;
this.logs.unshift({isPlayer: true, text: 'Player hits monster for ' + dmg}); this.logs.unshift({isPlayer: true, text: 'Player hits monster for ' + dmg});
this.monsterAttack(); this.monsterAttack();
}, },
specialAttack(){ specialAttack(){
console.log("special Attack");
var dmg = this.getRandomInt(10, 20); var dmg = this.getRandomInt(10, 20);
this.mHP -= dmg; this.mHP -= dmg;
this.logs.unshift({isPlayer: true, text: 'Player hits monster hard for ' + dmg}); this.logs.unshift({isPlayer: true, text: 'Player hits monster hard for ' + dmg});
this.monsterAttack(); this.monsterAttack();
}, },
heal(){ heal(){
console.log("heal");
var hp = 10 var hp = 10
this.pHP = Math.min(100, this.pHP + 10 ); this.pHP = Math.min(100, this.pHP + 10 );
var log = var log =
@ -57,7 +54,6 @@ var app = new Vue({
this.logs = []; this.logs = [];
}, },
monsterAttack(){ monsterAttack(){
console.log("attacked");
var dmg = this.getRandomInt(5, 12); var dmg = this.getRandomInt(5, 12);
var log = { isPlayer: false, text: 'monster hits player for ' + dmg} var log = { isPlayer: false, text: 'monster hits player for ' + dmg}
this.pHP -= dmg; this.pHP -= dmg;