diff options
author | PikalaxALT <pikalaxalt@gmail.com> | 2019-03-17 21:39:47 -0400 |
---|---|---|
committer | PikalaxALT <pikalaxalt@gmail.com> | 2019-03-18 08:40:31 -0400 |
commit | 655dd2f0c67bd39abf1562d42b8b35635ad578a8 (patch) | |
tree | e5268117d981b3a6891b2e36de66a4347380866f /include | |
parent | 7d0604cd61b699f7fd7319c698a5fc93d703ffc2 (diff) |
Fix matching HandleAction_UseItem
Diffstat (limited to 'include')
-rw-r--r-- | include/battle.h | 14 | ||||
-rw-r--r-- | include/battle_util.h | 39 | ||||
-rw-r--r-- | include/ewram.h | 3 | ||||
-rw-r--r-- | include/party_menu.h | 10 |
4 files changed, 64 insertions, 2 deletions
diff --git a/include/battle.h b/include/battle.h index ac95f6fff..a799f8360 100644 --- a/include/battle.h +++ b/include/battle.h @@ -21,7 +21,7 @@ #define B_ACTION_SAFARI_GO_NEAR 7 #define B_ACTION_SAFARI_RUN 8 // The exact purposes of these are unclear -#define B_ACTION_UNKNOWN9 9 +#define B_ACTION_WALLY_THROW 9 #define B_ACTION_EXEC_SCRIPT 10 // when executing an action #define B_ACTION_CANCEL_PARTNER 12 // when choosing an action #define B_ACTION_FINISHED 12 // when executing an action @@ -691,6 +691,18 @@ struct scriptsStack u8 size; }; +#define IS_TYPE_PHYSICAL(moveType)(moveType < TYPE_MYSTERY) +#define IS_TYPE_SPECIAL(moveType)(moveType > TYPE_MYSTERY) + +#define IS_BATTLER_OF_TYPE(battlerId, type)((gBattleMons[battlerId].type1 == type || gBattleMons[battlerId].type2 == type)) +#define SET_BATTLER_TYPE(battlerId, type) \ +{ \ + gBattleMons[battlerId].type1 = type; \ + gBattleMons[battlerId].type2 = type; \ +} + +#define GET_STAT_BUFF_VALUE2(n)((n & 0xF0)) + extern u8 gBattleTextBuff1[]; //function declarations of buffer emits diff --git a/include/battle_util.h b/include/battle_util.h index 15fa39d1a..3d178b487 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -10,6 +10,43 @@ #define BS_GET_PLAYER2 13 #define BS_GET_OPPONENT2 14 +#define MOVE_LIMITATION_ZEROMOVE (1 << 0) +#define MOVE_LIMITATION_PP (1 << 1) +#define MOVE_LIMITATION_DISABLED (1 << 2) +#define MOVE_LIMITATION_TORMENTED (1 << 3) +#define MOVE_LIMITATION_TAUNT (1 << 4) +#define MOVE_LIMITATION_IMPRISON (1 << 5) + +#define ABILITYEFFECT_ON_SWITCHIN 0x0 +#define ABILITYEFFECT_ENDTURN 0x1 +#define ABILITYEFFECT_MOVES_BLOCK 0x2 +#define ABILITYEFFECT_ABSORBING 0x3 +#define ABILITYEFFECT_MOVE_END 0x4 +#define ABILITYEFFECT_IMMUNITY 0x5 +#define ABILITYEFFECT_FORECAST 0x6 +#define ABILITYEFFECT_SYNCHRONIZE 0x7 +#define ABILITYEFFECT_ATK_SYNCHRONIZE 0x8 +#define ABILITYEFFECT_INTIMIDATE1 0x9 +#define ABILITYEFFECT_INTIMIDATE2 0xA +#define ABILITYEFFECT_TRACE 0xB +#define ABILITYEFFECT_CHECK_OTHER_SIDE 0xC +#define ABILITYEFFECT_CHECK_BATTLER_SIDE 0xD +#define ABILITYEFFECT_FIELD_SPORT 0xE +#define ABILITYEFFECT_CHECK_FIELD_EXCEPT_BATTLER 0xF +#define ABILITYEFFECT_COUNT_OTHER_SIDE 0x10 +#define ABILITYEFFECT_COUNT_BATTLER_SIDE 0x11 +#define ABILITYEFFECT_COUNT_ON_FIELD 0x12 +#define ABILITYEFFECT_CHECK_ON_FIELD 0x13 +#define ABILITYEFFECT_SWITCH_IN_WEATHER 0xFF + +#define ABILITY_ON_OPPOSING_FIELD(battlerId, abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_OTHER_SIDE, battlerId, abilityId, 0, 0)) +#define ABILITY_ON_FIELD(abilityId)(AbilityBattleEffects(ABILITYEFFECT_CHECK_ON_FIELD, 0, abilityId, 0, 0)) +#define ABILITY_ON_FIELD2(abilityId)(AbilityBattleEffects(ABILITYEFFECT_FIELD_SPORT, 0, abilityId, 0, 0)) + +#define ITEMEFFECT_ON_SWITCH_IN 0x0 +#define ITEMEFFECT_MOVE_END 0x3 +#define ITEMEFFECT_KINGSROCK_SHELLBELL 0x4 + void TryClearRageStatuses(void); void BattleScriptPush(const u8* BS_ptr); void PressurePPLoseOnUsingImprision(u8 bankAtk); @@ -25,5 +62,7 @@ bool8 HandleWishPerishSongOnTurnEnd(void); void BattleScriptExecute(const u8* BS_ptr); void BattleScriptPushCursorAndCallback(u8* BS_ptr); u8 IsMonDisobedient(void); +bool8 AreAllMovesUnusable(void); +u8 TrySetCantSelectMoveBattleScript(void); #endif // GUARD_BATTLE_UTIL_H diff --git a/include/ewram.h b/include/ewram.h index 01c4c3492..976ccd47d 100644 --- a/include/ewram.h +++ b/include/ewram.h @@ -133,6 +133,7 @@ extern u8 gSharedMem[]; #define ewram1608B gSharedMem[0x1608B] #define ewram1608Carr(battler) (gSharedMem[0x1608C + battler]) +#define ewram16094arr(battler) (gSharedMem[0x16094 + battler]) #define EWRAM_1609D (gSharedMem[0x1609D]) #define ewram160A1 (gSharedMem[0x160A1]) #define ewram160A4 (gSharedMem[0x160A4]) @@ -160,7 +161,7 @@ extern u8 gSharedMem[]; #define USED_HELD_ITEMS(battler) (*(u16 *)&gSharedMem[0x160CC + 2 * (battler)]) #define ewram160D4(battler) (gSharedMem[0x160D4 + (battler / 2) * 2]) #define ewram160D8(battler) (gSharedMem[0x160D8 + (battler / 2)]) -#define ewram160DA(battler) (gSharedMem[0x160DA + (battler / 2)]) +#define ewram160DA(battler) (gSharedMem[0x160DA + (battler >> 1)]) #define ewram160DD (gSharedMem[0x160DD]) #define ewram160E0(i) (gSharedMem[0x160E0 + i]) #define ewram160E6 (gSharedMem[0x160E6]) diff --git a/include/party_menu.h b/include/party_menu.h index e687f48c4..172435b2d 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -17,6 +17,16 @@ enum PARTY_MENU_TYPE_MOVE_TUTOR, }; +enum +{ + PARTY_CHOOSE_MON, + PARTY_MUST_CHOOSE_MON, + PARTY_CANT_SWITCH, + PARTY_USE_ITEM_ON, + PARTY_ABILITY_PREVENTS, + PARTY_GIVE_ITEM, +}; + // The party menu screen is presented differently depending on which menu layout is set. enum { |