Merge branch 'upcoming' into rhh-get-party

This commit is contained in:
Martin Griffin 2023-04-26 12:12:03 +01:00 committed by GitHub
commit 4a0abc5129
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
85 changed files with 1125 additions and 384 deletions

View File

@ -2077,6 +2077,14 @@
various \battler, VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES
.endm
.macro trytrainerslidezmovemsg battler:req
various \battler, VARIOUS_TRY_TRAINER_SLIDE_MSG_Z_MOVE
.endm
.macro trytrainerslidemegaevolutionmsg battler:req
various \battler, VARIOUS_TRY_TRAINER_SLIDE_MSG_MEGA_EVOLUTION
.endm
@ helpful macros
.macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER, \stat | \stages << 3 | \down << 7

View File

@ -24463,6 +24463,7 @@ General_TurnTrap:
jumpargeq 0, TRAP_ANIM_MAGMA_STORM, Status_MagmaStorm
jumpargeq 0, TRAP_ANIM_INFESTATION, Status_Infestation
jumpargeq 0, TRAP_ANIM_SNAP_TRAP, Status_Snap_Trap
jumpargeq 0, TRAP_ANIM_THUNDER_CAGE, Status_Thunder_Cage
goto Status_BindWrap
Status_BindWrap:
loadspritegfx ANIM_TAG_TENDRILS
@ -24549,6 +24550,10 @@ Status_Clamp:
waitforvisualfinish
end
Status_Thunder_Cage:
@ TODO
goto Move_THUNDER_CAGE
Status_Snap_Trap: @ placeholder
goto Move_BITE

View File

@ -7871,6 +7871,8 @@ BattleScript_FocusPunchSetUp::
end2
BattleScript_MegaEvolution::
printstring STRINGID_EMPTYSTRING3
trytrainerslidemegaevolutionmsg BS_ATTACKER
printstring STRINGID_MEGAEVOREACTING
BattleScript_MegaEvolutionAfeterString:
waitmessage B_WAIT_TIME_LONG
@ -7886,6 +7888,8 @@ BattleScript_MegaEvolutionAfeterString:
end2
BattleScript_WishMegaEvolution::
printstring STRINGID_EMPTYSTRING3
trytrainerslidemegaevolutionmsg BS_ATTACKER
printstring STRINGID_FERVENTWISHREACHED
goto BattleScript_MegaEvolutionAfeterString
@ -9180,7 +9184,7 @@ BattleScript_WanderingSpiritActivates::
pause 20
destroyabilitypopup
pause 40
copybyte gBattlerAbility, gBattlerAttacker
setbyte sFIXED_ABILITY_POPUP, TRUE
copyhword sABILITY_OVERWRITE, gLastUsedAbility
showabilitypopup BS_ATTACKER
@ -10075,6 +10079,8 @@ BattleScript_JabocaRowapBerryActivate_Dmg:
@ z moves / effects
BattleScript_ZMoveActivateDamaging::
printstring STRINGID_EMPTYSTRING3
trytrainerslidezmovemsg BS_ATTACKER
printstring STRINGID_ZPOWERSURROUNDS
playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL
printstring STRINGID_ZMOVEUNLEASHED
@ -10082,6 +10088,8 @@ BattleScript_ZMoveActivateDamaging::
return
BattleScript_ZMoveActivateStatus::
printstring STRINGID_EMPTYSTRING3
trytrainerslidezmovemsg BS_ATTACKER
savetarget
printstring STRINGID_ZPOWERSURROUNDS
playanimation BS_ATTACKER, B_ANIM_ZMOVE_ACTIVATE, NULL
@ -10387,3 +10395,30 @@ BattleScript_CouldntFullyProtect::
printstring STRINGID_COULDNTFULLYPROTECT
waitmessage B_WAIT_TIME_LONG
return
BattleScript_BerserkGeneRet::
BattleScript_BerserkGeneRet_Anim:
statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_BerserkGeneRet_TryConfuse
setgraphicalstatchangevalues
playanimation BS_SCRIPTING, B_ANIM_HELD_ITEM_EFFECT, sB_ANIM_ARG1
setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_ROSE_ITEM
call BattleScript_StatUp
BattleScript_BerserkGeneRet_TryConfuse:
jumpifability BS_SCRIPTING, ABILITY_OWN_TEMPO, BattleScript_BerserkGeneRet_OwnTempoPrevents
jumpifsafeguard BattleScript_BerserkGeneRet_SafeguardProtected
setmoveeffect MOVE_EFFECT_CONFUSION
seteffectprimary
goto BattleScript_BerserkGeneRet_End
BattleScript_BerserkGeneRet_SafeguardProtected::
pause B_WAIT_TIME_SHORT
printstring STRINGID_PKMNUSEDSAFEGUARD
waitmessage B_WAIT_TIME_LONG
goto BattleScript_BerserkGeneRet_End
BattleScript_BerserkGeneRet_OwnTempoPrevents:
pause B_WAIT_TIME_SHORT
call BattleScript_AbilityPopUp
printstring STRINGID_PKMNPREVENTSCONFUSIONWITH
waitmessage B_WAIT_TIME_LONG
BattleScript_BerserkGeneRet_End:
removeitem BS_SCRIPTING
end3

View File

@ -49,14 +49,13 @@ BattleScript_UseItemMessage:
BattleScript_ItemRestoreHP::
call BattleScript_UseItemMessage
itemrestorehp
printstring STRINGID_ITEMRESTOREDSPECIESHEALTH
waitmessage B_WAIT_TIME_LONG
jumpifbyte CMP_EQUAL, gBattleCommunication, TRUE, BattleScript_ItemRestoreHP_SendOutRevivedBattler
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
updatestatusicon BS_ATTACKER
printstring STRINGID_ITEMRESTOREDSPECIESHEALTH
waitmessage B_WAIT_TIME_LONG
end
BattleScript_ItemRestoreHP_SendOutRevivedBattler:
@ -68,22 +67,22 @@ BattleScript_ItemRestoreHP_SendOutRevivedBattler:
BattleScript_ItemCureStatus::
call BattleScript_UseItemMessage
itemcurestatus
updatestatusicon BS_ATTACKER
printstring STRINGID_ITEMCUREDSPECIESSTATUS
waitmessage B_WAIT_TIME_LONG
updatestatusicon BS_ATTACKER
end
BattleScript_ItemHealAndCureStatus::
call BattleScript_UseItemMessage
itemrestorehp
curestatus BS_ATTACKER
printstring STRINGID_ITEMRESTOREDSPECIESHEALTH
waitmessage B_WAIT_TIME_LONG
bichalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER
updatestatusicon BS_ATTACKER
printstring STRINGID_ITEMRESTOREDSPECIESHEALTH
waitmessage B_WAIT_TIME_LONG
end
BattleScript_ItemIncreaseStat::

View File

@ -0,0 +1,19 @@
JASC-PAL
0100
16
212 146 75
49 49 49
131 123 131
98 90 98
74 65 74
164 90 222
230 180 255
255 230 238
255 230 106
255 189 74
255 171 32
238 148 0
255 246 189
123 82 32
0 0 0
0 0 0

Binary file not shown.

After

Width:  |  Height:  |  Size: 356 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 802 B

After

Width:  |  Height:  |  Size: 738 B

View File

@ -11,8 +11,8 @@ JASC-PAL
16 16 16
128 216 160
224 248 216
112 56 56
176 64 64
112 56 56
128 216 160
0 0 0
0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 725 B

After

Width:  |  Height:  |  Size: 737 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

After

Width:  |  Height:  |  Size: 524 B

View File

@ -14,6 +14,6 @@ JASC-PAL
248 232 176
248 120 88
152 40 72
104 88 80
248 120 88
0 0 0
0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -13,7 +13,7 @@ JASC-PAL
248 232 144
192 168 64
248 248 248
88 72 64
104 104 104
176 176 192
0 0 0
0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -11,8 +11,8 @@ JASC-PAL
246 230 197
230 213 164
57 65 106
139 106 82
98 98 148
139 106 82
255 255 255
172 123 74
255 213 123

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -14,6 +14,6 @@ JASC-PAL
136 32 72
136 160 200
192 200 224
16 16 16
224 104 40
248 144 96
16 16 16

Binary file not shown.

Before

Width:  |  Height:  |  Size: 966 B

After

Width:  |  Height:  |  Size: 897 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -11,7 +11,7 @@ JASC-PAL
128 104 168
56 44 88
160 136 72
255 255 255
248 236 144
16 16 16
208 196 112
104 80 40

View File

@ -1,19 +0,0 @@
JASC-PAL
0100
16
152 208 160
160 28 200
216 60 224
224 76 144
216 52 48
88 72 128
40 28 72
128 104 168
56 44 88
160 136 72
248 236 144
16 16 16
208 196 112
104 80 40
0 0 0
0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

@ -517,7 +517,7 @@ struct ZMoveData
u8 splits[MAX_BATTLERS_COUNT];
};
struct StolenItem
struct LostItem
{
u16 originalItem:15;
u16 stolen:1;
@ -640,7 +640,7 @@ struct BattleStruct
u16 moveEffect2; // For Knock Off
u16 changedSpecies[PARTY_SIZE]; // For Zygarde or future forms when multiple mons can change into the same pokemon.
u8 quickClawBattlerId;
struct StolenItem itemStolen[PARTY_SIZE]; // Player's team that had items stolen (two bytes per party member)
struct LostItem itemLost[PARTY_SIZE]; // Player's team that had items consumed or stolen (two bytes per party member)
u8 blunderPolicy:1; // should blunder policy activate
u8 swapDamageCategory:1; // Photon Geyser, Shell Side Arm, Light That Burns the Sky
u8 forcedSwitch:4; // For each battler
@ -661,6 +661,14 @@ struct BattleStruct
u8 storedLunarDance:4; // Each battler as a bit.
u16 supremeOverlordModifier[MAX_BATTLERS_COUNT];
u8 itemPartyIndex[MAX_BATTLERS_COUNT];
bool8 trainerSlideHalfHpMsgDone;
u8 trainerSlideFirstCriticalHitMsgState:2;
u8 trainerSlideFirstSuperEffectiveHitMsgState:2;
u8 trainerSlideFirstSTABMoveMsgState:2;
u8 trainerSlidePlayerMonUnaffectedMsgState:2;
bool8 trainerSlideMegaEvolutionMsgDone;
bool8 trainerSlideZMoveMsgDone;
bool8 trainerSlideBeforeFirstTurnMsgDone;
};
#define F_DYNAMIC_TYPE_1 (1 << 6)

View File

@ -229,6 +229,14 @@ enum
TRAINER_SLIDE_LAST_SWITCHIN,
TRAINER_SLIDE_LAST_LOW_HP,
TRAINER_SLIDE_FIRST_DOWN,
TRAINER_SLIDE_LAST_HALF_HP,
TRAINER_SLIDE_FIRST_CRITICAL_HIT,
TRAINER_SLIDE_FIRST_SUPER_EFFECTIVE_HIT,
TRAINER_SLIDE_FIRST_STAB_MOVE,
TRAINER_SLIDE_PLAYER_MON_UNAFFECTED,
TRAINER_SLIDE_MEGA_EVOLUTION,
TRAINER_SLIDE_Z_MOVE,
TRAINER_SLIDE_BEFORE_FIRST_TURN,
};
void BufferStringBattle(u16 stringID);

View File

@ -461,6 +461,7 @@ extern const u8 BattleScript_CouldntFullyProtect[];
extern const u8 BattleScript_MoveEffectStockpileWoreOff[];
extern const u8 BattleScript_StealthRockActivates[];
extern const u8 BattleScript_SpikesActivates[];
extern const u8 BattleScript_BerserkGeneRet[];
// zmoves
extern const u8 BattleScript_ZMoveActivateDamaging[];

View File

@ -196,7 +196,7 @@ bool32 IsPartnerMonFromSameTrainer(u8 battlerId);
u8 GetSplitBasedOnStats(u8 battlerId);
void SortBattlersBySpeed(u8 *battlers, bool8 slowToFast);
bool32 TestSheerForceFlag(u8 battler, u16 move);
void TryRestoreStolenItems(void);
void TryRestoreHeldItems(void);
bool32 CanStealItem(u8 battlerStealing, u8 battlerItem, u16 item);
void TrySaveExchangedItem(u8 battlerId, u16 stolenItem);
bool32 IsPartnerMonFromSameTrainer(u8 battlerId);
@ -233,5 +233,6 @@ u32 GetBattlerFriendshipScore(u8 battlerId);
u32 CountBattlerStatIncreases(u8 battlerId, bool32 countEvasionAcc);
bool32 IsMyceliumMightOnField(void);
bool8 ChangeTypeBasedOnTerrain(u8 battlerId);
void RemoveConfusionStatus(u8 battlerId);
#endif // GUARD_BATTLE_UTIL_H

View File

@ -98,7 +98,7 @@
#define B_HEALING_WISH_SWITCH GEN_LATEST // In Gen5+, the mon receiving Healing Wish is sent out at the end of the turn.
// Additionally, in gen8+ the Healing Wish's effect will be stored until the user switches into a statused or hurt mon.
#define B_DEFOG_CLEARS_TERRAIN GEN_LATEST // In Gen8+, Defog also clears active Terrain.
#define B_STOCKPILE_RAISES_DEFS GEN_LATEST // In Gen4+, Stockpile also raises Defense and Sp.Defense stats. Once Spit Up / Swallow is used, these stat changes are lost.
#define B_STOCKPILE_RAISES_DEFS GEN_LATEST // In Gen4+, Stockpile also raises Defense and Sp. Defense stats. Once Spit Up / Swallow is used, these stat changes are lost.
// Ability settings
#define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters.
@ -126,6 +126,7 @@
#define B_X_ITEMS_BUFF GEN_LATEST // In Gen7+, the X Items raise a stat by 2 stages instead of 1.
#define B_MENTAL_HERB GEN_LATEST // In Gen5+, the Mental Herb cures Taunt, Encore, Torment, Heal Block, and Disable in addition to Infatuation from before.
#define B_TRAINERS_KNOCK_OFF_ITEMS TRUE // If TRUE, trainers can steal/swap your items (non-berries are restored after battle). In vanilla games trainers cannot steal items.
#define B_RESTORE_HELD_BATTLE_ITEMS TRUE // In Gen9 all non berry items are restored after battle.
#define B_SOUL_DEW_BOOST GEN_LATEST // In Gens3-6, Soul Dew boosts Lati@s' Sp. Atk and Sp. Def. In Gen7+ it boosts the power of their Psychic and Dragon type moves instead.
#define B_NET_BALL_MODIFIER GEN_LATEST // In Gen7+, Net Ball's catch multiplier is x5 instead of x3.
#define B_DIVE_BALL_MODIFIER GEN_LATEST // In Gen4+, Dive Ball's effectiveness increases by when Surfing or Fishing.
@ -155,6 +156,9 @@
#define VAR_TERRAIN 0 // If this var has a value, assigning a STATUS_FIELD_xx_TERRAIN to it before battle causes the battle to start with that terrain active
#define B_VAR_WILD_AI_FLAGS 0 // If not 0, you can use this var to add to default wild AI flags. NOT usable with flags above (1 << 15)
// Flag and Var settings
#define B_RESET_FLAGS_VARS_AFTER_WHITEOUT TRUE // If TRUE, Overworld_ResetBattleFlagsAndVars will reset battle-related Flags and Vars when the player whites out.
// Terrain settings
#define B_TERRAIN_BG_CHANGE TRUE // If set to TRUE, terrain moves permanently change the default battle background until the effect fades.
#define B_THUNDERSTORM_TERRAIN TRUE // If TRUE, overworld Thunderstorm generates Rain and Electric Terrain as in Gen 8.
@ -195,6 +199,7 @@
#define B_NEW_SWORD_PARTICLE FALSE // If set to TRUE, it updates Swords Dance's particle.
#define B_NEW_LEECH_SEED_PARTICLE FALSE // If set to TRUE, it updates Leech Seed's animation particle.
#define B_NEW_HORN_ATTACK_PARTICLE FALSE // If set to TRUE, it updates Horn Attack's horn particle.
#define B_NEW_ROCKS_PARTICLE TRUE // If set to TRUE, it updates rock particles.
#define B_NEW_LEAF_PARTICLE FALSE // If set to TRUE, it updates leaf particle.
#define B_NEW_EMBER_PARTICLES FALSE // If set to TRUE, it updates Ember's fire particle.
#define B_NEW_MEAN_LOOK_PARTICLE FALSE // If set to TRUE, it updates Mean Look's eye particle.

