summaryrefslogtreecommitdiff
path: root/Pokecenters-Disregard-Eggs.md
blob: 99735eb1a0a6a9c5f05639c86458418052b7c588 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
## Pokecenters Disregard Eggs

Credit to ghoulslash

In Gen4+, pokecenters disregarded eggs for the healing animation. This replicates that effect in Pokeemerald

### Replace the relevant party count
Open [src/field_effect.c](../blob/master/src/field_effect.c). Change `FldEff_PokecenterHeal` like so.
```diff
bool8 FldEff_PokecenterHeal(void)
{
    u8 nPokemon;
    struct Task *task;

-    nPokemon = CalculatePlayerPartyCount();
+    nPokemon = CountPartyNonEggMons();
    task = &gTasks[CreateTask(Task_PokecenterHeal, 0xff)];
    task->tNumMons = nPokemon;
    task->tFirstBallX = 93;
    task->tFirstBallY = 36;
    task->tMonitorX = 124;
    task->tMonitorY = 24;
    return FALSE;
}
```

### Allow field_effect.c to recognize `CountPartyNonEggMons`
Keep [src/field_effect.c](../blob/master/src/field_effect.c) open. Add the following somewhere at the top:
```c
#include "pokemon_storage_system.h"
```

Open [include/pokemon_storage_system.h](../blob/master/include/pokemon_storage_system.h). Add the following to the bottom:
```c
u8 CountPartyNonEggMons(void);
```