summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/battle.h6
-rw-r--r--include/battle_ai_switch_items.h10
-rw-r--r--include/pokemon.h1
-rw-r--r--include/pokemon_item_effects.h54
4 files changed, 68 insertions, 3 deletions
diff --git a/include/battle.h b/include/battle.h
index 0aa778fe2..a60f450ce 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -477,7 +477,7 @@ struct BattleHistory
struct UsedMoves usedMoves[BATTLE_BANKS_COUNT];
u8 abilities[BATTLE_BANKS_COUNT];
u8 itemEffects[BATTLE_BANKS_COUNT];
- u16 TrainerItems[BATTLE_BANKS_COUNT];
+ u16 trainerItems[BATTLE_BANKS_COUNT];
u8 itemsNo;
};
@@ -633,8 +633,8 @@ struct BattleStruct
void (*savedCallback)(void);
u16 usedHeldItems[BATTLE_BANKS_COUNT];
u8 field_C0[4];
- u8 field_C4[2];
- u8 field_C6[2];
+ u8 AI_itemType[2];
+ u8 AI_itemFlags[2];
u16 choicedMove[BATTLE_BANKS_COUNT];
u16 changedItems[BATTLE_BANKS_COUNT];
u8 intimidateBank;
diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h
index 5c78a5386..0a230e7f6 100644
--- a/include/battle_ai_switch_items.h
+++ b/include/battle_ai_switch_items.h
@@ -1,6 +1,16 @@
#ifndef GUARD_BATTLE_AI_SWITCH_ITEMS_H
#define GUARD_BATTLE_AI_SWITCH_ITEMS_H
+enum
+{
+ AI_ITEM_FULL_RESTORE = 1,
+ AI_ITEM_HEAL_HP,
+ AI_ITEM_CURE_CONDITION,
+ AI_ITEM_X_STAT,
+ AI_ITEM_GUARD_SPECS,
+ AI_ITEM_NOT_RECOGNIZABLE
+};
+
void AI_TrySwitchOrUseItem(void);
u8 GetMostSuitableMonToSwitchInto(void);
diff --git a/include/pokemon.h b/include/pokemon.h
index 263a37426..c26c28afa 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -642,6 +642,7 @@ void UpdatePartyPokerusTime(u16 days);
void PartySpreadPokerus(struct Pokemon *party);
s8 GetMonFlavourRelation(struct Pokemon *mon, u8 a2);
s8 GetFlavourRelationByPersonality(u32 personality, u8 a2);
+u8 GetItemEffectParamOffset(u16 itemId, u8 effectByte, u8 effectBit);
#include "sprite.h"
diff --git a/include/pokemon_item_effects.h b/include/pokemon_item_effects.h
index 88f341317..505cc0f25 100644
--- a/include/pokemon_item_effects.h
+++ b/include/pokemon_item_effects.h
@@ -3,6 +3,60 @@
#include "pokemon.h"
+// TODO once pokemon item effects is decompiled
+/*
+struct PokemonItemEffect
+{
+ //field 0
+ u8 xAtk : 4; // x1, x2, x4, x8 = xF
+ u8 field_0_x10 : 1; // x10
+ u8 critRatioUp : 1; // x20
+ u8 field_0_x40 : 1; // x40
+ u8 cureInfatuation : 1; // x80
+
+ /*field 1
+ u8 xSpeed : 4; // x1, x2, x4, x8 = xF
+ u8 xDefense : 4; // x10, x20, x40, xF0
+
+ /*field 2
+ u8 xSpAtk : 4; // x1, x2, x4, x8 = xF
+ u8 xAccuracy : 4; // x10, x20, x40, xF0
+
+ /*field 3
+ u8 cureConfusion : 1; // x1
+ u8 cureParalysis : 1; // x2
+ u8 cureFreeze : 1; // x4
+ u8 cureBurn : 1; // x8
+ u8 curePoison : 1; // x10
+ u8 cureSleep : 1; // x20
+ u8 field_3_x40 : 1; // x40
+ u8 cantLowerStats : 1; // x80
+
+ /*field 4
+ u8 hpEv : 1; // x1
+ u8 attackEv : 1; // x2
+ u8 healHp : 1; // x4
+ u8 field_4_x8 : 1; // x8
+ u8 field_4_x10 : 1; // x10
+ u8 ppUp : 1; // x20
+ u8 levelUp : 1; // x40
+ u8 evolutionStone : 1; // x80
+
+ /*field 5
+ u8 defEv: 1; // x1
+ u8 speedEv : 1; // x2
+ u8 spDefEv : 1; // x4
+ u8 spAtkEv : 1; // x8
+ u8 ppMax : 1; // x10
+ u8 field_5_x20 : 1; // x20
+ u8 field_5_x40 : 1; // x40
+ u8 field_5_x80 : 1; // x80
+
+ /*field 6
+ u8 value;
+};
+*/
+
bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 itemId, u8 partyId, u8 monMoveIndex, u8 a5);
#endif // GUARD_POKEMON_ITEM_EFFECTS