View File

@ -7,7 +7,11 @@
#define I_KEY_ESCAPE_ROPE GEN_LATEST // In Gen8, Escape Rope became a Key Item. Keep in mind, this will make it free to buy in marts.
#define I_HEALTH_RECOVERY GEN_LATEST // In Gen7+, certain healing items recover a different amount of HP than they used to.
#define I_SITRUS_BERRY_HEAL GEN_LATEST // In Gen4+, Sitrus Berry was changed from healing 30 HP to healing 25% of Max HP.
#define I_VITAMIN_EV_CAP GEN_LATEST // In Gen8, the Vitamins no longer have a cap of 100 EV per stat.
#define I_VITAMIN_EV_CAP GEN_LATEST // In Gen8+, the Vitamins no longer have a cap of 100 EV per stat.
#define I_BERRY_EV_JUMP GEN_LATEST // In Gen4 only, EV-lowering Berries lower a stat's EV to 100 if it is above 100.
// TM config
#define I_REUSABLE_TMS FALSE // In Gen5-8, TMs are reusable. Setting this to TRUE will make all vanilla TMs reusable, though they can also be cherry-picked by setting their importance to 1.
// Repel/Lure config
// These two settings are both independent and complementary.

View File

@ -21,6 +21,7 @@
// Other settings
#define P_LEGENDARY_PERFECT_IVS GEN_LATEST // Since Gen 6, Legendaries, Mythicals and Ultra Beasts found in the wild or given through gifts have at least 3 perfect IVs.
#define P_EV_CAP GEN_LATEST // Since Gen 6, the max EVs per stat is 252 instead of 255.
// Flag settings
// To use the following features in scripting, replace the 0s with the flag ID you're assigning it to.

View File

@ -185,6 +185,7 @@
#define STATUS4_PLASMA_FISTS (1 << 1)
#define STATUS4_MUD_SPORT (1 << 2) // Only used if B_SPORT_TURNS < GEN_6
#define STATUS4_WATER_SPORT (1 << 3) // Only used if B_SPORT_TURNS < GEN_6
#define STATUS4_INFINITE_CONFUSION (1 << 4) // Used for Berserk Gene
#define HITMARKER_WAKE_UP_CLEAR (1 << 4) // Cleared when waking up. Never set or checked.
#define HITMARKER_SKIP_DMG_TRACK (1 << 5)

View File

@ -583,6 +583,7 @@
#define TRAP_ANIM_MAGMA_STORM 5
#define TRAP_ANIM_INFESTATION 6
#define TRAP_ANIM_SNAP_TRAP 7
#define TRAP_ANIM_THUNDER_CAGE 8
// Weather defines for battle animation scripts.
#define ANIM_WEATHER_NONE 0

View File

@ -260,6 +260,8 @@
#define VARIOUS_HIT_SWITCH_TARGET_FAILED 168
#define VARIOUS_JUMP_IF_SHELL_TRAP 169
#define VARIOUS_TRY_REVIVAL_BLESSING 170
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_Z_MOVE 171
#define VARIOUS_TRY_TRAINER_SLIDE_MSG_MEGA_EVOLUTION 172
// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0

View File

@ -651,8 +651,9 @@
#define STRINGID_ITEMRESTOREDSPECIESHEALTH 649
#define STRINGID_ITEMCUREDSPECIESSTATUS 650
#define STRINGID_ITEMRESTOREDSPECIESPP 651
#define STRINGID_THUNDERCAGETRAPPED 652
#define BATTLESTRINGS_COUNT 652
#define BATTLESTRINGS_COUNT 653
// This is the string id that gBattleStringsTable starts with.
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,
@ -926,7 +927,8 @@
#define B_MSG_WRAPPED_MAGMA_STORM 6
#define B_MSG_WRAPPED_INFESTATION 7
#define B_MSG_WRAPPED_SNAP_TRAP 8
#define NUM_TRAPPING_MOVES 9
#define B_MSG_WRAPPED_THUNDER_CAGE 9
#define NUM_TRAPPING_MOVES 10
// z effects
#define B_MSG_Z_RESET_STATS 0

View File

@ -161,6 +161,9 @@
#define HOLD_EFFECT_LOADED_DICE 180
#define HOLD_EFFECT_BOOSTER_ENERGY 181 // Not implemented.
// Gen2 hold effect
#define HOLD_EFFECT_BERSERK_GENE 182
#define HOLD_EFFECT_CHOICE(holdEffect)((holdEffect == HOLD_EFFECT_CHOICE_BAND || holdEffect == HOLD_EFFECT_CHOICE_SCARF || holdEffect == HOLD_EFFECT_CHOICE_SPECS))
// Terrain seed params

View File

@ -972,8 +972,9 @@
#define ITEM_BLACK_AUGURITE 795
#define ITEM_LINKING_CORD 796
#define ITEM_PEAT_BLOCK 797
#define ITEM_BERSERK_GENE 798
#define ITEMS_COUNT 798
#define ITEMS_COUNT 799
#define ITEM_FIELD_ARROW ITEMS_COUNT
// A special item id associated with "Cancel"/"Exit" etc. in a list of items or decorations

View File

@ -201,7 +201,11 @@
#define MAX_PER_STAT_IVS 31
#define MAX_IV_MASK 31
#define USE_RANDOM_IVS (MAX_PER_STAT_IVS + 1)
#if P_EV_CAP >= GEN_6
#define MAX_PER_STAT_EVS 252
#else
#define MAX_PER_STAT_EVS 255
#endif
#define MAX_TOTAL_EVS 510
#if I_VITAMIN_EV_CAP >= GEN_8
#define EV_ITEM_RAISE_LIMIT MAX_PER_STAT_EVS

View File

@ -8878,6 +8878,8 @@ extern const u32 gItemIcon_GriseousCore[];
extern const u32 gItemIconPalette_GriseousCore[];
extern const u32 gItemIcon_LustrousGlobe[];
extern const u32 gItemIconPalette_LustrousGlobe[];
extern const u32 gItemIcon_BerserkGene[];
extern const u32 gItemIconPalette_BerserkGene[];
extern const u32 gItemIcon_ReturnToFieldArrow[];
extern const u32 gItemIconPalette_ReturnToFieldArrow[];

View File

@ -1025,6 +1025,8 @@ extern const u8 gText_ThrowInPremierBall[];
extern const u8 gText_ShopBuy[];
extern const u8 gText_ShopSell[];
extern const u8 gText_ShopQuit[];
extern const u8 gText_ThatItemIsSoldOut[];
extern const u8 gText_SoldOut[];
extern const u8 gText_OhABite[];
extern const u8 gText_PokemonOnHook[];

View File

@ -1129,7 +1129,7 @@ bool32 CanTargetFaintAi(u8 battlerDef, u8 battlerAtk)
{
s32 i, dmg;
u32 unusable = AI_DATA->moveLimitations[battlerDef];
u16 *moves = gBattleResources->battleHistory->usedMoves[battlerDef];
u16 *moves = GetMovesArray(battlerDef);
for (i = 0; i < MAX_MON_MOVES; i++)
{

View File

@ -2736,22 +2736,36 @@ void AnimTask_SetAttackerTargetLeftPos(u8 taskId)
void AnimTask_GetTrappedMoveAnimId(u8 taskId)
{
if (gBattleSpritesDataPtr->animationData->animArg == MOVE_FIRE_SPIN)
switch (gBattleSpritesDataPtr->animationData->animArg)
{
case MOVE_FIRE_SPIN:
gBattleAnimArgs[0] = TRAP_ANIM_FIRE_SPIN;
else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_WHIRLPOOL)
break;
case MOVE_WHIRLPOOL:
gBattleAnimArgs[0] = TRAP_ANIM_WHIRLPOOL;
else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_CLAMP)
break;
case MOVE_CLAMP:
gBattleAnimArgs[0] = TRAP_ANIM_CLAMP;
else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_SAND_TOMB)
break;
case MOVE_SAND_TOMB:
gBattleAnimArgs[0] = TRAP_ANIM_SAND_TOMB;
else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_MAGMA_STORM)
break;
case MOVE_MAGMA_STORM:
gBattleAnimArgs[0] = TRAP_ANIM_MAGMA_STORM;
else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_INFESTATION)
break;
case MOVE_INFESTATION:
gBattleAnimArgs[0] = TRAP_ANIM_INFESTATION;
else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_SNAP_TRAP)
break;
case MOVE_SNAP_TRAP:
gBattleAnimArgs[0] = TRAP_ANIM_SNAP_TRAP;
else
break;
case MOVE_THUNDER_CAGE:
gBattleAnimArgs[0] = TRAP_ANIM_THUNDER_CAGE;
break;
default:
gBattleAnimArgs[0] = TRAP_ANIM_BIND;
break;
}
DestroyAnimVisualTask(taskId);
}

View File

@ -228,9 +228,11 @@ static void Intro_DelayAndEnd(void)
}
}
static bool32 TwoIntroMons(u32 battlerId) // Double battle with both player pokemon active.
static bool32 TwoIntroMons(u32 battlerId) // Double battle with both opponent pokemon active.
{
return (IsDoubleBattle() && IsValidForBattle(&gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)]]));
return (IsDoubleBattle()
&& IsValidForBattle(&gEnemyParty[gBattlerPartyIndexes[battlerId]])
&& IsValidForBattle(&gEnemyParty[gBattlerPartyIndexes[BATTLE_PARTNER(battlerId)]]));
}
static void Intro_WaitForShinyAnimAndHealthbox(void)
@ -1969,7 +1971,7 @@ static void SpriteCB_FreeOpponentSprite(struct Sprite *sprite)
static void Task_StartSendOutAnim(u8 taskId)
{
u8 savedActiveBank = gActiveBattler;
u8 savedActiveBattler = gActiveBattler;
gActiveBattler = gTasks[taskId].data[0];
if ((!TwoIntroMons(gActiveBattler) || (gBattleTypeFlags & BATTLE_TYPE_MULTI)) && !BATTLE_TWO_VS_ONE_OPPONENT)
@ -1977,7 +1979,7 @@ static void Task_StartSendOutAnim(u8 taskId)
gBattleResources->bufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler];
StartSendOutAnim(gActiveBattler, FALSE);
}
else if ((gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS))
else if ((gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS) || (BATTLE_TWO_VS_ONE_OPPONENT && !TwoIntroMons(gActiveBattler)))
{
gBattleResources->bufferA[gActiveBattler][1] = gBattlerPartyIndexes[gActiveBattler];
StartSendOutAnim(gActiveBattler, FALSE);
@ -1992,7 +1994,7 @@ static void Task_StartSendOutAnim(u8 taskId)
gActiveBattler ^= BIT_FLANK;
}
gBattlerControllerFuncs[gActiveBattler] = Intro_TryShinyAnimShowHealthbox;
gActiveBattler = savedActiveBank;
gActiveBattler = savedActiveBattler;
DestroyTask(taskId);
}

View File

@ -690,12 +690,17 @@ static void InitLastUsedBallAssets(void)
}
// This function is here to cover a specific case - one player's mon in a 2 vs 1 double battle. In this scenario - display singles layout.
// The same goes for a 2 vs 1 where opponent has only one pokemon.
u32 WhichBattleCoords(u32 battlerId) // 0 - singles, 1 - doubles
{
if (GetBattlerPosition(battlerId) == B_POSITION_PLAYER_LEFT
&& gPlayerPartyCount == 1
&& !(gBattleTypeFlags & BATTLE_TYPE_MULTI))
return 0;
else if (GetBattlerPosition(battlerId) == B_POSITION_OPPONENT_LEFT
&& gEnemyPartyCount == 1
&& !(gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS))
return 0;
else
return IsDoubleBattle();
}

View File

