Commit db7fa39d authored by Manish Kumar's avatar Manish Kumar
Browse files

round dmg and remove duplicates in friends

parent a8895d51
......@@ -2,7 +2,6 @@ import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';
import { ActivatedRoute } from '@angular/router';
import { ChatService } from '../chat.service';
import { Pokemon } from "./pokemon.js";
@Component({
selector: 'app-battle',
templateUrl: './battle.component.html',
......@@ -196,7 +195,7 @@ export class BattleComponent implements OnInit {
calculeDmg(eff, power){
console.log(eff, power);
console.log(this.enemyDef + " " + this.atk);
let dmg = ((((0.4*this.level+2)*this.atk*power)/(50*this.enemyDef))+2)*(eff/100)*(Math.random()*(1 - 0.85)+ 0.85)
let dmg = Math.round(((((0.4*this.level+2)*this.atk*power)/(50*this.enemyDef))+2)*(eff/100)*(Math.random()*(1 - 0.85)+ 0.85));
this.applyDamageOpponent(dmg);
console.log(dmg + " " + this.enemyCurHealth);
return dmg;
......
......@@ -136,7 +136,6 @@ export class FriendsMenuComponent implements OnInit {
this.pseudo = res.body;
this.uid = res.uid;
this.liste();
this.ordre();
});
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment