Skip to content

Commit

Permalink
feat: 🎸 update move list on evoluton chain
Browse files Browse the repository at this point in the history
  • Loading branch information
HuskyHsu committed Oct 31, 2023
1 parent 986e5f5 commit 2a9d0f7
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 14 deletions.
2 changes: 1 addition & 1 deletion public/data/base_list_201.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/data/pm/184.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/data/pm/275.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/data/pm/289.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/data/pm/395.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/data/pm/604.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/data/pm/666.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/data/pm/979.json

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions src/pages/Pokemon/components/Moves.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const columns = [
? LevelMap[row.level.toString() as keyof typeof LevelMap]
: `Lv${row.level.toString().padStart(2, '0')}`;

return `${row.pm.nameZh}${row.pm.altForm ? '(' + row.pm.altForm + ')' : ''}-${level}`;
return `${row.pm.nameZh}${row.pm.altForm ? '(' + row.pm.altForm + ')' : ''}: ${level}`;
},
meta: 'w-2/12',
},
Expand Down Expand Up @@ -211,7 +211,9 @@ export function Moves({ pm }: Props) {
</li>
{allMoves
.map((move) => {
const key = `${move.pid}-${'level' in move ? move.level : move.TMPid}`;
const key = `${move.pid}-${
'level' in move ? ('pm' in move ? move.pm.link : move.level) : move.TMPid
}`;
const lilist = [
<li
className="flex cursor-pointer border-b-[1px] py-1"
Expand Down
8 changes: 4 additions & 4 deletions src/types/Pokemon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ type LevelingUp = Move & { level: number };

type EggMove = Move & { level: number };

type beforeEvolveMove = Move & { level: number; pm: SubPokemon };

type TM = Move & {
TMPid: number;
leaguePoint: number;
Expand All @@ -80,15 +82,13 @@ type TM = Move & {
}[];
};

type beforeEvolveMove = Move & { level: number; pm: SubPokemon };

export type PMMove = LevelingUp | EggMove | TM | beforeEvolveMove;
export type PMMove = LevelingUp | EggMove | beforeEvolveMove | TM;

type MoveInfo = {
levelingUps: LevelingUp[];
eggMoves: EggMove[];
TMs: TM[];
beforeEvolve: beforeEvolveMove[];
TMs: TM[];
};

export enum MoveCategoryEnum {
Expand Down

0 comments on commit 2a9d0f7

Please sign in to comment.