mirror of
https://github.com/chase-manning/pokemon-js.git
synced 2025-11-03 09:28:58 +00:00
🐛 first index not reset
This commit is contained in:
parent
c9e78a88b7
commit
c414e95aef
3 changed files with 2 additions and 143 deletions
1
TODO.md
1
TODO.md
|
|
@ -1,6 +1,5 @@
|
|||
===========
|
||||
|
||||
- first index not reset after heal
|
||||
- Restrict east traversal before beating brock
|
||||
- Implement meseum
|
||||
- Add more maps
|
||||
|
|
|
|||
|
|
@ -634,7 +634,6 @@ const PokemonEncounter = () => {
|
|||
// Ending encounter
|
||||
setTrainerPokemonIndex(0);
|
||||
dispatch(endEncounter());
|
||||
dispatch(resetActivePokemon());
|
||||
|
||||
if (isTrainer) {
|
||||
// Defeated trainer
|
||||
|
|
@ -667,6 +666,7 @@ const PokemonEncounter = () => {
|
|||
|
||||
useEffect(() => {
|
||||
if (isInBattle) {
|
||||
dispatch(resetActivePokemon());
|
||||
setStage(0);
|
||||
setTimeout(() => {
|
||||
setStage(1);
|
||||
|
|
@ -679,7 +679,7 @@ const PokemonEncounter = () => {
|
|||
if (!isInBattle) {
|
||||
setStage(-1);
|
||||
}
|
||||
}, [isInBattle]);
|
||||
}, [isInBattle, dispatch]);
|
||||
|
||||
const throwPokeball = () => {
|
||||
setTimeout(() => {
|
||||
|
|
|
|||
|
|
@ -77,146 +77,6 @@ const initialState: GameState = {
|
|||
{ id: "growl", pp: 40 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "scratch", pp: 35 },
|
||||
{ id: "growl", pp: 40 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "tackle", pp: 35 },
|
||||
{ id: "tail-whip", pp: 30 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "tackle", pp: 35 },
|
||||
{ id: "growl", pp: 40 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "scratch", pp: 35 },
|
||||
{ id: "growl", pp: 40 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "tackle", pp: 35 },
|
||||
{ id: "tail-whip", pp: 30 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "tackle", pp: 35 },
|
||||
{ id: "growl", pp: 40 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "scratch", pp: 35 },
|
||||
{ id: "growl", pp: 40 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "tackle", pp: 35 },
|
||||
{ id: "tail-whip", pp: 30 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "tackle", pp: 35 },
|
||||
{ id: "growl", pp: 40 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "scratch", pp: 35 },
|
||||
{ id: "growl", pp: 40 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "tackle", pp: 35 },
|
||||
{ id: "tail-whip", pp: 30 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 1,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "tackle", pp: 35 },
|
||||
{ id: "growl", pp: 40 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "scratch", pp: 35 },
|
||||
{ id: "growl", pp: 40 },
|
||||
],
|
||||
},
|
||||
{
|
||||
id: 7,
|
||||
level: 5,
|
||||
xp: 0,
|
||||
hp: 19,
|
||||
moves: [
|
||||
{ id: "tackle", pp: 35 },
|
||||
{ id: "tail-whip", pp: 30 },
|
||||
],
|
||||
},
|
||||
],
|
||||
activePokemonIndex: 0,
|
||||
trainerEncounter: undefined,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue