Skip to content

Commit

Permalink
Addition of evolution
Browse files Browse the repository at this point in the history
  • Loading branch information
junebug12851 committed Mar 20, 2019
1 parent a0eeabe commit 04fb2fd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/app/fragments/card-pokemon/card-pokemon.component.pug
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@ mat-menu(
'#menuShortcuts'=''
)
button('mat-menu-item'='', '(click)'='doHeal()', '[disabled]'='isHealed') Heal
button('mat-menu-item'='', '(click)'='doEvolve()', '[disabled]'='!canEvolve') Evolve
mat-divider
button('mat-menu-item'='', '(click)'='doMaxLevel()', '[disabled]'='isMaxLevel') Max Level
button('mat-menu-item'='', '(click)'='maxPPUps()', '[disabled]'='isMaxPPUps') Max PP Ups
mat-divider
button('mat-menu-item'='', '(click)'='doMaxDVs()', '[disabled]'='isMaxDVs') Max DV's
button('mat-menu-item'='', '(click)'='doReRollDVs()') Re-Roll DV's
mat-divider
button('mat-menu-item'='', '(click)'='doMaxEVs()', '[disabled]'='isMaxEVs') Max EV's
button('mat-menu-item'='', '(click)'='doResetEVs()', '[disabled]'='isMinEVs') Reset EV's
button('mat-menu-item'='', '(click)'='doReRollDVs()') Re-Roll DV's
button('mat-menu-item'='', '(click)'='doMaxDVs()', '[disabled]'='isMaxDVs') Max DV's
mat-divider
button('mat-menu-item'='', '(click)'='doFullyMaxed()', '[disabled]'='isFullyMaxed') Max Out
button('mat-menu-item'='', '(click)'='doFullReset()', '[disabled]'='isFullyReset') Full Reset
Expand Down
17 changes: 17 additions & 0 deletions src/app/fragments/card-pokemon/card-pokemon.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,23 @@ export class CardPokemonComponent implements OnInit {
this.entry.nickname = nickname;
}

get canEvolve() {
const species = this.pdb.pokemon[this.entry.species];
if(species == undefined || species.evolution == undefined)
return false;

return true;
}

doEvolve() {
const species = this.pdb.pokemon[this.entry.species];
if(species == undefined || species.evolution == undefined)
return;

this.entry.species = species.evolution.toName.ind;
this.onSpeciesChange();
}

@Input()
public entry: any = new PokemonParty();

Expand Down

0 comments on commit 04fb2fd

Please sign in to comment.