mirror of
https://github.com/maierfelix/POGOserver.git
synced 2026-04-25 07:19:38 -05:00
-Fixed candiesToEvolve in evolve() function
-Fixed getCandy() function now returns number instead object
This commit is contained in:
parent
7db29979e4
commit
33f753132b
|
|
@ -1,7 +1,6 @@
|
|||
import { GAME_MASTER } from "../../../shared";
|
||||
|
||||
import ENUM from "../../../enum";
|
||||
|
||||
/**
|
||||
* @class CandyBag
|
||||
*/
|
||||
|
|
@ -70,9 +69,8 @@ export default class CandyBag {
|
|||
* @return {Number}
|
||||
*/
|
||||
getCandy(dex) {
|
||||
return (
|
||||
this.getCandyByDexNumber(dex)
|
||||
);
|
||||
let candy = this.getCandyByDexNumber(dex);
|
||||
return (candy.amount);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -33,8 +33,8 @@ export function powerUp() {
|
|||
export function evolve() {
|
||||
let pkmnTmpl = this.getPkmnTemplate(this.dexNumber);
|
||||
let ownerPkmnCandies = this.owner.candyBag.getCandy(this.dexNumber);
|
||||
let candiesToEvolve = 1;//this.candiesToEvolve();
|
||||
if (ownerPkmnCandies < 1/*candiesToEvolve()*/) {
|
||||
let candiesToEvolve = this.candiesToEvolve();
|
||||
if (ownerPkmnCandies < candiesToEvolve) {
|
||||
return print(`You have ${ownerPkmnCandies}/${candiesToEvolve} candies to evolve ${this.getPkmnName()}!`, 31);
|
||||
}
|
||||
let evolutions = pkmnTmpl.evolution_ids;
|
||||
|
|
@ -57,11 +57,12 @@ export function evolveInto(ev) {
|
|||
let evName = _toCC(ev);
|
||||
let evId = pokename.getPokemonIdByName(evName);
|
||||
if (evId <= 0) {
|
||||
print(`Failed at retrieving id for pokemon ${ev}`, 31);
|
||||
print(`Failed at retrieving id for pokemon ${ev}`, 31);
|
||||
return (false);
|
||||
}
|
||||
let evTmpl = this.getPkmnTemplate(evId);
|
||||
print(`${this.owner.username} successfully evolved ${this.getPkmnName()} into ${evName}`);
|
||||
this.dexNumber = evId;
|
||||
|
||||
return (true);
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user