Add WiP move attributes system
This commit is contained in:
1 parent
1cf81869d0
commit
c9c4e82f7f
7 files changed
+760
-576
No files matched your search
@@ -92,13 +92,22 @@ export default class FightUiHandler extends UiHandler {
|
||||
ui.add(this.cursorObj);
|
||||
}
|
||||
|
||||
const pokemonMove = (this.scene as BattleScene).getPlayerPokemon().moveset[cursor];
|
||||
this.typeIcon.setTexture('types', Type[pokemonMove.getMove().type].toLowerCase());
|
||||
const moveset = (this.scene as BattleScene).getPlayerPokemon().moveset;
|
||||
|
||||
const maxPP = pokemonMove.getMove().pp + pokemonMove.ppUp;
|
||||
const pp = maxPP - pokemonMove.ppUsed;
|
||||
const hasMove = cursor < moveset.length;
|
||||
|
||||
this.ppText.setText(`${Utils.padInt(pp, 2, ' ')}/${Utils.padInt(maxPP, 2, ' ')}`);
|
||||
if (hasMove) {
|
||||
const pokemonMove = moveset[cursor];
|
||||
this.typeIcon.setTexture('types', Type[pokemonMove.getMove().type].toLowerCase());
|
||||
|
||||
const maxPP = pokemonMove.getMove().pp + pokemonMove.ppUp;
|
||||
const pp = maxPP - pokemonMove.ppUsed;
|
||||
|
||||
this.ppText.setText(`${Utils.padInt(pp, 2, ' ')}/${Utils.padInt(maxPP, 2, ' ')}`);
|
||||
}
|
||||
|
||||
this.typeIcon.setVisible(hasMove);
|
||||
this.ppText.setVisible(hasMove);
|
||||
|
||||
this.cursorObj.setPosition(13 + (cursor % 2 === 1 ? 100 : 0), -31 + (cursor >= 2 ? 15 : 0));
|
||||
|
||||
|
||||
Reference in new issue
Block a user