@ -594,6 +594,7 @@ static void CB2_InitBattleInternal(void)
if (gBattleTypeFlags & BATTLE_TYPE_TWO_OPPONENTS && !BATTLE_TWO_VS_ONE_OPPONENT)
CreateNPCTrainerParty(&gEnemyParty[PARTY_SIZE / 2], gTrainerBattleOpponent_B, FALSE);
SetWildMonHeldItem();
CalculateEnemyPartyCount();
}
gMain.inBattle = TRUE;
@ -3189,7 +3190,7 @@ static void BattleStartClearSetData(void)
{
gBattleStruct->usedHeldItems[i][B_SIDE_PLAYER] = 0;
gBattleStruct->usedHeldItems[i][B_SIDE_OPPONENT] = 0;
gBattleStruct->itemStolen[i].originalItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
gBattleStruct->itemLost[i].originalItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM);
gPartyCriticalHits[i] = 0;
gBattleStruct->allowedToChangeFormInWeather[i][B_SIDE_PLAYER] = FALSE;
gBattleStruct->allowedToChangeFormInWeather[i][B_SIDE_OPPONENT] = FALSE;
@ -3226,7 +3227,7 @@ void SwitchInClearSetData(void)
gStatuses3[gActiveBattler] &= (STATUS3_LEECHSEED_BATTLER | STATUS3_LEECHSEED | STATUS3_ALWAYS_HITS | STATUS3_PERISH_SONG | STATUS3_ROOTED
| STATUS3_GASTRO_ACID | STATUS3_EMBARGO | STATUS3_TELEKINESIS | STATUS3_MAGNET_RISE | STATUS3_HEAL_BLOCK
| STATUS3_AQUA_RING | STATUS3_POWER_TRICK);
gStatuses4[gActiveBattler] &= (STATUS4_MUD_SPORT | STATUS4_WATER_SPORT);
gStatuses4[gActiveBattler] &= (STATUS4_MUD_SPORT | STATUS4_WATER_SPORT | STATUS4_INFINITE_CONFUSION);
for (i = 0; i < gBattlersCount; i++)
{
if (GetBattlerSide(gActiveBattler) != GetBattlerSide(i)
@ -3922,6 +3923,9 @@ static void TryDoEventsBeforeFirstTurn(void)
StopCryAndClearCrySongs();
BattleScriptExecute(BattleScript_ArenaTurnBeginning);
}
if ((i = ShouldDoTrainerSlide(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), TRAINER_SLIDE_BEFORE_FIRST_TURN)))
BattleScriptExecute(i == 1 ? BattleScript_TrainerASlideMsgEnd2 : BattleScript_TrainerBSlideMsgEnd2);
}
static void HandleEndTurn_ContinueBattle(void)
@ -4014,6 +4018,16 @@ void BattleTurnPassed(void)
BattleScriptExecute(BattleScript_ArenaTurnBeginning);
else if ((i = ShouldDoTrainerSlide(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), TRAINER_SLIDE_LAST_LOW_HP)))
BattleScriptExecute(i == 1 ? BattleScript_TrainerASlideMsgEnd2 : BattleScript_TrainerBSlideMsgEnd2);
else if ((i = ShouldDoTrainerSlide(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), TRAINER_SLIDE_LAST_HALF_HP)))
BattleScriptExecute(i == 1 ? BattleScript_TrainerASlideMsgEnd2 : BattleScript_TrainerBSlideMsgEnd2);
else if ((i = ShouldDoTrainerSlide(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), TRAINER_SLIDE_FIRST_CRITICAL_HIT)))
BattleScriptExecute(i == 1 ? BattleScript_TrainerASlideMsgEnd2 : BattleScript_TrainerBSlideMsgEnd2);
else if ((i = ShouldDoTrainerSlide(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), TRAINER_SLIDE_FIRST_SUPER_EFFECTIVE_HIT)))
BattleScriptExecute(i == 1 ? BattleScript_TrainerASlideMsgEnd2 : BattleScript_TrainerBSlideMsgEnd2);
else if ((i = ShouldDoTrainerSlide(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), TRAINER_SLIDE_FIRST_STAB_MOVE)))
BattleScriptExecute(i == 1 ? BattleScript_TrainerASlideMsgEnd2 : BattleScript_TrainerBSlideMsgEnd2);
else if ((i = ShouldDoTrainerSlide(GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT), TRAINER_SLIDE_PLAYER_MON_UNAFFECTED)))
BattleScriptExecute(i == 1 ? BattleScript_TrainerASlideMsgEnd2 : BattleScript_TrainerBSlideMsgEnd2);
}
u8 IsRunningFromBattleImpossible(void)
@ -5390,9 +5404,9 @@ static void HandleEndTurn_FinishBattle(void)
TestRunner_Battle_AfterLastTurn();
BeginFastPaletteFade(3);
FadeOutMapMusic(5);
#if B_TRAINERS_KNOCK_OFF_ITEMS == TRUE
#if B_TRAINERS_KNOCK_OFF_ITEMS == TRUE || B_RESTORE_HELD_BATTLE_ITEMS == TRUE
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER)
TryRestoreStolenItems();
TryRestoreHeldItems();
#endif
for (i = 0; i < PARTY_SIZE; i++)
{

View File

@ -435,11 +435,11 @@ static const u8 sText_ExclamationMark3[] = _("!");
static const u8 sText_ExclamationMark4[] = _("!");
static const u8 sText_ExclamationMark5[] = _("!");
static const u8 sText_HP[] = _("HP");
static const u8 sText_Attack[] = _("attack");
static const u8 sText_Defense[] = _("defense");
static const u8 sText_Speed[] = _("speed");
static const u8 sText_SpAttack[] = _("sp. attack");
static const u8 sText_SpDefense[] = _("sp. defense");
static const u8 sText_Attack[] = _("Attack");
static const u8 sText_Defense[] = _("Defense");
static const u8 sText_Speed[] = _("Speed");
static const u8 sText_SpAttack[] = _("Sp. Atk");
static const u8 sText_SpDefense[] = _("Sp. Def");
static const u8 sText_Accuracy[] = _("accuracy");
static const u8 sText_Evasiveness[] = _("evasiveness");
@ -465,7 +465,7 @@ const u8 *const gPokeblockWasTooXStringTable[FLAVOR_COUNT] =
[FLAVOR_SOUR] = sText_PokeblockWasTooSour
};
static const u8 sText_PlayerUsedItem[] = _("{B_PLAYER_NAME} used\n{B_LAST_ITEM}!");
static const u8 sText_PlayerUsedItem[] = _("You used\n{B_LAST_ITEM}!");
static const u8 sText_WallyUsedItem[] = _("WALLY used\n{B_LAST_ITEM}!");
static const u8 sText_Trainer1UsedItem[] = _("{B_ATK_TRAINER_CLASS} {B_ATK_TRAINER_NAME}\nused {B_LAST_ITEM}!");
static const u8 sText_TrainerBlockedBall[] = _("The TRAINER blocked the BALL!");
@ -555,7 +555,7 @@ static const u8 sText_VanishedInstantly[] =_("{B_ATK_NAME_WITH_PREFIX} vanished\
static const u8 sText_ProtectedTeam[] =_("{B_CURRENT_MOVE} protected\n{B_ATK_TEAM2} team!");
static const u8 sText_SharedItsGuard[] =_("{B_ATK_NAME_WITH_PREFIX} shared its\nguard with the target!");
static const u8 sText_SharedItsPower[] =_("{B_ATK_NAME_WITH_PREFIX} shared its\npower with the target!");
static const u8 sText_SwapsDefAndSpDefOfAllPkmn[] =_("It created a bizarre area in which the\nDefense and Sp.Def stats are swapped!");
static const u8 sText_SwapsDefAndSpDefOfAllPkmn[] =_("It created a bizarre area in which the\nDefense and Sp. Def stats are swapped!");
static const u8 sText_BecameNimble[] =_("{B_ATK_NAME_WITH_PREFIX} became nimble!");
static const u8 sText_HurledIntoTheAir[] =_("{B_DEF_NAME_WITH_PREFIX} was hurled\ninto the air!");
static const u8 sText_HeldItemsLoseEffects[] =_("It created a bizarre area in which\nPokémon's held items lose their effects!");
@ -783,12 +783,14 @@ static const u8 sText_ShellTrapDidntWork[] = _("{B_ATK_NAME_WITH_PREFIX}'s shell
static const u8 sText_CouldntFullyProtect[] = _("{B_DEF_NAME_WITH_PREFIX} couldn't fully protect\nitself and got hurt!");
static const u8 sText_StockpiledEffectWoreOff[] = _("{B_ATK_NAME_WITH_PREFIX}'s stockpiled\neffect wore off!");
static const u8 sText_PkmnRevivedReadyToFight[] = _("{B_BUFF1} was revived and\nis ready to fight again!");
static const u8 sText_ItemRestoredSpeciesHealth[] = _("{B_LAST_ITEM} restored\n{B_BUFF1}'s health!");
static const u8 sText_ItemCuredSpeciesStatus[] = _("{B_LAST_ITEM} cured\n{B_BUFF1}'s status!");
static const u8 sText_ItemRestoredSpeciesPP[] = _("{B_LAST_ITEM} restored\n{B_BUFF1}'s PP!");
static const u8 sText_ItemRestoredSpeciesHealth[] = _("{B_BUFF1} had its\nHP restored!");
static const u8 sText_ItemCuredSpeciesStatus[] = _("{B_BUFF1} had\nits status healed!");
static const u8 sText_ItemRestoredSpeciesPP[] = _("{B_BUFF1} had its\nPP restored!");
static const u8 sText_AtkTrappedDef[] = _("{B_ATK_NAME_WITH_PREFIX} trapped\nthe {B_DEF_NAME_WITH_PREFIX}!");
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
{
[STRINGID_THUNDERCAGETRAPPED - BATTLESTRINGS_TABLE_START] = sText_AtkTrappedDef,
[STRINGID_ITEMRESTOREDSPECIESHEALTH - BATTLESTRINGS_TABLE_START] = sText_ItemRestoredSpeciesHealth,
[STRINGID_ITEMCUREDSPECIESSTATUS - BATTLESTRINGS_TABLE_START] = sText_ItemCuredSpeciesStatus,
[STRINGID_ITEMRESTOREDSPECIESPP - BATTLESTRINGS_TABLE_START] = sText_ItemRestoredSpeciesPP,
@ -1679,6 +1681,7 @@ const u16 gWrappedStringIds[NUM_TRAPPING_MOVES] =
[B_MSG_WRAPPED_MAGMA_STORM] = STRINGID_TRAPPEDBYSWIRLINGMAGMA, // MOVE_MAGMA_STORM
[B_MSG_WRAPPED_INFESTATION] = STRINGID_INFESTATION, // MOVE_INFESTATION
[B_MSG_WRAPPED_SNAP_TRAP] = STRINGID_PKMNINSNAPTRAP, // MOVE_SNAP_TRAP
[B_MSG_WRAPPED_THUNDER_CAGE]= STRINGID_THUNDERCAGETRAPPED, // MOVE_THUNDER_CAGE
};
const u16 gMistUsedStringIds[] =
@ -3893,6 +3896,14 @@ struct TrainerSlide
const u8 *msgLastSwitchIn;
const u8 *msgLastLowHp;
const u8 *msgFirstDown;
const u8 *msgLastHalfHp;
const u8 *msgFirstCriticalHit;
const u8 *msgFirstSuperEffectiveHit;
const u8 *msgFirstSTABMove;
const u8 *msgPlayerMonUnaffected;
const u8 *msgMegaEvolution;
const u8 *msgZMove;
const u8 *msgBeforeFirstTurn;
};
static const struct TrainerSlide sTrainerSlides[] =
@ -3904,6 +3915,14 @@ static const struct TrainerSlide sTrainerSlides[] =
.msgLastSwitchIn = sText_AarghAlmostHadIt,
.msgLastLowHp = sText_BoxIsFull,
.msgFirstDown = sText_123Poof,
.msgLastHalfHp = sText_ShootSoClose,
.msgFirstCriticalHit = sText_CriticalHit,
.msgFirstSuperEffectiveHit = sText_SuperEffective,
.msgFirstSTABMove = sText_ABoosted,
.msgPlayerMonUnaffected = sText_ButNoEffect,
.msgMegaEvolution = sText_PowderExplodes,
.msgZMove = sText_Electromagnetism,
.msgBeforeFirstTurn = sText_GravityIntensified,
},
*/
};
@ -3924,12 +3943,35 @@ static u32 GetEnemyMonCount(u32 firstId, u32 lastId, bool32 onlyAlive)
return count;
}
static bool32 IsBattlerHpLow(u32 battler)
enum
{
if ((gBattleMons[battler].hp * 100) / gBattleMons[battler].maxHP < 25)
return TRUE;
else
return FALSE;
LESS_THAN,
EQUAL,
GREATER_THAN,
LESS_THAN_OR_EQUAL,
GREATER_THAN_OR_EQUAL,
NOT_EQUAL,
};
u32 BattlerHPPercentage(u32 battlerId, u32 operation, u32 threshold)
{
switch (operation)
{
case LESS_THAN:
return gBattleMons[battlerId].hp < (gBattleMons[battlerId].maxHP / threshold);
case EQUAL:
return gBattleMons[battlerId].hp == (gBattleMons[battlerId].maxHP / threshold);
case GREATER_THAN:
return gBattleMons[battlerId].hp > (gBattleMons[battlerId].maxHP / threshold);
case LESS_THAN_OR_EQUAL:
return gBattleMons[battlerId].hp <= (gBattleMons[battlerId].maxHP / threshold);
case GREATER_THAN_OR_EQUAL:
return gBattleMons[battlerId].hp >= (gBattleMons[battlerId].maxHP / threshold);
case NOT_EQUAL:
return gBattleMons[battlerId].hp != (gBattleMons[battlerId].maxHP / threshold);
default:
break;
}
}
u32 ShouldDoTrainerSlide(u32 battlerId, u32 which)
@ -3977,7 +4019,7 @@ u32 ShouldDoTrainerSlide(u32 battlerId, u32 which)
case TRAINER_SLIDE_LAST_LOW_HP:
if (sTrainerSlides[i].msgLastLowHp != NULL
&& GetEnemyMonCount(firstId, lastId, TRUE) == 1
&& IsBattlerHpLow(battlerId)
&& BattlerHPPercentage(battlerId, GREATER_THAN_OR_EQUAL, 4)
&& !gBattleStruct->trainerSlideLowHpMsgDone)
{
gBattleStruct->trainerSlideLowHpMsgDone = TRUE;
@ -3992,6 +4034,79 @@ u32 ShouldDoTrainerSlide(u32 battlerId, u32 which)
return retValue;
}
break;
case TRAINER_SLIDE_LAST_HALF_HP:
if (sTrainerSlides[i].msgLastHalfHp != NULL
&& GetEnemyMonCount(firstId, lastId, TRUE) == GetEnemyMonCount(firstId, lastId, FALSE) - 1
&& BattlerHPPercentage(battlerId, LESS_THAN_OR_EQUAL, 2) && BattlerHPPercentage(battlerId, GREATER_THAN, 4)
&& !gBattleStruct->trainerSlideHalfHpMsgDone)
{
gBattleStruct->trainerSlideHalfHpMsgDone = TRUE;
gBattleStruct->trainerSlideMsg = sTrainerSlides[i].msgLastHalfHp;
return TRUE;
}
break;
case TRAINER_SLIDE_FIRST_CRITICAL_HIT:
if (sTrainerSlides[i].msgFirstCriticalHit != NULL && gBattleStruct->trainerSlideFirstCriticalHitMsgState == 1)
{
gBattleStruct->trainerSlideFirstCriticalHitMsgState = 2;
gBattleStruct->trainerSlideMsg = sTrainerSlides[i].msgFirstCriticalHit;
return TRUE;
}
break;
case TRAINER_SLIDE_FIRST_SUPER_EFFECTIVE_HIT:
if (sTrainerSlides[i].msgFirstSuperEffectiveHit != NULL
&& gBattleStruct->trainerSlideFirstSuperEffectiveHitMsgState == 1
&& gBattleMons[battlerId].hp)
{
gBattleStruct->trainerSlideFirstSuperEffectiveHitMsgState = 2;
gBattleStruct->trainerSlideMsg = sTrainerSlides[i].msgFirstSuperEffectiveHit;
return TRUE;
}
break;
case TRAINER_SLIDE_FIRST_STAB_MOVE:
if (sTrainerSlides[i].msgFirstSTABMove != NULL
&& gBattleStruct->trainerSlideFirstSTABMoveMsgState == 1
&& GetEnemyMonCount(firstId, lastId, TRUE) == GetEnemyMonCount(firstId, lastId, FALSE))
{
gBattleStruct->trainerSlideFirstSTABMoveMsgState = 2;
gBattleStruct->trainerSlideMsg = sTrainerSlides[i].msgFirstSTABMove;
return TRUE;
}
break;
case TRAINER_SLIDE_PLAYER_MON_UNAFFECTED:
if (sTrainerSlides[i].msgPlayerMonUnaffected != NULL
&& gBattleStruct->trainerSlidePlayerMonUnaffectedMsgState == 1
&& GetEnemyMonCount(firstId, lastId, TRUE) == GetEnemyMonCount(firstId, lastId, FALSE))
{
gBattleStruct->trainerSlidePlayerMonUnaffectedMsgState = 2;
gBattleStruct->trainerSlideMsg = sTrainerSlides[i].msgPlayerMonUnaffected;
return TRUE;
}
break;
case TRAINER_SLIDE_MEGA_EVOLUTION:
if (sTrainerSlides[i].msgMegaEvolution != NULL && !gBattleStruct->trainerSlideMegaEvolutionMsgDone)
{
gBattleStruct->trainerSlideMegaEvolutionMsgDone = TRUE;
gBattleStruct->trainerSlideMsg = sTrainerSlides[i].msgMegaEvolution;
return TRUE;
}
break;
case TRAINER_SLIDE_Z_MOVE:
if (sTrainerSlides[i].msgZMove != NULL && !gBattleStruct->trainerSlideZMoveMsgDone)
{
gBattleStruct->trainerSlideZMoveMsgDone = TRUE;
gBattleStruct->trainerSlideMsg = sTrainerSlides[i].msgZMove;
return TRUE;
}
break;
case TRAINER_SLIDE_BEFORE_FIRST_TURN:
if (sTrainerSlides[i].msgBeforeFirstTurn != NULL && !gBattleStruct->trainerSlideBeforeFirstTurnMsgDone)
{
gBattleStruct->trainerSlideBeforeFirstTurnMsgDone = TRUE;
gBattleStruct->trainerSlideMsg = sTrainerSlides[i].msgBeforeFirstTurn;
return TRUE;
}
break;
}
break;
}

