blob: 956c6e1ce46115adf88a2db3536ddf353437819e (
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
44
45
46
47
48
49
50
51
52
53
54
55
56
|
#include "global.h"
#include "dungeon_capabilities_1.h"
#include "constants/dungeon.h"
#include "constants/status.h"
#include "charge_move.h"
#include "dungeon_ai.h"
#include "dungeon_capabilities.h"
static inline bool8 JoinLocationCannotUseItems(struct DungeonEntityData *pokemonData)
{
if (pokemonData->joinLocation == DUNGEON_JOIN_LOCATION_CLIENT_POKEMON)
{
return TRUE;
}
if (pokemonData->joinLocation == DUNGEON_RESCUE_TEAM_BASE)
{
return TRUE;
}
return FALSE;
}
bool8 CannotUseItems(struct DungeonEntity *pokemon)
{
struct DungeonEntityData *pokemonData = pokemon->entityData;
if (pokemonData->clientType == CLIENT_TYPE_CLIENT
|| JoinLocationCannotUseItems(pokemonData)
|| (!pokemonData->isLeader && ShouldAvoidEnemies(pokemon))
|| CannotMove(pokemon, FALSE)
|| CannotAct(pokemon))
{
return TRUE;
}
if (IsCharging(pokemon, FALSE))
{
return TRUE;
}
return FALSE;
}
bool8 CannotAct(struct DungeonEntity *pokemon)
{
struct DungeonEntityData *pokemonData = pokemon->entityData;
if ((pokemonData->sleepStatus != SLEEP_STATUS_SLEEPLESS
&& pokemonData->sleepStatus != SLEEP_STATUS_NONE)
|| pokemonData->immobilizeStatus == IMMOBILIZE_STATUS_FROZEN
|| pokemonData->immobilizeStatus == IMMOBILIZE_STATUS_PETRIFIED)
{
return TRUE;
}
if (pokemonData->chargingStatus == CHARGING_STATUS_BIDE)
{
return TRUE;
}
return FALSE;
}
|