blob: c17db2bfec589cefa134c2ce71a857c904c7f37c (
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
39
40
41
42
43
|
#include "global.h"
#include "charge_move.h"
#include "constants/status.h"
#include "dungeon_util.h"
extern u32 gMultiTurnChargingStatuses[];
bool8 IsCharging(struct DungeonEntity *pokemon, bool8 checkCharge)
{
if (!EntityExists(pokemon))
{
return FALSE;
}
else
{
struct DungeonEntityData *pokemonData = pokemon->entityData;
int i = 0;
u8 *chargingStatusPointer = &pokemonData->chargingStatus;
u8 *chargingStatusPointer2;
u8 chargeStatus = CHARGING_STATUS_CHARGE;
for (; i < 100; i++)
{
u8 currentStatus = gMultiTurnChargingStatuses[i];
u8 chargingStatus;
if (currentStatus == CHARGING_STATUS_NONE)
{
return FALSE;
}
chargingStatus = *chargingStatusPointer;
chargingStatusPointer2 = &pokemonData->chargingStatus;
if (chargingStatus == currentStatus)
{
return TRUE;
}
}
if (checkCharge && *chargingStatusPointer2 == chargeStatus)
{
return TRUE;
}
return FALSE;
}
}
|