View File

@ -979,6 +979,7 @@ static const u8 sForbiddenMoves[MOVES_COUNT] =
[MOVE_STRUGGLE] = 0xFF, // Neither Struggle
[MOVE_AFTER_YOU] = FORBIDDEN_METRONOME,
[MOVE_APPLE_ACID] = FORBIDDEN_METRONOME,
[MOVE_ARMOR_CANNON] = FORBIDDEN_METRONOME,
[MOVE_ARM_THRUST] = FORBIDDEN_PARENTAL_BOND,
[MOVE_ASSIST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_ASTRAL_BARRAGE] = FORBIDDEN_METRONOME,
@ -994,6 +995,7 @@ static const u8 sForbiddenMoves[MOVES_COUNT] =
[MOVE_BESTOW] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_BIDE] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND, // Note: Bide should work with Parental Bond. This will be addressed in future.
[MOVE_BLAST_BURN] = FORBIDDEN_INSTRUCT,
[MOVE_BLAZING_TORQUE] = FORBIDDEN_MIMIC | FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_BODY_PRESS] = FORBIDDEN_METRONOME,
[MOVE_BONE_RUSH] = FORBIDDEN_PARENTAL_BOND,
[MOVE_BONEMERANG] = FORBIDDEN_PARENTAL_BOND,
@ -1005,9 +1007,14 @@ static const u8 sForbiddenMoves[MOVES_COUNT] =
[MOVE_BUZZY_BUZZ] = FORBIDDEN_METRONOME,
[MOVE_CELEBRATE] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_CHATTER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_CHILLING_WATER] = FORBIDDEN_METRONOME,
[MOVE_CHILLY_RECEPTION] = FORBIDDEN_METRONOME,
[MOVE_CIRCLE_THROW] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_CLANGOROUS_SOUL] = FORBIDDEN_METRONOME,
[MOVE_COLLISION_COURSE] = FORBIDDEN_METRONOME,
[MOVE_COMBAT_TORQUE] = FORBIDDEN_MIMIC | FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_COMET_PUNCH] = FORBIDDEN_PARENTAL_BOND,
[MOVE_COMEUPPANCE] = FORBIDDEN_METRONOME,
[MOVE_COPYCAT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_COUNTER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_COVET] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
@ -1018,9 +1025,11 @@ static const u8 sForbiddenMoves[MOVES_COUNT] =
[MOVE_DIAMOND_STORM] = FORBIDDEN_METRONOME,
[MOVE_DIG] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_DIVE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_DOODLE] = FORBIDDEN_METRONOME,
[MOVE_DOUBLE_IRON_BASH] = FORBIDDEN_METRONOME | FORBIDDEN_PARENTAL_BOND,
[MOVE_DOUBLE_HIT] = FORBIDDEN_PARENTAL_BOND,
[MOVE_DOUBLE_KICK] = FORBIDDEN_PARENTAL_BOND,
[MOVE_DOUBLE_SHOCK] = FORBIDDEN_METRONOME,
[MOVE_DOUBLE_SLAP] = FORBIDDEN_PARENTAL_BOND,
[MOVE_DRAGON_ASCENT] = FORBIDDEN_METRONOME,
[MOVE_DRAGON_ENERGY] = FORBIDDEN_METRONOME,
@ -1030,6 +1039,7 @@ static const u8 sForbiddenMoves[MOVES_COUNT] =
[MOVE_DUAL_CHOP] = FORBIDDEN_PARENTAL_BOND,
[MOVE_DUAL_WINGBEAT] = FORBIDDEN_PARENTAL_BOND,
[MOVE_DYNAMAX_CANNON] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_ELECTRO_DRIFT] = FORBIDDEN_METRONOME,
[MOVE_ENDEAVOR] = FORBIDDEN_PARENTAL_BOND,
[MOVE_ENDURE] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_ETERNABEAM] = FORBIDDEN_METRONOME | FORBIDDEN_INSTRUCT,
@ -1037,6 +1047,7 @@ static const u8 sForbiddenMoves[MOVES_COUNT] =
[MOVE_FALSE_SURRENDER] = FORBIDDEN_METRONOME,
[MOVE_FEINT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_FIERY_WRATH] = FORBIDDEN_METRONOME,
[MOVE_FILLET_AWAY] = FORBIDDEN_METRONOME,
[MOVE_FINAL_GAMBIT] = FORBIDDEN_PARENTAL_BOND,
[MOVE_FISSURE] = FORBIDDEN_PARENTAL_BOND,
[MOVE_FLEUR_CANNON] = FORBIDDEN_METRONOME,
@ -1062,16 +1073,20 @@ static const u8 sForbiddenMoves[MOVES_COUNT] =
[MOVE_HORN_DRILL] = FORBIDDEN_PARENTAL_BOND,
[MOVE_HYDRO_CANNON] = FORBIDDEN_INSTRUCT,
[MOVE_HYPER_BEAM] = FORBIDDEN_INSTRUCT,
[MOVE_HYPER_DRILL] = FORBIDDEN_METRONOME,
[MOVE_HYPERSPACE_FURY] = FORBIDDEN_METRONOME,
[MOVE_HYPERSPACE_HOLE] = FORBIDDEN_METRONOME,
[MOVE_ICE_BALL] = FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_ICE_BURN] = FORBIDDEN_METRONOME | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_ICICLE_SPEAR] = FORBIDDEN_PARENTAL_BOND,
[MOVE_INSTRUCT] = FORBIDDEN_METRONOME | FORBIDDEN_INSTRUCT,
[MOVE_JET_PUNCH] = FORBIDDEN_METRONOME,
[MOVE_JUNGLE_HEALING] = FORBIDDEN_METRONOME,
[MOVE_KINGS_SHIELD] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_INSTRUCT,
[MOVE_LIFE_DEW] = FORBIDDEN_METRONOME,
[MOVE_LIGHT_OF_RUIN] = FORBIDDEN_METRONOME,
[MOVE_MAKE_IT_RAIN] = FORBIDDEN_METRONOME,
[MOVE_MAGICAL_TORQUE] = FORBIDDEN_MIMIC | FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_MAT_BLOCK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_ME_FIRST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_METEOR_ASSAULT] = FORBIDDEN_METRONOME | FORBIDDEN_INSTRUCT,
@ -1085,32 +1100,47 @@ static const u8 sForbiddenMoves[MOVES_COUNT] =
[MOVE_MOONGEIST_BEAM] = FORBIDDEN_METRONOME,
[MOVE_NATURE_POWER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_NATURES_MADNESS] = FORBIDDEN_METRONOME,
[MOVE_NOXIOUS_TORQUE] = FORBIDDEN_MIMIC | FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_OBSTRUCT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_INSTRUCT,
[MOVE_ORDER_UP] = FORBIDDEN_METRONOME,
[MOVE_ORIGIN_PULSE] = FORBIDDEN_METRONOME,
[MOVE_OUTRAGE] = FORBIDDEN_INSTRUCT,
[MOVE_OVERDRIVE] = FORBIDDEN_METRONOME,
[MOVE_PHANTOM_FORCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_PHOTON_GEYSER] = FORBIDDEN_METRONOME,
[MOVE_PLASMA_FISTS] = FORBIDDEN_METRONOME,
[MOVE_POPULATION_BOMB] = FORBIDDEN_METRONOME,
[MOVE_POUNCE] = FORBIDDEN_METRONOME,
[MOVE_POWER_SHIFT] = FORBIDDEN_METRONOME,
[MOVE_PRECIPICE_BLADES] = FORBIDDEN_METRONOME,
[MOVE_PRISMATIC_LASER] = FORBIDDEN_INSTRUCT,
[MOVE_PROTECT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_PYRO_BALL] = FORBIDDEN_METRONOME,
[MOVE_QUASH] = FORBIDDEN_METRONOME,
[MOVE_QUICK_GUARD] = FORBIDDEN_METRONOME,
[MOVE_RAGE_FIST] = FORBIDDEN_METRONOME,
[MOVE_RAGE_POWDER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_RAGING_BULL] = FORBIDDEN_METRONOME,
[MOVE_RAGING_FURY] = FORBIDDEN_METRONOME,
[MOVE_RAZOR_WIND] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_RELIC_SONG] = FORBIDDEN_METRONOME,
[MOVE_REVIVAL_BLESSING] = FORBIDDEN_METRONOME,
[MOVE_ROAR] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_ROAR_OF_TIME] = FORBIDDEN_INSTRUCT,
[MOVE_ROCK_BLAST] = FORBIDDEN_PARENTAL_BOND,
[MOVE_ROCK_WRECKER] = FORBIDDEN_INSTRUCT,
[MOVE_ROLLOUT] = FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_RUINATION] = FORBIDDEN_METRONOME,
[MOVE_SAPPY_SEED] = FORBIDDEN_METRONOME,
[MOVE_SALT_CURE] = FORBIDDEN_METRONOME,
[MOVE_SCALE_SHOT] = FORBIDDEN_PARENTAL_BOND,
[MOVE_SECRET_SWORD] = FORBIDDEN_METRONOME,
[MOVE_SELF_DESTRUCT] = FORBIDDEN_PARENTAL_BOND,
[MOVE_SHADOW_FORCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_SHED_TAIL] = FORBIDDEN_METRONOME,
[MOVE_SHEER_COLD] = FORBIDDEN_PARENTAL_BOND,
[MOVE_SHELL_TRAP] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_SILK_TRAP] = FORBIDDEN_METRONOME,
[MOVE_SIZZLY_SLIDE] = FORBIDDEN_METRONOME,
[MOVE_SKETCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_SKULL_BASH] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
@ -1121,10 +1151,12 @@ static const u8 sForbiddenMoves[MOVES_COUNT] =
[MOVE_SNARL] = FORBIDDEN_METRONOME,
[MOVE_SNATCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_INSTRUCT,
[MOVE_SNORE] = FORBIDDEN_METRONOME,
[MOVE_SNOWSCAPE] = FORBIDDEN_METRONOME,
[MOVE_SOLAR_BEAM] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_SOLAR_BLADE] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_SPARKLY_SWIRL] = FORBIDDEN_METRONOME,
[MOVE_SPECTRAL_THIEF] = FORBIDDEN_METRONOME,
[MOVE_SPICY_EXTRACT] = FORBIDDEN_METRONOME,
[MOVE_SPIKE_CANNON] = FORBIDDEN_PARENTAL_BOND,
[MOVE_SPIKY_SHIELD] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_SPIRIT_BREAK] = FORBIDDEN_METRONOME,
@ -1144,17 +1176,21 @@ static const u8 sForbiddenMoves[MOVES_COUNT] =
[MOVE_THRASH] = FORBIDDEN_INSTRUCT,
[MOVE_THUNDER_CAGE] = FORBIDDEN_METRONOME,
[MOVE_THUNDEROUS_KICK] = FORBIDDEN_METRONOME,
[MOVE_TIDY_UP] = FORBIDDEN_METRONOME,
[MOVE_TRAILBLAZE] = FORBIDDEN_METRONOME,
[MOVE_TRANSFORM] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_INSTRUCT,
[MOVE_TRICK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_TRIPLE_AXEL] = FORBIDDEN_PARENTAL_BOND,
[MOVE_TRIPLE_KICK] = FORBIDDEN_PARENTAL_BOND,
[MOVE_TWINEEDLE] = FORBIDDEN_PARENTAL_BOND,
[MOVE_TWIN_BEAM] = FORBIDDEN_METRONOME,
[MOVE_UPROAR] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_V_CREATE] = FORBIDDEN_METRONOME,
[MOVE_VEEVEE_VOLLEY] = FORBIDDEN_METRONOME,
[MOVE_WATER_SHURIKEN] = FORBIDDEN_PARENTAL_BOND,
[MOVE_WHIRLWIND] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_WICKED_BLOW] = FORBIDDEN_METRONOME,
[MOVE_WICKED_TORQUE] = FORBIDDEN_MIMIC | FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_WIDE_GUARD] = FORBIDDEN_METRONOME,
[MOVE_ZIPPY_ZAP] = FORBIDDEN_METRONOME,
};
@ -2568,6 +2604,11 @@ static void Cmd_critmessage(void)
if (gIsCriticalHit == TRUE && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
{
PrepareStringBattle(STRINGID_CRITICALHIT, gBattlerAttacker);
// Signal for the trainer slide-in system.
if (GetBattlerSide(gBattlerTarget) != B_SIDE_PLAYER && gBattleStruct->trainerSlideFirstCriticalHitMsgState != 2)
gBattleStruct->trainerSlideFirstCriticalHitMsgState = 1;
gBattleCommunication[MSG_DISPLAY] = 1;
}
gBattlescriptCurrInstr = cmd->nextInstr;
@ -2647,7 +2688,13 @@ static void Cmd_resultmessage(void)
{
case MOVE_RESULT_SUPER_EFFECTIVE:
if (!gMultiHitCounter) // Don't print effectiveness on each hit in a multi hit attack
{
// Signal for the trainer slide-in system.
if (GetBattlerSide(gBattlerTarget) != B_SIDE_PLAYER && gBattleStruct->trainerSlideFirstSuperEffectiveHitMsgState != 2)
gBattleStruct->trainerSlideFirstSuperEffectiveHitMsgState = 1;
stringId = STRINGID_SUPEREFFECTIVE;
}
break;
case MOVE_RESULT_NOT_VERY_EFFECTIVE:
if (!gMultiHitCounter)
@ -7883,7 +7930,7 @@ static void BestowItem(u32 battlerAtk, u32 battlerDef)
// Called by Cmd_removeitem. itemId represents the item that was removed, not being given.
static bool32 TrySymbiosis(u32 battler, u32 itemId)
{
if (!gBattleStruct->itemStolen[gBattlerPartyIndexes[battler]].stolen
if (!gBattleStruct->itemLost[gBattlerPartyIndexes[battler]].stolen
&& gBattleStruct->changedItems[battler] == ITEM_NONE
&& GetBattlerHoldEffect(battler, TRUE) != HOLD_EFFECT_EJECT_BUTTON
&& GetBattlerHoldEffect(battler, TRUE) != HOLD_EFFECT_EJECT_PACK
@ -11176,15 +11223,6 @@ static void Cmd_various(void)
AbilityBattleEffects(ABILITYEFFECT_ON_WEATHER, gActiveBattler, 0, 0, 0);
return;
}
case VARIOUS_JUMP_IF_SHELL_TRAP:
{
VARIOUS_ARGS(const u8 *jumpInstr);
if (gProtectStructs[gActiveBattler].shellTrap)
gBattlescriptCurrInstr = cmd->jumpInstr;
else
gBattlescriptCurrInstr = cmd->nextInstr;
return;
}
case VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES:
{
VARIOUS_ARGS();
@ -11217,6 +11255,15 @@ static void Cmd_various(void)
gBattlescriptCurrInstr = cmd->nextInstr;
return;
}
case VARIOUS_JUMP_IF_SHELL_TRAP:
{
VARIOUS_ARGS(const u8 *jumpInstr);
if (gProtectStructs[gActiveBattler].shellTrap)
gBattlescriptCurrInstr = cmd->jumpInstr;
else
gBattlescriptCurrInstr = cmd->nextInstr;
return;
}
case VARIOUS_TRY_REVIVAL_BLESSING:
{
VARIOUS_ARGS(const u8 *failInstr);
@ -11261,6 +11308,30 @@ static void Cmd_various(void)
}
return;
}
case VARIOUS_TRY_TRAINER_SLIDE_MSG_Z_MOVE:
{
VARIOUS_ARGS();
if ((i = ShouldDoTrainerSlide(gActiveBattler, TRAINER_SLIDE_Z_MOVE)))
{
gBattleScripting.battler = gActiveBattler;
BattleScriptPush(cmd->nextInstr);
gBattlescriptCurrInstr = (i == 1 ? BattleScript_TrainerASlideMsgRet : BattleScript_TrainerBSlideMsgRet);
return;
}
break;
}
case VARIOUS_TRY_TRAINER_SLIDE_MSG_MEGA_EVOLUTION:
{
VARIOUS_ARGS();
if ((i = ShouldDoTrainerSlide(gActiveBattler, TRAINER_SLIDE_MEGA_EVOLUTION)))
{
gBattleScripting.battler = gActiveBattler;
BattleScriptPush(cmd->nextInstr);
gBattlescriptCurrInstr = (i == 1 ? BattleScript_TrainerASlideMsgRet : BattleScript_TrainerBSlideMsgRet);
return;
}
break;
}
} // End of switch (cmd->id)
gBattlescriptCurrInstr = cmd->nextInstr;
@ -16475,15 +16546,20 @@ void BS_ItemCureStatus(void) {
// Heal Status2 conditions if battler is active.
if (gBattleStruct->itemPartyIndex[gBattlerAttacker] == gBattlerPartyIndexes[gBattlerAttacker])
gBattleMons[gBattleStruct->itemPartyIndex[gBattlerAttacker]].status2 &= ~GetItemStatus2Mask(gLastUsedItem);
{
gBattleMons[gBattlerAttacker].status2 &= ~GetItemStatus2Mask(gLastUsedItem);
}
else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE
&& gBattleStruct->itemPartyIndex[gBattlerAttacker] == gBattlerPartyIndexes[BATTLE_PARTNER(gBattlerAttacker)])
{
gBattleMons[gBattlerAttacker].status2 &= ~GetItemStatus2Mask(gLastUsedItem);
gBattlerTarget = BATTLE_PARTNER(gBattlerAttacker);
}
if (GetItemStatus1Mask(gLastUsedItem) & STATUS1_SLEEP)
gBattleMons[gBattlerAttacker].status2 &= ~STATUS2_NIGHTMARE;
}
if (GetItemStatus2Mask(gLastUsedItem) & STATUS2_CONFUSION)
gStatuses4[gBattlerAttacker] &= ~STATUS4_INFINITE_CONFUSION;
PREPARE_SPECIES_BUFFER(gBattleTextBuff1, GetMonData(&party[gBattleStruct->itemPartyIndex[gBattlerAttacker]], MON_DATA_SPECIES));
gBattlescriptCurrInstr = cmd->nextInstr;

View File

@ -64,6 +64,7 @@ static void SetRandomMultiHitCounter();
static u32 GetBattlerItemHoldEffectParam(u8 battlerId, u16 item);
static u16 GetInverseTypeMultiplier(u16 multiplier);
static u16 GetSupremeOverlordModifier(u8 battlerId);
static bool8 CanBeInfinitelyConfused(u8 battlerId);
extern const u8 *const gBattleScriptsForMoveEffects[];
extern const u8 *const gBattlescriptsForRunningByItem[];
@ -1526,6 +1527,12 @@ void PrepareStringBattle(u16 stringId, u8 battler)
}
#endif
// Signal for the trainer slide-in system.
if ((stringId == STRINGID_ITDOESNTAFFECT || stringId == STRINGID_PKMNWASNTAFFECTED || stringId == STRINGID_PKMNUNAFFECTED)
&& GetBattlerSide(gBattlerTarget) == B_SIDE_OPPONENT
&& gBattleStruct->trainerSlidePlayerMonUnaffectedMsgState != 2)
gBattleStruct->trainerSlidePlayerMonUnaffectedMsgState = 1;
gActiveBattler = battler;
BtlController_EmitPrintString(BUFFER_A, stringId);
MarkBattlerForControllerExec(gActiveBattler);
@ -3515,6 +3522,7 @@ u8 AtkCanceller_UnableToUseMove(void)
case CANCELLER_CONFUSED: // confusion
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION)
{
if (!(gStatuses4[gBattlerAttacker] & STATUS4_INFINITE_CONFUSION))
gBattleMons[gBattlerAttacker].status2 -= STATUS2_CONFUSION_TURN(1);
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_CONFUSION)
{
@ -5943,7 +5951,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus;
break;
case 2: // get rid of confusion
gBattleMons[battler].status2 &= ~STATUS2_CONFUSION;
RemoveConfusionStatus(battler);
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_AbilityCuredStatus;
break;
@ -6881,7 +6889,7 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect)
case HOLD_EFFECT_CURE_CONFUSION:
if (gBattleMons[battlerId].status2 & STATUS2_CONFUSION && !UnnerveOn(battlerId, gLastUsedItem))
{
gBattleMons[battlerId].status2 &= ~STATUS2_CONFUSION;
RemoveConfusionStatus(battlerId);
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_BerryCureConfusionRet;
effect = ITEM_EFFECT_OTHER;
@ -6922,7 +6930,7 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect)
StringCopy(gBattleTextBuff1, gStatusConditionString_ConfusionJpn);
gBattleMons[battlerId].status1 = 0;
gBattleMons[battlerId].status2 &= ~STATUS2_CONFUSION;
RemoveConfusionStatus(battlerId);
BattleScriptPushCursor();
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_CURED_PROBLEM;
gBattlescriptCurrInstr = BattleScript_BerryCureChosenStatusRet;
@ -6960,6 +6968,21 @@ static u8 ItemEffectMoveEnd(u32 battlerId, u16 holdEffect)
effect = ITEM_EFFECT_OTHER;
}
break;
case HOLD_EFFECT_BERSERK_GENE:
BufferStatChange(battlerId, STAT_ATK, STRINGID_STATROSE);
gEffectBattler = battlerId;
if (CanBeInfinitelyConfused(gEffectBattler))
{
gStatuses4[gEffectBattler] |= STATUS4_INFINITE_CONFUSION;
}
SET_STATCHANGER(STAT_ATK, 2, FALSE);
gBattleScripting.animArg1 = 14 + STAT_ATK;
gBattleScripting.animArg2 = 0;
BattleScriptPushCursorAndCallback(BattleScript_BerserkGeneRet);
effect = ITEM_STATS_CHANGE;
break;
}
return effect;
@ -7138,7 +7161,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
else
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_NORMALIZED_STATUS;
gBattleMons[battlerId].status1 = 0;
gBattleMons[battlerId].status2 &= ~STATUS2_CONFUSION;
RemoveConfusionStatus(battlerId);
BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2);
effect = ITEM_STATUS_CHANGE;
}
@ -7199,6 +7222,21 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
}
}
break;
case HOLD_EFFECT_BERSERK_GENE:
BufferStatChange(battlerId, STAT_ATK, STRINGID_STATROSE);
gEffectBattler = battlerId;
if (CanBeInfinitelyConfused(gEffectBattler))
{
gStatuses4[gEffectBattler] |= STATUS4_INFINITE_CONFUSION;
}
SET_STATCHANGER(STAT_ATK, 2, FALSE);
gBattleScripting.animArg1 = 14 + STAT_ATK;
gBattleScripting.animArg2 = 0;
BattleScriptPushCursorAndCallback(BattleScript_BerserkGeneRet);
effect = ITEM_STATS_CHANGE;
break;
}
if (effect != 0)
{
@ -7419,7 +7457,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
case HOLD_EFFECT_CURE_CONFUSION:
if (gBattleMons[battlerId].status2 & STATUS2_CONFUSION && !UnnerveOn(battlerId, gLastUsedItem))
{
gBattleMons[battlerId].status2 &= ~STATUS2_CONFUSION;
RemoveConfusionStatus(battlerId);
BattleScriptExecute(BattleScript_BerryCureConfusionEnd2);
effect = ITEM_EFFECT_OTHER;
}
@ -7464,7 +7502,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
else
gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_NORMALIZED_STATUS;
gBattleMons[battlerId].status1 = 0;
gBattleMons[battlerId].status2 &= ~STATUS2_CONFUSION;
RemoveConfusionStatus(battlerId);
BattleScriptExecute(BattleScript_BerryCureChosenStatusEnd2);
effect = ITEM_STATUS_CHANGE;
}
@ -7482,6 +7520,21 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
if (!moveTurn)
effect = TrySetMicleBerry(battlerId, gLastUsedItem, TRUE);
break;
case HOLD_EFFECT_BERSERK_GENE:
BufferStatChange(battlerId, STAT_ATK, STRINGID_STATROSE);
gEffectBattler = battlerId;
if (CanBeInfinitelyConfused(gEffectBattler))
{
gStatuses4[gEffectBattler] |= STATUS4_INFINITE_CONFUSION;
}
SET_STATCHANGER(STAT_ATK, 2, FALSE);
gBattleScripting.animArg1 = 14 + STAT_ATK;
gBattleScripting.animArg2 = 0;
BattleScriptPushCursorAndCallback(BattleScript_BerserkGeneRet);
effect = ITEM_STATS_CHANGE;
break;
}
if (effect != 0)
@ -9829,6 +9882,10 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat
}
}
// Signal for the trainer slide-in system.
if (GetBattlerSide(battlerDef) != B_SIDE_PLAYER && modifier && gBattleStruct->trainerSlideFirstSTABMoveMsgState != 2)
gBattleStruct->trainerSlideFirstSTABMoveMsgState = 1;
return modifier;
}
@ -10503,18 +10560,20 @@ void SortBattlersBySpeed(u8 *battlers, bool8 slowToFast)
}
}
void TryRestoreStolenItems(void)
void TryRestoreHeldItems(void)
{
u32 i;
u16 stolenItem = ITEM_NONE;
u16 lostItem = ITEM_NONE;
for (i = 0; i < PARTY_SIZE; i++)
{
if (gBattleStruct->itemStolen[i].stolen)
#if B_RESTORE_HELD_BATTLE_ITEMS == FALSE
if (gBattleStruct->itemLost[i].stolen)
#endif
{
stolenItem = gBattleStruct->itemStolen[i].originalItem;
if (stolenItem != ITEM_NONE && ItemId_GetPocket(stolenItem) != POCKET_BERRIES)
SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &stolenItem); // Restore stolen non-berry items
lostItem = gBattleStruct->itemLost[i].originalItem;
if (lostItem != ITEM_NONE && ItemId_GetPocket(lostItem) != POCKET_BERRIES)
SetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM, &lostItem); // Restore stolen non-berry items
}
}
}
@ -10568,8 +10627,8 @@ void TrySaveExchangedItem(u8 battlerId, u16 stolenItem)
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER
&& !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER)
&& GetBattlerSide(battlerId) == B_SIDE_PLAYER
&& stolenItem == gBattleStruct->itemStolen[gBattlerPartyIndexes[battlerId]].originalItem)
gBattleStruct->itemStolen[gBattlerPartyIndexes[battlerId]].stolen = TRUE;
&& stolenItem == gBattleStruct->itemLost[gBattlerPartyIndexes[battlerId]].originalItem)
gBattleStruct->itemLost[gBattlerPartyIndexes[battlerId]].stolen = TRUE;
#endif
}
@ -10825,3 +10884,21 @@ static void SetRandomMultiHitCounter()
gMultiHitCounter = 5 - (Random() & 1);
}
}
void RemoveConfusionStatus(u8 battlerId)
{
gBattleMons[battlerId].status2 &= ~STATUS2_CONFUSION;
gStatuses4[battlerId] &= ~STATUS4_INFINITE_CONFUSION;
}
static bool8 CanBeInfinitelyConfused(u8 battlerId)
{
if (gBattleMons[battlerId].ability == ABILITY_OWN_TEMPO
|| IsBattlerTerrainAffected(battlerId, STATUS_FIELD_MISTY_TERRAIN)
|| gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD)
{
return FALSE;
}
return TRUE;
}

