diff options
author | DizzyEggg <jajkodizzy@wp.pl> | 2017-10-13 12:18:32 +0200 |
---|---|---|
committer | DizzyEggg <jajkodizzy@wp.pl> | 2017-10-13 12:18:32 +0200 |
commit | b229a1c295f9c4a722959ec564a1cb86d1a9eaef (patch) | |
tree | 59bb968ae154c586342dfee05d9cc8b2c1776b4f /include | |
parent | e382a73e9d706fee763723b5a275b36db3b0fc97 (diff) | |
parent | 428dd0e0a8539b171fccc59ea717fda970a22e91 (diff) |
Merge branch 'master' into decompile_reshow_battle_screen
Diffstat (limited to 'include')
-rw-r--r-- | include/battle.h | 7 | ||||
-rw-r--r-- | include/battle_ai_switch_items.h | 17 | ||||
-rw-r--r-- | include/battle_controllers.h | 1 | ||||
-rw-r--r-- | include/battle_script_commands.h | 2 | ||||
-rw-r--r-- | include/diploma.h | 6 | ||||
-rw-r--r-- | include/pokemon.h | 1 | ||||
-rw-r--r-- | include/pokemon_item_effects.h | 54 |
7 files changed, 84 insertions, 4 deletions
diff --git a/include/battle.h b/include/battle.h index c9d202fd0..6e41b25c1 100644 --- a/include/battle.h +++ b/include/battle.h @@ -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; diff --git a/include/battle_ai_switch_items.h b/include/battle_ai_switch_items.h new file mode 100644 index 000000000..0a230e7f6 --- /dev/null +++ b/include/battle_ai_switch_items.h @@ -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 diff --git a/include/battle_controllers.h b/include/battle_controllers.h index 75cdf457b..e710deea5 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -86,5 +86,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 diff --git a/include/battle_script_commands.h b/include/battle_script_commands.h index ae0d20f28..590944f02 100644 --- a/include/battle_script_commands.h +++ b/include/battle_script_commands.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); diff --git a/include/diploma.h b/include/diploma.h new file mode 100644 index 000000000..8d730fa05 --- /dev/null +++ b/include/diploma.h @@ -0,0 +1,6 @@ +#ifndef GUARD_DIPLOMA_H +#define GUARD_DIPLOMA_H + +void CB2_ShowDiploma(void); + +#endif // GUARD_DIPLOMA_H 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 |