Merge branch 'decompile_battle_9' of https://github.com/DizzyEggg/pokeemerald into DizzyEggg-decompile_battle_9
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "battle_util.h"
|
||||
#include "battle_script_commands.h"
|
||||
#include "battle_2.h"
|
||||
#include "battle_ai_switch_items.h"
|
||||
|
||||
/*
|
||||
Banks are a name given to what could be called a 'battlerId' or 'monControllerId'.
|
||||
@@ -476,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;
|
||||
};
|
||||
|
||||
@@ -632,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;
|
||||
|
||||
17
include/battle_ai_switch_items.h
Normal file
17
include/battle_ai_switch_items.h
Normal file
@@ -0,0 +1,17 @@
|
||||
#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);
|
||||
|
||||
#endif // GUARD_BATTLE_AI_SWITCH_ITEMS_H
|
||||
@@ -84,5 +84,6 @@ void Emit_x32(u8 bufferId);
|
||||
void EmitPrintString(u8 bufferId, u16 stringId);
|
||||
void EmitResetActionMoveSelection(u8 bufferId, u8 caseId);
|
||||
void EmitBallThrow(u8 bufferId, u8 caseId);
|
||||
void EmitCmd_x21(u8 bufferId, u8 arg1, u16 arg2);
|
||||
|
||||
#endif // GUARD_BATTLE_CONTROLLERS_H
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
void AI_CalcDmg(u8 bankAtk, u8 bankDef);
|
||||
u8 TypeCalc(u16 move, u8 bankAtk, u8 bankDef);
|
||||
u8 AI_TypeCalc(u16 move, u16 species, u8 ability);
|
||||
u8 AI_TypeCalc(u16 move, u16 targetSpecies, u8 targetAbility);
|
||||
u8 BankGetTurnOrder(u8 bank);
|
||||
void SetMoveEffect(bool8 primary, u8 certain);
|
||||
void BattleDestroyCursorAt(u8 cursorPosition);
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user