View File

@ -215,11 +215,7 @@ bool32 IsViableZMove(u8 battlerId, u16 move)
if (move != MOVE_NONE && zMove != MOVE_Z_STATUS && gBattleMoves[move].type == ItemId_GetSecondaryId(item))
{
if (IS_MOVE_STATUS(move))
gBattleStruct->zmove.chosenZMove = move;
else
gBattleStruct->zmove.chosenZMove = GetTypeBasedZMove(move, battlerId);
return TRUE;
}
}

View File

@ -1079,7 +1079,7 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] =
{gBattleAnimSpriteGfx_RedFist, 0x0200, ANIM_TAG_RED_FIST},
{gBattleAnimSpriteGfx_SlamHit, 0x1000, ANIM_TAG_SLAM_HIT},
{gBattleAnimSpriteGfx_Ring, 0x0180, ANIM_TAG_RING},
#if NEW_ROCKS_PARTICLE
#if B_NEW_ROCKS_PARTICLE == TRUE
{gBattleAnimSpriteGfx_NewRocks, 0x0C00, ANIM_TAG_ROCKS},
#else
{gBattleAnimSpriteGfx_Rocks, 0x0C00, ANIM_TAG_ROCKS},
@ -1529,7 +1529,7 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] =
{gBattleAnimSpritePal_HumanoidFoot, ANIM_TAG_RED_FIST},
{gBattleAnimSpritePal_SlamHit, ANIM_TAG_SLAM_HIT},
{gBattleAnimSpritePal_Ring, ANIM_TAG_RING},
#if NEW_ROCKS_PARTICLE
#if B_NEW_ROCKS_PARTICLE == TRUE
{gBattleAnimSpritePal_NewRocks, ANIM_TAG_ROCKS},
#else
{gBattleAnimSpritePal_Rocks, ANIM_TAG_ROCKS},

View File

