Merge branch 'RHH/upcoming' into RHH/pr/upcoming/debugCleanup2
# Conflicts: # src/debug.c
This commit is contained in:
commit
4f0802f96e
2
Makefile
2
Makefile
@ -119,7 +119,7 @@ LIBPATH := -L ../../tools/agbcc/lib
|
||||
LIB := $(LIBPATH) -lgcc -lc -L../../libagbsyscall -lagbsyscall
|
||||
else
|
||||
CC1 = $(shell $(PATH_MODERNCC) --print-prog-name=cc1) -quiet
|
||||
override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17
|
||||
override CFLAGS += -mthumb -mthumb-interwork -O2 -mabi=apcs-gnu -mtune=arm7tdmi -march=armv4t -fno-toplevel-reorder -Wno-pointer-to-int-cast -std=gnu17 -Werror -Wall -Wno-strict-aliasing -Wno-attribute-alias
|
||||
ifeq ($(ANALYZE),1)
|
||||
override CFLAGS += -fanalyzer
|
||||
endif
|
||||
|
||||
@ -856,6 +856,10 @@ gBattleAnims_Moves::
|
||||
.4byte Move_MAGICAL_TORQUE
|
||||
.4byte Move_PSYBLADE
|
||||
.4byte Move_HYDRO_STEAM
|
||||
.4byte Move_BLOOD_MOON
|
||||
.4byte Move_MATCHA_GOTCHA
|
||||
.4byte Move_SYRUP_BOMB
|
||||
.4byte Move_IVY_CUDGEL
|
||||
@@@@ Z MOVES
|
||||
.4byte Move_BREAKNECK_BLITZ
|
||||
.4byte Move_ALL_OUT_PUMMELING
|
||||
@ -16505,6 +16509,10 @@ Move_COMBAT_TORQUE::
|
||||
Move_MAGICAL_TORQUE::
|
||||
Move_PSYBLADE::
|
||||
Move_HYDRO_STEAM::
|
||||
Move_BLOOD_MOON::
|
||||
Move_MATCHA_GOTCHA::
|
||||
Move_SYRUP_BOMB::
|
||||
Move_IVY_CUDGEL::
|
||||
end @to do
|
||||
|
||||
@@@@@@@@@@@@@@@@@@@@@@@ GEN 1-3 @@@@@@@@@@@@@@@@@@@@@@@
|
||||
@ -19418,8 +19426,8 @@ Move_MILK_DRINK:
|
||||
Move_MAGNITUDE:
|
||||
createvisualtask AnimTask_IsPowerOver99, 2
|
||||
waitforvisualfinish
|
||||
jumpargeq 15, FALSE, MagnitudeRegular
|
||||
jumpargeq 15, TRUE, MagnitudeIntense
|
||||
jumpreteq FALSE, MagnitudeRegular
|
||||
jumpreteq TRUE, MagnitudeIntense
|
||||
MagnitudeEnd:
|
||||
end
|
||||
MagnitudeRegular:
|
||||
|
||||
@ -438,8 +438,51 @@ gBattleScriptsForMoveEffects::
|
||||
.4byte BattleScript_EffectHit @ EFFECT_GIGATON_HAMMER
|
||||
.4byte BattleScript_EffectSaltCure @ EFFECT_SALT_CURE
|
||||
|
||||
.4byte BattleScript_EffectMatchaGotcha @ EFFECT_MATCHA_GOTCHA
|
||||
.4byte BattleScript_EffectSyrupBomb @ EFFECT_SYRUP_BOMB
|
||||
.4byte BattleScript_EffectHit @ EFFECT_IVY_CUDGEL
|
||||
|
||||
BattleScript_EffectSyrupBomb::
|
||||
setmoveeffect MOVE_EFFECT_SYRUP_BOMB
|
||||
call BattleScript_EffectHit_Ret
|
||||
seteffectwithchance
|
||||
tryfaintmon BS_TARGET
|
||||
printstring STRINGID_TARGETCOVEREDINSTICKYCANDYSYRUP
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_SyrupBombEndTurn::
|
||||
setbyte sSTAT_ANIM_PLAYED, FALSE
|
||||
copybyte sBATTLER, gBattlerTarget
|
||||
jumpifholdeffect BS_TARGET, HOLD_EFFECT_CLEAR_AMULET, BattleScript_SyrupBombItemNoStatLoss
|
||||
jumpifability BS_TARGET, ABILITY_CLEAR_BODY, BattleScript_SyrupBombAbilityNoStatLoss
|
||||
jumpifability BS_TARGET, ABILITY_FULL_METAL_BODY, BattleScript_SyrupBombAbilityNoStatLoss
|
||||
jumpifability BS_TARGET, ABILITY_WHITE_SMOKE, BattleScript_SyrupBombAbilityNoStatLoss
|
||||
jumpifstat BS_TARGET, CMP_GREATER_THAN, BIT_SPEED, MIN_STAT_STAGE, BattleScript_SyrupBombLowerSpeed
|
||||
goto BattleScript_SyrupBombEnd2
|
||||
BattleScript_SyrupBombLowerSpeed:
|
||||
playstatchangeanimation BS_ATTACKER, BIT_SPEED, STAT_CHANGE_NEGATIVE
|
||||
setbyte sSTAT_ANIM_PLAYED, TRUE
|
||||
setstatchanger STAT_SPEED, 1, TRUE
|
||||
statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_SyrupBombEnd2
|
||||
jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_SyrupBombEnd2
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
BattleScript_SyrupBombItemNoStatLoss::
|
||||
call BattleScript_ItemNoStatLoss
|
||||
goto BattleScript_SyrupBombEnd2
|
||||
BattleScript_SyrupBombAbilityNoStatLoss::
|
||||
call BattleScript_AbilityNoStatLoss
|
||||
BattleScript_SyrupBombEnd2::
|
||||
end2
|
||||
|
||||
BattleScript_EffectMatchaGotcha::
|
||||
setmoveeffect MOVE_EFFECT_BURN
|
||||
goto BattleScript_EffectAbsorb
|
||||
|
||||
BattleScript_EffectSaltCure:
|
||||
call BattleScript_EffectHit_Ret
|
||||
tryfaintmon BS_TARGET
|
||||
jumpiffainted BS_TARGET, TRUE, BattleScript_EffectSaltCure_End
|
||||
applysaltcure BS_TARGET
|
||||
printstring STRINGID_TARGETISBEINGSALTCURED
|
||||
@ -3332,6 +3375,7 @@ BattleScript_EffectPoisonHit:
|
||||
|
||||
BattleScript_EffectAbsorb::
|
||||
call BattleScript_EffectHit_Ret
|
||||
seteffectwithchance
|
||||
jumpifstatus3 BS_ATTACKER, STATUS3_HEAL_BLOCK, BattleScript_AbsorbHealBlock
|
||||
setdrainedhp
|
||||
manipulatedamage DMG_BIG_ROOT
|
||||
@ -3852,6 +3896,7 @@ BattleScript_EffectRest::
|
||||
jumpifuproarwakes BattleScript_RestCantSleep
|
||||
jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_InsomniaProtects
|
||||
jumpifability BS_TARGET, ABILITY_VITAL_SPIRIT, BattleScript_InsomniaProtects
|
||||
jumpifability BS_ATTACKER, ABILITY_PURIFYING_SALT, BattleScript_InsomniaProtects
|
||||
.if B_LEAF_GUARD_PREVENTS_REST >= GEN_5
|
||||
jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardPreventsRest
|
||||
.endif
|
||||
@ -7959,9 +8004,10 @@ BattleScript_DoTurnDmgEnd:
|
||||
end2
|
||||
|
||||
BattleScript_PoisonHealActivates::
|
||||
copybyte gBattlerAbility, gBattlerAttacker
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_POISONHEALHPUP
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
recordability BS_ATTACKER
|
||||
statusanimation BS_ATTACKER
|
||||
orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE | HITMARKER_PASSIVE_DAMAGE
|
||||
healthbarupdate BS_ATTACKER
|
||||
@ -8711,28 +8757,6 @@ BattleScript_ActivateTerrainEffects_Increment:
|
||||
restoretarget
|
||||
return
|
||||
|
||||
BattleScript_ActivateSwitchInAbilities:
|
||||
copybyte sBATTLER, gBattlerAttacker
|
||||
setbyte gBattlerAttacker, 0
|
||||
BattleScript_ActivateSwitchInAbilities_Loop:
|
||||
switchinabilities BS_ATTACKER
|
||||
BattleScript_ActivateSwitchInAbilities_Increment:
|
||||
addbyte gBattlerAttacker, 1
|
||||
jumpifbytenotequal gBattlerAttacker, gBattlersCount, BattleScript_ActivateSwitchInAbilities_Loop
|
||||
copybyte gBattlerAttacker, sBATTLER
|
||||
return
|
||||
|
||||
BattleScript_ActivateTerrainAbilities:
|
||||
savetarget
|
||||
setbyte gBattlerTarget, 0
|
||||
BattleScript_ActivateTerrainAbilities_Loop:
|
||||
activateterrainchangeabilities BS_ATTACKER
|
||||
BattleScript_ActivateTerrainAbilities_Increment:
|
||||
addbyte gBattlerTarget, 1
|
||||
jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_ActivateTerrainAbilities_Loop
|
||||
restoretarget
|
||||
return
|
||||
|
||||
BattleScript_ElectricSurgeActivates::
|
||||
pause B_WAIT_TIME_SHORT
|
||||
call BattleScript_AbilityPopUp
|
||||
@ -9901,6 +9925,14 @@ BattleScript_MirrorHerbCopyStatChange::
|
||||
copybyte gBattlerAttacker, sSAVED_BATTLER @ restore the original attacker just to be safe
|
||||
return
|
||||
|
||||
BattleScript_OpportunistCopyStatChange::
|
||||
call BattleScript_AbilityPopUp
|
||||
printstring STRINGID_OPPORTUNISTCOPIED
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
call BattleScript_TotemVar_Ret
|
||||
copybyte gBattlerAttacker, sSAVED_BATTLER @ restore the original attacker just to be safe
|
||||
end3
|
||||
|
||||
BattleScript_TotemVar::
|
||||
call BattleScript_TotemVar_Ret
|
||||
end2
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
#include "global.h"
|
||||
#include "malloc.h"
|
||||
#if TESTING
|
||||
#include "test/test.h"
|
||||
#endif
|
||||
|
||||
static void *sHeapStart;
|
||||
static u32 sHeapSize;
|
||||
@ -71,7 +74,27 @@ void *AllocInternal(void *heapStart, u32 size, const char *location)
|
||||
}
|
||||
|
||||
if (pos->next == head)
|
||||
{
|
||||
#if TESTING
|
||||
const struct MemBlock *head = HeapHead();
|
||||
const struct MemBlock *block = head;
|
||||
do
|
||||
{
|
||||
if (block->allocated)
|
||||
{
|
||||
const char *location = MemBlockLocation(block);
|
||||
if (location)
|
||||
MgbaPrintf_("%s: %d bytes allocated", location, block->size);
|
||||
else
|
||||
MgbaPrintf_("<unknown>: %d bytes allocated", block->size);
|
||||
}
|
||||
block = block->next;
|
||||
}
|
||||
while (block != head);
|
||||
Test_ExitWithResult(TEST_RESULT_ERROR, "%s: OOM allocating %d bytes", location, size);
|
||||
#endif
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pos = pos->next;
|
||||
}
|
||||
|
||||
@ -324,7 +324,7 @@ void AnimateSprites(void)
|
||||
void BuildOamBuffer(void)
|
||||
{
|
||||
bool32 oamLoadDisabled;
|
||||
u32 i, stride;
|
||||
u32 i;
|
||||
u8 oamIndex;
|
||||
|
||||
// All attributes which affect sorting packed into a single u32:
|
||||
|
||||
BIN
graphics/pokemon/pikachu/world_cap/icon.png
Normal file
BIN
graphics/pokemon/pikachu/world_cap/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 370 B |
@ -103,6 +103,7 @@ struct DisableStruct
|
||||
u8 toxicSpikesDone:1;
|
||||
u8 stickyWebDone:1;
|
||||
u8 stealthRockDone:1;
|
||||
u8 syrupBombTimer;
|
||||
};
|
||||
|
||||
struct ProtectStruct
|
||||
@ -149,6 +150,7 @@ struct ProtectStruct
|
||||
u16 shellTrap:1;
|
||||
u16 silkTrapped:1;
|
||||
u16 eatMirrorHerb:1;
|
||||
u16 activateOpportunist:2; // 2 - to copy stats. 1 - stats copied (do not repeat). 0 - no stats to copy
|
||||
u32 physicalDmg;
|
||||
u32 specialDmg;
|
||||
u8 physicalBattlerId;
|
||||
@ -901,7 +903,7 @@ struct MonSpritesGfx
|
||||
u16 *buffer;
|
||||
};
|
||||
|
||||
struct TotemBoost
|
||||
struct QueuedStatBoost
|
||||
{
|
||||
u8 stats; // bitfield for each battle stat that is set if the stat changes
|
||||
s8 statChanges[NUM_BATTLE_STATS - 1]; // highest bit being set decreases the stat
|
||||
@ -920,7 +922,7 @@ extern u16 gBattle_WIN0H;
|
||||
extern u16 gBattle_WIN0V;
|
||||
extern u16 gBattle_WIN1H;
|
||||
extern u16 gBattle_WIN1V;
|
||||
extern u8 gDisplayedStringBattle[400];
|
||||
extern u8 gDisplayedStringBattle[425];
|
||||
extern u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT];
|
||||
extern u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT];
|
||||
extern u8 gBattleTextBuff3[30]; //to handle stupidly large z move names
|
||||
@ -1014,7 +1016,7 @@ extern u32 gFieldStatuses;
|
||||
extern struct FieldTimer gFieldTimers;
|
||||
extern u8 gBattlerAbility;
|
||||
extern u16 gPartnerSpriteId;
|
||||
extern struct TotemBoost gTotemBoosts[MAX_BATTLERS_COUNT];
|
||||
extern struct QueuedStatBoost gQueuedStatBoosts[MAX_BATTLERS_COUNT];
|
||||
|
||||
extern void (*gPreBattleCallback1)(void);
|
||||
extern void (*gBattleMainFunc)(void);
|
||||
|
||||
@ -24,6 +24,13 @@
|
||||
score += val; \
|
||||
} while (0) \
|
||||
|
||||
#define ADJUST_SCORE_PTR(val) \
|
||||
do \
|
||||
{ \
|
||||
TestRunner_Battle_AIAdjustScore(__FILE__, __LINE__, sBattler_AI, AI_THINKING_STRUCT->movesetIndex, val); \
|
||||
(*score) += val; \
|
||||
} while (0) \
|
||||
|
||||
#define RETURN_SCORE_PLUS(val) \
|
||||
{ \
|
||||
ADJUST_SCORE(val); \
|
||||
|
||||
@ -112,8 +112,6 @@ bool32 IsStatLoweringMoveEffect(u32 moveEffect);
|
||||
bool32 IsMoveRedirectionPrevented(u32 move, u32 atkAbility);
|
||||
bool32 IsMoveEncouragedToHit(u32 battlerAtk, u32 battlerDef, u32 move);
|
||||
bool32 IsHazardMoveEffect(u32 moveEffect);
|
||||
bool32 MoveCallsOtherMove(u32 move);
|
||||
bool32 MoveRequiresRecharging(u32 move);
|
||||
bool32 IsEncoreEncouragedEffect(u32 moveEffect);
|
||||
void ProtectChecks(u32 battlerAtk, u32 battlerDef, u32 move, u32 predictedMove, s32 *score);
|
||||
bool32 ShouldSetSandstorm(u32 battler, u32 ability, u32 holdEffect);
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
#ifndef GUARD_BATTLE_SCRIPTS_H
|
||||
#define GUARD_BATTLE_SCRIPTS_H
|
||||
|
||||
extern const u8 BattleScript_OpportunistCopyStatChange[];
|
||||
extern const u8 BattleScript_MirrorHerbCopyStatChange[];
|
||||
extern const u8 BattleScript_MirrorHerbCopyStatChangeEnd2[];
|
||||
extern const u8 BattleScript_NotAffected[];
|
||||
@ -478,6 +479,7 @@ extern const u8 BattleScript_UltraBurst[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedCurrentMove[];
|
||||
extern const u8 BattleScript_SelectingNotAllowedCurrentMoveInPalace[];
|
||||
extern const u8 BattleScript_SaltCureExtraDamage[];
|
||||
extern const u8 BattleScript_SyrupBombEndTurn[];
|
||||
|
||||
// zmoves
|
||||
extern const u8 BattleScript_ZMoveActivateDamaging[];
|
||||
|
||||
@ -33,14 +33,15 @@
|
||||
#define ABILITYEFFECT_TRACE2 10
|
||||
#define ABILITYEFFECT_MOVE_END_OTHER 11
|
||||
#define ABILITYEFFECT_NEUTRALIZINGGAS 12
|
||||
#define ABILITYEFFECT_FIELD_SPORT 13 // Only used if B_SPORT_TURNS < GEN_6
|
||||
#define ABILITYEFFECT_FIELD_SPORT 13 // Only used if B_SPORT_TURNS >= GEN_6
|
||||
#define ABILITYEFFECT_ON_WEATHER 14
|
||||
#define ABILITYEFFECT_ON_TERRAIN 15
|
||||
#define ABILITYEFFECT_SWITCH_IN_TERRAIN 16
|
||||
#define ABILITYEFFECT_SWITCH_IN_WEATHER 17
|
||||
#define ABILITYEFFECT_OPPORTUNIST 18
|
||||
// Special cases
|
||||
#define ABILITYEFFECT_MUD_SPORT 252 // Only used if B_SPORT_TURNS < GEN_6
|
||||
#define ABILITYEFFECT_WATER_SPORT 253 // Only used if B_SPORT_TURNS < GEN_6
|
||||
#define ABILITYEFFECT_MUD_SPORT 252 // Only used if B_SPORT_TURNS >= GEN_6
|
||||
#define ABILITYEFFECT_WATER_SPORT 253 // Only used if B_SPORT_TURNS >= GEN_6
|
||||
|
||||
// For the first argument of ItemBattleEffects, to deteremine which block of item effects to try
|
||||
#define ITEMEFFECT_ON_SWITCH_IN 0
|
||||
@ -248,6 +249,7 @@ bool32 ChangeTypeBasedOnTerrain(u32 battler);
|
||||
void RemoveConfusionStatus(u32 battler);
|
||||
u8 GetBattlerGender(u32 battler);
|
||||
bool32 AreBattlersOfOppositeGender(u32 battler1, u32 battler2);
|
||||
bool32 AreBattlersOfSameGender(u32 battler1, u32 battler2);
|
||||
u32 CalcSecondaryEffectChance(u32 battler, u8 secondaryEffectChance);
|
||||
u8 GetBattlerType(u32 battler, u8 typeIndex);
|
||||
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
#define B_CONFUSION_SELF_DMG_CHANCE GEN_LATEST // In Gen7+, confusion has a 33.3% of self-damage, instead of 50%.
|
||||
#define B_MULTI_HIT_CHANCE GEN_LATEST // In Gen5+, multi-hit moves have different %. See Cmd_setmultihitcounter for values.
|
||||
#define B_WHITEOUT_MONEY GEN_LATEST // In Gen4+, the amount of money lost by losing a battle is determined by the amount of badges earned. Previously, it would cut the current money by half. (While this change was also in FRLG, for the sake of simplicity, setting this to GEN_3 will result in RSE behavior.)
|
||||
#define B_LIGHT_BALL_ATTACK_BOOST GEN_LATEST // In Gen4+, Light Ball doubles the power of physical moves in addition to special moves.
|
||||
#define B_SANDSTORM_SPDEF_BOOST GEN_LATEST // In Gen4+, Sandstorm weather multiplies the Sp. Defense of Rock-type Pokémon by x1.5.
|
||||
|
||||
// Experience settings
|
||||
#define B_EXP_CATCH GEN_LATEST // In Gen6+, Pokémon get experience from catching.
|
||||
@ -23,7 +25,7 @@
|
||||
#define B_RECALCULATE_STATS GEN_LATEST // In Gen5+, the stats of the Pokémon who participate in battle are recalculated at the end of each battle.
|
||||
|
||||
// Damage settings
|
||||
#define B_BURN_DAMAGE GEN_LATEST // In Gen7+, burn damage is 1/16th of max HP instead of 1/8th.
|
||||
#define B_BURN_DAMAGE GEN_LATEST // In Gen7+, burn damage is 1/16th of max HP instead of 1/8th. Also applies to Frostbite.
|
||||
#define B_BURN_FACADE_DMG GEN_LATEST // In Gen6+, burn's effect of lowering the Attack stat no longer applies to Facade.
|
||||
#define B_BINDING_DAMAGE GEN_LATEST // In Gen6+, binding damage is 1/8 of max HP instead of 1/16. (With Binding Band, 1/6 and 1/8 respectively.)
|
||||
#define B_PSYWAVE_DMG GEN_LATEST // Psywave's damage formula. See Cmd_psywavedamageeffect.
|
||||
@ -126,16 +128,17 @@
|
||||
#define B_ABSORBING_ABILITY_STRING GEN_LATEST // In Gen5+, the abilities that absorb moves of a certain type use a generic string for stat increases and decreases.
|
||||
#define B_LEAF_GUARD_PREVENTS_REST GEN_LATEST // In Gen5+, Leaf Guard prevents the use of Rest in harsh sunlight.
|
||||
#define B_SNOW_WARNING GEN_LATEST // In Gen9+, Snow Warning will summon snow instead of hail.
|
||||
#define B_TRANSISTOR_BOOST GEN_LATEST // In Gen9+, Transistor will only boost Electric-type moves by 1.3x as opposed to 1.5x.
|
||||
|
||||
// Item settings
|
||||
#define B_HP_BERRIES GEN_LATEST // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn.
|
||||
#define B_HP_BERRIES GEN_LATEST // In Gen4+, berries which restore HP activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn.
|
||||
#define B_BERRIES_INSTANT GEN_LATEST // In Gen4+, most berries activate on battle start/switch-in if applicable. In Gen3, they only activate either at the move end or turn end.
|
||||
#define B_CONFUSE_BERRIES_HEAL GEN_LATEST // Before Gen7, Figy and similar berries restore 1/8th of HP and trigger at half HP. In Gen7 they restore half HP, triggering at 25% HP. In Gen8 they heal 1/3rd of HP.
|
||||
#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_SOUL_DEW_BOOST GEN_LATEST // In Gens3-6, Soul Dew boosts Latis' 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.
|
||||
#define B_NEST_BALL_MODIFIER GEN_LATEST // Nest Ball's formula varies depending on the Gen. See Cmd_handleballthrow.
|
||||
|
||||
@ -19,6 +19,8 @@
|
||||
#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.
|
||||
|
||||
// Exp. Share config
|
||||
// To use this feature, replace the 0 with the flag ID you're assigning it to.
|
||||
// Eg: Replace with FLAG_UNUSED_0x264 so you can use that flag to toggle the feature.
|
||||
#define I_EXP_SHARE_FLAG 0 // If this flag is set, every Pokémon in the party will gain experience, regardless if they participated in the battle or not.
|
||||
#define I_EXP_SHARE_ITEM GEN_5 // In Gen6+, the Exp. Share was changed from a held item to a Key item that toggles the effect described above.
|
||||
|
||||
|
||||
@ -324,8 +324,16 @@
|
||||
#define ABILITY_ARMOR_TAIL 296
|
||||
#define ABILITY_EARTH_EATER 297
|
||||
#define ABILITY_MYCELIUM_MIGHT 298
|
||||
#define ABILITY_HOSPITALITY 299
|
||||
#define ABILITY_MINDS_EYE 300
|
||||
#define ABILITY_EMBODY_ASPECT_TEAL 301
|
||||
#define ABILITY_EMBODY_ASPECT_HEARTHFLAME 302
|
||||
#define ABILITY_EMBODY_ASPECT_WELLSPRING 303
|
||||
#define ABILITY_EMBODY_ASPECT_CORNERSTONE 304
|
||||
#define ABILITY_TOXIC_CHAIN 305
|
||||
#define ABILITY_SUPERSWEET_SYRUP 306
|
||||
|
||||
#define ABILITIES_COUNT_GEN9 299
|
||||
#define ABILITIES_COUNT_GEN9 307
|
||||
|
||||
#define ABILITIES_COUNT ABILITIES_COUNT_GEN9
|
||||
|
||||
|
||||
@ -189,6 +189,7 @@
|
||||
#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 STATUS4_SALT_CURE (1 << 5)
|
||||
#define STATUS4_SYRUP_BOMB (1 << 6)
|
||||
|
||||
#define HITMARKER_WAKE_UP_CLEAR (1 << 4) // Cleared when waking up. Never set or checked.
|
||||
#define HITMARKER_SKIP_DMG_TRACK (1 << 5)
|
||||
@ -385,8 +386,9 @@
|
||||
#define MOVE_EFFECT_STEALTH_ROCK 76
|
||||
#define MOVE_EFFECT_SPIKES 77
|
||||
#define MOVE_EFFECT_TRIPLE_ARROWS 78
|
||||
#define MOVE_EFFECT_SYRUP_BOMB 79
|
||||
|
||||
#define NUM_MOVE_EFFECTS 79
|
||||
#define NUM_MOVE_EFFECTS 80
|
||||
|
||||
#define MOVE_EFFECT_AFFECTS_USER 0x4000
|
||||
#define MOVE_EFFECT_CERTAIN 0x8000
|
||||
|
||||
@ -414,7 +414,10 @@
|
||||
#define EFFECT_MORTAL_SPIN 408
|
||||
#define EFFECT_GIGATON_HAMMER 409
|
||||
#define EFFECT_SALT_CURE 410
|
||||
#define EFFECT_MATCHA_GOTCHA 411
|
||||
#define EFFECT_SYRUP_BOMB 412
|
||||
#define EFFECT_IVY_CUDGEL 413
|
||||
|
||||
#define NUM_BATTLE_MOVE_EFFECTS 411
|
||||
#define NUM_BATTLE_MOVE_EFFECTS 414
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
||||
|
||||
@ -323,8 +323,9 @@
|
||||
#define MOVEEND_DANCER 31
|
||||
#define MOVEEND_EMERGENCY_EXIT 32
|
||||
#define MOVEEND_SYMBIOSIS 33
|
||||
#define MOVEEND_CLEAR_BITS 34
|
||||
#define MOVEEND_COUNT 35
|
||||
#define MOVEEND_OPPORTUNIST 34 // Occurs after other stat change items/abilities to try and copy the boosts
|
||||
#define MOVEEND_CLEAR_BITS 35
|
||||
#define MOVEEND_COUNT 36
|
||||
|
||||
// switch cases
|
||||
#define B_SWITCH_NORMAL 0
|
||||
|
||||
@ -670,8 +670,10 @@
|
||||
#define STRINGID_CURRENTMOVECANTSELECT 668
|
||||
#define STRINGID_TARGETISBEINGSALTCURED 669
|
||||
#define STRINGID_TARGETISHURTBYSALTCURE 670
|
||||
#define STRINGID_OPPORTUNISTCOPIED 671
|
||||
#define STRINGID_TARGETCOVEREDINSTICKYCANDYSYRUP 672
|
||||
|
||||
#define BATTLESTRINGS_COUNT 671
|
||||
#define BATTLESTRINGS_COUNT 673
|
||||
|
||||
// This is the string id that gBattleStringsTable starts with.
|
||||
// String ids before this (e.g. STRINGID_INTROMSG) are not in the table,
|
||||
|
||||
@ -160,9 +160,10 @@
|
||||
#define HOLD_EFFECT_COVERT_CLOAK 179
|
||||
#define HOLD_EFFECT_LOADED_DICE 180
|
||||
#define HOLD_EFFECT_BOOSTER_ENERGY 181 // Not implemented.
|
||||
#define HOLD_EFFECT_MASK 183
|
||||
|
||||
// Gen2 hold effect
|
||||
#define HOLD_EFFECT_BERSERK_GENE 182
|
||||
#define HOLD_EFFECT_BERSERK_GENE 184
|
||||
|
||||
#define HOLD_EFFECT_CHOICE(holdEffect)((holdEffect == HOLD_EFFECT_CHOICE_BAND || holdEffect == HOLD_EFFECT_CHOICE_SCARF || holdEffect == HOLD_EFFECT_CHOICE_SPECS))
|
||||
|
||||
|
||||
@ -66,6 +66,7 @@
|
||||
#define ITEM6_ADD_EV 10
|
||||
#define ITEM6_SUBTRACT_EV -10
|
||||
#define ITEM6_ADD_ONE_EV 1
|
||||
#define ITEM6_RESET_EV 0
|
||||
|
||||
// Used for GetItemEffectType.
|
||||
#define ITEM_EFFECT_X_ITEM 0
|
||||
|
||||
@ -914,7 +914,23 @@
|
||||
#define ITEM_PEAT_BLOCK 797
|
||||
#define ITEM_BERSERK_GENE 798
|
||||
|
||||
#define ITEMS_COUNT 799
|
||||
#define ITEM_FAIRY_FEATHER 799
|
||||
#define ITEM_SYRUPY_APPLE 800
|
||||
#define ITEM_UNREMARKABLE_TEACUP 801
|
||||
#define ITEM_MASTERPIECE_TEACUP 802
|
||||
#define ITEM_CORNERSTONE_MASK 803
|
||||
#define ITEM_WELLSPRING_MASK 804
|
||||
#define ITEM_HEARTHFLAME_MASK 805
|
||||
#define ITEM_HEALTH_MOCHI 806
|
||||
#define ITEM_MUSCLE_MOCHI 807
|
||||
#define ITEM_RESIST_MOCHI 808
|
||||
#define ITEM_GENIUS_MOCHI 809
|
||||
#define ITEM_CLEVER_MOCHI 810
|
||||
#define ITEM_SWIFT_MOCHI 811
|
||||
#define ITEM_FRESH_START_MOCHI 812
|
||||
#define ITEM_GLIMMERING_CHARM 813
|
||||
|
||||
#define ITEMS_COUNT 814
|
||||
#define ITEM_FIELD_ARROW ITEMS_COUNT
|
||||
|
||||
// A special item id associated with "Cancel"/"Exit" etc. in a list of items or decorations
|
||||
|
||||
@ -860,8 +860,12 @@
|
||||
#define MOVE_MAGICAL_TORQUE 826
|
||||
#define MOVE_PSYBLADE 827
|
||||
#define MOVE_HYDRO_STEAM 828
|
||||
#define MOVE_BLOOD_MOON 829
|
||||
#define MOVE_MATCHA_GOTCHA 830
|
||||
#define MOVE_SYRUP_BOMB 831
|
||||
#define MOVE_IVY_CUDGEL 832
|
||||
|
||||
#define MOVES_COUNT_GEN9 829
|
||||
#define MOVES_COUNT_GEN9 833
|
||||
|
||||
#define MOVES_COUNT MOVES_COUNT_GEN9
|
||||
|
||||
|
||||
@ -163,7 +163,7 @@
|
||||
|
||||
#define LEVEL_UP_MOVE_ID 0x01FF
|
||||
#define LEVEL_UP_MOVE_LV 0xFE00
|
||||
#define LEVEL_UP_END 0xFFFF
|
||||
#define LEVEL_UP_MOVE_END 0xFFFF
|
||||
|
||||
#define MAX_LEVEL_UP_MOVES 20
|
||||
|
||||
|
||||
@ -132,7 +132,7 @@ struct Weather
|
||||
s16 droughtTimer;
|
||||
s16 droughtState;
|
||||
u8 droughtUnused[9];
|
||||
s8 loadDroughtPalsIndex;
|
||||
u8 loadDroughtPalsIndex;
|
||||
u8 loadDroughtPalsOffset;
|
||||
};
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
#include "main.h"
|
||||
|
||||
extern struct BackupMapLayout gBackupMapLayout;
|
||||
extern u16 ALIGNED(4) sBackupMapData[MAX_MAP_DATA_SIZE];
|
||||
|
||||
u32 MapGridGetMetatileIdAt(int, int);
|
||||
u32 MapGridGetMetatileBehaviorAt(int, int);
|
||||
|
||||
@ -6158,6 +6158,7 @@ extern const u8 gMonIcon_PikachuUnovaCap[];
|
||||
extern const u8 gMonIcon_PikachuKalosCap[];
|
||||
extern const u8 gMonIcon_PikachuAlolaCap[];
|
||||
extern const u8 gMonIcon_PikachuPartnerCap[];
|
||||
extern const u8 gMonIcon_PikachuWorldCap[];
|
||||
extern const u8 gMonIcon_PichuSpikyEared[];
|
||||
extern const u8 gMonIcon_UnownB[];
|
||||
extern const u8 gMonIcon_UnownC[];
|
||||
|
||||
@ -13,6 +13,7 @@ void ItemUseOutOfBattle_WailmerPail(u8);
|
||||
void ItemUseOutOfBattle_Medicine(u8);
|
||||
void ItemUseOutOfBattle_AbilityCapsule(u8);
|
||||
void ItemUseOutOfBattle_AbilityPatch(u8);
|
||||
void ItemUseOutOfBattle_ResetEVs(u8);
|
||||
void ItemUseOutOfBattle_ReduceEV(u8);
|
||||
void ItemUseOutOfBattle_SacredAsh(u8);
|
||||
void ItemUseOutOfBattle_PPRecovery(u8);
|
||||
|
||||
@ -53,6 +53,7 @@ void ItemUseCB_BattleChooseMove(u8 taskId, TaskFunc task);
|
||||
void ItemUseCB_Medicine(u8 taskId, TaskFunc task);
|
||||
void ItemUseCB_AbilityCapsule(u8 taskId, TaskFunc task);
|
||||
void ItemUseCB_AbilityPatch(u8 taskId, TaskFunc task);
|
||||
void ItemUseCB_ResetEVs(u8 taskId, TaskFunc task);
|
||||
void ItemUseCB_ReduceEV(u8 taskId, TaskFunc task);
|
||||
void ItemUseCB_PPRecovery(u8 taskId, TaskFunc task);
|
||||
void ItemUseCB_PPUp(u8 taskId, TaskFunc task);
|
||||
|
||||
@ -92,6 +92,7 @@ enum RandomTag
|
||||
RNG_TRI_ATTACK,
|
||||
RNG_TRIPLE_ARROWS_DEFENSE_DOWN,
|
||||
RNG_TRIPLE_ARROWS_FLINCH,
|
||||
RNG_QUICK_DRAW,
|
||||
};
|
||||
|
||||
#define RandomWeighted(tag, ...) \
|
||||
|
||||
@ -3166,4 +3166,6 @@ extern const u8 gText_TellHimTheWords[];
|
||||
extern const u8 gText_ExpShareOn[];
|
||||
extern const u8 gText_ExpShareOff[];
|
||||
|
||||
extern const u8 gText_BasePointsResetToZero[];
|
||||
|
||||
#endif // GUARD_STRINGS_H
|
||||
|
||||
@ -504,8 +504,8 @@
|
||||
|
||||
enum { BATTLE_TEST_SINGLES, BATTLE_TEST_DOUBLES, BATTLE_TEST_WILD, BATTLE_TEST_AI_SINGLES, BATTLE_TEST_AI_DOUBLES };
|
||||
|
||||
typedef void (*SingleBattleTestFunction)(void *, u32, struct BattlePokemon *, struct BattlePokemon *);
|
||||
typedef void (*DoubleBattleTestFunction)(void *, u32, struct BattlePokemon *, struct BattlePokemon *, struct BattlePokemon *, struct BattlePokemon *);
|
||||
typedef void (*SingleBattleTestFunction)(void *, const u32, struct BattlePokemon *, struct BattlePokemon *);
|
||||
typedef void (*DoubleBattleTestFunction)(void *, const u32, struct BattlePokemon *, struct BattlePokemon *, struct BattlePokemon *, struct BattlePokemon *);
|
||||
|
||||
struct BattleTest
|
||||
{
|
||||
@ -712,7 +712,7 @@ struct BattleTestRunnerState
|
||||
};
|
||||
|
||||
extern const struct TestRunner gBattleTestRunner;
|
||||
extern struct BattleTestRunnerState *gBattleTestRunnerState;
|
||||
extern struct BattleTestRunnerState *const gBattleTestRunnerState;
|
||||
|
||||
#define MEMBERS(...) VARARG_8(MEMBERS_, __VA_ARGS__)
|
||||
#define MEMBERS_0()
|
||||
@ -746,7 +746,7 @@ extern struct BattleTestRunnerState *gBattleTestRunnerState;
|
||||
|
||||
#define BATTLE_TEST_ARGS_SINGLE(_name, _type, ...) \
|
||||
struct CAT(Result, __LINE__) { MEMBERS(__VA_ARGS__) }; \
|
||||
static void CAT(Test, __LINE__)(struct CAT(Result, __LINE__) *, u32, struct BattlePokemon *, struct BattlePokemon *); \
|
||||
static void CAT(Test, __LINE__)(struct CAT(Result, __LINE__) *, const u32, struct BattlePokemon *, struct BattlePokemon *); \
|
||||
__attribute__((section(".tests"))) static const struct Test CAT(sTest, __LINE__) = \
|
||||
{ \
|
||||
.name = _name, \
|
||||
@ -760,11 +760,11 @@ extern struct BattleTestRunnerState *gBattleTestRunnerState;
|
||||
.resultsSize = sizeof(struct CAT(Result, __LINE__)), \
|
||||
}, \
|
||||
}; \
|
||||
static void CAT(Test, __LINE__)(struct CAT(Result, __LINE__) *results, u32 i, struct BattlePokemon *player, struct BattlePokemon *opponent)
|
||||
static void CAT(Test, __LINE__)(struct CAT(Result, __LINE__) *results, const u32 i, struct BattlePokemon *player, struct BattlePokemon *opponent)
|
||||
|
||||
#define BATTLE_TEST_ARGS_DOUBLE(_name, _type, ...) \
|
||||
struct CAT(Result, __LINE__) { MEMBERS(__VA_ARGS__) }; \
|
||||
static void CAT(Test, __LINE__)(struct CAT(Result, __LINE__) *, u32, struct BattlePokemon *, struct BattlePokemon *, struct BattlePokemon *, struct BattlePokemon *); \
|
||||
static void CAT(Test, __LINE__)(struct CAT(Result, __LINE__) *, const u32, struct BattlePokemon *, struct BattlePokemon *, struct BattlePokemon *, struct BattlePokemon *); \
|
||||
__attribute__((section(".tests"))) static const struct Test CAT(sTest, __LINE__) = \
|
||||
{ \
|
||||
.name = _name, \
|
||||
@ -778,7 +778,7 @@ extern struct BattleTestRunnerState *gBattleTestRunnerState;
|
||||
.resultsSize = sizeof(struct CAT(Result, __LINE__)), \
|
||||
}, \
|
||||
}; \
|
||||
static void CAT(Test, __LINE__)(struct CAT(Result, __LINE__) *results, u32 i, struct BattlePokemon *playerLeft, struct BattlePokemon *opponentLeft, struct BattlePokemon *playerRight, struct BattlePokemon *opponentRight)
|
||||
static void CAT(Test, __LINE__)(struct CAT(Result, __LINE__) *results, const u32 i, struct BattlePokemon *playerLeft, struct BattlePokemon *opponentLeft, struct BattlePokemon *playerRight, struct BattlePokemon *opponentRight)
|
||||
|
||||
|
||||
#define SINGLE_BATTLE_TEST(_name, ...) BATTLE_TEST_ARGS_SINGLE(_name, BATTLE_TEST_SINGLES, __VA_ARGS__)
|
||||
@ -894,8 +894,8 @@ enum { TURN_CLOSED, TURN_OPEN, TURN_CLOSING };
|
||||
|
||||
#define EXPECT_MOVE(battler, ...) ExpectMove(__LINE__, battler, (struct MoveContext) { APPEND_TRUE(__VA_ARGS__) })
|
||||
#define NOT_EXPECT_MOVE(battler, _move) ExpectMove(__LINE__, battler, (struct MoveContext) { .move = _move, .explicitMove = TRUE, .notExpected = TRUE, .explicitNotExpected = TRUE, })
|
||||
#define EXPECT_MOVES(battler, ...) ExpectMoves(__LINE__, battler, FALSE, (struct FourMoves) { __VA_ARGS__ })
|
||||
#define NOT_EXPECT_MOVES(battler, ...) ExpectMoves(__LINE__, battler, TRUE, (struct FourMoves) { __VA_ARGS__ })
|
||||
#define EXPECT_MOVES(battler, ...) ExpectMoves(__LINE__, battler, FALSE, (struct FourMoves) {{ __VA_ARGS__ }})
|
||||
#define NOT_EXPECT_MOVES(battler, ...) ExpectMoves(__LINE__, battler, TRUE, (struct FourMoves) {{ __VA_ARGS__ }})
|
||||
#define EXPECT_SEND_OUT(battler, partyIndex) ExpectSendOut(__LINE__, battler, partyIndex)
|
||||
#define EXPECT_SWITCH(battler, partyIndex) ExpectSwitch(__LINE__, battler, partyIndex)
|
||||
#define SCORE_EQ(battler, ...) Score(__LINE__, battler, CMP_EQUAL, FALSE, (struct TestAIScoreStruct) { APPEND_TRUE(__VA_ARGS__) } )
|
||||
|
||||
@ -24,8 +24,6 @@ void TestRunner_Battle_CheckBattleRecordActionType(u32 battlerId, u32 recordInde
|
||||
|
||||
u32 TestRunner_Battle_GetForcedAbility(u32 side, u32 partyIndex);
|
||||
|
||||
s32 MgbaPrintf_(const char *fmt, ...);
|
||||
|
||||
#else
|
||||
|
||||
#define TestRunner_Battle_RecordAbilityPopUp(...) (void)0
|
||||
@ -45,8 +43,6 @@ s32 MgbaPrintf_(const char *fmt, ...);
|
||||
|
||||
#define TestRunner_Battle_GetForcedAbility(...) (u32)0
|
||||
|
||||
#define MgbaPrintf_(...) (u32)0
|
||||
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
@ -351,7 +351,7 @@ static u16 GetRandomAlternateMove(u8 monId)
|
||||
else // == APPRENTICE_LVL_MODE_OPEN
|
||||
level = 60; // Despite being open level, level up moves are only read up to level 60
|
||||
|
||||
for (j = 0; learnset[j].move != LEVEL_UP_END; j++)
|
||||
for (j = 0; learnset[j].move != LEVEL_UP_MOVE_END; j++)
|
||||
{
|
||||
if (learnset[j].level > level)
|
||||
break;
|
||||
@ -468,7 +468,7 @@ static void GetLatestLearnedMoves(u16 species, u16 *moves)
|
||||
level = 60;
|
||||
|
||||
learnset = gLevelUpLearnsets[species];
|
||||
for (i = 0; learnset[i].move != LEVEL_UP_END; i++)
|
||||
for (i = 0; learnset[i].move != LEVEL_UP_MOVE_END; i++)
|
||||
{
|
||||
if (learnset[i].level > level)
|
||||
break;
|
||||
|
||||
@ -118,7 +118,7 @@ void BattleAI_SetupItems(void)
|
||||
static u32 GetWildAiFlags(void)
|
||||
{
|
||||
u32 avgLevel = GetMonData(&gEnemyParty[0], MON_DATA_LEVEL);
|
||||
u32 flags;
|
||||
u32 flags = 0;
|
||||
|
||||
if (IsDoubleBattle())
|
||||
avgLevel = (GetMonData(&gEnemyParty[0], MON_DATA_LEVEL) + GetMonData(&gEnemyParty[1], MON_DATA_LEVEL)) / 2;
|
||||
@ -174,7 +174,7 @@ void BattleAI_SetupFlags(void)
|
||||
// sBattler_AI set in ComputeBattleAiScores
|
||||
void BattleAI_SetupAIData(u8 defaultScoreMoves, u32 battler)
|
||||
{
|
||||
s32 i, move, dmg;
|
||||
s32 i;
|
||||
u8 moveLimitations;
|
||||
|
||||
// Clear AI data but preserve the flags.
|
||||
@ -492,7 +492,7 @@ static u32 ChooseMoveOrAction_Singles(u32 battlerAi)
|
||||
u8 currentMoveArray[MAX_MON_MOVES];
|
||||
u8 consideredMoveArray[MAX_MON_MOVES];
|
||||
u32 numOfBestMoves;
|
||||
s32 i, id;
|
||||
s32 i;
|
||||
u32 flags = AI_THINKING_STRUCT->aiFlags;
|
||||
|
||||
AI_DATA->partnerMove = 0; // no ally
|
||||
@ -721,7 +721,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
u32 moveEffect = gBattleMoves[move].effect;
|
||||
s32 moveType;
|
||||
u32 moveTarget = AI_GetBattlerMoveTargetType(battlerAtk, move);
|
||||
u32 accuracy = AI_DATA->moveAccuracy[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex];
|
||||
struct AiLogicData *aiData = AI_DATA;
|
||||
u32 effectiveness = aiData->effectiveness[battlerAtk][battlerDef][AI_THINKING_STRUCT->movesetIndex];
|
||||
bool32 isDoubleBattle = IsValidDoubleBattle(battlerAtk);
|
||||
@ -938,11 +937,10 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
} // ignore def ability check
|
||||
|
||||
// gen7+ dark type mons immune to priority->elevated moves from prankster
|
||||
#if B_PRANKSTER_DARK_TYPES >= GEN_7
|
||||
if (aiData->abilities[battlerAtk] == ABILITY_PRANKSTER && IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK) && IS_MOVE_STATUS(move)
|
||||
if (B_PRANKSTER_DARK_TYPES >= GEN_7 && IS_BATTLER_OF_TYPE(battlerDef, TYPE_DARK)
|
||||
&& aiData->abilities[battlerAtk] == ABILITY_PRANKSTER && IS_MOVE_STATUS(move)
|
||||
&& !(moveTarget & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_USER)))
|
||||
RETURN_SCORE_MINUS(10);
|
||||
#endif
|
||||
|
||||
// terrain & effect checks
|
||||
if (AI_IsTerrainAffected(battlerDef, STATUS_FIELD_ELECTRIC_TERRAIN))
|
||||
@ -1126,10 +1124,9 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
ADJUST_SCORE(-20);
|
||||
else if (!HasMoveWithType(battlerAtk, TYPE_ELECTRIC))
|
||||
ADJUST_SCORE(-10);
|
||||
#if B_CHARGE_SPDEF_RAISE >= GEN_5
|
||||
else if (!BattlerStatCanRise(battlerAtk, aiData->abilities[battlerAtk], STAT_SPDEF))
|
||||
else if (B_CHARGE_SPDEF_RAISE >= GEN_5
|
||||
&& !BattlerStatCanRise(battlerAtk, aiData->abilities[battlerAtk], STAT_SPDEF))
|
||||
ADJUST_SCORE(-5);
|
||||
#endif
|
||||
break;
|
||||
case EFFECT_QUIVER_DANCE:
|
||||
case EFFECT_GEOMANCY:
|
||||
@ -1416,10 +1413,8 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
case EFFECT_OHKO:
|
||||
#if B_SHEER_COLD_IMMUNITY >= GEN_7
|
||||
if (move == MOVE_SHEER_COLD && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE))
|
||||
if (B_SHEER_COLD_IMMUNITY >= GEN_7 && move == MOVE_SHEER_COLD && IS_BATTLER_OF_TYPE(battlerDef, TYPE_ICE))
|
||||
return 0;
|
||||
#endif
|
||||
if (!ShouldTryOHKO(battlerAtk, battlerDef, aiData->abilities[battlerAtk], aiData->abilities[battlerDef], move))
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
@ -1447,10 +1442,8 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
ADJUST_SCORE(-8);
|
||||
else if (aiData->hpPercents[battlerAtk] <= 25)
|
||||
ADJUST_SCORE(-10);
|
||||
#if B_SOUND_SUBSTITUTE >= GEN_6
|
||||
else if (HasSoundMove(battlerDef))
|
||||
else if (B_SOUND_SUBSTITUTE >= GEN_6 && HasSoundMove(battlerDef))
|
||||
ADJUST_SCORE(-8);
|
||||
#endif
|
||||
break;
|
||||
case EFFECT_LEECH_SEED:
|
||||
if (gStatuses3[battlerDef] & STATUS3_LEECHSEED
|
||||
@ -1462,9 +1455,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
break;
|
||||
case EFFECT_DISABLE:
|
||||
if (gDisableStructs[battlerDef].disableTimer == 0
|
||||
#if B_MENTAL_HERB >= GEN_5
|
||||
&& aiData->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB
|
||||
#endif
|
||||
&& (B_MENTAL_HERB < GEN_5 || aiData->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB)
|
||||
&& !PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, aiData->partnerMove))
|
||||
{
|
||||
if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker should go first
|
||||
@ -1484,9 +1475,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
break;
|
||||
case EFFECT_ENCORE:
|
||||
if (gDisableStructs[battlerDef].encoreTimer == 0
|
||||
#if B_MENTAL_HERB >= GEN_5
|
||||
&& aiData->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB
|
||||
#endif
|
||||
&& (B_MENTAL_HERB < GEN_5 || aiData->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB)
|
||||
&& !DoesPartnerHaveSameMoveEffect(BATTLE_PARTNER(battlerAtk), battlerDef, move, aiData->partnerMove))
|
||||
{
|
||||
if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // Attacker should go first
|
||||
@ -1715,10 +1704,8 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
ADJUST_SCORE(-10);
|
||||
break;
|
||||
}
|
||||
#if B_MENTAL_HERB >= GEN_5
|
||||
if (aiData->holdEffects[battlerDef] == HOLD_EFFECT_MENTAL_HERB)
|
||||
if (B_MENTAL_HERB >= GEN_5 && aiData->holdEffects[battlerDef] == HOLD_EFFECT_MENTAL_HERB)
|
||||
ADJUST_SCORE(-6);
|
||||
#endif
|
||||
break;
|
||||
case EFFECT_WILL_O_WISP:
|
||||
if (!AI_CanBurn(battlerAtk, battlerDef, aiData->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, aiData->partnerMove))
|
||||
@ -2534,8 +2521,7 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score)
|
||||
|
||||
if (instructedMove == MOVE_NONE
|
||||
|| gBattleMoves[instructedMove].instructBanned
|
||||
|| MoveRequiresRecharging(instructedMove)
|
||||
|| MoveCallsOtherMove(instructedMove)
|
||||
|| gBattleMoves[instructedMove].effect == EFFECT_RECHARGE
|
||||
|| IsZMove(instructedMove)
|
||||
|| (gLockedMoves[battlerDef] != 0 && gLockedMoves[battlerDef] != 0xFFFF)
|
||||
|| gBattleMons[battlerDef].status2 & STATUS2_MULTIPLETURNS
|
||||
@ -3154,26 +3140,13 @@ static u32 CompareMoveAccuracies(u32 battlerAtk, u32 battlerDef, u32 moveSlot1,
|
||||
return 2;
|
||||
}
|
||||
|
||||
static u32 GetAIMostDamagingMoveId(u32 battlerAtk, u32 battlerDef)
|
||||
{
|
||||
u32 i, id = 0;
|
||||
u32 mostDmg = 0;
|
||||
|
||||
for (i = 0; i < MAX_MON_MOVES; i++)
|
||||
{
|
||||
if (AI_DATA->simulatedDmg[battlerAtk][battlerDef][i] > mostDmg)
|
||||
id = i, mostDmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][i];
|
||||
}
|
||||
return id;
|
||||
}
|
||||
|
||||
static s32 AI_CompareDamagingMoves(u32 battlerAtk, u32 battlerDef, u32 currId)
|
||||
{
|
||||
u32 i;
|
||||
bool32 multipleBestMoves = FALSE;
|
||||
s32 noOfHits[MAX_MON_MOVES];
|
||||
s32 score = 0;
|
||||
s32 leastHits = 1000, leastHitsId = 0;
|
||||
s32 leastHits = 1000;
|
||||
u16 *moves = GetMovesArray(battlerAtk);
|
||||
bool8 isPowerfulIgnoredEffect[MAX_MON_MOVES];
|
||||
|
||||
@ -3185,7 +3158,6 @@ static s32 AI_CompareDamagingMoves(u32 battlerAtk, u32 battlerDef, u32 currId)
|
||||
if (noOfHits[i] < leastHits)
|
||||
{
|
||||
leastHits = noOfHits[i];
|
||||
leastHitsId = i;
|
||||
}
|
||||
isPowerfulIgnoredEffect[i] = IsInIgnoredPowerfulMoveEffects(gBattleMoves[moves[i]].effect);
|
||||
}
|
||||
@ -3829,10 +3801,7 @@ static s32 AI_CheckViability(u32 battlerAtk, u32 battlerDef, u32 move, s32 score
|
||||
break;
|
||||
case EFFECT_DISABLE:
|
||||
if (gDisableStructs[battlerDef].disableTimer == 0
|
||||
#if B_MENTAL_HERB >= GEN_5
|
||||
&& aiData->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB // mental herb
|
||||
#endif
|
||||
)
|
||||
&& (B_MENTAL_HERB < GEN_5 || aiData->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB))
|
||||
{
|
||||
if (AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER) // AI goes first
|
||||
{
|
||||
@ -3853,10 +3822,7 @@ static s32 AI_CheckViability(u32 battlerAtk, u32 battlerDef, u32 move, s32 score
|
||||
break;
|
||||
case EFFECT_ENCORE:
|
||||
if (gDisableStructs[battlerDef].encoreTimer == 0
|
||||
#if B_MENTAL_HERB >= GEN_5
|
||||
&& aiData->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB // mental herb
|
||||
#endif
|
||||
)
|
||||
&& (B_MENTAL_HERB < GEN_5 || aiData->holdEffects[battlerDef] != HOLD_EFFECT_MENTAL_HERB))
|
||||
{
|
||||
if (IsEncoreEncouragedEffect(gBattleMoves[gLastMoves[battlerDef]].effect))
|
||||
ADJUST_SCORE(3);
|
||||
@ -3905,9 +3871,8 @@ static s32 AI_CheckViability(u32 battlerAtk, u32 battlerDef, u32 move, s32 score
|
||||
{
|
||||
bool32 canSteal = FALSE;
|
||||
|
||||
#if B_TRAINERS_KNOCK_OFF_ITEMS == TRUE
|
||||
if (B_TRAINERS_KNOCK_OFF_ITEMS == TRUE)
|
||||
canSteal = TRUE;
|
||||
#endif
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_FRONTIER || GetBattlerSide(battlerAtk) == B_SIDE_PLAYER)
|
||||
canSteal = TRUE;
|
||||
|
||||
@ -4363,9 +4328,8 @@ static s32 AI_CheckViability(u32 battlerAtk, u32 battlerDef, u32 move, s32 score
|
||||
case EFFECT_CHARGE:
|
||||
if (HasDamagingMoveOfType(battlerAtk, TYPE_ELECTRIC))
|
||||
ADJUST_SCORE(2);
|
||||
#if B_CHARGE_SPDEF_RAISE >= GEN_5
|
||||
IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPDEF, &score);
|
||||
#endif
|
||||
if (B_CHARGE_SPDEF_RAISE >= GEN_5)
|
||||
IncreaseStatUpScore(battlerAtk, battlerDef, STAT_SPDEF, &score);
|
||||
break;
|
||||
case EFFECT_TAUNT:
|
||||
if (IS_MOVE_STATUS(predictedMove))
|
||||
|
||||
@ -420,7 +420,6 @@ static bool8 ShouldSwitchIfGameStatePrompt(u32 battler)
|
||||
|
||||
static bool8 ShouldSwitchIfAbilityBenefit(u32 battler)
|
||||
{
|
||||
s32 monToSwitchId;
|
||||
s32 moduloChance = 4; //25% Chance Default
|
||||
s32 chanceReducer = 1; //No Reduce default. Increase to reduce
|
||||
|
||||
@ -894,7 +893,7 @@ static u32 GetBestMonTypeMatchup(struct Pokemon *party, int firstId, int lastId,
|
||||
|
||||
static u32 GetBestMonDmg(struct Pokemon *party, int firstId, int lastId, u8 invalidMons, u32 battler, u32 opposingBattler)
|
||||
{
|
||||
int i, j;
|
||||
int i;
|
||||
int dmg, bestDmg = 0;
|
||||
int bestMonId = PARTY_SIZE;
|
||||
|
||||
@ -926,7 +925,7 @@ u8 GetMostSuitableMonToSwitchInto(u32 battler)
|
||||
s32 firstId = 0;
|
||||
s32 lastId = 0; // + 1
|
||||
struct Pokemon *party;
|
||||
s32 i, j, aliveCount = 0;
|
||||
s32 i, aliveCount = 0;
|
||||
u32 invalidMons = 0, aceMonId = PARTY_SIZE;
|
||||
|
||||
if (*(gBattleStruct->monToSwitchIntoId + battler) != PARTY_SIZE)
|
||||
@ -1004,8 +1003,6 @@ u8 GetMostSuitableMonToSwitchInto(u32 battler)
|
||||
|
||||
static bool32 AiExpectsToFaintPlayer(u32 battler)
|
||||
{
|
||||
bool32 canFaintPlayer;
|
||||
u32 i;
|
||||
u8 target = gBattleStruct->aiChosenTarget[battler];
|
||||
|
||||
if (gBattleStruct->aiMoveOrAction[battler] > 3)
|
||||
@ -1059,7 +1056,6 @@ static bool8 ShouldUseItem(u32 battler)
|
||||
{
|
||||
u16 item;
|
||||
const u8 *itemEffects;
|
||||
u8 paramOffset;
|
||||
u8 battlerSide;
|
||||
|
||||
item = gBattleResources->battleHistory->trainerItems[i];
|
||||
|
||||
@ -383,41 +383,6 @@ static const u16 sIgnoredPowerfulMoveEffects[] =
|
||||
IGNORED_MOVES_END
|
||||
};
|
||||
|
||||
static const u16 sIgnoreMoldBreakerMoves[] =
|
||||
{
|
||||
MOVE_MOONGEIST_BEAM,
|
||||
MOVE_SUNSTEEL_STRIKE,
|
||||
MOVE_PHOTON_GEYSER,
|
||||
MOVE_LIGHT_THAT_BURNS_THE_SKY,
|
||||
MOVE_MENACING_MOONRAZE_MAELSTROM,
|
||||
MOVE_SEARING_SUNRAZE_SMASH,
|
||||
};
|
||||
|
||||
static const u16 sRechargeMoves[] =
|
||||
{
|
||||
MOVE_HYPER_BEAM,
|
||||
MOVE_BLAST_BURN,
|
||||
MOVE_HYDRO_CANNON,
|
||||
MOVE_FRENZY_PLANT,
|
||||
MOVE_GIGA_IMPACT,
|
||||
MOVE_ROCK_WRECKER,
|
||||
MOVE_ROAR_OF_TIME,
|
||||
MOVE_PRISMATIC_LASER,
|
||||
MOVE_METEOR_ASSAULT,
|
||||
MOVE_ETERNABEAM,
|
||||
};
|
||||
|
||||
static const u16 sOtherMoveCallingMoves[] =
|
||||
{
|
||||
MOVE_ASSIST,
|
||||
MOVE_COPYCAT,
|
||||
MOVE_ME_FIRST,
|
||||
MOVE_METRONOME,
|
||||
MOVE_MIRROR_MOVE,
|
||||
MOVE_NATURE_POWER,
|
||||
MOVE_SLEEP_TALK,
|
||||
};
|
||||
|
||||
// Functions
|
||||
u32 GetAIChosenMove(u32 battlerId)
|
||||
{
|
||||
@ -651,10 +616,8 @@ bool32 IsBattlerTrapped(u32 battler, bool32 checkSwitch)
|
||||
{
|
||||
u32 holdEffect = AI_DATA->holdEffects[battler];
|
||||
|
||||
#if B_GHOSTS_ESCAPE >= GEN_6
|
||||
if (IS_BATTLER_OF_TYPE(battler, TYPE_GHOST))
|
||||
if (B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GHOST))
|
||||
return FALSE;
|
||||
#endif
|
||||
if (checkSwitch && holdEffect == HOLD_EFFECT_SHED_SHELL)
|
||||
return FALSE;
|
||||
else if (!checkSwitch && GetBattlerAbility(battler) == ABILITY_RUN_AWAY)
|
||||
@ -702,9 +665,7 @@ bool32 IsTruantMonVulnerable(u32 battlerAI, u32 opposingBattler)
|
||||
bool32 IsAffectedByPowder(u32 battler, u32 ability, u32 holdEffect)
|
||||
{
|
||||
if (ability == ABILITY_OVERCOAT
|
||||
#if B_POWDER_GRASS >= GEN_6
|
||||
|| IS_BATTLER_OF_TYPE(battler, TYPE_GRASS)
|
||||
#endif
|
||||
|| (B_POWDER_GRASS >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GRASS))
|
||||
|| holdEffect == HOLD_EFFECT_SAFETY_GOGGLES)
|
||||
return FALSE;
|
||||
return TRUE;
|
||||
@ -741,7 +702,7 @@ s32 AI_CalcDamageSaveBattlers(u32 move, u32 battlerAtk, u32 battlerDef, u8 *type
|
||||
{
|
||||
SaveBattlerData(battlerAtk);
|
||||
SaveBattlerData(battlerDef);
|
||||
AI_CalcDamage(move, battlerAtk, battlerDef, typeEffectiveness, considerZPower, AI_GetWeather(AI_DATA));
|
||||
return AI_CalcDamage(move, battlerAtk, battlerDef, typeEffectiveness, considerZPower, AI_GetWeather(AI_DATA));
|
||||
}
|
||||
|
||||
static inline s32 LowestRollDmg(s32 dmg)
|
||||
@ -846,8 +807,8 @@ s32 AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u8 *typeEffectivenes
|
||||
case EFFECT_FINAL_GAMBIT:
|
||||
dmg = gBattleMons[battlerAtk].hp;
|
||||
break;
|
||||
#if B_BEAT_UP >= GEN_5
|
||||
case EFFECT_BEAT_UP:
|
||||
if (B_BEAT_UP >= GEN_5)
|
||||
{
|
||||
u32 partyCount = CalculatePartyCount(GetBattlerParty(battlerAtk));
|
||||
u32 i;
|
||||
@ -859,7 +820,6 @@ s32 AI_CalcDamage(u32 move, u32 battlerAtk, u32 battlerDef, u8 *typeEffectivenes
|
||||
gBattleStruct->beatUpSlot = 0;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Handle other multi-strike moves
|
||||
@ -1265,7 +1225,6 @@ u32 AI_WhoStrikesFirst(u32 battlerAI, u32 battler2, u32 moveConsidered)
|
||||
{
|
||||
u32 fasterAI = 0, fasterPlayer = 0, i;
|
||||
s8 prioAI = 0;
|
||||
s8 prioPlayer = 0;
|
||||
s8 prioBattler2 = 0;
|
||||
u16 *battler2Moves = GetMovesArray(battler2);
|
||||
|
||||
@ -1311,7 +1270,7 @@ u32 AI_WhoStrikesFirst(u32 battlerAI, u32 battler2, u32 moveConsidered)
|
||||
// Check if target has means to faint ai mon.
|
||||
bool32 CanTargetFaintAi(u32 battlerDef, u32 battlerAtk)
|
||||
{
|
||||
s32 i, dmg;
|
||||
s32 i;
|
||||
u32 unusable = AI_DATA->moveLimitations[battlerDef];
|
||||
u16 *moves = GetMovesArray(battlerDef);
|
||||
|
||||
@ -1500,18 +1459,10 @@ bool32 AI_IsBattlerGrounded(u32 battlerId)
|
||||
|
||||
bool32 DoesBattlerIgnoreAbilityChecks(u32 atkAbility, u32 move)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_NEGATE_UNAWARE)
|
||||
return FALSE; // AI handicap flag: doesn't understand ability suppression concept
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(sIgnoreMoldBreakerMoves); i++)
|
||||
{
|
||||
if (move == sIgnoreMoldBreakerMoves[i])
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (IsMoldBreakerTypeAbility(atkAbility))
|
||||
if (IsMoldBreakerTypeAbility(atkAbility) || gBattleMoves[move].ignoresTargetAbility)
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
@ -1536,8 +1487,6 @@ u32 AI_GetWeather(struct AiLogicData *aiData)
|
||||
|
||||
u32 AI_GetBattlerMoveTargetType(u32 battlerId, u32 move)
|
||||
{
|
||||
u32 target;
|
||||
|
||||
if (gBattleMoves[move].effect == EFFECT_EXPANDING_FORCE && AI_IsTerrainAffected(battlerId, STATUS_FIELD_PSYCHIC_TERRAIN))
|
||||
return MOVE_TARGET_BOTH;
|
||||
else
|
||||
@ -1546,8 +1495,6 @@ u32 AI_GetBattlerMoveTargetType(u32 battlerId, u32 move)
|
||||
|
||||
bool32 IsAromaVeilProtectedMove(u32 move)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
switch (move)
|
||||
{
|
||||
case MOVE_DISABLE:
|
||||
@ -1672,10 +1619,8 @@ bool32 IsMoveEncouragedToHit(u32 battlerAtk, u32 battlerDef, u32 move)
|
||||
if (AI_DATA->abilities[battlerDef] == ABILITY_NO_GUARD || AI_DATA->abilities[battlerAtk] == ABILITY_NO_GUARD)
|
||||
return TRUE;
|
||||
|
||||
#if B_TOXIC_NEVER_MISS >= GEN_6
|
||||
if (gBattleMoves[move].effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON))
|
||||
if (B_TOXIC_NEVER_MISS >= GEN_6 && gBattleMoves[move].effect == EFFECT_TOXIC && IS_BATTLER_OF_TYPE(battlerAtk, TYPE_POISON))
|
||||
return TRUE;
|
||||
#endif
|
||||
|
||||
// discouraged from hitting
|
||||
weather = AI_GetWeather(AI_DATA);
|
||||
@ -1687,9 +1632,7 @@ bool32 IsMoveEncouragedToHit(u32 battlerAtk, u32 battlerDef, u32 move)
|
||||
if ((((weather & B_WEATHER_RAIN) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE))
|
||||
|| (((weather & (B_WEATHER_HAIL | B_WEATHER_SNOW)) && move == MOVE_BLIZZARD)))
|
||||
|| (gBattleMoves[move].effect == EFFECT_VITAL_THROW)
|
||||
#if B_MINIMIZE_DMG_ACC >= GEN_6
|
||||
|| ((gStatuses3[battlerDef] & STATUS3_MINIMIZED) && gBattleMoves[move].minimizeDoubleDamage)
|
||||
#endif
|
||||
|| (B_MINIMIZE_DMG_ACC >= GEN_6 && (gStatuses3[battlerDef] & STATUS3_MINIMIZED) && gBattleMoves[move].minimizeDoubleDamage)
|
||||
|| (gBattleMoves[move].accuracy == 0))
|
||||
{
|
||||
return TRUE;
|
||||
@ -1722,10 +1665,8 @@ bool32 ShouldTryOHKO(u32 battlerAtk, u32 battlerDef, u32 atkAbility, u32 defAbil
|
||||
else // test the odds
|
||||
{
|
||||
u32 odds = accuracy + (gBattleMons[battlerAtk].level - gBattleMons[battlerDef].level);
|
||||
#if B_SHEER_COLD_ACC >= GEN_7
|
||||
if (move == MOVE_SHEER_COLD && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE))
|
||||
if (B_SHEER_COLD_ACC >= GEN_7 && move == MOVE_SHEER_COLD && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ICE))
|
||||
odds -= 10;
|
||||
#endif
|
||||
if (Random() % 100 + 1 < odds && gBattleMons[battlerAtk].level >= gBattleMons[battlerDef].level)
|
||||
return TRUE;
|
||||
}
|
||||
@ -1849,42 +1790,40 @@ bool32 ShouldSetSnow(u32 battler, u32 ability, u32 holdEffect)
|
||||
void ProtectChecks(u32 battlerAtk, u32 battlerDef, u32 move, u32 predictedMove, s32 *score)
|
||||
{
|
||||
// TODO more sophisticated logic
|
||||
u32 predictedEffect = gBattleMoves[predictedMove].effect;
|
||||
u32 defAbility = AI_DATA->abilities[battlerDef];
|
||||
u32 uses = gDisableStructs[battlerAtk].protectUses;
|
||||
|
||||
/*if (GetMoveResultFlags(predictedMove) & (MOVE_RESULT_NO_EFFECT | MOVE_RESULT_MISSED))
|
||||
{
|
||||
(*score) -= 5;
|
||||
ADJUST_SCORE_PTR(-5);
|
||||
return;
|
||||
}*/
|
||||
|
||||
if (uses == 0)
|
||||
{
|
||||
if (predictedMove != MOVE_NONE && predictedMove != 0xFFFF && !IS_MOVE_STATUS(predictedMove))
|
||||
(*score) += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else if (Random() % 256 < 100)
|
||||
(*score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (IsDoubleBattle())
|
||||
(*score) -= 2 * min(uses, 3);
|
||||
ADJUST_SCORE_PTR(-(2 * min(uses, 3)));
|
||||
else
|
||||
(*score) -= min(uses, 3);
|
||||
ADJUST_SCORE_PTR(-(min(uses, 3)));
|
||||
}
|
||||
|
||||
if (gBattleMons[battlerAtk].status1 & (STATUS1_PSN_ANY | STATUS1_BURN | STATUS1_FROSTBITE)
|
||||
|| gBattleMons[battlerAtk].status2 & (STATUS2_CURSED | STATUS2_INFATUATION)
|
||||
|| gStatuses3[battlerAtk] & (STATUS3_PERISH_SONG | STATUS3_LEECHSEED | STATUS3_YAWN))
|
||||
{
|
||||
(*score)--;
|
||||
ADJUST_SCORE_PTR(-1);
|
||||
}
|
||||
|
||||
if (gBattleMons[battlerDef].status1 & STATUS1_TOXIC_POISON
|
||||
|| gBattleMons[battlerDef].status2 & (STATUS2_CURSED | STATUS2_INFATUATION)
|
||||
|| gStatuses3[battlerDef] & (STATUS3_PERISH_SONG | STATUS3_LEECHSEED | STATUS3_YAWN))
|
||||
(*score) += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
}
|
||||
|
||||
// stat stages
|
||||
@ -2340,9 +2279,6 @@ bool32 IsStatRaisingEffect(u32 effect)
|
||||
case EFFECT_EVASION_UP_2:
|
||||
case EFFECT_MINIMIZE:
|
||||
case EFFECT_DEFENSE_CURL:
|
||||
#if B_CHARGE_SPDEF_RAISE >= GEN_5
|
||||
case EFFECT_CHARGE:
|
||||
#endif
|
||||
case EFFECT_CALM_MIND:
|
||||
case EFFECT_COSMIC_POWER:
|
||||
case EFFECT_DRAGON_DANCE:
|
||||
@ -2359,6 +2295,8 @@ bool32 IsStatRaisingEffect(u32 effect)
|
||||
case EFFECT_STOCKPILE:
|
||||
case EFFECT_VICTORY_DANCE:
|
||||
return TRUE;
|
||||
case EFFECT_CHARGE:
|
||||
return B_CHARGE_SPDEF_RAISE >= GEN_5;
|
||||
default:
|
||||
return FALSE;
|
||||
}
|
||||
@ -2453,28 +2391,6 @@ bool32 IsEncoreEncouragedEffect(u32 moveEffect)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 MoveRequiresRecharging(u32 move)
|
||||
{
|
||||
u32 i;
|
||||
for (i = 0; i < ARRAY_COUNT(sRechargeMoves); i++)
|
||||
{
|
||||
if (move == sRechargeMoves[i])
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 MoveCallsOtherMove(u32 move)
|
||||
{
|
||||
u32 i;
|
||||
for (i = 0; i < ARRAY_COUNT(sOtherMoveCallingMoves); i++)
|
||||
{
|
||||
if (move == sOtherMoveCallingMoves[i])
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static u32 GetLeechSeedDamage(u32 battlerId)
|
||||
{
|
||||
u32 damage = 0;
|
||||
@ -2520,15 +2436,10 @@ static u32 GetTrapDamage(u32 battlerId)
|
||||
if (gBattleMons[battlerId].status2 & STATUS2_WRAPPED)
|
||||
{
|
||||
if (holdEffect == HOLD_EFFECT_BINDING_BAND)
|
||||
#if B_BINDING_DAMAGE >= GEN_6
|
||||
damage = gBattleMons[battlerId].maxHP / 6;
|
||||
damage = gBattleMons[battlerId].maxHP / (B_BINDING_DAMAGE >= GEN_6 ? 6 : 8);
|
||||
else
|
||||
damage = gBattleMons[battlerId].maxHP / 8;
|
||||
#else
|
||||
damage = gBattleMons[battlerId].maxHP / 8;
|
||||
else
|
||||
damage = gBattleMons[battlerId].maxHP / 16;
|
||||
#endif
|
||||
damage = gBattleMons[battlerId].maxHP / (B_BINDING_DAMAGE >= GEN_6 ? 8 : 16);
|
||||
|
||||
if (damage == 0)
|
||||
damage = 1;
|
||||
}
|
||||
@ -2768,9 +2679,7 @@ bool32 ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u32
|
||||
|
||||
if (!IS_MOVE_STATUS(move) && (shouldSwitch
|
||||
|| (AtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH
|
||||
#if B_STURDY >= GEN_5
|
||||
|| defAbility == ABILITY_STURDY
|
||||
#endif
|
||||
|| (B_STURDY >= GEN_5 && defAbility == ABILITY_STURDY)
|
||||
|| defAbility == ABILITY_MULTISCALE
|
||||
|| defAbility == ABILITY_SHADOW_SHIELD))))
|
||||
return PIVOT; // pivot to break sash/sturdy/multiscale
|
||||
@ -2778,9 +2687,7 @@ bool32 ShouldPivot(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u32
|
||||
else if (!hasStatBoost)
|
||||
{
|
||||
if (!IS_MOVE_STATUS(move) && (AtMaxHp(battlerDef) && (AI_DATA->holdEffects[battlerDef] == HOLD_EFFECT_FOCUS_SASH
|
||||
#if B_STURDY >= GEN_5
|
||||
|| (defAbility == ABILITY_STURDY)
|
||||
#endif
|
||||
|| (B_STURDY >= GEN_5 && defAbility == ABILITY_STURDY)
|
||||
|| defAbility == ABILITY_MULTISCALE
|
||||
|| defAbility == ABILITY_SHADOW_SHIELD)))
|
||||
return PIVOT; // pivot to break sash/sturdy/multiscale
|
||||
@ -2921,9 +2828,7 @@ bool32 CanKnockOffItem(u32 battler, u32 item)
|
||||
| BATTLE_TYPE_LINK
|
||||
| BATTLE_TYPE_RECORDED_LINK
|
||||
| BATTLE_TYPE_SECRET_BASE
|
||||
#if B_TRAINERS_KNOCK_OFF_ITEMS == TRUE
|
||||
| BATTLE_TYPE_TRAINER
|
||||
#endif
|
||||
| (B_TRAINERS_KNOCK_OFF_ITEMS == TRUE ? BATTLE_TYPE_TRAINER : 0)
|
||||
)) && GetBattlerSide(battler) == B_SIDE_PLAYER)
|
||||
return FALSE;
|
||||
|
||||
@ -3474,7 +3379,7 @@ bool32 PartnerMoveIsSameNoTarget(u32 battlerAtkPartner, u32 move, u32 partnerMov
|
||||
bool32 ShouldUseWishAromatherapy(u32 battlerAtk, u32 battlerDef, u32 move)
|
||||
{
|
||||
u32 i;
|
||||
u32 firstId, lastId;
|
||||
s32 firstId, lastId;
|
||||
struct Pokemon* party;
|
||||
bool32 hasStatus = FALSE;
|
||||
bool32 needHealing = FALSE;
|
||||
@ -3557,7 +3462,7 @@ void FreeRestoreBattleMons(struct BattlePokemon *savedBattleMons)
|
||||
// party logic
|
||||
s32 AI_CalcPartyMonBestMoveDamage(u32 battlerAtk, u32 battlerDef, struct Pokemon *attackerMon, struct Pokemon *targetMon)
|
||||
{
|
||||
s32 i, move, bestDmg, dmg;
|
||||
s32 i, move, bestDmg, dmg = 0;
|
||||
u8 effectiveness;
|
||||
struct BattlePokemon *savedBattleMons = AllocSaveBattleMons();
|
||||
|
||||
@ -3645,7 +3550,6 @@ bool32 IsPartyFullyHealedExceptBattler(u32 battlerId)
|
||||
|
||||
bool32 PartyHasMoveSplit(u32 battlerId, u32 split)
|
||||
{
|
||||
u32 firstId, lastId;
|
||||
struct Pokemon *party = GetBattlerParty(battlerId);
|
||||
u32 i, j;
|
||||
|
||||
@ -3781,39 +3685,39 @@ void IncreaseStatUpScore(u32 battlerAtk, u32 battlerDef, u32 statId, s32 *score)
|
||||
if (HasMoveWithSplit(battlerAtk, SPLIT_PHYSICAL) && AI_DATA->hpPercents[battlerAtk] > 40)
|
||||
{
|
||||
if (gBattleMons[battlerAtk].statStages[STAT_ATK] < STAT_UP_2_STAGE)
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else if (gBattleMons[battlerAtk].statStages[STAT_ATK] < STAT_UP_STAGE)
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
if (HasMoveEffect(battlerAtk, EFFECT_FOUL_PLAY))
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
break;
|
||||
case STAT_DEF:
|
||||
if ((HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL)|| IS_MOVE_PHYSICAL(gLastMoves[battlerDef]))
|
||||
&& AI_DATA->hpPercents[battlerAtk] > 70)
|
||||
{
|
||||
if (gBattleMons[battlerAtk].statStages[STAT_DEF] < STAT_UP_2_STAGE)
|
||||
*score += 2; // seems better to raise def at higher HP
|
||||
ADJUST_SCORE_PTR(2); // seems better to raise def at higher HP
|
||||
else if (gBattleMons[battlerAtk].statStages[STAT_DEF] < STAT_UP_STAGE)
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
break;
|
||||
case STAT_SPEED:
|
||||
if (!AI_STRIKES_FIRST(battlerAtk, battlerDef, AI_THINKING_STRUCT->moveConsidered))
|
||||
{
|
||||
if (gBattleMons[battlerAtk].statStages[STAT_SPEED] < STAT_UP_2_STAGE)
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else if (gBattleMons[battlerAtk].statStages[STAT_SPEED] < STAT_UP_STAGE)
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
break;
|
||||
case STAT_SPATK:
|
||||
if (HasMoveWithSplit(battlerAtk, SPLIT_SPECIAL) && AI_DATA->hpPercents[battlerAtk] > 40)
|
||||
{
|
||||
if (gBattleMons[battlerAtk].statStages[STAT_SPATK] < STAT_UP_2_STAGE)
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else if (gBattleMons[battlerAtk].statStages[STAT_SPATK] < STAT_UP_STAGE)
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
break;
|
||||
case STAT_SPDEF:
|
||||
@ -3821,24 +3725,24 @@ void IncreaseStatUpScore(u32 battlerAtk, u32 battlerDef, u32 statId, s32 *score)
|
||||
&& AI_DATA->hpPercents[battlerAtk] > 70)
|
||||
{
|
||||
if (gBattleMons[battlerAtk].statStages[STAT_SPDEF] < STAT_UP_2_STAGE)
|
||||
*score += 2; // seems better to raise spdef at higher HP
|
||||
ADJUST_SCORE_PTR(2); // seems better to raise spdef at higher HP
|
||||
else if (gBattleMons[battlerAtk].statStages[STAT_SPDEF] < STAT_UP_STAGE)
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
break;
|
||||
case STAT_ACC:
|
||||
if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 80, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef]))
|
||||
*score += 2; // has moves with less than 80% accuracy
|
||||
ADJUST_SCORE_PTR(2); // has moves with less than 80% accuracy
|
||||
else if (HasMoveWithLowAccuracy(battlerAtk, battlerDef, 90, TRUE, AI_DATA->abilities[battlerAtk], AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerAtk], AI_DATA->holdEffects[battlerDef]))
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
break;
|
||||
case STAT_EVASION:
|
||||
if (!BattlerWillFaintFromWeather(battlerAtk, AI_DATA->abilities[battlerAtk]))
|
||||
{
|
||||
if (!GetBattlerSecondaryDamage(battlerAtk) && !(gStatuses3[battlerAtk] & STATUS3_ROOTED))
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -3853,18 +3757,18 @@ void IncreasePoisonScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score)
|
||||
if (AI_CanPoison(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove) && AI_DATA->hpPercents[battlerDef] > 20)
|
||||
{
|
||||
if (!HasDamagingMove(battlerDef))
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
|
||||
if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_STALL && HasMoveEffect(battlerAtk, EFFECT_PROTECT))
|
||||
(*score)++; // stall tactic
|
||||
ADJUST_SCORE_PTR(1); // stall tactic
|
||||
|
||||
if (HasMoveEffect(battlerAtk, EFFECT_VENOSHOCK)
|
||||
|| HasMoveEffect(battlerAtk, EFFECT_HEX)
|
||||
|| HasMoveEffect(battlerAtk, EFFECT_VENOM_DRENCH)
|
||||
|| AI_DATA->abilities[battlerAtk] == ABILITY_MERCILESS)
|
||||
*(score) += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else
|
||||
*(score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3876,15 +3780,15 @@ void IncreaseBurnScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score)
|
||||
|
||||
if (AI_CanBurn(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove))
|
||||
{
|
||||
(*score)++; // burning is good
|
||||
ADJUST_SCORE_PTR(1); // burning is good
|
||||
if (HasMoveWithSplit(battlerDef, SPLIT_PHYSICAL))
|
||||
{
|
||||
if (CanTargetFaintAi(battlerDef, battlerAtk))
|
||||
*score += 2; // burning the target to stay alive is cool
|
||||
ADJUST_SCORE_PTR(2); // burning the target to stay alive is cool
|
||||
}
|
||||
|
||||
if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_HEX))
|
||||
(*score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3904,9 +3808,9 @@ void IncreaseParalyzeScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score)
|
||||
|| HasMoveEffect(battlerAtk, EFFECT_FLINCH_HIT)
|
||||
|| gBattleMons[battlerDef].status2 & STATUS2_INFATUATION
|
||||
|| gBattleMons[battlerDef].status2 & STATUS2_CONFUSION)
|
||||
*score += 4;
|
||||
ADJUST_SCORE_PTR(4);
|
||||
else
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3917,16 +3821,16 @@ void IncreaseSleepScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score)
|
||||
return;
|
||||
|
||||
if (AI_CanPutToSleep(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], move, AI_DATA->partnerMove))
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
else
|
||||
return;
|
||||
|
||||
if ((HasMoveEffect(battlerAtk, EFFECT_DREAM_EATER) || HasMoveEffect(battlerAtk, EFFECT_NIGHTMARE))
|
||||
&& !(HasMoveEffect(battlerDef, EFFECT_SNORE) || HasMoveEffect(battlerDef, EFFECT_SLEEP_TALK)))
|
||||
(*score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
|
||||
if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_HEX))
|
||||
(*score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
|
||||
void IncreaseConfusionScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score)
|
||||
@ -3942,9 +3846,9 @@ void IncreaseConfusionScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score
|
||||
if (gBattleMons[battlerDef].status1 & STATUS1_PARALYSIS
|
||||
|| gBattleMons[battlerDef].status2 & STATUS2_INFATUATION
|
||||
|| (AI_DATA->abilities[battlerAtk] == ABILITY_SERENE_GRACE && HasMoveEffect(battlerAtk, EFFECT_FLINCH_HIT)))
|
||||
*score += 3;
|
||||
ADJUST_SCORE_PTR(3);
|
||||
else
|
||||
*score += 2;
|
||||
ADJUST_SCORE_PTR(2);
|
||||
}
|
||||
}
|
||||
|
||||
@ -3955,15 +3859,15 @@ void IncreaseFrostbiteScore(u32 battlerAtk, u32 battlerDef, u32 move, s32 *score
|
||||
|
||||
if (AI_CanGiveFrostbite(battlerAtk, battlerDef, AI_DATA->abilities[battlerDef], BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove))
|
||||
{
|
||||
(*score)++; // frostbite is good
|
||||
ADJUST_SCORE_PTR(1); // frostbite is good
|
||||
if (HasMoveWithSplit(battlerDef, SPLIT_SPECIAL))
|
||||
{
|
||||
if (CanTargetFaintAi(battlerDef, battlerAtk))
|
||||
*score += 2; // frostbiting the target to stay alive is cool
|
||||
ADJUST_SCORE_PTR(2); // frostbiting the target to stay alive is cool
|
||||
}
|
||||
|
||||
if (HasMoveEffect(battlerAtk, EFFECT_HEX) || HasMoveEffect(BATTLE_PARTNER(battlerAtk), EFFECT_HEX))
|
||||
(*score)++;
|
||||
ADJUST_SCORE_PTR(1);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -248,6 +248,7 @@ void LaunchBattleAnimation(u32 animType, u32 animId)
|
||||
switch (animType)
|
||||
{
|
||||
case ANIM_TYPE_GENERAL:
|
||||
default:
|
||||
animsTable = gBattleAnims_General;
|
||||
break;
|
||||
case ANIM_TYPE_MOVE:
|
||||
@ -1468,10 +1469,8 @@ static void LoadDefaultBg(void)
|
||||
{
|
||||
if (IsContest())
|
||||
LoadContestBgAfterMoveAnim();
|
||||
#if B_TERRAIN_BG_CHANGE == TRUE
|
||||
else if (gFieldStatuses & STATUS_FIELD_TERRAIN_ANY)
|
||||
else if (B_TERRAIN_BG_CHANGE == TRUE && gFieldStatuses & STATUS_FIELD_TERRAIN_ANY)
|
||||
DrawTerrainTypeBattleBackground();
|
||||
#endif
|
||||
else
|
||||
DrawMainBattleBackground();
|
||||
}
|
||||
|
||||
2
src/battle_anim_effects_3.c
Executable file → Normal file
2
src/battle_anim_effects_3.c
Executable file → Normal file
@ -721,8 +721,6 @@ const struct SpriteTemplate gSweetScentPetalSpriteTemplate =
|
||||
.callback = AnimSweetScentPetal,
|
||||
};
|
||||
|
||||
static const u16 sUnusedPalette[] = INCBIN_U16("graphics/battle_anims/unused/unknown.gbapal");
|
||||
|
||||
const union AnimCmd gPainSplitAnimCmds[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 5),
|
||||
|
||||
@ -1447,7 +1447,6 @@ static void AnimPoltergeistItem(struct Sprite *sprite)
|
||||
void AnimTask_PulverizingPancakeWhiteShadow(u8 taskId)
|
||||
{
|
||||
struct Task *task;
|
||||
s16 battler;
|
||||
u8 spriteId;
|
||||
s16 baseX, baseY;
|
||||
s16 x, y;
|
||||
|
||||
@ -750,7 +750,7 @@ static void SetBattlersXOffsetForShake(struct Task *task)
|
||||
|
||||
void AnimTask_IsPowerOver99(u8 taskId)
|
||||
{
|
||||
gBattleAnimArgs[15] = gAnimMovePower > 99;
|
||||
gBattleAnimArgs[ARG_RET_ID] = gAnimMovePower > 99;
|
||||
DestroyAnimVisualTask(taskId);
|
||||
}
|
||||
|
||||
|
||||
@ -81,8 +81,6 @@ static void SpriteCB_HorizontalSliceStep(struct Sprite *sprite);
|
||||
static void SpriteCB_HorizontalSlice(struct Sprite *sprite);
|
||||
static void SpriteCB_LashOutStrike(struct Sprite* sprite);
|
||||
static void AnimTask_TwinkleTackleLaunchStep(u8 taskId);
|
||||
static void SpriteCB_ShellSmashShell(struct Sprite* sprite);
|
||||
static void SpriteCB_ShellSmashShell_DestroyDuringFadeOut(struct Sprite* sprite);
|
||||
static void SpriteCB_AnimSpriteOnTargetSideCentre(struct Sprite *sprite);
|
||||
static void SpriteCB_SpriteOnMonUntilAffineAnimEnds(struct Sprite* sprite);
|
||||
static void SpriteCB_MoveSpriteUpwardsForDurationStep(struct Sprite* sprite);
|
||||
@ -8727,6 +8725,7 @@ static void SpriteCB_LashOutStrike(struct Sprite* sprite)
|
||||
sprite->callback = AnimKnockOffStrike_Step;
|
||||
}
|
||||
|
||||
/* TODO - Use the ShellSmash Anim
|
||||
//Moves the shells towards the attacker and leaves them there until they fade out
|
||||
//arg 0: Initial x-pos
|
||||
//arg 1: Final x-pos
|
||||
@ -8754,6 +8753,7 @@ static void SpriteCB_ShellSmashShell_DestroyDuringFadeOut(struct Sprite* sprite)
|
||||
if (GetGpuReg(REG_OFFSET_BLDALPHA) >= BLDALPHA_BLEND(0, 8)) //Fade out 1/2 done
|
||||
DestroyAnimSprite(sprite);
|
||||
}
|
||||
*/
|
||||
|
||||
static void SpriteCB_AnimSpriteOnTargetSideCentre(struct Sprite *sprite)
|
||||
{
|
||||
|
||||
@ -351,8 +351,7 @@ const struct SpriteTemplate gSeedFlareGreenWavesTemplate =
|
||||
|
||||
static void AnimStealthRock(struct Sprite *sprite)
|
||||
{
|
||||
u16 x;
|
||||
u16 y;
|
||||
s16 x, y;
|
||||
|
||||
InitSpritePosToAnimAttacker(sprite, TRUE);
|
||||
SetAverageBattlerPositions(gBattleAnimTarget, FALSE, &x, &y);
|
||||
|
||||
@ -57,9 +57,6 @@ static void AnimAquaTail(struct Sprite *sprite);
|
||||
static void AnimKnockOffAquaTail(struct Sprite *sprite);
|
||||
static void AnimKnockOffAquaTailStep(struct Sprite *sprite);
|
||||
|
||||
static const u8 sUnusedWater_Gfx[] = INCBIN_U8("graphics/battle_anims/unused/water_gfx.4bpp");
|
||||
static const u8 sUnusedWater[] = INCBIN_U8("graphics/battle_anims/unused/water.bin");
|
||||
|
||||
static const union AnimCmd sAnim_RainDrop[] =
|
||||
{
|
||||
ANIMCMD_FRAME(0, 2),
|
||||
|
||||
@ -856,11 +856,10 @@ void LoadBattleTextboxAndBackground(void)
|
||||
CopyBgTilemapBufferToVram(0);
|
||||
LoadCompressedPalette(gBattleTextboxPalette, BG_PLTT_ID(0), 2 * PLTT_SIZE_4BPP);
|
||||
LoadBattleMenuWindowGfx();
|
||||
#if B_TERRAIN_BG_CHANGE == TRUE
|
||||
DrawTerrainTypeBattleBackground();
|
||||
#else
|
||||
DrawMainBattleBackground();
|
||||
#endif
|
||||
if (B_TERRAIN_BG_CHANGE == TRUE)
|
||||
DrawTerrainTypeBattleBackground();
|
||||
else
|
||||
DrawMainBattleBackground();
|
||||
}
|
||||
|
||||
static void DrawLinkBattleParticipantPokeballs(u8 taskId, u8 multiplayerId, u8 bgId, u8 destX, u8 destY)
|
||||
|
||||
@ -590,9 +590,8 @@ static void OpponentHandleChooseMove(u32 battler)
|
||||
target = GetBattlerAtPosition(Random() & 2);
|
||||
} while (!CanTargetBattler(battler, target, move));
|
||||
|
||||
#if B_WILD_NATURAL_ENEMIES == TRUE
|
||||
// Don't bother to loop through table if the move can't attack ally
|
||||
if (!(gBattleMoves[move].target & MOVE_TARGET_BOTH))
|
||||
if (B_WILD_NATURAL_ENEMIES == TRUE && !(gBattleMoves[move].target & MOVE_TARGET_BOTH))
|
||||
{
|
||||
u16 i, speciesAttacker, speciesTarget, isPartnerEnemy = FALSE;
|
||||
static const u16 naturalEnemies[][2] =
|
||||
@ -622,8 +621,9 @@ static void OpponentHandleChooseMove(u32 battler)
|
||||
BtlController_EmitTwoReturnValues(battler, BUFFER_B, 10, (chosenMoveId) | (target << 8));
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
BtlController_EmitTwoReturnValues(battler, BUFFER_B, 10, (chosenMoveId) | (target << 8));
|
||||
}
|
||||
}
|
||||
else
|
||||
BtlController_EmitTwoReturnValues(battler, BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) << 8));
|
||||
|
||||
@ -202,7 +202,7 @@ static void CompleteOnBattlerSpritePosX_0(u32 battler)
|
||||
static u16 GetPrevBall(u16 ballId)
|
||||
{
|
||||
u16 ballPrev;
|
||||
u32 i, j;
|
||||
s32 i, j;
|
||||
CompactItemsInBagPocket(&gBagPockets[BALLS_POCKET]);
|
||||
for (i = 0; i < gBagPockets[BALLS_POCKET].capacity; i++)
|
||||
{
|
||||
@ -218,28 +218,29 @@ static u16 GetPrevBall(u16 ballId)
|
||||
}
|
||||
}
|
||||
i--;
|
||||
return gBagPockets[BALLS_POCKET].itemSlots[i].itemId;
|
||||
break;
|
||||
}
|
||||
}
|
||||
return gBagPockets[BALLS_POCKET].itemSlots[i].itemId;
|
||||
}
|
||||
|
||||
static u16 GetNextBall(u16 ballId)
|
||||
{
|
||||
u16 ballNext;
|
||||
u32 i;
|
||||
u16 ballNext = 0;
|
||||
s32 i;
|
||||
CompactItemsInBagPocket(&gBagPockets[BALLS_POCKET]);
|
||||
for (i = 0; i < gBagPockets[BALLS_POCKET].capacity; i++)
|
||||
{
|
||||
if (ballId == gBagPockets[BALLS_POCKET].itemSlots[i].itemId)
|
||||
{
|
||||
i++;
|
||||
ballNext = gBagPockets[BALLS_POCKET].itemSlots[i].itemId;
|
||||
if (ballNext == ITEM_NONE)
|
||||
return gBagPockets[BALLS_POCKET].itemSlots[0].itemId; // Zeroth slot
|
||||
else
|
||||
return ballNext;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (ballNext == ITEM_NONE)
|
||||
return gBagPockets[BALLS_POCKET].itemSlots[0].itemId; // Zeroth slot
|
||||
else
|
||||
return ballNext;
|
||||
}
|
||||
|
||||
static void HandleInputChooseAction(u32 battler)
|
||||
@ -716,25 +717,26 @@ static void HandleInputChooseMove(u32 battler)
|
||||
canSelectTarget = 0;
|
||||
}
|
||||
|
||||
#if B_SHOW_TARGETS == TRUE
|
||||
// Show all available targets for multi-target moves
|
||||
if ((moveTarget & MOVE_TARGET_ALL_BATTLERS) == MOVE_TARGET_ALL_BATTLERS)
|
||||
if (B_SHOW_TARGETS == TRUE)
|
||||
{
|
||||
u32 i = 0;
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
TryShowAsTarget(i);
|
||||
// Show all available targets for multi-target moves
|
||||
if ((moveTarget & MOVE_TARGET_ALL_BATTLERS) == MOVE_TARGET_ALL_BATTLERS)
|
||||
{
|
||||
u32 i = 0;
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
TryShowAsTarget(i);
|
||||
|
||||
canSelectTarget = 3;
|
||||
canSelectTarget = 3;
|
||||
}
|
||||
else if (moveTarget & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))
|
||||
{
|
||||
TryShowAsTarget(gMultiUsePlayerCursor);
|
||||
TryShowAsTarget(BATTLE_PARTNER(gMultiUsePlayerCursor));
|
||||
if (moveTarget & MOVE_TARGET_FOES_AND_ALLY)
|
||||
TryShowAsTarget(BATTLE_PARTNER(battler));
|
||||
canSelectTarget = 2;
|
||||
}
|
||||
}
|
||||
else if (moveTarget & (MOVE_TARGET_OPPONENTS_FIELD | MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY))
|
||||
{
|
||||
TryShowAsTarget(gMultiUsePlayerCursor);
|
||||
TryShowAsTarget(BATTLE_PARTNER(gMultiUsePlayerCursor));
|
||||
if (moveTarget & MOVE_TARGET_FOES_AND_ALLY)
|
||||
TryShowAsTarget(BATTLE_PARTNER(battler));
|
||||
canSelectTarget = 2;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
switch (canSelectTarget)
|
||||
@ -1788,7 +1790,7 @@ static void PlayerHandleDrawTrainerPic(u32 battler)
|
||||
{
|
||||
bool32 isFrontPic;
|
||||
s16 xPos, yPos;
|
||||
u32 trainerPicId, gender;
|
||||
u32 trainerPicId;
|
||||
|
||||
trainerPicId = PlayerGetTrainerBackPicId();
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_MULTI)
|
||||
|
||||
@ -841,7 +841,7 @@ static const u8 *const sAiInfoItemNames[] =
|
||||
|
||||
static void PutAiInfoText(struct BattleDebugMenu *data)
|
||||
{
|
||||
u32 i, j, count;
|
||||
u32 i;
|
||||
u8 *text = Alloc(0x50);
|
||||
|
||||
FillWindowPixelBuffer(data->aiMovesWindowId, 0x11);
|
||||
|
||||
@ -2796,7 +2796,6 @@ static int SelectOpponentMonsFromParty(int *partyMovePoints, bool8 allowRandom)
|
||||
static int GetTypeEffectivenessPoints(int move, int targetSpecies, int mode)
|
||||
{
|
||||
int defType1, defType2, defAbility, moveType;
|
||||
int i = 0;
|
||||
int typePower = TYPE_x1;
|
||||
|
||||
if (move == MOVE_NONE || move == MOVE_UNAVAILABLE || IS_MOVE_STATUS(move))
|
||||
|
||||
@ -591,13 +591,16 @@ void BattleLoadMonSpriteGfx(struct Pokemon *mon, u32 battler)
|
||||
else
|
||||
{
|
||||
species = gBattleSpritesDataPtr->battlerData[battler].transformSpecies;
|
||||
#if B_TRANSFORM_SHINY >= GEN_4
|
||||
if (B_TRANSFORM_SHINY >= GEN_4)
|
||||
{
|
||||
currentPersonality = gTransformedPersonalities[battler];
|
||||
currentOtId = gTransformedOtIds[battler];
|
||||
#else
|
||||
}
|
||||
else
|
||||
{
|
||||
currentPersonality = monsPersonality;
|
||||
currentOtId = otId;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
position = GetBattlerPosition(battler);
|
||||
@ -886,14 +889,12 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool32 megaEvo, bo
|
||||
|
||||
if (GetBattlerSide(battlerAtk) == B_SIDE_PLAYER)
|
||||
{
|
||||
#if B_TRANSFORM_SHINY >= GEN_4
|
||||
if (trackEnemyPersonality)
|
||||
if (B_TRANSFORM_SHINY >= GEN_4 && trackEnemyPersonality)
|
||||
{
|
||||
personalityValue = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
||||
otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
personalityValue = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
||||
otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
|
||||
@ -907,15 +908,13 @@ void HandleSpeciesGfxDataChange(u8 battlerAtk, u8 battlerDef, bool32 megaEvo, bo
|
||||
}
|
||||
else
|
||||
{
|
||||
#if B_TRANSFORM_SHINY >= GEN_4
|
||||
if (trackEnemyPersonality)
|
||||
if (B_TRANSFORM_SHINY >= GEN_4 && trackEnemyPersonality)
|
||||
{
|
||||
personalityValue = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
||||
otId = GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
|
||||
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
personalityValue = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_PERSONALITY);
|
||||
otId = GetMonData(&gEnemyParty[gBattlerPartyIndexes[battlerAtk]], MON_DATA_OT_ID);
|
||||
|
||||
@ -754,12 +754,6 @@ static const struct SpriteTemplate sSpriteTemplate_BurstTrigger =
|
||||
#define hBar_HealthBoxSpriteId data[5]
|
||||
#define hBar_Data6 data[6]
|
||||
|
||||
static void InitLastUsedBallAssets(void)
|
||||
{
|
||||
gBattleStruct->ballSpriteIds[0] = MAX_SPRITES;
|
||||
gBattleStruct->ballSpriteIds[1] = MAX_SPRITES;
|
||||
}
|
||||
|
||||
// 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
|
||||
@ -780,7 +774,7 @@ u8 CreateBattlerHealthboxSprites(u8 battlerId)
|
||||
{
|
||||
s16 data6 = 0;
|
||||
u8 healthboxLeftSpriteId, healthboxRightSpriteId;
|
||||
u8 healthbarSpriteId, megaIndicatorSpriteId;
|
||||
u8 healthbarSpriteId;
|
||||
struct Sprite *healthBarSpritePtr;
|
||||
|
||||
if (WhichBattleCoords(battlerId) == 0) // Singles
|
||||
@ -995,10 +989,8 @@ void UpdateOamPriorityInAllHealthboxes(u8 priority, bool32 hideHPBoxes)
|
||||
|
||||
MegaIndicator_UpdateOamPriority(healthboxLeftSpriteId, priority);
|
||||
|
||||
#if B_HIDE_HEALTHBOX_IN_ANIMS
|
||||
if (hideHPBoxes && IsBattlerAlive(i))
|
||||
if (B_HIDE_HEALTHBOX_IN_ANIMS == TRUE && hideHPBoxes && IsBattlerAlive(i))
|
||||
TryToggleHealboxVisibility(priority, healthboxLeftSpriteId, healthboxRightSpriteId, healthbarSpriteId);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -1090,7 +1082,7 @@ static void UpdateLvlInHealthbox(u8 healthboxSpriteId, u8 lvl)
|
||||
static void PrintHpOnHealthbox(u32 spriteId, s16 currHp, s16 maxHp, u32 bgColor, u32 rightTile, u32 leftTile)
|
||||
{
|
||||
u8 *windowTileData;
|
||||
u32 windowId, tilesCount, x, healthboxTileNum;
|
||||
u32 windowId, tilesCount, x;
|
||||
u8 text[28], *txtPtr;
|
||||
void *objVram = (void *)(OBJ_VRAM0) + gSprites[spriteId].oam.tileNum * TILE_SIZE_4BPP;
|
||||
|
||||
@ -1692,7 +1684,6 @@ void MegaIndicator_LoadSpritesGfx(void)
|
||||
|
||||
static bool32 MegaIndicator_ShouldBeInvisible(u32 battlerId, struct Sprite *sprite)
|
||||
{
|
||||
u32 side = GetBattlerSide(battlerId);
|
||||
bool32 megaEvolved = IsBattlerMegaEvolved(battlerId);
|
||||
bool32 primalReverted = IsBattlerPrimalReverted(battlerId);
|
||||
|
||||
@ -1739,7 +1730,6 @@ static void MegaIndicator_UpdateOamPriority(u32 healthboxId, u32 oamPriority)
|
||||
|
||||
static void MegaIndicator_UpdateLevel(u32 healthboxId, u32 level)
|
||||
{
|
||||
u32 i;
|
||||
s16 xDelta = 0;
|
||||
u8 *spriteId = MegaIndicator_GetSpriteId(healthboxId);
|
||||
|
||||
@ -1754,7 +1744,7 @@ static void MegaIndicator_UpdateLevel(u32 healthboxId, u32 level)
|
||||
static void MegaIndicator_CreateSprite(u32 battlerId, u32 healthboxSpriteId)
|
||||
{
|
||||
struct SpriteTemplate sprTemplate;
|
||||
u32 position, level;
|
||||
u32 position;
|
||||
u8 *spriteId;
|
||||
s16 xHealthbox = 0, y = 0;
|
||||
s32 x = 0;
|
||||
@ -2614,15 +2604,12 @@ s32 MoveBattleBar(u8 battlerId, u8 healthboxSpriteId, u8 whichBar, u8 unused)
|
||||
|
||||
if (whichBar == HEALTH_BAR) // health bar
|
||||
{
|
||||
u16 hpFraction = B_FAST_HP_DRAIN == FALSE ? 1 : max(gBattleSpritesDataPtr->battleBars[battlerId].maxValue / B_HEALTHBAR_PIXELS, 1);
|
||||
currentBarValue = CalcNewBarValue(gBattleSpritesDataPtr->battleBars[battlerId].maxValue,
|
||||
gBattleSpritesDataPtr->battleBars[battlerId].oldValue,
|
||||
gBattleSpritesDataPtr->battleBars[battlerId].receivedValue,
|
||||
&gBattleSpritesDataPtr->battleBars[battlerId].currValue,
|
||||
#if B_FAST_HP_DRAIN == TRUE
|
||||
B_HEALTHBAR_PIXELS / 8, max(gBattleSpritesDataPtr->battleBars[battlerId].maxValue / B_HEALTHBAR_PIXELS, 1));
|
||||
#else
|
||||
B_HEALTHBAR_PIXELS / 8, 1);
|
||||
#endif
|
||||
B_HEALTHBAR_PIXELS / 8, hpFraction);
|
||||
}
|
||||
else // exp bar
|
||||
{
|
||||
@ -3239,10 +3226,12 @@ static void RestoreOverwrittenPixels(u8 *tiles)
|
||||
|
||||
void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle)
|
||||
{
|
||||
#if B_ABILITY_POP_UP == TRUE
|
||||
const s16 (*coords)[2];
|
||||
u8 spriteId1, spriteId2, battlerPosition, taskId;
|
||||
|
||||
if (B_ABILITY_POP_UP == FALSE)
|
||||
return;
|
||||
|
||||
if (gTestRunnerEnabled)
|
||||
{
|
||||
TestRunner_Battle_RecordAbilityPopUp(battlerId, ability);
|
||||
@ -3312,7 +3301,6 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle)
|
||||
PrintBattlerOnAbilityPopUp(battlerId, spriteId1, spriteId2);
|
||||
PrintAbilityOnAbilityPopUp(ability, spriteId1, spriteId2);
|
||||
RestoreOverwrittenPixels((void*)(OBJ_VRAM0) + (gSprites[spriteId1].oam.tileNum * 32));
|
||||
#endif
|
||||
}
|
||||
|
||||
void UpdateAbilityPopup(u8 battlerId)
|
||||
@ -3395,18 +3383,10 @@ static const struct OamData sOamData_LastUsedBall =
|
||||
.objMode = 0,
|
||||
.mosaic = 0,
|
||||
.bpp = 0,
|
||||
#if B_LAST_USED_BALL_CYCLE == TRUE
|
||||
.shape = SPRITE_SHAPE(32x64),
|
||||
#else
|
||||
.shape = SPRITE_SHAPE(32x32),
|
||||
#endif
|
||||
.shape = (B_LAST_USED_BALL_CYCLE == TRUE ? SPRITE_SHAPE(32x64) : SPRITE_SHAPE(32x32)),
|
||||
.x = 0,
|
||||
.matrixNum = 0,
|
||||
#if B_LAST_USED_BALL_CYCLE == TRUE
|
||||
.size = SPRITE_SIZE(32x64),
|
||||
#else
|
||||
.size = SPRITE_SIZE(32x32),
|
||||
#endif
|
||||
.size = (B_LAST_USED_BALL_CYCLE == TRUE ? SPRITE_SIZE(32x64) : SPRITE_SIZE(32x32)),
|
||||
.tileNum = 0,
|
||||
.priority = 1,
|
||||
.paletteNum = 0,
|
||||
@ -3457,9 +3437,8 @@ static const struct SpriteSheet sSpriteSheet_LastUsedBallWindow =
|
||||
|
||||
bool32 CanThrowLastUsedBall(void)
|
||||
{
|
||||
#if B_LAST_USED_BALL == FALSE
|
||||
return FALSE;
|
||||
#else
|
||||
if (B_LAST_USED_BALL == FALSE)
|
||||
return FALSE;
|
||||
if (!CanThrowBall())
|
||||
return FALSE;
|
||||
if (gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FRONTIER))
|
||||
@ -3468,12 +3447,12 @@ bool32 CanThrowLastUsedBall(void)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
#endif
|
||||
}
|
||||
|
||||
void TryAddLastUsedBallItemSprites(void)
|
||||
{
|
||||
#if B_LAST_USED_BALL == TRUE
|
||||
if (B_LAST_USED_BALL == FALSE)
|
||||
return;
|
||||
if (gLastThrownBall == 0
|
||||
|| (gLastThrownBall != 0 && !CheckBagHasItem(gLastThrownBall, 1)))
|
||||
{
|
||||
@ -3510,10 +3489,8 @@ void TryAddLastUsedBallItemSprites(void)
|
||||
gSprites[gBattleStruct->ballSpriteIds[1]].sHide = FALSE; // restore
|
||||
gLastUsedBallMenuPresent = TRUE;
|
||||
}
|
||||
#if B_LAST_USED_BALL_CYCLE == TRUE
|
||||
ArrowsChangeColorLastBallCycle(0); //Default the arrows to be invisible
|
||||
#endif
|
||||
#endif
|
||||
if (B_LAST_USED_BALL_CYCLE == TRUE)
|
||||
ArrowsChangeColorLastBallCycle(0); //Default the arrows to be invisible
|
||||
}
|
||||
|
||||
static void DestroyLastUsedBallWinGfx(struct Sprite *sprite)
|
||||
@ -3571,7 +3548,8 @@ static void SpriteCB_LastUsedBall(struct Sprite *sprite)
|
||||
|
||||
static void TryHideOrRestoreLastUsedBall(u8 caseId)
|
||||
{
|
||||
#if B_LAST_USED_BALL == TRUE
|
||||
if (B_LAST_USED_BALL == FALSE)
|
||||
return;
|
||||
if (gBattleStruct->ballSpriteIds[0] == MAX_SPRITES)
|
||||
return;
|
||||
|
||||
@ -3592,27 +3570,25 @@ static void TryHideOrRestoreLastUsedBall(u8 caseId)
|
||||
gLastUsedBallMenuPresent = TRUE;
|
||||
break;
|
||||
}
|
||||
#if B_LAST_USED_BALL_CYCLE == TRUE
|
||||
ArrowsChangeColorLastBallCycle(0); //Default the arrows to be invisible
|
||||
#endif
|
||||
#endif
|
||||
if (B_LAST_USED_BALL_CYCLE == TRUE)
|
||||
ArrowsChangeColorLastBallCycle(0); //Default the arrows to be invisible
|
||||
}
|
||||
|
||||
void TryHideLastUsedBall(void)
|
||||
{
|
||||
#if B_LAST_USED_BALL == TRUE
|
||||
TryHideOrRestoreLastUsedBall(0);
|
||||
#endif
|
||||
if (B_LAST_USED_BALL == TRUE)
|
||||
TryHideOrRestoreLastUsedBall(0);
|
||||
}
|
||||
|
||||
void TryRestoreLastUsedBall(void)
|
||||
{
|
||||
#if B_LAST_USED_BALL == TRUE
|
||||
if (B_LAST_USED_BALL == FALSE)
|
||||
return;
|
||||
|
||||
if (gBattleStruct->ballSpriteIds[0] != MAX_SPRITES)
|
||||
TryHideOrRestoreLastUsedBall(1);
|
||||
else
|
||||
TryAddLastUsedBallItemSprites();
|
||||
#endif
|
||||
}
|
||||
|
||||
static void SpriteCB_LastUsedBallBounce(struct Sprite *sprite)
|
||||
@ -3672,13 +3648,13 @@ static void Task_BounceBall(u8 taskId)
|
||||
sprite->callback = SpriteCB_LastUsedBallBounce; //Show and bounce down
|
||||
task->sState++;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case 4: // Destroy Task
|
||||
if(!sprite->sMoving)
|
||||
{
|
||||
sprite->callback = SpriteCB_LastUsedBall;
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!gLastUsedBallMenuPresent)
|
||||
{
|
||||
|
||||
@ -587,7 +587,6 @@ static void BattleIntroSlidePartner(u8 taskId)
|
||||
void DrawBattlerOnBg(int bgId, u8 x, u8 y, u8 battlerPosition, u8 paletteId, u8 *tiles, u16 *tilemap, u16 tilesOffset)
|
||||
{
|
||||
int i, j;
|
||||
u8 battler = GetBattlerAtPosition(battlerPosition);
|
||||
int offset = tilesOffset;
|
||||
CpuCopy16(gMonSpritesGfxPtr->sprites.ptr[battlerPosition], tiles, BG_SCREEN_SIZE);
|
||||
LoadBgTiles(bgId, tiles, 0x1000, tilesOffset);
|
||||
|
||||
@ -87,7 +87,6 @@ static void AskRecordBattle(void);
|
||||
static void SpriteCB_MoveWildMonToRight(struct Sprite *sprite);
|
||||
static void SpriteCB_WildMonShowHealthbox(struct Sprite *sprite);
|
||||
static void SpriteCB_WildMonAnimate(struct Sprite *sprite);
|
||||
static void SpriteCB_Flicker(struct Sprite *sprite);
|
||||
static void SpriteCB_AnimFaintOpponent(struct Sprite *sprite);
|
||||
static void SpriteCB_BlinkVisible(struct Sprite *sprite);
|
||||
static void SpriteCB_Idle(struct Sprite *sprite);
|
||||
@ -103,8 +102,6 @@ static void SetActionsAndBattlersTurnOrder(void);
|
||||
static void UpdateBattlerPartyOrdersOnSwitch(u32 battler);
|
||||
static bool8 AllAtActionConfirmed(void);
|
||||
static void TryChangeTurnOrder(void);
|
||||
static void CheckChosenMoveForEffectsBeforeTurnStarts(void);
|
||||
static void CheckMegaEvolutionBeforeTurn(void);
|
||||
static void CheckQuickClaw_CustapBerryActivation(void);
|
||||
static void FreeResetData_ReturnToOvOrDoEvolutions(void);
|
||||
static void ReturnFromBattleToOverworld(void);
|
||||
@ -134,16 +131,10 @@ EWRAM_DATA u16 gBattle_WIN0H = 0;
|
||||
EWRAM_DATA u16 gBattle_WIN0V = 0;
|
||||
EWRAM_DATA u16 gBattle_WIN1H = 0;
|
||||
EWRAM_DATA u16 gBattle_WIN1V = 0;
|
||||
EWRAM_DATA u8 gDisplayedStringBattle[400] = {0};
|
||||
EWRAM_DATA u8 gDisplayedStringBattle[425] = {0}; // Increased in size to fit Juan's defeat text (SootopolisCity_Gym_1F_Text_JuanDefeat)
|
||||
EWRAM_DATA u8 gBattleTextBuff1[TEXT_BUFF_ARRAY_COUNT] = {0};
|
||||
EWRAM_DATA u8 gBattleTextBuff2[TEXT_BUFF_ARRAY_COUNT] = {0};
|
||||
EWRAM_DATA u8 gBattleTextBuff3[30] = {0}; //expanded for stupidly long z move names
|
||||
// The below array is never intentionally used. However, Juan's
|
||||
// defeat text (SootopolisCity_Gym_1F_Text_JuanDefeat) is too long
|
||||
// for gDisplayedStringBattle and overflows into this array. If it
|
||||
// is removed (and none of the buffers above are increased in size)
|
||||
// it will instead overflow into useful data.
|
||||
EWRAM_DATA static u32 sFlickerArray[25] = {0};
|
||||
EWRAM_DATA u8 gBattleTextBuff3[TEXT_BUFF_ARRAY_COUNT + 13] = {0}; // expanded for stupidly long z move names
|
||||
EWRAM_DATA u32 gBattleTypeFlags = 0;
|
||||
EWRAM_DATA u8 gBattleTerrain = 0;
|
||||
EWRAM_DATA u32 gUnusedFirstBattleVar1 = 0; // Never read
|
||||
@ -236,7 +227,7 @@ EWRAM_DATA u32 gFieldStatuses = 0;
|
||||
EWRAM_DATA struct FieldTimer gFieldTimers = {0};
|
||||
EWRAM_DATA u8 gBattlerAbility = 0;
|
||||
EWRAM_DATA u16 gPartnerSpriteId = 0;
|
||||
EWRAM_DATA struct TotemBoost gTotemBoosts[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA struct QueuedStatBoost gQueuedStatBoosts[MAX_BATTLERS_COUNT] = {0};
|
||||
EWRAM_DATA bool8 gHasFetchedBall = FALSE;
|
||||
EWRAM_DATA u8 gLastUsedBall = 0;
|
||||
EWRAM_DATA u16 gLastThrownBall = 0;
|
||||
@ -509,7 +500,6 @@ void CB2_InitBattle(void)
|
||||
static void CB2_InitBattleInternal(void)
|
||||
{
|
||||
s32 i;
|
||||
u16 targetSpecies;
|
||||
|
||||
SetHBlankCallback(NULL);
|
||||
SetVBlankCallback(NULL);
|
||||
@ -606,14 +596,11 @@ static void CB2_InitBattleInternal(void)
|
||||
gSaveBlock2Ptr->frontier.disableRecordBattle = FALSE;
|
||||
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
AdjustFriendship(&gPlayerParty[i], FRIENDSHIP_EVENT_LEAGUE_BATTLE);
|
||||
|
||||
// Apply party-wide start-of-battle form changes
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
// Player's side
|
||||
// Apply party-wide start-of-battle form changes for both sides.
|
||||
TryFormChange(i, B_SIDE_PLAYER, FORM_CHANGE_BEGIN_BATTLE);
|
||||
// Opponent's side
|
||||
TryFormChange(i, B_SIDE_OPPONENT, FORM_CHANGE_BEGIN_BATTLE);
|
||||
}
|
||||
|
||||
@ -1941,7 +1928,6 @@ void CustomTrainerPartyAssignMoves(struct Pokemon *mon, const struct TrainerMon
|
||||
u8 CreateNPCTrainerPartyFromTrainer(struct Pokemon *party, const struct Trainer *trainer, bool32 firstTrainer, u32 battleTypeFlags)
|
||||
{
|
||||
u32 personalityValue;
|
||||
u8 fixedIV;
|
||||
s32 i, j;
|
||||
u8 monsCount;
|
||||
if (battleTypeFlags & BATTLE_TYPE_TRAINER && !(battleTypeFlags & (BATTLE_TYPE_FRONTIER
|
||||
@ -2697,29 +2683,6 @@ void SpriteCallbackDummy_2(struct Sprite *sprite)
|
||||
|
||||
}
|
||||
|
||||
#define sNumFlickers data[3]
|
||||
#define sDelay data[4]
|
||||
|
||||
static void SpriteCB_Flicker(struct Sprite *sprite)
|
||||
{
|
||||
sprite->sDelay--;
|
||||
if (sprite->sDelay == 0)
|
||||
{
|
||||
sprite->sDelay = 8;
|
||||
sprite->invisible ^= 1;
|
||||
sprite->sNumFlickers--;
|
||||
if (sprite->sNumFlickers == 0)
|
||||
{
|
||||
sprite->invisible = FALSE;
|
||||
sprite->callback = SpriteCallbackDummy_2;
|
||||
// sFlickerArray[0] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#undef sNumFlickers
|
||||
#undef sDelay
|
||||
|
||||
extern const struct MonCoords gMonFrontPicCoords[];
|
||||
|
||||
void SpriteCB_FaintOpponentMon(struct Sprite *sprite)
|
||||
@ -3244,6 +3207,7 @@ void SwitchInClearSetData(u32 battler)
|
||||
gSelectedMonPartyId = PARTY_SIZE;
|
||||
|
||||
// Allow for illegal abilities within tests.
|
||||
#if TESTING
|
||||
if (gTestRunnerEnabled)
|
||||
{
|
||||
u32 side = GetBattlerSide(battler);
|
||||
@ -3251,6 +3215,7 @@ void SwitchInClearSetData(u32 battler)
|
||||
if (TestRunner_Battle_GetForcedAbility(side, partyIndex))
|
||||
gBattleMons[i].ability = gBattleStruct->overwrittenAbilities[i] = TestRunner_Battle_GetForcedAbility(side, partyIndex);
|
||||
}
|
||||
#endif // TESTING
|
||||
|
||||
Ai_UpdateSwitchInData(battler);
|
||||
}
|
||||
@ -3516,11 +3481,10 @@ static void DoBattleIntro(void)
|
||||
}
|
||||
else // Skip party summary since it is a wild battle.
|
||||
{
|
||||
#if B_FAST_INTRO == TRUE
|
||||
*state = 7; // Don't wait for sprite, print message at the same time.
|
||||
#else
|
||||
*state = 6; // Wait for sprite to load.
|
||||
#endif
|
||||
if (B_FAST_INTRO == TRUE)
|
||||
*state = 7; // Don't wait for sprite, print message at the same time.
|
||||
else
|
||||
*state = 6; // Wait for sprite to load.
|
||||
}
|
||||
break;
|
||||
case 5: // draw party summary in trainer battles
|
||||
@ -3589,11 +3553,10 @@ static void DoBattleIntro(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
#if B_FAST_INTRO == TRUE
|
||||
*state = 15; // Wait for text to be printed.
|
||||
#else
|
||||
*state = 14; // Wait for text and sprite.
|
||||
#endif
|
||||
if (B_FAST_INTRO == TRUE)
|
||||
*state = 15; // Wait for text to be printed.
|
||||
else
|
||||
*state = 14; // Wait for text and sprite.
|
||||
}
|
||||
}
|
||||
break;
|
||||
@ -3631,11 +3594,10 @@ static void DoBattleIntro(void)
|
||||
BtlController_EmitIntroTrainerBallThrow(battler, BUFFER_A);
|
||||
MarkBattlerForControllerExec(battler);
|
||||
}
|
||||
#if B_FAST_INTRO == TRUE
|
||||
if (!(gBattleTypeFlags & (BATTLE_TYPE_RECORDED | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_RECORDED_IS_MASTER | BATTLE_TYPE_LINK)))
|
||||
if (B_FAST_INTRO == TRUE
|
||||
&& !(gBattleTypeFlags & (BATTLE_TYPE_RECORDED | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_RECORDED_IS_MASTER | BATTLE_TYPE_LINK)))
|
||||
*state = 15; // Print at the same time as trainer sends out second mon.
|
||||
else
|
||||
#endif
|
||||
(*state)++;
|
||||
break;
|
||||
case 14: // wait for opponent 2 send out
|
||||
@ -3655,14 +3617,13 @@ static void DoBattleIntro(void)
|
||||
battler = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT);
|
||||
|
||||
// A hack that makes fast intro work in trainer battles too.
|
||||
#if B_FAST_INTRO == TRUE
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_TRAINER
|
||||
if (B_FAST_INTRO == TRUE
|
||||
&& gBattleTypeFlags & BATTLE_TYPE_TRAINER
|
||||
&& !(gBattleTypeFlags & (BATTLE_TYPE_RECORDED | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_RECORDED_IS_MASTER | BATTLE_TYPE_LINK))
|
||||
&& gSprites[gHealthboxSpriteIds[battler ^ BIT_SIDE]].callback == SpriteCallbackDummy)
|
||||
{
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
PrepareStringBattle(STRINGID_INTROSENDOUT, battler);
|
||||
}
|
||||
@ -3750,6 +3711,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
}
|
||||
|
||||
// Allow for illegal abilities within tests.
|
||||
#if TESTING
|
||||
if (gTestRunnerEnabled && gBattleStruct->switchInAbilitiesCounter == 0)
|
||||
{
|
||||
for (i = 0; i < gBattlersCount; ++i)
|
||||
@ -3760,6 +3722,7 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
gBattleMons[i].ability = gBattleStruct->overwrittenAbilities[i] = TestRunner_Battle_GetForcedAbility(side, partyIndex);
|
||||
}
|
||||
}
|
||||
#endif // TESTING
|
||||
|
||||
if (gBattleStruct->switchInAbilitiesCounter == 0)
|
||||
{
|
||||
@ -3790,14 +3753,13 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
// Totem boosts
|
||||
for (i = 0; i < gBattlersCount; i++)
|
||||
{
|
||||
if (gTotemBoosts[i].stats != 0)
|
||||
if (gQueuedStatBoosts[i].stats != 0 && !gProtectStructs[i].eatMirrorHerb && gProtectStructs[i].activateOpportunist == 0)
|
||||
{
|
||||
gBattlerAttacker = i;
|
||||
BattleScriptExecute(BattleScript_TotemVar);
|
||||
return;
|
||||
}
|
||||
}
|
||||
memset(gTotemBoosts, 0, sizeof(gTotemBoosts)); // erase all totem boosts just to be safe
|
||||
|
||||
// Check neutralizing gas
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_NEUTRALIZINGGAS, 0, 0, 0, 0) != 0)
|
||||
@ -3822,6 +3784,9 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
return;
|
||||
}
|
||||
|
||||
if (AbilityBattleEffects(ABILITYEFFECT_OPPORTUNIST, 0, 0, 0, 0))
|
||||
return;
|
||||
|
||||
for (i = 0; i < MAX_BATTLERS_COUNT; i++)
|
||||
{
|
||||
*(gBattleStruct->monToSwitchIntoId + i) = PARTY_SIZE;
|
||||
@ -3855,6 +3820,8 @@ static void TryDoEventsBeforeFirstTurn(void)
|
||||
|
||||
gRandomTurnNumber = Random();
|
||||
|
||||
memset(gQueuedStatBoosts, 0, sizeof(gQueuedStatBoosts)); // erase all totem boosts just to be safe
|
||||
|
||||
SetAiLogicDataForTurn(AI_DATA); // get assumed abilities, hold effects, etc of all battlers
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_ARENA)
|
||||
@ -3994,10 +3961,8 @@ u8 IsRunningFromBattleImpossible(u32 battler)
|
||||
|
||||
if (holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)
|
||||
return BATTLE_RUN_SUCCESS;
|
||||
#if B_GHOSTS_ESCAPE >= GEN_6
|
||||
if (IS_BATTLER_OF_TYPE(battler, TYPE_GHOST))
|
||||
return BATTLE_RUN_SUCCESS;
|
||||
#endif
|
||||
if (B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battler, TYPE_GHOST))
|
||||
return BATTLE_RUN_SUCCESS;
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||
return BATTLE_RUN_SUCCESS;
|
||||
if (GetBattlerAbility(battler) == ABILITY_RUN_AWAY)
|
||||
@ -4661,11 +4626,7 @@ u32 GetBattlerTotalSpeedStatArgs(u32 battler, u32 ability, u32 holdEffect)
|
||||
|
||||
// paralysis drop
|
||||
if (gBattleMons[battler].status1 & STATUS1_PARALYSIS && ability != ABILITY_QUICK_FEET)
|
||||
#if B_PARALYSIS_SPEED >= GEN_7
|
||||
speed /= 2;
|
||||
#else
|
||||
speed /= 4;
|
||||
#endif
|
||||
speed /= B_PARALYSIS_SPEED >= GEN_7 ? 2 : 4;
|
||||
|
||||
return speed;
|
||||
}
|
||||
@ -4697,9 +4658,7 @@ s8 GetMovePriority(u32 battler, u16 move)
|
||||
|
||||
priority = gBattleMoves[move].priority;
|
||||
if (ability == ABILITY_GALE_WINGS
|
||||
#if B_GALE_WINGS >= GEN_7
|
||||
&& BATTLER_MAX_HP(battler)
|
||||
#endif
|
||||
&& (B_GALE_WINGS < GEN_7 || BATTLER_MAX_HP(battler))
|
||||
&& gBattleMoves[move].type == TYPE_FLYING)
|
||||
{
|
||||
priority++;
|
||||
@ -4749,7 +4708,7 @@ u32 GetWhichBattlerFasterArgs(u32 battler1, u32 battler2, bool32 ignoreChosenMov
|
||||
|
||||
// Battler 1
|
||||
// Quick Draw
|
||||
if (!ignoreChosenMoves && ability1 == ABILITY_QUICK_DRAW && !IS_MOVE_STATUS(gChosenMoveByBattler[battler1]) && Random() % 100 < 30)
|
||||
if (!ignoreChosenMoves && ability1 == ABILITY_QUICK_DRAW && !IS_MOVE_STATUS(gChosenMoveByBattler[battler1]) && RandomPercentage(RNG_QUICK_DRAW, 30))
|
||||
gProtectStructs[battler1].quickDraw = TRUE;
|
||||
// Quick Claw and Custap Berry
|
||||
if (!gProtectStructs[battler1].quickDraw
|
||||
@ -4759,7 +4718,7 @@ u32 GetWhichBattlerFasterArgs(u32 battler1, u32 battler2, bool32 ignoreChosenMov
|
||||
|
||||
// Battler 2
|
||||
// Quick Draw
|
||||
if (!ignoreChosenMoves && ability2 == ABILITY_QUICK_DRAW && !IS_MOVE_STATUS(gChosenMoveByBattler[battler2]) && Random() % 100 < 30)
|
||||
if (!ignoreChosenMoves && ability2 == ABILITY_QUICK_DRAW && !IS_MOVE_STATUS(gChosenMoveByBattler[battler2]) && RandomPercentage(RNG_QUICK_DRAW, 30))
|
||||
gProtectStructs[battler2].quickDraw = TRUE;
|
||||
// Quick Claw and Custap Berry
|
||||
if (!gProtectStructs[battler2].quickDraw
|
||||
@ -4968,6 +4927,7 @@ static void TurnValuesCleanUp(bool8 var0)
|
||||
gProtectStructs[i].kingsShielded = FALSE;
|
||||
gProtectStructs[i].banefulBunkered = FALSE;
|
||||
gProtectStructs[i].quash = FALSE;
|
||||
gProtectStructs[i].usedCustapBerry = FALSE;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -5013,8 +4973,6 @@ static bool32 TryDoMegaEvosBeforeMoves(void)
|
||||
if (!(gHitMarker & HITMARKER_RUN) && (gBattleStruct->mega.toEvolve || gBattleStruct->burst.toBurst))
|
||||
{
|
||||
u32 i, battler;
|
||||
struct Pokemon *party;
|
||||
struct Pokemon *mon;
|
||||
u8 megaOrder[MAX_BATTLERS_COUNT];
|
||||
|
||||
PopulateArrayWithBattlers(megaOrder);
|
||||
@ -5027,8 +4985,6 @@ static bool32 TryDoMegaEvosBeforeMoves(void)
|
||||
gBattlerAttacker = megaOrder[i];
|
||||
gBattleStruct->mega.toEvolve &= ~(gBitTable[gBattlerAttacker]);
|
||||
gLastUsedItem = gBattleMons[gBattlerAttacker].item;
|
||||
party = GetBattlerParty(gBattlerAttacker);
|
||||
mon = &party[gBattlerPartyIndexes[gBattlerAttacker]];
|
||||
if (GetBattleFormChangeTargetSpecies(gBattlerAttacker, FORM_CHANGE_BATTLE_MEGA_EVOLUTION_MOVE) != SPECIES_NONE)
|
||||
BattleScriptExecute(BattleScript_WishMegaEvolution);
|
||||
else
|
||||
@ -5042,17 +4998,14 @@ static bool32 TryDoMegaEvosBeforeMoves(void)
|
||||
battler = gBattlerAttacker = megaOrder[i];
|
||||
gBattleStruct->burst.toBurst &= ~(gBitTable[battler]);
|
||||
gLastUsedItem = gBattleMons[battler].item;
|
||||
party = GetBattlerParty(battler);
|
||||
mon = &party[gBattlerPartyIndexes[battler]];
|
||||
BattleScriptExecute(BattleScript_UltraBurst);
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if B_MEGA_EVO_TURN_ORDER >= GEN_7
|
||||
if (B_MEGA_EVO_TURN_ORDER >= GEN_7)
|
||||
TryChangeTurnOrder(); // This will just do nothing if no mon has mega evolved.
|
||||
#endif
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -5061,7 +5014,6 @@ static bool32 TryDoMoveEffectsBeforeMoves(void)
|
||||
if (!(gHitMarker & HITMARKER_RUN))
|
||||
{
|
||||
u32 i;
|
||||
struct Pokemon *mon;
|
||||
u8 battlers[MAX_BATTLERS_COUNT];
|
||||
|
||||
PopulateArrayWithBattlers(battlers);
|
||||
@ -5134,7 +5086,6 @@ static void CheckQuickClaw_CustapBerryActivation(void)
|
||||
{
|
||||
if (gProtectStructs[battler].usedCustapBerry)
|
||||
{
|
||||
gProtectStructs[battler].usedCustapBerry = FALSE;
|
||||
gLastUsedItem = gBattleMons[battler].item;
|
||||
PREPARE_ITEM_BUFFER(gBattleTextBuff1, gLastUsedItem);
|
||||
if (GetBattlerHoldEffect(battler, FALSE) == HOLD_EFFECT_CUSTAP_BERRY)
|
||||
@ -5404,9 +5355,8 @@ static void HandleEndTurn_FinishBattle(void)
|
||||
TestRunner_Battle_AfterLastTurn();
|
||||
BeginFastPaletteFade(3);
|
||||
FadeOutMapMusic(5);
|
||||
#if B_TRAINERS_KNOCK_OFF_ITEMS == TRUE || B_RESTORE_HELD_BATTLE_ITEMS == TRUE
|
||||
if (B_TRAINERS_KNOCK_OFF_ITEMS == TRUE || B_RESTORE_HELD_BATTLE_ITEMS == TRUE)
|
||||
TryRestoreHeldItems();
|
||||
#endif
|
||||
for (i = 0; i < PARTY_SIZE; i++)
|
||||
{
|
||||
bool8 changedForm = FALSE;
|
||||
@ -5422,11 +5372,9 @@ static void HandleEndTurn_FinishBattle(void)
|
||||
gBattleStruct->changedSpecies[B_SIDE_PLAYER][i] = SPECIES_NONE;
|
||||
gBattleStruct->changedSpecies[B_SIDE_OPPONENT][i] = SPECIES_NONE;
|
||||
|
||||
#if B_RECALCULATE_STATS >= GEN_5
|
||||
// Recalculate the stats of every party member before the end
|
||||
if (!changedForm)
|
||||
if (!changedForm && B_RECALCULATE_STATS >= GEN_5)
|
||||
CalculateMonStats(&gPlayerParty[i]);
|
||||
#endif
|
||||
}
|
||||
// Clear battle mon species to avoid a bug on the next battle that causes
|
||||
// healthboxes loading incorrectly due to it trying to create a Mega Indicator
|
||||
@ -5459,10 +5407,9 @@ static void FreeResetData_ReturnToOvOrDoEvolutions(void)
|
||||
| BATTLE_TYPE_FRONTIER
|
||||
| BATTLE_TYPE_EREADER_TRAINER
|
||||
| BATTLE_TYPE_WALLY_TUTORIAL))
|
||||
#if B_EVOLUTION_AFTER_WHITEOUT <= GEN_5
|
||||
&& (gBattleOutcome == B_OUTCOME_WON || gBattleOutcome == B_OUTCOME_CAUGHT)
|
||||
#endif
|
||||
)
|
||||
&& (B_EVOLUTION_AFTER_WHITEOUT >= GEN_6
|
||||
|| gBattleOutcome == B_OUTCOME_WON
|
||||
|| gBattleOutcome == B_OUTCOME_CAUGHT))
|
||||
{
|
||||
gBattleMainFunc = TrySpecialEvolution;
|
||||
}
|
||||
@ -5640,6 +5587,10 @@ void SetTypeBeforeUsingMove(u32 move, u32 battlerAtk)
|
||||
if (holdEffect == gBattleMoves[move].argument)
|
||||
gBattleStruct->dynamicMoveType = ItemId_GetSecondaryId(gBattleMons[battlerAtk].item) | F_DYNAMIC_TYPE_2;
|
||||
}
|
||||
else if (gBattleMoves[move].effect == EFFECT_IVY_CUDGEL && holdEffect == HOLD_EFFECT_MASK)
|
||||
{
|
||||
gBattleStruct->dynamicMoveType = ItemId_GetSecondaryId(gBattleMons[battlerAtk].item) | F_DYNAMIC_TYPE_2;
|
||||
}
|
||||
else if (gBattleMoves[move].effect == EFFECT_REVELATION_DANCE)
|
||||
{
|
||||
if (gBattleMons[battlerAtk].type1 != TYPE_MYSTERY)
|
||||
@ -5737,9 +5688,9 @@ void SetTotemBoost(void)
|
||||
{
|
||||
if (*(&gSpecialVar_0x8001 + i))
|
||||
{
|
||||
gTotemBoosts[battler].stats |= (1 << i);
|
||||
gTotemBoosts[battler].statChanges[i] = *(&gSpecialVar_0x8001 + i);
|
||||
gTotemBoosts[battler].stats |= 0x80; // used as a flag for the "totem flared to life" script
|
||||
gQueuedStatBoosts[battler].stats |= (1 << i);
|
||||
gQueuedStatBoosts[battler].statChanges[i] = *(&gSpecialVar_0x8001 + i);
|
||||
gQueuedStatBoosts[battler].stats |= 0x80; // used as a flag for the "totem flared to life" script
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -532,12 +532,12 @@ static const u8 sText_TwoInGameTrainersDefeated[];
|
||||
static const u8 sText_Trainer2LoseText[];
|
||||
|
||||
// New battle strings.
|
||||
static const s8 sText_EnduredViaSturdy[] = _("{B_DEF_NAME_WITH_PREFIX} endured\nthe hit using {B_DEF_ABILITY}!");
|
||||
static const s8 sText_PowerHerbActivation[] = _("{B_ATK_NAME_WITH_PREFIX} became fully charged\ndue to its {B_LAST_ITEM}!");
|
||||
static const s8 sText_HurtByItem[] = _("{B_ATK_NAME_WITH_PREFIX} was hurt\nby its {B_LAST_ITEM}!");
|
||||
static const s8 sText_BadlyPoisonedByItem[] = _("{B_EFF_NAME_WITH_PREFIX} was badly\npoisoned by the {B_LAST_ITEM}!");
|
||||
static const s8 sText_BurnedByItem[] = _("{B_EFF_NAME_WITH_PREFIX} was burned\nby the {B_LAST_ITEM}!");
|
||||
static const s8 sText_TargetAbilityActivates[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY} activates!");
|
||||
static const u8 sText_EnduredViaSturdy[] = _("{B_DEF_NAME_WITH_PREFIX} endured\nthe hit using {B_DEF_ABILITY}!");
|
||||
static const u8 sText_PowerHerbActivation[] = _("{B_ATK_NAME_WITH_PREFIX} became fully charged\ndue to its {B_LAST_ITEM}!");
|
||||
static const u8 sText_HurtByItem[] = _("{B_ATK_NAME_WITH_PREFIX} was hurt\nby its {B_LAST_ITEM}!");
|
||||
static const u8 sText_BadlyPoisonedByItem[] = _("{B_EFF_NAME_WITH_PREFIX} was badly\npoisoned by the {B_LAST_ITEM}!");
|
||||
static const u8 sText_BurnedByItem[] = _("{B_EFF_NAME_WITH_PREFIX} was burned\nby the {B_LAST_ITEM}!");
|
||||
static const u8 sText_TargetAbilityActivates[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_DEF_ABILITY} activates!");
|
||||
static const u8 sText_GravityIntensified[] = _("Gravity intensified!");
|
||||
static const u8 sText_TargetIdentified[] = _("{B_DEF_NAME_WITH_PREFIX} was\nidentified!");
|
||||
static const u8 sText_TargetWokeUp[] = _("{B_DEF_NAME_WITH_PREFIX} woke up!");
|
||||
@ -807,9 +807,12 @@ static const u8 sText_TeamGainedEXP[] = _("The rest of your team gained EXP.\nPo
|
||||
static const u8 sText_CurrentMoveCantSelect[] = _("{B_BUFF1} cannot be used!\p");
|
||||
static const u8 sText_TargetIsBeingSaltCured[] = _("{B_DEF_NAME_WITH_PREFIX} is being salt cured!");
|
||||
static const u8 sText_TargetIsHurtBySaltCure[] = _("{B_DEF_NAME_WITH_PREFIX} is hurt by {B_BUFF1}!");
|
||||
static const u8 sText_OpportunistCopied[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} copied its\nopponent's stat changes!");
|
||||
static const u8 sText_TargetCoveredInStickyCandySyrup[] = _("{B_DEF_NAME_WITH_PREFIX} got covered\nin sticky syrup!");
|
||||
|
||||
const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||
{
|
||||
[STRINGID_OPPORTUNISTCOPIED - BATTLESTRINGS_TABLE_START] = sText_OpportunistCopied,
|
||||
[STRINGID_TARGETISHURTBYSALTCURE - BATTLESTRINGS_TABLE_START] = sText_TargetIsHurtBySaltCure,
|
||||
[STRINGID_TARGETISBEINGSALTCURED - BATTLESTRINGS_TABLE_START] = sText_TargetIsBeingSaltCured,
|
||||
[STRINGID_CURRENTMOVECANTSELECT - BATTLESTRINGS_TABLE_START] = sText_CurrentMoveCantSelect,
|
||||
@ -1469,6 +1472,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] =
|
||||
[STRINGID_ULTRABURSTREACTING - BATTLESTRINGS_TABLE_START] = sText_UltraBurstReacting,
|
||||
[STRINGID_ULTRABURSTCOMPLETED - BATTLESTRINGS_TABLE_START] = sText_UltraBurstCompleted,
|
||||
[STRINGID_TEAMGAINEDEXP - BATTLESTRINGS_TABLE_START] = sText_TeamGainedEXP,
|
||||
[STRINGID_TARGETCOVEREDINSTICKYCANDYSYRUP - BATTLESTRINGS_TABLE_START] = sText_TargetCoveredInStickyCandySyrup,
|
||||
};
|
||||
|
||||
const u16 gTrainerUsedItemStringIds[] =
|
||||
@ -1850,11 +1854,7 @@ const u16 gWeatherStartsStringIds[] =
|
||||
[WEATHER_SUNNY_CLOUDS] = STRINGID_ITISRAINING,
|
||||
[WEATHER_SUNNY] = STRINGID_ITISRAINING,
|
||||
[WEATHER_RAIN] = STRINGID_ITISRAINING,
|
||||
#if B_OVERWORLD_SNOW >= GEN_9
|
||||
[WEATHER_SNOW] = STRINGID_STARTEDSNOW,
|
||||
#else
|
||||
[WEATHER_SNOW] = STRINGID_STARTEDHAIL,
|
||||
#endif
|
||||
[WEATHER_SNOW] = (B_OVERWORLD_SNOW >= GEN_9 ? STRINGID_STARTEDSNOW : STRINGID_STARTEDHAIL),
|
||||
[WEATHER_RAIN_THUNDERSTORM] = STRINGID_ITISRAINING,
|
||||
[WEATHER_FOG_HORIZONTAL] = STRINGID_ITISRAINING,
|
||||
[WEATHER_VOLCANIC_ASH] = STRINGID_ITISRAINING,
|
||||
@ -2948,7 +2948,7 @@ void BufferStringBattle(u16 stringID, u32 battler)
|
||||
|
||||
u32 BattleStringExpandPlaceholdersToDisplayedString(const u8 *src)
|
||||
{
|
||||
BattleStringExpandPlaceholders(src, gDisplayedStringBattle);
|
||||
return BattleStringExpandPlaceholders(src, gDisplayedStringBattle);
|
||||
}
|
||||
|
||||
static const u8 *TryGetStatusString(u8 *src)
|
||||
@ -3016,7 +3016,7 @@ static void GetBattlerNick(u32 battler, u8 *dst)
|
||||
|
||||
static const u8 *BattleStringGetOpponentNameByTrainerId(u16 trainerId, u8 *text, u8 multiplayerId, u8 battler)
|
||||
{
|
||||
const u8 *toCpy;
|
||||
const u8 *toCpy = NULL;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_SECRET_BASE)
|
||||
{
|
||||
@ -3068,7 +3068,7 @@ static const u8 *BattleStringGetOpponentNameByTrainerId(u16 trainerId, u8 *text,
|
||||
|
||||
static const u8 *BattleStringGetOpponentName(u8 *text, u8 multiplayerId, u8 battler)
|
||||
{
|
||||
const u8 *toCpy;
|
||||
const u8 *toCpy = NULL;
|
||||
|
||||
switch (GetBattlerPosition(battler))
|
||||
{
|
||||
@ -3088,7 +3088,7 @@ static const u8 *BattleStringGetOpponentName(u8 *text, u8 multiplayerId, u8 batt
|
||||
|
||||
static const u8 *BattleStringGetPlayerName(u8 *text, u8 battler)
|
||||
{
|
||||
const u8 *toCpy;
|
||||
const u8 *toCpy = NULL;
|
||||
|
||||
switch (GetBattlerPosition(battler))
|
||||
{
|
||||
@ -3164,7 +3164,6 @@ u32 BattleStringExpandPlaceholders(const u8 *src, u8 *dst)
|
||||
// This buffer may hold either the name of a trainer, pokemon, or item.
|
||||
u8 text[max(max(max(32, TRAINER_NAME_LENGTH + 1), POKEMON_NAME_LENGTH + 1), ITEM_NAME_LENGTH)];
|
||||
u8 multiplayerId;
|
||||
s32 i;
|
||||
|
||||
if (gBattleTypeFlags & BATTLE_TYPE_RECORDED_LINK)
|
||||
multiplayerId = gRecordedBattleMultiplayerId;
|
||||
@ -3745,7 +3744,7 @@ void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst)
|
||||
// unused, since the value loaded into the buffer is not read; it loaded one of
|
||||
// two particles (either "?" or "?") which works in tandem with ChooseTypeOfMoveUsedString
|
||||
// below to effect changes in the meaning of the line.
|
||||
static void ChooseMoveUsedParticle(u8 *textBuff)
|
||||
static void UNUSED ChooseMoveUsedParticle(u8 *textBuff)
|
||||
{
|
||||
s32 counter = 0;
|
||||
u32 i = 0;
|
||||
@ -3785,7 +3784,7 @@ static void ChooseMoveUsedParticle(u8 *textBuff)
|
||||
//
|
||||
// sText_ExclamationMark5 was " ????!" This resulted in a translation of
|
||||
// "<NAME>'s <ATTACK> attack!".
|
||||
static void ChooseTypeOfMoveUsedString(u8 *dst)
|
||||
static void UNUSED ChooseTypeOfMoveUsedString(u8 *dst)
|
||||
{
|
||||
s32 counter = 0;
|
||||
s32 i = 0;
|
||||
@ -4028,9 +4027,8 @@ u32 BattlerHPPercentage(u32 battler, u32 operation, u32 threshold)
|
||||
case GREATER_THAN_OR_EQUAL:
|
||||
return gBattleMons[battler].hp >= (gBattleMons[battler].maxHP / threshold);
|
||||
case NOT_EQUAL:
|
||||
return gBattleMons[battler].hp != (gBattleMons[battler].maxHP / threshold);
|
||||
default:
|
||||
break;
|
||||
return gBattleMons[battler].hp != (gBattleMons[battler].maxHP / threshold);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -861,10 +861,7 @@ static bool8 DoesTypePreventStatus(u16 species, u32 status)
|
||||
break;
|
||||
case STATUS1_PARALYSIS:
|
||||
if (gSpeciesInfo[species].types[0] == TYPE_GROUND || gSpeciesInfo[species].types[1] == TYPE_GROUND
|
||||
#if B_PARALYZE_ELECTRIC >= GEN_6
|
||||
|| gSpeciesInfo[species].types[0] == TYPE_ELECTRIC || gSpeciesInfo[species].types[1] == TYPE_ELECTRIC
|
||||
#endif
|
||||
)
|
||||
|| (B_PARALYZE_ELECTRIC >= GEN_6 && (gSpeciesInfo[species].types[0] == TYPE_ELECTRIC || gSpeciesInfo[species].types[1] == TYPE_ELECTRIC)))
|
||||
ret = TRUE;
|
||||
break;
|
||||
case STATUS1_BURN:
|
||||
@ -916,11 +913,7 @@ static bool8 TryInflictRandomStatus(void)
|
||||
if (rand < 35)
|
||||
sStatusFlags = STATUS1_TOXIC_POISON;
|
||||
else if (rand < 60)
|
||||
#if B_USE_FROSTBITE == TRUE
|
||||
sStatusFlags = STATUS1_FROSTBITE;
|
||||
#else
|
||||
sStatusFlags = STATUS1_FREEZE;
|
||||
#endif
|
||||
sStatusFlags = B_USE_FROSTBITE ? STATUS1_FROSTBITE : STATUS1_FREEZE;
|
||||
else if (rand < 80)
|
||||
sStatusFlags = STATUS1_PARALYSIS;
|
||||
else if (rand < 90)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -3004,7 +3004,7 @@ void TryHideBattleTowerReporter(void)
|
||||
static void FillPartnerParty(u16 trainerId)
|
||||
{
|
||||
s32 i, j;
|
||||
u32 ivs, level;
|
||||
u32 ivs, level, personality;
|
||||
u32 friendship;
|
||||
u16 monId;
|
||||
u32 otID;
|
||||
@ -3054,22 +3054,22 @@ static void FillPartnerParty(u16 trainerId)
|
||||
u32 otIdType = OT_ID_RANDOM_NO_SHINY;
|
||||
do
|
||||
{
|
||||
j = Random32();
|
||||
} while (IsShinyOtIdPersonality(otID, j));
|
||||
personality = Random32();
|
||||
} while (IsShinyOtIdPersonality(otID, personality));
|
||||
|
||||
if (partyData[i].gender == TRAINER_MON_MALE)
|
||||
j = (j & 0xFFFFFF00) | GeneratePersonalityForGender(MON_MALE, partyData[i].species);
|
||||
personality = (personality & 0xFFFFFF00) | GeneratePersonalityForGender(MON_MALE, partyData[i].species);
|
||||
else if (partyData[i].gender == TRAINER_MON_FEMALE)
|
||||
j = (j & 0xFFFFFF00) | GeneratePersonalityForGender(MON_FEMALE, partyData[i].species);
|
||||
personality = (personality & 0xFFFFFF00) | GeneratePersonalityForGender(MON_FEMALE, partyData[i].species);
|
||||
if (partyData[i].nature != 0)
|
||||
ModifyPersonalityForNature(&j, partyData[i].nature - 1);
|
||||
ModifyPersonalityForNature(&personality, partyData[i].nature - 1);
|
||||
if (partyData[i].isShiny)
|
||||
{
|
||||
otIdType = OT_ID_PRESET;
|
||||
otID = HIHALF(j) ^ LOHALF(j);
|
||||
otID = HIHALF(personality) ^ LOHALF(personality);
|
||||
}
|
||||
|
||||
CreateMon(&gPlayerParty[i + 3], partyData[i].species, partyData[i].lvl, 0, TRUE, j, otIdType, otID);
|
||||
CreateMon(&gPlayerParty[i + 3], partyData[i].species, partyData[i].lvl, 0, TRUE, personality, otIdType, otID);
|
||||
SetMonData(&gPlayerParty[i + 3], MON_DATA_HELD_ITEM, &partyData[i].heldItem);
|
||||
CustomTrainerPartyAssignMoves(&gPlayerParty[i+3], &partyData[i]);
|
||||
|
||||
|
||||
@ -1196,7 +1196,7 @@ static bool8 Swirl_Init(struct Task *task)
|
||||
InitTransitionData();
|
||||
ScanlineEffect_Clear();
|
||||
BeginNormalPaletteFade(PALETTES_ALL, 4, 0, 16, RGB_BLACK);
|
||||
SetSinWave(gScanlineEffectRegBuffers[1], sTransitionData->cameraX, 0, 2, 0, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[1], sTransitionData->cameraX, 0, 2, 0, DISPLAY_HEIGHT);
|
||||
|
||||
SetVBlankCallback(VBlankCB_Swirl);
|
||||
SetHBlankCallback(HBlankCB_Swirl);
|
||||
@ -1213,7 +1213,7 @@ static bool8 Swirl_End(struct Task *task)
|
||||
task->tSinIndex += 4;
|
||||
task->tAmplitude += 8;
|
||||
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], sTransitionData->cameraX, task->tSinIndex, 2, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], sTransitionData->cameraX, task->tSinIndex, 2, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
@ -1468,7 +1468,7 @@ static bool8 BigPokeball_SetGfx(struct Task *task)
|
||||
SET_TILE(tilemap, i, j, *bigPokeballMap);
|
||||
}
|
||||
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return TRUE;
|
||||
@ -1480,7 +1480,7 @@ static bool8 Aqua_SetGfx(struct Task *task)
|
||||
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LZ77UnCompVram(sTeamAqua_Tilemap, tilemap);
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
@ -1492,7 +1492,7 @@ static bool8 Magma_SetGfx(struct Task *task)
|
||||
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LZ77UnCompVram(sTeamMagma_Tilemap, tilemap);
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
@ -1505,7 +1505,7 @@ static bool8 Regice_SetGfx(struct Task *task)
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LoadPalette(sRegice_Palette, BG_PLTT_ID(15), sizeof(sRegice_Palette));
|
||||
CpuCopy16(sRegice_Tilemap, tilemap, 0x500);
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
@ -1518,7 +1518,7 @@ static bool8 Registeel_SetGfx(struct Task *task)
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LoadPalette(sRegisteel_Palette, BG_PLTT_ID(15), sizeof(sRegisteel_Palette));
|
||||
CpuCopy16(sRegisteel_Tilemap, tilemap, 0x500);
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
@ -1531,7 +1531,7 @@ static bool8 Regirock_SetGfx(struct Task *task)
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LoadPalette(sRegirock_Palette, BG_PLTT_ID(15), sizeof(sRegirock_Palette));
|
||||
CpuCopy16(sRegirock_Tilemap, tilemap, 0x500);
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return FALSE;
|
||||
@ -1623,7 +1623,7 @@ static bool8 PatternWeave_Blend1(struct Task *task)
|
||||
task->tSinIndex += 8;
|
||||
task->tAmplitude -= 256;
|
||||
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);
|
||||
|
||||
sTransitionData->VBlank_DMA++;
|
||||
return FALSE;
|
||||
@ -1643,7 +1643,7 @@ static bool8 PatternWeave_Blend2(struct Task *task)
|
||||
task->tSinIndex += 8;
|
||||
task->tAmplitude -= 256;
|
||||
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);
|
||||
|
||||
sTransitionData->VBlank_DMA++;
|
||||
return FALSE;
|
||||
@ -1655,7 +1655,7 @@ static bool8 PatternWeave_FinishAppear(struct Task *task)
|
||||
task->tSinIndex += 8;
|
||||
task->tAmplitude -= 256;
|
||||
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude >> 8, DISPLAY_HEIGHT);
|
||||
|
||||
if (task->tAmplitude <= 0)
|
||||
{
|
||||
@ -4253,7 +4253,7 @@ static bool8 FrontierLogoWiggle_SetGfx(struct Task *task)
|
||||
|
||||
GetBg0TilesDst(&tilemap, &tileset);
|
||||
LZ77UnCompVram(sFrontierLogo_Tilemap, tilemap);
|
||||
SetSinWave(gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
SetSinWave((s16*)gScanlineEffectRegBuffers[0], 0, task->tSinIndex, 132, task->tAmplitude, DISPLAY_HEIGHT);
|
||||
|
||||
task->tState++;
|
||||
return TRUE;
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -52,7 +52,6 @@ static void ZMoveSelectionDisplayPpNumber(u32 battler);
|
||||
static void ZMoveSelectionDisplayPower(u16 move, u16 zMove);
|
||||
static void ShowZMoveTriggerSprite(u8 battleId);
|
||||
static bool32 AreStatsMaxed(u8 battler, u8 n);
|
||||
static u8 GetZMoveScore(u8 battlerAtk, u8 battlerDef, u16 baseMove, u16 zMove);
|
||||
static void ZMoveSelectionDisplayMoveType(u16 zMove, u32 battler);
|
||||
|
||||
// Const Data
|
||||
@ -158,15 +157,10 @@ void QueueZMove(u8 battler, u16 baseMove)
|
||||
|
||||
bool32 IsViableZMove(u8 battler, u16 move)
|
||||
{
|
||||
struct Pokemon *mon;
|
||||
u8 battlerPosition = GetBattlerPosition(battler);
|
||||
u8 partnerPosition = GetBattlerPosition(BATTLE_PARTNER(battler));
|
||||
u32 item;
|
||||
u16 holdEffect;
|
||||
u16 species;
|
||||
int moveSlotIndex;
|
||||
|
||||
species = gBattleMons[battler].species;
|
||||
item = gBattleMons[battler].item;
|
||||
|
||||
for (moveSlotIndex = 0; moveSlotIndex < MAX_MON_MOVES; moveSlotIndex++)
|
||||
@ -236,6 +230,8 @@ bool32 TryChangeZIndicator(u8 battler, u8 moveIndex)
|
||||
HideZMoveTriggerSprite(); // Was a viable z move, now is not -> slide out
|
||||
else if (!gBattleStruct->zmove.viable && viableZMove)
|
||||
ShowZMoveTriggerSprite(battler); // Was not a viable z move, now is -> slide back in
|
||||
|
||||
return viableZMove;
|
||||
}
|
||||
|
||||
#define SINGLES_Z_TRIGGER_POS_X_OPTIMAL (29)
|
||||
@ -267,7 +263,7 @@ void CreateZMoveTriggerSprite(u8 battler, bool8 viable)
|
||||
else
|
||||
{
|
||||
x = gSprites[gHealthboxSpriteIds[battler]].x - SINGLES_Z_TRIGGER_POS_X_SLIDE;
|
||||
y = gSprites[gHealthboxSpriteIds[battler]].y - SINGLES_Z_TRIGGER_POS_Y_DIFF, 0;
|
||||
y = gSprites[gHealthboxSpriteIds[battler]].y - SINGLES_Z_TRIGGER_POS_Y_DIFF;
|
||||
}
|
||||
|
||||
if (gBattleStruct->zmove.triggerSpriteId == 0xFF)
|
||||
@ -350,7 +346,6 @@ void HideZMoveTriggerSprite(void)
|
||||
|
||||
static void ShowZMoveTriggerSprite(u8 battler)
|
||||
{
|
||||
struct Sprite *sprite = &gSprites[gBattleStruct->zmove.triggerSpriteId];
|
||||
gBattleStruct->zmove.viable = TRUE;
|
||||
CreateZMoveTriggerSprite(battler, TRUE);
|
||||
}
|
||||
@ -535,13 +530,11 @@ static void ZMoveSelectionDisplayPower(u16 move, u16 zMove)
|
||||
static void ZMoveSelectionDisplayPpNumber(u32 battler)
|
||||
{
|
||||
u8 *txtPtr;
|
||||
struct ChooseMoveStruct *moveInfo;
|
||||
|
||||
if (gBattleResources->bufferA[battler][2] == TRUE) // Check if we didn't want to display pp number
|
||||
return;
|
||||
|
||||
SetPpNumbersPaletteInMoveSelection(battler);
|
||||
moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[battler][4]);
|
||||
txtPtr = ConvertIntToDecimalStringN(gDisplayedStringBattle, 1, STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||
*(txtPtr)++ = CHAR_SLASH;
|
||||
ConvertIntToDecimalStringN(txtPtr, 1, STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||
@ -551,7 +544,6 @@ static void ZMoveSelectionDisplayPpNumber(u32 battler)
|
||||
static void ZMoveSelectionDisplayMoveType(u16 zMove, u32 battler)
|
||||
{
|
||||
u8 *txtPtr;
|
||||
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[battler][4]);
|
||||
u8 zMoveType;
|
||||
|
||||
GET_MOVE_TYPE(zMove, zMoveType);
|
||||
|
||||
10
src/berry.c
10
src/berry.c
@ -1825,8 +1825,8 @@ bool8 PlayerHasBerries(void)
|
||||
// For all berry trees on screen, allow normal growth
|
||||
void SetBerryTreesSeen(void)
|
||||
{
|
||||
s16 cam_left;
|
||||
s16 cam_top;
|
||||
u16 cam_left;
|
||||
u16 cam_top;
|
||||
s16 left;
|
||||
s16 top;
|
||||
s16 right;
|
||||
@ -1842,9 +1842,9 @@ void SetBerryTreesSeen(void)
|
||||
{
|
||||
if (gObjectEvents[i].active && gObjectEvents[i].movementType == MOVEMENT_TYPE_BERRY_TREE_GROWTH)
|
||||
{
|
||||
cam_left = gObjectEvents[i].currentCoords.x;
|
||||
cam_top = gObjectEvents[i].currentCoords.y;
|
||||
if (left <= cam_left && cam_left <= right && top <= cam_top && cam_top <= bottom)
|
||||
s16 x = gObjectEvents[i].currentCoords.x;
|
||||
s16 y = gObjectEvents[i].currentCoords.y;
|
||||
if (left <= x && x <= right && top <= y && y <= bottom)
|
||||
AllowBerryTreeGrowth(gObjectEvents[i].trainerRange_berryTreeId);
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,8 +174,8 @@ struct BerryBlender
|
||||
u16 progressBarValue;
|
||||
u16 maxProgressBarValue;
|
||||
u16 centerScale;
|
||||
u16 bg_X;
|
||||
u16 bg_Y;
|
||||
s16 bg_X;
|
||||
s16 bg_Y;
|
||||
u8 opponentTaskIds[BLENDER_MAX_PLAYERS - 1];
|
||||
u8 perfectOpponents; // for debugging, NPCs will always hit Best
|
||||
u16 scores[BLENDER_MAX_PLAYERS][NUM_SCORE_TYPES];
|
||||
|
||||
@ -5296,7 +5296,6 @@ static u16 SanitizeSpecies(u16 species)
|
||||
|
||||
static void SetMoveSpecificAnimData(u8 contestant)
|
||||
{
|
||||
s32 i;
|
||||
u16 move = SanitizeMove(eContestantStatus[contestant].currMove);
|
||||
u16 species = SanitizeSpecies(gContestMons[contestant].species);
|
||||
u8 targetContestant;
|
||||
|
||||
@ -4078,11 +4078,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
||||
|
||||
[MOVE_HIDDEN_POWER] =
|
||||
{
|
||||
#if B_HIDDEN_POWER_DMG >= GEN_6
|
||||
.power = 60,
|
||||
#else
|
||||
.power = 1,
|
||||
#endif
|
||||
.power = B_HIDDEN_POWER_DMG >= GEN_6 ? 60 : 1,
|
||||
.effect = EFFECT_HIDDEN_POWER,
|
||||
.type = TYPE_NORMAL,
|
||||
.accuracy = 100,
|
||||
@ -13813,6 +13809,68 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_Z] =
|
||||
.zMoveEffect = Z_EFFECT_NONE,
|
||||
},
|
||||
|
||||
[MOVE_BLOOD_MOON] =
|
||||
{
|
||||
.effect = EFFECT_GIGATON_HAMMER,
|
||||
.power = 140,
|
||||
.type = TYPE_NORMAL,
|
||||
.accuracy = 100,
|
||||
.pp = 5,
|
||||
.secondaryEffectChance = 0,
|
||||
.target = MOVE_TARGET_SELECTED,
|
||||
.priority = 0,
|
||||
.split = SPLIT_SPECIAL,
|
||||
.zMoveEffect = Z_EFFECT_NONE,
|
||||
},
|
||||
|
||||
[MOVE_MATCHA_GOTCHA] =
|
||||
{
|
||||
.effect = EFFECT_MATCHA_GOTCHA,
|
||||
.power = 80,
|
||||
.type = TYPE_GRASS,
|
||||
.accuracy = 90,
|
||||
.pp = 15,
|
||||
.secondaryEffectChance = 20,
|
||||
.target = MOVE_TARGET_BOTH,
|
||||
.priority = 0,
|
||||
.split = SPLIT_SPECIAL,
|
||||
.zMoveEffect = Z_EFFECT_NONE,
|
||||
.thawsUser = TRUE,
|
||||
.metronomeBanned = TRUE,
|
||||
},
|
||||
|
||||
[MOVE_SYRUP_BOMB] =
|
||||
{
|
||||
.effect = EFFECT_SYRUP_BOMB,
|
||||
.power = 60,
|
||||
.type = TYPE_GRASS,
|
||||
.accuracy = 85,
|
||||
.pp = 10,
|
||||
.secondaryEffectChance = 100, // syrup bomb volatile status
|
||||
.target = MOVE_TARGET_SELECTED,
|
||||
.priority = 0,
|
||||
.split = SPLIT_SPECIAL,
|
||||
.zMoveEffect = Z_EFFECT_NONE,
|
||||
.ballisticMove = TRUE,
|
||||
.metronomeBanned = TRUE,
|
||||
},
|
||||
|
||||
[MOVE_IVY_CUDGEL] =
|
||||
{
|
||||
.effect = EFFECT_IVY_CUDGEL,
|
||||
.power = 100,
|
||||
.type = TYPE_GRASS,
|
||||
.accuracy = 100,
|
||||
.pp = 10,
|
||||
.secondaryEffectChance = 0,
|
||||
.target = MOVE_TARGET_SELECTED,
|
||||
.priority = 0,
|
||||
.split = SPLIT_PHYSICAL,
|
||||
.zMoveEffect = Z_EFFECT_NONE,
|
||||
.highCritRatio = TRUE,
|
||||
.metronomeBanned = TRUE,
|
||||
},
|
||||
|
||||
// Z-Moves
|
||||
[MOVE_BREAKNECK_BLITZ] =
|
||||
{
|
||||
|
||||
@ -6066,6 +6066,14 @@ const struct ContestMove gContestMoves[MOVES_COUNT] =
|
||||
[MOVE_PSYBLADE] = {0}, // TODO
|
||||
|
||||
[MOVE_HYDRO_STEAM] = {0}, // TODO
|
||||
|
||||
[MOVE_BLOOD_MOON] = {0}, // TODO
|
||||
|
||||
[MOVE_MATCHA_GOTCHA] = {0}, // TODO
|
||||
|
||||
[MOVE_SYRUP_BOMB] = {0}, // TODO
|
||||
|
||||
[MOVE_IVY_CUDGEL] = {0}, // TODO
|
||||
};
|
||||
|
||||
const struct ContestEffect gContestEffects[] =
|
||||
|
||||
@ -6089,6 +6089,7 @@ const u8 gMonIcon_PikachuUnovaCap[] = INCBIN_U8("graphics/pokemon/pikachu/unova_
|
||||
const u8 gMonIcon_PikachuKalosCap[] = INCBIN_U8("graphics/pokemon/pikachu/kalos_cap/icon.4bpp");
|
||||
const u8 gMonIcon_PikachuAlolaCap[] = INCBIN_U8("graphics/pokemon/pikachu/alola_cap/icon.4bpp");
|
||||
const u8 gMonIcon_PikachuPartnerCap[] = INCBIN_U8("graphics/pokemon/pikachu/partner_cap/icon.4bpp");
|
||||
const u8 gMonIcon_PikachuWorldCap[] = INCBIN_U8("graphics/pokemon/pikachu/world_cap/icon.4bpp");
|
||||
const u8 gMonIcon_PichuSpikyEared[] = INCBIN_U8("graphics/pokemon/pichu/spiky_eared/icon.4bpp");
|
||||
const u8 gMonIcon_UnownB[] = INCBIN_U8("graphics/pokemon/unown/b/icon.4bpp");
|
||||
const u8 gMonIcon_UnownC[] = INCBIN_U8("graphics/pokemon/unown/c/icon.4bpp");
|
||||
|
||||
@ -844,6 +844,21 @@ const u32 *const gItemIconTable[ITEMS_COUNT + 1][2] =
|
||||
[ITEM_LINKING_CORD] = {gItemIcon_LinkingCord, gItemIconPalette_LinkingCord},
|
||||
[ITEM_PEAT_BLOCK] = {gItemIcon_PeatBlock, gItemIconPalette_PeatBlock},
|
||||
[ITEM_BERSERK_GENE] = {gItemIcon_BerserkGene, gItemIconPalette_BerserkGene},
|
||||
[ITEM_FAIRY_FEATHER] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_FairyFeather, gItemIconPalette_FairyFeather},
|
||||
[ITEM_SYRUPY_APPLE] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_SyrupyApple, gItemIconPalette_SyrupyApple},
|
||||
[ITEM_UNREMARKABLE_TEACUP] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_UnremarkableTeacup, gItemIconPalette_UnremarkableTeacup},
|
||||
[ITEM_MASTERPIECE_TEACUP] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_MasterpieceTeacup, gItemIconPalette_MasterpieceTeacup},
|
||||
[ITEM_CORNERSTONE_MASK] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_CornerstoneMask, gItemIconPalette_CornerstoneMask},
|
||||
[ITEM_WELLSPRING_MASK] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_WellspringMask, gItemIconPalette_WellspringMask},
|
||||
[ITEM_HEARTHFLAME_MASK] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_HearthflameMask, gItemIconPalette_HearthflameMask},
|
||||
[ITEM_HEALTH_MOCHI] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_Mochi, gItemIconPalette_HealthMochi},
|
||||
[ITEM_MUSCLE_MOCHI] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_Mochi, gItemIconPalette_MuscleMochi},
|
||||
[ITEM_RESIST_MOCHI] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_Mochi, gItemIconPalette_ResistMochi},
|
||||
[ITEM_GENIUS_MOCHI] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_Mochi, gItemIconPalette_GeniusMochi},
|
||||
[ITEM_CLEVER_MOCHI] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_Mochi, gItemIconPalette_CleverMochi},
|
||||
[ITEM_SWIFT_MOCHI] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_Mochi, gItemIconPalette_SwiftMochi},
|
||||
[ITEM_FRESH_START_MOCHI] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_Mochi, gItemIconPalette_FreshStartMochi},
|
||||
[ITEM_GLIMMERING_CHARM] = {gItemIcon_QuestionMark, gItemIconPalette_QuestionMark}, // {gItemIcon_GlimmeringCharm, gItemIconPalette_GlimmeringCharm},
|
||||
// Return to field arrow
|
||||
[ITEMS_COUNT] = {gItemIcon_ReturnToFieldArrow, gItemIconPalette_ReturnToFieldArrow},
|
||||
};
|
||||
|
||||
176
src/data/items.h
176
src/data/items.h
@ -4844,11 +4844,7 @@ const struct Item gItems[] =
|
||||
.name = _("Soul Dew"),
|
||||
.price = 0,
|
||||
.holdEffect = HOLD_EFFECT_SOUL_DEW,
|
||||
#if B_SOUL_DEW_BOOST >= GEN_7
|
||||
.holdEffectParam = 20,
|
||||
#else
|
||||
.holdEffectParam = 50,
|
||||
#endif
|
||||
.holdEffectParam = B_SOUL_DEW_BOOST >= GEN_7 ? 20 : 50,
|
||||
.description = sSoulDewDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_BAG_MENU,
|
||||
@ -9649,4 +9645,174 @@ const struct Item gItems[] =
|
||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_FAIRY_FEATHER] =
|
||||
{
|
||||
.name = _("Fairy Feather"),
|
||||
.price = 1000,
|
||||
.holdEffect = HOLD_EFFECT_FAIRY_POWER,
|
||||
.holdEffectParam = TYPE_BOOST_PARAM,
|
||||
.description = sFairyFeatherDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_BAG_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
||||
.flingPower = 10,
|
||||
},
|
||||
|
||||
[ITEM_SYRUPY_APPLE] =
|
||||
{
|
||||
.name = _("Syrupy Apple"),
|
||||
.price = 2200,
|
||||
.description = sSyrupyAppleDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_EvolutionStone,
|
||||
.flingPower = 30,
|
||||
},
|
||||
|
||||
[ITEM_UNREMARKABLE_TEACUP] =
|
||||
{
|
||||
.name = _("UnrmkblTeacup"),
|
||||
.price = 1600,
|
||||
.description = sUnremarkableTeacupDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_EvolutionStone,
|
||||
.flingPower = 80,
|
||||
},
|
||||
|
||||
[ITEM_MASTERPIECE_TEACUP] =
|
||||
{
|
||||
.name = _("MstrpceTeacup"),
|
||||
.price = 38000,
|
||||
.description = sMasterpieceTeacupDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_EvolutionStone,
|
||||
.flingPower = 80,
|
||||
},
|
||||
|
||||
[ITEM_CORNERSTONE_MASK] =
|
||||
{
|
||||
.name = _("CornrstneMask"),
|
||||
.price = 0,
|
||||
.holdEffect = HOLD_EFFECT_MASK,
|
||||
.description = sCornerstoneMaskDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_BAG_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
||||
.secondaryId = TYPE_ROCK,
|
||||
},
|
||||
|
||||
[ITEM_WELLSPRING_MASK] =
|
||||
{
|
||||
.name = _("WellsprngMask"),
|
||||
.price = 0,
|
||||
.holdEffect = HOLD_EFFECT_MASK,
|
||||
.description = sWellspringMaskDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_BAG_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
||||
.secondaryId = TYPE_WATER,
|
||||
},
|
||||
|
||||
[ITEM_HEARTHFLAME_MASK] =
|
||||
{
|
||||
.name = _("HrthflameMask"),
|
||||
.price = 0,
|
||||
.holdEffect = HOLD_EFFECT_MASK,
|
||||
.description = sHearthflameMaskDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_BAG_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
||||
.secondaryId = TYPE_FIRE,
|
||||
},
|
||||
|
||||
[ITEM_HEALTH_MOCHI] =
|
||||
{
|
||||
.name = _("Health Mochi"),
|
||||
.price = 500,
|
||||
.description = sHealthMochiDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_Medicine,
|
||||
.flingPower = 30,
|
||||
},
|
||||
|
||||
[ITEM_MUSCLE_MOCHI] =
|
||||
{
|
||||
.name = _("Muscle Mochi"),
|
||||
.price = 500,
|
||||
.description = sMuscleMochiDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_Medicine,
|
||||
.flingPower = 30,
|
||||
},
|
||||
|
||||
[ITEM_RESIST_MOCHI] =
|
||||
{
|
||||
.name = _("Resist Mochi"),
|
||||
.price = 500,
|
||||
.description = sResistMochiDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_Medicine,
|
||||
.flingPower = 30,
|
||||
},
|
||||
|
||||
[ITEM_GENIUS_MOCHI] =
|
||||
{
|
||||
.name = _("Genius Mochi"),
|
||||
.price = 500,
|
||||
.description = sGeniusMochiDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_Medicine,
|
||||
.flingPower = 30,
|
||||
},
|
||||
|
||||
[ITEM_CLEVER_MOCHI] =
|
||||
{
|
||||
.name = _("Clever Mochi"),
|
||||
.price = 500,
|
||||
.description = sCleverMochiDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_Medicine,
|
||||
.flingPower = 30,
|
||||
},
|
||||
|
||||
[ITEM_SWIFT_MOCHI] =
|
||||
{
|
||||
.name = _("Swift Mochi"),
|
||||
.price = 500,
|
||||
.description = sSwiftMochiDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_Medicine,
|
||||
.flingPower = 30,
|
||||
},
|
||||
|
||||
[ITEM_FRESH_START_MOCHI] =
|
||||
{
|
||||
.name = _("FrshStrtMochi"),
|
||||
.price = 300,
|
||||
.description = sFreshStartMochiDesc,
|
||||
.pocket = POCKET_ITEMS,
|
||||
.type = ITEM_USE_PARTY_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_ResetEVs,
|
||||
.flingPower = 30,
|
||||
},
|
||||
|
||||
[ITEM_GLIMMERING_CHARM] =
|
||||
{
|
||||
.name = _("GlmmringCharm"),
|
||||
.price = 0,
|
||||
.importance = 1,
|
||||
.description = sGlimmeringCharmDesc,
|
||||
.pocket = POCKET_KEY_ITEMS,
|
||||
.type = ITEM_USE_BAG_MENU,
|
||||
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
|
||||
},
|
||||
};
|
||||
|
||||
@ -282,6 +282,49 @@ const u8 gItemEffect_SpdefFeather[11] = {
|
||||
[10] = 0,
|
||||
};
|
||||
|
||||
const u8 gItemEffect_HpMochi[11] = {
|
||||
[4] = ITEM4_EV_HP,
|
||||
[6] = ITEM6_ADD_EV,
|
||||
[10] = 0,
|
||||
};
|
||||
|
||||
const u8 gItemEffect_AtkMochi[11] = {
|
||||
[4] = ITEM4_EV_ATK,
|
||||
[6] = ITEM6_ADD_EV,
|
||||
[10] = 0,
|
||||
};
|
||||
|
||||
const u8 gItemEffect_DefMochi[11] = {
|
||||
[5] = ITEM5_EV_DEF,
|
||||
[6] = ITEM6_ADD_EV,
|
||||
[10] = 0,
|
||||
};
|
||||
|
||||
const u8 gItemEffect_SpeedMochi[11] = {
|
||||
[5] = ITEM5_EV_SPEED,
|
||||
[6] = ITEM6_ADD_EV,
|
||||
[10] = 0,
|
||||
};
|
||||
|
||||
const u8 gItemEffect_SpatkMochi[11] = {
|
||||
[5] = ITEM5_EV_SPATK,
|
||||
[6] = ITEM6_ADD_EV,
|
||||
[10] = 0,
|
||||
};
|
||||
|
||||
const u8 gItemEffect_SpdefMochi[11] = {
|
||||
[5] = ITEM5_EV_SPDEF,
|
||||
[6] = ITEM6_ADD_EV,
|
||||
[10] = 0,
|
||||
};
|
||||
|
||||
const u8 gItemEffect_ResetMochi[11] = {
|
||||
[4] = ITEM4_EV_HP | ITEM4_EV_ATK,
|
||||
[5] = ITEM5_EV_DEF | ITEM5_EV_SPEED | ITEM5_EV_SPATK | ITEM5_EV_SPDEF,
|
||||
[6] = ITEM6_RESET_EV,
|
||||
[10] = 0,
|
||||
};
|
||||
|
||||
const u8 gItemEffect_RareCandy[10] = {
|
||||
[3] = ITEM3_LEVEL_UP,
|
||||
[4] = ITEM4_REVIVE | ITEM4_HEAL_HP,
|
||||
@ -508,6 +551,15 @@ const u8 *const gItemEffectTable[ITEMS_COUNT] =
|
||||
[ITEM_CLEVER_FEATHER] = gItemEffect_SpdefFeather,
|
||||
[ITEM_SWIFT_FEATHER] = gItemEffect_SpeedFeather,
|
||||
|
||||
//Mochi
|
||||
[ITEM_HEALTH_MOCHI] = gItemEffect_HpMochi,
|
||||
[ITEM_MUSCLE_MOCHI] = gItemEffect_AtkMochi,
|
||||
[ITEM_RESIST_MOCHI] = gItemEffect_DefMochi,
|
||||
[ITEM_GENIUS_MOCHI] = gItemEffect_SpatkMochi,
|
||||
[ITEM_CLEVER_MOCHI] = gItemEffect_SpdefMochi,
|
||||
[ITEM_SWIFT_MOCHI] = gItemEffect_SpeedMochi,
|
||||
[ITEM_FRESH_START_MOCHI] = gItemEffect_ResetMochi,
|
||||
|
||||
// Candy
|
||||
[ITEM_RARE_CANDY] = gItemEffect_RareCandy,
|
||||
[ITEM_EXP_CANDY_XS] = gItemEffect_RareCandy,
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#define LEVEL_UP_MOVE(lvl, moveLearned) {.move = moveLearned, .level = lvl}
|
||||
#define LEVEL_UP_END {.move = LEVEL_UP_MOVE_END, .level = 0}
|
||||
|
||||
static const struct LevelUpMove sBulbasaurLevelUpLearnset[] = {
|
||||
LEVEL_UP_MOVE( 1, MOVE_TACKLE),
|
||||
|
||||
@ -12036,10 +12036,10 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
{
|
||||
.baseHP = 120,
|
||||
.baseAttack = 70,
|
||||
.baseDefense = 120,
|
||||
.baseDefense = P_UPDATED_STATS >= GEN_9 ? 110 : 120,
|
||||
.baseSpeed = 85,
|
||||
.baseSpAttack = 75,
|
||||
.baseSpDefense = 130,
|
||||
.baseSpDefense = P_UPDATED_STATS >= GEN_9 ? 120 : 130,
|
||||
.types = { TYPE_PSYCHIC, TYPE_PSYCHIC},
|
||||
.catchRate = 3,
|
||||
.expYield = 270,
|
||||
@ -16972,9 +16972,9 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.friendship = STANDARD_FRIENDSHIP,
|
||||
.growthRate = GROWTH_MEDIUM_FAST,
|
||||
#if P_UPDATED_EGG_GROUPS >= GEN_8
|
||||
.eggGroups = { EGG_GROUP_MONSTER, EGG_GROUP_MONSTER},
|
||||
#else
|
||||
.eggGroups = { EGG_GROUP_MONSTER, EGG_GROUP_MINERAL},
|
||||
#else
|
||||
.eggGroups = { EGG_GROUP_MONSTER, EGG_GROUP_MONSTER},
|
||||
#endif
|
||||
.abilities = {ABILITY_OWN_TEMPO, ABILITY_ICE_BODY, ABILITY_STURDY},
|
||||
.bodyColor = BODY_COLOR_BLUE,
|
||||
@ -16998,9 +16998,9 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.friendship = STANDARD_FRIENDSHIP,
|
||||
.growthRate = GROWTH_MEDIUM_FAST,
|
||||
#if P_UPDATED_EGG_GROUPS >= GEN_8
|
||||
.eggGroups = { EGG_GROUP_MONSTER, EGG_GROUP_MONSTER},
|
||||
#else
|
||||
.eggGroups = { EGG_GROUP_MONSTER, EGG_GROUP_MINERAL},
|
||||
#else
|
||||
.eggGroups = { EGG_GROUP_MONSTER, EGG_GROUP_MONSTER},
|
||||
#endif
|
||||
.abilities = {ABILITY_OWN_TEMPO, ABILITY_ICE_BODY, ABILITY_STURDY},
|
||||
.bodyColor = BODY_COLOR_BLUE,
|
||||
@ -20653,7 +20653,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
[SPECIES_ZACIAN] =
|
||||
{
|
||||
.baseHP = 92,
|
||||
.baseAttack = 130,
|
||||
.baseAttack = P_UPDATED_STATS >= GEN_9 ? 120 : 130,
|
||||
.baseDefense = 115,
|
||||
.baseSpeed = 138,
|
||||
.baseSpAttack = 80,
|
||||
@ -20676,7 +20676,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
[SPECIES_ZAMAZENTA] =
|
||||
{
|
||||
.baseHP = 92,
|
||||
.baseAttack = 130,
|
||||
.baseAttack = P_UPDATED_STATS >= GEN_9 ? 120 : 130,
|
||||
.baseDefense = 115,
|
||||
.baseSpeed = 138,
|
||||
.baseSpAttack = 80,
|
||||
@ -20921,7 +20921,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.friendship = STANDARD_FRIENDSHIP,
|
||||
.growthRate = GROWTH_MEDIUM_FAST,
|
||||
.eggGroups = { EGG_GROUP_BUG, EGG_GROUP_BUG},
|
||||
.abilities = {ABILITY_SWARM, ABILITY_SHEER_FORCE, ABILITY_STEADFAST},
|
||||
.abilities = {ABILITY_SWARM, ABILITY_SHEER_FORCE, ABILITY_SHARPNESS},
|
||||
.bodyColor = BODY_COLOR_BROWN,
|
||||
.noFlip = FALSE,
|
||||
},
|
||||
@ -21010,7 +21010,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.friendship = 35,
|
||||
.growthRate = GROWTH_MEDIUM_SLOW,
|
||||
.eggGroups = { EGG_GROUP_FIELD, EGG_GROUP_FIELD},
|
||||
.abilities = {ABILITY_PRESSURE, ABILITY_NONE, ABILITY_POISON_TOUCH},
|
||||
.abilities = {ABILITY_PRESSURE, ABILITY_UNBURDEN, ABILITY_POISON_TOUCH},
|
||||
.bodyColor = BODY_COLOR_BLUE,
|
||||
.noFlip = FALSE,
|
||||
},
|
||||
@ -23130,7 +23130,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_INTIMIDATE, ABILITY_FLASH_FIRE, ABILITY_ROCK_HEAD},
|
||||
.bodyColor = BODY_COLOR_BROWN,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
[SPECIES_ARCANINE_HISUIAN] =
|
||||
@ -23153,7 +23153,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_INTIMIDATE, ABILITY_FLASH_FIRE, ABILITY_ROCK_HEAD},
|
||||
.bodyColor = BODY_COLOR_BROWN,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
[SPECIES_VOLTORB_HISUIAN] =
|
||||
@ -23176,7 +23176,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_SOUNDPROOF, ABILITY_STATIC, ABILITY_AFTERMATH},
|
||||
.bodyColor = BODY_COLOR_RED,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
[SPECIES_ELECTRODE_HISUIAN] =
|
||||
@ -23199,7 +23199,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_SOUNDPROOF, ABILITY_STATIC, ABILITY_AFTERMATH},
|
||||
.bodyColor = BODY_COLOR_RED,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
[SPECIES_TYPHLOSION_HISUIAN] =
|
||||
@ -23222,7 +23222,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_BLAZE, ABILITY_NONE, ABILITY_FRISK},
|
||||
.bodyColor = BODY_COLOR_YELLOW,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
[SPECIES_QWILFISH_HISUIAN] =
|
||||
@ -23237,7 +23237,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.catchRate = 45,
|
||||
.expYield = 88,
|
||||
.evYield_Attack = 1,
|
||||
.itemRare = ITEM_POISON_BARB,
|
||||
.itemRare = ITEM_POISON_BARB,
|
||||
.genderRatio = PERCENT_FEMALE(50),
|
||||
.eggCycles = 20,
|
||||
.friendship = STANDARD_FRIENDSHIP,
|
||||
@ -23246,7 +23246,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_POISON_POINT, ABILITY_SWIFT_SWIM, ABILITY_INTIMIDATE},
|
||||
.bodyColor = BODY_COLOR_GRAY,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
[SPECIES_SNEASEL_HISUIAN] =
|
||||
@ -23267,10 +23267,10 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.friendship = 35,
|
||||
.growthRate = GROWTH_MEDIUM_SLOW,
|
||||
.eggGroups = { EGG_GROUP_FIELD, EGG_GROUP_FIELD},
|
||||
.abilities = {ABILITY_INNER_FOCUS, ABILITY_KEEN_EYE, ABILITY_POISON_TOUCH},
|
||||
.abilities = {ABILITY_INNER_FOCUS, ABILITY_KEEN_EYE, ABILITY_PICKPOCKET},
|
||||
.bodyColor = BODY_COLOR_BLACK,
|
||||
.noFlip = TRUE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
#if P_GEN_5_POKEMON == TRUE
|
||||
@ -23294,7 +23294,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_TORRENT, ABILITY_NONE, ABILITY_SHARPNESS},
|
||||
.bodyColor = BODY_COLOR_BLUE,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
[SPECIES_LILLIGANT_HISUIAN] =
|
||||
@ -23318,7 +23318,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_CHLOROPHYLL, ABILITY_HUSTLE, ABILITY_LEAF_GUARD},
|
||||
.bodyColor = BODY_COLOR_GREEN,
|
||||
.noFlip = TRUE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
[SPECIES_ZORUA_HISUIAN] =
|
||||
@ -23341,7 +23341,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_ILLUSION, ABILITY_NONE},
|
||||
.bodyColor = BODY_COLOR_GRAY,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
[SPECIES_ZOROARK_HISUIAN] =
|
||||
@ -23364,7 +23364,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_ILLUSION, ABILITY_NONE},
|
||||
.bodyColor = BODY_COLOR_GRAY,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
[SPECIES_BRAVIARY_HISUIAN] =
|
||||
@ -23387,7 +23387,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_KEEN_EYE, ABILITY_SHEER_FORCE, ABILITY_TINTED_LENS},
|
||||
.bodyColor = BODY_COLOR_RED,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
#endif
|
||||
|
||||
@ -23413,7 +23413,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_SAP_SIPPER, ABILITY_SHELL_ARMOR, ABILITY_GOOEY},
|
||||
.bodyColor = BODY_COLOR_PURPLE,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
[SPECIES_GOODRA_HISUIAN] =
|
||||
@ -23436,7 +23436,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_SAP_SIPPER, ABILITY_SHELL_ARMOR, ABILITY_GOOEY},
|
||||
.bodyColor = BODY_COLOR_PURPLE,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
|
||||
[SPECIES_AVALUGG_HISUIAN] =
|
||||
@ -23459,7 +23459,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_STRONG_JAW, ABILITY_ICE_BODY, ABILITY_STURDY},
|
||||
.bodyColor = BODY_COLOR_BLUE,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
#endif
|
||||
|
||||
@ -23484,7 +23484,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
.abilities = {ABILITY_OVERGROW, ABILITY_NONE, ABILITY_SCRAPPY},
|
||||
.bodyColor = BODY_COLOR_BROWN,
|
||||
.noFlip = FALSE,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
.flags = SPECIES_FLAG_HISUIAN_FORM,
|
||||
},
|
||||
#endif
|
||||
|
||||
@ -24586,7 +24586,7 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
[SPECIES_ZACIAN_CROWNED_SWORD] =
|
||||
{
|
||||
.baseHP = 92,
|
||||
.baseAttack = 170,
|
||||
.baseAttack = P_UPDATED_STATS >= GEN_9 ? 150 : 170,
|
||||
.baseDefense = 115,
|
||||
.baseSpeed = 148,
|
||||
.baseSpAttack = 80,
|
||||
@ -24609,11 +24609,11 @@ const struct SpeciesInfo gSpeciesInfo[] =
|
||||
[SPECIES_ZAMAZENTA_CROWNED_SHIELD] =
|
||||
{
|
||||
.baseHP = 92,
|
||||
.baseAttack = 130,
|
||||
.baseDefense = 145,
|
||||
.baseAttack = P_UPDATED_STATS >= GEN_9 ? 120 : 130,
|
||||
.baseDefense = P_UPDATED_STATS >= GEN_9 ? 140 : 145,
|
||||
.baseSpeed = 128,
|
||||
.baseSpAttack = 80,
|
||||
.baseSpDefense = 145,
|
||||
.baseSpDefense = P_UPDATED_STATS >= GEN_9 ? 140 : 145,
|
||||
.types = { TYPE_FIGHTING, TYPE_STEEL},
|
||||
.catchRate = 10,
|
||||
.expYield = 360,
|
||||
|
||||
@ -289,6 +289,14 @@ static const u8 sToxicDebrisDescription[] = _("Throws poison spikes if hit.");
|
||||
static const u8 sArmorTailDescription[] = _("Protects from priority.");
|
||||
static const u8 sEarthEaterDescription[] = _("Eats ground to heal HP.");
|
||||
static const u8 sMyceliumMightDescription[] = _("Status moves never fail.");
|
||||
static const u8 sHospitalityDescription[] = _("Restores ally's HP.");
|
||||
static const u8 sMindsEyeDescription[] = _("Keen Eye and Scrappy.");
|
||||
static const u8 sEmbodyAspectTealDescription[] = _("Raises Speed.");
|
||||
static const u8 sEmbodyAspectHearthflameDescription[] = _("Raises Attack.");
|
||||
static const u8 sEmbodyAspectWellspringDescription[] = _("Raises Sp. Def.");
|
||||
static const u8 sEmbodyAspectCornerstoneDescription[] = _("Raises Defense.");
|
||||
static const u8 sToxicChainDescription[] = _("Moves can poison.");
|
||||
static const u8 sSupersweetSyrupDescription[] = _("Lowers the foe's Speed.");
|
||||
|
||||
#if B_EXPANDED_ABILITY_NAMES == TRUE
|
||||
const u8 gAbilityNames[ABILITIES_COUNT][ABILITY_NAME_LENGTH + 1] =
|
||||
@ -592,6 +600,14 @@ const u8 gAbilityNames[ABILITIES_COUNT][ABILITY_NAME_LENGTH + 1] =
|
||||
[ABILITY_ARMOR_TAIL] = _("Armor Tail"),
|
||||
[ABILITY_EARTH_EATER] = _("Earth Eater"),
|
||||
[ABILITY_MYCELIUM_MIGHT] = _("Mycelium Might"),
|
||||
[ABILITY_HOSPITALITY] = _("Hospitality"),
|
||||
[ABILITY_MINDS_EYE] = _("Mind's Eye"),
|
||||
[ABILITY_EMBODY_ASPECT_TEAL] = _("Embody Aspect"),
|
||||
[ABILITY_EMBODY_ASPECT_HEARTHFLAME] = _("Embody Aspect"),
|
||||
[ABILITY_EMBODY_ASPECT_WELLSPRING] = _("Embody Aspect"),
|
||||
[ABILITY_EMBODY_ASPECT_CORNERSTONE] = _("Embody Aspect"),
|
||||
[ABILITY_TOXIC_CHAIN] = _("Toxic Chain"),
|
||||
[ABILITY_SUPERSWEET_SYRUP] = _("Supersweet Syrup"),
|
||||
};
|
||||
#else // 12 characters
|
||||
const u8 gAbilityNames[ABILITIES_COUNT][ABILITY_NAME_LENGTH + 1] =
|
||||
@ -895,6 +911,14 @@ const u8 gAbilityNames[ABILITIES_COUNT][ABILITY_NAME_LENGTH + 1] =
|
||||
[ABILITY_ARMOR_TAIL] = _("Armor Tail"),
|
||||
[ABILITY_EARTH_EATER] = _("Earth Eater"),
|
||||
[ABILITY_MYCELIUM_MIGHT] = _("MceliumMight"),
|
||||
[ABILITY_HOSPITALITY] = _("Hospitality"),
|
||||
[ABILITY_MINDS_EYE] = _("Mind's Eye"),
|
||||
[ABILITY_EMBODY_ASPECT_TEAL] = _("EmbodyAspect"),
|
||||
[ABILITY_EMBODY_ASPECT_HEARTHFLAME] = _("EmbodyAspect"),
|
||||
[ABILITY_EMBODY_ASPECT_WELLSPRING] = _("EmbodyAspect"),
|
||||
[ABILITY_EMBODY_ASPECT_CORNERSTONE] = _("EmbodyAspect"),
|
||||
[ABILITY_TOXIC_CHAIN] = _("Toxic Chain"),
|
||||
[ABILITY_SUPERSWEET_SYRUP] = _("SuprswtSyrup"),
|
||||
};
|
||||
#endif
|
||||
|
||||
@ -1199,4 +1223,12 @@ const u8 *const gAbilityDescriptionPointers[ABILITIES_COUNT] =
|
||||
[ABILITY_ARMOR_TAIL] = sArmorTailDescription,
|
||||
[ABILITY_EARTH_EATER] = sEarthEaterDescription,
|
||||
[ABILITY_MYCELIUM_MIGHT] = sMyceliumMightDescription,
|
||||
[ABILITY_HOSPITALITY] = sHospitalityDescription,
|
||||
[ABILITY_MINDS_EYE] = sMindsEyeDescription,
|
||||
[ABILITY_EMBODY_ASPECT_TEAL] = sEmbodyAspectTealDescription,
|
||||
[ABILITY_EMBODY_ASPECT_HEARTHFLAME] = sEmbodyAspectHearthflameDescription,
|
||||
[ABILITY_EMBODY_ASPECT_WELLSPRING] = sEmbodyAspectWellspringDescription,
|
||||
[ABILITY_EMBODY_ASPECT_CORNERSTONE] = sEmbodyAspectCornerstoneDescription,
|
||||
[ABILITY_TOXIC_CHAIN] = sToxicChainDescription,
|
||||
[ABILITY_SUPERSWEET_SYRUP] = sSupersweetSyrupDescription,
|
||||
};
|
||||
|
||||
@ -3918,3 +3918,78 @@ static const u8 sBerserkGene[] = _(
|
||||
"Sharply boosts\n"
|
||||
"Attack, but causes\n"
|
||||
"lasting confusion.");
|
||||
|
||||
static const u8 sFairyFeatherDesc[] = _(
|
||||
"A hold item that\n"
|
||||
"raises the power of\n"
|
||||
"Fairy-type moves.");
|
||||
|
||||
static const u8 sSyrupyAppleDesc[] = _(
|
||||
"A very syrupy apple\n"
|
||||
"that makes certain\n"
|
||||
"Pokémon evolve.");
|
||||
|
||||
static const u8 sUnremarkableTeacupDesc[] = _(
|
||||
"A cracked teacup\n"
|
||||
"that makes certain\n"
|
||||
"Pokémon evolve.");
|
||||
|
||||
static const u8 sMasterpieceTeacupDesc[] = _(
|
||||
"A chipped teacup\n"
|
||||
"that makes certain\n"
|
||||
"Pokémon evolve.");
|
||||
|
||||
static const u8 sCornerstoneMaskDesc[] = _(
|
||||
"Allows Ogerpon to\n"
|
||||
"wield the Rock-\n"
|
||||
"type in battle.");
|
||||
|
||||
static const u8 sWellspringMaskDesc[] = _(
|
||||
"Allows Ogerpon to\n"
|
||||
"wield the Water-\n"
|
||||
"type in battle.");
|
||||
|
||||
static const u8 sHearthflameMaskDesc[] = _(
|
||||
"Allows Ogerpon to\n"
|
||||
"wield the Fire-\n"
|
||||
"type in battle.");
|
||||
|
||||
static const u8 sHealthMochiDesc[] = _(
|
||||
"An item that raises\n"
|
||||
"the base HP of\n"
|
||||
"a Pokémon.");
|
||||
|
||||
static const u8 sMuscleMochiDesc[] = _(
|
||||
"An item that raises\n"
|
||||
"the base Attack of\n"
|
||||
"a Pokémon.");
|
||||
|
||||
static const u8 sResistMochiDesc[] = _(
|
||||
"An item that raises\n"
|
||||
"the base Defense\n"
|
||||
"of a Pokémon.");
|
||||
|
||||
static const u8 sGeniusMochiDesc[] = _(
|
||||
"An item that raises\n"
|
||||
"the base Sp. Atk.\n"
|
||||
"of a Pokémon.");
|
||||
|
||||
static const u8 sCleverMochiDesc[] = _(
|
||||
"An item that raises\n"
|
||||
"the base Sp. Def.\n"
|
||||
"of a Pokémon.");
|
||||
|
||||
static const u8 sSwiftMochiDesc[] = _(
|
||||
"An item that raises\n"
|
||||
"the base Speed of\n"
|
||||
"a Pokémon.");
|
||||
|
||||
static const u8 sFreshStartMochiDesc[] = _(
|
||||
"An item that resets\n"
|
||||
"all base points of\n"
|
||||
"a Pokémon.");
|
||||
|
||||
static const u8 sGlimmeringCharmDesc[] = _(
|
||||
"A charm that will\n"
|
||||
"raise the shards\n"
|
||||
"from Tera Raids.");
|
||||
|
||||
@ -3260,6 +3260,22 @@ static const u8 sHydroSteamDescription[] = _(
|
||||
"This move's power increases\n"
|
||||
"under harsh sunlight.");
|
||||
|
||||
static const u8 sBloodMoonDescription[] = _(
|
||||
"Unleashes the blood moon.\n"
|
||||
"Can't be used twice in a row.");
|
||||
|
||||
static const u8 sMatchaGotchaDescription[] = _(
|
||||
"Absorbs half the damage\n"
|
||||
"inflicted. May cause a burn.");
|
||||
|
||||
static const u8 sSyrupBombDescription[] = _(
|
||||
"Lowers the foe's speed\n"
|
||||
"each turn for 3 turns.");
|
||||
|
||||
static const u8 sIvyCudgelDescription[] = _(
|
||||
"Type changes with held mask.\n"
|
||||
"High critical-hit ratio.");
|
||||
|
||||
const u8 gNotDoneYetDescription[] = _(
|
||||
"This move can't be used. Its\n"
|
||||
"effect is in development.");
|
||||
@ -4099,4 +4115,8 @@ const u8 *const gMoveDescriptionPointers[MOVES_COUNT - 1] =
|
||||
[MOVE_MAGICAL_TORQUE - 1] = sMagicalTorqueDescription,
|
||||
[MOVE_PSYBLADE - 1] = sPsybladeDescription,
|
||||
[MOVE_HYDRO_STEAM - 1] = sHydroSteamDescription,
|
||||
[MOVE_BLOOD_MOON - 1] = sBloodMoonDescription,
|
||||
[MOVE_MATCHA_GOTCHA - 1] = sMatchaGotchaDescription,
|
||||
[MOVE_SYRUP_BOMB - 1] = sSyrupBombDescription,
|
||||
[MOVE_IVY_CUDGEL - 1] = sIvyCudgelDescription,
|
||||
};
|
||||
|
||||
@ -831,6 +831,10 @@ const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1] =
|
||||
[MOVE_MAGICAL_TORQUE] = _("Magical Torque"),
|
||||
[MOVE_PSYBLADE] = _("Psyblade"),
|
||||
[MOVE_HYDRO_STEAM] = _("Hydro Steam"),
|
||||
[MOVE_BLOOD_MOON] = _("Blood Moon"),
|
||||
[MOVE_MATCHA_GOTCHA] = _("Matcha Gotcha"),
|
||||
[MOVE_SYRUP_BOMB] = _("Syrup Bomb"),
|
||||
[MOVE_IVY_CUDGEL] = _("Ivy Cudgel"),
|
||||
};
|
||||
#else
|
||||
// 12 letters
|
||||
@ -1665,6 +1669,10 @@ const u8 gMoveNames[MOVES_COUNT][MOVE_NAME_LENGTH + 1] =
|
||||
[MOVE_MAGICAL_TORQUE] = _("MagiclTorque"),
|
||||
[MOVE_PSYBLADE] = _("Psyblade"),
|
||||
[MOVE_HYDRO_STEAM] = _("Hydro Steam"),
|
||||
[MOVE_BLOOD_MOON] = _("Blood Moon"),
|
||||
[MOVE_MATCHA_GOTCHA] = _("MatchaGotcha"),
|
||||
[MOVE_SYRUP_BOMB] = _("Syrup Bomb"),
|
||||
[MOVE_IVY_CUDGEL] = _("Ivy Cudgel"),
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@ -952,11 +952,12 @@ void RejectEggFromDayCare(void)
|
||||
RemoveEggFromDayCare(&gSaveBlock1Ptr->daycare);
|
||||
}
|
||||
|
||||
|
||||
static const struct {
|
||||
u16 currSpecies;
|
||||
u16 item;
|
||||
u16 babySpecies;
|
||||
} IncenseBabyTable[][3] =
|
||||
} sIncenseBabyTable[] =
|
||||
{
|
||||
// Regular offspring, Item, Incense Offspring
|
||||
{ SPECIES_WOBBUFFET, ITEM_LAX_INCENSE, SPECIES_WYNAUT },
|
||||
@ -970,6 +971,7 @@ static const struct {
|
||||
{ SPECIES_MANTINE, ITEM_WAVE_INCENSE, SPECIES_MANTYKE },
|
||||
};
|
||||
|
||||
#if P_INCENSE_BREEDING < GEN_9
|
||||
static void AlterEggSpeciesWithIncenseItem(u16 *species, struct DayCare *daycare)
|
||||
{
|
||||
u32 i;
|
||||
@ -977,21 +979,22 @@ static void AlterEggSpeciesWithIncenseItem(u16 *species, struct DayCare *daycare
|
||||
motherItem = GetBoxMonData(&daycare->mons[0].mon, MON_DATA_HELD_ITEM);
|
||||
fatherItem = GetBoxMonData(&daycare->mons[1].mon, MON_DATA_HELD_ITEM);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(IncenseBabyTable); i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sIncenseBabyTable); i++)
|
||||
{
|
||||
if (IncenseBabyTable[i]->babySpecies == *species && motherItem != IncenseBabyTable[i]->item && fatherItem != IncenseBabyTable[i]->item)
|
||||
if (sIncenseBabyTable[i].babySpecies == *species && motherItem != sIncenseBabyTable[i].item && fatherItem != sIncenseBabyTable[i].item)
|
||||
{
|
||||
*species = IncenseBabyTable[i]->currSpecies;
|
||||
*species = sIncenseBabyTable[i].currSpecies;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static const struct {
|
||||
u16 offspring;
|
||||
u16 item;
|
||||
u16 move;
|
||||
} BreedingSpecialMoveItemTable[][3] =
|
||||
} sBreedingSpecialMoveItemTable[] =
|
||||
{
|
||||
// Offspring, Item, Move
|
||||
{ SPECIES_PICHU, ITEM_LIGHT_BALL, MOVE_VOLT_TACKLE },
|
||||
@ -1003,14 +1006,14 @@ static void GiveMoveIfItem(struct Pokemon *mon, struct DayCare *daycare)
|
||||
u32 motherItem = GetBoxMonData(&daycare->mons[0].mon, MON_DATA_HELD_ITEM);
|
||||
u32 fatherItem = GetBoxMonData(&daycare->mons[1].mon, MON_DATA_HELD_ITEM);
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(BreedingSpecialMoveItemTable); i++)
|
||||
for (i = 0; i < ARRAY_COUNT(sBreedingSpecialMoveItemTable); i++)
|
||||
{
|
||||
if (BreedingSpecialMoveItemTable[i]->offspring == species
|
||||
&& (motherItem == BreedingSpecialMoveItemTable[i]->item ||
|
||||
fatherItem == BreedingSpecialMoveItemTable[i]->item))
|
||||
if (sBreedingSpecialMoveItemTable[i].offspring == species
|
||||
&& (motherItem == sBreedingSpecialMoveItemTable[i].item ||
|
||||
fatherItem == sBreedingSpecialMoveItemTable[i].item))
|
||||
{
|
||||
if (GiveMoveToMon(mon, BreedingSpecialMoveItemTable[i]->move) == MON_HAS_MAX_MOVES)
|
||||
DeleteFirstMoveAndGiveMoveToMon(mon, BreedingSpecialMoveItemTable[i]->move);
|
||||
if (GiveMoveToMon(mon, sBreedingSpecialMoveItemTable[i].move) == MON_HAS_MAX_MOVES)
|
||||
DeleteFirstMoveAndGiveMoveToMon(mon, sBreedingSpecialMoveItemTable[i].move);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
24
src/debug.c
24
src/debug.c
@ -281,12 +281,10 @@ EWRAM_DATA u32 gDebugAIFlags = 0;
|
||||
// Define functions
|
||||
static void Debug_ReShowMainMenu(void);
|
||||
static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate);
|
||||
static void Debug_ShowMenuDynamic(u8 taskId);
|
||||
static void Debug_DestroyMenu(u8 taskId);
|
||||
static void Debug_DestroyMenu_Full(u8 taskId);
|
||||
static void DebugAction_Cancel(u8 taskId);
|
||||
static void DebugAction_DestroyExtraWindow(u8 taskId);
|
||||
static void DebugTask_HandleMenuInput(u8 taskId, void (*HandleInput)(u8));
|
||||
static void Debug_InitDebugBattleData(void);
|
||||
static void Debug_RefreshListMenu(u8 taskId);
|
||||
static void Debug_RedrawListMenu(u8 taskId);
|
||||
@ -303,7 +301,6 @@ static void DebugAction_Util_Script_8(u8 taskId);
|
||||
static void DebugAction_OpenUtilitiesMenu(u8 taskId);
|
||||
static void DebugAction_OpenScriptsMenu(u8 taskId);
|
||||
static void DebugAction_OpenFlagsVarsMenu(u8 taskId);
|
||||
static void DebugAction_OpenBattleMenu(u8 taskId);
|
||||
static void DebugAction_OpenGiveMenu(u8 taskId);
|
||||
static void DebugAction_OpenFillMenu(u8 taskId);
|
||||
static void DebugAction_OpenSoundMenu(u8 taskId);
|
||||
@ -1025,7 +1022,6 @@ static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMte
|
||||
gTasks[inputTaskId].tSubWindowId = 0;
|
||||
|
||||
Debug_RefreshListMenu(inputTaskId);
|
||||
//Debug_ShowMenuDynamic(inputTaskId);
|
||||
|
||||
// draw everything
|
||||
CopyWindowToVram(windowId, COPYWIN_FULL);
|
||||
@ -1182,10 +1178,8 @@ static void Debug_RefreshListMenu(u8 taskId)
|
||||
u16 i;
|
||||
const u8 sColor_Red[] = _("{COLOR RED}");
|
||||
const u8 sColor_Green[] = _("{COLOR GREEN}");
|
||||
u8 listTaskId = gTasks[taskId].tMenuTaskId;
|
||||
struct ListMenu *list = (void*) gTasks[listTaskId].data;
|
||||
u8 totalItems, flagResult;
|
||||
u8 const * name;
|
||||
u8 totalItems = 0, flagResult = 0;
|
||||
u8 const *name = NULL;
|
||||
|
||||
if (sDebugMenuListData->listId == 0)
|
||||
{
|
||||
@ -1239,7 +1233,7 @@ static void Debug_RefreshListMenu(u8 taskId)
|
||||
{
|
||||
flagResult = sDebugBattleData->aiFlags[i];
|
||||
if (i == totalItems - 1)
|
||||
flagResult == 0xFF;
|
||||
flagResult = 0xFF;
|
||||
name = sDebugMenu_Items_Battle_1[i].name;
|
||||
}
|
||||
|
||||
@ -1412,10 +1406,9 @@ static void DebugTask_HandleBattleMenuReDraw(u8 taskId)
|
||||
|
||||
static void DebugTask_HandleMenuInput_Battle(u8 taskId)
|
||||
{
|
||||
void (*func)(u8);
|
||||
u8 listTaskId = gTasks[taskId].tMenuTaskId;
|
||||
u32 input = ListMenu_ProcessInput(listTaskId);
|
||||
u16 idx;
|
||||
u8 listTaskId = gTasks[taskId].tMenuTaskId;
|
||||
ListMenu_ProcessInput(listTaskId);
|
||||
|
||||
ListMenuGetCurrentItemArrayId(listTaskId, &idx);
|
||||
|
||||
@ -1618,12 +1611,6 @@ static void DebugAction_OpenFlagsVarsMenu(u8 taskId)
|
||||
Debug_ShowMenu(DebugTask_HandleMenuInput_FlagsVars, gMultiuseListMenuTemplate);
|
||||
}
|
||||
|
||||
static void DebugAction_OpenBattleMenu(u8 taskId)
|
||||
{
|
||||
Debug_DestroyMenu(taskId);
|
||||
sDebugMenuListData->listId = 1;
|
||||
Debug_ShowMenu(DebugTask_HandleMenuInput_Battle, sDebugMenu_ListTemplate_Battle_0);
|
||||
}
|
||||
|
||||
static void DebugAction_OpenGiveMenu(u8 taskId)
|
||||
{
|
||||
@ -3629,7 +3616,6 @@ static void DebugAction_Fill_PCBoxes_Fast(u8 taskId) //Credit: Sierraffinity
|
||||
static void DebugAction_Fill_PCBoxes_Slow(u8 taskId)
|
||||
{
|
||||
int boxId, boxPosition;
|
||||
u32 personality;
|
||||
struct BoxPokemon boxMon;
|
||||
u32 species = SPECIES_BULBASAUR;
|
||||
bool8 spaceAvailable = FALSE;
|
||||
|
||||
@ -360,7 +360,6 @@ static void AddHatchedMonToParty(u8 id)
|
||||
u8 isEgg = 0x46; // ?
|
||||
u16 species;
|
||||
u8 name[POKEMON_NAME_LENGTH + 1];
|
||||
u16 ball;
|
||||
u16 metLevel;
|
||||
u8 metLocation;
|
||||
struct Pokemon *mon = &gPlayerParty[id];
|
||||
|
||||
@ -8883,7 +8883,7 @@ static void CreateLevitateMovementTask(struct ObjectEvent *objectEvent)
|
||||
u8 taskId = CreateTask(ApplyLevitateMovement, 0xFF);
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
StoreWordInTwoHalfwords(&task->data[0], (u32)objectEvent);
|
||||
StoreWordInTwoHalfwords((u16*) &task->data[0], (u32)objectEvent);
|
||||
objectEvent->warpArrowSpriteId = taskId;
|
||||
task->data[3] = 0xFFFF;
|
||||
}
|
||||
@ -8894,7 +8894,7 @@ static void ApplyLevitateMovement(u8 taskId)
|
||||
struct Sprite *sprite;
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
LoadWordFromTwoHalfwords(&task->data[0], (u32 *)&objectEvent); // load the map object pointer.
|
||||
LoadWordFromTwoHalfwords((u16*) &task->data[0], (u32 *)&objectEvent); // load the map object pointer.
|
||||
sprite = &gSprites[objectEvent->spriteId];
|
||||
|
||||
if(!(task->data[2] & 3))
|
||||
@ -8911,7 +8911,7 @@ static void DestroyLevitateMovementTask(u8 taskId)
|
||||
struct ObjectEvent *objectEvent;
|
||||
struct Task *task = &gTasks[taskId];
|
||||
|
||||
LoadWordFromTwoHalfwords(&task->data[0], (u32 *)&objectEvent); // unused objectEvent
|
||||
LoadWordFromTwoHalfwords((u16*) &task->data[0], (u32 *)&objectEvent); // unused objectEvent
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
|
||||
@ -68,7 +68,9 @@ static bool8 TryStartWarpEventScript(struct MapPosition *, u16);
|
||||
static bool8 TryStartMiscWalkingScripts(u16);
|
||||
static bool8 TryStartStepCountScript(u16);
|
||||
static void UpdateFriendshipStepCounter(void);
|
||||
#if OW_POISON_DAMAGE < GEN_5
|
||||
static bool8 UpdatePoisonStepCounter(void);
|
||||
#endif // OW_POISON_DAMAGE
|
||||
|
||||
void FieldClearPlayerInput(struct FieldInput *input)
|
||||
{
|
||||
@ -655,6 +657,7 @@ void ClearPoisonStepCounter(void)
|
||||
VarSet(VAR_POISON_STEP_COUNTER, 0);
|
||||
}
|
||||
|
||||
#if OW_POISON_DAMAGE < GEN_5
|
||||
static bool8 UpdatePoisonStepCounter(void)
|
||||
{
|
||||
u16 *ptr;
|
||||
@ -679,6 +682,7 @@ static bool8 UpdatePoisonStepCounter(void)
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
#endif // OW_POISON_DAMAGE
|
||||
|
||||
void RestartWildEncounterImmunitySteps(void)
|
||||
{
|
||||
|
||||
@ -412,7 +412,7 @@ static void Task_AnimateDoor(u8 taskId)
|
||||
struct DoorAnimFrame *frames = (struct DoorAnimFrame *)(tFramesHi << 16 | tFramesLo);
|
||||
struct DoorGraphics *gfx = (struct DoorGraphics *)(tGfxHi << 16 | tGfxLo);
|
||||
|
||||
if (AnimateDoorFrame(gfx, frames, data) == FALSE)
|
||||
if (AnimateDoorFrame(gfx, frames, gTasks[taskId].data) == FALSE)
|
||||
DestroyTask(taskId);
|
||||
}
|
||||
|
||||
|
||||
@ -964,8 +964,8 @@ void FieldShowRegionMap(void)
|
||||
|
||||
static bool8 IsPlayerInFrontOfPC(void)
|
||||
{
|
||||
u16 x, y;
|
||||
u16 tileInFront;
|
||||
s16 x, y;
|
||||
u32 tileInFront;
|
||||
|
||||
GetXYCoordsOneStepInFrontOfPlayer(&x, &y);
|
||||
tileInFront = MapGridGetMetatileIdAt(x, y);
|
||||
|
||||
@ -938,7 +938,7 @@ static void InitSnowflakeSpriteMovement(struct Sprite *sprite)
|
||||
sprite->tFallCounter = 0;
|
||||
}
|
||||
|
||||
static void WaitSnowflakeSprite(struct Sprite *sprite)
|
||||
static void UNUSED WaitSnowflakeSprite(struct Sprite *sprite)
|
||||
{
|
||||
if (++gWeatherPtr->snowflakeTimer > 18)
|
||||
{
|
||||
@ -953,7 +953,6 @@ static void WaitSnowflakeSprite(struct Sprite *sprite)
|
||||
static void UpdateSnowflakeSprite(struct Sprite *sprite)
|
||||
{
|
||||
s16 x;
|
||||
s16 y;
|
||||
|
||||
sprite->tPosY += sprite->tDeltaY;
|
||||
sprite->y = sprite->tPosY >> 7;
|
||||
|
||||
@ -25,7 +25,7 @@ struct ConnectionFlags
|
||||
u8 east:1;
|
||||
};
|
||||
|
||||
EWRAM_DATA static u16 ALIGNED(4) sBackupMapData[MAX_MAP_DATA_SIZE] = {0};
|
||||
EWRAM_DATA u16 ALIGNED(4) sBackupMapData[MAX_MAP_DATA_SIZE] = {0};
|
||||
EWRAM_DATA struct MapHeader gMapHeader = {0};
|
||||
EWRAM_DATA struct Camera gCamera = {0};
|
||||
EWRAM_DATA static struct ConnectionFlags sMapConnectionFlags = {0};
|
||||
@ -48,16 +48,12 @@ static const struct MapConnection *GetIncomingConnection(u8 direction, int x, in
|
||||
static bool8 IsPosInIncomingConnectingMap(u8 direction, int x, int y, const struct MapConnection *connection);
|
||||
static bool8 IsCoordInIncomingConnectingMap(int coord, int srcMax, int destMax, int offset);
|
||||
|
||||
#define GetBorderBlockAt(x, y)({ \
|
||||
u16 block; \
|
||||
int i; \
|
||||
const u16 *border = gMapHeader.mapLayout->border; /* Unused, they read it again below */ \
|
||||
\
|
||||
i = (x + 1) & 1; \
|
||||
i += ((y + 1) & 1) * 2; \
|
||||
\
|
||||
block = gMapHeader.mapLayout->border[i] | MAPGRID_COLLISION_MASK; \
|
||||
})
|
||||
static inline u16 GetBorderBlockAt(int x, int y)
|
||||
{
|
||||
int i = (x + 1) & 1;
|
||||
i += ((y + 1) & 1) * 2;
|
||||
return gMapHeader.mapLayout->border[i] | MAPGRID_COLLISION_MASK;
|
||||
}
|
||||
|
||||
#define AreCoordsWithinMapGridBounds(x, y) (x >= 0 && x < gBackupMapLayout.width && y >= 0 && y < gBackupMapLayout.height)
|
||||
|
||||
@ -681,7 +677,7 @@ bool8 CameraMove(int x, int y)
|
||||
{
|
||||
DebugPrintfLevel(MGBA_LOG_WARN, "GetIncomingConnection returned an invalid connection inside CameraMove!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
return gCamera.active;
|
||||
}
|
||||
|
||||
@ -1478,7 +1478,7 @@ static void UpdateDomeConfetti(struct ConfettiUtil *util)
|
||||
static void Task_DoDomeConfetti(u8 taskId)
|
||||
{
|
||||
u32 id = 0;
|
||||
u16 *data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
switch (tState)
|
||||
{
|
||||
|
||||
@ -795,6 +795,12 @@ void ItemUseOutOfBattle_AbilityPatch(u8 taskId)
|
||||
SetUpItemUseCallback(taskId);
|
||||
}
|
||||
|
||||
void ItemUseOutOfBattle_ResetEVs(u8 taskId)
|
||||
{
|
||||
gItemUseCB = ItemUseCB_ResetEVs;
|
||||
SetUpItemUseCallback(taskId);
|
||||
}
|
||||
|
||||
void ItemUseOutOfBattle_ReduceEV(u8 taskId)
|
||||
{
|
||||
gItemUseCB = ItemUseCB_ReduceEV;
|
||||
@ -1051,10 +1057,8 @@ static u32 GetBallThrowableState(void)
|
||||
return BALL_THROW_UNABLE_TWO_MONS;
|
||||
else if (IsPlayerPartyAndPokemonStorageFull() == TRUE)
|
||||
return BALL_THROW_UNABLE_NO_ROOM;
|
||||
#if B_SEMI_INVULNERABLE_CATCH >= GEN_4
|
||||
else if (gStatuses3[GetCatchingBattler()] & STATUS3_SEMI_INVULNERABLE)
|
||||
else if (B_SEMI_INVULNERABLE_CATCH >= GEN_4 && (gStatuses3[GetCatchingBattler()] & STATUS3_SEMI_INVULNERABLE))
|
||||
return BALL_THROW_UNABLE_SEMI_INVULNERABLE;
|
||||
#endif
|
||||
else if (FlagGet(B_FLAG_NO_CATCHING))
|
||||
return BALL_THROW_UNABLE_DISABLED_FLAG;
|
||||
|
||||
@ -1093,14 +1097,12 @@ void ItemUseInBattle_PokeBall(u8 taskId)
|
||||
else
|
||||
DisplayItemMessageInBattlePyramid(taskId, gText_BoxFull, Task_CloseBattlePyramidBagMessage);
|
||||
break;
|
||||
#if B_SEMI_INVULNERABLE_CATCH >= GEN_4
|
||||
case BALL_THROW_UNABLE_SEMI_INVULNERABLE:
|
||||
if (!InBattlePyramid())
|
||||
DisplayItemMessage(taskId, FONT_NORMAL, sText_CantThrowPokeBall_SemiInvulnerable, CloseItemMessage);
|
||||
else
|
||||
DisplayItemMessageInBattlePyramid(taskId, sText_CantThrowPokeBall_SemiInvulnerable, Task_CloseBattlePyramidBagMessage);
|
||||
break;
|
||||
#endif
|
||||
case BALL_THROW_UNABLE_DISABLED_FLAG:
|
||||
if (!InBattlePyramid())
|
||||
DisplayItemMessage(taskId, FONT_NORMAL, sText_CantThrowPokeBall_Disabled, CloseItemMessage);
|
||||
@ -1110,30 +1112,6 @@ void ItemUseInBattle_PokeBall(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void Task_CloseStatIncreaseMessage(u8 taskId)
|
||||
{
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||
{
|
||||
if (!InBattlePyramid())
|
||||
Task_FadeAndCloseBagMenu(taskId);
|
||||
else
|
||||
CloseBattlePyramidBag(taskId);
|
||||
}
|
||||
}
|
||||
|
||||
static void Task_UseStatIncreaseItem(u8 taskId)
|
||||
{
|
||||
if(++gTasks[taskId].data[8] > 7)
|
||||
{
|
||||
PlaySE(SE_USE_ITEM);
|
||||
RemoveBagItem(gSpecialVar_ItemId, 1);
|
||||
if (!InBattlePyramid())
|
||||
DisplayItemMessage(taskId, FONT_NORMAL, UseStatIncreaseItem(gSpecialVar_ItemId), Task_CloseStatIncreaseMessage);
|
||||
else
|
||||
DisplayItemMessageInBattlePyramid(taskId, UseStatIncreaseItem(gSpecialVar_ItemId), Task_CloseStatIncreaseMessage);
|
||||
}
|
||||
}
|
||||
|
||||
static void ItemUseInBattle_ShowPartyMenu(u8 taskId)
|
||||
{
|
||||
if (!InBattlePyramid())
|
||||
@ -1210,12 +1188,10 @@ static bool32 CannotUseBagBattleItem(u16 itemId)
|
||||
failStr = gText_BoxFull;
|
||||
cannotUse++;
|
||||
break;
|
||||
#if B_SEMI_INVULNERABLE_CATCH >= GEN_4
|
||||
case BALL_THROW_UNABLE_SEMI_INVULNERABLE:
|
||||
failStr = sText_CantThrowPokeBall_SemiInvulnerable;
|
||||
cannotUse++;
|
||||
break;
|
||||
#endif
|
||||
case BALL_THROW_UNABLE_DISABLED_FLAG:
|
||||
failStr = sText_CantThrowPokeBall_Disabled;
|
||||
cannotUse++;
|
||||
|
||||
@ -134,8 +134,6 @@ static const char str_checkMbootLL[] = "RFU-MBOOT";
|
||||
u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p, bool8 copyInterruptToRam)
|
||||
{
|
||||
u16 i;
|
||||
u16 *dst;
|
||||
const u16 *src;
|
||||
u16 buffByteSizeMax;
|
||||
|
||||
// is in EWRAM?
|
||||
@ -182,11 +180,13 @@ u16 rfu_initializeAPI(u32 *APIBuffer, u16 buffByteSize, IntrFunc *sioIntrTable_p
|
||||
}
|
||||
// rfu_REQ_changeMasterSlave is the function next to rfu_STC_fastCopy
|
||||
#if LIBRFU_VERSION < 1026
|
||||
src = (const u16 *)((uintptr_t)&rfu_STC_fastCopy & ~1);
|
||||
dst = gRfuFixed->fastCopyBuffer;
|
||||
{
|
||||
const u16 *src = (const u16 *)((uintptr_t)&rfu_STC_fastCopy & ~1);
|
||||
u16 *dst = gRfuFixed->fastCopyBuffer;
|
||||
buffByteSizeMax = ((void *)rfu_REQ_changeMasterSlave - (void *)rfu_STC_fastCopy) / sizeof(u16);
|
||||
while (buffByteSizeMax-- != 0)
|
||||
*dst++ = *src++;
|
||||
}
|
||||
#else
|
||||
COPY(
|
||||
(uintptr_t)&rfu_STC_fastCopy & ~1,
|
||||
@ -591,19 +591,17 @@ static void rfu_CB_pollAndEndSearchChild(u8 reqCommand, u16 reqResult)
|
||||
|
||||
static void rfu_STC_readChildList(void)
|
||||
{
|
||||
u32 stwiParam;
|
||||
u8 numSlots = gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket8.data[1];
|
||||
u8 *data_p;
|
||||
u8 i;
|
||||
u8 bm_slot_id;
|
||||
#if LIBRFU_VERSION < 1026
|
||||
u8 true_slots[RFU_CHILD_MAX];
|
||||
#endif
|
||||
|
||||
#if LIBRFU_VERSION < 1026
|
||||
u8 true_slots[RFU_CHILD_MAX];
|
||||
|
||||
if (numSlots != 0)
|
||||
{
|
||||
stwiParam = gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket32.data[0];
|
||||
u8 i;
|
||||
u32 stwiParam = gRfuFixed->STWIBuffer->rxPacketAlloc.rfuPacket32.data[0];
|
||||
STWI_set_Callback_M(rfu_CB_defaultCallback);
|
||||
STWI_send_LinkStatusREQ();
|
||||
if (STWI_poll_CommandEnd() == 0)
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
#include <string.h>
|
||||
#include "gba/m4a_internal.h"
|
||||
#include "global.h"
|
||||
|
||||
extern const u8 gCgb3Vol[];
|
||||
|
||||
|
||||
@ -67,7 +67,6 @@ static EWRAM_DATA u16 sTileNum = 0;
|
||||
static EWRAM_DATA u8 sPaletteNum = 0;
|
||||
static EWRAM_DATA u8 sYesNoWindowId = 0;
|
||||
static EWRAM_DATA u8 sHofPCTopBarWindowId = 0;
|
||||
static EWRAM_DATA u16 sFiller = 0; // needed to align
|
||||
static EWRAM_DATA bool8 sScheduledBgCopiesToVram[4] = {FALSE};
|
||||
static EWRAM_DATA u16 sTempTileDataBufferIdx = 0;
|
||||
static EWRAM_DATA void *sTempTileDataBuffer[0x20] = {NULL};
|
||||
|
||||
@ -131,7 +131,7 @@ static void UpdateAllLinkPlayers(u16 *, s32);
|
||||
static u8 FlipVerticalAndClearForced(u8, u8);
|
||||
static u8 LinkPlayerGetCollision(u8, u8, s16, s16);
|
||||
static void CreateLinkPlayerSprite(u8, u8);
|
||||
static void GetLinkPlayerCoords(u8, u16 *, u16 *);
|
||||
static void GetLinkPlayerCoords(u8, s16 *, s16 *);
|
||||
static u8 GetLinkPlayerFacingDirection(u8);
|
||||
static u8 GetLinkPlayerElevation(u8);
|
||||
static u8 GetLinkPlayerIdAt(s16, s16);
|
||||
@ -358,9 +358,8 @@ static void (*const sMovementStatusHandler[])(struct LinkPlayerObjectEvent *, st
|
||||
void DoWhiteOut(void)
|
||||
{
|
||||
RunScriptImmediately(EventScript_WhiteOut);
|
||||
#if B_WHITEOUT_MONEY == GEN_3
|
||||
SetMoney(&gSaveBlock1Ptr->money, GetMoney(&gSaveBlock1Ptr->money) / 2);
|
||||
#endif
|
||||
if (B_WHITEOUT_MONEY == GEN_3)
|
||||
SetMoney(&gSaveBlock1Ptr->money, GetMoney(&gSaveBlock1Ptr->money) / 2);
|
||||
HealPlayerParty();
|
||||
Overworld_ResetStateAfterWhiteOut();
|
||||
SetWarpDestinationToLastHealLocation();
|
||||
@ -425,9 +424,8 @@ static void Overworld_ResetStateAfterWhiteOut(void)
|
||||
FlagClear(FLAG_SYS_SAFARI_MODE);
|
||||
FlagClear(FLAG_SYS_USE_STRENGTH);
|
||||
FlagClear(FLAG_SYS_USE_FLASH);
|
||||
#if B_RESET_FLAGS_VARS_AFTER_WHITEOUT == TRUE
|
||||
Overworld_ResetBattleFlagsAndVars();
|
||||
#endif
|
||||
if (B_RESET_FLAGS_VARS_AFTER_WHITEOUT == TRUE)
|
||||
Overworld_ResetBattleFlagsAndVars();
|
||||
// If you were defeated by Kyogre/Groudon and the step counter has
|
||||
// maxed out, end the abnormal weather.
|
||||
if (VarGet(VAR_SHOULD_END_ABNORMAL_WEATHER) == 1)
|
||||
@ -3016,7 +3014,7 @@ static u8 GetSpriteForLinkedPlayer(u8 linkPlayerId)
|
||||
return objEvent->spriteId;
|
||||
}
|
||||
|
||||
static void GetLinkPlayerCoords(u8 linkPlayerId, u16 *x, u16 *y)
|
||||
static void GetLinkPlayerCoords(u8 linkPlayerId, s16 *x, s16 *y)
|
||||
{
|
||||
u8 objEventId = gLinkPlayerObjectEvents[linkPlayerId].objEventId;
|
||||
struct ObjectEvent *objEvent = &gObjectEvents[objEventId];
|
||||
|
||||
@ -62,7 +62,6 @@ ALIGNED(4) EWRAM_DATA u16 gPlttBufferUnfaded[PLTT_BUFFER_SIZE] = {0};
|
||||
ALIGNED(4) EWRAM_DATA u16 gPlttBufferFaded[PLTT_BUFFER_SIZE] = {0};
|
||||
static EWRAM_DATA struct PaletteStruct sPaletteStructs[NUM_PALETTE_STRUCTS] = {0};
|
||||
EWRAM_DATA struct PaletteFadeControl gPaletteFade = {0};
|
||||
static EWRAM_DATA u32 sFiller = 0;
|
||||
static EWRAM_DATA u32 sPlttBufferTransferPending = 0;
|
||||
EWRAM_DATA u8 ALIGNED(2) gPaletteDecompressionBuffer[PLTT_SIZE] = {0};
|
||||
|
||||
|
||||
34
src/party_menu.c
Executable file → Normal file
34
src/party_menu.c
Executable file → Normal file
@ -228,7 +228,6 @@ static EWRAM_DATA u16 *sSlot1TilemapBuffer = 0; // for switching party slots
|
||||
static EWRAM_DATA u16 *sSlot2TilemapBuffer = 0; //
|
||||
EWRAM_DATA u8 gSelectedOrderFromParty[MAX_FRONTIER_PARTY_SIZE] = {0};
|
||||
static EWRAM_DATA u16 sPartyMenuItemId = 0;
|
||||
static EWRAM_DATA u16 sUnused = 0;
|
||||
EWRAM_DATA u8 gBattlePartyCurrentOrder[PARTY_SIZE / 2] = {0}; // bits 0-3 are the current pos of Slot 1, 4-7 are Slot 2, and so on
|
||||
static EWRAM_DATA u8 sInitialLevel = 0;
|
||||
static EWRAM_DATA u8 sFinalLevel = 0;
|
||||
@ -4777,6 +4776,33 @@ static void Task_ClosePartyMenuAfterText(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
void ItemUseCB_ResetEVs(u8 taskId, TaskFunc task)
|
||||
{
|
||||
struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId];
|
||||
u16 item = gSpecialVar_ItemId;
|
||||
bool8 cannotUseEffect = ExecuteTableBasedItemEffect(mon, item, gPartyMenu.slotId, 0);
|
||||
|
||||
if (cannotUseEffect)
|
||||
{
|
||||
gPartyMenuUseExitCallback = FALSE;
|
||||
PlaySE(SE_SELECT);
|
||||
DisplayPartyMenuMessage(gText_WontHaveEffect, TRUE);
|
||||
ScheduleBgCopyTilemapToVram(2);
|
||||
gTasks[taskId].func = task;
|
||||
}
|
||||
else
|
||||
{
|
||||
gPartyMenuUseExitCallback = TRUE;
|
||||
PlaySE(SE_USE_ITEM);
|
||||
RemoveBagItem(item, 1);
|
||||
GetMonNickname(mon, gStringVar1);
|
||||
StringExpandPlaceholders(gStringVar4, gText_BasePointsResetToZero);
|
||||
DisplayPartyMenuMessage(gStringVar4, TRUE);
|
||||
ScheduleBgCopyTilemapToVram(2);
|
||||
gTasks[taskId].func = task;
|
||||
}
|
||||
}
|
||||
|
||||
void ItemUseCB_ReduceEV(u8 taskId, TaskFunc task)
|
||||
{
|
||||
struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId];
|
||||
@ -5270,7 +5296,7 @@ static void Task_TryLearningNextMoveAfterText(u8 taskId)
|
||||
Task_TryLearningNextMove(taskId);
|
||||
}
|
||||
|
||||
static void DisplayExpPoints(u8 taskId, TaskFunc task, u8 holdEffectParam)
|
||||
static void UNUSED DisplayExpPoints(u8 taskId, TaskFunc task, u8 holdEffectParam)
|
||||
{
|
||||
PlaySE(SE_USE_ITEM);
|
||||
ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[holdEffectParam], STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||
@ -5403,7 +5429,7 @@ static void Task_DisplayLevelUpStatsPg2(u8 taskId)
|
||||
|
||||
static void DisplayLevelUpStatsPg1(u8 taskId)
|
||||
{
|
||||
s16 *arrayPtr = sPartyMenuInternal->data;
|
||||
u16 *arrayPtr = (u16*) sPartyMenuInternal->data;
|
||||
|
||||
arrayPtr[12] = CreateLevelUpStatsWindow();
|
||||
DrawLevelUpWindowPg1(arrayPtr[12], arrayPtr, &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY);
|
||||
@ -5413,7 +5439,7 @@ static void DisplayLevelUpStatsPg1(u8 taskId)
|
||||
|
||||
static void DisplayLevelUpStatsPg2(u8 taskId)
|
||||
{
|
||||
s16 *arrayPtr = sPartyMenuInternal->data;
|
||||
u16 *arrayPtr = (u16*) sPartyMenuInternal->data;
|
||||
|
||||
DrawLevelUpWindowPg2(arrayPtr[12], &arrayPtr[6], TEXT_COLOR_WHITE, TEXT_COLOR_DARK_GRAY, TEXT_COLOR_LIGHT_GRAY);
|
||||
CopyWindowToVram(arrayPtr[12], COPYWIN_GFX);
|
||||
|
||||
@ -388,7 +388,7 @@ void PlayerPC(void)
|
||||
|
||||
static void InitPlayerPCMenu(u8 taskId)
|
||||
{
|
||||
u16 *data;
|
||||
s16 *data;
|
||||
struct WindowTemplate windowTemplate;
|
||||
data = gTasks[taskId].data;
|
||||
|
||||
@ -408,7 +408,7 @@ static void InitPlayerPCMenu(u8 taskId)
|
||||
|
||||
static void PlayerPCProcessMenuInput(u8 taskId)
|
||||
{
|
||||
u16 *data;
|
||||
s16 *data;
|
||||
s8 inputOptionId;
|
||||
|
||||
data = gTasks[taskId].data;
|
||||
@ -503,7 +503,7 @@ static void PlayerPC_TurnOff(u8 taskId)
|
||||
|
||||
static void InitItemStorageMenu(u8 taskId, u8 var)
|
||||
{
|
||||
u16 *data;
|
||||
s16 *data;
|
||||
struct WindowTemplate windowTemplate;
|
||||
|
||||
data = gTasks[taskId].data;
|
||||
@ -621,7 +621,7 @@ static void ItemStorage_Toss(u8 taskId)
|
||||
|
||||
static void ItemStorage_Enter(u8 taskId, bool8 toss)
|
||||
{
|
||||
u16 *data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
tInTossMenu = toss;
|
||||
ItemStorage_EraseMainMenu(taskId);
|
||||
@ -654,7 +654,7 @@ static void SetPlayerPCListCount(u8 taskId)
|
||||
|
||||
static void ItemStorage_EraseMainMenu(u8 taskId)
|
||||
{
|
||||
u16 *data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
ClearStdWindowAndFrameToTransparent(tWindowId, FALSE);
|
||||
ClearWindowTilemap(tWindowId);
|
||||
RemoveWindow(tWindowId);
|
||||
@ -700,7 +700,7 @@ static void Mailbox_DrawMailboxMenu(u8 taskId)
|
||||
|
||||
static void Mailbox_ProcessInput(u8 taskId)
|
||||
{
|
||||
u16 *data = gTasks[taskId].data;
|
||||
s16 *data = gTasks[taskId].data;
|
||||
|
||||
if (!gPaletteFade.active)
|
||||
{
|
||||
@ -1488,7 +1488,6 @@ static void ItemStorage_HandleRemoveItem(u8 taskId)
|
||||
|
||||
static void ItemStorage_HandleErrorMessageInput(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||
{
|
||||
ItemStorage_PrintMessage(ItemStorage_GetMessage(gSaveBlock1Ptr->pcItems[gPlayerPCItemPageInfo.itemsAbove + gPlayerPCItemPageInfo.cursorPos].itemId));
|
||||
|
||||
@ -1591,7 +1591,7 @@ static void ResetPokedexView(struct PokedexView *pokedexView)
|
||||
|
||||
void CB2_OpenPokedex(void)
|
||||
{
|
||||
#if POKEDEX_PLUS_HGSS == TRUE
|
||||
#if POKEDEX_PLUS_HGSS == TRUE
|
||||
CB2_OpenPokedexPlusHGSS();
|
||||
return;
|
||||
#endif
|
||||
@ -3943,11 +3943,12 @@ static void HighlightSubmenuScreenSelectBarItem(u8 a, u16 b)
|
||||
|
||||
u8 DisplayCaughtMonDexPage(u16 dexNum, u32 otId, u32 personality)
|
||||
{
|
||||
#if POKEDEX_PLUS_HGSS == TRUE
|
||||
u8 taskId = CreateTask(Task_DisplayCaughtMonDexPageHGSS, 0);
|
||||
#else
|
||||
u8 taskId = CreateTask(Task_DisplayCaughtMonDexPage, 0);
|
||||
#endif
|
||||
u8 taskId = 0;
|
||||
#if POKEDEX_PLUS_HGSS
|
||||
taskId = CreateTask(Task_DisplayCaughtMonDexPageHGSS, 0);
|
||||
#else
|
||||
taskId = CreateTask(Task_DisplayCaughtMonDexPage, 0);
|
||||
#endif // POKEDEX_PLUS_HGSS
|
||||
|
||||
gTasks[taskId].tState = 0;
|
||||
gTasks[taskId].tDexNum = dexNum;
|
||||
@ -5103,8 +5104,8 @@ static void Task_SearchCompleteWaitForInput(u8 taskId)
|
||||
static void Task_SelectSearchMenuItem(u8 taskId)
|
||||
{
|
||||
u8 menuItem;
|
||||
u16 *cursorPos;
|
||||
u16 *scrollOffset;
|
||||
s16 *cursorPos;
|
||||
s16 *scrollOffset;
|
||||
|
||||
DrawOrEraseSearchParameterBox(FALSE);
|
||||
menuItem = gTasks[taskId].tMenuItem;
|
||||
@ -5124,8 +5125,8 @@ static void Task_HandleSearchParameterInput(u8 taskId)
|
||||
{
|
||||
u8 menuItem;
|
||||
const struct SearchOptionText *texts;
|
||||
u16 *cursorPos;
|
||||
u16 *scrollOffset;
|
||||
s16 *cursorPos;
|
||||
s16 *scrollOffset;
|
||||
u16 maxOption;
|
||||
bool8 moved;
|
||||
|
||||
@ -5442,8 +5443,8 @@ static void DrawOrEraseSearchParameterBox(bool8 erase)
|
||||
static void PrintSearchParameterText(u8 taskId)
|
||||
{
|
||||
const struct SearchOptionText *texts = sSearchOptions[gTasks[taskId].tMenuItem].texts;
|
||||
const u16 *cursorPos = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataCursorPos];
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataScrollOffset];
|
||||
const s16 *cursorPos = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataCursorPos];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataScrollOffset];
|
||||
u16 i;
|
||||
u16 j;
|
||||
|
||||
@ -5457,8 +5458,8 @@ static void PrintSearchParameterText(u8 taskId)
|
||||
|
||||
static u8 GetSearchModeSelection(u8 taskId, u8 option)
|
||||
{
|
||||
const u16 *cursorPos = &gTasks[taskId].data[sSearchOptions[option].taskDataCursorPos];
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[option].taskDataScrollOffset];
|
||||
const s16 *cursorPos = &gTasks[taskId].data[sSearchOptions[option].taskDataCursorPos];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[option].taskDataScrollOffset];
|
||||
u16 id = *cursorPos + *scrollOffset;
|
||||
|
||||
switch (option)
|
||||
@ -5529,7 +5530,7 @@ static void SetDefaultSearchModeAndOrder(u8 taskId)
|
||||
static bool8 SearchParamCantScrollUp(u8 taskId)
|
||||
{
|
||||
u8 menuItem = gTasks[taskId].tMenuItem;
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
u16 lastOption = sSearchOptions[menuItem].numOptions - 1;
|
||||
|
||||
if (lastOption > MAX_SEARCH_PARAM_CURSOR_POS && *scrollOffset != 0)
|
||||
@ -5541,7 +5542,7 @@ static bool8 SearchParamCantScrollUp(u8 taskId)
|
||||
static bool8 SearchParamCantScrollDown(u8 taskId)
|
||||
{
|
||||
u8 menuItem = gTasks[taskId].tMenuItem;
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
u16 lastOption = sSearchOptions[menuItem].numOptions - 1;
|
||||
|
||||
if (lastOption > MAX_SEARCH_PARAM_CURSOR_POS && *scrollOffset < lastOption - MAX_SEARCH_PARAM_CURSOR_POS)
|
||||
|
||||
@ -2994,7 +2994,6 @@ static void CreateInterfaceSprites(u8 page)
|
||||
{
|
||||
u8 spriteId;
|
||||
u16 digitNum;
|
||||
u8 color[3];
|
||||
bool32 drawNextDigit;
|
||||
|
||||
// Scroll arrows
|
||||
@ -3906,7 +3905,7 @@ static void LoadScreenSelectBarSubmenu(u16 unused)
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
}
|
||||
|
||||
static void HighlightScreenSelectBarItem(u8 selectedScreen, u16 unused)
|
||||
static void UNUSED HighlightScreenSelectBarItem(u8 selectedScreen, u16 unused)
|
||||
{
|
||||
u8 i;
|
||||
u8 j;
|
||||
@ -3933,7 +3932,7 @@ static void HighlightScreenSelectBarItem(u8 selectedScreen, u16 unused)
|
||||
CopyBgTilemapBufferToVram(1);
|
||||
}
|
||||
|
||||
static void HighlightSubmenuScreenSelectBarItem(u8 a, u16 b)
|
||||
static void UNUSED HighlightSubmenuScreenSelectBarItem(u8 a, u16 b)
|
||||
{
|
||||
u8 i;
|
||||
u8 j;
|
||||
@ -4178,7 +4177,7 @@ static void PrintInfoScreenTextSmall(const u8* str, u8 left, u8 top)
|
||||
|
||||
AddTextPrinterParameterized4(0, 0, left, top, 0, 0, color, 0, str);
|
||||
}
|
||||
static void PrintInfoScreenTextSmallWhite(const u8* str, u8 left, u8 top)
|
||||
static void UNUSED PrintInfoScreenTextSmallWhite(const u8* str, u8 left, u8 top)
|
||||
{
|
||||
u8 color[3];
|
||||
color[0] = TEXT_COLOR_TRANSPARENT;
|
||||
@ -4256,14 +4255,11 @@ static void SetTypeIconPosAndPal(u8 typeId, u8 x, u8 y, u8 spriteArrayId)
|
||||
}
|
||||
static void PrintCurrentSpeciesTypeInfo(u8 newEntry, u16 species)
|
||||
{
|
||||
u32 i;
|
||||
u16 dexNum = SpeciesToNationalPokedexNum(species);
|
||||
u8 type1, type2;
|
||||
|
||||
if (!newEntry)
|
||||
{
|
||||
species = NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum);
|
||||
dexNum = SpeciesToNationalPokedexNum(species);
|
||||
}
|
||||
//type icon(s)
|
||||
#ifdef TX_RANDOMIZER_AND_CHALLENGES
|
||||
@ -4454,7 +4450,7 @@ static void PrintMonWeight(u16 weight, u8 left, u8 top)
|
||||
}
|
||||
|
||||
// Unused in the English version, used to print height/weight in versions which use metric system.
|
||||
static void PrintDecimalNum(u8 windowId, u16 num, u8 left, u8 top)
|
||||
static void UNUSED PrintDecimalNum(u8 windowId, u16 num, u8 left, u8 top)
|
||||
{
|
||||
u8 str[6];
|
||||
bool8 outputted = FALSE;
|
||||
@ -4646,7 +4642,7 @@ static u16 GetNextPosition(u8 direction, u16 position, u16 min, u16 max)
|
||||
|
||||
// Unown and Spinda use the personality of the first seen individual of that species
|
||||
// All others use personality 0
|
||||
static u32 GetPokedexMonPersonality(u16 species)
|
||||
static UNUSED u32 GetPokedexMonPersonality(u16 species)
|
||||
{
|
||||
if (species == SPECIES_UNOWN || species == SPECIES_SPINDA)
|
||||
{
|
||||
@ -4670,15 +4666,13 @@ static u32 GetPokedexMonPersonality(u16 species)
|
||||
//************************************
|
||||
u16 NationalPokedexNumToSpeciesHGSS(u16 nationalNum)
|
||||
{
|
||||
u16 species;
|
||||
|
||||
if (!nationalNum)
|
||||
return 0;
|
||||
|
||||
if (sPokedexView->formSpecies != 0)
|
||||
return sPokedexView->formSpecies;
|
||||
else
|
||||
return NationalPokedexNumToSpecies(nationalNum);
|
||||
if (sPokedexView->formSpecies != 0)
|
||||
return sPokedexView->formSpecies;
|
||||
else
|
||||
return NationalPokedexNumToSpecies(nationalNum);
|
||||
}
|
||||
|
||||
static void LoadTilesetTilemapHGSS(u8 page)
|
||||
@ -4785,8 +4779,8 @@ static void ResetStatsWindows(void)
|
||||
static void SaveMonDataInStruct(void)
|
||||
{
|
||||
u16 species = NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum);
|
||||
u8 EVs[6] = {gSpeciesInfo[species].evYield_HP, gSpeciesInfo[species].evYield_Speed, gSpeciesInfo[species].evYield_Attack, gSpeciesInfo[species].evYield_SpAttack, gSpeciesInfo[species].evYield_Defense, gSpeciesInfo[species].evYield_SpDefense};
|
||||
u8 differentEVs;
|
||||
u8 evs[6] = {gSpeciesInfo[species].evYield_HP, gSpeciesInfo[species].evYield_Speed, gSpeciesInfo[species].evYield_Attack, gSpeciesInfo[species].evYield_SpAttack, gSpeciesInfo[species].evYield_Defense, gSpeciesInfo[species].evYield_SpDefense};
|
||||
u8 differentEVs = 0;
|
||||
u8 i;
|
||||
|
||||
//Count how many different EVs
|
||||
@ -4948,7 +4942,7 @@ static void Task_LoadStatsScreen(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
static void FreeStatsScreenWindowAndBgBuffers(void)
|
||||
static void UNUSED FreeStatsScreenWindowAndBgBuffers(void)
|
||||
{
|
||||
void *tilemapBuffer;
|
||||
|
||||
@ -5070,7 +5064,6 @@ static bool8 CalculateMoves(void)
|
||||
|
||||
u16 statsMovesEgg[EGG_MOVES_ARRAY_COUNT] = {0};
|
||||
u16 statsMovesLevelUp[MAX_LEVEL_UP_MOVES] = {0};
|
||||
u16 statsMovesTMHM[NUM_TECHNICAL_MACHINES + NUM_HIDDEN_MACHINES] = {0};
|
||||
u16 move;
|
||||
|
||||
u8 numEggMoves = 0;
|
||||
@ -5310,14 +5303,7 @@ static void PrintStatsScreen_Moves_Bottom(u8 taskId)
|
||||
static void PrintStatsScreen_NameGender(u8 taskId, u32 num, u32 value)
|
||||
{
|
||||
u8 str[16];
|
||||
u8 str2[32];
|
||||
u8 strEV[25];
|
||||
u16 species = NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum);
|
||||
u16 natNum;
|
||||
u8 evVal;
|
||||
const u8 *category;
|
||||
const u8 *description;
|
||||
const u8 *strEVtype;
|
||||
|
||||
u8 base_x = 38;
|
||||
u8 base_y = 0;
|
||||
@ -5403,7 +5389,6 @@ static void PrintStatsScreen_Left(u8 taskId)
|
||||
{
|
||||
u8 base_x = 8;
|
||||
u8 x_offset_column = 43;
|
||||
u8 x_offset_value = 26;
|
||||
u8 column = 0;
|
||||
u8 base_x_offset = 70;
|
||||
u8 base_x_first_row = 23;
|
||||
@ -5417,7 +5402,6 @@ static void PrintStatsScreen_Left(u8 taskId)
|
||||
u8 strBase[14];
|
||||
u8 EVs[6] = {sPokedexView->sPokemonStats.evYield_HP, sPokedexView->sPokemonStats.evYield_Speed, sPokedexView->sPokemonStats.evYield_Attack, sPokedexView->sPokemonStats.evYield_SpAttack, sPokedexView->sPokemonStats.evYield_Defense, sPokedexView->sPokemonStats.evYield_SpDefense};
|
||||
u8 differentEVs = 0;
|
||||
u8 i;
|
||||
|
||||
//Base stats
|
||||
if (gTasks[taskId].data[5] == 0)
|
||||
@ -5816,7 +5800,6 @@ static void PrintStatsScreen_Left(u8 taskId)
|
||||
|
||||
static void PrintStatsScreen_Abilities(u8 taskId)
|
||||
{
|
||||
u16 species = NationalPokedexNumToSpeciesHGSS(sPokedexListItem->dexNum);
|
||||
u8 abilities_x = 5;
|
||||
u8 abilities_y = 3;
|
||||
u16 ability0;
|
||||
@ -6096,7 +6079,6 @@ static void Task_HandleEvolutionScreenInput(u8 taskId)
|
||||
|
||||
if (sPokedexView->sEvoScreenData.numAllEvolutions != 0 && sPokedexView->sEvoScreenData.numSeen != 0)
|
||||
{
|
||||
u8 i;
|
||||
u8 base_y = 58;
|
||||
u8 base_y_offset = 9;
|
||||
u8 pos = sPokedexView->sEvoScreenData.menuPos;
|
||||
@ -6263,8 +6245,6 @@ static u8 PrintPreEvolutions(u8 taskId, u16 species)
|
||||
u8 base_x = 13+8;
|
||||
u8 base_y = 51;
|
||||
u8 base_y_offset = 9;
|
||||
u8 base_i = 0;
|
||||
u8 depth_x = 16;
|
||||
|
||||
u16 preEvolutionOne = 0;
|
||||
u16 preEvolutionTwo = 0;
|
||||
@ -6355,8 +6335,7 @@ static u8 PrintPreEvolutions(u8 taskId, u16 species)
|
||||
static u8 PrintEvolutionTargetSpeciesAndMethod(u8 taskId, u16 species, u8 depth, u8 depth_i)
|
||||
{
|
||||
u16 i;
|
||||
u16 j;
|
||||
const struct MapHeader *mapHeader;
|
||||
const struct MapHeader *mapHeader;
|
||||
u16 targetSpecies = 0;
|
||||
u16 previousTargetSpecies = 0;
|
||||
|
||||
@ -6469,119 +6448,119 @@ static u8 PrintEvolutionTargetSpeciesAndMethod(u8 taskId, u16 species, u8 depth,
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, 3); //beauty
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_BEAUTY );
|
||||
break;
|
||||
case EVO_LEVEL_FEMALE:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_FEMALE );
|
||||
break;
|
||||
case EVO_LEVEL_MALE:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_MALE );
|
||||
break;
|
||||
case EVO_LEVEL_NIGHT:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_NIGHT );
|
||||
break;
|
||||
case EVO_LEVEL_DAY:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_DAY );
|
||||
break;
|
||||
case EVO_LEVEL_DUSK:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_DUSK );
|
||||
break;
|
||||
case EVO_ITEM_HOLD_DAY:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_HOLD_DAY );
|
||||
break;
|
||||
case EVO_ITEM_HOLD_NIGHT:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_HOLD_NIGHT );
|
||||
break;
|
||||
case EVO_MOVE:
|
||||
StringCopy(gStringVar2, gMoveNames[gEvolutionTable[species][i].param]);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_MOVE );
|
||||
break;
|
||||
case EVO_FRIENDSHIP_MOVE_TYPE:
|
||||
StringCopy(gStringVar2, gTypeNames[gEvolutionTable[species][i].param]);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_FRIENDSHIP_MOVE_TYPE );
|
||||
break;
|
||||
case EVO_MAPSEC:
|
||||
StringCopy(gStringVar2, gRegionMapEntries[gEvolutionTable[species][i].param].name);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_MAPSEC );
|
||||
break;
|
||||
case EVO_ITEM_MALE:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_MALE );
|
||||
break;
|
||||
case EVO_ITEM_FEMALE:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_FEMALE );
|
||||
break;
|
||||
case EVO_LEVEL_RAIN:
|
||||
//if (j == WEATHER_RAIN || j == WEATHER_RAIN_THUNDERSTORM || j == WEATHER_DOWNPOUR)
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_RAIN );
|
||||
break;
|
||||
case EVO_SPECIFIC_MON_IN_PARTY:
|
||||
StringCopy(gStringVar2, gSpeciesNames[gEvolutionTable[species][i].param]); //mon name
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_SPECIFIC_MON_IN_PARTY );
|
||||
break;
|
||||
case EVO_LEVEL_DARK_TYPE_MON_IN_PARTY:
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_DARK_TYPE_MON_IN_PARTY );
|
||||
break;
|
||||
case EVO_TRADE_SPECIFIC_MON:
|
||||
StringCopy(gStringVar2, gSpeciesNames[gEvolutionTable[species][i].param]); //mon name
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_TRADE_SPECIFIC_MON );
|
||||
break;
|
||||
case EVO_SPECIFIC_MAP:
|
||||
mapHeader = Overworld_GetMapHeaderByGroupAndId(gEvolutionTable[species][i].param >> 8, gEvolutionTable[species][i].param & 0xFF);
|
||||
GetMapName(gStringVar2, mapHeader->regionMapSectionId, 0);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_SPECIFIC_MAP );
|
||||
break;
|
||||
case EVO_LEVEL_NATURE_AMPED:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_NATURE_AMPED);
|
||||
break;
|
||||
case EVO_LEVEL_NATURE_LOW_KEY:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_NATURE_LOW_KEY);
|
||||
break;
|
||||
case EVO_CRITICAL_HITS:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_CRITS_DIGITS); //crits
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_CRITICAL_HITS);
|
||||
break;
|
||||
case EVO_SCRIPT_TRIGGER_DMG:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_DMG_DIGITS); //damage
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_SCRIPT_TRIGGER_DMG);
|
||||
break;
|
||||
case EVO_DARK_SCROLL:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_DARK_SCROLL );
|
||||
break;
|
||||
case EVO_WATER_SCROLL:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_WATER_SCROLL );
|
||||
break;
|
||||
case EVO_ITEM_NIGHT:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_NIGHT );
|
||||
break;
|
||||
case EVO_ITEM_DAY:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_DAY );
|
||||
break;
|
||||
case EVO_ITEM_HOLD:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_HOLD );
|
||||
break;
|
||||
case EVO_LEVEL_FEMALE:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_FEMALE );
|
||||
break;
|
||||
case EVO_LEVEL_MALE:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_MALE );
|
||||
break;
|
||||
case EVO_LEVEL_NIGHT:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_NIGHT );
|
||||
break;
|
||||
case EVO_LEVEL_DAY:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_DAY );
|
||||
break;
|
||||
case EVO_LEVEL_DUSK:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_DUSK );
|
||||
break;
|
||||
case EVO_ITEM_HOLD_DAY:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_HOLD_DAY );
|
||||
break;
|
||||
case EVO_ITEM_HOLD_NIGHT:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_HOLD_NIGHT );
|
||||
break;
|
||||
case EVO_MOVE:
|
||||
StringCopy(gStringVar2, gMoveNames[gEvolutionTable[species][i].param]);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_MOVE );
|
||||
break;
|
||||
case EVO_FRIENDSHIP_MOVE_TYPE:
|
||||
StringCopy(gStringVar2, gTypeNames[gEvolutionTable[species][i].param]);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_FRIENDSHIP_MOVE_TYPE );
|
||||
break;
|
||||
case EVO_MAPSEC:
|
||||
StringCopy(gStringVar2, gRegionMapEntries[gEvolutionTable[species][i].param].name);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_MAPSEC );
|
||||
break;
|
||||
case EVO_ITEM_MALE:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_MALE );
|
||||
break;
|
||||
case EVO_ITEM_FEMALE:
|
||||
item = gEvolutionTable[species][i].param; //item
|
||||
CopyItemName(item, gStringVar2); //item
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_FEMALE );
|
||||
break;
|
||||
case EVO_LEVEL_RAIN:
|
||||
//if (j == WEATHER_RAIN || j == WEATHER_RAIN_THUNDERSTORM || j == WEATHER_DOWNPOUR)
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_RAIN );
|
||||
break;
|
||||
case EVO_SPECIFIC_MON_IN_PARTY:
|
||||
StringCopy(gStringVar2, gSpeciesNames[gEvolutionTable[species][i].param]); //mon name
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_SPECIFIC_MON_IN_PARTY );
|
||||
break;
|
||||
case EVO_LEVEL_DARK_TYPE_MON_IN_PARTY:
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_DARK_TYPE_MON_IN_PARTY );
|
||||
break;
|
||||
case EVO_TRADE_SPECIFIC_MON:
|
||||
StringCopy(gStringVar2, gSpeciesNames[gEvolutionTable[species][i].param]); //mon name
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_TRADE_SPECIFIC_MON );
|
||||
break;
|
||||
case EVO_SPECIFIC_MAP:
|
||||
mapHeader = Overworld_GetMapHeaderByGroupAndId(gEvolutionTable[species][i].param >> 8, gEvolutionTable[species][i].param & 0xFF);
|
||||
GetMapName(gStringVar2, mapHeader->regionMapSectionId, 0);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_SPECIFIC_MAP );
|
||||
break;
|
||||
case EVO_LEVEL_NATURE_AMPED:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_NATURE_AMPED);
|
||||
break;
|
||||
case EVO_LEVEL_NATURE_LOW_KEY:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_LVL_DIGITS); //level
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_LEVEL_NATURE_LOW_KEY);
|
||||
break;
|
||||
case EVO_CRITICAL_HITS:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_CRITS_DIGITS); //crits
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_CRITICAL_HITS);
|
||||
break;
|
||||
case EVO_SCRIPT_TRIGGER_DMG:
|
||||
ConvertIntToDecimalStringN(gStringVar2, gEvolutionTable[species][i].param, STR_CONV_MODE_LEADING_ZEROS, EVO_SCREEN_DMG_DIGITS); //damage
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_SCRIPT_TRIGGER_DMG);
|
||||
break;
|
||||
case EVO_DARK_SCROLL:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_DARK_SCROLL );
|
||||
break;
|
||||
case EVO_WATER_SCROLL:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_WATER_SCROLL );
|
||||
break;
|
||||
case EVO_ITEM_NIGHT:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_NIGHT );
|
||||
break;
|
||||
case EVO_ITEM_DAY:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_DAY );
|
||||
break;
|
||||
case EVO_ITEM_HOLD:
|
||||
item = gEvolutionTable[species][i].param;
|
||||
CopyItemName(item, gStringVar2);
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_ITEM_HOLD );
|
||||
break;
|
||||
default:
|
||||
StringExpandPlaceholders(gStringVar4, gText_EVO_UNKNOWN );
|
||||
break;
|
||||
@ -6852,13 +6831,9 @@ static void PrintForms(u8 taskId, u16 species)
|
||||
u8 j = 1;
|
||||
u16 speciesForm;
|
||||
|
||||
|
||||
bool8 left = TRUE;
|
||||
u8 base_x = 5;
|
||||
u8 base_x_offset = 54;
|
||||
u8 base_y = 52;
|
||||
u8 base_y_offset = 9;
|
||||
u8 base_i = 0;
|
||||
u8 times = 0;
|
||||
u8 y_offset_icons = 0; //For unown only
|
||||
|
||||
@ -6886,10 +6861,13 @@ static void PrintForms(u8 taskId, u16 species)
|
||||
gTasks[taskId].data[4+times] = CreateMonIcon(speciesForm, SpriteCB_MonIcon, 52 + 34*(times-1), 31, 4, 0); //Create pokemon sprite
|
||||
else if (times < 14)
|
||||
gTasks[taskId].data[4+times] = CreateMonIcon(speciesForm, SpriteCB_MonIcon, 18 + 34*(times-7), 70 - y_offset_icons, 4, 0); //Create pokemon sprite
|
||||
// Can't print any more forms, because we're going out of bounds for task data.
|
||||
/*
|
||||
else if (times < 21)
|
||||
gTasks[taskId].data[4+times] = CreateMonIcon(speciesForm, SpriteCB_MonIcon, 18 + 34*(times-14), 104 - y_offset_icons, 4, 0); //Create pokemon sprite
|
||||
else
|
||||
gTasks[taskId].data[4+times] = CreateMonIcon(speciesForm, SpriteCB_MonIcon, 18 + 34*(times-21), 138 - y_offset_icons, 4, 0); //Create pokemon sprite
|
||||
*/
|
||||
gSprites[gTasks[taskId].data[4+times]].oam.priority = 0;
|
||||
}
|
||||
}
|
||||
@ -7550,7 +7528,7 @@ static void Task_ClosePokedexFromSearchResultsStartMenu(u8 taskId)
|
||||
static int DoPokedexSearch(u8 dexMode, u8 order, u8 abcGroup, u8 bodyColor, u8 type1, u8 type2)
|
||||
{
|
||||
u16 species;
|
||||
u16 i,j;
|
||||
u16 i;
|
||||
u16 resultsCount;
|
||||
u8 types[2];
|
||||
|
||||
@ -7738,7 +7716,7 @@ static void Task_LoadSearchMenu(u8 taskId)
|
||||
case 1:
|
||||
LoadCompressedSpriteSheet(&sInterfaceSpriteSheet[HGSS_DECAPPED]);
|
||||
LoadSpritePalettes(sInterfaceSpritePalette);
|
||||
LoadSpritePalettes(sStatBarSpritePal);
|
||||
LoadSpritePalettes(sStatBarSpritePal);
|
||||
CreateSearchParameterScrollArrows(taskId);
|
||||
for (i = 0; i < NUM_TASK_DATA; i++)
|
||||
gTasks[taskId].data[i] = 0;
|
||||
@ -8014,8 +7992,8 @@ static void Task_SearchCompleteWaitForInput(u8 taskId)
|
||||
static void Task_SelectSearchMenuItem(u8 taskId)
|
||||
{
|
||||
u8 menuItem;
|
||||
u16 *cursorPos;
|
||||
u16 *scrollOffset;
|
||||
s16 *cursorPos;
|
||||
s16 *scrollOffset;
|
||||
|
||||
DrawOrEraseSearchParameterBox(FALSE);
|
||||
menuItem = gTasks[taskId].tMenuItem;
|
||||
@ -8035,8 +8013,8 @@ static void Task_HandleSearchParameterInput(u8 taskId)
|
||||
{
|
||||
u8 menuItem;
|
||||
const struct SearchOptionText *texts;
|
||||
u16 *cursorPos;
|
||||
u16 *scrollOffset;
|
||||
s16 *cursorPos;
|
||||
s16 *scrollOffset;
|
||||
u16 maxOption;
|
||||
bool8 moved;
|
||||
|
||||
@ -8354,8 +8332,8 @@ static void DrawOrEraseSearchParameterBox(bool8 erase)
|
||||
static void PrintSearchParameterText(u8 taskId)
|
||||
{
|
||||
const struct SearchOptionText *texts = sSearchOptions[gTasks[taskId].tMenuItem].texts;
|
||||
const u16 *cursorPos = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataCursorPos];
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataScrollOffset];
|
||||
const s16 *cursorPos = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataCursorPos];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[gTasks[taskId].tMenuItem].taskDataScrollOffset];
|
||||
u16 i;
|
||||
u16 j;
|
||||
|
||||
@ -8369,8 +8347,8 @@ static void PrintSearchParameterText(u8 taskId)
|
||||
|
||||
static u8 GetSearchModeSelection(u8 taskId, u8 option)
|
||||
{
|
||||
const u16 *cursorPos = &gTasks[taskId].data[sSearchOptions[option].taskDataCursorPos];
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[option].taskDataScrollOffset];
|
||||
const s16 *cursorPos = &gTasks[taskId].data[sSearchOptions[option].taskDataCursorPos];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[option].taskDataScrollOffset];
|
||||
u16 id = *cursorPos + *scrollOffset;
|
||||
|
||||
switch (option)
|
||||
@ -8441,7 +8419,7 @@ static void SetDefaultSearchModeAndOrder(u8 taskId)
|
||||
static bool8 SearchParamCantScrollUp(u8 taskId)
|
||||
{
|
||||
u8 menuItem = gTasks[taskId].tMenuItem;
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
u16 lastOption = sSearchOptions[menuItem].numOptions - 1;
|
||||
|
||||
if (lastOption > MAX_SEARCH_PARAM_CURSOR_POS && *scrollOffset != 0)
|
||||
@ -8453,7 +8431,7 @@ static bool8 SearchParamCantScrollUp(u8 taskId)
|
||||
static bool8 SearchParamCantScrollDown(u8 taskId)
|
||||
{
|
||||
u8 menuItem = gTasks[taskId].tMenuItem;
|
||||
const u16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
const s16 *scrollOffset = &gTasks[taskId].data[sSearchOptions[menuItem].taskDataScrollOffset];
|
||||
u16 lastOption = sSearchOptions[menuItem].numOptions - 1;
|
||||
|
||||
if (lastOption > MAX_SEARCH_PARAM_CURSOR_POS && *scrollOffset < lastOption - MAX_SEARCH_PARAM_CURSOR_POS)
|
||||
|
||||
111
src/pokemon.c
111
src/pokemon.c
@ -4090,19 +4090,14 @@ static u16 CalculateBoxMonChecksum(struct BoxPokemon *boxMon)
|
||||
return checksum;
|
||||
}
|
||||
|
||||
#if B_FRIENDSHIP_BOOST == TRUE
|
||||
#define CALC_FRIENDSHIP_BOOST() n = n + ((n * 10 * friendship) / (MAX_FRIENDSHIP * 100));
|
||||
#else
|
||||
#define CALC_FRIENDSHIP_BOOST()
|
||||
#endif
|
||||
|
||||
#define CALC_STAT(base, iv, ev, statIndex, field) \
|
||||
{ \
|
||||
u8 baseStat = gSpeciesInfo[species].base; \
|
||||
s32 n = (((2 * baseStat + iv + ev / 4) * level) / 100) + 5; \
|
||||
u8 nature = GetNature(mon); \
|
||||
n = ModifyStatByNature(nature, n, statIndex); \
|
||||
CALC_FRIENDSHIP_BOOST() \
|
||||
if (B_FRIENDSHIP_BOOST == TRUE) \
|
||||
n = n + ((n * 10 * friendship) / (MAX_FRIENDSHIP * 100));\
|
||||
SetMonData(mon, field, &n); \
|
||||
}
|
||||
|
||||
@ -4288,7 +4283,7 @@ void GiveBoxMonInitialMoveset(struct BoxPokemon *boxMon)
|
||||
s32 level = GetLevelFromBoxMonExp(boxMon);
|
||||
s32 i;
|
||||
|
||||
for (i = 0; gLevelUpLearnsets[species][i].move != LEVEL_UP_END; i++)
|
||||
for (i = 0; gLevelUpLearnsets[species][i].move != LEVEL_UP_MOVE_END; i++)
|
||||
{
|
||||
if (gLevelUpLearnsets[species][i].level > level)
|
||||
break;
|
||||
@ -4308,12 +4303,12 @@ void GiveBoxMonInitialMoveset_Fast(struct BoxPokemon *boxMon) //Credit: Asparagu
|
||||
{
|
||||
u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
|
||||
s32 level = GetLevelFromBoxMonExp(boxMon);
|
||||
s32 i, j;
|
||||
s32 i;
|
||||
u16 levelMoveCount = 0;
|
||||
u16 moves[MAX_MON_MOVES] = {0};
|
||||
u8 addedMoves = 0;
|
||||
|
||||
for (i = 0; gLevelUpLearnsets[species][i].move != LEVEL_UP_END; i++)
|
||||
for (i = 0; gLevelUpLearnsets[species][i].move != LEVEL_UP_MOVE_END; i++)
|
||||
levelMoveCount++;
|
||||
|
||||
for (i = levelMoveCount; (i >= 0 && addedMoves < MAX_MON_MOVES); i--)
|
||||
@ -4350,7 +4345,7 @@ u16 MonTryLearningNewMove(struct Pokemon *mon, bool8 firstMove)
|
||||
while (gLevelUpLearnsets[species][sLearningMoveTableID].level != level)
|
||||
{
|
||||
sLearningMoveTableID++;
|
||||
if (gLevelUpLearnsets[species][sLearningMoveTableID].move == LEVEL_UP_END)
|
||||
if (gLevelUpLearnsets[species][sLearningMoveTableID].move == LEVEL_UP_MOVE_END)
|
||||
return MOVE_NONE;
|
||||
}
|
||||
}
|
||||
@ -4607,44 +4602,20 @@ static void DecryptBoxMon(struct BoxPokemon *boxMon)
|
||||
#define SUBSTRUCT_CASE(n, v1, v2, v3, v4) \
|
||||
case n: \
|
||||
{ \
|
||||
union PokemonSubstruct *substructs0 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs1 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs2 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs3 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs4 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs5 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs6 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs7 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs8 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs9 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs10 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs11 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs12 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs13 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs14 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs15 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs16 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs17 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs18 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs19 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs20 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs21 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs22 = boxMon->secure.substructs; \
|
||||
union PokemonSubstruct *substructs23 = boxMon->secure.substructs; \
|
||||
\
|
||||
switch (substructType) \
|
||||
{ \
|
||||
case 0: \
|
||||
substruct = &substructs ## n [v1]; \
|
||||
substruct = &boxMon->secure.substructs[v1]; \
|
||||
break; \
|
||||
case 1: \
|
||||
substruct = &substructs ## n [v2]; \
|
||||
substruct = &boxMon->secure.substructs[v2]; \
|
||||
break; \
|
||||
case 2: \
|
||||
substruct = &substructs ## n [v3]; \
|
||||
substruct = &boxMon->secure.substructs[v3]; \
|
||||
break; \
|
||||
case 3: \
|
||||
substruct = &substructs ## n [v4]; \
|
||||
substruct = &boxMon->secure.substructs[v4]; \
|
||||
break; \
|
||||
} \
|
||||
break; \
|
||||
@ -4748,7 +4719,10 @@ u32 GetMonData3(struct Pokemon *mon, s32 field, u8 *data)
|
||||
return ret;
|
||||
}
|
||||
|
||||
u32 GetMonData2(struct Pokemon *mon, s32 field) __attribute__((alias("GetMonData3")));
|
||||
u32 GetMonData2(struct Pokemon *mon, s32 field)
|
||||
{
|
||||
return GetMonData3(mon, field, NULL);
|
||||
}
|
||||
|
||||
/* GameFreak called GetBoxMonData with either 2 or 3 arguments, for type
|
||||
* safety we have a GetBoxMonData macro (in include/pokemon.h) which
|
||||
@ -5118,7 +5092,10 @@ u32 GetBoxMonData3(struct BoxPokemon *boxMon, s32 field, u8 *data)
|
||||
return retVal;
|
||||
}
|
||||
|
||||
u32 GetBoxMonData2(struct BoxPokemon *boxMon, s32 field) __attribute__((alias("GetBoxMonData3")));
|
||||
u32 GetBoxMonData2(struct BoxPokemon *boxMon, s32 field)
|
||||
{
|
||||
return GetBoxMonData3(boxMon, field, NULL);
|
||||
}
|
||||
|
||||
#define SET8(lhs) (lhs) = *data
|
||||
#define SET16(lhs) (lhs) = data[0] + (data[1] << 8)
|
||||
@ -5781,12 +5758,6 @@ bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex,
|
||||
} \
|
||||
}
|
||||
|
||||
#if B_X_ITEMS_BUFF >= GEN_7
|
||||
#define X_ITEM_STAGES 2
|
||||
#else
|
||||
#define X_ITEM_STAGES 1
|
||||
#endif
|
||||
|
||||
// EXP candies store an index for this table in their holdEffectParam.
|
||||
const u32 sExpCandyExperienceTable[] = {
|
||||
[EXP_100 - 1] = 100,
|
||||
@ -5953,7 +5924,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
|
||||
dataSigned += temp2;
|
||||
}
|
||||
else // Decreasing EV (HP or Atk)
|
||||
else if (evChange < 0) // Decreasing EV (HP or Atk)
|
||||
{
|
||||
if (dataSigned == 0)
|
||||
{
|
||||
@ -5970,6 +5941,13 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if (dataSigned < 0)
|
||||
dataSigned = 0;
|
||||
}
|
||||
else // Reset EV (HP or Atk)
|
||||
{
|
||||
if (dataSigned == 0)
|
||||
break;
|
||||
|
||||
dataSigned = 0;
|
||||
}
|
||||
|
||||
// Update EVs and stats
|
||||
SetMonData(mon, sGetMonDataEVConstants[temp1], &dataSigned);
|
||||
@ -6133,7 +6111,7 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
|
||||
dataSigned += temp2;
|
||||
}
|
||||
else // Decreasing EV
|
||||
else if (evChange < 0) // Decreasing EV
|
||||
{
|
||||
if (dataSigned == 0)
|
||||
{
|
||||
@ -6150,6 +6128,13 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
|
||||
if (dataSigned < 0)
|
||||
dataSigned = 0;
|
||||
}
|
||||
else // Reset EV
|
||||
{
|
||||
if (dataSigned == 0)
|
||||
break;
|
||||
|
||||
dataSigned = 0;
|
||||
}
|
||||
|
||||
// Update EVs and stats
|
||||
SetMonData(mon, sGetMonDataEVConstants[temp1 + 2], &dataSigned);
|
||||
@ -6345,18 +6330,20 @@ static void BufferStatRoseMessage(s32 statIdx)
|
||||
{
|
||||
gBattlerTarget = gBattlerInMenuId;
|
||||
StringCopy(gBattleTextBuff1, gStatNamesTable[sStatsToRaise[statIdx]]);
|
||||
#if B_X_ITEMS_BUFF >= GEN_7
|
||||
StringCopy(gBattleTextBuff2, gText_StatSharply);
|
||||
StringAppend(gBattleTextBuff2, gText_StatRose);
|
||||
#else
|
||||
StringCopy(gBattleTextBuff2, gText_StatRose);
|
||||
#endif
|
||||
if (B_X_ITEMS_BUFF >= GEN_7)
|
||||
{
|
||||
StringCopy(gBattleTextBuff2, gText_StatSharply);
|
||||
StringAppend(gBattleTextBuff2, gText_StatRose);
|
||||
}
|
||||
else
|
||||
{
|
||||
StringCopy(gBattleTextBuff2, gText_StatRose);
|
||||
}
|
||||
BattleStringExpandPlaceholdersToDisplayedString(gText_DefendersStatRose);
|
||||
}
|
||||
|
||||
u8 *UseStatIncreaseItem(u16 itemId)
|
||||
{
|
||||
int i;
|
||||
const u8 *itemEffect;
|
||||
|
||||
if (itemId == ITEM_ENIGMA_BERRY_E_READER)
|
||||
@ -7491,7 +7478,7 @@ u8 GetMoveRelearnerMoves(struct Pokemon *mon, u16 *moves)
|
||||
{
|
||||
u16 moveLevel;
|
||||
|
||||
if (gLevelUpLearnsets[species][i].move == LEVEL_UP_END)
|
||||
if (gLevelUpLearnsets[species][i].move == LEVEL_UP_MOVE_END)
|
||||
break;
|
||||
|
||||
moveLevel = gLevelUpLearnsets[species][i].level;
|
||||
@ -7520,7 +7507,7 @@ u8 GetLevelUpMovesBySpecies(u16 species, u16 *moves)
|
||||
u8 numMoves = 0;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < MAX_LEVEL_UP_MOVES && gLevelUpLearnsets[species][i].move != LEVEL_UP_END; i++)
|
||||
for (i = 0; i < MAX_LEVEL_UP_MOVES && gLevelUpLearnsets[species][i].move != LEVEL_UP_MOVE_END; i++)
|
||||
moves[numMoves++] = gLevelUpLearnsets[species][i].move;
|
||||
|
||||
return numMoves;
|
||||
@ -7545,7 +7532,7 @@ u8 GetNumberOfRelearnableMoves(struct Pokemon *mon)
|
||||
{
|
||||
u16 moveLevel;
|
||||
|
||||
if (gLevelUpLearnsets[species][i].move == LEVEL_UP_END)
|
||||
if (gLevelUpLearnsets[species][i].move == LEVEL_UP_MOVE_END)
|
||||
break;
|
||||
|
||||
moveLevel = gLevelUpLearnsets[species][i].level;
|
||||
@ -8414,7 +8401,7 @@ u16 GetFormChangeTargetSpecies(struct Pokemon *mon, u16 method, u32 arg)
|
||||
// Returns SPECIES_NONE if no form change is possible
|
||||
u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32 arg)
|
||||
{
|
||||
u32 i, j;
|
||||
u32 i;
|
||||
u16 targetSpecies = SPECIES_NONE;
|
||||
u16 species = GetBoxMonData(boxMon, MON_DATA_SPECIES, NULL);
|
||||
const struct FormChange *formChanges = gFormChangeTablePointers[species];
|
||||
@ -8485,7 +8472,7 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32
|
||||
|
||||
bool32 DoesSpeciesHaveFormChangeMethod(u16 species, u16 method)
|
||||
{
|
||||
u32 i, j;
|
||||
u32 i;
|
||||
const struct FormChange *formChanges = gFormChangeTablePointers[species];
|
||||
|
||||
if (formChanges != NULL)
|
||||
@ -8513,7 +8500,7 @@ u16 MonTryLearningNewMoveEvolution(struct Pokemon *mon, bool8 firstMove)
|
||||
{
|
||||
sLearningMoveTableID = 0;
|
||||
}
|
||||
while(gLevelUpLearnsets[species][sLearningMoveTableID].move != LEVEL_UP_END)
|
||||
while(gLevelUpLearnsets[species][sLearningMoveTableID].move != LEVEL_UP_MOVE_END)
|
||||
{
|
||||
while (gLevelUpLearnsets[species][sLearningMoveTableID].level == 0 || gLevelUpLearnsets[species][sLearningMoveTableID].level == level)
|
||||
{
|
||||
|
||||
@ -378,7 +378,7 @@ static void ReloadPokemonSprites(struct PokemonDebugMenu *data);
|
||||
static void Exit_Debug_Pokemon(u8);
|
||||
|
||||
//Text handling functions
|
||||
static void PadString(const u8 *src, u8 *dst)
|
||||
static void UNUSED PadString(const u8 *src, u8 *dst)
|
||||
{
|
||||
u32 i;
|
||||
|
||||
@ -542,7 +542,6 @@ static void ValueToCharDigits(u8 *charDigits, u32 newValue, u8 maxDigits)
|
||||
|
||||
static void SetArrowInvisibility(struct PokemonDebugMenu *data)
|
||||
{
|
||||
bool8 invisible = data->currentSubmenu;
|
||||
switch (data->currentSubmenu)
|
||||
{
|
||||
case 0:
|
||||
@ -672,7 +671,6 @@ static bool32 TryMoveDigit(struct PokemonDebugModifyArrows *modArrows, bool32 mo
|
||||
|
||||
static void UpdateBattlerValue(struct PokemonDebugMenu *data)
|
||||
{
|
||||
u32 i;
|
||||
switch (data->modifyArrows.typeOfVal)
|
||||
{
|
||||
case VAL_U16:
|
||||
@ -706,13 +704,8 @@ static const struct CompressedSpritePalette *GetMonSpritePalStructCustom(u16 spe
|
||||
|
||||
static void BattleLoadOpponentMonSpriteGfxCustom(u16 species, bool8 isFemale, bool8 isShiny, u8 battlerId)
|
||||
{
|
||||
u16 paletteOffset;
|
||||
const void *lzPaletteData;
|
||||
const struct CompressedSpritePalette *palette;
|
||||
|
||||
paletteOffset = 0x100 + battlerId * 16;
|
||||
|
||||
palette = GetMonSpritePalStructCustom(species, isFemale, isShiny);
|
||||
u16 paletteOffset = 0x100 + battlerId * 16;;
|
||||
|
||||
if (isShiny)
|
||||
{
|
||||
@ -1109,9 +1102,7 @@ void CB2_Debug_Pokemon(void)
|
||||
|
||||
FillBgTilemapBufferRect(0, 0, 0, 0, 32, 20, 15);
|
||||
InitBgsFromTemplates(0, sBgTemplates, ARRAY_COUNT(sBgTemplates));
|
||||
data->battleBgType = 0;
|
||||
data->battleTerrain = 0;
|
||||
LoadBattleBg(data->battleBgType , data->battleTerrain);
|
||||
LoadBattleBg(0, BATTLE_TERRAIN_GRASS);
|
||||
|
||||
gMain.state++;
|
||||
break;
|
||||
@ -1262,7 +1253,7 @@ static void ApplyOffsetSpriteValues(struct PokemonDebugMenu *data)
|
||||
gSprites[data->backspriteId].y = DEBUG_MON_BACK_Y + gMonBackPicCoords[species].y_offset + data->offsetsSpriteValues.offset_back_picCoords;
|
||||
//Front
|
||||
gSprites[data->frontspriteId].y = GetBattlerSpriteFinal_YCustom(species, data->offsetsSpriteValues.offset_front_picCoords, data->offsetsSpriteValues.offset_front_elevation);
|
||||
|
||||
|
||||
if (data->currentSubmenu == 2)
|
||||
UpdateShadowSpriteInvisible(data);
|
||||
}
|
||||
|
||||
@ -1072,7 +1072,7 @@ const u8 *const gMonIconTable[NUM_SPECIES + 1] =
|
||||
[SPECIES_PIKACHU_KALOS_CAP] = gMonIcon_PikachuKalosCap,
|
||||
[SPECIES_PIKACHU_ALOLA_CAP] = gMonIcon_PikachuAlolaCap,
|
||||
[SPECIES_PIKACHU_PARTNER_CAP] = gMonIcon_PikachuPartnerCap,
|
||||
[SPECIES_PIKACHU_WORLD_CAP] = gMonIcon_QuestionMark,
|
||||
[SPECIES_PIKACHU_WORLD_CAP] = gMonIcon_PikachuWorldCap,
|
||||
[SPECIES_PICHU_SPIKY_EARED] = gMonIcon_PichuSpikyEared,
|
||||
[SPECIES_UNOWN_B] = gMonIcon_UnownB,
|
||||
[SPECIES_UNOWN_C] = gMonIcon_UnownC,
|
||||
|
||||
@ -3750,9 +3750,8 @@ static void PrintMoveDetails(u16 move)
|
||||
if (sMonSummaryScreen->currPageIndex == PSS_PAGE_BATTLE_MOVES)
|
||||
{
|
||||
moveEffect = gBattleMoves[move].effect;
|
||||
#if B_SHOW_SPLIT_ICON == TRUE
|
||||
ShowSplitIcon(GetBattleMoveSplit(move));
|
||||
#endif
|
||||
if (B_SHOW_SPLIT_ICON == TRUE)
|
||||
ShowSplitIcon(GetBattleMoveSplit(move));
|
||||
PrintMovePowerAndAccuracy(move);
|
||||
|
||||
if (moveEffect != EFFECT_PLACEHOLDER)
|
||||
|
||||
@ -460,20 +460,20 @@ static void Task_MixingRecordsRecv(u8 taskId)
|
||||
task->func = Task_SendPacket;
|
||||
if (Link_AnyPartnersPlayingRubyOrSapphire())
|
||||
{
|
||||
StorePtrInTaskData(sSentRecord, &task->tSentRecord);
|
||||
StorePtrInTaskData(sSentRecord, (u16*) &task->tSentRecord);
|
||||
subTaskId = CreateTask(Task_CopyReceiveBuffer, 80);
|
||||
task->tCopyTaskId = subTaskId;
|
||||
gTasks[subTaskId].tParentTaskId = taskId;
|
||||
StorePtrInTaskData(sReceivedRecords, &gTasks[subTaskId].tRecvRecords);
|
||||
StorePtrInTaskData(sReceivedRecords, (u16*) &gTasks[subTaskId].tRecvRecords);
|
||||
sRecordStructSize = sizeof(struct PlayerRecordRS);
|
||||
}
|
||||
else
|
||||
{
|
||||
StorePtrInTaskData(sSentRecord, &task->tSentRecord);
|
||||
StorePtrInTaskData(sSentRecord, (u16*) &task->tSentRecord);
|
||||
subTaskId = CreateTask(Task_CopyReceiveBuffer, 80);
|
||||
task->tCopyTaskId = subTaskId;
|
||||
gTasks[subTaskId].tParentTaskId = taskId;
|
||||
StorePtrInTaskData(sReceivedRecords, &gTasks[subTaskId].tRecvRecords);
|
||||
StorePtrInTaskData(sReceivedRecords,(u16*) &gTasks[subTaskId].tRecvRecords);
|
||||
sRecordStructSize = sizeof(struct PlayerRecordEmerald);
|
||||
}
|
||||
}
|
||||
@ -495,7 +495,7 @@ static void Task_SendPacket(u8 taskId)
|
||||
{
|
||||
case 0: // Copy record data chunk to send buffer
|
||||
{
|
||||
void *recordData = LoadPtrFromTaskData(&task->tSentRecord) + task->tNumChunksSent * BUFFER_CHUNK_SIZE;
|
||||
void *recordData = LoadPtrFromTaskData((u16*)&task->tSentRecord) + task->tNumChunksSent * BUFFER_CHUNK_SIZE;
|
||||
|
||||
memcpy(gBlockSendBuffer, recordData, BUFFER_CHUNK_SIZE);
|
||||
task->tState++;
|
||||
@ -537,7 +537,7 @@ static void Task_CopyReceiveBuffer(u8 taskId)
|
||||
{
|
||||
if ((status >> i) & 1)
|
||||
{
|
||||
void *dest = LoadPtrFromTaskData(&task->tRecvRecords) + task->tNumChunksRecv(i) * BUFFER_CHUNK_SIZE + sRecordStructSize * i;
|
||||
void *dest = LoadPtrFromTaskData((u16*) &task->tRecvRecords) + task->tNumChunksRecv(i) * BUFFER_CHUNK_SIZE + sRecordStructSize * i;
|
||||
void *src = GetPlayerRecvBuffer(i);
|
||||
if ((task->tNumChunksRecv(i) + 1) * BUFFER_CHUNK_SIZE > sRecordStructSize)
|
||||
memcpy(dest, src, sRecordStructSize - task->tNumChunksRecv(i) * BUFFER_CHUNK_SIZE);
|
||||
@ -765,9 +765,6 @@ static void ReceiveDaycareMailData(struct RecordMixingDaycareMail *records, size
|
||||
struct RecordMixingDaycareMail *mixMail;
|
||||
u8 playerSlot1, playerSlot2;
|
||||
void *ptr;
|
||||
u8 unusedArr1[MAX_LINK_PLAYERS];
|
||||
u8 unusedArr2[MAX_LINK_PLAYERS];
|
||||
struct RecordMixingDaycareMail *unusedMixMail[MAX_LINK_PLAYERS];
|
||||
bool8 canHoldItem[MAX_LINK_PLAYERS][DAYCARE_MON_COUNT];
|
||||
u8 idxs[MAX_LINK_PLAYERS][2];
|
||||
u8 numDaycareCanHold;
|
||||
@ -782,8 +779,6 @@ static void ReceiveDaycareMailData(struct RecordMixingDaycareMail *records, size
|
||||
linkPlayerCount = GetLinkPlayerCount();
|
||||
for (i = 0; i < MAX_LINK_PLAYERS; i++)
|
||||
{
|
||||
unusedArr1[i] = 0xFF;
|
||||
unusedArr2[i] = 0;
|
||||
canHoldItem[i][0] = FALSE;
|
||||
canHoldItem[i][1] = FALSE;
|
||||
}
|
||||
@ -924,7 +919,6 @@ static void ReceiveDaycareMailData(struct RecordMixingDaycareMail *records, size
|
||||
for (i = 0; i < MAX_LINK_PLAYERS; i++)
|
||||
{
|
||||
mixMail = &records[multiplayerId * recordSize];
|
||||
unusedMixMail[i] = mixMail;
|
||||
}
|
||||
|
||||
// Choose a random table id to determine who will
|
||||
|
||||
@ -1124,8 +1124,8 @@ static void RegionMap_InitializeStateBasedOnSSTidalLocation(void)
|
||||
{
|
||||
u16 y;
|
||||
u16 x;
|
||||
u8 mapGroup;
|
||||
u8 mapNum;
|
||||
s8 mapGroup;
|
||||
s8 mapNum;
|
||||
u16 dimensionScale;
|
||||
s16 xOnMap;
|
||||
s16 yOnMap;
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user