@ -1998,3 +1998,6 @@ const u32 gItemIconPalette_GriseousCore[] = INCBIN_U32("graphics/items/icon_pale
const u32 gItemIcon_LustrousGlobe[] = INCBIN_U32("graphics/items/icons/lustrous_globe.4bpp.lz");
const u32 gItemIconPalette_LustrousGlobe[] = INCBIN_U32("graphics/items/icon_palettes/lustrous_globe.gbapal.lz");
const u32 gItemIcon_BerserkGene[] = INCBIN_U32("graphics/items/icons/berserk_gene.4bpp.lz");
const u32 gItemIconPalette_BerserkGene[] = INCBIN_U32("graphics/items/icon_palettes/berserk_gene.gbapal.lz");

View File

@ -843,6 +843,7 @@ const u32 *const gItemIconTable[ITEMS_COUNT + 1][2] =
[ITEM_BLACK_AUGURITE] = {gItemIcon_BlackAugurite, gItemIconPalette_BlackAugurite},
[ITEM_LINKING_CORD] = {gItemIcon_LinkingCord, gItemIconPalette_LinkingCord},
[ITEM_PEAT_BLOCK] = {gItemIcon_PeatBlock, gItemIconPalette_PeatBlock},
[ITEM_BERSERK_GENE] = {gItemIcon_BerserkGene, gItemIconPalette_BerserkGene},
// Return to field arrow
[ITEMS_COUNT] = {gItemIcon_ReturnToFieldArrow, gItemIconPalette_ReturnToFieldArrow},
};

View File

@ -7728,6 +7728,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM01_FOCUS_PUNCH,
.price = 3000,
.description = sTM01Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7739,6 +7740,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM02_DRAGON_CLAW,
.price = 3000,
.description = sTM02Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7750,6 +7752,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM03_WATER_PULSE,
.price = 3000,
.description = sTM03Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7761,6 +7764,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM04_CALM_MIND,
.price = 3000,
.description = sTM04Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7772,6 +7776,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM05_ROAR,
.price = 1000,
.description = sTM05Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7783,6 +7788,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM06_TOXIC,
.price = 3000,
.description = sTM06Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7794,6 +7800,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM07_HAIL,
.price = 3000,
.description = sTM07Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7805,6 +7812,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM08_BULK_UP,
.price = 3000,
.description = sTM08Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7816,6 +7824,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM09_BULLET_SEED,
.price = 3000,
.description = sTM09Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7827,6 +7836,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM10_HIDDEN_POWER,
.price = 3000,
.description = sTM10Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7838,6 +7848,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM11_SUNNY_DAY,
.price = 2000,
.description = sTM11Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7849,6 +7860,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM12_TAUNT,
.price = 3000,
.description = sTM12Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7860,6 +7872,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM13_ICE_BEAM,
.price = 3000,
.description = sTM13Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7871,6 +7884,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM14_BLIZZARD,
.price = 5500,
.description = sTM14Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7882,6 +7896,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM15_HYPER_BEAM,
.price = 7500,
.description = sTM15Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7893,6 +7908,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM16_LIGHT_SCREEN,
.price = 3000,
.description = sTM16Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7904,6 +7920,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM17_PROTECT,
.price = 3000,
.description = sTM17Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7915,6 +7932,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM18_RAIN_DANCE,
.price = 2000,
.description = sTM18Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7926,6 +7944,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM19_GIGA_DRAIN,
.price = 3000,
.description = sTM19Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7937,6 +7956,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM20_SAFEGUARD,
.price = 3000,
.description = sTM20Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7948,6 +7968,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM21_FRUSTRATION,
.price = 1000,
.description = sTM21Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7959,6 +7980,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM22_SOLAR_BEAM,
.price = 3000,
.description = sTM22Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7970,6 +7992,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM23_IRON_TAIL,
.price = 3000,
.description = sTM23Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7981,6 +8004,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM24_THUNDERBOLT,
.price = 3000,
.description = sTM24Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -7992,6 +8016,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM25_THUNDER,
.price = 5500,
.description = sTM25Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8003,6 +8028,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM26_EARTHQUAKE,
.price = 3000,
.description = sTM26Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8014,6 +8040,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM27_RETURN,
.price = 1000,
.description = sTM27Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8025,6 +8052,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM28_DIG,
.price = 2000,
.description = sTM28Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8036,6 +8064,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM29_PSYCHIC,
.price = 2000,
.description = sTM29Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8047,6 +8076,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM30_SHADOW_BALL,
.price = 3000,
.description = sTM30Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8058,6 +8088,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM31_BRICK_BREAK,
.price = 3000,
.description = sTM31Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8069,6 +8100,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM32_DOUBLE_TEAM,
.price = 2000,
.description = sTM32Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8080,6 +8112,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM33_REFLECT,
.price = 3000,
.description = sTM33Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8091,6 +8124,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM34_SHOCK_WAVE,
.price = 3000,
.description = sTM34Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8102,6 +8136,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM35_FLAMETHROWER,
.price = 3000,
.description = sTM35Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8113,6 +8148,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM36_SLUDGE_BOMB,
.price = 1000,
.description = sTM36Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8124,6 +8160,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM37_SANDSTORM,
.price = 2000,
.description = sTM37Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8135,6 +8172,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM38_FIRE_BLAST,
.price = 5500,
.description = sTM38Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8146,6 +8184,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM39_ROCK_TOMB,
.price = 3000,
.description = sTM39Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8157,6 +8196,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM40_AERIAL_ACE,
.price = 3000,
.description = sTM40Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8168,6 +8208,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM41_TORMENT,
.price = 3000,
.description = sTM41Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8179,6 +8220,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM42_FACADE,
.price = 3000,
.description = sTM42Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8190,6 +8232,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM43_SECRET_POWER,
.price = 3000,
.description = sTM43Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8201,6 +8244,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM44_REST,
.price = 3000,
.description = sTM44Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8212,6 +8256,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM45_ATTRACT,
.price = 3000,
.description = sTM45Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8223,6 +8268,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM46_THIEF,
.price = 3000,
.description = sTM46Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8234,6 +8280,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM47_STEEL_WING,
.price = 3000,
.description = sTM47Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8245,6 +8292,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM48_SKILL_SWAP,
.price = 3000,
.description = sTM48Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8256,6 +8304,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM49_SNATCH,
.price = 3000,
.description = sTM49Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8267,6 +8316,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM50_OVERHEAT,
.price = 3000,
.description = sTM50Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8278,6 +8328,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM51,
.price = 3000,
.description = sTM51Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8289,6 +8340,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM52,
.price = 3000,
.description = sTM52Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8300,6 +8352,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM53,
.price = 3000,
.description = sTM53Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8311,6 +8364,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM54,
.price = 3000,
.description = sTM54Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8322,6 +8376,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM55,
.price = 3000,
.description = sTM55Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8333,6 +8388,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM56,
.price = 3000,
.description = sTM56Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8344,6 +8400,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM57,
.price = 3000,
.description = sTM57Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8355,6 +8412,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM58,
.price = 3000,
.description = sTM58Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8366,6 +8424,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM59,
.price = 3000,
.description = sTM59Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8377,6 +8436,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM60,
.price = 3000,
.description = sTM60Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8388,6 +8448,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM61,
.price = 3000,
.description = sTM61Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8399,6 +8460,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM62,
.price = 3000,
.description = sTM62Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8410,6 +8472,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM63,
.price = 3000,
.description = sTM63Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8421,6 +8484,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM64,
.price = 3000,
.description = sTM64Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8432,6 +8496,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM65,
.price = 3000,
.description = sTM65Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8443,6 +8508,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM66,
.price = 3000,
.description = sTM66Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8454,6 +8520,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM67,
.price = 3000,
.description = sTM67Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8465,6 +8532,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM68,
.price = 3000,
.description = sTM68Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8476,6 +8544,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM69,
.price = 3000,
.description = sTM69Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8487,6 +8556,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM70,
.price = 3000,
.description = sTM70Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8498,6 +8568,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM71,
.price = 3000,
.description = sTM71Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8509,6 +8580,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM72,
.price = 3000,
.description = sTM72Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8520,6 +8592,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM73,
.price = 3000,
.description = sTM73Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8531,6 +8604,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM74,
.price = 3000,
.description = sTM74Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8542,6 +8616,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM75,
.price = 3000,
.description = sTM75Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8553,6 +8628,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM76,
.price = 3000,
.description = sTM76Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8564,6 +8640,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM77,
.price = 3000,
.description = sTM77Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8575,6 +8652,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM78,
.price = 3000,
.description = sTM78Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8586,6 +8664,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM79,
.price = 3000,
.description = sTM79Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8597,6 +8676,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM80,
.price = 3000,
.description = sTM80Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8608,6 +8688,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM81,
.price = 3000,
.description = sTM81Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8619,6 +8700,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM82,
.price = 3000,
.description = sTM82Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8630,6 +8712,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM83,
.price = 3000,
.description = sTM83Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8641,6 +8724,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM84,
.price = 3000,
.description = sTM84Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8652,6 +8736,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM85,
.price = 3000,
.description = sTM85Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8663,6 +8748,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM86,
.price = 3000,
.description = sTM86Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8674,6 +8760,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM87,
.price = 3000,
.description = sTM87Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8685,6 +8772,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM88,
.price = 3000,
.description = sTM88Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8696,6 +8784,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM89,
.price = 3000,
.description = sTM89Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8707,6 +8796,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM90,
.price = 3000,
.description = sTM90Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8718,6 +8808,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM91,
.price = 3000,
.description = sTM91Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8729,6 +8820,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM92,
.price = 3000,
.description = sTM92Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8740,6 +8832,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM93,
.price = 3000,
.description = sTM93Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8751,6 +8844,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM94,
.price = 3000,
.description = sTM94Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8762,6 +8856,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM95,
.price = 3000,
.description = sTM95Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8773,6 +8868,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM96,
.price = 3000,
.description = sTM96Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8784,6 +8880,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM97,
.price = 3000,
.description = sTM97Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8795,6 +8892,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM98,
.price = 3000,
.description = sTM98Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8806,6 +8904,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM99,
.price = 3000,
.description = sTM99Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -8817,6 +8916,7 @@ const struct Item gItems[] =
.itemId = ITEM_TM100,
.price = 3000,
.description = sTM100Desc,
.importance = I_REUSABLE_TMS,
.pocket = POCKET_TM_HM,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_TMHM,
@ -10240,4 +10340,17 @@ const struct Item gItems[] =
.fieldUseFunc = ItemUseOutOfBattle_EvolutionStone,
.flingPower = 30,
},
[ITEM_BERSERK_GENE] =
{
.name = _("Berserk Gene"),
.itemId = ITEM_BERSERK_GENE,
.price = 20,
.holdEffect = HOLD_EFFECT_BERSERK_GENE,
.description = sBerserkGene,
.pocket = POCKET_ITEMS,
.type = ITEM_USE_BAG_MENU,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
.flingPower = 10,
},
};

View File

@ -316,7 +316,7 @@ const struct Evolution gEvolutionTable[NUM_SPECIES][EVOS_PER_MON] =
[SPECIES_KRICKETOT] = {{EVO_LEVEL, 10, SPECIES_KRICKETUNE}},
[SPECIES_SHINX] = {{EVO_LEVEL, 15, SPECIES_LUXIO}},
[SPECIES_LUXIO] = {{EVO_LEVEL, 30, SPECIES_LUXRAY}},
[SPECIES_BUDEW] = {{EVO_FRIENDSHIP, 0, SPECIES_ROSELIA}},
[SPECIES_BUDEW] = {{EVO_FRIENDSHIP_DAY, 0, SPECIES_ROSELIA}},
[SPECIES_CRANIDOS] = {{EVO_LEVEL, 30, SPECIES_RAMPARDOS}},
[SPECIES_SHIELDON] = {{EVO_LEVEL, 30, SPECIES_BASTIODON}},
[SPECIES_BURMY] = {{EVO_LEVEL_FEMALE, 20, SPECIES_WORMADAM},

View File

@ -3907,3 +3907,8 @@ static const u8 sLustrousGlobeDesc[] = _(
"A large, glowing gem\n"
"that lets Palkia\n"
"change form.");
static const u8 sBerserkGene[] = _(
"Sharply boosts\n"
"Attack, but causes\n"
"lasting confusion.");

View File

@ -973,6 +973,8 @@ u32 GetItemStatus1Mask(u16 itemId)
const u8 *effect = GetItemEffect(itemId);
switch (effect[3])
{
case ITEM3_PARALYSIS:
return STATUS1_PARALYSIS;
case ITEM3_FREEZE:
return STATUS1_FREEZE;
case ITEM3_BURN:

View File

@ -1154,7 +1154,7 @@ static bool32 CannotUseBagBattleItem(u16 itemId)
}
// Dire Hit
if (battleUsage == EFFECT_ITEM_SET_FOCUS_ENERGY
&& !(gBattleMons[gBattlerInMenuId].status2 & STATUS2_FOCUS_ENERGY))
&& (gBattleMons[gBattlerInMenuId].status2 & STATUS2_FOCUS_ENERGY))
{
cannotUse++;
}
@ -1229,10 +1229,11 @@ void ItemUseInBattle_BagMenu(u8 taskId)
{
PlaySE(SE_SELECT);
RemoveUsedItem();
ScheduleBgCopyTilemapToVram(2);
if (!InBattlePyramid())
DisplayItemMessage(taskId, FONT_NORMAL, gStringVar4, Task_FadeAndCloseBagMenu);
gTasks[taskId].func = Task_FadeAndCloseBagMenu;
else
DisplayItemMessageInBattlePyramid(taskId, gStringVar4, CloseBattlePyramidBag);
gTasks[taskId].func = CloseBattlePyramidBag;
}
}

View File

@ -401,6 +401,25 @@ void Overworld_ResetStateAfterDigEscRope(void)
FlagClear(FLAG_SYS_USE_FLASH);
}
#if B_RESET_FLAGS_VARS_AFTER_WHITEOUT == TRUE
void Overworld_ResetBattleFlagsAndVars(void)
{
#if VAR_TERRAIN != 0
VarSet(VAR_TERRAIN, 0);
#endif
#if B_VAR_WILD_AI_FLAGS != 0
VarSet(B_VAR_WILD_AI_FLAGS,0);
#endif
FlagClear(B_FLAG_INVERSE_BATTLE);
FlagClear(B_FLAG_FORCE_DOUBLE_WILD);
FlagClear(B_SMART_WILD_AI_FLAG);
FlagClear(B_FLAG_NO_BAG_USE);
FlagClear(B_FLAG_NO_CATCHING);
}
#endif
static void Overworld_ResetStateAfterWhiteOut(void)
{
ResetInitialPlayerAvatarState();
@ -409,8 +428,8 @@ static void Overworld_ResetStateAfterWhiteOut(void)
FlagClear(FLAG_SYS_SAFARI_MODE);
FlagClear(FLAG_SYS_USE_STRENGTH);
FlagClear(FLAG_SYS_USE_FLASH);
#if VAR_TERRAIN != 0
VarSet(VAR_TERRAIN, 0);
#if B_RESET_FLAGS_VARS_AFTER_WHITEOUT == TRUE
Overworld_ResetBattleFlagsAndVars();
#endif
// If you were defeated by Kyogre/Groudon and the step counter has
// maxed out, end the abnormal weather.

View File

@ -4470,11 +4470,8 @@ void ItemUseCB_BattleScript(u8 taskId, TaskFunc task)
gBattleStruct->itemPartyIndex[gBattlerInMenuId] = GetPartyIdFromBattleSlot(gPartyMenu.slotId);
gPartyMenuUseExitCallback = TRUE;
PlaySE(SE_SELECT);
CopyItemName(gSpecialVar_ItemId, gStringVar2);
StringExpandPlaceholders(gStringVar4, gText_PlayerUsedVar2);
DisplayPartyMenuMessage(gStringVar4, TRUE);
ScheduleBgCopyTilemapToVram(2);
RemoveBagItem(gSpecialVar_ItemId, 1);
ScheduleBgCopyTilemapToVram(2);
gTasks[taskId].func = task;
}
}
@ -4943,9 +4940,6 @@ static void TryUseItemOnMove(u8 taskId)
gChosenMovePos = ptr->data1;
gPartyMenuUseExitCallback = TRUE;
RemoveBagItem(gSpecialVar_ItemId, 1);
CopyItemName(gSpecialVar_ItemId, gStringVar2);
StringExpandPlaceholders(gStringVar4, gText_PlayerUsedVar2);
DisplayPartyMenuMessage(gStringVar4, TRUE);
ScheduleBgCopyTilemapToVram(2);
gTasks[taskId].func = Task_ClosePartyMenuAfterText;
}
@ -5090,7 +5084,7 @@ static void Task_LearnedMove(u8 taskId)
if (move[1] == 0)
{
AdjustFriendship(mon, FRIENDSHIP_EVENT_LEARN_TMHM);
if (item < ITEM_HM01_CUT)
if (!ItemId_GetImportance(item))
RemoveBagItem(item, 1);
}
GetMonNickname(mon, gStringVar1);
@ -5290,7 +5284,7 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task)
if (sInitialLevel != MAX_LEVEL)
{
BufferMonStatsToTaskData(mon, arrayPtr);
cannotUseEffect = ExecuteTableBasedItemEffect(mon, gPartyMenu.slotId, *itemPtr, 0);
cannotUseEffect = ExecuteTableBasedItemEffect(mon, *itemPtr, gPartyMenu.slotId, 0);
BufferMonStatsToTaskData(mon, &ptr->data[NUM_STATS]);
}
else

View File

@ -1919,7 +1919,7 @@ const struct SpindaSpot gSpindaSpotGraphics[] =
#include "data/pokemon/item_effects.h"
const s8 gNatureStatTable[NUM_NATURES][NUM_NATURE_STATS] =
{ // Attack Defense Speed Sp.Atk Sp.Def
{ // Attack Defense Speed Sp.Atk Sp. Def
[NATURE_HARDY] = { 0, 0, 0, 0, 0 },
[NATURE_LONELY] = { +1, -1, 0, 0, 0 },
[NATURE_BRAVE] = { +1, 0, -1, 0, 0 },
@ -5854,7 +5854,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
if (itemEffect[10] & ITEM10_IS_VITAMIN)
evCap = EV_ITEM_RAISE_LIMIT;
else
evCap = 252;
evCap = MAX_PER_STAT_EVS;
if (dataSigned >= evCap)
break;
@ -5880,6 +5880,10 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
break;
}
dataSigned += evChange;
#if I_EV_LOWERING_BERRY_JUMP == GEN_4
if (dataSigned > 100)
dataSigned = 100;
#endif
if (dataSigned < 0)
dataSigned = 0;
}
@ -6030,7 +6034,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
if (itemEffect[10] & ITEM10_IS_VITAMIN)
evCap = EV_ITEM_RAISE_LIMIT;
else
evCap = 252;
evCap = MAX_PER_STAT_EVS;
if (dataSigned >= evCap)
break;
@ -6056,6 +6060,10 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
break;
}
dataSigned += evChange;
#if I_BERRY_EV_JUMP == GEN_4
if (dataSigned > 100)
dataSigned = 100;
#endif
if (dataSigned < 0)
dataSigned = 0;
}

View File

@ -639,6 +639,9 @@ static void BuyMenuPrintPriceInList(u8 windowId, u32 itemId, u8 y)
5);
}
if (ItemId_GetImportance(itemId) && (CheckBagHasItem(itemId, 1) || CheckPCHasItem(itemId, 1)))
StringCopy(gStringVar4, gText_SoldOut);
else
StringExpandPlaceholders(gStringVar4, gText_PokedollarVar1);
x = GetStringRightAlignXOffset(FONT_NARROW, gStringVar4, 120);
AddTextPrinterParameterized4(windowId, FONT_NARROW, x, y, 0, 0, sShopBuyMenuTextColors[COLORID_ITEM_LIST], TEXT_SKIP_DRAW, gStringVar4);
@ -989,7 +992,9 @@ static void Task_BuyMenu(u8 taskId)
else
sShopData->totalCost = gDecorations[itemId].price;
if (!IsEnoughMoney(&gSaveBlock1Ptr->money, sShopData->totalCost))
if (ItemId_GetImportance(itemId) && (CheckBagHasItem(itemId, 1) || CheckPCHasItem(itemId, 1)))
BuyMenuDisplayMessage(taskId, gText_ThatItemIsSoldOut, BuyMenuReturnToItemList);
else if (!IsEnoughMoney(&gSaveBlock1Ptr->money, sShopData->totalCost))
{
BuyMenuDisplayMessage(taskId, gText_YouDontHaveMoney, BuyMenuReturnToItemList);
}
@ -998,7 +1003,15 @@ static void Task_BuyMenu(u8 taskId)
if (sMartInfo.martType == MART_TYPE_NORMAL)
{
CopyItemName(itemId, gStringVar1);
if (ItemId_GetPocket(itemId) == POCKET_TM_HM)
if (ItemId_GetImportance(itemId))
{
ConvertIntToDecimalStringN(gStringVar2, sShopData->totalCost, STR_CONV_MODE_LEFT_ALIGN, 6);
StringExpandPlaceholders(gStringVar4, gText_YouWantedVar1ThatllBeVar2);
tItemCount = 1;
sShopData->totalCost = (ItemId_GetPrice(tItemId) >> IsPokeNewsActive(POKENEWS_SLATEPORT)) * tItemCount;
BuyMenuDisplayMessage(taskId, gStringVar4, BuyMenuConfirmPurchase);
}
else if (ItemId_GetPocket(itemId) == POCKET_TM_HM)
{
StringCopy(gStringVar2, gMoveNames[ItemIdToBattleMoveId(itemId)]);
BuyMenuDisplayMessage(taskId, gText_Var1CertainlyHowMany2, Task_BuyHowManyDialogueInit);
@ -1103,8 +1116,8 @@ static void BuyMenuTryMakePurchase(u8 taskId)
{
if (AddBagItem(tItemId, tItemCount) == TRUE)
{
BuyMenuDisplayMessage(taskId, gText_HereYouGoThankYou, BuyMenuSubtractMoney);
RecordItemPurchase(taskId);
BuyMenuDisplayMessage(taskId, gText_HereYouGoThankYou, BuyMenuSubtractMoney);
}
else
{
@ -1170,6 +1183,7 @@ static void BuyMenuReturnToItemList(u8 taskId)
s16 *data = gTasks[taskId].data;
ClearDialogWindowAndFrameToTransparent(WIN_MESSAGE, FALSE);
RedrawListMenu(tListTaskId);
BuyMenuPrintCursor(tListTaskId, COLORID_ITEM_LIST);
PutWindowTilemap(WIN_ITEM_LIST);
PutWindowTilemap(WIN_ITEM_DESCRIPTION);

View File

@ -341,6 +341,8 @@ const u8 gText_Var1DisdainfullyAteVar2[] = _("{STR_VAR_1} disdainfully ate the\n
const u8 gText_ShopBuy[] = _("BUY");
const u8 gText_ShopSell[] = _("SELL");
const u8 gText_ShopQuit[] = _("QUIT");
const u8 gText_ThatItemIsSoldOut[] = _("I'm sorry, but that item is sold out.{PAUSE_UNTIL_PRESS}");
const u8 gText_SoldOut[] = _("SOLD OUT");
const u8 gText_InBagVar1[] = _("IN BAG: {STR_VAR_1}");
const u8 gText_QuitShopping[] = _("Quit shopping.");
const u8 gText_Var1CertainlyHowMany[] = _("{STR_VAR_1}? Certainly.\nHow many would you like?");

View File

@ -21,7 +21,7 @@ SINGLE_BATTLE_TEST("Contrary raises Attack when Intimidated", s16 damage)
if (ability == ABILITY_CONTRARY) {
ABILITY_POPUP(opponent, ABILITY_CONTRARY);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Spinda's attack rose!");
MESSAGE("Foe Spinda's Attack rose!");
}
HP_BAR(player, captureDamage: &results[i].damage);
}
@ -49,11 +49,11 @@ SINGLE_BATTLE_TEST("Contrary raises stats after using a move which would normall
if (ability == ABILITY_CONTRARY) {
// ABILITY_POPUP(opponent, ABILITY_CONTRARY);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Spinda's sp. attack sharply rose!");
MESSAGE("Foe Spinda's Sp. Atk sharply rose!");
}
else {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Spinda's sp. attack harshly fell!");
MESSAGE("Foe Spinda's Sp. Atk harshly fell!");
}
// MESSAGE("Foe Spinda used Overheat!");
@ -61,11 +61,11 @@ SINGLE_BATTLE_TEST("Contrary raises stats after using a move which would normall
if (ability == ABILITY_CONTRARY) {
// ABILITY_POPUP(opponent, ABILITY_CONTRARY);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Spinda's sp. attack sharply rose!");
MESSAGE("Foe Spinda's Sp. Atk sharply rose!");
}
else {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Spinda's sp. attack harshly fell!");
MESSAGE("Foe Spinda's Sp. Atk harshly fell!");
}
}
FINALLY {
@ -95,11 +95,11 @@ SINGLE_BATTLE_TEST("Contrary lowers a stat after using a move which would normal
if (ability == ABILITY_CONTRARY) {
// ABILITY_POPUP(opponent, ABILITY_CONTRARY);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Spinda's attack harshly fell!");
MESSAGE("Foe Spinda's Attack harshly fell!");
}
else {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Spinda's attack sharply rose!");
MESSAGE("Foe Spinda's Attack sharply rose!");
}
// MESSAGE("Foe Spinda used Tackle!");
@ -127,11 +127,11 @@ SINGLE_BATTLE_TEST("Contrary raises a stat after using a move which would normal
if (ability == ABILITY_CONTRARY) {
// ABILITY_POPUP(opponent, ABILITY_CONTRARY);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Spinda's attack rose!");
MESSAGE("Foe Spinda's Attack rose!");
}
else {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Spinda's attack fell!");
MESSAGE("Foe Spinda's Attack fell!");
}
MESSAGE("Foe Spinda used Tackle!");

View File

@ -7,7 +7,7 @@ ASSUMPTIONS
ASSUME(gBattleMoves[MOVE_TRI_ATTACK].split == SPLIT_SPECIAL);
}
SINGLE_BATTLE_TEST("Download raises Attack if player has lower Def than Sp.Def", s16 damage)
SINGLE_BATTLE_TEST("Download raises Attack if player has lower Def than Sp. Def", s16 damage)
{
u32 ability;
PARAMETRIZE { ability = ABILITY_TRACE; }
@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("Download raises Attack if player has lower Def than Sp.Def",
{
ABILITY_POPUP(opponent, ABILITY_DOWNLOAD);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Porygon's Download raised its attack!");
MESSAGE("Foe Porygon's Download raised its Attack!");
}
HP_BAR(player, captureDamage: &results[i].damage);
} FINALLY {
@ -30,7 +30,7 @@ SINGLE_BATTLE_TEST("Download raises Attack if player has lower Def than Sp.Def",
}
}
SINGLE_BATTLE_TEST("Download raises Sp.Attack if enemy has lower Sp.Def than Def", s16 damage)
SINGLE_BATTLE_TEST("Download raises Sp.Attack if enemy has lower Sp. Def than Def", s16 damage)
{
u32 ability;
PARAMETRIZE { ability = ABILITY_TRACE; }
@ -45,7 +45,7 @@ SINGLE_BATTLE_TEST("Download raises Sp.Attack if enemy has lower Sp.Def than Def
{
ABILITY_POPUP(player, ABILITY_DOWNLOAD);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Porygon's Download raised its sp. attack!");
MESSAGE("Porygon's Download raised its Sp. Atk!");
}
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
@ -79,10 +79,10 @@ SINGLE_BATTLE_TEST("Download doesn't activate if target hasn't been sent out yet
{
ABILITY_POPUP(player, ABILITY_DOWNLOAD);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Porygon's Download raised its attack!");
MESSAGE("Porygon's Download raised its Attack!");
ABILITY_POPUP(opponent, ABILITY_DOWNLOAD);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Porygon2's Download raised its sp. attack!");
MESSAGE("Foe Porygon2's Download raised its Sp. Atk!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player);
HP_BAR(opponent, captureDamage: &results[i].damagePhysical);

View File

@ -74,11 +74,11 @@ DOUBLE_BATTLE_TEST("Magic Bounce bounces back moves hitting both foes at two foe
MESSAGE("Abra's Leer was bounced back by Foe Espeon's Magic Bounce!");
ANIMATION(ANIM_TYPE_MOVE, MOVE_LEER, opponentLeft);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft);
MESSAGE("Abra's defense fell!");
MESSAGE("Abra's Defense fell!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight);
MESSAGE("Kadabra's defense fell!");
MESSAGE("Kadabra's Defense fell!");
// Also check if second original target gets hit by Leer as this was once bugged
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponentRight);
MESSAGE("Foe Wynaut's defense fell!");
MESSAGE("Foe Wynaut's Defense fell!");
}
}

View File

@ -63,6 +63,6 @@ SINGLE_BATTLE_TEST("Oblivious prevents Intimidate")
ABILITY_POPUP(opponent, ABILITY_INTIMIDATE);
ABILITY_POPUP(player, ABILITY_OBLIVIOUS);
NONE_OF { ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); }
MESSAGE("Slowpoke's attack was not lowered!");
MESSAGE("Slowpoke's Attack was not lowered!");
}
}

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "test_battle.h"
SINGLE_BATTLE_TEST("Speed Boost gradually boosts speed")
SINGLE_BATTLE_TEST("Speed Boost gradually boosts Speed")
{
GIVEN {
PLAYER(SPECIES_TORCHIC) { Ability(ABILITY_SPEED_BOOST); Speed(99); };

View File

@ -102,7 +102,7 @@ SINGLE_BATTLE_TEST("Volt Absorb prevents Cell Battery from activating")
NONE_OF {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_HELD_ITEM_EFFECT, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Using Cell Battery, the attack of Jolteon rose!");
MESSAGE("Using Cell Battery, the Attack of Jolteon rose!");
}
}

View File

@ -0,0 +1,187 @@
#include "global.h"
#include "test_battle.h"
ASSUMPTIONS
{
ASSUME(gItems[ITEM_BERSERK_GENE].holdEffect == HOLD_EFFECT_BERSERK_GENE);
}
SINGLE_BATTLE_TEST("Berserk Gene sharply raises attack at the start of battle", s16 damage)
{
u16 useItem;
PARAMETRIZE { useItem = FALSE; }
PARAMETRIZE { useItem = TRUE; }
if (useItem) PASSES_RANDOMLY(66, 100, RNG_CONFUSION);
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { if (useItem) Item(ITEM_BERSERK_GENE); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {
MOVE(player, MOVE_TACKLE);
}
} SCENE {
if (useItem)
{
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Using Berserk Gene, the Attack of Wobbuffet sharply rose!");
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, player);
MESSAGE("Wobbuffet became confused!");
}
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(2.0), results[1].damage);
}
}
SINGLE_BATTLE_TEST("Berserk Gene activates on switch in", s16 damage)
{
u16 useItem;
PARAMETRIZE { useItem = FALSE; }
PARAMETRIZE { useItem = TRUE; }
if (useItem) PASSES_RANDOMLY(66, 100, RNG_CONFUSION);
GIVEN {
PLAYER(SPECIES_WYNAUT);
PLAYER(SPECIES_WOBBUFFET) { if (useItem) Item(ITEM_BERSERK_GENE); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {
SWITCH(player, 1);
} TURN {
MOVE(player, MOVE_TACKLE);
}
} SCENE {
if (useItem)
{
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Using Berserk Gene, the Attack of Wobbuffet sharply rose!");
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, player);
MESSAGE("Wobbuffet became confused!");
}
HP_BAR(opponent, captureDamage: &results[i].damage);
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(2.0), results[1].damage);
}
}
SINGLE_BATTLE_TEST("Berserk Gene does not confuse a Pokemon with Own Tempo but still raises attack sharply", s16 damage)
{
u16 useItem;
PARAMETRIZE { useItem = FALSE; }
PARAMETRIZE { useItem = TRUE; }
GIVEN {
PLAYER(SPECIES_SLOWBRO) { Ability(ABILITY_OWN_TEMPO); if (useItem) Item(ITEM_BERSERK_GENE); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {
MOVE(player, MOVE_TACKLE);
}
} SCENE {
if (useItem)
{
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Using Berserk Gene, the Attack of Slowbro sharply rose!");
ABILITY_POPUP(player, ABILITY_OWN_TEMPO);
MESSAGE("Slowbro's Own Tempo prevents confusion!");
}
HP_BAR(opponent, captureDamage: &results[i].damage);
NONE_OF
{
MESSAGE("Slowbro became confused!");
}
} FINALLY {
EXPECT_MUL_EQ(results[0].damage, Q_4_12(2.0), results[1].damage);
}
}
SINGLE_BATTLE_TEST("Berserk Gene does not confuse on Misty Terrain but still raises attack sharply")
{
GIVEN {
ASSUME(P_GEN_7_POKEMON == TRUE);
PLAYER(SPECIES_TAPU_FINI) { Ability(ABILITY_MISTY_SURGE); Item(ITEM_BERSERK_GENE); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {
MOVE(player, MOVE_TACKLE);
}
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Using Berserk Gene, the Attack of Tapu Fini sharply rose!");
NONE_OF
{
MESSAGE("Tapu Fini became confused!");
}
}
}
SINGLE_BATTLE_TEST("Berserk Gene does not confuse when Safeguard is active")
{
GIVEN {
PLAYER(SPECIES_WYNAUT);
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BERSERK_GENE); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_SAFEGUARD); }
TURN { SWITCH(player, 1); }
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Using Berserk Gene, the Attack of Wobbuffet sharply rose!");
MESSAGE("Wobbuffet's party is protected by SAFEGUARD!");
NONE_OF
{
MESSAGE("Wobbuffet became confused!");
}
}
}
SINGLE_BATTLE_TEST("Berserk Gene causes confusion for more than 5 turns") // how else would be check for infinite?
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BERSERK_GENE); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {}
TURN {}
TURN {}
TURN {}
TURN {}
TURN {}
} SCENE {
NONE_OF
{
MESSAGE("Wobbuffet snapped out of confusion!");
}
}
}
SINGLE_BATTLE_TEST("Berserk Gene causes infinite confusion") // check if bit is set
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BERSERK_GENE); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN {}
} SCENE {
} THEN {
EXPECT(gStatuses4[GetBattlerAtPosition(B_POSITION_PLAYER_LEFT)] & STATUS4_INFINITE_CONFUSION);
}
}
SINGLE_BATTLE_TEST("Berserk Gene causes confusion timer to not tick down", u32 status2)
{
u32 turns;
PARAMETRIZE { turns = 1; }
PARAMETRIZE { turns = 2; }
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_BERSERK_GENE); };
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
u32 count;
for (count = 0; count < turns; count++) {
TURN {}
}
} THEN {
results[i].status2 = player->status2;
} FINALLY {
EXPECT_EQ(results[0].status2, results[1].status2);
}
}

View File

@ -1,7 +1,7 @@
#include "global.h"
#include "test_battle.h"
SINGLE_BATTLE_TEST("X-Attack sharply raises battler's attack stat", s16 damage)
SINGLE_BATTLE_TEST("X-Attack sharply raises battler's Attack stat", s16 damage)
{
u16 useItem;
PARAMETRIZE { useItem = FALSE; }

View File

@ -54,7 +54,7 @@ SINGLE_BATTLE_TEST("Turn order is determined by priority")
}
}
SINGLE_BATTLE_TEST("Turn order is determined by speed if priority ties")
SINGLE_BATTLE_TEST("Turn order is determined by Speed if priority ties")
{
GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Speed(2); }
@ -67,7 +67,7 @@ SINGLE_BATTLE_TEST("Turn order is determined by speed if priority ties")
}
}
SINGLE_BATTLE_TEST("Turn order is determined randomly if priority and speed tie")
SINGLE_BATTLE_TEST("Turn order is determined randomly if priority and Speed tie")
{
KNOWN_FAILING; // The algorithm is significantly biased.
PASSES_RANDOMLY(1, 2);

View File

@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("Growl lowers Attack", s16 damage)
if (lowerAttack) {
ANIMATION(ANIM_TYPE_MOVE, MOVE_GROWL, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Wobbuffet's attack fell!");
MESSAGE("Foe Wobbuffet's Attack fell!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
HP_BAR(player, captureDamage: &results[i].damage);

View File

@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("Meditate raises Attack", s16 damage)
if (raiseAttack) {
ANIMATION(ANIM_TYPE_MOVE, MOVE_MEDITATE, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's attack rose!");
MESSAGE("Wobbuffet's Attack rose!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player);
HP_BAR(opponent, captureDamage: &results[i].damage);

View File

@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("Howl raises user's Attack", s16 damage)
if (raiseAttack) {
ANIMATION(ANIM_TYPE_MOVE, MOVE_HOWL, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's attack rose!");
MESSAGE("Wobbuffet's Attack rose!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player);
HP_BAR(opponent, captureDamage: &results[i].damage);
@ -50,9 +50,9 @@ DOUBLE_BATTLE_TEST("Howl raises user's and partner's Attack", s16 damageLeft, s1
if (raiseAttack) {
ANIMATION(ANIM_TYPE_MOVE, MOVE_HOWL, playerLeft);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft);
MESSAGE("Wobbuffet's attack rose!");
MESSAGE("Wobbuffet's Attack rose!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerRight);
MESSAGE("Wynaut's attack rose!");
MESSAGE("Wynaut's Attack rose!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, playerLeft);
HP_BAR(opponentLeft, captureDamage: &results[i].damageLeft);

View File

@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("Tail Whip lowers Defense", s16 damage)
if (lowerDefense) {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TAIL_WHIP, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Wobbuffet's defense fell!");
MESSAGE("Foe Wobbuffet's Defense fell!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, player);
HP_BAR(opponent, captureDamage: &results[i].damage);

View File

@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("Harden raises Defense", s16 damage)
if (raiseDefense) {
ANIMATION(ANIM_TYPE_MOVE, MOVE_HARDEN, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's defense rose!");
MESSAGE("Wobbuffet's Defense rose!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
HP_BAR(player, captureDamage: &results[i].damage);

View File

@ -165,7 +165,7 @@ DOUBLE_BATTLE_TEST("Defog lowers evasiveness by 1 and removes Stealth Rock and S
MESSAGE("Pointed stones dug into Wobbuffet!");
MESSAGE("Wobbuffet was caught in a Sticky Web!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft);
MESSAGE("Wobbuffet's speed fell!");
MESSAGE("Wobbuffet's Speed fell!");
}
else {
NONE_OF {
@ -173,7 +173,7 @@ DOUBLE_BATTLE_TEST("Defog lowers evasiveness by 1 and removes Stealth Rock and S
MESSAGE("Pointed stones dug into Wobbuffet!");
MESSAGE("Wobbuffet was caught in a Sticky Web!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft);
MESSAGE("Wobbuffet's speed fell!");
MESSAGE("Wobbuffet's Speed fell!");
}
}
}

View File

@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("Confide lowers Special Attack", s16 damage)
if (lowerSpecialAttack) {
ANIMATION(ANIM_TYPE_MOVE, MOVE_CONFIDE, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent);
MESSAGE("Foe Wobbuffet's sp. attack fell!");
MESSAGE("Foe Wobbuffet's Sp. Atk fell!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_GUST, opponent);
HP_BAR(player, captureDamage: &results[i].damage);

View File

@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("Tail Glow drastically raises Special Attack", s16 damage)
if (raiseSpecialAttack) {
ANIMATION(ANIM_TYPE_MOVE, MOVE_TAIL_GLOW, player);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's sp. attack drastically rose!");
MESSAGE("Wobbuffet's Sp. Atk drastically rose!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_GUST, player);
HP_BAR(opponent, captureDamage: &results[i].damage);

View File

@ -142,7 +142,7 @@ SINGLE_BATTLE_TEST("Swallow heals HP depending on Stockpile's count", s16 hpHeal
}
}
SINGLE_BATTLE_TEST("Stockpile temporarily raises Def and Sp.Def", s16 dmgPyhsical, s16 dmgSpecial)
SINGLE_BATTLE_TEST("Stockpile temporarily raises Def and Sp. Def", s16 dmgPyhsical, s16 dmgSpecial)
{
u16 move;
PARAMETRIZE {move = MOVE_STOCKPILE;}
@ -161,8 +161,8 @@ SINGLE_BATTLE_TEST("Stockpile temporarily raises Def and Sp.Def", s16 dmgPyhsica
if (move == MOVE_STOCKPILE) {
MESSAGE("Wobbuffet stockpiled 1!");
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Wobbuffet's defense rose!");
MESSAGE("Wobbuffet's sp. defense rose!");
MESSAGE("Wobbuffet's Defense rose!");
MESSAGE("Wobbuffet's Sp. Def rose!");
}
ANIMATION(ANIM_TYPE_MOVE, MOVE_TACKLE, opponent);
@ -176,7 +176,7 @@ SINGLE_BATTLE_TEST("Stockpile temporarily raises Def and Sp.Def", s16 dmgPyhsica
}
}
DOUBLE_BATTLE_TEST("Stockpile's Def and Sp.Def boost is lost after using Spit Up or Swallow", s16 dmgPyhsicalBefore, s16 dmgPhysicalAfter, s16 dmgSpecialBefore, s16 dmgSpecialAfter)
DOUBLE_BATTLE_TEST("Stockpile's Def and Sp. Def boost is lost after using Spit Up or Swallow", s16 dmgPyhsicalBefore, s16 dmgPhysicalAfter, s16 dmgSpecialBefore, s16 dmgSpecialAfter)
{
u8 count;
u16 move;
@ -217,24 +217,24 @@ DOUBLE_BATTLE_TEST("Stockpile's Def and Sp.Def boost is lost after using Spit Up
ANIMATION(ANIM_TYPE_MOVE, move, playerLeft);
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft);
if (count == 1) {
MESSAGE("Wobbuffet's defense fell!");
MESSAGE("Wobbuffet's Defense fell!");
}
else if (count == 2) {
MESSAGE("Wobbuffet's defense harshly fell!");
MESSAGE("Wobbuffet's Defense harshly fell!");
}
else {
MESSAGE("Wobbuffet's defense severely fell!");
MESSAGE("Wobbuffet's Defense severely fell!");
}
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, playerLeft);
if (count == 1) {
MESSAGE("Wobbuffet's sp. defense fell!");
MESSAGE("Wobbuffet's Sp. Def fell!");
}
else if (count == 2) {
MESSAGE("Wobbuffet's sp. defense harshly fell!");
MESSAGE("Wobbuffet's Sp. Def harshly fell!");
}
else {
MESSAGE("Wobbuffet's sp. defense severely fell!");
MESSAGE("Wobbuffet's Sp. Def severely fell!");
}
MESSAGE("Wobbuffet's stockpiled effect wore off!");

View File

@ -53,7 +53,7 @@ SINGLE_BATTLE_TEST("Burn deals 1/16th damage per turn")
}
}
SINGLE_BATTLE_TEST("Burn reduces attack by 50%", s16 damage)
SINGLE_BATTLE_TEST("Burn reduces Attack by 50%", s16 damage)
{
bool32 burned;
PARAMETRIZE { burned = FALSE; }
@ -113,7 +113,7 @@ SINGLE_BATTLE_TEST("Freeze is thawed by user's Flame Wheel")
}
}
SINGLE_BATTLE_TEST("Paralysis reduces speed by 50%")
SINGLE_BATTLE_TEST("Paralysis reduces Speed by 50%")
{
u16 playerSpeed;
bool32 playerFirst;

View File

@ -31,7 +31,7 @@ SINGLE_BATTLE_TEST("Electric Terrain activates Electric Seed and Mimicry")
TURN { MOVE(player, MOVE_ELECTRIC_TERRAIN); }
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Using Electric Seed, the defense of Wobbuffet rose!");
MESSAGE("Using Electric Seed, the Defense of Wobbuffet rose!");
ABILITY_POPUP(opponent);
MESSAGE("Foe Stunfisk's type changed to Electr!");
} FINALLY {

View File

@ -27,7 +27,7 @@ SINGLE_BATTLE_TEST("Grassy Terrain activates Grassy Seed and Mimicry")
TURN { MOVE(player, MOVE_GRASSY_TERRAIN); }
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Using Grassy Seed, the defense of Wobbuffet rose!");
MESSAGE("Using Grassy Seed, the Defense of Wobbuffet rose!");
ABILITY_POPUP(opponent);
MESSAGE("Foe Stunfisk's type changed to Grass!");
} FINALLY {

View File

@ -31,7 +31,7 @@ SINGLE_BATTLE_TEST("Misty Terrain activates Misty Seed and Mimicry")
TURN { MOVE(player, MOVE_MISTY_TERRAIN); }
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Using Misty Seed, the sp. defense of Wobbuffet rose!");
MESSAGE("Using Misty Seed, the Sp. Def of Wobbuffet rose!");
ABILITY_POPUP(opponent);
MESSAGE("Foe Stunfisk's type changed to Fairy!");
} FINALLY {

View File

@ -30,7 +30,7 @@ SINGLE_BATTLE_TEST("Psychic Terrain activates Psychic Seed and Mimicry")
TURN { MOVE(player, MOVE_PSYCHIC_TERRAIN); }
} SCENE {
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player);
MESSAGE("Using Psychic Seed, the sp. defense of Wobbuffet rose!");
MESSAGE("Using Psychic Seed, the Sp. Def of Wobbuffet rose!");
ABILITY_POPUP(opponent);
MESSAGE("Foe Stunfisk's type changed to Psychc!");
} FINALLY {