From 2f03ac31b9892ed35bde167bb5a33b16e5c896b0 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Thu, 23 Sep 2021 14:31:21 +1200 Subject: [PATCH 01/58] Multihit refactor and Parental Bond Port multihit system from the CFRU, implement Parental Bond, refactor certain moves as required and implement all remaining multi hit moves except Dragon Darts. --- data/battle_scripts_1.s | 111 ++--- include/battle.h | 9 +- include/battle_scripts.h | 2 + include/battle_util.h | 4 + include/constants/battle.h | 111 +++-- include/constants/battle_config.h | 2 + include/constants/battle_script_commands.h | 51 +-- src/battle_main.c | 3 + src/battle_script_commands.c | 470 +++++++++++++-------- src/battle_util.c | 150 +++++++ src/data/battle_moves.h | 10 +- 11 files changed, 590 insertions(+), 333 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 324bb62a6..7d06e34e7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -48,7 +48,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectBide @ EFFECT_BIDE .4byte BattleScript_EffectRampage @ EFFECT_RAMPAGE .4byte BattleScript_EffectRoar @ EFFECT_ROAR - .4byte BattleScript_EffectMultiHit @ EFFECT_MULTI_HIT + .4byte BattleScript_EffectHit @ EFFECT_MULTI_HIT .4byte BattleScript_EffectConversion @ EFFECT_CONVERSION .4byte BattleScript_EffectFlinchHit @ EFFECT_FLINCH_HIT .4byte BattleScript_EffectRestoreHp @ EFFECT_RESTORE_HP @@ -63,11 +63,11 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectDragonRage @ EFFECT_DRAGON_RAGE .4byte BattleScript_EffectTrap @ EFFECT_TRAP .4byte BattleScript_EffectHealBlock @ EFFECT_HEAL_BLOCK - .4byte BattleScript_EffectDoubleHit @ EFFECT_DOUBLE_HIT + .4byte BattleScript_EffectHit @ EFFECT_DOUBLE_HIT .4byte BattleScript_EffectRecoilIfMiss @ EFFECT_RECOIL_IF_MISS .4byte BattleScript_EffectMist @ EFFECT_MIST .4byte BattleScript_EffectFocusEnergy @ EFFECT_FOCUS_ENERGY - .4byte BattleScript_EffectRecoil25 @ EFFECT_RECOIL_25 + .4byte BattleScript_EffectHit @ EFFECT_RECOIL_25 .4byte BattleScript_EffectConfuse @ EFFECT_CONFUSE .4byte BattleScript_EffectAttackUp2 @ EFFECT_ATTACK_UP_2 .4byte BattleScript_EffectDefenseUp2 @ EFFECT_DEFENSE_UP_2 @@ -217,7 +217,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectSnatch @ EFFECT_SNATCH .4byte BattleScript_EffectHit @ EFFECT_LOW_KICK .4byte BattleScript_EffectSecretPower @ EFFECT_SECRET_POWER - .4byte BattleScript_EffectRecoil33 @ EFFECT_RECOIL_33 + .4byte BattleScript_EffectHit @ EFFECT_RECOIL_33 .4byte BattleScript_EffectTeeterDance @ EFFECT_TEETER_DANCE .4byte BattleScript_EffectHitEscape @ EFFECT_HIT_ESCAPE .4byte BattleScript_EffectMudSport @ EFFECT_MUD_SPORT @@ -306,9 +306,9 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectGrowth @ EFFECT_GROWTH .4byte BattleScript_EffectCloseCombat @ EFFECT_CLOSE_COMBAT .4byte BattleScript_EffectLastResort @ EFFECT_LAST_RESORT - .4byte BattleScript_EffectRecoil33WithStatus @ EFFECT_RECOIL_33_STATUS + .4byte BattleScript_EffectHit @ EFFECT_RECOIL_33_STATUS .4byte BattleScript_EffectFlinchWithStatus @ EFFECT_FLINCH_STATUS - .4byte BattleScript_EffectRecoil50 @ EFFECT_RECOIL_50 + .4byte BattleScript_EffectHit @ EFFECT_RECOIL_50 .4byte BattleScript_EffectShellSmash @ EFFECT_SHELL_SMASH .4byte BattleScript_EffectShiftGear @ EFFECT_SHIFT_GEAR .4byte BattleScript_EffectDefenseUp3 @ EFFECT_DEFENSE_UP_3 @@ -407,9 +407,11 @@ BattleScript_EffectBurnUp: attackstring ppreduce jumpiftype BS_ATTACKER, TYPE_FIRE, BattleScript_BurnUpWorks - goto BattleScript_ButItFailed + goto BattleScript_MoveEnd BattleScript_BurnUpWorks: accuracycheck BattleScript_MoveMissedPause, ACC_CURR_MOVE + setmoveeffect MOVE_EFFECT_BURN_UP + seteffectwithchance critcalc damagecalc adjustdamage @@ -424,11 +426,14 @@ BattleScript_BurnUpWorks: waitmessage B_WAIT_TIME_LONG resultmessage waitmessage B_WAIT_TIME_LONG + tryfaintmon BS_TARGET, FALSE, NULL + goto BattleScript_MoveEnd + +BattleScript_BurnUpRemoveType:: losetype BS_ATTACKER, TYPE_FIRE printstring STRINGID_ATTACKERLOSTFIRETYPE waitmessage B_WAIT_TIME_LONG - tryfaintmon BS_TARGET, FALSE, NULL - goto BattleScript_MoveEnd + return BattleScript_EffectPurify: attackcanceler @@ -2593,6 +2598,8 @@ BattleScript_MultiHitPrintStrings:: copyarray gBattleTextBuff1, sMULTIHIT_STRING, 6 printstring STRINGID_HITXTIMES waitmessage B_WAIT_TIME_LONG + return + BattleScript_MultiHitEnd:: seteffectwithchance tryfaintmon BS_TARGET, FALSE, NULL @@ -3497,57 +3504,16 @@ BattleScript_PartyHealEnd:: BattleScript_EffectTripleKick:: attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring ppreduce - sethword sTRIPLE_KICK_POWER, 0 - initmultihitstring - setmultihit 3 -BattleScript_TripleKickLoop:: - jumpifhasnohp BS_ATTACKER, BattleScript_TripleKickEnd - jumpifhasnohp BS_TARGET, BattleScript_TripleKickNoMoreHits - jumpifhalfword CMP_EQUAL, gChosenMove, MOVE_SLEEP_TALK, BattleScript_DoTripleKickAttack - jumpifstatus BS_ATTACKER, STATUS1_SLEEP, BattleScript_TripleKickNoMoreHits -BattleScript_DoTripleKickAttack:: - accuracycheck BattleScript_TripleKickNoMoreHits, ACC_CURR_MOVE - movevaluescleanup - addbyte sTRIPLE_KICK_POWER, 10 - addbyte sMULTIHIT_STRING + 4, 1 - critcalc - damagecalc - adjustdamage - jumpifmovehadnoeffect BattleScript_TripleKickNoMoreHits - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - printstring STRINGID_EMPTYSTRING3 - waitmessage 1 - moveendto MOVEEND_NEXT_TARGET - jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_FOE_ENDURED, BattleScript_TripleKickPrintStrings - decrementmultihit BattleScript_TripleKickLoop - goto BattleScript_TripleKickPrintStrings -BattleScript_TripleKickNoMoreHits:: - pause B_WAIT_TIME_SHORT - jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0, BattleScript_TripleKickPrintStrings - bichalfword gMoveResultFlags, MOVE_RESULT_MISSED -BattleScript_TripleKickPrintStrings:: - resultmessage - waitmessage B_WAIT_TIME_LONG - jumpifbyte CMP_EQUAL, sMULTIHIT_STRING + 4, 0, BattleScript_TripleKickEnd - jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_TripleKickEnd - copyarray gBattleTextBuff1, sMULTIHIT_STRING, 6 - printstring STRINGID_HITXTIMES - waitmessage B_WAIT_TIME_LONG -BattleScript_TripleKickEnd:: - seteffectwithchance - tryfaintmon BS_TARGET, FALSE, NULL - moveendfrom MOVEEND_UPDATE_LAST_MOVES - end + jumpifmove MOVE_TRIPLE_AXEL BS_TripleAxel + addbyte sTRIPLE_KICK_POWER 10 + goto BattleScript_HitFromAtkString + +BS_TripleAxel: + addbyte sTRIPLE_KICK_POWER 20 + goto BattleScript_HitFromAtkString BattleScript_EffectThief:: setmoveeffect MOVE_EFFECT_STEAL_ITEM @@ -4064,6 +4030,7 @@ BattleScript_EffectTeleport: setoutcomeonteleport BS_ATTACKER goto BattleScript_MoveEnd +.if B_BEAT_UP_DMG < GEN_5 BattleScript_EffectBeatUp:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE @@ -4096,6 +4063,13 @@ BattleScript_BeatUpAttack:: goto BattleScript_BeatUpLoop BattleScript_BeatUpEnd:: end +.else +BattleScript_EffectBeatUp:: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + addbyte gBattleCommunication, 1 + goto BattleScript_HitFromAtkString +.endif BattleScript_EffectSemiInvulnerable:: jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_SecondTurnSemiInvulnerable @@ -4717,24 +4691,6 @@ BattleScript_EffectSecretPower:: getsecretpowereffect goto BattleScript_EffectHit -BattleScript_EffectRecoil25: - setmoveeffect MOVE_EFFECT_RECOIL_25 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN - jumpifnotmove MOVE_STRUGGLE, BattleScript_EffectHit - incrementgamestat GAME_STAT_USED_STRUGGLE - goto BattleScript_EffectHit - -BattleScript_EffectRecoil33:: - setmoveeffect MOVE_EFFECT_RECOIL_33 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN - goto BattleScript_EffectHit - -BattleScript_EffectRecoil33WithStatus: - setmoveeffect MOVE_EFFECT_RECOIL_33_STATUS | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN - goto BattleScript_EffectHit - -BattleScript_EffectRecoil50: - setmoveeffect MOVE_EFFECT_RECOIL_50 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN - goto BattleScript_EffectHit - BattleScript_EffectTeeterDance:: attackcanceler attackstring @@ -6657,7 +6613,6 @@ BattleScript_MoveEffectConfusion:: BattleScript_MoveEffectRecoilWithStatus:: argumentstatuseffect - copyword gBattleMoveDamage, sSAVED_DMG BattleScript_MoveEffectRecoil:: jumpifmove MOVE_STRUGGLE, BattleScript_DoRecoil jumpifability BS_ATTACKER, ABILITY_ROCK_HEAD, BattleScript_RecoilEnd @@ -7600,6 +7555,7 @@ BattleScript_BerryCureSlpRet:: BattleScript_GemActivates:: playanimation BS_ATTACKER, B_ANIM_HELD_ITEM_EFFECT, NULL waitanimation + setlastuseditem BS_ATTACKER printstring STRINGID_GEMACTIVATES waitmessage B_WAIT_TIME_LONG removeitem BS_ATTACKER @@ -7608,6 +7564,7 @@ BattleScript_GemActivates:: BattleScript_BerryReduceDmg:: playanimation BS_TARGET, B_ANIM_HELD_ITEM_EFFECT, NULL waitanimation + setlastuseditem BS_TARGET printstring STRINGID_TARGETATEITEM waitmessage B_WAIT_TIME_LONG removeitem BS_TARGET diff --git a/include/battle.h b/include/battle.h index 36646c9fe..98c9a825e 100644 --- a/include/battle.h +++ b/include/battle.h @@ -162,15 +162,20 @@ struct SpecialStatus u8 traced:1; u8 ppNotAffectedByPressure:1; u8 flag40:1; - u8 focusBanded:1; + // end of byte + u8 focusBanded:1; u8 focusSashed:1; u8 sturdied:1; u8 stormDrainRedirected:1; u8 switchInAbilityDone:1; - u8 switchInItemDone:1; + u8 switchInItemDone:1; + // end of byte, two bits unused u8 instructedChosenTarget:3; u8 berryReduced:1; u8 gemBoost:1; + u8 parentalBondOn:2; + u8 multiHitOn:1; + // end of byte u8 gemParam; u8 damagedMons:4; // Mons that have been damaged directly by using a move, includes substitute. u8 dancerUsedMove:1; diff --git a/include/battle_scripts.h b/include/battle_scripts.h index b15ab3aeb..2229f0a05 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -384,5 +384,7 @@ extern const u8 BattleScript_MentalHerbCureEnd2[]; extern const u8 BattleScript_TerrainPreventsEnd2[]; extern const u8 BattleScript_MistyTerrainPrevents[]; extern const u8 BattleScript_ElectricTerrainPrevents[]; +extern const u8 BattleScript_MultiHitPrintStrings[]; +extern const u8 BattleScript_BurnUpRemoveType[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/battle_util.h b/include/battle_util.h index 26bfe3c7c..25be32939 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -152,6 +152,7 @@ bool32 CompareStat(u8 battlerId, u8 statId, u8 cmpTo, u8 cmpKind); bool32 TryRoomService(u8 battlerId); void BufferStatChange(u8 battlerId, u8 statId, u8 stringId); void DoBurmyFormChange(u32 monId); +bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId); // ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability); @@ -170,4 +171,7 @@ bool32 CanBeFrozen(u8 battlerId); bool32 CanBeConfused(u8 battlerId); bool32 IsBattlerTerrainAffected(u8 battlerId, u32 terrainFlag); +// Move checks +bool8 IsTwoStrikesMove(u16 move); + #endif // GUARD_BATTLE_UTIL_H diff --git a/include/constants/battle.h b/include/constants/battle.h index 73d5c3deb..18001a1a2 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -291,63 +291,60 @@ #define MOVE_EFFECT_PAYDAY 0xB #define MOVE_EFFECT_CHARGING 0xC #define MOVE_EFFECT_WRAP 0xD -#define MOVE_EFFECT_RECOIL_25 0xE -#define MOVE_EFFECT_ATK_PLUS_1 0xF -#define MOVE_EFFECT_DEF_PLUS_1 0x10 -#define MOVE_EFFECT_SPD_PLUS_1 0x11 -#define MOVE_EFFECT_SP_ATK_PLUS_1 0x12 -#define MOVE_EFFECT_SP_DEF_PLUS_1 0x13 -#define MOVE_EFFECT_ACC_PLUS_1 0x14 -#define MOVE_EFFECT_EVS_PLUS_1 0x15 -#define MOVE_EFFECT_ATK_MINUS_1 0x16 -#define MOVE_EFFECT_DEF_MINUS_1 0x17 -#define MOVE_EFFECT_SPD_MINUS_1 0x18 -#define MOVE_EFFECT_SP_ATK_MINUS_1 0x19 -#define MOVE_EFFECT_SP_DEF_MINUS_1 0x1A -#define MOVE_EFFECT_ACC_MINUS_1 0x1B -#define MOVE_EFFECT_EVS_MINUS_1 0x1C -#define MOVE_EFFECT_RECHARGE 0x1D -#define MOVE_EFFECT_RAGE 0x1E -#define MOVE_EFFECT_STEAL_ITEM 0x1F -#define MOVE_EFFECT_PREVENT_ESCAPE 0x20 -#define MOVE_EFFECT_NIGHTMARE 0x21 -#define MOVE_EFFECT_ALL_STATS_UP 0x22 -#define MOVE_EFFECT_RAPIDSPIN 0x23 -#define MOVE_EFFECT_REMOVE_STATUS 0x24 -#define MOVE_EFFECT_ATK_DEF_DOWN 0x25 -#define MOVE_EFFECT_RECOIL_33 0x26 -#define MOVE_EFFECT_ATK_PLUS_2 0x27 -#define MOVE_EFFECT_DEF_PLUS_2 0x28 -#define MOVE_EFFECT_SPD_PLUS_2 0x29 -#define MOVE_EFFECT_SP_ATK_PLUS_2 0x2A -#define MOVE_EFFECT_SP_DEF_PLUS_2 0x2B -#define MOVE_EFFECT_ACC_PLUS_2 0x2C -#define MOVE_EFFECT_EVS_PLUS_2 0x2D -#define MOVE_EFFECT_ATK_MINUS_2 0x2E -#define MOVE_EFFECT_DEF_MINUS_2 0x2F -#define MOVE_EFFECT_SPD_MINUS_2 0x30 -#define MOVE_EFFECT_SP_ATK_MINUS_2 0x31 -#define MOVE_EFFECT_SP_DEF_MINUS_2 0x32 -#define MOVE_EFFECT_ACC_MINUS_2 0x33 -#define MOVE_EFFECT_EVS_MINUS_2 0x34 -#define MOVE_EFFECT_THRASH 0x35 -#define MOVE_EFFECT_KNOCK_OFF 0x36 -#define MOVE_EFFECT_DEF_SPDEF_DOWN 0x37 -#define MOVE_EFFECT_RECOIL_33_STATUS 0x38 -#define MOVE_EFFECT_RECOIL_50 0x39 -#define MOVE_EFFECT_CLEAR_SMOG 0x3A -#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x3B -#define MOVE_EFFECT_SMACK_DOWN 0x3C -#define MOVE_EFFECT_FLAME_BURST 0x3D -#define MOVE_EFFECT_FEINT 0x3E -#define MOVE_EFFECT_SPECTRAL_THIEF 0x3F -#define MOVE_EFFECT_V_CREATE 0x40 -#define MOVE_EFFECT_HAPPY_HOUR 0x41 -#define MOVE_EFFECT_CORE_ENFORCER 0x42 -#define MOVE_EFFECT_THROAT_CHOP 0x43 -#define MOVE_EFFECT_INCINERATE 0x44 -#define MOVE_EFFECT_BUG_BITE 0x45 -#define NUM_MOVE_EFFECTS 0x46 +#define MOVE_EFFECT_ATK_PLUS_1 0xE +#define MOVE_EFFECT_DEF_PLUS_1 0xF +#define MOVE_EFFECT_SPD_PLUS_1 0x10 +#define MOVE_EFFECT_SP_ATK_PLUS_1 0x11 +#define MOVE_EFFECT_SP_DEF_PLUS_1 0x12 +#define MOVE_EFFECT_ACC_PLUS_1 0x13 +#define MOVE_EFFECT_EVS_PLUS_1 0x14 +#define MOVE_EFFECT_ATK_MINUS_1 0x15 +#define MOVE_EFFECT_DEF_MINUS_1 0x16 +#define MOVE_EFFECT_SPD_MINUS_1 0x17 +#define MOVE_EFFECT_SP_ATK_MINUS_1 0x18 +#define MOVE_EFFECT_SP_DEF_MINUS_1 0x19 +#define MOVE_EFFECT_ACC_MINUS_1 0x1A +#define MOVE_EFFECT_EVS_MINUS_1 0x1B +#define MOVE_EFFECT_RECHARGE 0x1C +#define MOVE_EFFECT_RAGE 0x1D +#define MOVE_EFFECT_STEAL_ITEM 0x1E +#define MOVE_EFFECT_PREVENT_ESCAPE 0x1F +#define MOVE_EFFECT_NIGHTMARE 0x20 +#define MOVE_EFFECT_ALL_STATS_UP 0x21 +#define MOVE_EFFECT_RAPIDSPIN 0x22 +#define MOVE_EFFECT_REMOVE_STATUS 0x23 +#define MOVE_EFFECT_ATK_DEF_DOWN 0x24 +#define MOVE_EFFECT_ATK_PLUS_2 0x25 +#define MOVE_EFFECT_DEF_PLUS_2 0x26 +#define MOVE_EFFECT_SPD_PLUS_2 0x27 +#define MOVE_EFFECT_SP_ATK_PLUS_2 0x28 +#define MOVE_EFFECT_SP_DEF_PLUS_2 0x29 +#define MOVE_EFFECT_ACC_PLUS_2 0x2A +#define MOVE_EFFECT_EVS_PLUS_2 0x2B +#define MOVE_EFFECT_ATK_MINUS_2 0x2C +#define MOVE_EFFECT_DEF_MINUS_2 0x2D +#define MOVE_EFFECT_SPD_MINUS_2 0x2E +#define MOVE_EFFECT_SP_ATK_MINUS_2 0x2F +#define MOVE_EFFECT_SP_DEF_MINUS_2 0x30 +#define MOVE_EFFECT_ACC_MINUS_2 0x31 +#define MOVE_EFFECT_EVS_MINUS_2 0x32 +#define MOVE_EFFECT_THRASH 0x33 +#define MOVE_EFFECT_KNOCK_OFF 0x34 +#define MOVE_EFFECT_DEF_SPDEF_DOWN 0x35 +#define MOVE_EFFECT_CLEAR_SMOG 0x36 +#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x37 +#define MOVE_EFFECT_SMACK_DOWN 0x38 +#define MOVE_EFFECT_FLAME_BURST 0x39 +#define MOVE_EFFECT_FEINT 0x3A +#define MOVE_EFFECT_SPECTRAL_THIEF 0x3B +#define MOVE_EFFECT_V_CREATE 0x3C +#define MOVE_EFFECT_HAPPY_HOUR 0x3D +#define MOVE_EFFECT_CORE_ENFORCER 0x3E +#define MOVE_EFFECT_THROAT_CHOP 0x3F +#define MOVE_EFFECT_INCINERATE 0x40 +#define MOVE_EFFECT_BUG_BITE 0x41 +#define MOVE_EFFECT_BURN_UP 0x42 +#define NUM_MOVE_EFFECTS 0x43 #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index b2559dbb7..e1888a500 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -96,6 +96,7 @@ #define B_RECOIL_IF_MISS_DMG GEN_7 // In Gen5+, Jump Kick and High Jump Kick will always do half of the user's max HP when missing. #define B_PSYWAVE_DMG GEN_7 // Psywave's damage formula. See Cmd_psywavedamageeffect. #define B_BADGE_BOOST GEN_7 // In Gen4+, Gym Badges no longer boost a Pokémon's stats. +#define B_BEAT_UP_DMG GEN_8 // In Gen5+, Beat Up uses a different formula to calculate the damage of each hit, and deals Dark-type damage. // Move data settings #define B_UPDATED_MOVE_DATA GEN_8 // Updates move data in gBattleMoves, including Power, Accuracy, PP, stat changes, targets, chances of secondary effects, etc. @@ -128,6 +129,7 @@ #define B_FLASH_FIRE_FROZEN GEN_7 // In Gen5+, Flash Fire can trigger even when frozen, when it couldn't before. #define B_SYNCHRONIZE_NATURE GEN_8 // In Gen8, if the Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously. #define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. +#define B_PARENTAL_BOND_DAMAGE GEN_8 // In Gen7+, Parental Bond's second hit does 25% of the initial hits damage. Before, it did 50%. // Item settings #define B_HP_BERRIES GEN_7 // In Gen4+, berries which restore hp activate immediately after HP drops to half. In Gen3, the effect occurs at the end of the turn. diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 66f592503..0b037b9a1 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -217,36 +217,39 @@ #define PARTY_SCREEN_OPTIONAL (1 << 7) // Flag for first argument to openpartyscreen // cases for Cmd_moveend -#define MOVEEND_PROTECT_LIKE_EFFECT 0 -#define MOVEEND_RAGE 1 -#define MOVEEND_DEFROST 2 +#define MOVEEND_SUM_DAMAGE 0 +#define MOVEEND_PROTECT_LIKE_EFFECT 1 +#define MOVEEND_RAGE 2 #define MOVEEND_SYNCHRONIZE_TARGET 3 #define MOVEEND_ABILITIES 4 #define MOVEEND_ABILITIES_ATTACKER 5 #define MOVEEND_STATUS_IMMUNITY_ABILITIES 6 #define MOVEEND_SYNCHRONIZE_ATTACKER 7 #define MOVEEND_CHOICE_MOVE 8 -#define MOVEEND_CHANGED_ITEMS 9 -#define MOVEEND_ATTACKER_INVISIBLE 10 -#define MOVEEND_ATTACKER_VISIBLE 11 -#define MOVEEND_TARGET_VISIBLE 12 -#define MOVEEND_ITEM_EFFECTS_TARGET 13 -#define MOVEEND_MOVE_EFFECTS2 14 -#define MOVEEND_ITEM_EFFECTS_ALL 15 -#define MOVEEND_KINGSROCK 16 // These item effects will occur each strike of a multi-hit move -#define MOVEEND_SUBSTITUTE 17 -#define MOVEEND_UPDATE_LAST_MOVES 18 -#define MOVEEND_MIRROR_MOVE 19 -#define MOVEEND_NEXT_TARGET 20 // Everything up until here is handled for each strike of a multi-hit move -#define MOVEEND_EJECT_BUTTON 21 -#define MOVEEND_RED_CARD 22 -#define MOVEEND_EJECT_PACK 23 -#define MOVEEND_LIFEORB_SHELLBELL 24 // Includes shell bell, throat spray, etc -#define MOVEEND_PICKPOCKET 25 -#define MOVEEND_DANCER 26 -#define MOVEEND_EMERGENCY_EXIT 27 -#define MOVEEND_CLEAR_BITS 28 -#define MOVEEND_COUNT 29 +#define MOVEEND_ATTACKER_INVISIBLE 9 +#define MOVEEND_ATTACKER_VISIBLE 10 +#define MOVEEND_TARGET_VISIBLE 11 +#define MOVEEND_ITEM_EFFECTS_TARGET 12 +#define MOVEEND_ITEM_EFFECTS_ALL 13 +#define MOVEEND_KINGSROCK 14 +#define MOVEEND_SUBSTITUTE 15 +#define MOVEEND_UPDATE_LAST_MOVES 16 +#define MOVEEND_MIRROR_MOVE 17 +#define MOVEEND_NEXT_TARGET 18 // Everything up until here is handled for each strike of a multi-hit move +#define MOVEEND_MULTIHIT_MOVE 19 +#define MOVEEND_MOVE_EFFECTS2 20 +#define MOVEEND_RECOIL 21 +#define MOVEEND_EJECT_BUTTON 22 +#define MOVEEND_RED_CARD 23 +#define MOVEEND_EJECT_PACK 24 +#define MOVEEND_LIFEORB_SHELLBELL 25 // Includes shell bell, throat spray, etc +#define MOVEEND_CHANGED_ITEMS 26 +#define MOVEEND_DEFROST 27 +#define MOVEEND_PICKPOCKET 28 +#define MOVEEND_DANCER 29 +#define MOVEEND_EMERGENCY_EXIT 30 +#define MOVEEND_CLEAR_BITS 31 +#define MOVEEND_COUNT 32 // switch cases #define B_SWITCH_NORMAL 0 diff --git a/src/battle_main.c b/src/battle_main.c index 72d05a0fd..074633437 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -2894,6 +2894,7 @@ static void BattleStartClearSetData(void) gBattleScripting.monCaught = FALSE; gMultiHitCounter = 0; + gBattleScripting.savedDmg = 0; gBattleOutcome = 0; gBattleControllerExecFlags = 0; gPaydayMoney = 0; @@ -4563,6 +4564,8 @@ static void TurnValuesCleanUp(bool8 var0) if (gDisableStructs[gActiveBattler].substituteHP == 0) gBattleMons[gActiveBattler].status2 &= ~(STATUS2_SUBSTITUTE); + + gSpecialStatuses[gActiveBattler].parentalBondOn = 0; } gSideStatuses[0] &= ~(SIDE_STATUS_QUICK_GUARD | SIDE_STATUS_WIDE_GUARD | SIDE_STATUS_CRAFTY_SHIELD | SIDE_STATUS_MAT_BLOCK); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 5840e8805..4e8af061e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -862,8 +862,6 @@ static const u8* const sMoveEffectBS_Ptrs[] = [MOVE_EFFECT_UPROAR] = BattleScript_MoveEffectUproar, [MOVE_EFFECT_PAYDAY] = BattleScript_MoveEffectPayDay, [MOVE_EFFECT_WRAP] = BattleScript_MoveEffectWrap, - [MOVE_EFFECT_RECOIL_25] = BattleScript_MoveEffectRecoil, - [MOVE_EFFECT_RECOIL_33] = BattleScript_MoveEffectRecoil, }; static const struct WindowTemplate sUnusedWinTemplate = {0, 1, 3, 7, 0xF, 0x1F, 0x3F}; @@ -908,6 +906,7 @@ static const u16 sProtectSuccessRates[] = {USHRT_MAX, USHRT_MAX / 2, USHRT_MAX / #define FORBIDDEN_ASSIST 0x4 #define FORBIDDEN_COPYCAT 0x8 #define FORBIDDEN_SLEEP_TALK 0x10 +#define FORBIDDEN_PARENTAL_BOND 0x20 #define FORBIDDEN_INSTRUCT_END 0xFFFF @@ -917,27 +916,34 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_STRUGGLE] = 0xFF, // Neither Struggle [MOVE_AFTER_YOU] = FORBIDDEN_METRONOME, [MOVE_APPLE_ACID] = FORBIDDEN_METRONOME, + [MOVE_ARM_THRUST] = FORBIDDEN_PARENTAL_BOND, [MOVE_ASSIST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, [MOVE_ASTRAL_BARRAGE] = FORBIDDEN_METRONOME, [MOVE_AURA_WHEEL] = FORBIDDEN_METRONOME, [MOVE_BADDY_BAD] = FORBIDDEN_METRONOME, [MOVE_BANEFUL_BUNKER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, + [MOVE_BARRAGE] = FORBIDDEN_PARENTAL_BOND, [MOVE_BEAK_BLAST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_BEAT_UP] = FORBIDDEN_PARENTAL_BOND, [MOVE_BEHEMOTH_BASH] = FORBIDDEN_METRONOME | FORBIDDEN_COPYCAT, [MOVE_BEHEMOTH_BLADE] = FORBIDDEN_METRONOME | FORBIDDEN_COPYCAT, [MOVE_BELCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, [MOVE_BESTOW] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_BIDE] = FORBIDDEN_SLEEP_TALK, [MOVE_BODY_PRESS] = FORBIDDEN_METRONOME, - [MOVE_BOUNCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, + [MOVE_BONE_RUSH] = FORBIDDEN_PARENTAL_BOND, + [MOVE_BONEMERANG] = FORBIDDEN_PARENTAL_BOND, + [MOVE_BOUNCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, [MOVE_BOUNCY_BUBBLE] = FORBIDDEN_METRONOME, [MOVE_BRANCH_POKE] = FORBIDDEN_METRONOME, [MOVE_BREAKING_SWIPE] = FORBIDDEN_METRONOME, + [MOVE_BULLET_SEED] = FORBIDDEN_PARENTAL_BOND, [MOVE_BUZZY_BUZZ] = FORBIDDEN_METRONOME, [MOVE_CELEBRATE] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, [MOVE_CHATTER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK, [MOVE_CIRCLE_THROW] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_CLANGOROUS_SOUL] = FORBIDDEN_METRONOME, + [MOVE_COMET_PUNCH] = FORBIDDEN_PARENTAL_BOND, [MOVE_COPYCAT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, [MOVE_COUNTER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_COVET] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, @@ -946,36 +952,54 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_DESTINY_BOND] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_DETECT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_DIAMOND_STORM] = FORBIDDEN_METRONOME, - [MOVE_DIG] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, - [MOVE_DIVE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, - [MOVE_DOUBLE_IRON_BASH] = FORBIDDEN_METRONOME, + [MOVE_DIG] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, + [MOVE_DIVE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, + [MOVE_DOUBLE_IRON_BASH] = FORBIDDEN_METRONOME | FORBIDDEN_PARENTAL_BOND, + [MOVE_DOUBLE_HIT] = FORBIDDEN_PARENTAL_BOND, + [MOVE_DOUBLE_KICK] = FORBIDDEN_PARENTAL_BOND, + [MOVE_DOUBLE_SLAP] = FORBIDDEN_PARENTAL_BOND, [MOVE_DRAGON_ASCENT] = FORBIDDEN_METRONOME, [MOVE_DRAGON_ENERGY] = FORBIDDEN_METRONOME, + [MOVE_DRAGON_DARTS] = FORBIDDEN_PARENTAL_BOND, [MOVE_DRAGON_TAIL] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_DRUM_BEATING] = FORBIDDEN_METRONOME, + [MOVE_DUAL_CHOP] = FORBIDDEN_PARENTAL_BOND, + [MOVE_DUAL_WINGBEAT] = FORBIDDEN_PARENTAL_BOND, [MOVE_DYNAMAX_CANNON] = FORBIDDEN_METRONOME | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_ENDEAVOR] = FORBIDDEN_PARENTAL_BOND, [MOVE_ENDURE] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_ETERNABEAM] = FORBIDDEN_METRONOME, + [MOVE_EXPLOSION] = FORBIDDEN_PARENTAL_BOND, [MOVE_FALSE_SURRENDER] = FORBIDDEN_METRONOME, [MOVE_FEINT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_FIERY_WRATH] = FORBIDDEN_METRONOME, + [MOVE_FINAL_GAMBIT] = FORBIDDEN_PARENTAL_BOND, + [MOVE_FISSURE] = FORBIDDEN_PARENTAL_BOND, [MOVE_FLEUR_CANNON] = FORBIDDEN_METRONOME, + [MOVE_FLING] = FORBIDDEN_PARENTAL_BOND, [MOVE_FLOATY_FALL] = FORBIDDEN_METRONOME, - [MOVE_FLY] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, + [MOVE_FLY] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, [MOVE_FOCUS_PUNCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, [MOVE_FOLLOW_ME] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_FREEZE_SHOCK] = FORBIDDEN_METRONOME | FORBIDDEN_SLEEP_TALK, + [MOVE_FREEZE_SHOCK] = FORBIDDEN_METRONOME | FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, [MOVE_FREEZING_GLARE] = FORBIDDEN_METRONOME, [MOVE_FREEZY_FROST] = FORBIDDEN_METRONOME, - [MOVE_GEOMANCY] = FORBIDDEN_SLEEP_TALK, + [MOVE_FURY_ATTACK] = FORBIDDEN_PARENTAL_BOND, + [MOVE_FURY_SWIPES] = FORBIDDEN_PARENTAL_BOND, + [MOVE_GEAR_GRIND] = FORBIDDEN_PARENTAL_BOND, + [MOVE_GEOMANCY] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, [MOVE_GLACIAL_LANCE] = FORBIDDEN_METRONOME, [MOVE_GLITZY_GLOW] = FORBIDDEN_METRONOME, [MOVE_GRAV_APPLE] = FORBIDDEN_METRONOME, + [MOVE_GUILLOTINE] = FORBIDDEN_PARENTAL_BOND, [MOVE_HELPING_HAND] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_HOLD_HANDS] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, + [MOVE_HORN_DRILL] = FORBIDDEN_PARENTAL_BOND, [MOVE_HYPERSPACE_FURY] = FORBIDDEN_METRONOME, [MOVE_HYPERSPACE_HOLE] = FORBIDDEN_METRONOME, - [MOVE_ICE_BURN] = FORBIDDEN_METRONOME | FORBIDDEN_SLEEP_TALK, + [MOVE_ICE_BALL] = FORBIDDEN_PARENTAL_BOND, + [MOVE_ICE_BURN] = FORBIDDEN_METRONOME | FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, + [MOVE_ICICLE_SPEAR] = FORBIDDEN_PARENTAL_BOND, [MOVE_INSTRUCT] = FORBIDDEN_METRONOME, [MOVE_JUNGLE_HEALING] = FORBIDDEN_METRONOME, [MOVE_KINGS_SHIELD] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, @@ -984,6 +1008,7 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_MAT_BLOCK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_ME_FIRST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, [MOVE_METEOR_ASSAULT] = FORBIDDEN_METRONOME, + [MOVE_METEOR_BEAM] = FORBIDDEN_PARENTAL_BOND, [MOVE_METRONOME] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, [MOVE_MIMIC] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK, [MOVE_MIND_BLOWN] = FORBIDDEN_METRONOME, @@ -995,9 +1020,10 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_OBSTRUCT] = FORBIDDEN_METRONOME | FORBIDDEN_COPYCAT, [MOVE_ORIGIN_PULSE] = FORBIDDEN_METRONOME, [MOVE_OVERDRIVE] = FORBIDDEN_METRONOME, - [MOVE_PHANTOM_FORCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, + [MOVE_PHANTOM_FORCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, [MOVE_PHOTON_GEYSER] = FORBIDDEN_METRONOME, [MOVE_PIKA_PAPOW] = FORBIDDEN_METRONOME, + [MOVE_PIN_MISSILE] = FORBIDDEN_PARENTAL_BOND, [MOVE_PLASMA_FISTS] = FORBIDDEN_METRONOME, [MOVE_PRECIPICE_BLADES] = FORBIDDEN_METRONOME, [MOVE_PROTECT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, @@ -1005,27 +1031,33 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_QUASH] = FORBIDDEN_METRONOME, [MOVE_QUICK_GUARD] = FORBIDDEN_METRONOME, [MOVE_RAGE_POWDER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_RAZOR_WIND] = FORBIDDEN_SLEEP_TALK, + [MOVE_RAZOR_WIND] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, [MOVE_RELIC_SONG] = FORBIDDEN_METRONOME, [MOVE_ROAR] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, + [MOVE_ROCK_BLAST] = FORBIDDEN_PARENTAL_BOND, + [MOVE_ROLLOUT] = FORBIDDEN_PARENTAL_BOND, [MOVE_SAPPY_SEED] = FORBIDDEN_METRONOME, + [MOVE_SCALE_SHOT] = FORBIDDEN_PARENTAL_BOND, [MOVE_SECRET_SWORD] = FORBIDDEN_METRONOME, - [MOVE_SHADOW_FORCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, + [MOVE_SELF_DESTRUCT] = FORBIDDEN_PARENTAL_BOND, + [MOVE_SHADOW_FORCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, + [MOVE_SHEER_COLD] = FORBIDDEN_PARENTAL_BOND, [MOVE_SHELL_TRAP] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, [MOVE_SIZZLY_SLIDE] = FORBIDDEN_METRONOME, [MOVE_SKETCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK, - [MOVE_SKULL_BASH] = FORBIDDEN_SLEEP_TALK, - [MOVE_SKY_ATTACK] = FORBIDDEN_SLEEP_TALK, - [MOVE_SKY_DROP] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK, + [MOVE_SKULL_BASH] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, + [MOVE_SKY_ATTACK] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, + [MOVE_SKY_DROP] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, [MOVE_SLEEP_TALK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK, [MOVE_SNAP_TRAP] = FORBIDDEN_METRONOME, [MOVE_SNARL] = FORBIDDEN_METRONOME, [MOVE_SNATCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_SNORE] = FORBIDDEN_METRONOME, - [MOVE_SOLAR_BEAM] = FORBIDDEN_SLEEP_TALK, - [MOVE_SOLAR_BLADE] = FORBIDDEN_SLEEP_TALK, + [MOVE_SOLAR_BEAM] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, + [MOVE_SOLAR_BLADE] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, [MOVE_SPARKLY_SWIRL] = FORBIDDEN_METRONOME, [MOVE_SPECTRAL_THIEF] = FORBIDDEN_METRONOME, + [MOVE_SPIKE_CANNON] = FORBIDDEN_PARENTAL_BOND, [MOVE_SPIKY_SHIELD] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_SPIRIT_BREAK] = FORBIDDEN_METRONOME, [MOVE_SPLISHY_SPLASH] = FORBIDDEN_METRONOME, @@ -1034,8 +1066,9 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_STEEL_BEAM] = FORBIDDEN_METRONOME, [MOVE_STRANGE_STEAM] = FORBIDDEN_METRONOME, [MOVE_SUNSTEEL_STRIKE] = FORBIDDEN_METRONOME, - [MOVE_SURGING_STRIKES] = FORBIDDEN_METRONOME, + [MOVE_SURGING_STRIKES] = FORBIDDEN_METRONOME | FORBIDDEN_PARENTAL_BOND, [MOVE_SWITCHEROO] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, + [MOVE_TAIL_SLAP] = FORBIDDEN_PARENTAL_BOND, [MOVE_TECHNO_BLAST] = FORBIDDEN_METRONOME, [MOVE_THIEF] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_THOUSAND_ARROWS] = FORBIDDEN_METRONOME, @@ -1044,9 +1077,13 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_THUNDEROUS_KICK] = FORBIDDEN_METRONOME, [MOVE_TRANSFORM] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC, [MOVE_TRICK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_UPROAR] = FORBIDDEN_SLEEP_TALK, + [MOVE_TRIPLE_AXEL] = FORBIDDEN_PARENTAL_BOND, + [MOVE_TRIPLE_KICK] = FORBIDDEN_PARENTAL_BOND, + [MOVE_TWINEEDLE] = FORBIDDEN_PARENTAL_BOND, + [MOVE_UPROAR] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_PARENTAL_BOND, [MOVE_V_CREATE] = FORBIDDEN_METRONOME, [MOVE_VEEVEE_VOLLEY] = FORBIDDEN_METRONOME, + [MOVE_WATER_SHURIKEN] = FORBIDDEN_PARENTAL_BOND, [MOVE_WHIRLWIND] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_WICKED_BLOW] = FORBIDDEN_METRONOME, [MOVE_WIDE_GUARD] = FORBIDDEN_METRONOME, @@ -1341,6 +1378,17 @@ static void Cmd_attackcanceler(void) if (AtkCanceller_UnableToUseMove()) return; + if (!gSpecialStatuses[gBattlerAttacker].parentalBondOn + && GetBattlerAbility(gBattlerAttacker) == ABILITY_PARENTAL_BOND + && IsMoveAffectedByParentalBond(gCurrentMove, gBattlerAttacker) + && !(gAbsentBattlerFlags & gBitTable[gBattlerTarget])) + { + gSpecialStatuses[gBattlerAttacker].parentalBondOn = 2; + gMultiHitCounter = 2; + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) + return; + } + // Check Protean activation. GET_MOVE_TYPE(gCurrentMove, moveType); if ((GetBattlerAbility(gBattlerAttacker) == ABILITY_PROTEAN || GetBattlerAbility(gBattlerAttacker) == ABILITY_LIBERO) @@ -1669,6 +1717,13 @@ static void Cmd_accuracycheck(void) else if (!JumpIfMoveAffectedByProtect(0)) gBattlescriptCurrInstr += 7; } + else if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 1 + || (gSpecialStatuses[gBattlerAttacker].multiHitOn && (gBattleMoves[move].effect != EFFECT_TRIPLE_KICK + || GetBattlerAbility(gBattlerAttacker) == ABILITY_SKILL_LINK))) + { + // No acc checks for second hit of Parental Bond or multi hit moves, except Triple Kick/Triple Axel + gBattlescriptCurrInstr += 7; + } else { GET_MOVE_TYPE(move, type); @@ -1749,7 +1804,8 @@ static void Cmd_ppreduce(void) // For item Metronome, echoed voice if (gCurrentMove == gLastResultingMoves[gBattlerAttacker] && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) - && !WasUnableToUseMove(gBattlerAttacker)) + && !WasUnableToUseMove(gBattlerAttacker) + && gSpecialStatuses[gBattlerAttacker].parentalBondOn != 2) // Don't increment counter on first hit gBattleStruct->sameMoveTurns[gBattlerAttacker]++; else gBattleStruct->sameMoveTurns[gBattlerAttacker] = 0; @@ -2008,6 +2064,12 @@ static void Cmd_attackanimation(void) } else { + if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 1) // No animation on second hit + { + gBattlescriptCurrInstr++; + return; + } + if ((gBattleMoves[gCurrentMove].target & MOVE_TARGET_BOTH || gBattleMoves[gCurrentMove].target & MOVE_TARGET_FOES_AND_ALLY || gBattleMoves[gCurrentMove].target & MOVE_TARGET_DEPENDS) @@ -2295,10 +2357,12 @@ static void Cmd_resultmessage(void) switch (gMoveResultFlags & (~MOVE_RESULT_MISSED)) { case MOVE_RESULT_SUPER_EFFECTIVE: - stringId = STRINGID_SUPEREFFECTIVE; + if (!gMultiHitCounter) // Don't print effectiveness on each hit in a multi hit attack + stringId = STRINGID_SUPEREFFECTIVE; break; case MOVE_RESULT_NOT_VERY_EFFECTIVE: - stringId = STRINGID_NOTVERYEFFECTIVE; + if (!gMultiHitCounter) + stringId = STRINGID_NOTVERYEFFECTIVE; break; case MOVE_RESULT_ONE_HIT_KO: stringId = STRINGID_ONEHITKO; @@ -2377,7 +2441,6 @@ static void Cmd_resultmessage(void) if (gSpecialStatuses[gBattlerTarget].berryReduced && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { - gLastUsedItem = gBattleMons[gBattlerTarget].item; gSpecialStatuses[gBattlerTarget].berryReduced = 0; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString; @@ -2524,6 +2587,10 @@ void SetMoveEffect(bool32 primary, u32 certain) switch (gBattleScripting.moveEffect) // Set move effects which happen later on { case MOVE_EFFECT_KNOCK_OFF: + case MOVE_EFFECT_SMACK_DOWN: + case MOVE_EFFECT_REMOVE_STATUS: + case MOVE_EFFECT_STEAL_ITEM: + case MOVE_EFFECT_BURN_UP: gBattleStruct->moveEffect2 = gBattleScripting.moveEffect; gBattlescriptCurrInstr++; return; @@ -3013,61 +3080,6 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattleMons[gBattlerAttacker].status2 |= STATUS2_RAGE; gBattlescriptCurrInstr++; break; - case MOVE_EFFECT_STEAL_ITEM: - { - if (!CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item)) - { - gBattlescriptCurrInstr++; - break; - } - - side = GetBattlerSide(gBattlerAttacker); - if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT - && !(gBattleTypeFlags & - (BATTLE_TYPE_EREADER_TRAINER - | BATTLE_TYPE_FRONTIER - | BATTLE_TYPE_LINK - | BATTLE_TYPE_RECORDED_LINK - | BATTLE_TYPE_SECRET_BASE))) - { - gBattlescriptCurrInstr++; - } - else if (!(gBattleTypeFlags & - (BATTLE_TYPE_EREADER_TRAINER - | BATTLE_TYPE_FRONTIER - | BATTLE_TYPE_LINK - | BATTLE_TYPE_RECORDED_LINK - | BATTLE_TYPE_SECRET_BASE)) - && (gWishFutureKnock.knockedOffMons[side] & gBitTable[gBattlerPartyIndexes[gBattlerAttacker]])) - { - gBattlescriptCurrInstr++; - } - else if (gBattleMons[gBattlerTarget].item - && gBattleMons[gBattlerTarget].ability == ABILITY_STICKY_HOLD) - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_NoItemSteal; - - gLastUsedAbility = gBattleMons[gBattlerTarget].ability; - RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); - } - else if (gBattleMons[gBattlerAttacker].item != 0 - || gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY - || gBattleMons[gBattlerTarget].item == 0) - { - gBattlescriptCurrInstr++; - } - else - { - StealTargetItem(gBattlerAttacker, gBattlerTarget); // Attacker steals target item - gBattleMons[gBattlerAttacker].item = 0; // Item assigned later on with thief (see MOVEEND_CHANGED_ITEMS) - gBattleStruct->changedItems[gBattlerAttacker] = gLastUsedItem; // Stolen item to be assigned later - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_ItemSteal; - } - - } - break; case MOVE_EFFECT_PREVENT_ESCAPE: gBattleMons[gBattlerTarget].status2 |= STATUS2_ESCAPE_PREVENTION; gDisableStructs[gBattlerTarget].battlerPreventingEscape = gBattlerAttacker; @@ -3085,34 +3097,6 @@ void SetMoveEffect(bool32 primary, u32 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_RapidSpinAway; break; - case MOVE_EFFECT_REMOVE_STATUS: // Smelling salts - if (!(gBattleMons[gBattlerTarget].status1 & gBattleMoves[gCurrentMove].argument)) - { - gBattlescriptCurrInstr++; - } - else - { - gBattleMons[gBattlerTarget].status1 &= ~(gBattleMoves[gCurrentMove].argument); - - gActiveBattler = gBattlerTarget; - BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); - MarkBattlerForControllerExec(gActiveBattler); - - BattleScriptPush(gBattlescriptCurrInstr + 1); - switch (gBattleMoves[gCurrentMove].argument) - { - case STATUS1_PARALYSIS: - gBattlescriptCurrInstr = BattleScript_TargetPRLZHeal; - break; - case STATUS1_SLEEP: - gBattlescriptCurrInstr = BattleScript_TargetWokeUp; - break; - case STATUS1_BURN: - gBattlescriptCurrInstr = BattleScript_TargetBurnHeal; - break; - } - } - break; case MOVE_EFFECT_ATK_DEF_DOWN: // SuperPower BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_AtkDefDown; @@ -3121,38 +3105,6 @@ void SetMoveEffect(bool32 primary, u32 certain) BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_DefSpDefDown; break; - case MOVE_EFFECT_RECOIL_25: // Take Down, 25% recoil - gBattleMoveDamage = (gHpDealt) / 4; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; - - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect]; - break; - case MOVE_EFFECT_RECOIL_33: // Double Edge, 33 % recoil - gBattleMoveDamage = gHpDealt / 3; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; - - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect]; - break; - case MOVE_EFFECT_RECOIL_50: // Head Smash, 50 % recoil - gBattleMoveDamage = gHpDealt / 2; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; - - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_MoveEffectRecoil; - break; - case MOVE_EFFECT_RECOIL_33_STATUS: // Flare Blitz - can burn, Volt Tackle - can paralyze - gBattleScripting.savedDmg = gHpDealt / 3; - if (gBattleScripting.savedDmg == 0) - gBattleScripting.savedDmg = 1; - - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_MoveEffectRecoilWithStatus; - break; case MOVE_EFFECT_THRASH: if (gBattleMons[gEffectBattler].status2 & STATUS2_LOCK_CONFUSE) { @@ -3183,15 +3135,6 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattlescriptCurrInstr = BattleScript_MoveEffectClearSmog; } break; - case MOVE_EFFECT_SMACK_DOWN: - if (!IsBattlerGrounded(gBattlerTarget)) - { - gStatuses3[gBattlerTarget] |= STATUS3_SMACKED_DOWN; - gStatuses3[gBattlerTarget] &= ~(STATUS3_MAGNET_RISE | STATUS3_TELEKINESIS | STATUS3_ON_AIR); - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_MoveEffectSmackDown; - } - break; case MOVE_EFFECT_FLAME_BURST: if (IsBattlerAlive(BATTLE_PARTNER(gBattlerTarget)) && GetBattlerAbility(BATTLE_PARTNER(gBattlerTarget)) != ABILITY_MAGIC_GUARD) { @@ -4748,6 +4691,10 @@ static void Cmd_moveend(void) { switch (gBattleScripting.moveendState) { + case MOVEEND_SUM_DAMAGE: // Sum and store damage dealt for multi strike recoil + gBattleScripting.savedDmg += gHpDealt; + gBattleScripting.moveendState++; + break; case MOVEEND_PROTECT_LIKE_EFFECT: if (gProtectStructs[gBattlerAttacker].touchedProtectLike) { @@ -4815,6 +4762,41 @@ static void Cmd_moveend(void) } gBattleScripting.moveendState++; break; + case MOVEEND_RECOIL: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) + && IsBattlerAlive(gBattlerAttacker)) + { + switch (gBattleMoves[gCurrentMove].effect) + { + case EFFECT_RECOIL_25: // Take Down, 25% recoil + gBattleMoveDamage = max(1, gBattleScripting.savedDmg / 4); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MoveEffectRecoil; + effect = TRUE; + break; + case EFFECT_RECOIL_33: // Double Edge, 33 % recoil + gBattleMoveDamage = max(1, gBattleScripting.savedDmg / 3); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MoveEffectRecoil; + effect = TRUE; + break; + case EFFECT_RECOIL_50: // Head Smash, 50 % recoil + gBattleMoveDamage = max(1, gBattleScripting.savedDmg / 2); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MoveEffectRecoil; + effect = TRUE; + break; + case EFFECT_RECOIL_33_STATUS: // Flare Blitz - can burn, Volt Tackle - can paralyze + gBattleMoveDamage = max(1, gBattleScripting.savedDmg / 3); + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MoveEffectRecoilWithStatus; + effect = TRUE; + break; + } + } + gBattleScripting.moveendState++; + break; case MOVEEND_SYNCHRONIZE_TARGET: // target synchronize if (AbilityBattleEffects(ABILITYEFFECT_SYNCHRONIZE, gBattlerTarget, 0, 0, 0)) effect = TRUE; @@ -4882,15 +4864,82 @@ static void Cmd_moveend(void) gBattleScripting.moveendState++; break; case MOVEEND_MOVE_EFFECTS2: // For effects which should happen after target items, for example Knock Off after damage from Rocky Helmet. + { switch (gBattleStruct->moveEffect2) { case MOVE_EFFECT_KNOCK_OFF: effect = TryKnockOffBattleScript(gBattlerTarget); break; + case MOVE_EFFECT_SMACK_DOWN: + if (!IsBattlerGrounded(gBattlerTarget) && IsBattlerAlive(gBattlerTarget)) + { + gStatuses3[gBattlerTarget] |= STATUS3_SMACKED_DOWN; + gStatuses3[gBattlerTarget] &= ~(STATUS3_MAGNET_RISE | STATUS3_TELEKINESIS | STATUS3_ON_AIR); + effect = TRUE; + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectSmackDown; + } + break; + case MOVE_EFFECT_REMOVE_STATUS: // Smelling salts, Wake-Up Slap, Sparkling Aria + if ((gBattleMons[gBattlerTarget].status1 & gBattleMoves[gCurrentMove].argument) && IsBattlerAlive(gBattlerTarget)) + { + gBattleMons[gBattlerTarget].status1 &= ~(gBattleMoves[gCurrentMove].argument); + + gActiveBattler = gBattlerTarget; + BtlController_EmitSetMonData(0, REQUEST_STATUS_BATTLE, 0, 4, &gBattleMons[gActiveBattler].status1); + MarkBattlerForControllerExec(gActiveBattler); + effect = TRUE; + BattleScriptPush(gBattlescriptCurrInstr + 1); + switch (gBattleMoves[gCurrentMove].argument) + { + case STATUS1_PARALYSIS: + gBattlescriptCurrInstr = BattleScript_TargetPRLZHeal; + break; + case STATUS1_SLEEP: + gBattlescriptCurrInstr = BattleScript_TargetWokeUp; + break; + case STATUS1_BURN: + gBattlescriptCurrInstr = BattleScript_TargetBurnHeal; + break; + } + } + break; // MOVE_EFFECT_REMOVE_STATUS + case MOVE_EFFECT_STEAL_ITEM: + if (!CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item) + || gBattleMons[gBattlerAttacker].item != ITEM_NONE + || gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY + || gBattleMons[gBattlerTarget].item == ITEM_NONE) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MoveEnd; // Can't steal item, just do damage + } + else if (gBattleMons[gBattlerTarget].item + && gBattleMons[gBattlerTarget].ability == ABILITY_STICKY_HOLD) // Can steal item, but ability prevents it + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_NoItemSteal; + + gLastUsedAbility = gBattleMons[gBattlerTarget].ability; + RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); + } + else + { + StealTargetItem(gBattlerAttacker, gBattlerTarget); // Attacker steals target item + gBattleStruct->changedItems[gBattlerAttacker] = gLastUsedItem; // Stolen item to be assigned later + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_ItemSteal; + } + break; // MOVE_EFFECT_STEAL_ITEM + case MOVE_EFFECT_BURN_UP: + effect = TRUE; + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_BurnUpRemoveType; + break; } gBattleStruct->moveEffect2 = 0; gBattleScripting.moveendState++; - break; + break; // MOVEEND_MOVE_EFFECTS2 + } case MOVEEND_ITEM_EFFECTS_ALL: // item effects for all battlers if (ItemBattleEffects(ITEMEFFECT_MOVE_END, 0, FALSE)) effect = TRUE; @@ -5076,6 +5125,56 @@ static void Cmd_moveend(void) RecordLastUsedMoveBy(gBattlerAttacker, gCurrentMove); gBattleScripting.moveendState++; break; + case MOVEEND_MULTIHIT_MOVE: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) + && gMultiHitCounter + && !(gCurrentMove == MOVE_PRESENT && gBattleStruct->presentBasePower == 0)) // Silly edge case + { + gBattleScripting.multihitString[4]++; + if (--gMultiHitCounter == 0) + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; + effect = 1; + } + else + { + if (gCurrentMove == MOVE_DRAGON_DARTS) + { + // TODO + } + + if (gBattleMons[gBattlerAttacker].hp + && gBattleMons[gBattlerTarget].hp + && (gChosenMove == MOVE_SLEEP_TALK || !(gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP)) + && !(gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE)) + { + if (gSpecialStatuses[gBattlerAttacker].parentalBondOn) + gSpecialStatuses[gBattlerAttacker].parentalBondOn--; + + gHitMarker |= (HITMARKER_NO_PPDEDUCT | HITMARKER_NO_ATTACKSTRING); + gBattleScripting.animTargetsHit = 0; + gBattleScripting.moveendState = 0; + gSpecialStatuses[gBattlerAttacker].multiHitOn = TRUE; + MoveValuesCleanUp(); + BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); + gBattlescriptCurrInstr = BattleScript_FlushMessageBox; + return; + } + else + { + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; + effect = 1; + } + } + } + gMultiHitCounter = 0; + gSpecialStatuses[gBattlerAttacker].parentalBondOn = 0; + gSpecialStatuses[gBattlerAttacker].multiHitOn = 0; + gBattleScripting.moveendState++; + break; case MOVEEND_EJECT_BUTTON: if (gCurrentMove != MOVE_DRAGON_TAIL && gCurrentMove != MOVE_CIRCLE_THROW @@ -10808,7 +10907,8 @@ static void Cmd_handlefurycutter(void) } else { - if (gDisableStructs[gBattlerAttacker].furyCutterCounter != 5) + if (gDisableStructs[gBattlerAttacker].furyCutterCounter != 5 + && gSpecialStatuses[gBattlerAttacker].parentalBondOn != 2) // Don't increment counter on first hit gDisableStructs[gBattlerAttacker].furyCutterCounter++; gBattlescriptCurrInstr++; @@ -10833,27 +10933,37 @@ static void Cmd_presentdamagecalculation(void) { u32 rand = Random() & 0xFF; - if (rand < 102) + /* Don't reroll present effect/power for the second hit of Parental Bond. + * Not sure if this is the correct behaviour, but bulbapedia states + * that if present heals the foe, it doesn't strike twice, and if it deals + * damage, the second strike will always deal damage too. This is a simple way + * to replicate that effect. + */ + if (gSpecialStatuses[gBattlerAttacker].parentalBondOn != 1) { - gBattleStruct->presentBasePower = 40; - } - else if (rand < 178) - { - gBattleStruct->presentBasePower = 80; - } - else if (rand < 204) - { - gBattleStruct->presentBasePower = 120; - } - else - { - gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 4; - if (gBattleMoveDamage == 0) - gBattleMoveDamage = 1; - gBattleMoveDamage *= -1; + if (rand < 102) + { + gBattleStruct->presentBasePower = 40; + } + else if (rand < 178) + { + gBattleStruct->presentBasePower = 80; + } + else if (rand < 204) + { + gBattleStruct->presentBasePower = 120; + } + else + { + gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 4; + if (gBattleMoveDamage == 0) + gBattleMoveDamage = 1; + gBattleMoveDamage *= -1; + gBattleStruct->presentBasePower = 0; + } } - if (rand < 204) + if (gBattleStruct->presentBasePower) { gBattlescriptCurrInstr = BattleScript_HitFromCritCalc; } @@ -12873,3 +12983,27 @@ static bool32 CriticalCapture(u32 odds) #endif } +bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId) +{ + if (gBattleMoves[move].split != SPLIT_STATUS && !(sForbiddenMoves[move] & FORBIDDEN_PARENTAL_BOND)) + { + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + switch (gBattleMoves[move].target) + { + case MOVE_TARGET_BOTH: + if (CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) >= 2) // Check for single target + return FALSE; + break; + case MOVE_TARGET_FOES_AND_ALLY: + if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) >= 2) // Count mons on both sides; ignore attacker + return FALSE; + break; + } + } + + return TRUE; + } + + return FALSE; +} diff --git a/src/battle_util.c b/src/battle_util.c index f0adfebb9..5229e48c4 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -217,6 +217,37 @@ static const u16 sEntrainmentTargetSimpleBeamBannedAbilities[] = ABILITY_GULP_MISSILE, }; +static const u16 sTwoStrikeMoves[] = +{ + MOVE_BONEMERANG, + MOVE_DOUBLE_HIT, + MOVE_DOUBLE_IRON_BASH, + MOVE_DOUBLE_KICK, + MOVE_DRAGON_DARTS, + MOVE_DUAL_CHOP, + MOVE_DUAL_WINGBEAT, + MOVE_GEAR_GRIND, + MOVE_TWINEEDLE, + 0xFFFF +}; + +static u8 CalcBeatUpPower(void) +{ + struct Pokemon *party; + u8 basePower; + u16 species; + + if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + // Party slot is set in the battle script for Beat Up + species = GetMonData(&party[gBattleCommunication[0] - 1], MON_DATA_SPECIES); + basePower = (gBaseStats[species].baseAttack / 10) + 5; + + return basePower; +} + bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide) { u32 ability = GetBattlerAbility(battlerAtk); @@ -248,6 +279,7 @@ void HandleAction_UseMove(void) gBattleStruct->atkCancellerTracker = 0; gMoveResultFlags = 0; gMultiHitCounter = 0; + gBattleScripting.savedDmg = 0; gBattleCommunication[6] = 0; gBattleScripting.savedMoveEffect = 0; gCurrMovePos = gChosenMovePos = *(gBattleStruct->chosenMovePositions + gBattlerAttacker); @@ -3085,6 +3117,7 @@ enum CANCELLER_POWDER_MOVE, CANCELLER_POWDER_STATUS, CANCELLER_THROAT_CHOP, + CANCELLER_MULTIHIT_MOVES, CANCELLER_END, CANCELLER_PSYCHIC_TERRAIN, CANCELLER_END2, @@ -3101,6 +3134,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_FLAGS: // flags clear gBattleMons[gBattlerAttacker].status2 &= ~(STATUS2_DESTINY_BOND); gStatuses3[gBattlerAttacker] &= ~(STATUS3_GRUDGE); + gBattleScripting.tripleKickPower = 0; gBattleStruct->atkCancellerTracker++; break; case CANCELLER_ASLEEP: // check being asleep @@ -3412,6 +3446,95 @@ u8 AtkCanceller_UnableToUseMove(void) } gBattleStruct->atkCancellerTracker++; break; + case CANCELLER_MULTIHIT_MOVES: + if (gBattleMoves[gCurrentMove].effect == EFFECT_MULTI_HIT) + { + u16 ability = gBattleMons[gBattlerAttacker].ability; + + if (ability == ABILITY_SKILL_LINK) + { + gMultiHitCounter = 5; + } + #ifdef POKEMON_EXPANSION + else if (ability == ABILITY_BATTLE_BOND + && gCurrentMove == MOVE_WATER_SHURIKEN + && gBattleMons[gBattlerAttacker].species == SPECIES_GRENINJA_ASH) + { + gMultiHitCounter = 3; + } + #endif + else + { + if (B_MULTI_HIT_CHANCE >= GEN_5) + { + // 2 and 3 hits: 33.3% + // 4 and 5 hits: 16.7% + gMultiHitCounter = Random() % 4; + if (gMultiHitCounter > 2) + { + gMultiHitCounter = (Random() % 3); + if (gMultiHitCounter < 2) + gMultiHitCounter = 2; + else + gMultiHitCounter = 3; + } + else + gMultiHitCounter += 3; + } + else + { + // 2 and 3 hits: 37.5% + // 4 and 5 hits: 12.5% + gMultiHitCounter = Random() % 4; + if (gMultiHitCounter > 1) + gMultiHitCounter = (Random() % 4) + 2; + else + gMultiHitCounter += 2; + } + } + + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) + } + else if (IsTwoStrikesMove(gCurrentMove)) + { + gMultiHitCounter = 2; + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) + if (gCurrentMove == MOVE_DRAGON_DARTS) + { + // TODO + } + } + else if (gBattleMoves[gCurrentMove].effect == EFFECT_TRIPLE_KICK || gCurrentMove == MOVE_SURGING_STRIKES) + { + gMultiHitCounter = 3; + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) + } + #if B_BEAT_UP_DMG >= GEN_5 + else if (gBattleMoves[gCurrentMove].effect == EFFECT_BEAT_UP) + { + struct Pokemon* party; + int i; + + if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) + party = gPlayerParty; + else + party = gEnemyParty; + + for (i = 0; i < PARTY_SIZE; i++) + { + if (GetMonData(&party[i], MON_DATA_HP) + && GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE + && !GetMonData(&party[i], MON_DATA_IS_EGG) + && !GetMonData(&party[i], MON_DATA_STATUS)) + gMultiHitCounter++; + } + + gBattleCommunication[0] = 0; // For later + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) + } + #endif + gBattleStruct->atkCancellerTracker++; + break; case CANCELLER_END: break; } @@ -7466,6 +7589,11 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) if (gBattleMoves[gLastUsedMove].effect == EFFECT_FUSION_COMBO && move != gLastUsedMove) basePower *= 2; break; + #if B_BEAT_UP_DMG >= GEN_5 + case EFFECT_BEAT_UP: + basePower = CalcBeatUpPower(); + break; + #endif } if (basePower == 0) @@ -8163,6 +8291,15 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move MulModifier(&finalModifier, UQ_4_12(0.5)); } + // Parental Bond Second Strike + if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 1) + { + if (B_PARENTAL_BOND_DAMAGE < GEN_7) + MulModifier(&finalModifier, UQ_4_12(0.5)); + else + MulModifier(&finalModifier, UQ_4_12(0.25)); + } + // attacker's abilities switch (abilityAtk) { @@ -9214,3 +9351,16 @@ void DoBurmyFormChange(u32 monId) } } } + +// Move Checks +bool8 IsTwoStrikesMove(u16 move) +{ + u32 i; + + for (i = 0; i < ARRAY_COUNT(sTwoStrikeMoves); i++) + { + if (move == sTwoStrikeMoves[i]) + return TRUE; + } + return FALSE; +} diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 657341b5e..b0377ccc1 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -641,7 +641,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_TWINEEDLE] = { - .effect = EFFECT_TWINEEDLE, + .effect = EFFECT_POISON_HIT, .power = 25, .type = TYPE_BUG, .accuracy = 100, @@ -10020,7 +10020,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .type = TYPE_FIRE, .accuracy = 100, .pp = 5, - .secondaryEffectChance = 0, + .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_THAW_USER, @@ -10716,7 +10716,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = #else .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, #endif - .effect = EFFECT_PLACEHOLDER, //TODO (EFFECT_FLINCH_HIT + EFFECT_DOUBLE_HIT) + .effect = EFFECT_FLINCH_HIT, .power = 60, .type = TYPE_STEEL, .accuracy = 100, @@ -11444,7 +11444,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_TRIPLE_AXEL] = { - .effect = EFFECT_TRIPLE_KICK, //TODO: Increase damage by 20 instead of 10 + .effect = EFFECT_TRIPLE_KICK, .power = 20, .type = TYPE_ICE, .accuracy = 90, @@ -11513,7 +11513,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SURGING_STRIKES] = { - .effect = EFFECT_PLACEHOLDER, //TODO (Multi hit + Always Crit) + .effect = EFFECT_ALWAYS_CRIT, .power = 25, .type = TYPE_WATER, .accuracy = 100, From f49a486a8ccad34508b7ee75984d6c9dfffcc911 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Thu, 23 Sep 2021 16:55:05 +1200 Subject: [PATCH 02/58] Replace tabs with spaces --- src/battle_script_commands.c | 58 ++++++++++++++++++------------------ src/battle_util.c | 36 +++++++++++----------- 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index dac210ff5..b0508b80b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1729,8 +1729,8 @@ static void Cmd_accuracycheck(void) gBattlescriptCurrInstr += 7; } else if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 1 - || (gSpecialStatuses[gBattlerAttacker].multiHitOn && (gBattleMoves[move].effect != EFFECT_TRIPLE_KICK - || GetBattlerAbility(gBattlerAttacker) == ABILITY_SKILL_LINK))) + || (gSpecialStatuses[gBattlerAttacker].multiHitOn && (gBattleMoves[move].effect != EFFECT_TRIPLE_KICK + || GetBattlerAbility(gBattlerAttacker) == ABILITY_SKILL_LINK))) { // No acc checks for second hit of Parental Bond or multi hit moves, except Triple Kick/Triple Axel gBattlescriptCurrInstr += 7; @@ -2078,8 +2078,8 @@ static void Cmd_attackanimation(void) { if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 1) // No animation on second hit { - gBattlescriptCurrInstr++; - return; + gBattlescriptCurrInstr++; + return; } if ((gBattleMoves[gCurrentMove].target & MOVE_TARGET_BOTH @@ -5162,9 +5162,9 @@ static void Cmd_moveend(void) gBattleScripting.multihitString[4]++; if (--gMultiHitCounter == 0) { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; - effect = 1; + BattleScriptPushCursor(); + gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; + effect = 1; } else { @@ -5176,7 +5176,7 @@ static void Cmd_moveend(void) if (gBattleMons[gBattlerAttacker].hp && gBattleMons[gBattlerTarget].hp && (gChosenMove == MOVE_SLEEP_TALK || !(gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP)) - && !(gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE)) + && !(gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE)) { if (gSpecialStatuses[gBattlerAttacker].parentalBondOn) gSpecialStatuses[gBattlerAttacker].parentalBondOn--; @@ -5187,14 +5187,14 @@ static void Cmd_moveend(void) gSpecialStatuses[gBattlerAttacker].multiHitOn = TRUE; MoveValuesCleanUp(); BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); - gBattlescriptCurrInstr = BattleScript_FlushMessageBox; - return; + gBattlescriptCurrInstr = BattleScript_FlushMessageBox; + return; } else { BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; - effect = 1; + gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; + effect = 1; } } } @@ -13124,24 +13124,24 @@ static bool32 CriticalCapture(u32 odds) bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId) { if (gBattleMoves[move].split != SPLIT_STATUS && !(sForbiddenMoves[move] & FORBIDDEN_PARENTAL_BOND)) - { - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - { - switch (gBattleMoves[move].target) + { + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + switch (gBattleMoves[move].target) { - case MOVE_TARGET_BOTH: - if (CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) >= 2) // Check for single target - return FALSE; - break; - case MOVE_TARGET_FOES_AND_ALLY: - if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) >= 2) // Count mons on both sides; ignore attacker - return FALSE; - break; - } - } + case MOVE_TARGET_BOTH: + if (CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) >= 2) // Check for single target + return FALSE; + break; + case MOVE_TARGET_FOES_AND_ALLY: + if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) >= 2) // Count mons on both sides; ignore attacker + return FALSE; + break; + } + } - return TRUE; - } + return TRUE; + } - return FALSE; + return FALSE; } diff --git a/src/battle_util.c b/src/battle_util.c index 36060103b..0c0f51ddc 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3500,7 +3500,7 @@ u8 AtkCanceller_UnableToUseMove(void) else if (IsTwoStrikesMove(gCurrentMove)) { gMultiHitCounter = 2; - PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) if (gCurrentMove == MOVE_DRAGON_DARTS) { // TODO @@ -3509,7 +3509,7 @@ u8 AtkCanceller_UnableToUseMove(void) else if (gBattleMoves[gCurrentMove].effect == EFFECT_TRIPLE_KICK || gCurrentMove == MOVE_SURGING_STRIKES) { gMultiHitCounter = 3; - PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) } #if B_BEAT_UP_DMG >= GEN_5 else if (gBattleMoves[gCurrentMove].effect == EFFECT_BEAT_UP) @@ -3523,16 +3523,16 @@ u8 AtkCanceller_UnableToUseMove(void) party = gEnemyParty; for (i = 0; i < PARTY_SIZE; i++) - { - if (GetMonData(&party[i], MON_DATA_HP) - && GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE - && !GetMonData(&party[i], MON_DATA_IS_EGG) - && !GetMonData(&party[i], MON_DATA_STATUS)) - gMultiHitCounter++; - } + { + if (GetMonData(&party[i], MON_DATA_HP) + && GetMonData(&party[i], MON_DATA_SPECIES) != SPECIES_NONE + && !GetMonData(&party[i], MON_DATA_IS_EGG) + && !GetMonData(&party[i], MON_DATA_STATUS)) + gMultiHitCounter++; + } - gBattleCommunication[0] = 0; // For later - PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) + gBattleCommunication[0] = 0; // For later + PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) } #endif gBattleStruct->atkCancellerTracker++; @@ -8309,13 +8309,13 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move } // Parental Bond Second Strike - if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 1) - { - if (B_PARENTAL_BOND_DAMAGE < GEN_7) - MulModifier(&finalModifier, UQ_4_12(0.5)); - else - MulModifier(&finalModifier, UQ_4_12(0.25)); - } + if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 1) + { + if (B_PARENTAL_BOND_DAMAGE < GEN_7) + MulModifier(&finalModifier, UQ_4_12(0.5)); + else + MulModifier(&finalModifier, UQ_4_12(0.25)); + } // attacker's abilities switch (abilityAtk) From 1ee841146f370b12e67489683d7f5eafd6a35596 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 2 Oct 2021 15:08:15 +1300 Subject: [PATCH 03/58] Fix recoil occurring on zero damage attack The "x was hit with recoil!" message was appearing when the target was immune due to protection or an ability - this should fix that and handle any other cases where 0 damage is dealt. --- src/battle_script_commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index b0508b80b..aa85b5d30 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4793,7 +4793,8 @@ static void Cmd_moveend(void) case MOVEEND_RECOIL: if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && !(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) - && IsBattlerAlive(gBattlerAttacker)) + && IsBattlerAlive(gBattlerAttacker) + && gBattleScripting.savedDmg != 0) // Some checks may be redundant alongside this one { switch (gBattleMoves[gCurrentMove].effect) { From 41d6969dea90b84ab530888dbc0eca614599ef4f Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 9 Oct 2021 12:49:37 +1300 Subject: [PATCH 04/58] Fix Sturdy/Sash/Band Make these effects endure one hit of a multi strike move, not all of them. --- src/battle_script_commands.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index aa85b5d30..c4c29304b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5185,6 +5185,9 @@ static void Cmd_moveend(void) gHitMarker |= (HITMARKER_NO_PPDEDUCT | HITMARKER_NO_ATTACKSTRING); gBattleScripting.animTargetsHit = 0; gBattleScripting.moveendState = 0; + gSpecialStatuses[gBattlerTarget].sturdied = 0; + gSpecialStatuses[gBattlerTarget].focusBanded = 0; // Delete this line to make Focus Band last for the duration of the whole move turn. + gSpecialStatuses[gBattlerTarget].focusSashed = 0; // Delete this line to make Focus Sash last for the duration of the whole move turn. gSpecialStatuses[gBattlerAttacker].multiHitOn = TRUE; MoveValuesCleanUp(); BattleScriptPush(gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect]); From 61add8823eb38eb54c06a26e01383b92d85a9eec Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 13 Oct 2021 18:25:04 +1300 Subject: [PATCH 05/58] Fix Thief Thief doesn't work as a move end effect - the item steal animation only works if it runs before the target faints. This restores its original code and adds a simple check to handle its interaction with Parental Bond. --- src/battle_script_commands.c | 29 ++--------------------------- 1 file changed, 2 insertions(+), 27 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 20fb438d8..1c9af7897 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2651,7 +2651,6 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_KNOCK_OFF: case MOVE_EFFECT_SMACK_DOWN: case MOVE_EFFECT_REMOVE_STATUS: - case MOVE_EFFECT_STEAL_ITEM: case MOVE_EFFECT_BURN_UP: gBattleStruct->moveEffect2 = gBattleScripting.moveEffect; gBattlescriptCurrInstr++; @@ -3146,6 +3145,8 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattlescriptCurrInstr++; break; case MOVE_EFFECT_STEAL_ITEM: + // Only steal items on the final strike of Parental Bond + if (!(gSpecialStatuses[gBattlerAttacker].parentalBondOn == 2 && gBattleMons[gBattlerTarget].hp != 0)) { if (!CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item)) { @@ -5046,32 +5047,6 @@ static void Cmd_moveend(void) } } break; // MOVE_EFFECT_REMOVE_STATUS - case MOVE_EFFECT_STEAL_ITEM: - if (!CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item) - || gBattleMons[gBattlerAttacker].item != ITEM_NONE - || gBattleMons[gBattlerTarget].item == ITEM_ENIGMA_BERRY - || gBattleMons[gBattlerTarget].item == ITEM_NONE) - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_MoveEnd; // Can't steal item, just do damage - } - else if (gBattleMons[gBattlerTarget].item - && gBattleMons[gBattlerTarget].ability == ABILITY_STICKY_HOLD) // Can steal item, but ability prevents it - { - BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_NoItemSteal; - - gLastUsedAbility = gBattleMons[gBattlerTarget].ability; - RecordAbilityBattle(gBattlerTarget, gLastUsedAbility); - } - else - { - StealTargetItem(gBattlerAttacker, gBattlerTarget); // Attacker steals target item - gBattleStruct->changedItems[gBattlerAttacker] = gLastUsedItem; // Stolen item to be assigned later - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_ItemSteal; - } - break; // MOVE_EFFECT_STEAL_ITEM case MOVE_EFFECT_BURN_UP: effect = TRUE; BattleScriptPush(gBattlescriptCurrInstr + 1); From 8db2e725d5140cf79696f3c477dc59f388580802 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Fri, 15 Oct 2021 17:07:02 +1300 Subject: [PATCH 06/58] Parental Bond/Bug Bite interaction Bug Bite's effect should only occur on the final strike of Parental Bond (which can also be the first strike if it KO's the target). --- src/battle_script_commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c7edc283b..e3f0c5902 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3373,7 +3373,8 @@ void SetMoveEffect(bool32 primary, u32 certain) break; case MOVE_EFFECT_BUG_BITE: if (ItemId_GetPocket(gBattleMons[gEffectBattler].item) == POCKET_BERRIES - && GetBattlerAbility(gEffectBattler) != ABILITY_STICKY_HOLD) + && GetBattlerAbility(gEffectBattler) != ABILITY_STICKY_HOLD + && !(gSpecialStatuses[gBattlerAttacker].parentalBondOn == 2 && gBattleMons[gBattlerTarget].hp != 0)) // Steal berry on final hit { // target loses their berry gLastUsedItem = gBattleMons[gEffectBattler].item; From 0345dea91820e49b9dd0fc929f454ef94bbcbd5f Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Mon, 1 Nov 2021 23:39:37 +1300 Subject: [PATCH 07/58] Replace EFFECT_DOUBLE_HIT with FLAG_TWO_STRIKES This removes the need to have separate move effects for Twineedle, Double Iron Bash, and any custom two strike moves. --- data/battle_scripts_1.s | 34 -- include/battle_util.h | 3 - include/constants/battle_move_effects.h | 750 ++++++++++++------------ include/constants/pokemon.h | 1 + src/battle_ai_main.c | 1 - src/battle_tv.c | 4 +- src/battle_util.c | 28 +- src/data/battle_moves.h | 32 +- 8 files changed, 393 insertions(+), 460 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 7cd3ef1ae..9f2f46484 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -64,7 +64,6 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectDragonRage @ EFFECT_DRAGON_RAGE .4byte BattleScript_EffectTrap @ EFFECT_TRAP .4byte BattleScript_EffectHealBlock @ EFFECT_HEAL_BLOCK - .4byte BattleScript_EffectHit @ EFFECT_DOUBLE_HIT .4byte BattleScript_EffectRecoilIfMiss @ EFFECT_RECOIL_IF_MISS .4byte BattleScript_EffectMist @ EFFECT_MIST .4byte BattleScript_EffectFocusEnergy @ EFFECT_FOCUS_ENERGY @@ -97,7 +96,6 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_EVASION_DOWN_HIT .4byte BattleScript_EffectTwoTurnsAttack @ EFFECT_TWO_TURNS_ATTACK .4byte BattleScript_EffectConfuseHit @ EFFECT_CONFUSE_HIT - .4byte BattleScript_EffectTwineedle @ EFFECT_TWINEEDLE .4byte BattleScript_EffectHit @ EFFECT_VITAL_THROW .4byte BattleScript_EffectSubstitute @ EFFECT_SUBSTITUTE .4byte BattleScript_EffectRecharge @ EFFECT_RECHARGE @@ -379,12 +377,10 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_DYNAMAX_DOUBLE_DMG .4byte BattleScript_EffectDecorate @ EFFECT_DECORATE .4byte BattleScript_EffectHit @ EFFECT_SNIPE_SHOT - .4byte BattleScript_EffectTripleHit @ EFFECT_TRIPLE_HIT .4byte BattleScript_EffectRecoilHP25 @ EFFECT_RECOIL_HP_25 .4byte BattleScript_EffectStuffCheeks @ EFFECT_STUFF_CHEEKS .4byte BattleScript_EffectDefenseDownHit @ EFFECT_GRAV_APPLE .4byte BattleScript_EffectEvasionUpHit @ EFFECT_EVASION_UP_HIT - .4byte BattleScript_EffectDoubleIronBash @ EFFECT_DOUBLE_IRON_BASH .4byte BattleScript_EffectGlitzyGlow @ EFFECT_GLITZY_GLOW .4byte BattleScript_EffectBaddyBad @ EFFECT_BADDY_BAD .4byte BattleScript_EffectSappySeed @ EFFECT_SAPPY_SEED @@ -577,16 +573,6 @@ BattleScript_EffectGlitzyGlow: waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd -BattleScript_EffectDoubleIronBash: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - setmultihitcounter 2 - initmultihitstring - sethword sMULTIHIT_EFFECT, MOVE_EFFECT_FLINCH - goto BattleScript_MultiHitLoop - BattleScript_EffectEvasionUpHit: setmoveeffect MOVE_EFFECT_EVS_PLUS_1 | MOVE_EFFECT_AFFECTS_USER goto BattleScript_EffectHit @@ -3207,26 +3193,6 @@ BattleScript_EffectTrap:: setmoveeffect MOVE_EFFECT_WRAP goto BattleScript_EffectHit -BattleScript_EffectTripleHit:: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - setmultihitcounter 3 - initmultihitstring - sethword sMULTIHIT_EFFECT, 0 - goto BattleScript_MultiHitLoop - -BattleScript_EffectDoubleHit:: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - attackstring - ppreduce - setmultihitcounter 2 - initmultihitstring - sethword sMULTIHIT_EFFECT, 0 - goto BattleScript_MultiHitLoop - BattleScript_EffectRecoilIfMiss:: attackcanceler accuracycheck BattleScript_MoveMissedDoDamage, ACC_CURR_MOVE diff --git a/include/battle_util.h b/include/battle_util.h index 2f7ea6850..00aa0cd59 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -175,7 +175,4 @@ bool32 CanBeFrozen(u8 battlerId); bool32 CanBeConfused(u8 battlerId); bool32 IsBattlerTerrainAffected(u8 battlerId, u32 terrainFlag); -// Move checks -bool8 IsTwoStrikesMove(u16 move); - #endif // GUARD_BATTLE_UTIL_H diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 62b49a191..fd8919374 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -1,381 +1,377 @@ #ifndef GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H #define GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H -#define EFFECT_HIT 0 -#define EFFECT_SLEEP 1 -#define EFFECT_POISON_HIT 2 -#define EFFECT_ABSORB 3 -#define EFFECT_BURN_HIT 4 -#define EFFECT_FREEZE_HIT 5 -#define EFFECT_PARALYZE_HIT 6 -#define EFFECT_EXPLOSION 7 -#define EFFECT_DREAM_EATER 8 -#define EFFECT_MIRROR_MOVE 9 -#define EFFECT_ATTACK_UP 10 -#define EFFECT_DEFENSE_UP 11 -#define EFFECT_SPEED_UP 12 -#define EFFECT_SPECIAL_ATTACK_UP 13 -#define EFFECT_SPECIAL_DEFENSE_UP 14 -#define EFFECT_ACCURACY_UP 15 -#define EFFECT_EVASION_UP 16 -#define EFFECT_SPECIAL_ATTACK_UP_3 17 -#define EFFECT_ATTACK_DOWN 18 -#define EFFECT_DEFENSE_DOWN 19 -#define EFFECT_SPEED_DOWN 20 -#define EFFECT_SPECIAL_ATTACK_DOWN 21 -#define EFFECT_SPECIAL_DEFENSE_DOWN 22 -#define EFFECT_ACCURACY_DOWN 23 -#define EFFECT_EVASION_DOWN 24 -#define EFFECT_HAZE 25 -#define EFFECT_BIDE 26 -#define EFFECT_RAMPAGE 27 -#define EFFECT_ROAR 28 -#define EFFECT_MULTI_HIT 29 -#define EFFECT_CONVERSION 30 -#define EFFECT_FLINCH_HIT 31 -#define EFFECT_RESTORE_HP 32 -#define EFFECT_TOXIC 33 -#define EFFECT_PAY_DAY 34 -#define EFFECT_LIGHT_SCREEN 35 -#define EFFECT_TRI_ATTACK 36 -#define EFFECT_REST 37 -#define EFFECT_OHKO 38 -#define EFFECT_FUSION_COMBO 39 -#define EFFECT_SUPER_FANG 40 -#define EFFECT_DRAGON_RAGE 41 -#define EFFECT_TRAP 42 -#define EFFECT_HEAL_BLOCK 43 -#define EFFECT_DOUBLE_HIT 44 -#define EFFECT_RECOIL_IF_MISS 45 -#define EFFECT_MIST 46 -#define EFFECT_FOCUS_ENERGY 47 -#define EFFECT_RECOIL_25 48 -#define EFFECT_CONFUSE 49 -#define EFFECT_ATTACK_UP_2 50 -#define EFFECT_DEFENSE_UP_2 51 -#define EFFECT_SPEED_UP_2 52 -#define EFFECT_SPECIAL_ATTACK_UP_2 53 -#define EFFECT_SPECIAL_DEFENSE_UP_2 54 -#define EFFECT_ACCURACY_UP_2 55 -#define EFFECT_EVASION_UP_2 56 -#define EFFECT_TRANSFORM 57 -#define EFFECT_ATTACK_DOWN_2 58 -#define EFFECT_DEFENSE_DOWN_2 59 -#define EFFECT_SPEED_DOWN_2 60 -#define EFFECT_SPECIAL_ATTACK_DOWN_2 61 -#define EFFECT_SPECIAL_DEFENSE_DOWN_2 62 -#define EFFECT_ACCURACY_DOWN_2 63 -#define EFFECT_EVASION_DOWN_2 64 -#define EFFECT_REFLECT 65 -#define EFFECT_POISON 66 -#define EFFECT_PARALYZE 67 -#define EFFECT_ATTACK_DOWN_HIT 68 -#define EFFECT_DEFENSE_DOWN_HIT 69 -#define EFFECT_SPEED_DOWN_HIT 70 -#define EFFECT_SPECIAL_ATTACK_DOWN_HIT 71 -#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT 72 -#define EFFECT_ACCURACY_DOWN_HIT 73 -#define EFFECT_EVASION_DOWN_HIT 74 -#define EFFECT_TWO_TURNS_ATTACK 75 -#define EFFECT_CONFUSE_HIT 76 -#define EFFECT_TWINEEDLE 77 -#define EFFECT_VITAL_THROW 78 -#define EFFECT_SUBSTITUTE 79 -#define EFFECT_RECHARGE 80 -#define EFFECT_RAGE 81 -#define EFFECT_MIMIC 82 -#define EFFECT_METRONOME 83 -#define EFFECT_LEECH_SEED 84 -#define EFFECT_DO_NOTHING 85 -#define EFFECT_DISABLE 86 -#define EFFECT_LEVEL_DAMAGE 87 -#define EFFECT_PSYWAVE 88 -#define EFFECT_COUNTER 89 -#define EFFECT_ENCORE 90 -#define EFFECT_PAIN_SPLIT 91 -#define EFFECT_SNORE 92 -#define EFFECT_CONVERSION_2 93 -#define EFFECT_LOCK_ON 94 -#define EFFECT_SKETCH 95 -#define EFFECT_HAMMER_ARM 96 -#define EFFECT_SLEEP_TALK 97 -#define EFFECT_DESTINY_BOND 98 -#define EFFECT_FLAIL 99 -#define EFFECT_SPITE 100 -#define EFFECT_FALSE_SWIPE 101 -#define EFFECT_HEAL_BELL 102 -#define EFFECT_ALWAYS_CRIT 103 -#define EFFECT_TRIPLE_KICK 104 -#define EFFECT_THIEF 105 -#define EFFECT_MEAN_LOOK 106 -#define EFFECT_NIGHTMARE 107 -#define EFFECT_MINIMIZE 108 -#define EFFECT_CURSE 109 -#define EFFECT_HEALING_WISH 110 -#define EFFECT_PROTECT 111 -#define EFFECT_SPIKES 112 -#define EFFECT_FORESIGHT 113 -#define EFFECT_PERISH_SONG 114 -#define EFFECT_SANDSTORM 115 -#define EFFECT_ENDURE 116 -#define EFFECT_ROLLOUT 117 -#define EFFECT_SWAGGER 118 -#define EFFECT_FURY_CUTTER 119 -#define EFFECT_ATTRACT 120 -#define EFFECT_RETURN 121 -#define EFFECT_PRESENT 122 -#define EFFECT_FRUSTRATION 123 -#define EFFECT_SAFEGUARD 124 -#define EFFECT_UNUSED_125 125 -#define EFFECT_MAGNITUDE 126 -#define EFFECT_BATON_PASS 127 -#define EFFECT_PURSUIT 128 -#define EFFECT_RAPID_SPIN 129 -#define EFFECT_SONICBOOM 130 -#define EFFECT_CAPTIVATE 131 -#define EFFECT_MORNING_SUN 132 -#define EFFECT_SYNTHESIS 133 -#define EFFECT_MOONLIGHT 134 -#define EFFECT_HIDDEN_POWER 135 -#define EFFECT_RAIN_DANCE 136 -#define EFFECT_SUNNY_DAY 137 -#define EFFECT_DEFENSE_UP_HIT 138 -#define EFFECT_ATTACK_UP_HIT 139 -#define EFFECT_ALL_STATS_UP_HIT 140 -#define EFFECT_FELL_STINGER 141 -#define EFFECT_BELLY_DRUM 142 -#define EFFECT_PSYCH_UP 143 -#define EFFECT_MIRROR_COAT 144 -#define EFFECT_SKULL_BASH 145 -#define EFFECT_TWISTER 146 -#define EFFECT_EARTHQUAKE 147 -#define EFFECT_FUTURE_SIGHT 148 -#define EFFECT_GUST 149 -#define EFFECT_FLINCH_MINIMIZE_HIT 150 -#define EFFECT_SOLARBEAM 151 -#define EFFECT_THUNDER 152 -#define EFFECT_TELEPORT 153 -#define EFFECT_BEAT_UP 154 -#define EFFECT_SEMI_INVULNERABLE 155 -#define EFFECT_DEFENSE_CURL 156 -#define EFFECT_SOFTBOILED 157 -#define EFFECT_FAKE_OUT 158 -#define EFFECT_UPROAR 159 -#define EFFECT_STOCKPILE 160 -#define EFFECT_SPIT_UP 161 -#define EFFECT_SWALLOW 162 -#define EFFECT_WORRY_SEED 163 -#define EFFECT_HAIL 164 -#define EFFECT_TORMENT 165 -#define EFFECT_FLATTER 166 -#define EFFECT_WILL_O_WISP 167 -#define EFFECT_MEMENTO 168 -#define EFFECT_FACADE 169 -#define EFFECT_FOCUS_PUNCH 170 -#define EFFECT_SMELLINGSALT 171 -#define EFFECT_FOLLOW_ME 172 -#define EFFECT_NATURE_POWER 173 -#define EFFECT_CHARGE 174 -#define EFFECT_TAUNT 175 -#define EFFECT_HELPING_HAND 176 -#define EFFECT_TRICK 177 -#define EFFECT_ROLE_PLAY 178 -#define EFFECT_WISH 179 -#define EFFECT_ASSIST 180 -#define EFFECT_INGRAIN 181 -#define EFFECT_SUPERPOWER 182 -#define EFFECT_MAGIC_COAT 183 -#define EFFECT_RECYCLE 184 -#define EFFECT_REVENGE 185 -#define EFFECT_BRICK_BREAK 186 -#define EFFECT_YAWN 187 -#define EFFECT_KNOCK_OFF 188 -#define EFFECT_ENDEAVOR 189 -#define EFFECT_ERUPTION 190 -#define EFFECT_SKILL_SWAP 191 -#define EFFECT_IMPRISON 192 -#define EFFECT_REFRESH 193 -#define EFFECT_GRUDGE 194 -#define EFFECT_SNATCH 195 -#define EFFECT_LOW_KICK 196 -#define EFFECT_SECRET_POWER 197 -#define EFFECT_RECOIL_33 198 -#define EFFECT_TEETER_DANCE 199 -#define EFFECT_HIT_ESCAPE 200 -#define EFFECT_MUD_SPORT 201 -#define EFFECT_POISON_FANG 202 -#define EFFECT_WEATHER_BALL 203 -#define EFFECT_OVERHEAT 204 -#define EFFECT_TICKLE 205 -#define EFFECT_COSMIC_POWER 206 -#define EFFECT_SKY_UPPERCUT 207 -#define EFFECT_BULK_UP 208 -#define EFFECT_PLACEHOLDER 209 -#define EFFECT_WATER_SPORT 210 -#define EFFECT_CALM_MIND 211 -#define EFFECT_DRAGON_DANCE 212 -#define EFFECT_CAMOUFLAGE 213 +#define EFFECT_HIT 0 +#define EFFECT_SLEEP 1 +#define EFFECT_POISON_HIT 2 +#define EFFECT_ABSORB 3 +#define EFFECT_BURN_HIT 4 +#define EFFECT_FREEZE_HIT 5 +#define EFFECT_PARALYZE_HIT 6 +#define EFFECT_EXPLOSION 7 +#define EFFECT_DREAM_EATER 8 +#define EFFECT_MIRROR_MOVE 9 +#define EFFECT_ATTACK_UP 10 +#define EFFECT_DEFENSE_UP 11 +#define EFFECT_SPEED_UP 12 +#define EFFECT_SPECIAL_ATTACK_UP 13 +#define EFFECT_SPECIAL_DEFENSE_UP 14 +#define EFFECT_ACCURACY_UP 15 +#define EFFECT_EVASION_UP 16 +#define EFFECT_SPECIAL_ATTACK_UP_3 17 +#define EFFECT_ATTACK_DOWN 18 +#define EFFECT_DEFENSE_DOWN 19 +#define EFFECT_SPEED_DOWN 20 +#define EFFECT_SPECIAL_ATTACK_DOWN 21 +#define EFFECT_SPECIAL_DEFENSE_DOWN 22 +#define EFFECT_ACCURACY_DOWN 23 +#define EFFECT_EVASION_DOWN 24 +#define EFFECT_HAZE 25 +#define EFFECT_BIDE 26 +#define EFFECT_RAMPAGE 27 +#define EFFECT_ROAR 28 +#define EFFECT_MULTI_HIT 29 +#define EFFECT_CONVERSION 30 +#define EFFECT_FLINCH_HIT 31 +#define EFFECT_RESTORE_HP 32 +#define EFFECT_TOXIC 33 +#define EFFECT_PAY_DAY 34 +#define EFFECT_LIGHT_SCREEN 35 +#define EFFECT_TRI_ATTACK 36 +#define EFFECT_REST 37 +#define EFFECT_OHKO 38 +#define EFFECT_FUSION_COMBO 39 +#define EFFECT_SUPER_FANG 40 +#define EFFECT_DRAGON_RAGE 41 +#define EFFECT_TRAP 42 +#define EFFECT_HEAL_BLOCK 43 +#define EFFECT_RECOIL_IF_MISS 44 +#define EFFECT_MIST 45 +#define EFFECT_FOCUS_ENERGY 46 +#define EFFECT_RECOIL_25 47 +#define EFFECT_CONFUSE 48 +#define EFFECT_ATTACK_UP_2 49 +#define EFFECT_DEFENSE_UP_2 50 +#define EFFECT_SPEED_UP_2 51 +#define EFFECT_SPECIAL_ATTACK_UP_2 52 +#define EFFECT_SPECIAL_DEFENSE_UP_2 53 +#define EFFECT_ACCURACY_UP_2 54 +#define EFFECT_EVASION_UP_2 55 +#define EFFECT_TRANSFORM 56 +#define EFFECT_ATTACK_DOWN_2 57 +#define EFFECT_DEFENSE_DOWN_2 58 +#define EFFECT_SPEED_DOWN_2 59 +#define EFFECT_SPECIAL_ATTACK_DOWN_2 60 +#define EFFECT_SPECIAL_DEFENSE_DOWN_2 61 +#define EFFECT_ACCURACY_DOWN_2 62 +#define EFFECT_EVASION_DOWN_2 63 +#define EFFECT_REFLECT 64 +#define EFFECT_POISON 65 +#define EFFECT_PARALYZE 66 +#define EFFECT_ATTACK_DOWN_HIT 67 +#define EFFECT_DEFENSE_DOWN_HIT 68 +#define EFFECT_SPEED_DOWN_HIT 69 +#define EFFECT_SPECIAL_ATTACK_DOWN_HIT 70 +#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT 71 +#define EFFECT_ACCURACY_DOWN_HIT 72 +#define EFFECT_EVASION_DOWN_HIT 73 +#define EFFECT_TWO_TURNS_ATTACK 74 +#define EFFECT_CONFUSE_HIT 75 +#define EFFECT_VITAL_THROW 76 +#define EFFECT_SUBSTITUTE 77 +#define EFFECT_RECHARGE 78 +#define EFFECT_RAGE 79 +#define EFFECT_MIMIC 80 +#define EFFECT_METRONOME 81 +#define EFFECT_LEECH_SEED 82 +#define EFFECT_DO_NOTHING 83 +#define EFFECT_DISABLE 84 +#define EFFECT_LEVEL_DAMAGE 85 +#define EFFECT_PSYWAVE 86 +#define EFFECT_COUNTER 87 +#define EFFECT_ENCORE 88 +#define EFFECT_PAIN_SPLIT 89 +#define EFFECT_SNORE 90 +#define EFFECT_CONVERSION_2 91 +#define EFFECT_LOCK_ON 92 +#define EFFECT_SKETCH 93 +#define EFFECT_HAMMER_ARM 94 +#define EFFECT_SLEEP_TALK 95 +#define EFFECT_DESTINY_BOND 96 +#define EFFECT_FLAIL 97 +#define EFFECT_SPITE 98 +#define EFFECT_FALSE_SWIPE 99 +#define EFFECT_HEAL_BELL 100 +#define EFFECT_ALWAYS_CRIT 101 +#define EFFECT_TRIPLE_KICK 102 +#define EFFECT_THIEF 103 +#define EFFECT_MEAN_LOOK 104 +#define EFFECT_NIGHTMARE 105 +#define EFFECT_MINIMIZE 106 +#define EFFECT_CURSE 107 +#define EFFECT_HEALING_WISH 108 +#define EFFECT_PROTECT 109 +#define EFFECT_SPIKES 110 +#define EFFECT_FORESIGHT 111 +#define EFFECT_PERISH_SONG 112 +#define EFFECT_SANDSTORM 113 +#define EFFECT_ENDURE 114 +#define EFFECT_ROLLOUT 115 +#define EFFECT_SWAGGER 116 +#define EFFECT_FURY_CUTTER 117 +#define EFFECT_ATTRACT 118 +#define EFFECT_RETURN 119 +#define EFFECT_PRESENT 120 +#define EFFECT_FRUSTRATION 121 +#define EFFECT_SAFEGUARD 122 +#define EFFECT_UNUSED_125 123 +#define EFFECT_MAGNITUDE 124 +#define EFFECT_BATON_PASS 125 +#define EFFECT_PURSUIT 126 +#define EFFECT_RAPID_SPIN 127 +#define EFFECT_SONICBOOM 128 +#define EFFECT_CAPTIVATE 129 +#define EFFECT_MORNING_SUN 130 +#define EFFECT_SYNTHESIS 131 +#define EFFECT_MOONLIGHT 132 +#define EFFECT_HIDDEN_POWER 133 +#define EFFECT_RAIN_DANCE 134 +#define EFFECT_SUNNY_DAY 135 +#define EFFECT_DEFENSE_UP_HIT 136 +#define EFFECT_ATTACK_UP_HIT 137 +#define EFFECT_ALL_STATS_UP_HIT 138 +#define EFFECT_FELL_STINGER 139 +#define EFFECT_BELLY_DRUM 140 +#define EFFECT_PSYCH_UP 141 +#define EFFECT_MIRROR_COAT 142 +#define EFFECT_SKULL_BASH 143 +#define EFFECT_TWISTER 144 +#define EFFECT_EARTHQUAKE 145 +#define EFFECT_FUTURE_SIGHT 146 +#define EFFECT_GUST 147 +#define EFFECT_FLINCH_MINIMIZE_HIT 148 +#define EFFECT_SOLARBEAM 149 +#define EFFECT_THUNDER 150 +#define EFFECT_TELEPORT 151 +#define EFFECT_BEAT_UP 152 +#define EFFECT_SEMI_INVULNERABLE 153 +#define EFFECT_DEFENSE_CURL 154 +#define EFFECT_SOFTBOILED 155 +#define EFFECT_FAKE_OUT 156 +#define EFFECT_UPROAR 157 +#define EFFECT_STOCKPILE 158 +#define EFFECT_SPIT_UP 159 +#define EFFECT_SWALLOW 160 +#define EFFECT_WORRY_SEED 161 +#define EFFECT_HAIL 162 +#define EFFECT_TORMENT 163 +#define EFFECT_FLATTER 164 +#define EFFECT_WILL_O_WISP 165 +#define EFFECT_MEMENTO 166 +#define EFFECT_FACADE 167 +#define EFFECT_FOCUS_PUNCH 168 +#define EFFECT_SMELLINGSALT 169 +#define EFFECT_FOLLOW_ME 170 +#define EFFECT_NATURE_POWER 171 +#define EFFECT_CHARGE 172 +#define EFFECT_TAUNT 173 +#define EFFECT_HELPING_HAND 174 +#define EFFECT_TRICK 175 +#define EFFECT_ROLE_PLAY 176 +#define EFFECT_WISH 177 +#define EFFECT_ASSIST 178 +#define EFFECT_INGRAIN 179 +#define EFFECT_SUPERPOWER 180 +#define EFFECT_MAGIC_COAT 181 +#define EFFECT_RECYCLE 182 +#define EFFECT_REVENGE 183 +#define EFFECT_BRICK_BREAK 184 +#define EFFECT_YAWN 185 +#define EFFECT_KNOCK_OFF 186 +#define EFFECT_ENDEAVOR 187 +#define EFFECT_ERUPTION 188 +#define EFFECT_SKILL_SWAP 189 +#define EFFECT_IMPRISON 190 +#define EFFECT_REFRESH 191 +#define EFFECT_GRUDGE 192 +#define EFFECT_SNATCH 193 +#define EFFECT_LOW_KICK 194 +#define EFFECT_SECRET_POWER 195 +#define EFFECT_RECOIL_33 196 +#define EFFECT_TEETER_DANCE 197 +#define EFFECT_HIT_ESCAPE 198 +#define EFFECT_MUD_SPORT 199 +#define EFFECT_POISON_FANG 200 +#define EFFECT_WEATHER_BALL 201 +#define EFFECT_OVERHEAT 202 +#define EFFECT_TICKLE 203 +#define EFFECT_COSMIC_POWER 204 +#define EFFECT_SKY_UPPERCUT 205 +#define EFFECT_BULK_UP 206 +#define EFFECT_PLACEHOLDER 207 +#define EFFECT_WATER_SPORT 208 +#define EFFECT_CALM_MIND 209 +#define EFFECT_DRAGON_DANCE 210 +#define EFFECT_CAMOUFLAGE 211 + +// New move effects 212 +#define EFFECT_PLEDGE 213 +#define EFFECT_FLING 214 +#define EFFECT_NATURAL_GIFT 215 +#define EFFECT_WAKE_UP_SLAP 216 +#define EFFECT_WRING_OUT 217 +#define EFFECT_HEX 218 +#define EFFECT_ASSURANCE 219 +#define EFFECT_TRUMP_CARD 220 +#define EFFECT_ACROBATICS 221 +#define EFFECT_HEAT_CRASH 222 +#define EFFECT_PUNISHMENT 223 +#define EFFECT_STORED_POWER 224 +#define EFFECT_ELECTRO_BALL 225 +#define EFFECT_GYRO_BALL 226 +#define EFFECT_ECHOED_VOICE 227 +#define EFFECT_PAYBACK 228 +#define EFFECT_ROUND 229 +#define EFFECT_BRINE 230 +#define EFFECT_VENOSHOCK 231 +#define EFFECT_RETALIATE 232 +#define EFFECT_BULLDOZE 233 +#define EFFECT_FOUL_PLAY 234 +#define EFFECT_PSYSHOCK 235 +#define EFFECT_ROOST 236 +#define EFFECT_GRAVITY 237 +#define EFFECT_MIRACLE_EYE 238 +#define EFFECT_TAILWIND 239 +#define EFFECT_EMBARGO 240 +#define EFFECT_AQUA_RING 241 +#define EFFECT_TRICK_ROOM 242 +#define EFFECT_WONDER_ROOM 243 +#define EFFECT_MAGIC_ROOM 244 +#define EFFECT_MAGNET_RISE 245 +#define EFFECT_TOXIC_SPIKES 246 +#define EFFECT_GASTRO_ACID 247 +#define EFFECT_STEALTH_ROCK 248 +#define EFFECT_TELEKINESIS 249 +#define EFFECT_POWER_SWAP 250 +#define EFFECT_GUARD_SWAP 251 +#define EFFECT_HEART_SWAP 252 +#define EFFECT_POWER_SPLIT 253 +#define EFFECT_GUARD_SPLIT 254 +#define EFFECT_STICKY_WEB 255 +#define EFFECT_METAL_BURST 256 +#define EFFECT_LUCKY_CHANT 257 +#define EFFECT_SUCKER_PUNCH 258 +#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 259 +#define EFFECT_SIMPLE_BEAM 260 +#define EFFECT_ENTRAINMENT 261 +#define EFFECT_HEAL_PULSE 262 +#define EFFECT_QUASH 263 +#define EFFECT_ION_DELUGE 264 +#define EFFECT_FREEZE_DRY 265 +#define EFFECT_TOPSY_TURVY 266 +#define EFFECT_MISTY_TERRAIN 267 +#define EFFECT_GRASSY_TERRAIN 268 +#define EFFECT_ELECTRIC_TERRAIN 269 +#define EFFECT_PSYCHIC_TERRAIN 270 +#define EFFECT_ATTACK_ACCURACY_UP 271 +#define EFFECT_ATTACK_SPATK_UP 272 +#define EFFECT_HURRICANE 273 +#define EFFECT_TWO_TYPED_MOVE 274 +#define EFFECT_ME_FIRST 275 +#define EFFECT_SPEED_UP_HIT 276 +#define EFFECT_QUIVER_DANCE 277 +#define EFFECT_COIL 278 +#define EFFECT_ELECTRIFY 279 +#define EFFECT_SCALD 280 +#define EFFECT_REFLECT_TYPE 281 +#define EFFECT_SOAK 282 +#define EFFECT_GROWTH 283 +#define EFFECT_CLOSE_COMBAT 284 +#define EFFECT_LAST_RESORT 285 +#define EFFECT_RECOIL_33_STATUS 286 +#define EFFECT_FLINCH_STATUS 287 +#define EFFECT_RECOIL_50 288 +#define EFFECT_SHELL_SMASH 289 +#define EFFECT_SHIFT_GEAR 290 +#define EFFECT_DEFENSE_UP_3 291 +#define EFFECT_NOBLE_ROAR 292 +#define EFFECT_VENOM_DRENCH 293 +#define EFFECT_TOXIC_THREAD 294 +#define EFFECT_CLEAR_SMOG 295 +#define EFFECT_HIT_SWITCH_TARGET 296 +#define EFFECT_FINAL_GAMBIT 297 +#define EFFECT_CHANGE_TYPE_ON_ITEM 298 +#define EFFECT_AUTOTOMIZE 299 +#define EFFECT_COPYCAT 300 +#define EFFECT_DEFOG 301 +#define EFFECT_HIT_ENEMY_HEAL_ALLY 302 +#define EFFECT_SMACK_DOWN 303 +#define EFFECT_SYNCHRONOISE 304 +#define EFFECT_PSYCHO_SHIFT 305 +#define EFFECT_POWER_TRICK 306 +#define EFFECT_FLAME_BURST 307 +#define EFFECT_AFTER_YOU 308 +#define EFFECT_BESTOW 309 +#define EFFECT_ROTOTILLER 310 +#define EFFECT_FLOWER_SHIELD 311 +#define EFFECT_HIT_PREVENT_ESCAPE 312 +#define EFFECT_SPEED_SWAP 313 +#define EFFECT_DEFENSE_UP2_HIT 314 +#define EFFECT_REVELATION_DANCE 315 +#define EFFECT_AURORA_VEIL 316 +#define EFFECT_THIRD_TYPE 317 +#define EFFECT_FEINT 318 +#define EFFECT_SPARKLING_ARIA 319 +#define EFFECT_ACUPRESSURE 320 +#define EFFECT_AROMATIC_MIST 321 +#define EFFECT_POWDER 322 +#define EFFECT_SP_ATTACK_UP_HIT 323 +#define EFFECT_BELCH 324 +#define EFFECT_PARTING_SHOT 325 +#define EFFECT_SPECTRAL_THIEF 326 +#define EFFECT_V_CREATE 327 +#define EFFECT_MAT_BLOCK 328 +#define EFFECT_STOMPING_TANTRUM 329 +#define EFFECT_CORE_ENFORCER 330 +#define EFFECT_INSTRUCT 331 +#define EFFECT_THROAT_CHOP 332 +#define EFFECT_LASER_FOCUS 333 +#define EFFECT_MAGNETIC_FLUX 334 +#define EFFECT_GEAR_UP 335 +#define EFFECT_INCINERATE 336 +#define EFFECT_BUG_BITE 337 +#define EFFECT_STRENGTH_SAP 338 +#define EFFECT_MIND_BLOWN 339 +#define EFFECT_PURIFY 340 +#define EFFECT_BURN_UP 341 +#define EFFECT_SHORE_UP 342 +#define EFFECT_GEOMANCY 343 +#define EFFECT_FAIRY_LOCK 344 +#define EFFECT_ALLY_SWITCH 345 +#define EFFECT_SLEEP_HIT 346 +#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 347 +#define EFFECT_BODY_PRESS 348 +#define EFFECT_EERIE_SPELL 349 +#define EFFECT_JUNGLE_HEALING 350 +#define EFFECT_COACHING 351 +#define EFFECT_LASH_OUT 352 +#define EFFECT_GRASSY_GLIDE 353 +#define EFFECT_REMOVE_TERRAIN 354 +#define EFFECT_DYNAMAX_DOUBLE_DMG 355 +#define EFFECT_DECORATE 356 +#define EFFECT_SNIPE_SHOT 357 +#define EFFECT_RECOIL_HP_25 358 +#define EFFECT_STUFF_CHEEKS 359 +#define EFFECT_GRAV_APPLE 360 +#define EFFECT_EVASION_UP_HIT 361 +#define EFFECT_GLITZY_GLOW 362 +#define EFFECT_BADDY_BAD 363 +#define EFFECT_SAPPY_SEED 364 +#define EFFECT_FREEZY_FROST 365 +#define EFFECT_SPARKLY_SWIRL 366 +#define EFFECT_PLASMA_FISTS 367 +#define EFFECT_HYPERSPACE_FURY 368 + +#define NUM_BATTLE_MOVE_EFFECTS 369 -// New move effects -#define EFFECT_PLEDGE 214 -#define EFFECT_FLING 215 -#define EFFECT_NATURAL_GIFT 216 -#define EFFECT_WAKE_UP_SLAP 217 -#define EFFECT_WRING_OUT 218 -#define EFFECT_HEX 219 -#define EFFECT_ASSURANCE 220 -#define EFFECT_TRUMP_CARD 221 -#define EFFECT_ACROBATICS 222 -#define EFFECT_HEAT_CRASH 223 -#define EFFECT_PUNISHMENT 224 -#define EFFECT_STORED_POWER 225 -#define EFFECT_ELECTRO_BALL 226 -#define EFFECT_GYRO_BALL 227 -#define EFFECT_ECHOED_VOICE 228 -#define EFFECT_PAYBACK 229 -#define EFFECT_ROUND 230 -#define EFFECT_BRINE 231 -#define EFFECT_VENOSHOCK 232 -#define EFFECT_RETALIATE 233 -#define EFFECT_BULLDOZE 234 -#define EFFECT_FOUL_PLAY 235 -#define EFFECT_PSYSHOCK 236 -#define EFFECT_ROOST 237 -#define EFFECT_GRAVITY 238 -#define EFFECT_MIRACLE_EYE 239 -#define EFFECT_TAILWIND 240 -#define EFFECT_EMBARGO 241 -#define EFFECT_AQUA_RING 242 -#define EFFECT_TRICK_ROOM 243 -#define EFFECT_WONDER_ROOM 244 -#define EFFECT_MAGIC_ROOM 245 -#define EFFECT_MAGNET_RISE 246 -#define EFFECT_TOXIC_SPIKES 247 -#define EFFECT_GASTRO_ACID 248 -#define EFFECT_STEALTH_ROCK 249 -#define EFFECT_TELEKINESIS 250 -#define EFFECT_POWER_SWAP 251 -#define EFFECT_GUARD_SWAP 252 -#define EFFECT_HEART_SWAP 253 -#define EFFECT_POWER_SPLIT 254 -#define EFFECT_GUARD_SPLIT 255 -#define EFFECT_STICKY_WEB 256 -#define EFFECT_METAL_BURST 257 -#define EFFECT_LUCKY_CHANT 258 -#define EFFECT_SUCKER_PUNCH 259 -#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 260 -#define EFFECT_SIMPLE_BEAM 261 -#define EFFECT_ENTRAINMENT 262 -#define EFFECT_HEAL_PULSE 263 -#define EFFECT_QUASH 264 -#define EFFECT_ION_DELUGE 265 -#define EFFECT_FREEZE_DRY 266 -#define EFFECT_TOPSY_TURVY 267 -#define EFFECT_MISTY_TERRAIN 268 -#define EFFECT_GRASSY_TERRAIN 269 -#define EFFECT_ELECTRIC_TERRAIN 270 -#define EFFECT_PSYCHIC_TERRAIN 271 -#define EFFECT_ATTACK_ACCURACY_UP 272 -#define EFFECT_ATTACK_SPATK_UP 273 -#define EFFECT_HURRICANE 274 -#define EFFECT_TWO_TYPED_MOVE 275 -#define EFFECT_ME_FIRST 276 -#define EFFECT_SPEED_UP_HIT 277 -#define EFFECT_QUIVER_DANCE 278 -#define EFFECT_COIL 279 -#define EFFECT_ELECTRIFY 280 -#define EFFECT_SCALD 281 -#define EFFECT_REFLECT_TYPE 282 -#define EFFECT_SOAK 283 -#define EFFECT_GROWTH 284 -#define EFFECT_CLOSE_COMBAT 285 -#define EFFECT_LAST_RESORT 286 -#define EFFECT_RECOIL_33_STATUS 287 -#define EFFECT_FLINCH_STATUS 288 -#define EFFECT_RECOIL_50 289 -#define EFFECT_SHELL_SMASH 290 -#define EFFECT_SHIFT_GEAR 291 -#define EFFECT_DEFENSE_UP_3 292 -#define EFFECT_NOBLE_ROAR 293 -#define EFFECT_VENOM_DRENCH 294 -#define EFFECT_TOXIC_THREAD 295 -#define EFFECT_CLEAR_SMOG 296 -#define EFFECT_HIT_SWITCH_TARGET 297 -#define EFFECT_FINAL_GAMBIT 298 -#define EFFECT_CHANGE_TYPE_ON_ITEM 299 -#define EFFECT_AUTOTOMIZE 300 -#define EFFECT_COPYCAT 301 -#define EFFECT_DEFOG 302 -#define EFFECT_HIT_ENEMY_HEAL_ALLY 303 -#define EFFECT_SMACK_DOWN 304 -#define EFFECT_SYNCHRONOISE 305 -#define EFFECT_PSYCHO_SHIFT 306 -#define EFFECT_POWER_TRICK 307 -#define EFFECT_FLAME_BURST 308 -#define EFFECT_AFTER_YOU 309 -#define EFFECT_BESTOW 310 -#define EFFECT_ROTOTILLER 311 -#define EFFECT_FLOWER_SHIELD 312 -#define EFFECT_HIT_PREVENT_ESCAPE 313 -#define EFFECT_SPEED_SWAP 314 -#define EFFECT_DEFENSE_UP2_HIT 315 -#define EFFECT_REVELATION_DANCE 316 -#define EFFECT_AURORA_VEIL 317 -#define EFFECT_THIRD_TYPE 318 -#define EFFECT_FEINT 319 -#define EFFECT_SPARKLING_ARIA 320 -#define EFFECT_ACUPRESSURE 321 -#define EFFECT_AROMATIC_MIST 322 -#define EFFECT_POWDER 323 -#define EFFECT_SP_ATTACK_UP_HIT 324 -#define EFFECT_BELCH 325 -#define EFFECT_PARTING_SHOT 326 -#define EFFECT_SPECTRAL_THIEF 327 -#define EFFECT_V_CREATE 328 -#define EFFECT_MAT_BLOCK 329 -#define EFFECT_STOMPING_TANTRUM 330 -#define EFFECT_CORE_ENFORCER 331 -#define EFFECT_INSTRUCT 332 -#define EFFECT_THROAT_CHOP 333 -#define EFFECT_LASER_FOCUS 334 -#define EFFECT_MAGNETIC_FLUX 335 -#define EFFECT_GEAR_UP 336 -#define EFFECT_INCINERATE 337 -#define EFFECT_BUG_BITE 338 -#define EFFECT_STRENGTH_SAP 339 -#define EFFECT_MIND_BLOWN 340 -#define EFFECT_PURIFY 341 -#define EFFECT_BURN_UP 342 -#define EFFECT_SHORE_UP 343 -#define EFFECT_GEOMANCY 344 -#define EFFECT_FAIRY_LOCK 345 -#define EFFECT_ALLY_SWITCH 346 -#define EFFECT_SLEEP_HIT 347 -#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 348 -#define EFFECT_BODY_PRESS 349 -#define EFFECT_EERIE_SPELL 350 -#define EFFECT_JUNGLE_HEALING 351 -#define EFFECT_COACHING 352 -#define EFFECT_LASH_OUT 353 -#define EFFECT_GRASSY_GLIDE 354 -#define EFFECT_REMOVE_TERRAIN 355 -#define EFFECT_DYNAMAX_DOUBLE_DMG 356 -#define EFFECT_DECORATE 357 -#define EFFECT_SNIPE_SHOT 358 -#define EFFECT_TRIPLE_HIT 359 -#define EFFECT_RECOIL_HP_25 360 -#define EFFECT_STUFF_CHEEKS 361 -#define EFFECT_GRAV_APPLE 362 -#define EFFECT_EVASION_UP_HIT 363 -#define EFFECT_DOUBLE_IRON_BASH 364 -#define EFFECT_GLITZY_GLOW 365 -#define EFFECT_BADDY_BAD 366 -#define EFFECT_SAPPY_SEED 367 -#define EFFECT_FREEZY_FROST 368 -#define EFFECT_SPARKLY_SWIRL 369 -#define EFFECT_PLASMA_FISTS 370 -#define EFFECT_HYPERSPACE_FURY 371 - -#define NUM_BATTLE_MOVE_EFFECTS 372 - -#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H +#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 4e776e592..959148e6c 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -308,6 +308,7 @@ #define FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING (1 << 24) // Makes a Ground type move do 1x damage to flying and levitating targets #define FLAG_THAW_USER (1 << 25) #define FLAG_HIT_IN_SUBSTITUTE (1 << 26) // Hyperspace Fury +#define FLAG_TWO_STRIKES (1 << 27) // A move with this flag will strike twice, and may apply its effect on each hit // Split defines. #define SPLIT_PHYSICAL 0x0 diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 84fa7b634..43979a673 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -3241,7 +3241,6 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += min(CountPositiveStatStages(battlerDef), 4); break; case EFFECT_MULTI_HIT: - case EFFECT_DOUBLE_HIT: case EFFECT_TRIPLE_KICK: break; case EFFECT_CONVERSION: diff --git a/src/battle_tv.c b/src/battle_tv.c index e6e29470d..3566f0873 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -130,7 +130,7 @@ static const u16 sPoints_MoveEffect[NUM_BATTLE_MOVE_EFFECTS] = [EFFECT_DRAGON_RAGE] = 2, [EFFECT_TRAP] = 4, // [EFFECT_HIGH_CRITICAL] = 1, - [EFFECT_DOUBLE_HIT] = 1, +// [EFFECT_DOUBLE_HIT] = 1, [EFFECT_RECOIL_IF_MISS] = 1, [EFFECT_MIST] = 5, [EFFECT_FOCUS_ENERGY] = 1, @@ -163,7 +163,7 @@ static const u16 sPoints_MoveEffect[NUM_BATTLE_MOVE_EFFECTS] = [EFFECT_EVASION_DOWN_HIT] = 1, // [EFFECT_SKY_ATTACK] = 4, [EFFECT_CONFUSE_HIT] = 1, - [EFFECT_TWINEEDLE] = 1, +// [EFFECT_TWINEEDLE] = 1, [EFFECT_VITAL_THROW] = 1, [EFFECT_SUBSTITUTE] = 4, [EFFECT_RECHARGE] = 5, diff --git a/src/battle_util.c b/src/battle_util.c index 6163e040f..e624ca166 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -217,20 +217,6 @@ static const u16 sEntrainmentTargetSimpleBeamBannedAbilities[] = ABILITY_GULP_MISSILE, }; -static const u16 sTwoStrikeMoves[] = -{ - MOVE_BONEMERANG, - MOVE_DOUBLE_HIT, - MOVE_DOUBLE_IRON_BASH, - MOVE_DOUBLE_KICK, - MOVE_DRAGON_DARTS, - MOVE_DUAL_CHOP, - MOVE_DUAL_WINGBEAT, - MOVE_GEAR_GRIND, - MOVE_TWINEEDLE, - 0xFFFF -}; - static u8 CalcBeatUpPower(void) { struct Pokemon *party; @@ -3571,7 +3557,7 @@ u8 AtkCanceller_UnableToUseMove(void) PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) } - else if (IsTwoStrikesMove(gCurrentMove)) + else if (gBattleMoves[gCurrentMove].flags & FLAG_TWO_STRIKES) { gMultiHitCounter = 2; PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) @@ -9714,15 +9700,3 @@ u16 GetUsedHeldItem(u8 battler) { return gBattleStruct->usedHeldItems[gBattlerPartyIndexes[battler]][GetBattlerSide(battler)]; } - -bool8 IsTwoStrikesMove(u16 move) -{ - u32 i; - - for (i = 0; i < ARRAY_COUNT(sTwoStrikeMoves); i++) - { - if (move == sTwoStrikeMoves[i]) - return TRUE; - } - return FALSE; -} diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index c3892cdc8..3729bf224 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -370,7 +370,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_DOUBLE_KICK] = { - .effect = EFFECT_DOUBLE_HIT, + .effect = EFFECT_HIT, .power = 30, .type = TYPE_FIGHTING, .accuracy = 100, @@ -378,7 +378,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -649,7 +649,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 20, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -2452,7 +2452,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_BONEMERANG] = { - .effect = EFFECT_DOUBLE_HIT, + .effect = EFFECT_HIT, .power = 50, .type = TYPE_GROUND, .accuracy = 90, @@ -2460,7 +2460,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -7259,7 +7259,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_DOUBLE_HIT] = { - .effect = EFFECT_DOUBLE_HIT, + .effect = EFFECT_HIT, .power = 35, .type = TYPE_NORMAL, .accuracy = 90, @@ -7267,7 +7267,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -8359,7 +8359,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_DUAL_CHOP] = { - .effect = EFFECT_DOUBLE_HIT, + .effect = EFFECT_HIT, .power = 40, .type = TYPE_DRAGON, .accuracy = 90, @@ -8367,7 +8367,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -8567,7 +8567,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_GEAR_GRIND] = { - .effect = EFFECT_DOUBLE_HIT, + .effect = EFFECT_HIT, .power = 50, .type = TYPE_STEEL, .accuracy = 85, @@ -8575,7 +8575,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -10726,9 +10726,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_DOUBLE_IRON_BASH] = { #if B_UPDATED_MOVE_DATA >= GEN_8 - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES, #else - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES, #endif .effect = EFFECT_FLINCH_HIT, .power = 60, @@ -10850,7 +10850,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -11472,7 +11472,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_DUAL_WINGBEAT] = { - .effect = EFFECT_DOUBLE_HIT, + .effect = EFFECT_HIT, .power = 40, .type = TYPE_FLYING, .accuracy = 90, @@ -11480,7 +11480,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, From 5d678bc2ce66f3432ceaf689839f11c950ce1a2d Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Mon, 1 Nov 2021 23:51:03 +1300 Subject: [PATCH 08/58] Fix move effect defines Had a define in a comment, which offset all the new move effects and misaligned their battle scripts. --- data/battle_scripts_1.s | 10 - include/constants/battle_move_effects.h | 316 ++++++++++++------------ 2 files changed, 158 insertions(+), 168 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 9f2f46484..e4514abf6 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -3551,16 +3551,6 @@ BattleScript_EffectConfuseHit:: setmoveeffect MOVE_EFFECT_CONFUSION goto BattleScript_EffectHit -BattleScript_EffectTwineedle:: - attackcanceler - accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE - sethword sMULTIHIT_EFFECT, MOVE_EFFECT_POISON - attackstring - ppreduce - setmultihitcounter 2 - initmultihitstring - goto BattleScript_MultiHitLoop - BattleScript_EffectSubstitute:: attackcanceler ppreduce diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index fd8919374..1892d9da9 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -214,164 +214,164 @@ #define EFFECT_DRAGON_DANCE 210 #define EFFECT_CAMOUFLAGE 211 -// New move effects 212 -#define EFFECT_PLEDGE 213 -#define EFFECT_FLING 214 -#define EFFECT_NATURAL_GIFT 215 -#define EFFECT_WAKE_UP_SLAP 216 -#define EFFECT_WRING_OUT 217 -#define EFFECT_HEX 218 -#define EFFECT_ASSURANCE 219 -#define EFFECT_TRUMP_CARD 220 -#define EFFECT_ACROBATICS 221 -#define EFFECT_HEAT_CRASH 222 -#define EFFECT_PUNISHMENT 223 -#define EFFECT_STORED_POWER 224 -#define EFFECT_ELECTRO_BALL 225 -#define EFFECT_GYRO_BALL 226 -#define EFFECT_ECHOED_VOICE 227 -#define EFFECT_PAYBACK 228 -#define EFFECT_ROUND 229 -#define EFFECT_BRINE 230 -#define EFFECT_VENOSHOCK 231 -#define EFFECT_RETALIATE 232 -#define EFFECT_BULLDOZE 233 -#define EFFECT_FOUL_PLAY 234 -#define EFFECT_PSYSHOCK 235 -#define EFFECT_ROOST 236 -#define EFFECT_GRAVITY 237 -#define EFFECT_MIRACLE_EYE 238 -#define EFFECT_TAILWIND 239 -#define EFFECT_EMBARGO 240 -#define EFFECT_AQUA_RING 241 -#define EFFECT_TRICK_ROOM 242 -#define EFFECT_WONDER_ROOM 243 -#define EFFECT_MAGIC_ROOM 244 -#define EFFECT_MAGNET_RISE 245 -#define EFFECT_TOXIC_SPIKES 246 -#define EFFECT_GASTRO_ACID 247 -#define EFFECT_STEALTH_ROCK 248 -#define EFFECT_TELEKINESIS 249 -#define EFFECT_POWER_SWAP 250 -#define EFFECT_GUARD_SWAP 251 -#define EFFECT_HEART_SWAP 252 -#define EFFECT_POWER_SPLIT 253 -#define EFFECT_GUARD_SPLIT 254 -#define EFFECT_STICKY_WEB 255 -#define EFFECT_METAL_BURST 256 -#define EFFECT_LUCKY_CHANT 257 -#define EFFECT_SUCKER_PUNCH 258 -#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 259 -#define EFFECT_SIMPLE_BEAM 260 -#define EFFECT_ENTRAINMENT 261 -#define EFFECT_HEAL_PULSE 262 -#define EFFECT_QUASH 263 -#define EFFECT_ION_DELUGE 264 -#define EFFECT_FREEZE_DRY 265 -#define EFFECT_TOPSY_TURVY 266 -#define EFFECT_MISTY_TERRAIN 267 -#define EFFECT_GRASSY_TERRAIN 268 -#define EFFECT_ELECTRIC_TERRAIN 269 -#define EFFECT_PSYCHIC_TERRAIN 270 -#define EFFECT_ATTACK_ACCURACY_UP 271 -#define EFFECT_ATTACK_SPATK_UP 272 -#define EFFECT_HURRICANE 273 -#define EFFECT_TWO_TYPED_MOVE 274 -#define EFFECT_ME_FIRST 275 -#define EFFECT_SPEED_UP_HIT 276 -#define EFFECT_QUIVER_DANCE 277 -#define EFFECT_COIL 278 -#define EFFECT_ELECTRIFY 279 -#define EFFECT_SCALD 280 -#define EFFECT_REFLECT_TYPE 281 -#define EFFECT_SOAK 282 -#define EFFECT_GROWTH 283 -#define EFFECT_CLOSE_COMBAT 284 -#define EFFECT_LAST_RESORT 285 -#define EFFECT_RECOIL_33_STATUS 286 -#define EFFECT_FLINCH_STATUS 287 -#define EFFECT_RECOIL_50 288 -#define EFFECT_SHELL_SMASH 289 -#define EFFECT_SHIFT_GEAR 290 -#define EFFECT_DEFENSE_UP_3 291 -#define EFFECT_NOBLE_ROAR 292 -#define EFFECT_VENOM_DRENCH 293 -#define EFFECT_TOXIC_THREAD 294 -#define EFFECT_CLEAR_SMOG 295 -#define EFFECT_HIT_SWITCH_TARGET 296 -#define EFFECT_FINAL_GAMBIT 297 -#define EFFECT_CHANGE_TYPE_ON_ITEM 298 -#define EFFECT_AUTOTOMIZE 299 -#define EFFECT_COPYCAT 300 -#define EFFECT_DEFOG 301 -#define EFFECT_HIT_ENEMY_HEAL_ALLY 302 -#define EFFECT_SMACK_DOWN 303 -#define EFFECT_SYNCHRONOISE 304 -#define EFFECT_PSYCHO_SHIFT 305 -#define EFFECT_POWER_TRICK 306 -#define EFFECT_FLAME_BURST 307 -#define EFFECT_AFTER_YOU 308 -#define EFFECT_BESTOW 309 -#define EFFECT_ROTOTILLER 310 -#define EFFECT_FLOWER_SHIELD 311 -#define EFFECT_HIT_PREVENT_ESCAPE 312 -#define EFFECT_SPEED_SWAP 313 -#define EFFECT_DEFENSE_UP2_HIT 314 -#define EFFECT_REVELATION_DANCE 315 -#define EFFECT_AURORA_VEIL 316 -#define EFFECT_THIRD_TYPE 317 -#define EFFECT_FEINT 318 -#define EFFECT_SPARKLING_ARIA 319 -#define EFFECT_ACUPRESSURE 320 -#define EFFECT_AROMATIC_MIST 321 -#define EFFECT_POWDER 322 -#define EFFECT_SP_ATTACK_UP_HIT 323 -#define EFFECT_BELCH 324 -#define EFFECT_PARTING_SHOT 325 -#define EFFECT_SPECTRAL_THIEF 326 -#define EFFECT_V_CREATE 327 -#define EFFECT_MAT_BLOCK 328 -#define EFFECT_STOMPING_TANTRUM 329 -#define EFFECT_CORE_ENFORCER 330 -#define EFFECT_INSTRUCT 331 -#define EFFECT_THROAT_CHOP 332 -#define EFFECT_LASER_FOCUS 333 -#define EFFECT_MAGNETIC_FLUX 334 -#define EFFECT_GEAR_UP 335 -#define EFFECT_INCINERATE 336 -#define EFFECT_BUG_BITE 337 -#define EFFECT_STRENGTH_SAP 338 -#define EFFECT_MIND_BLOWN 339 -#define EFFECT_PURIFY 340 -#define EFFECT_BURN_UP 341 -#define EFFECT_SHORE_UP 342 -#define EFFECT_GEOMANCY 343 -#define EFFECT_FAIRY_LOCK 344 -#define EFFECT_ALLY_SWITCH 345 -#define EFFECT_SLEEP_HIT 346 -#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 347 -#define EFFECT_BODY_PRESS 348 -#define EFFECT_EERIE_SPELL 349 -#define EFFECT_JUNGLE_HEALING 350 -#define EFFECT_COACHING 351 -#define EFFECT_LASH_OUT 352 -#define EFFECT_GRASSY_GLIDE 353 -#define EFFECT_REMOVE_TERRAIN 354 -#define EFFECT_DYNAMAX_DOUBLE_DMG 355 -#define EFFECT_DECORATE 356 -#define EFFECT_SNIPE_SHOT 357 -#define EFFECT_RECOIL_HP_25 358 -#define EFFECT_STUFF_CHEEKS 359 -#define EFFECT_GRAV_APPLE 360 -#define EFFECT_EVASION_UP_HIT 361 -#define EFFECT_GLITZY_GLOW 362 -#define EFFECT_BADDY_BAD 363 -#define EFFECT_SAPPY_SEED 364 -#define EFFECT_FREEZY_FROST 365 -#define EFFECT_SPARKLY_SWIRL 366 -#define EFFECT_PLASMA_FISTS 367 -#define EFFECT_HYPERSPACE_FURY 368 +// New move effects +#define EFFECT_PLEDGE 212 +#define EFFECT_FLING 213 +#define EFFECT_NATURAL_GIFT 214 +#define EFFECT_WAKE_UP_SLAP 215 +#define EFFECT_WRING_OUT 216 +#define EFFECT_HEX 217 +#define EFFECT_ASSURANCE 218 +#define EFFECT_TRUMP_CARD 219 +#define EFFECT_ACROBATICS 220 +#define EFFECT_HEAT_CRASH 221 +#define EFFECT_PUNISHMENT 222 +#define EFFECT_STORED_POWER 223 +#define EFFECT_ELECTRO_BALL 224 +#define EFFECT_GYRO_BALL 225 +#define EFFECT_ECHOED_VOICE 226 +#define EFFECT_PAYBACK 227 +#define EFFECT_ROUND 228 +#define EFFECT_BRINE 229 +#define EFFECT_VENOSHOCK 230 +#define EFFECT_RETALIATE 231 +#define EFFECT_BULLDOZE 232 +#define EFFECT_FOUL_PLAY 233 +#define EFFECT_PSYSHOCK 234 +#define EFFECT_ROOST 235 +#define EFFECT_GRAVITY 236 +#define EFFECT_MIRACLE_EYE 237 +#define EFFECT_TAILWIND 238 +#define EFFECT_EMBARGO 239 +#define EFFECT_AQUA_RING 240 +#define EFFECT_TRICK_ROOM 241 +#define EFFECT_WONDER_ROOM 242 +#define EFFECT_MAGIC_ROOM 243 +#define EFFECT_MAGNET_RISE 244 +#define EFFECT_TOXIC_SPIKES 245 +#define EFFECT_GASTRO_ACID 246 +#define EFFECT_STEALTH_ROCK 247 +#define EFFECT_TELEKINESIS 248 +#define EFFECT_POWER_SWAP 249 +#define EFFECT_GUARD_SWAP 250 +#define EFFECT_HEART_SWAP 251 +#define EFFECT_POWER_SPLIT 252 +#define EFFECT_GUARD_SPLIT 253 +#define EFFECT_STICKY_WEB 254 +#define EFFECT_METAL_BURST 255 +#define EFFECT_LUCKY_CHANT 256 +#define EFFECT_SUCKER_PUNCH 257 +#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 258 +#define EFFECT_SIMPLE_BEAM 259 +#define EFFECT_ENTRAINMENT 260 +#define EFFECT_HEAL_PULSE 261 +#define EFFECT_QUASH 262 +#define EFFECT_ION_DELUGE 263 +#define EFFECT_FREEZE_DRY 264 +#define EFFECT_TOPSY_TURVY 265 +#define EFFECT_MISTY_TERRAIN 266 +#define EFFECT_GRASSY_TERRAIN 267 +#define EFFECT_ELECTRIC_TERRAIN 268 +#define EFFECT_PSYCHIC_TERRAIN 269 +#define EFFECT_ATTACK_ACCURACY_UP 270 +#define EFFECT_ATTACK_SPATK_UP 271 +#define EFFECT_HURRICANE 272 +#define EFFECT_TWO_TYPED_MOVE 273 +#define EFFECT_ME_FIRST 274 +#define EFFECT_SPEED_UP_HIT 275 +#define EFFECT_QUIVER_DANCE 276 +#define EFFECT_COIL 277 +#define EFFECT_ELECTRIFY 278 +#define EFFECT_SCALD 279 +#define EFFECT_REFLECT_TYPE 280 +#define EFFECT_SOAK 281 +#define EFFECT_GROWTH 282 +#define EFFECT_CLOSE_COMBAT 283 +#define EFFECT_LAST_RESORT 284 +#define EFFECT_RECOIL_33_STATUS 285 +#define EFFECT_FLINCH_STATUS 286 +#define EFFECT_RECOIL_50 287 +#define EFFECT_SHELL_SMASH 288 +#define EFFECT_SHIFT_GEAR 289 +#define EFFECT_DEFENSE_UP_3 290 +#define EFFECT_NOBLE_ROAR 291 +#define EFFECT_VENOM_DRENCH 292 +#define EFFECT_TOXIC_THREAD 293 +#define EFFECT_CLEAR_SMOG 294 +#define EFFECT_HIT_SWITCH_TARGET 295 +#define EFFECT_FINAL_GAMBIT 296 +#define EFFECT_CHANGE_TYPE_ON_ITEM 297 +#define EFFECT_AUTOTOMIZE 298 +#define EFFECT_COPYCAT 299 +#define EFFECT_DEFOG 300 +#define EFFECT_HIT_ENEMY_HEAL_ALLY 301 +#define EFFECT_SMACK_DOWN 302 +#define EFFECT_SYNCHRONOISE 303 +#define EFFECT_PSYCHO_SHIFT 304 +#define EFFECT_POWER_TRICK 305 +#define EFFECT_FLAME_BURST 306 +#define EFFECT_AFTER_YOU 307 +#define EFFECT_BESTOW 308 +#define EFFECT_ROTOTILLER 309 +#define EFFECT_FLOWER_SHIELD 310 +#define EFFECT_HIT_PREVENT_ESCAPE 311 +#define EFFECT_SPEED_SWAP 312 +#define EFFECT_DEFENSE_UP2_HIT 313 +#define EFFECT_REVELATION_DANCE 314 +#define EFFECT_AURORA_VEIL 315 +#define EFFECT_THIRD_TYPE 316 +#define EFFECT_FEINT 317 +#define EFFECT_SPARKLING_ARIA 318 +#define EFFECT_ACUPRESSURE 319 +#define EFFECT_AROMATIC_MIST 320 +#define EFFECT_POWDER 321 +#define EFFECT_SP_ATTACK_UP_HIT 322 +#define EFFECT_BELCH 323 +#define EFFECT_PARTING_SHOT 324 +#define EFFECT_SPECTRAL_THIEF 325 +#define EFFECT_V_CREATE 326 +#define EFFECT_MAT_BLOCK 327 +#define EFFECT_STOMPING_TANTRUM 328 +#define EFFECT_CORE_ENFORCER 329 +#define EFFECT_INSTRUCT 330 +#define EFFECT_THROAT_CHOP 331 +#define EFFECT_LASER_FOCUS 332 +#define EFFECT_MAGNETIC_FLUX 333 +#define EFFECT_GEAR_UP 334 +#define EFFECT_INCINERATE 335 +#define EFFECT_BUG_BITE 336 +#define EFFECT_STRENGTH_SAP 337 +#define EFFECT_MIND_BLOWN 338 +#define EFFECT_PURIFY 339 +#define EFFECT_BURN_UP 340 +#define EFFECT_SHORE_UP 341 +#define EFFECT_GEOMANCY 342 +#define EFFECT_FAIRY_LOCK 343 +#define EFFECT_ALLY_SWITCH 344 +#define EFFECT_SLEEP_HIT 345 +#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 346 +#define EFFECT_BODY_PRESS 347 +#define EFFECT_EERIE_SPELL 348 +#define EFFECT_JUNGLE_HEALING 349 +#define EFFECT_COACHING 350 +#define EFFECT_LASH_OUT 351 +#define EFFECT_GRASSY_GLIDE 352 +#define EFFECT_REMOVE_TERRAIN 353 +#define EFFECT_DYNAMAX_DOUBLE_DMG 354 +#define EFFECT_DECORATE 355 +#define EFFECT_SNIPE_SHOT 356 +#define EFFECT_RECOIL_HP_25 357 +#define EFFECT_STUFF_CHEEKS 358 +#define EFFECT_GRAV_APPLE 359 +#define EFFECT_EVASION_UP_HIT 360 +#define EFFECT_GLITZY_GLOW 361 +#define EFFECT_BADDY_BAD 362 +#define EFFECT_SAPPY_SEED 363 +#define EFFECT_FREEZY_FROST 364 +#define EFFECT_SPARKLY_SWIRL 365 +#define EFFECT_PLASMA_FISTS 366 +#define EFFECT_HYPERSPACE_FURY 367 -#define NUM_BATTLE_MOVE_EFFECTS 369 +#define NUM_BATTLE_MOVE_EFFECTS 368 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H From 735ee60f85dca77a845bf50fddc521885aa2a2c0 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 2 Nov 2021 16:17:57 +1300 Subject: [PATCH 09/58] Restore missing break --- src/battle_util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/battle_util.c b/src/battle_util.c index e624ca166..efb63b301 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7874,6 +7874,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) #if B_BEAT_UP_DMG >= GEN_5 basePower = CalcBeatUpPower(); #endif + break; } // move-specific base power changes From be518608e8749526643aefc4f96dc8f8206a8688 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 7 Nov 2021 12:16:06 +1300 Subject: [PATCH 10/58] Update move effect defines Removing move effects above the ones that have stat change animations causes the wrong stat change to be shown, so I've reordered the list to fix that. --- include/constants/battle.h | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/include/constants/battle.h b/include/constants/battle.h index 0a2cfc49c..144cd3a13 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -300,7 +300,7 @@ #define MOVE_EFFECT_PAYDAY 0xB #define MOVE_EFFECT_CHARGING 0xC #define MOVE_EFFECT_WRAP 0xD -#define MOVE_EFFECT_RECOIL_25 0xE +#define MOVE_EFFECT_INCINERATE 0xE #define MOVE_EFFECT_ATK_PLUS_1 0xF #define MOVE_EFFECT_DEF_PLUS_1 0x10 #define MOVE_EFFECT_SPD_PLUS_1 0x11 @@ -324,7 +324,7 @@ #define MOVE_EFFECT_RAPIDSPIN 0x23 #define MOVE_EFFECT_REMOVE_STATUS 0x24 #define MOVE_EFFECT_ATK_DEF_DOWN 0x25 -#define MOVE_EFFECT_RECOIL_33 0x26 +#define MOVE_EFFECT_RECOIL_HP_25 0x26 #define MOVE_EFFECT_ATK_PLUS_2 0x27 #define MOVE_EFFECT_DEF_PLUS_2 0x28 #define MOVE_EFFECT_SPD_PLUS_2 0x29 @@ -342,9 +342,9 @@ #define MOVE_EFFECT_THRASH 0x35 #define MOVE_EFFECT_KNOCK_OFF 0x36 #define MOVE_EFFECT_DEF_SPDEF_DOWN 0x37 -#define MOVE_EFFECT_RECOIL_33_STATUS 0x38 -#define MOVE_EFFECT_RECOIL_50 0x39 -#define MOVE_EFFECT_CLEAR_SMOG 0x3A +#define MOVE_EFFECT_BURN_UP 0x38 +#define MOVE_EFFECT_CLEAR_SMOG 0x39 +#define MOVE_EFFECT_BUG_BITE 0x3A #define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x3B #define MOVE_EFFECT_SMACK_DOWN 0x3C #define MOVE_EFFECT_FLAME_BURST 0x3D @@ -354,12 +354,8 @@ #define MOVE_EFFECT_HAPPY_HOUR 0x41 #define MOVE_EFFECT_CORE_ENFORCER 0x42 #define MOVE_EFFECT_THROAT_CHOP 0x43 -#define MOVE_EFFECT_INCINERATE 0x44 -#define MOVE_EFFECT_BUG_BITE 0x45 -#define MOVE_EFFECT_RECOIL_HP_25 0x46 -#define MOVE_EFFECT_RELIC_SONG 0x47 -#define MOVE_EFFECT_BURN_UP 0x48 -#define NUM_MOVE_EFFECTS 0x48 + +#define NUM_MOVE_EFFECTS 0x44 #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 From c69e7666e7a4b9ce610ffa140bddae56ddb8be3a Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 7 Nov 2021 12:22:55 +1300 Subject: [PATCH 11/58] Update battle_move_effects.h --- include/constants/battle_move_effects.h | 753 ++++++++++++------------ 1 file changed, 380 insertions(+), 373 deletions(-) diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 1892d9da9..ac307a09a 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -1,377 +1,384 @@ #ifndef GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H #define GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H -#define EFFECT_HIT 0 -#define EFFECT_SLEEP 1 -#define EFFECT_POISON_HIT 2 -#define EFFECT_ABSORB 3 -#define EFFECT_BURN_HIT 4 -#define EFFECT_FREEZE_HIT 5 -#define EFFECT_PARALYZE_HIT 6 -#define EFFECT_EXPLOSION 7 -#define EFFECT_DREAM_EATER 8 -#define EFFECT_MIRROR_MOVE 9 -#define EFFECT_ATTACK_UP 10 -#define EFFECT_DEFENSE_UP 11 -#define EFFECT_SPEED_UP 12 -#define EFFECT_SPECIAL_ATTACK_UP 13 -#define EFFECT_SPECIAL_DEFENSE_UP 14 -#define EFFECT_ACCURACY_UP 15 -#define EFFECT_EVASION_UP 16 -#define EFFECT_SPECIAL_ATTACK_UP_3 17 -#define EFFECT_ATTACK_DOWN 18 -#define EFFECT_DEFENSE_DOWN 19 -#define EFFECT_SPEED_DOWN 20 -#define EFFECT_SPECIAL_ATTACK_DOWN 21 -#define EFFECT_SPECIAL_DEFENSE_DOWN 22 -#define EFFECT_ACCURACY_DOWN 23 -#define EFFECT_EVASION_DOWN 24 -#define EFFECT_HAZE 25 -#define EFFECT_BIDE 26 -#define EFFECT_RAMPAGE 27 -#define EFFECT_ROAR 28 -#define EFFECT_MULTI_HIT 29 -#define EFFECT_CONVERSION 30 -#define EFFECT_FLINCH_HIT 31 -#define EFFECT_RESTORE_HP 32 -#define EFFECT_TOXIC 33 -#define EFFECT_PAY_DAY 34 -#define EFFECT_LIGHT_SCREEN 35 -#define EFFECT_TRI_ATTACK 36 -#define EFFECT_REST 37 -#define EFFECT_OHKO 38 -#define EFFECT_FUSION_COMBO 39 -#define EFFECT_SUPER_FANG 40 -#define EFFECT_DRAGON_RAGE 41 -#define EFFECT_TRAP 42 -#define EFFECT_HEAL_BLOCK 43 -#define EFFECT_RECOIL_IF_MISS 44 -#define EFFECT_MIST 45 -#define EFFECT_FOCUS_ENERGY 46 -#define EFFECT_RECOIL_25 47 -#define EFFECT_CONFUSE 48 -#define EFFECT_ATTACK_UP_2 49 -#define EFFECT_DEFENSE_UP_2 50 -#define EFFECT_SPEED_UP_2 51 -#define EFFECT_SPECIAL_ATTACK_UP_2 52 -#define EFFECT_SPECIAL_DEFENSE_UP_2 53 -#define EFFECT_ACCURACY_UP_2 54 -#define EFFECT_EVASION_UP_2 55 -#define EFFECT_TRANSFORM 56 -#define EFFECT_ATTACK_DOWN_2 57 -#define EFFECT_DEFENSE_DOWN_2 58 -#define EFFECT_SPEED_DOWN_2 59 -#define EFFECT_SPECIAL_ATTACK_DOWN_2 60 -#define EFFECT_SPECIAL_DEFENSE_DOWN_2 61 -#define EFFECT_ACCURACY_DOWN_2 62 -#define EFFECT_EVASION_DOWN_2 63 -#define EFFECT_REFLECT 64 -#define EFFECT_POISON 65 -#define EFFECT_PARALYZE 66 -#define EFFECT_ATTACK_DOWN_HIT 67 -#define EFFECT_DEFENSE_DOWN_HIT 68 -#define EFFECT_SPEED_DOWN_HIT 69 -#define EFFECT_SPECIAL_ATTACK_DOWN_HIT 70 -#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT 71 -#define EFFECT_ACCURACY_DOWN_HIT 72 -#define EFFECT_EVASION_DOWN_HIT 73 -#define EFFECT_TWO_TURNS_ATTACK 74 -#define EFFECT_CONFUSE_HIT 75 -#define EFFECT_VITAL_THROW 76 -#define EFFECT_SUBSTITUTE 77 -#define EFFECT_RECHARGE 78 -#define EFFECT_RAGE 79 -#define EFFECT_MIMIC 80 -#define EFFECT_METRONOME 81 -#define EFFECT_LEECH_SEED 82 -#define EFFECT_DO_NOTHING 83 -#define EFFECT_DISABLE 84 -#define EFFECT_LEVEL_DAMAGE 85 -#define EFFECT_PSYWAVE 86 -#define EFFECT_COUNTER 87 -#define EFFECT_ENCORE 88 -#define EFFECT_PAIN_SPLIT 89 -#define EFFECT_SNORE 90 -#define EFFECT_CONVERSION_2 91 -#define EFFECT_LOCK_ON 92 -#define EFFECT_SKETCH 93 -#define EFFECT_HAMMER_ARM 94 -#define EFFECT_SLEEP_TALK 95 -#define EFFECT_DESTINY_BOND 96 -#define EFFECT_FLAIL 97 -#define EFFECT_SPITE 98 -#define EFFECT_FALSE_SWIPE 99 -#define EFFECT_HEAL_BELL 100 -#define EFFECT_ALWAYS_CRIT 101 -#define EFFECT_TRIPLE_KICK 102 -#define EFFECT_THIEF 103 -#define EFFECT_MEAN_LOOK 104 -#define EFFECT_NIGHTMARE 105 -#define EFFECT_MINIMIZE 106 -#define EFFECT_CURSE 107 -#define EFFECT_HEALING_WISH 108 -#define EFFECT_PROTECT 109 -#define EFFECT_SPIKES 110 -#define EFFECT_FORESIGHT 111 -#define EFFECT_PERISH_SONG 112 -#define EFFECT_SANDSTORM 113 -#define EFFECT_ENDURE 114 -#define EFFECT_ROLLOUT 115 -#define EFFECT_SWAGGER 116 -#define EFFECT_FURY_CUTTER 117 -#define EFFECT_ATTRACT 118 -#define EFFECT_RETURN 119 -#define EFFECT_PRESENT 120 -#define EFFECT_FRUSTRATION 121 -#define EFFECT_SAFEGUARD 122 -#define EFFECT_UNUSED_125 123 -#define EFFECT_MAGNITUDE 124 -#define EFFECT_BATON_PASS 125 -#define EFFECT_PURSUIT 126 -#define EFFECT_RAPID_SPIN 127 -#define EFFECT_SONICBOOM 128 -#define EFFECT_CAPTIVATE 129 -#define EFFECT_MORNING_SUN 130 -#define EFFECT_SYNTHESIS 131 -#define EFFECT_MOONLIGHT 132 -#define EFFECT_HIDDEN_POWER 133 -#define EFFECT_RAIN_DANCE 134 -#define EFFECT_SUNNY_DAY 135 -#define EFFECT_DEFENSE_UP_HIT 136 -#define EFFECT_ATTACK_UP_HIT 137 -#define EFFECT_ALL_STATS_UP_HIT 138 -#define EFFECT_FELL_STINGER 139 -#define EFFECT_BELLY_DRUM 140 -#define EFFECT_PSYCH_UP 141 -#define EFFECT_MIRROR_COAT 142 -#define EFFECT_SKULL_BASH 143 -#define EFFECT_TWISTER 144 -#define EFFECT_EARTHQUAKE 145 -#define EFFECT_FUTURE_SIGHT 146 -#define EFFECT_GUST 147 -#define EFFECT_FLINCH_MINIMIZE_HIT 148 -#define EFFECT_SOLARBEAM 149 -#define EFFECT_THUNDER 150 -#define EFFECT_TELEPORT 151 -#define EFFECT_BEAT_UP 152 -#define EFFECT_SEMI_INVULNERABLE 153 -#define EFFECT_DEFENSE_CURL 154 -#define EFFECT_SOFTBOILED 155 -#define EFFECT_FAKE_OUT 156 -#define EFFECT_UPROAR 157 -#define EFFECT_STOCKPILE 158 -#define EFFECT_SPIT_UP 159 -#define EFFECT_SWALLOW 160 -#define EFFECT_WORRY_SEED 161 -#define EFFECT_HAIL 162 -#define EFFECT_TORMENT 163 -#define EFFECT_FLATTER 164 -#define EFFECT_WILL_O_WISP 165 -#define EFFECT_MEMENTO 166 -#define EFFECT_FACADE 167 -#define EFFECT_FOCUS_PUNCH 168 -#define EFFECT_SMELLINGSALT 169 -#define EFFECT_FOLLOW_ME 170 -#define EFFECT_NATURE_POWER 171 -#define EFFECT_CHARGE 172 -#define EFFECT_TAUNT 173 -#define EFFECT_HELPING_HAND 174 -#define EFFECT_TRICK 175 -#define EFFECT_ROLE_PLAY 176 -#define EFFECT_WISH 177 -#define EFFECT_ASSIST 178 -#define EFFECT_INGRAIN 179 -#define EFFECT_SUPERPOWER 180 -#define EFFECT_MAGIC_COAT 181 -#define EFFECT_RECYCLE 182 -#define EFFECT_REVENGE 183 -#define EFFECT_BRICK_BREAK 184 -#define EFFECT_YAWN 185 -#define EFFECT_KNOCK_OFF 186 -#define EFFECT_ENDEAVOR 187 -#define EFFECT_ERUPTION 188 -#define EFFECT_SKILL_SWAP 189 -#define EFFECT_IMPRISON 190 -#define EFFECT_REFRESH 191 -#define EFFECT_GRUDGE 192 -#define EFFECT_SNATCH 193 -#define EFFECT_LOW_KICK 194 -#define EFFECT_SECRET_POWER 195 -#define EFFECT_RECOIL_33 196 -#define EFFECT_TEETER_DANCE 197 -#define EFFECT_HIT_ESCAPE 198 -#define EFFECT_MUD_SPORT 199 -#define EFFECT_POISON_FANG 200 -#define EFFECT_WEATHER_BALL 201 -#define EFFECT_OVERHEAT 202 -#define EFFECT_TICKLE 203 -#define EFFECT_COSMIC_POWER 204 -#define EFFECT_SKY_UPPERCUT 205 -#define EFFECT_BULK_UP 206 -#define EFFECT_PLACEHOLDER 207 -#define EFFECT_WATER_SPORT 208 -#define EFFECT_CALM_MIND 209 -#define EFFECT_DRAGON_DANCE 210 -#define EFFECT_CAMOUFLAGE 211 - -// New move effects -#define EFFECT_PLEDGE 212 -#define EFFECT_FLING 213 -#define EFFECT_NATURAL_GIFT 214 -#define EFFECT_WAKE_UP_SLAP 215 -#define EFFECT_WRING_OUT 216 -#define EFFECT_HEX 217 -#define EFFECT_ASSURANCE 218 -#define EFFECT_TRUMP_CARD 219 -#define EFFECT_ACROBATICS 220 -#define EFFECT_HEAT_CRASH 221 -#define EFFECT_PUNISHMENT 222 -#define EFFECT_STORED_POWER 223 -#define EFFECT_ELECTRO_BALL 224 -#define EFFECT_GYRO_BALL 225 -#define EFFECT_ECHOED_VOICE 226 -#define EFFECT_PAYBACK 227 -#define EFFECT_ROUND 228 -#define EFFECT_BRINE 229 -#define EFFECT_VENOSHOCK 230 -#define EFFECT_RETALIATE 231 -#define EFFECT_BULLDOZE 232 -#define EFFECT_FOUL_PLAY 233 -#define EFFECT_PSYSHOCK 234 -#define EFFECT_ROOST 235 -#define EFFECT_GRAVITY 236 -#define EFFECT_MIRACLE_EYE 237 -#define EFFECT_TAILWIND 238 -#define EFFECT_EMBARGO 239 -#define EFFECT_AQUA_RING 240 -#define EFFECT_TRICK_ROOM 241 -#define EFFECT_WONDER_ROOM 242 -#define EFFECT_MAGIC_ROOM 243 -#define EFFECT_MAGNET_RISE 244 -#define EFFECT_TOXIC_SPIKES 245 -#define EFFECT_GASTRO_ACID 246 -#define EFFECT_STEALTH_ROCK 247 -#define EFFECT_TELEKINESIS 248 -#define EFFECT_POWER_SWAP 249 -#define EFFECT_GUARD_SWAP 250 -#define EFFECT_HEART_SWAP 251 -#define EFFECT_POWER_SPLIT 252 -#define EFFECT_GUARD_SPLIT 253 -#define EFFECT_STICKY_WEB 254 -#define EFFECT_METAL_BURST 255 -#define EFFECT_LUCKY_CHANT 256 -#define EFFECT_SUCKER_PUNCH 257 -#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 258 -#define EFFECT_SIMPLE_BEAM 259 -#define EFFECT_ENTRAINMENT 260 -#define EFFECT_HEAL_PULSE 261 -#define EFFECT_QUASH 262 -#define EFFECT_ION_DELUGE 263 -#define EFFECT_FREEZE_DRY 264 -#define EFFECT_TOPSY_TURVY 265 -#define EFFECT_MISTY_TERRAIN 266 -#define EFFECT_GRASSY_TERRAIN 267 -#define EFFECT_ELECTRIC_TERRAIN 268 -#define EFFECT_PSYCHIC_TERRAIN 269 -#define EFFECT_ATTACK_ACCURACY_UP 270 -#define EFFECT_ATTACK_SPATK_UP 271 -#define EFFECT_HURRICANE 272 -#define EFFECT_TWO_TYPED_MOVE 273 -#define EFFECT_ME_FIRST 274 -#define EFFECT_SPEED_UP_HIT 275 -#define EFFECT_QUIVER_DANCE 276 -#define EFFECT_COIL 277 -#define EFFECT_ELECTRIFY 278 -#define EFFECT_SCALD 279 -#define EFFECT_REFLECT_TYPE 280 -#define EFFECT_SOAK 281 -#define EFFECT_GROWTH 282 -#define EFFECT_CLOSE_COMBAT 283 -#define EFFECT_LAST_RESORT 284 -#define EFFECT_RECOIL_33_STATUS 285 -#define EFFECT_FLINCH_STATUS 286 -#define EFFECT_RECOIL_50 287 -#define EFFECT_SHELL_SMASH 288 -#define EFFECT_SHIFT_GEAR 289 -#define EFFECT_DEFENSE_UP_3 290 -#define EFFECT_NOBLE_ROAR 291 -#define EFFECT_VENOM_DRENCH 292 -#define EFFECT_TOXIC_THREAD 293 -#define EFFECT_CLEAR_SMOG 294 -#define EFFECT_HIT_SWITCH_TARGET 295 -#define EFFECT_FINAL_GAMBIT 296 -#define EFFECT_CHANGE_TYPE_ON_ITEM 297 -#define EFFECT_AUTOTOMIZE 298 -#define EFFECT_COPYCAT 299 -#define EFFECT_DEFOG 300 -#define EFFECT_HIT_ENEMY_HEAL_ALLY 301 -#define EFFECT_SMACK_DOWN 302 -#define EFFECT_SYNCHRONOISE 303 -#define EFFECT_PSYCHO_SHIFT 304 -#define EFFECT_POWER_TRICK 305 -#define EFFECT_FLAME_BURST 306 -#define EFFECT_AFTER_YOU 307 -#define EFFECT_BESTOW 308 -#define EFFECT_ROTOTILLER 309 -#define EFFECT_FLOWER_SHIELD 310 -#define EFFECT_HIT_PREVENT_ESCAPE 311 -#define EFFECT_SPEED_SWAP 312 -#define EFFECT_DEFENSE_UP2_HIT 313 -#define EFFECT_REVELATION_DANCE 314 -#define EFFECT_AURORA_VEIL 315 -#define EFFECT_THIRD_TYPE 316 -#define EFFECT_FEINT 317 -#define EFFECT_SPARKLING_ARIA 318 -#define EFFECT_ACUPRESSURE 319 -#define EFFECT_AROMATIC_MIST 320 -#define EFFECT_POWDER 321 -#define EFFECT_SP_ATTACK_UP_HIT 322 -#define EFFECT_BELCH 323 -#define EFFECT_PARTING_SHOT 324 -#define EFFECT_SPECTRAL_THIEF 325 -#define EFFECT_V_CREATE 326 -#define EFFECT_MAT_BLOCK 327 -#define EFFECT_STOMPING_TANTRUM 328 -#define EFFECT_CORE_ENFORCER 329 -#define EFFECT_INSTRUCT 330 -#define EFFECT_THROAT_CHOP 331 -#define EFFECT_LASER_FOCUS 332 -#define EFFECT_MAGNETIC_FLUX 333 -#define EFFECT_GEAR_UP 334 -#define EFFECT_INCINERATE 335 -#define EFFECT_BUG_BITE 336 -#define EFFECT_STRENGTH_SAP 337 -#define EFFECT_MIND_BLOWN 338 -#define EFFECT_PURIFY 339 -#define EFFECT_BURN_UP 340 -#define EFFECT_SHORE_UP 341 -#define EFFECT_GEOMANCY 342 -#define EFFECT_FAIRY_LOCK 343 -#define EFFECT_ALLY_SWITCH 344 -#define EFFECT_SLEEP_HIT 345 -#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 346 -#define EFFECT_BODY_PRESS 347 -#define EFFECT_EERIE_SPELL 348 -#define EFFECT_JUNGLE_HEALING 349 -#define EFFECT_COACHING 350 -#define EFFECT_LASH_OUT 351 -#define EFFECT_GRASSY_GLIDE 352 -#define EFFECT_REMOVE_TERRAIN 353 -#define EFFECT_DYNAMAX_DOUBLE_DMG 354 -#define EFFECT_DECORATE 355 -#define EFFECT_SNIPE_SHOT 356 -#define EFFECT_RECOIL_HP_25 357 -#define EFFECT_STUFF_CHEEKS 358 -#define EFFECT_GRAV_APPLE 359 -#define EFFECT_EVASION_UP_HIT 360 -#define EFFECT_GLITZY_GLOW 361 -#define EFFECT_BADDY_BAD 362 -#define EFFECT_SAPPY_SEED 363 -#define EFFECT_FREEZY_FROST 364 -#define EFFECT_SPARKLY_SWIRL 365 -#define EFFECT_PLASMA_FISTS 366 -#define EFFECT_HYPERSPACE_FURY 367 - -#define NUM_BATTLE_MOVE_EFFECTS 368 +#define EFFECT_HIT 0 +#define EFFECT_SLEEP 1 +#define EFFECT_POISON_HIT 2 +#define EFFECT_ABSORB 3 +#define EFFECT_BURN_HIT 4 +#define EFFECT_FREEZE_HIT 5 +#define EFFECT_PARALYZE_HIT 6 +#define EFFECT_EXPLOSION 7 +#define EFFECT_DREAM_EATER 8 +#define EFFECT_MIRROR_MOVE 9 +#define EFFECT_ATTACK_UP 10 +#define EFFECT_DEFENSE_UP 11 +#define EFFECT_SPEED_UP 12 +#define EFFECT_SPECIAL_ATTACK_UP 13 +#define EFFECT_SPECIAL_DEFENSE_UP 14 +#define EFFECT_ACCURACY_UP 15 +#define EFFECT_EVASION_UP 16 +#define EFFECT_SPECIAL_ATTACK_UP_3 17 +#define EFFECT_ATTACK_DOWN 18 +#define EFFECT_DEFENSE_DOWN 19 +#define EFFECT_SPEED_DOWN 20 +#define EFFECT_SPECIAL_ATTACK_DOWN 21 +#define EFFECT_SPECIAL_DEFENSE_DOWN 22 +#define EFFECT_ACCURACY_DOWN 23 +#define EFFECT_EVASION_DOWN 24 +#define EFFECT_HAZE 25 +#define EFFECT_BIDE 26 +#define EFFECT_RAMPAGE 27 +#define EFFECT_ROAR 28 +#define EFFECT_MULTI_HIT 29 +#define EFFECT_CONVERSION 30 +#define EFFECT_FLINCH_HIT 31 +#define EFFECT_RESTORE_HP 32 +#define EFFECT_TOXIC 33 +#define EFFECT_PAY_DAY 34 +#define EFFECT_LIGHT_SCREEN 35 +#define EFFECT_TRI_ATTACK 36 +#define EFFECT_REST 37 +#define EFFECT_OHKO 38 +#define EFFECT_FUSION_COMBO 39 +#define EFFECT_SUPER_FANG 40 +#define EFFECT_DRAGON_RAGE 41 +#define EFFECT_TRAP 42 +#define EFFECT_HEAL_BLOCK 43 +#define EFFECT_DOUBLE_HIT 44 +#define EFFECT_RECOIL_IF_MISS 45 +#define EFFECT_MIST 46 +#define EFFECT_FOCUS_ENERGY 47 +#define EFFECT_RECOIL_25 48 +#define EFFECT_CONFUSE 49 +#define EFFECT_ATTACK_UP_2 50 +#define EFFECT_DEFENSE_UP_2 51 +#define EFFECT_SPEED_UP_2 52 +#define EFFECT_SPECIAL_ATTACK_UP_2 53 +#define EFFECT_SPECIAL_DEFENSE_UP_2 54 +#define EFFECT_ACCURACY_UP_2 55 +#define EFFECT_EVASION_UP_2 56 +#define EFFECT_TRANSFORM 57 +#define EFFECT_ATTACK_DOWN_2 58 +#define EFFECT_DEFENSE_DOWN_2 59 +#define EFFECT_SPEED_DOWN_2 60 +#define EFFECT_SPECIAL_ATTACK_DOWN_2 61 +#define EFFECT_SPECIAL_DEFENSE_DOWN_2 62 +#define EFFECT_ACCURACY_DOWN_2 63 +#define EFFECT_EVASION_DOWN_2 64 +#define EFFECT_REFLECT 65 +#define EFFECT_POISON 66 +#define EFFECT_PARALYZE 67 +#define EFFECT_ATTACK_DOWN_HIT 68 +#define EFFECT_DEFENSE_DOWN_HIT 69 +#define EFFECT_SPEED_DOWN_HIT 70 +#define EFFECT_SPECIAL_ATTACK_DOWN_HIT 71 +#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT 72 +#define EFFECT_ACCURACY_DOWN_HIT 73 +#define EFFECT_EVASION_DOWN_HIT 74 +#define EFFECT_TWO_TURNS_ATTACK 75 +#define EFFECT_CONFUSE_HIT 76 +#define EFFECT_TWINEEDLE 77 +#define EFFECT_VITAL_THROW 78 +#define EFFECT_SUBSTITUTE 79 +#define EFFECT_RECHARGE 80 +#define EFFECT_RAGE 81 +#define EFFECT_MIMIC 82 +#define EFFECT_METRONOME 83 +#define EFFECT_LEECH_SEED 84 +#define EFFECT_DO_NOTHING 85 +#define EFFECT_DISABLE 86 +#define EFFECT_LEVEL_DAMAGE 87 +#define EFFECT_PSYWAVE 88 +#define EFFECT_COUNTER 89 +#define EFFECT_ENCORE 90 +#define EFFECT_PAIN_SPLIT 91 +#define EFFECT_SNORE 92 +#define EFFECT_CONVERSION_2 93 +#define EFFECT_LOCK_ON 94 +#define EFFECT_SKETCH 95 +#define EFFECT_HAMMER_ARM 96 +#define EFFECT_SLEEP_TALK 97 +#define EFFECT_DESTINY_BOND 98 +#define EFFECT_FLAIL 99 +#define EFFECT_SPITE 100 +#define EFFECT_FALSE_SWIPE 101 +#define EFFECT_HEAL_BELL 102 +#define EFFECT_ALWAYS_CRIT 103 +#define EFFECT_TRIPLE_KICK 104 +#define EFFECT_THIEF 105 +#define EFFECT_MEAN_LOOK 106 +#define EFFECT_NIGHTMARE 107 +#define EFFECT_MINIMIZE 108 +#define EFFECT_CURSE 109 +#define EFFECT_HEALING_WISH 110 +#define EFFECT_PROTECT 111 +#define EFFECT_SPIKES 112 +#define EFFECT_FORESIGHT 113 +#define EFFECT_PERISH_SONG 114 +#define EFFECT_SANDSTORM 115 +#define EFFECT_ENDURE 116 +#define EFFECT_ROLLOUT 117 +#define EFFECT_SWAGGER 118 +#define EFFECT_FURY_CUTTER 119 +#define EFFECT_ATTRACT 120 +#define EFFECT_RETURN 121 +#define EFFECT_PRESENT 122 +#define EFFECT_FRUSTRATION 123 +#define EFFECT_SAFEGUARD 124 +#define EFFECT_UNUSED_125 125 +#define EFFECT_MAGNITUDE 126 +#define EFFECT_BATON_PASS 127 +#define EFFECT_PURSUIT 128 +#define EFFECT_RAPID_SPIN 129 +#define EFFECT_SONICBOOM 130 +#define EFFECT_CAPTIVATE 131 +#define EFFECT_MORNING_SUN 132 +#define EFFECT_SYNTHESIS 133 +#define EFFECT_MOONLIGHT 134 +#define EFFECT_HIDDEN_POWER 135 +#define EFFECT_RAIN_DANCE 136 +#define EFFECT_SUNNY_DAY 137 +#define EFFECT_DEFENSE_UP_HIT 138 +#define EFFECT_ATTACK_UP_HIT 139 +#define EFFECT_ALL_STATS_UP_HIT 140 +#define EFFECT_FELL_STINGER 141 +#define EFFECT_BELLY_DRUM 142 +#define EFFECT_PSYCH_UP 143 +#define EFFECT_MIRROR_COAT 144 +#define EFFECT_SKULL_BASH 145 +#define EFFECT_TWISTER 146 +#define EFFECT_EARTHQUAKE 147 +#define EFFECT_FUTURE_SIGHT 148 +#define EFFECT_GUST 149 +#define EFFECT_FLINCH_MINIMIZE_HIT 150 +#define EFFECT_SOLARBEAM 151 +#define EFFECT_THUNDER 152 +#define EFFECT_TELEPORT 153 +#define EFFECT_BEAT_UP 154 +#define EFFECT_SEMI_INVULNERABLE 155 +#define EFFECT_DEFENSE_CURL 156 +#define EFFECT_SOFTBOILED 157 +#define EFFECT_FAKE_OUT 158 +#define EFFECT_UPROAR 159 +#define EFFECT_STOCKPILE 160 +#define EFFECT_SPIT_UP 161 +#define EFFECT_SWALLOW 162 +#define EFFECT_WORRY_SEED 163 +#define EFFECT_HAIL 164 +#define EFFECT_TORMENT 165 +#define EFFECT_FLATTER 166 +#define EFFECT_WILL_O_WISP 167 +#define EFFECT_MEMENTO 168 +#define EFFECT_FACADE 169 +#define EFFECT_FOCUS_PUNCH 170 +#define EFFECT_SMELLINGSALT 171 +#define EFFECT_FOLLOW_ME 172 +#define EFFECT_NATURE_POWER 173 +#define EFFECT_CHARGE 174 +#define EFFECT_TAUNT 175 +#define EFFECT_HELPING_HAND 176 +#define EFFECT_TRICK 177 +#define EFFECT_ROLE_PLAY 178 +#define EFFECT_WISH 179 +#define EFFECT_ASSIST 180 +#define EFFECT_INGRAIN 181 +#define EFFECT_SUPERPOWER 182 +#define EFFECT_MAGIC_COAT 183 +#define EFFECT_RECYCLE 184 +#define EFFECT_REVENGE 185 +#define EFFECT_BRICK_BREAK 186 +#define EFFECT_YAWN 187 +#define EFFECT_KNOCK_OFF 188 +#define EFFECT_ENDEAVOR 189 +#define EFFECT_ERUPTION 190 +#define EFFECT_SKILL_SWAP 191 +#define EFFECT_IMPRISON 192 +#define EFFECT_REFRESH 193 +#define EFFECT_GRUDGE 194 +#define EFFECT_SNATCH 195 +#define EFFECT_LOW_KICK 196 +#define EFFECT_SECRET_POWER 197 +#define EFFECT_RECOIL_33 198 +#define EFFECT_TEETER_DANCE 199 +#define EFFECT_HIT_ESCAPE 200 +#define EFFECT_MUD_SPORT 201 +#define EFFECT_POISON_FANG 202 +#define EFFECT_WEATHER_BALL 203 +#define EFFECT_OVERHEAT 204 +#define EFFECT_TICKLE 205 +#define EFFECT_COSMIC_POWER 206 +#define EFFECT_SKY_UPPERCUT 207 +#define EFFECT_BULK_UP 208 +#define EFFECT_PLACEHOLDER 209 +#define EFFECT_WATER_SPORT 210 +#define EFFECT_CALM_MIND 211 +#define EFFECT_DRAGON_DANCE 212 +#define EFFECT_CAMOUFLAGE 213 -#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H +// New move effects +#define EFFECT_PLEDGE 214 +#define EFFECT_FLING 215 +#define EFFECT_NATURAL_GIFT 216 +#define EFFECT_WAKE_UP_SLAP 217 +#define EFFECT_WRING_OUT 218 +#define EFFECT_HEX 219 +#define EFFECT_ASSURANCE 220 +#define EFFECT_TRUMP_CARD 221 +#define EFFECT_ACROBATICS 222 +#define EFFECT_HEAT_CRASH 223 +#define EFFECT_PUNISHMENT 224 +#define EFFECT_STORED_POWER 225 +#define EFFECT_ELECTRO_BALL 226 +#define EFFECT_GYRO_BALL 227 +#define EFFECT_ECHOED_VOICE 228 +#define EFFECT_PAYBACK 229 +#define EFFECT_ROUND 230 +#define EFFECT_BRINE 231 +#define EFFECT_VENOSHOCK 232 +#define EFFECT_RETALIATE 233 +#define EFFECT_BULLDOZE 234 +#define EFFECT_FOUL_PLAY 235 +#define EFFECT_PSYSHOCK 236 +#define EFFECT_ROOST 237 +#define EFFECT_GRAVITY 238 +#define EFFECT_MIRACLE_EYE 239 +#define EFFECT_TAILWIND 240 +#define EFFECT_EMBARGO 241 +#define EFFECT_AQUA_RING 242 +#define EFFECT_TRICK_ROOM 243 +#define EFFECT_WONDER_ROOM 244 +#define EFFECT_MAGIC_ROOM 245 +#define EFFECT_MAGNET_RISE 246 +#define EFFECT_TOXIC_SPIKES 247 +#define EFFECT_GASTRO_ACID 248 +#define EFFECT_STEALTH_ROCK 249 +#define EFFECT_TELEKINESIS 250 +#define EFFECT_POWER_SWAP 251 +#define EFFECT_GUARD_SWAP 252 +#define EFFECT_HEART_SWAP 253 +#define EFFECT_POWER_SPLIT 254 +#define EFFECT_GUARD_SPLIT 255 +#define EFFECT_STICKY_WEB 256 +#define EFFECT_METAL_BURST 257 +#define EFFECT_LUCKY_CHANT 258 +#define EFFECT_SUCKER_PUNCH 259 +#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 260 +#define EFFECT_SIMPLE_BEAM 261 +#define EFFECT_ENTRAINMENT 262 +#define EFFECT_HEAL_PULSE 263 +#define EFFECT_QUASH 264 +#define EFFECT_ION_DELUGE 265 +#define EFFECT_FREEZE_DRY 266 +#define EFFECT_TOPSY_TURVY 267 +#define EFFECT_MISTY_TERRAIN 268 +#define EFFECT_GRASSY_TERRAIN 269 +#define EFFECT_ELECTRIC_TERRAIN 270 +#define EFFECT_PSYCHIC_TERRAIN 271 +#define EFFECT_ATTACK_ACCURACY_UP 272 +#define EFFECT_ATTACK_SPATK_UP 273 +#define EFFECT_HURRICANE 274 +#define EFFECT_TWO_TYPED_MOVE 275 +#define EFFECT_ME_FIRST 276 +#define EFFECT_SPEED_UP_HIT 277 +#define EFFECT_QUIVER_DANCE 278 +#define EFFECT_COIL 279 +#define EFFECT_ELECTRIFY 280 +#define EFFECT_SCALD 281 +#define EFFECT_REFLECT_TYPE 282 +#define EFFECT_SOAK 283 +#define EFFECT_GROWTH 284 +#define EFFECT_CLOSE_COMBAT 285 +#define EFFECT_LAST_RESORT 286 +#define EFFECT_RECOIL_33_STATUS 287 +#define EFFECT_FLINCH_STATUS 288 +#define EFFECT_RECOIL_50 289 +#define EFFECT_SHELL_SMASH 290 +#define EFFECT_SHIFT_GEAR 291 +#define EFFECT_DEFENSE_UP_3 292 +#define EFFECT_NOBLE_ROAR 293 +#define EFFECT_VENOM_DRENCH 294 +#define EFFECT_TOXIC_THREAD 295 +#define EFFECT_CLEAR_SMOG 296 +#define EFFECT_HIT_SWITCH_TARGET 297 +#define EFFECT_FINAL_GAMBIT 298 +#define EFFECT_CHANGE_TYPE_ON_ITEM 299 +#define EFFECT_AUTOTOMIZE 300 +#define EFFECT_COPYCAT 301 +#define EFFECT_DEFOG 302 +#define EFFECT_HIT_ENEMY_HEAL_ALLY 303 +#define EFFECT_SMACK_DOWN 304 +#define EFFECT_SYNCHRONOISE 305 +#define EFFECT_PSYCHO_SHIFT 306 +#define EFFECT_POWER_TRICK 307 +#define EFFECT_FLAME_BURST 308 +#define EFFECT_AFTER_YOU 309 +#define EFFECT_BESTOW 310 +#define EFFECT_ROTOTILLER 311 +#define EFFECT_FLOWER_SHIELD 312 +#define EFFECT_HIT_PREVENT_ESCAPE 313 +#define EFFECT_SPEED_SWAP 314 +#define EFFECT_DEFENSE_UP2_HIT 315 +#define EFFECT_REVELATION_DANCE 316 +#define EFFECT_AURORA_VEIL 317 +#define EFFECT_THIRD_TYPE 318 +#define EFFECT_FEINT 319 +#define EFFECT_SPARKLING_ARIA 320 +#define EFFECT_ACUPRESSURE 321 +#define EFFECT_AROMATIC_MIST 322 +#define EFFECT_POWDER 323 +#define EFFECT_SP_ATTACK_UP_HIT 324 +#define EFFECT_BELCH 325 +#define EFFECT_PARTING_SHOT 326 +#define EFFECT_SPECTRAL_THIEF 327 +#define EFFECT_V_CREATE 328 +#define EFFECT_MAT_BLOCK 329 +#define EFFECT_STOMPING_TANTRUM 330 +#define EFFECT_CORE_ENFORCER 331 +#define EFFECT_INSTRUCT 332 +#define EFFECT_THROAT_CHOP 333 +#define EFFECT_LASER_FOCUS 334 +#define EFFECT_MAGNETIC_FLUX 335 +#define EFFECT_GEAR_UP 336 +#define EFFECT_INCINERATE 337 +#define EFFECT_BUG_BITE 338 +#define EFFECT_STRENGTH_SAP 339 +#define EFFECT_MIND_BLOWN 340 +#define EFFECT_PURIFY 341 +#define EFFECT_BURN_UP 342 +#define EFFECT_SHORE_UP 343 +#define EFFECT_GEOMANCY 344 +#define EFFECT_FAIRY_LOCK 345 +#define EFFECT_ALLY_SWITCH 346 +#define EFFECT_RELIC_SONG 347 +#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 348 +#define EFFECT_BODY_PRESS 349 +#define EFFECT_EERIE_SPELL 350 +#define EFFECT_JUNGLE_HEALING 351 +#define EFFECT_COACHING 352 +#define EFFECT_LASH_OUT 353 +#define EFFECT_GRASSY_GLIDE 354 +#define EFFECT_REMOVE_TERRAIN 355 +#define EFFECT_DYNAMAX_DOUBLE_DMG 356 +#define EFFECT_DECORATE 357 +#define EFFECT_SNIPE_SHOT 358 +#define EFFECT_TRIPLE_HIT 359 +#define EFFECT_RECOIL_HP_25 360 +#define EFFECT_STUFF_CHEEKS 361 +#define EFFECT_GRAV_APPLE 362 +#define EFFECT_EVASION_UP_HIT 363 +#define EFFECT_DOUBLE_IRON_BASH 364 +#define EFFECT_GLITZY_GLOW 365 +#define EFFECT_BADDY_BAD 366 +#define EFFECT_SAPPY_SEED 367 +#define EFFECT_FREEZY_FROST 368 +#define EFFECT_SPARKLY_SWIRL 369 +#define EFFECT_PLASMA_FISTS 370 +#define EFFECT_HYPERSPACE_FURY 371 +#define EFFECT_AURA_WHEEL 372 +#define EFFECT_PHOTON_GEYSER 373 +#define EFFECT_SHELL_SIDE_ARM 374 + +#define NUM_BATTLE_MOVE_EFFECTS 375 + +#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H \ No newline at end of file From 9351df5ed856b2bbd3658970fc77de03dc5925ce Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 7 Nov 2021 12:25:26 +1300 Subject: [PATCH 12/58] Revert "Update move effect defines" This reverts commit be518608e8749526643aefc4f96dc8f8206a8688. --- include/constants/battle.h | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/include/constants/battle.h b/include/constants/battle.h index 144cd3a13..0a2cfc49c 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -300,7 +300,7 @@ #define MOVE_EFFECT_PAYDAY 0xB #define MOVE_EFFECT_CHARGING 0xC #define MOVE_EFFECT_WRAP 0xD -#define MOVE_EFFECT_INCINERATE 0xE +#define MOVE_EFFECT_RECOIL_25 0xE #define MOVE_EFFECT_ATK_PLUS_1 0xF #define MOVE_EFFECT_DEF_PLUS_1 0x10 #define MOVE_EFFECT_SPD_PLUS_1 0x11 @@ -324,7 +324,7 @@ #define MOVE_EFFECT_RAPIDSPIN 0x23 #define MOVE_EFFECT_REMOVE_STATUS 0x24 #define MOVE_EFFECT_ATK_DEF_DOWN 0x25 -#define MOVE_EFFECT_RECOIL_HP_25 0x26 +#define MOVE_EFFECT_RECOIL_33 0x26 #define MOVE_EFFECT_ATK_PLUS_2 0x27 #define MOVE_EFFECT_DEF_PLUS_2 0x28 #define MOVE_EFFECT_SPD_PLUS_2 0x29 @@ -342,9 +342,9 @@ #define MOVE_EFFECT_THRASH 0x35 #define MOVE_EFFECT_KNOCK_OFF 0x36 #define MOVE_EFFECT_DEF_SPDEF_DOWN 0x37 -#define MOVE_EFFECT_BURN_UP 0x38 -#define MOVE_EFFECT_CLEAR_SMOG 0x39 -#define MOVE_EFFECT_BUG_BITE 0x3A +#define MOVE_EFFECT_RECOIL_33_STATUS 0x38 +#define MOVE_EFFECT_RECOIL_50 0x39 +#define MOVE_EFFECT_CLEAR_SMOG 0x3A #define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x3B #define MOVE_EFFECT_SMACK_DOWN 0x3C #define MOVE_EFFECT_FLAME_BURST 0x3D @@ -354,8 +354,12 @@ #define MOVE_EFFECT_HAPPY_HOUR 0x41 #define MOVE_EFFECT_CORE_ENFORCER 0x42 #define MOVE_EFFECT_THROAT_CHOP 0x43 - -#define NUM_MOVE_EFFECTS 0x44 +#define MOVE_EFFECT_INCINERATE 0x44 +#define MOVE_EFFECT_BUG_BITE 0x45 +#define MOVE_EFFECT_RECOIL_HP_25 0x46 +#define MOVE_EFFECT_RELIC_SONG 0x47 +#define MOVE_EFFECT_BURN_UP 0x48 +#define NUM_MOVE_EFFECTS 0x48 #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 From d30f2b57125b5cbca83248799079de40ffba51a2 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 7 Nov 2021 15:22:33 +1300 Subject: [PATCH 13/58] Fix move effects list Fixed it properly this time! --- include/constants/battle_move_effects.h | 752 ++++++++++++------------ 1 file changed, 374 insertions(+), 378 deletions(-) diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index ac307a09a..6397a09d7 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -1,384 +1,380 @@ #ifndef GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H #define GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H -#define EFFECT_HIT 0 -#define EFFECT_SLEEP 1 -#define EFFECT_POISON_HIT 2 -#define EFFECT_ABSORB 3 -#define EFFECT_BURN_HIT 4 -#define EFFECT_FREEZE_HIT 5 -#define EFFECT_PARALYZE_HIT 6 -#define EFFECT_EXPLOSION 7 -#define EFFECT_DREAM_EATER 8 -#define EFFECT_MIRROR_MOVE 9 -#define EFFECT_ATTACK_UP 10 -#define EFFECT_DEFENSE_UP 11 -#define EFFECT_SPEED_UP 12 -#define EFFECT_SPECIAL_ATTACK_UP 13 -#define EFFECT_SPECIAL_DEFENSE_UP 14 -#define EFFECT_ACCURACY_UP 15 -#define EFFECT_EVASION_UP 16 -#define EFFECT_SPECIAL_ATTACK_UP_3 17 -#define EFFECT_ATTACK_DOWN 18 -#define EFFECT_DEFENSE_DOWN 19 -#define EFFECT_SPEED_DOWN 20 -#define EFFECT_SPECIAL_ATTACK_DOWN 21 -#define EFFECT_SPECIAL_DEFENSE_DOWN 22 -#define EFFECT_ACCURACY_DOWN 23 -#define EFFECT_EVASION_DOWN 24 -#define EFFECT_HAZE 25 -#define EFFECT_BIDE 26 -#define EFFECT_RAMPAGE 27 -#define EFFECT_ROAR 28 -#define EFFECT_MULTI_HIT 29 -#define EFFECT_CONVERSION 30 -#define EFFECT_FLINCH_HIT 31 -#define EFFECT_RESTORE_HP 32 -#define EFFECT_TOXIC 33 -#define EFFECT_PAY_DAY 34 -#define EFFECT_LIGHT_SCREEN 35 -#define EFFECT_TRI_ATTACK 36 -#define EFFECT_REST 37 -#define EFFECT_OHKO 38 -#define EFFECT_FUSION_COMBO 39 -#define EFFECT_SUPER_FANG 40 -#define EFFECT_DRAGON_RAGE 41 -#define EFFECT_TRAP 42 -#define EFFECT_HEAL_BLOCK 43 -#define EFFECT_DOUBLE_HIT 44 -#define EFFECT_RECOIL_IF_MISS 45 -#define EFFECT_MIST 46 -#define EFFECT_FOCUS_ENERGY 47 -#define EFFECT_RECOIL_25 48 -#define EFFECT_CONFUSE 49 -#define EFFECT_ATTACK_UP_2 50 -#define EFFECT_DEFENSE_UP_2 51 -#define EFFECT_SPEED_UP_2 52 -#define EFFECT_SPECIAL_ATTACK_UP_2 53 -#define EFFECT_SPECIAL_DEFENSE_UP_2 54 -#define EFFECT_ACCURACY_UP_2 55 -#define EFFECT_EVASION_UP_2 56 -#define EFFECT_TRANSFORM 57 -#define EFFECT_ATTACK_DOWN_2 58 -#define EFFECT_DEFENSE_DOWN_2 59 -#define EFFECT_SPEED_DOWN_2 60 -#define EFFECT_SPECIAL_ATTACK_DOWN_2 61 -#define EFFECT_SPECIAL_DEFENSE_DOWN_2 62 -#define EFFECT_ACCURACY_DOWN_2 63 -#define EFFECT_EVASION_DOWN_2 64 -#define EFFECT_REFLECT 65 -#define EFFECT_POISON 66 -#define EFFECT_PARALYZE 67 -#define EFFECT_ATTACK_DOWN_HIT 68 -#define EFFECT_DEFENSE_DOWN_HIT 69 -#define EFFECT_SPEED_DOWN_HIT 70 -#define EFFECT_SPECIAL_ATTACK_DOWN_HIT 71 -#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT 72 -#define EFFECT_ACCURACY_DOWN_HIT 73 -#define EFFECT_EVASION_DOWN_HIT 74 -#define EFFECT_TWO_TURNS_ATTACK 75 -#define EFFECT_CONFUSE_HIT 76 -#define EFFECT_TWINEEDLE 77 -#define EFFECT_VITAL_THROW 78 -#define EFFECT_SUBSTITUTE 79 -#define EFFECT_RECHARGE 80 -#define EFFECT_RAGE 81 -#define EFFECT_MIMIC 82 -#define EFFECT_METRONOME 83 -#define EFFECT_LEECH_SEED 84 -#define EFFECT_DO_NOTHING 85 -#define EFFECT_DISABLE 86 -#define EFFECT_LEVEL_DAMAGE 87 -#define EFFECT_PSYWAVE 88 -#define EFFECT_COUNTER 89 -#define EFFECT_ENCORE 90 -#define EFFECT_PAIN_SPLIT 91 -#define EFFECT_SNORE 92 -#define EFFECT_CONVERSION_2 93 -#define EFFECT_LOCK_ON 94 -#define EFFECT_SKETCH 95 -#define EFFECT_HAMMER_ARM 96 -#define EFFECT_SLEEP_TALK 97 -#define EFFECT_DESTINY_BOND 98 -#define EFFECT_FLAIL 99 -#define EFFECT_SPITE 100 -#define EFFECT_FALSE_SWIPE 101 -#define EFFECT_HEAL_BELL 102 -#define EFFECT_ALWAYS_CRIT 103 -#define EFFECT_TRIPLE_KICK 104 -#define EFFECT_THIEF 105 -#define EFFECT_MEAN_LOOK 106 -#define EFFECT_NIGHTMARE 107 -#define EFFECT_MINIMIZE 108 -#define EFFECT_CURSE 109 -#define EFFECT_HEALING_WISH 110 -#define EFFECT_PROTECT 111 -#define EFFECT_SPIKES 112 -#define EFFECT_FORESIGHT 113 -#define EFFECT_PERISH_SONG 114 -#define EFFECT_SANDSTORM 115 -#define EFFECT_ENDURE 116 -#define EFFECT_ROLLOUT 117 -#define EFFECT_SWAGGER 118 -#define EFFECT_FURY_CUTTER 119 -#define EFFECT_ATTRACT 120 -#define EFFECT_RETURN 121 -#define EFFECT_PRESENT 122 -#define EFFECT_FRUSTRATION 123 -#define EFFECT_SAFEGUARD 124 -#define EFFECT_UNUSED_125 125 -#define EFFECT_MAGNITUDE 126 -#define EFFECT_BATON_PASS 127 -#define EFFECT_PURSUIT 128 -#define EFFECT_RAPID_SPIN 129 -#define EFFECT_SONICBOOM 130 -#define EFFECT_CAPTIVATE 131 -#define EFFECT_MORNING_SUN 132 -#define EFFECT_SYNTHESIS 133 -#define EFFECT_MOONLIGHT 134 -#define EFFECT_HIDDEN_POWER 135 -#define EFFECT_RAIN_DANCE 136 -#define EFFECT_SUNNY_DAY 137 -#define EFFECT_DEFENSE_UP_HIT 138 -#define EFFECT_ATTACK_UP_HIT 139 -#define EFFECT_ALL_STATS_UP_HIT 140 -#define EFFECT_FELL_STINGER 141 -#define EFFECT_BELLY_DRUM 142 -#define EFFECT_PSYCH_UP 143 -#define EFFECT_MIRROR_COAT 144 -#define EFFECT_SKULL_BASH 145 -#define EFFECT_TWISTER 146 -#define EFFECT_EARTHQUAKE 147 -#define EFFECT_FUTURE_SIGHT 148 -#define EFFECT_GUST 149 -#define EFFECT_FLINCH_MINIMIZE_HIT 150 -#define EFFECT_SOLARBEAM 151 -#define EFFECT_THUNDER 152 -#define EFFECT_TELEPORT 153 -#define EFFECT_BEAT_UP 154 -#define EFFECT_SEMI_INVULNERABLE 155 -#define EFFECT_DEFENSE_CURL 156 -#define EFFECT_SOFTBOILED 157 -#define EFFECT_FAKE_OUT 158 -#define EFFECT_UPROAR 159 -#define EFFECT_STOCKPILE 160 -#define EFFECT_SPIT_UP 161 -#define EFFECT_SWALLOW 162 -#define EFFECT_WORRY_SEED 163 -#define EFFECT_HAIL 164 -#define EFFECT_TORMENT 165 -#define EFFECT_FLATTER 166 -#define EFFECT_WILL_O_WISP 167 -#define EFFECT_MEMENTO 168 -#define EFFECT_FACADE 169 -#define EFFECT_FOCUS_PUNCH 170 -#define EFFECT_SMELLINGSALT 171 -#define EFFECT_FOLLOW_ME 172 -#define EFFECT_NATURE_POWER 173 -#define EFFECT_CHARGE 174 -#define EFFECT_TAUNT 175 -#define EFFECT_HELPING_HAND 176 -#define EFFECT_TRICK 177 -#define EFFECT_ROLE_PLAY 178 -#define EFFECT_WISH 179 -#define EFFECT_ASSIST 180 -#define EFFECT_INGRAIN 181 -#define EFFECT_SUPERPOWER 182 -#define EFFECT_MAGIC_COAT 183 -#define EFFECT_RECYCLE 184 -#define EFFECT_REVENGE 185 -#define EFFECT_BRICK_BREAK 186 -#define EFFECT_YAWN 187 -#define EFFECT_KNOCK_OFF 188 -#define EFFECT_ENDEAVOR 189 -#define EFFECT_ERUPTION 190 -#define EFFECT_SKILL_SWAP 191 -#define EFFECT_IMPRISON 192 -#define EFFECT_REFRESH 193 -#define EFFECT_GRUDGE 194 -#define EFFECT_SNATCH 195 -#define EFFECT_LOW_KICK 196 -#define EFFECT_SECRET_POWER 197 -#define EFFECT_RECOIL_33 198 -#define EFFECT_TEETER_DANCE 199 -#define EFFECT_HIT_ESCAPE 200 -#define EFFECT_MUD_SPORT 201 -#define EFFECT_POISON_FANG 202 -#define EFFECT_WEATHER_BALL 203 -#define EFFECT_OVERHEAT 204 -#define EFFECT_TICKLE 205 -#define EFFECT_COSMIC_POWER 206 -#define EFFECT_SKY_UPPERCUT 207 -#define EFFECT_BULK_UP 208 -#define EFFECT_PLACEHOLDER 209 -#define EFFECT_WATER_SPORT 210 -#define EFFECT_CALM_MIND 211 -#define EFFECT_DRAGON_DANCE 212 -#define EFFECT_CAMOUFLAGE 213 +#define EFFECT_HIT 0 +#define EFFECT_SLEEP 1 +#define EFFECT_POISON_HIT 2 +#define EFFECT_ABSORB 3 +#define EFFECT_BURN_HIT 4 +#define EFFECT_FREEZE_HIT 5 +#define EFFECT_PARALYZE_HIT 6 +#define EFFECT_EXPLOSION 7 +#define EFFECT_DREAM_EATER 8 +#define EFFECT_MIRROR_MOVE 9 +#define EFFECT_ATTACK_UP 10 +#define EFFECT_DEFENSE_UP 11 +#define EFFECT_SPEED_UP 12 +#define EFFECT_SPECIAL_ATTACK_UP 13 +#define EFFECT_SPECIAL_DEFENSE_UP 14 +#define EFFECT_ACCURACY_UP 15 +#define EFFECT_EVASION_UP 16 +#define EFFECT_SPECIAL_ATTACK_UP_3 17 +#define EFFECT_ATTACK_DOWN 18 +#define EFFECT_DEFENSE_DOWN 19 +#define EFFECT_SPEED_DOWN 20 +#define EFFECT_SPECIAL_ATTACK_DOWN 21 +#define EFFECT_SPECIAL_DEFENSE_DOWN 22 +#define EFFECT_ACCURACY_DOWN 23 +#define EFFECT_EVASION_DOWN 24 +#define EFFECT_HAZE 25 +#define EFFECT_BIDE 26 +#define EFFECT_RAMPAGE 27 +#define EFFECT_ROAR 28 +#define EFFECT_MULTI_HIT 29 +#define EFFECT_CONVERSION 30 +#define EFFECT_FLINCH_HIT 31 +#define EFFECT_RESTORE_HP 32 +#define EFFECT_TOXIC 33 +#define EFFECT_PAY_DAY 34 +#define EFFECT_LIGHT_SCREEN 35 +#define EFFECT_TRI_ATTACK 36 +#define EFFECT_REST 37 +#define EFFECT_OHKO 38 +#define EFFECT_FUSION_COMBO 39 +#define EFFECT_SUPER_FANG 40 +#define EFFECT_DRAGON_RAGE 41 +#define EFFECT_TRAP 42 +#define EFFECT_HEAL_BLOCK 43 +#define EFFECT_RECOIL_IF_MISS 44 +#define EFFECT_MIST 45 +#define EFFECT_FOCUS_ENERGY 46 +#define EFFECT_RECOIL_25 47 +#define EFFECT_CONFUSE 48 +#define EFFECT_ATTACK_UP_2 49 +#define EFFECT_DEFENSE_UP_2 50 +#define EFFECT_SPEED_UP_2 51 +#define EFFECT_SPECIAL_ATTACK_UP_2 52 +#define EFFECT_SPECIAL_DEFENSE_UP_2 53 +#define EFFECT_ACCURACY_UP_2 54 +#define EFFECT_EVASION_UP_2 55 +#define EFFECT_TRANSFORM 56 +#define EFFECT_ATTACK_DOWN_2 57 +#define EFFECT_DEFENSE_DOWN_2 58 +#define EFFECT_SPEED_DOWN_2 59 +#define EFFECT_SPECIAL_ATTACK_DOWN_2 60 +#define EFFECT_SPECIAL_DEFENSE_DOWN_2 61 +#define EFFECT_ACCURACY_DOWN_2 62 +#define EFFECT_EVASION_DOWN_2 63 +#define EFFECT_REFLECT 64 +#define EFFECT_POISON 65 +#define EFFECT_PARALYZE 66 +#define EFFECT_ATTACK_DOWN_HIT 67 +#define EFFECT_DEFENSE_DOWN_HIT 68 +#define EFFECT_SPEED_DOWN_HIT 69 +#define EFFECT_SPECIAL_ATTACK_DOWN_HIT 70 +#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT 71 +#define EFFECT_ACCURACY_DOWN_HIT 72 +#define EFFECT_EVASION_DOWN_HIT 73 +#define EFFECT_TWO_TURNS_ATTACK 74 +#define EFFECT_CONFUSE_HIT 75 +#define EFFECT_VITAL_THROW 76 +#define EFFECT_SUBSTITUTE 77 +#define EFFECT_RECHARGE 78 +#define EFFECT_RAGE 79 +#define EFFECT_MIMIC 80 +#define EFFECT_METRONOME 81 +#define EFFECT_LEECH_SEED 82 +#define EFFECT_DO_NOTHING 83 +#define EFFECT_DISABLE 84 +#define EFFECT_LEVEL_DAMAGE 85 +#define EFFECT_PSYWAVE 86 +#define EFFECT_COUNTER 87 +#define EFFECT_ENCORE 88 +#define EFFECT_PAIN_SPLIT 89 +#define EFFECT_SNORE 90 +#define EFFECT_CONVERSION_2 91 +#define EFFECT_LOCK_ON 92 +#define EFFECT_SKETCH 93 +#define EFFECT_HAMMER_ARM 94 +#define EFFECT_SLEEP_TALK 95 +#define EFFECT_DESTINY_BOND 96 +#define EFFECT_FLAIL 97 +#define EFFECT_SPITE 98 +#define EFFECT_FALSE_SWIPE 99 +#define EFFECT_HEAL_BELL 100 +#define EFFECT_ALWAYS_CRIT 101 +#define EFFECT_TRIPLE_KICK 102 +#define EFFECT_THIEF 103 +#define EFFECT_MEAN_LOOK 104 +#define EFFECT_NIGHTMARE 105 +#define EFFECT_MINIMIZE 106 +#define EFFECT_CURSE 107 +#define EFFECT_HEALING_WISH 108 +#define EFFECT_PROTECT 109 +#define EFFECT_SPIKES 110 +#define EFFECT_FORESIGHT 111 +#define EFFECT_PERISH_SONG 112 +#define EFFECT_SANDSTORM 113 +#define EFFECT_ENDURE 114 +#define EFFECT_ROLLOUT 115 +#define EFFECT_SWAGGER 116 +#define EFFECT_FURY_CUTTER 117 +#define EFFECT_ATTRACT 118 +#define EFFECT_RETURN 119 +#define EFFECT_PRESENT 120 +#define EFFECT_FRUSTRATION 121 +#define EFFECT_SAFEGUARD 122 +#define EFFECT_UNUSED_125 123 +#define EFFECT_MAGNITUDE 124 +#define EFFECT_BATON_PASS 125 +#define EFFECT_PURSUIT 126 +#define EFFECT_RAPID_SPIN 127 +#define EFFECT_SONICBOOM 128 +#define EFFECT_CAPTIVATE 129 +#define EFFECT_MORNING_SUN 130 +#define EFFECT_SYNTHESIS 131 +#define EFFECT_MOONLIGHT 132 +#define EFFECT_HIDDEN_POWER 133 +#define EFFECT_RAIN_DANCE 134 +#define EFFECT_SUNNY_DAY 135 +#define EFFECT_DEFENSE_UP_HIT 136 +#define EFFECT_ATTACK_UP_HIT 137 +#define EFFECT_ALL_STATS_UP_HIT 138 +#define EFFECT_FELL_STINGER 139 +#define EFFECT_BELLY_DRUM 140 +#define EFFECT_PSYCH_UP 141 +#define EFFECT_MIRROR_COAT 142 +#define EFFECT_SKULL_BASH 143 +#define EFFECT_TWISTER 144 +#define EFFECT_EARTHQUAKE 145 +#define EFFECT_FUTURE_SIGHT 146 +#define EFFECT_GUST 147 +#define EFFECT_FLINCH_MINIMIZE_HIT 148 +#define EFFECT_SOLARBEAM 149 +#define EFFECT_THUNDER 150 +#define EFFECT_TELEPORT 151 +#define EFFECT_BEAT_UP 152 +#define EFFECT_SEMI_INVULNERABLE 153 +#define EFFECT_DEFENSE_CURL 154 +#define EFFECT_SOFTBOILED 155 +#define EFFECT_FAKE_OUT 156 +#define EFFECT_UPROAR 157 +#define EFFECT_STOCKPILE 158 +#define EFFECT_SPIT_UP 159 +#define EFFECT_SWALLOW 160 +#define EFFECT_WORRY_SEED 161 +#define EFFECT_HAIL 162 +#define EFFECT_TORMENT 163 +#define EFFECT_FLATTER 164 +#define EFFECT_WILL_O_WISP 165 +#define EFFECT_MEMENTO 166 +#define EFFECT_FACADE 167 +#define EFFECT_FOCUS_PUNCH 168 +#define EFFECT_SMELLINGSALT 169 +#define EFFECT_FOLLOW_ME 170 +#define EFFECT_NATURE_POWER 171 +#define EFFECT_CHARGE 172 +#define EFFECT_TAUNT 173 +#define EFFECT_HELPING_HAND 174 +#define EFFECT_TRICK 175 +#define EFFECT_ROLE_PLAY 176 +#define EFFECT_WISH 177 +#define EFFECT_ASSIST 178 +#define EFFECT_INGRAIN 179 +#define EFFECT_SUPERPOWER 180 +#define EFFECT_MAGIC_COAT 181 +#define EFFECT_RECYCLE 182 +#define EFFECT_REVENGE 183 +#define EFFECT_BRICK_BREAK 184 +#define EFFECT_YAWN 185 +#define EFFECT_KNOCK_OFF 186 +#define EFFECT_ENDEAVOR 187 +#define EFFECT_ERUPTION 188 +#define EFFECT_SKILL_SWAP 189 +#define EFFECT_IMPRISON 190 +#define EFFECT_REFRESH 191 +#define EFFECT_GRUDGE 192 +#define EFFECT_SNATCH 193 +#define EFFECT_LOW_KICK 194 +#define EFFECT_SECRET_POWER 195 +#define EFFECT_RECOIL_33 196 +#define EFFECT_TEETER_DANCE 197 +#define EFFECT_HIT_ESCAPE 198 +#define EFFECT_MUD_SPORT 199 +#define EFFECT_POISON_FANG 200 +#define EFFECT_WEATHER_BALL 201 +#define EFFECT_OVERHEAT 202 +#define EFFECT_TICKLE 203 +#define EFFECT_COSMIC_POWER 204 +#define EFFECT_SKY_UPPERCUT 205 +#define EFFECT_BULK_UP 206 +#define EFFECT_PLACEHOLDER 207 +#define EFFECT_WATER_SPORT 208 +#define EFFECT_CALM_MIND 209 +#define EFFECT_DRAGON_DANCE 210 +#define EFFECT_CAMOUFLAGE 211 + +// New move effects +#define EFFECT_PLEDGE 212 +#define EFFECT_FLING 213 +#define EFFECT_NATURAL_GIFT 214 +#define EFFECT_WAKE_UP_SLAP 215 +#define EFFECT_WRING_OUT 216 +#define EFFECT_HEX 217 +#define EFFECT_ASSURANCE 218 +#define EFFECT_TRUMP_CARD 219 +#define EFFECT_ACROBATICS 220 +#define EFFECT_HEAT_CRASH 221 +#define EFFECT_PUNISHMENT 222 +#define EFFECT_STORED_POWER 223 +#define EFFECT_ELECTRO_BALL 224 +#define EFFECT_GYRO_BALL 225 +#define EFFECT_ECHOED_VOICE 226 +#define EFFECT_PAYBACK 227 +#define EFFECT_ROUND 228 +#define EFFECT_BRINE 229 +#define EFFECT_VENOSHOCK 230 +#define EFFECT_RETALIATE 231 +#define EFFECT_BULLDOZE 232 +#define EFFECT_FOUL_PLAY 233 +#define EFFECT_PSYSHOCK 234 +#define EFFECT_ROOST 235 +#define EFFECT_GRAVITY 236 +#define EFFECT_MIRACLE_EYE 237 +#define EFFECT_TAILWIND 238 +#define EFFECT_EMBARGO 239 +#define EFFECT_AQUA_RING 240 +#define EFFECT_TRICK_ROOM 241 +#define EFFECT_WONDER_ROOM 242 +#define EFFECT_MAGIC_ROOM 243 +#define EFFECT_MAGNET_RISE 244 +#define EFFECT_TOXIC_SPIKES 245 +#define EFFECT_GASTRO_ACID 246 +#define EFFECT_STEALTH_ROCK 247 +#define EFFECT_TELEKINESIS 248 +#define EFFECT_POWER_SWAP 249 +#define EFFECT_GUARD_SWAP 250 +#define EFFECT_HEART_SWAP 251 +#define EFFECT_POWER_SPLIT 252 +#define EFFECT_GUARD_SPLIT 253 +#define EFFECT_STICKY_WEB 254 +#define EFFECT_METAL_BURST 255 +#define EFFECT_LUCKY_CHANT 256 +#define EFFECT_SUCKER_PUNCH 257 +#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 258 +#define EFFECT_SIMPLE_BEAM 259 +#define EFFECT_ENTRAINMENT 260 +#define EFFECT_HEAL_PULSE 261 +#define EFFECT_QUASH 262 +#define EFFECT_ION_DELUGE 263 +#define EFFECT_FREEZE_DRY 264 +#define EFFECT_TOPSY_TURVY 265 +#define EFFECT_MISTY_TERRAIN 266 +#define EFFECT_GRASSY_TERRAIN 267 +#define EFFECT_ELECTRIC_TERRAIN 268 +#define EFFECT_PSYCHIC_TERRAIN 269 +#define EFFECT_ATTACK_ACCURACY_UP 270 +#define EFFECT_ATTACK_SPATK_UP 271 +#define EFFECT_HURRICANE 272 +#define EFFECT_TWO_TYPED_MOVE 273 +#define EFFECT_ME_FIRST 274 +#define EFFECT_SPEED_UP_HIT 275 +#define EFFECT_QUIVER_DANCE 276 +#define EFFECT_COIL 277 +#define EFFECT_ELECTRIFY 278 +#define EFFECT_SCALD 279 +#define EFFECT_REFLECT_TYPE 280 +#define EFFECT_SOAK 281 +#define EFFECT_GROWTH 282 +#define EFFECT_CLOSE_COMBAT 283 +#define EFFECT_LAST_RESORT 284 +#define EFFECT_RECOIL_33_STATUS 285 +#define EFFECT_FLINCH_STATUS 286 +#define EFFECT_RECOIL_50 287 +#define EFFECT_SHELL_SMASH 288 +#define EFFECT_SHIFT_GEAR 289 +#define EFFECT_DEFENSE_UP_3 290 +#define EFFECT_NOBLE_ROAR 291 +#define EFFECT_VENOM_DRENCH 292 +#define EFFECT_TOXIC_THREAD 293 +#define EFFECT_CLEAR_SMOG 294 +#define EFFECT_HIT_SWITCH_TARGET 295 +#define EFFECT_FINAL_GAMBIT 296 +#define EFFECT_CHANGE_TYPE_ON_ITEM 297 +#define EFFECT_AUTOTOMIZE 298 +#define EFFECT_COPYCAT 299 +#define EFFECT_DEFOG 300 +#define EFFECT_HIT_ENEMY_HEAL_ALLY 301 +#define EFFECT_SMACK_DOWN 302 +#define EFFECT_SYNCHRONOISE 303 +#define EFFECT_PSYCHO_SHIFT 304 +#define EFFECT_POWER_TRICK 305 +#define EFFECT_FLAME_BURST 306 +#define EFFECT_AFTER_YOU 307 +#define EFFECT_BESTOW 308 +#define EFFECT_ROTOTILLER 309 +#define EFFECT_FLOWER_SHIELD 310 +#define EFFECT_HIT_PREVENT_ESCAPE 311 +#define EFFECT_SPEED_SWAP 312 +#define EFFECT_DEFENSE_UP2_HIT 313 +#define EFFECT_REVELATION_DANCE 314 +#define EFFECT_AURORA_VEIL 315 +#define EFFECT_THIRD_TYPE 316 +#define EFFECT_FEINT 317 +#define EFFECT_SPARKLING_ARIA 318 +#define EFFECT_ACUPRESSURE 319 +#define EFFECT_AROMATIC_MIST 320 +#define EFFECT_POWDER 321 +#define EFFECT_SP_ATTACK_UP_HIT 322 +#define EFFECT_BELCH 323 +#define EFFECT_PARTING_SHOT 324 +#define EFFECT_SPECTRAL_THIEF 325 +#define EFFECT_V_CREATE 326 +#define EFFECT_MAT_BLOCK 327 +#define EFFECT_STOMPING_TANTRUM 328 +#define EFFECT_CORE_ENFORCER 329 +#define EFFECT_INSTRUCT 330 +#define EFFECT_THROAT_CHOP 331 +#define EFFECT_LASER_FOCUS 332 +#define EFFECT_MAGNETIC_FLUX 333 +#define EFFECT_GEAR_UP 334 +#define EFFECT_INCINERATE 335 +#define EFFECT_BUG_BITE 336 +#define EFFECT_STRENGTH_SAP 337 +#define EFFECT_MIND_BLOWN 338 +#define EFFECT_PURIFY 339 +#define EFFECT_BURN_UP 340 +#define EFFECT_SHORE_UP 341 +#define EFFECT_GEOMANCY 342 +#define EFFECT_FAIRY_LOCK 343 +#define EFFECT_ALLY_SWITCH 344 +#define EFFECT_RELIC_SONG 345 +#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 346 +#define EFFECT_BODY_PRESS 347 +#define EFFECT_EERIE_SPELL 348 +#define EFFECT_JUNGLE_HEALING 349 +#define EFFECT_COACHING 350 +#define EFFECT_LASH_OUT 351 +#define EFFECT_GRASSY_GLIDE 352 +#define EFFECT_REMOVE_TERRAIN 353 +#define EFFECT_DYNAMAX_DOUBLE_DMG 354 +#define EFFECT_DECORATE 355 +#define EFFECT_SNIPE_SHOT 356 +#define EFFECT_RECOIL_HP_25 357 +#define EFFECT_STUFF_CHEEKS 358 +#define EFFECT_GRAV_APPLE 359 +#define EFFECT_EVASION_UP_HIT 360 +#define EFFECT_GLITZY_GLOW 361 +#define EFFECT_BADDY_BAD 362 +#define EFFECT_SAPPY_SEED 363 +#define EFFECT_FREEZY_FROST 364 +#define EFFECT_SPARKLY_SWIRL 365 +#define EFFECT_PLASMA_FISTS 366 +#define EFFECT_HYPERSPACE_FURY 367 +#define EFFECT_AURA_WHEEL 368 +#define EFFECT_PHOTON_GEYSER 369 +#define EFFECT_SHELL_SIDE_ARM 370 -// New move effects -#define EFFECT_PLEDGE 214 -#define EFFECT_FLING 215 -#define EFFECT_NATURAL_GIFT 216 -#define EFFECT_WAKE_UP_SLAP 217 -#define EFFECT_WRING_OUT 218 -#define EFFECT_HEX 219 -#define EFFECT_ASSURANCE 220 -#define EFFECT_TRUMP_CARD 221 -#define EFFECT_ACROBATICS 222 -#define EFFECT_HEAT_CRASH 223 -#define EFFECT_PUNISHMENT 224 -#define EFFECT_STORED_POWER 225 -#define EFFECT_ELECTRO_BALL 226 -#define EFFECT_GYRO_BALL 227 -#define EFFECT_ECHOED_VOICE 228 -#define EFFECT_PAYBACK 229 -#define EFFECT_ROUND 230 -#define EFFECT_BRINE 231 -#define EFFECT_VENOSHOCK 232 -#define EFFECT_RETALIATE 233 -#define EFFECT_BULLDOZE 234 -#define EFFECT_FOUL_PLAY 235 -#define EFFECT_PSYSHOCK 236 -#define EFFECT_ROOST 237 -#define EFFECT_GRAVITY 238 -#define EFFECT_MIRACLE_EYE 239 -#define EFFECT_TAILWIND 240 -#define EFFECT_EMBARGO 241 -#define EFFECT_AQUA_RING 242 -#define EFFECT_TRICK_ROOM 243 -#define EFFECT_WONDER_ROOM 244 -#define EFFECT_MAGIC_ROOM 245 -#define EFFECT_MAGNET_RISE 246 -#define EFFECT_TOXIC_SPIKES 247 -#define EFFECT_GASTRO_ACID 248 -#define EFFECT_STEALTH_ROCK 249 -#define EFFECT_TELEKINESIS 250 -#define EFFECT_POWER_SWAP 251 -#define EFFECT_GUARD_SWAP 252 -#define EFFECT_HEART_SWAP 253 -#define EFFECT_POWER_SPLIT 254 -#define EFFECT_GUARD_SPLIT 255 -#define EFFECT_STICKY_WEB 256 -#define EFFECT_METAL_BURST 257 -#define EFFECT_LUCKY_CHANT 258 -#define EFFECT_SUCKER_PUNCH 259 -#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 260 -#define EFFECT_SIMPLE_BEAM 261 -#define EFFECT_ENTRAINMENT 262 -#define EFFECT_HEAL_PULSE 263 -#define EFFECT_QUASH 264 -#define EFFECT_ION_DELUGE 265 -#define EFFECT_FREEZE_DRY 266 -#define EFFECT_TOPSY_TURVY 267 -#define EFFECT_MISTY_TERRAIN 268 -#define EFFECT_GRASSY_TERRAIN 269 -#define EFFECT_ELECTRIC_TERRAIN 270 -#define EFFECT_PSYCHIC_TERRAIN 271 -#define EFFECT_ATTACK_ACCURACY_UP 272 -#define EFFECT_ATTACK_SPATK_UP 273 -#define EFFECT_HURRICANE 274 -#define EFFECT_TWO_TYPED_MOVE 275 -#define EFFECT_ME_FIRST 276 -#define EFFECT_SPEED_UP_HIT 277 -#define EFFECT_QUIVER_DANCE 278 -#define EFFECT_COIL 279 -#define EFFECT_ELECTRIFY 280 -#define EFFECT_SCALD 281 -#define EFFECT_REFLECT_TYPE 282 -#define EFFECT_SOAK 283 -#define EFFECT_GROWTH 284 -#define EFFECT_CLOSE_COMBAT 285 -#define EFFECT_LAST_RESORT 286 -#define EFFECT_RECOIL_33_STATUS 287 -#define EFFECT_FLINCH_STATUS 288 -#define EFFECT_RECOIL_50 289 -#define EFFECT_SHELL_SMASH 290 -#define EFFECT_SHIFT_GEAR 291 -#define EFFECT_DEFENSE_UP_3 292 -#define EFFECT_NOBLE_ROAR 293 -#define EFFECT_VENOM_DRENCH 294 -#define EFFECT_TOXIC_THREAD 295 -#define EFFECT_CLEAR_SMOG 296 -#define EFFECT_HIT_SWITCH_TARGET 297 -#define EFFECT_FINAL_GAMBIT 298 -#define EFFECT_CHANGE_TYPE_ON_ITEM 299 -#define EFFECT_AUTOTOMIZE 300 -#define EFFECT_COPYCAT 301 -#define EFFECT_DEFOG 302 -#define EFFECT_HIT_ENEMY_HEAL_ALLY 303 -#define EFFECT_SMACK_DOWN 304 -#define EFFECT_SYNCHRONOISE 305 -#define EFFECT_PSYCHO_SHIFT 306 -#define EFFECT_POWER_TRICK 307 -#define EFFECT_FLAME_BURST 308 -#define EFFECT_AFTER_YOU 309 -#define EFFECT_BESTOW 310 -#define EFFECT_ROTOTILLER 311 -#define EFFECT_FLOWER_SHIELD 312 -#define EFFECT_HIT_PREVENT_ESCAPE 313 -#define EFFECT_SPEED_SWAP 314 -#define EFFECT_DEFENSE_UP2_HIT 315 -#define EFFECT_REVELATION_DANCE 316 -#define EFFECT_AURORA_VEIL 317 -#define EFFECT_THIRD_TYPE 318 -#define EFFECT_FEINT 319 -#define EFFECT_SPARKLING_ARIA 320 -#define EFFECT_ACUPRESSURE 321 -#define EFFECT_AROMATIC_MIST 322 -#define EFFECT_POWDER 323 -#define EFFECT_SP_ATTACK_UP_HIT 324 -#define EFFECT_BELCH 325 -#define EFFECT_PARTING_SHOT 326 -#define EFFECT_SPECTRAL_THIEF 327 -#define EFFECT_V_CREATE 328 -#define EFFECT_MAT_BLOCK 329 -#define EFFECT_STOMPING_TANTRUM 330 -#define EFFECT_CORE_ENFORCER 331 -#define EFFECT_INSTRUCT 332 -#define EFFECT_THROAT_CHOP 333 -#define EFFECT_LASER_FOCUS 334 -#define EFFECT_MAGNETIC_FLUX 335 -#define EFFECT_GEAR_UP 336 -#define EFFECT_INCINERATE 337 -#define EFFECT_BUG_BITE 338 -#define EFFECT_STRENGTH_SAP 339 -#define EFFECT_MIND_BLOWN 340 -#define EFFECT_PURIFY 341 -#define EFFECT_BURN_UP 342 -#define EFFECT_SHORE_UP 343 -#define EFFECT_GEOMANCY 344 -#define EFFECT_FAIRY_LOCK 345 -#define EFFECT_ALLY_SWITCH 346 -#define EFFECT_RELIC_SONG 347 -#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 348 -#define EFFECT_BODY_PRESS 349 -#define EFFECT_EERIE_SPELL 350 -#define EFFECT_JUNGLE_HEALING 351 -#define EFFECT_COACHING 352 -#define EFFECT_LASH_OUT 353 -#define EFFECT_GRASSY_GLIDE 354 -#define EFFECT_REMOVE_TERRAIN 355 -#define EFFECT_DYNAMAX_DOUBLE_DMG 356 -#define EFFECT_DECORATE 357 -#define EFFECT_SNIPE_SHOT 358 -#define EFFECT_TRIPLE_HIT 359 -#define EFFECT_RECOIL_HP_25 360 -#define EFFECT_STUFF_CHEEKS 361 -#define EFFECT_GRAV_APPLE 362 -#define EFFECT_EVASION_UP_HIT 363 -#define EFFECT_DOUBLE_IRON_BASH 364 -#define EFFECT_GLITZY_GLOW 365 -#define EFFECT_BADDY_BAD 366 -#define EFFECT_SAPPY_SEED 367 -#define EFFECT_FREEZY_FROST 368 -#define EFFECT_SPARKLY_SWIRL 369 -#define EFFECT_PLASMA_FISTS 370 -#define EFFECT_HYPERSPACE_FURY 371 -#define EFFECT_AURA_WHEEL 372 -#define EFFECT_PHOTON_GEYSER 373 -#define EFFECT_SHELL_SIDE_ARM 374 - -#define NUM_BATTLE_MOVE_EFFECTS 375 +#define NUM_BATTLE_MOVE_EFFECTS 371 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H \ No newline at end of file From e407883b58b0ec3fa0d33ff915f77ead4f997b0a Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 7 Nov 2021 20:31:09 +1300 Subject: [PATCH 14/58] Rethink final strike effects This is now checked in SetMoveEffect instead of in each move that should behave this way. Some effects will need to be redone to make them play nice with this change, but some just work as is. --- data/battle_scripts_1.s | 7 +++-- include/constants/battle.h | 2 +- src/battle_script_commands.c | 53 ++++++++++++++++++++++++++++-------- 3 files changed, 47 insertions(+), 15 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index bf396ca20..a11510689 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -813,11 +813,9 @@ BattleScript_EffectBurnUp: attackstring ppreduce jumpiftype BS_ATTACKER, TYPE_FIRE, BattleScript_BurnUpWorks - goto BattleScript_MoveEnd + goto BattleScript_ButItFailed BattleScript_BurnUpWorks: accuracycheck BattleScript_MoveMissedPause, ACC_CURR_MOVE - setmoveeffect MOVE_EFFECT_BURN_UP - seteffectwithchance critcalc damagecalc adjustdamage @@ -832,6 +830,9 @@ BattleScript_BurnUpWorks: waitmessage B_WAIT_TIME_LONG resultmessage waitmessage B_WAIT_TIME_LONG + losetype BS_ATTACKER, TYPE_FIRE + printstring STRINGID_ATTACKERLOSTFIRETYPE + waitmessage B_WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL goto BattleScript_MoveEnd diff --git a/include/constants/battle.h b/include/constants/battle.h index 0a2cfc49c..6b8698720 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -358,7 +358,7 @@ #define MOVE_EFFECT_BUG_BITE 0x45 #define MOVE_EFFECT_RECOIL_HP_25 0x46 #define MOVE_EFFECT_RELIC_SONG 0x47 -#define MOVE_EFFECT_BURN_UP 0x48 + #define NUM_MOVE_EFFECTS 0x48 #define MOVE_EFFECT_AFFECTS_USER 0x4000 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index cf9fcb93e..a4a3f39e0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -301,6 +301,7 @@ static bool8 sub_804F344(void); static void PutMonIconOnLvlUpBox(void); static void PutLevelAndGenderOnLvlUpBox(void); static bool32 CriticalCapture(u32 odds); +static bool8 IsFinalStrikeEffect(u16 move); static void SpriteCB_MonIconOnLvlUpBox(struct Sprite* sprite); @@ -1134,6 +1135,24 @@ static const u16 sMoveEffectsForbiddenToInstruct[] = FORBIDDEN_INSTRUCT_END }; +static const u16 sFinalStrikeOnlyEffects[] = +{ + EFFECT_RELIC_SONG, + EFFECT_BUG_BITE, + EFFECT_THIEF, + EFFECT_BURN_UP, + EFFECT_PAY_DAY, + EFFECT_SECRET_POWER, + EFFECT_HIT_SWITCH_TARGET, + EFFECT_SMACK_DOWN, + EFFECT_SPARKLING_ARIA, + EFFECT_SMELLINGSALT, + EFFECT_WAKE_UP_SLAP, + EFFECT_HIT_ESCAPE, + EFFECT_RECOIL_HP_25, + EFFECT_HIT_PREVENT_ESCAPE, +}; + static const u16 sNaturePowerMoves[] = { [BATTLE_TERRAIN_GRASS] = MOVE_ENERGY_BALL, @@ -2656,13 +2675,20 @@ void SetMoveEffect(bool32 primary, u32 certain) bool32 statusChanged = FALSE; bool32 mirrorArmorReflected = (GetBattlerAbility(gBattlerTarget) == ABILITY_MIRROR_ARMOR); u32 flags = 0; - + + if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 2 + && gBattleMons[gBattlerTarget].hp != 0 + && IsFinalStrikeEffect(gCurrentMove)) + { + gBattlescriptCurrInstr++; + return; + } + switch (gBattleScripting.moveEffect) // Set move effects which happen later on { case MOVE_EFFECT_KNOCK_OFF: case MOVE_EFFECT_SMACK_DOWN: case MOVE_EFFECT_REMOVE_STATUS: - case MOVE_EFFECT_BURN_UP: gBattleStruct->moveEffect2 = gBattleScripting.moveEffect; gBattlescriptCurrInstr++; return; @@ -3160,8 +3186,6 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattlescriptCurrInstr++; break; case MOVE_EFFECT_STEAL_ITEM: - // Only steal items on the final strike of Parental Bond - if (!(gSpecialStatuses[gBattlerAttacker].parentalBondOn == 2 && gBattleMons[gBattlerTarget].hp != 0)) { if (!CanStealItem(gBattlerAttacker, gBattlerTarget, gBattleMons[gBattlerTarget].item)) { @@ -3385,8 +3409,7 @@ void SetMoveEffect(bool32 primary, u32 certain) break; case MOVE_EFFECT_BUG_BITE: if (ItemId_GetPocket(gBattleMons[gEffectBattler].item) == POCKET_BERRIES - && GetBattlerAbility(gEffectBattler) != ABILITY_STICKY_HOLD - && !(gSpecialStatuses[gBattlerAttacker].parentalBondOn == 2 && gBattleMons[gBattlerTarget].hp != 0)) // Steal berry on final hit + && GetBattlerAbility(gEffectBattler) != ABILITY_STICKY_HOLD) { // target loses their berry gLastUsedItem = gBattleMons[gEffectBattler].item; @@ -5089,11 +5112,6 @@ static void Cmd_moveend(void) } } break; // MOVE_EFFECT_REMOVE_STATUS - case MOVE_EFFECT_BURN_UP: - effect = TRUE; - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = BattleScript_BurnUpRemoveType; - break; } gBattleStruct->moveEffect2 = 0; gBattleScripting.moveendState++; @@ -13582,3 +13600,16 @@ bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId) return FALSE; } + +static bool8 IsFinalStrikeEffect(u16 move) +{ + u32 i; + u16 moveEffect = gBattleMoves[move].effect; + + for (i = 0; i < ARRAY_COUNT(sFinalStrikeOnlyEffects); i++) + { + if (moveEffect == sFinalStrikeOnlyEffects[i]) + return TRUE; + } + return FALSE; +} From 6232b046b1f0e140880f99cfcb993381533b594a Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 13 Nov 2021 12:40:45 +1300 Subject: [PATCH 15/58] Fix Burn Up Now works properly with and without Parental Bond. It wasn't broken before, but its interaction with Parental Bond was. --- data/battle_scripts_1.s | 23 +++-------------------- include/constants/battle.h | 3 ++- src/battle_script_commands.c | 5 +++++ 3 files changed, 10 insertions(+), 21 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a11510689..0353c9133 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -814,27 +814,10 @@ BattleScript_EffectBurnUp: ppreduce jumpiftype BS_ATTACKER, TYPE_FIRE, BattleScript_BurnUpWorks goto BattleScript_ButItFailed + BattleScript_BurnUpWorks: - accuracycheck BattleScript_MoveMissedPause, ACC_CURR_MOVE - critcalc - damagecalc - adjustdamage - attackanimation - waitanimation - effectivenesssound - hitanimation BS_TARGET - waitstate - healthbarupdate BS_TARGET - datahpupdate BS_TARGET - critmessage - waitmessage B_WAIT_TIME_LONG - resultmessage - waitmessage B_WAIT_TIME_LONG - losetype BS_ATTACKER, TYPE_FIRE - printstring STRINGID_ATTACKERLOSTFIRETYPE - waitmessage B_WAIT_TIME_LONG - tryfaintmon BS_TARGET, FALSE, NULL - goto BattleScript_MoveEnd + setmoveeffect MOVE_EFFECT_BURN_UP | MOVE_EFFECT_CERTAIN + goto BattleScript_EffectHit BattleScript_BurnUpRemoveType:: losetype BS_ATTACKER, TYPE_FIRE diff --git a/include/constants/battle.h b/include/constants/battle.h index 6b8698720..5a95d1853 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -358,8 +358,9 @@ #define MOVE_EFFECT_BUG_BITE 0x45 #define MOVE_EFFECT_RECOIL_HP_25 0x46 #define MOVE_EFFECT_RELIC_SONG 0x47 +#define MOVE_EFFECT_BURN_UP 0x48 -#define NUM_MOVE_EFFECTS 0x48 +#define NUM_MOVE_EFFECTS 0x49 #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index a4a3f39e0..f8548f522 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3443,6 +3443,11 @@ void SetMoveEffect(bool32 primary, u32 certain) } } break; + case MOVE_EFFECT_BURN_UP: + // This seems unnecessary but is done to make it work properly with Parental Bond + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_BurnUpRemoveType; + break; } } } From d0336a9edf7c53db15fab0341ea62d4c30670210 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 13 Nov 2021 14:01:36 +1300 Subject: [PATCH 16/58] Fix Payday Only scatters coins on the first hit of Parental Bond. --- src/battle_script_commands.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index f8548f522..dad910d5e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1141,7 +1141,6 @@ static const u16 sFinalStrikeOnlyEffects[] = EFFECT_BUG_BITE, EFFECT_THIEF, EFFECT_BURN_UP, - EFFECT_PAY_DAY, EFFECT_SECRET_POWER, EFFECT_HIT_SWITCH_TARGET, EFFECT_SMACK_DOWN, @@ -3019,15 +3018,21 @@ void SetMoveEffect(bool32 primary, u32 certain) } break; case MOVE_EFFECT_PAYDAY: - if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER) + // Don't scatter coins on the second hit of Parental Bond + if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER && gSpecialStatuses[gBattlerAttacker].parentalBondOn != 1) { u16 PayDay = gPaydayMoney; gPaydayMoney += (gBattleMons[gBattlerAttacker].level * 5); if (PayDay > gPaydayMoney) gPaydayMoney = 0xFFFF; + + BattleScriptPush(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = BattleScript_MoveEffectPayDay; + } + else + { + gBattlescriptCurrInstr++; } - BattleScriptPush(gBattlescriptCurrInstr + 1); - gBattlescriptCurrInstr = sMoveEffectBS_Ptrs[gBattleScripting.moveEffect]; break; case MOVE_EFFECT_HAPPY_HOUR: if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER && !gBattleStruct->moneyMultiplierMove) From 2bf72fc51eb526319353d046c6bbef871c615f72 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 13 Nov 2021 15:29:24 +1300 Subject: [PATCH 17/58] Double Struggle damage for PB Not sure if this should hit twice. If not, this works. --- src/battle_script_commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index dad910d5e..789c95bb0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1142,7 +1142,6 @@ static const u16 sFinalStrikeOnlyEffects[] = EFFECT_THIEF, EFFECT_BURN_UP, EFFECT_SECRET_POWER, - EFFECT_HIT_SWITCH_TARGET, EFFECT_SMACK_DOWN, EFFECT_SPARKLING_ARIA, EFFECT_SMELLINGSALT, @@ -3274,6 +3273,8 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattleMoveDamage = (gBattleMons[gEffectBattler].maxHP) / 4; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; + if (GetBattlerAbility(gEffectBattler) == ABILITY_PARENTAL_BOND) + gBattleMoveDamage *= 2; BattleScriptPush(gBattlescriptCurrInstr + 1); gBattlescriptCurrInstr = BattleScript_MoveEffectRecoil; From 55b279ba0ab302be4fd0e61e7afeca6336d38af7 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 13 Nov 2021 16:29:12 +1300 Subject: [PATCH 18/58] Fix several move effects Dragon Tail, Natural Gift, Spit Up all hit twice now. Could maybe use isparentalbondlaststrike instead of some of the other checks too. --- asm/macros/battle_script.inc | 5 +++++ data/battle_scripts_1.s | 4 ++++ include/constants/battle_script_commands.h | 1 + src/battle_script_commands.c | 17 +++++++++++++---- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index df4a860dd..a5ac603ed 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1891,6 +1891,11 @@ various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK .endm + .macro isparentalbondlaststrike ptr:req + various BS_ATTACKER, VARIOUS_IS_PARENTAL_BOND_LAST_STRIKE + .4byte \ptr + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0353c9133..3677bc535 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1534,6 +1534,7 @@ BattleScript_EffectHitSwitchTarget: resultmessage waitmessage B_WAIT_TIME_LONG tryfaintmon BS_TARGET, FALSE, NULL + isparentalbondlaststrike BattleScript_EffectHitSwitchTargetMoveEnd jumpifability BS_TARGET, ABILITY_SUCTION_CUPS, BattleScript_AbilityPreventsPhasingOut jumpifstatus3 BS_TARGET, STATUS3_ROOTED, BattleScript_PrintMonIsRooted tryhitswitchtarget BattleScript_EffectHitSwitchTargetMoveEnd @@ -2536,6 +2537,7 @@ BattleScript_EffectNaturalGift: waitmessage B_WAIT_TIME_LONG seteffectwithchance jumpifmovehadnoeffect BattleScript_EffectNaturalGiftEnd + isparentalbondlaststrike BattleScript_EffectNaturalGiftEnd removeitem BS_ATTACKER BattleScript_EffectNaturalGiftEnd: tryfaintmon BS_TARGET, FALSE, NULL @@ -4817,9 +4819,11 @@ BattleScript_EffectSpitUp:: stockpiletobasedamage BattleScript_SpitUpFail goto BattleScript_HitFromAtkAnimation BattleScript_SpitUpFail:: + isparentalbondlaststrike BattleScript_SpitUpEnd pause B_WAIT_TIME_SHORT printstring STRINGID_FAILEDTOSPITUP waitmessage B_WAIT_TIME_LONG +BattleScript_SpitUpEnd: goto BattleScript_MoveEnd BattleScript_SpitUpFailProtect:: diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 82a28f86a..b3fa659c2 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -201,6 +201,7 @@ #define VARIOUS_TRY_TO_APPLY_MIMICRY 128 #define VARIOUS_PHOTON_GEYSER_CHECK 129 #define VARIOUS_SHELL_SIDE_ARM_CHECK 130 +#define VARIOUS_IS_PARENTAL_BOND_LAST_STRIKE 131 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 789c95bb0..d3cafecca 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9275,6 +9275,12 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; return; } + case VARIOUS_IS_PARENTAL_BOND_LAST_STRIKE: + if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 2 && gBattleMons[gBattlerTarget].hp != 0) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + else + gBattlescriptCurrInstr += 7; + return; } gBattlescriptCurrInstr += 3; @@ -9743,10 +9749,13 @@ static void Cmd_stockpiletobasedamage(void) if (gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED) gBattleScripting.animTurn = gDisableStructs[gBattlerAttacker].stockpileCounter; - gDisableStructs[gBattlerAttacker].stockpileCounter = 0; - // Restore stat changes from stockpile. - gBattleMons[gBattlerAttacker].statStages[STAT_DEF] -= gDisableStructs[gBattlerAttacker].stockpileDef; - gBattleMons[gBattlerAttacker].statStages[STAT_SPDEF] -= gDisableStructs[gBattlerAttacker].stockpileSpDef; + if (!(gSpecialStatuses[gBattlerAttacker].parentalBondOn == 2 && gBattleMons[gBattlerTarget].hp != 0)) + { + gDisableStructs[gBattlerAttacker].stockpileCounter = 0; + // Restore stat changes from stockpile. + gBattleMons[gBattlerAttacker].statStages[STAT_DEF] -= gDisableStructs[gBattlerAttacker].stockpileDef; + gBattleMons[gBattlerAttacker].statStages[STAT_SPDEF] -= gDisableStructs[gBattlerAttacker].stockpileSpDef; + } gBattlescriptCurrInstr += 5; } } From 02b3a1da8679c5d71e3ba2669e5e8bf62f49079b Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 13 Nov 2021 17:13:03 +1300 Subject: [PATCH 19/58] Fix infinite Bide loop Bide no longer gets stuck in a loop, but also doesn't strike twice. --- src/battle_script_commands.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d3cafecca..243661622 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -13598,7 +13598,9 @@ static bool32 CriticalCapture(u32 odds) bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId) { - if (gBattleMoves[move].split != SPLIT_STATUS && !(sForbiddenMoves[move] & FORBIDDEN_PARENTAL_BOND)) + if (gBattleMoves[move].split != SPLIT_STATUS + && !(sForbiddenMoves[move] & FORBIDDEN_PARENTAL_BOND) + && gBattleMons[gBattlerAttacker].status2 & STATUS2_BIDE) { if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { From 3e1934ebe3dac459443893e1bb329825f28714cd Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 7 May 2022 14:20:37 +1200 Subject: [PATCH 20/58] Rework VARIOUS_IS_PARENTAL_BOND_LAST_STRIKE Make this more versatile by allowing it to check parentalBondOn instead of only checking if parentalBondOn == 2. Also, fix Dragon Tail/Circle Throw switching the target on the first hit. --- asm/macros/battle_script.inc | 5 +++-- data/battle_scripts_1.s | 12 ++++++------ include/constants/battle_script_commands.h | 2 +- src/battle_script_commands.c | 16 ++++++++++------ 4 files changed, 20 insertions(+), 15 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 4fa360db0..a45b9967b 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1976,8 +1976,9 @@ various BS_ATTACKER, VARIOUS_SWAP_SIDE_STATUSES .endm - .macro isparentalbondlaststrike ptr:req - various BS_ATTACKER, VARIOUS_IS_PARENTAL_BOND_LAST_STRIKE + .macro checkparentalbondcounter counter:req, ptr:req + various BS_ATTACKER, VARIOUS_CHECK_PARENTAL_BOND_COUNTER + .byte \counter .4byte \ptr .endm diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 95a279f28..52eaf89f1 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -306,7 +306,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectCloseCombat @ EFFECT_CLOSE_COMBAT .4byte BattleScript_EffectLastResort @ EFFECT_LAST_RESORT .4byte BattleScript_EffectHit @ EFFECT_RECOIL_33_STATUS - .4byte BattleScript_EffectFlinchWithStatus @ EFFECT_FLINCH_STATUS + .4byte BattleScript_EffectFlinchStatus @ EFFECT_FLINCH_STATUS .4byte BattleScript_EffectHit @ EFFECT_RECOIL_50 .4byte BattleScript_EffectShellSmash @ EFFECT_SHELL_SMASH .4byte BattleScript_EffectShiftGear @ EFFECT_SHIFT_GEAR @@ -1907,7 +1907,7 @@ BattleScript_EffectHitSwitchTarget: resultmessage waitmessage B_WAIT_TIME_LONG tryfaintmon BS_TARGET - isparentalbondlaststrike BattleScript_EffectHitSwitchTargetMoveEnd + checkparentalbondcounter 2, BattleScript_EffectHitSwitchTargetMoveEnd moveendcase MOVEEND_MAGICIAN @ possibly others? jumpifability BS_TARGET, ABILITY_SUCTION_CUPS, BattleScript_AbilityPreventsPhasingOut jumpifstatus3 BS_TARGET, STATUS3_ROOTED, BattleScript_PrintMonIsRooted @@ -2913,7 +2913,7 @@ BattleScript_EffectNaturalGift: waitmessage B_WAIT_TIME_LONG seteffectwithchance jumpifmovehadnoeffect BattleScript_EffectNaturalGiftEnd - isparentalbondlaststrike BattleScript_EffectNaturalGiftEnd + checkparentalbondcounter 2, BattleScript_EffectNaturalGiftEnd removeitem BS_ATTACKER BattleScript_EffectNaturalGiftEnd: tryfaintmon BS_TARGET @@ -4380,11 +4380,11 @@ BattleScript_EffectTripleKick:: attackstring ppreduce jumpifmove MOVE_TRIPLE_AXEL BS_TripleAxel - addbyte sTRIPLE_KICK_POWER 10 @ triple kick gets +10 power + addbyte sTRIPLE_KICK_POWER, 10 @ triple kick gets +10 power goto BattleScript_HitFromAtkString BS_TripleAxel: - addbyte sTRIPLE_KICK_POWER 20 @ triple axel gets +20 power + addbyte sTRIPLE_KICK_POWER, 20 @ triple axel gets +20 power goto BattleScript_HitFromAtkString BattleScript_EffectThief:: @@ -5193,7 +5193,7 @@ BattleScript_EffectSpitUp:: stockpiletobasedamage BattleScript_SpitUpFail goto BattleScript_HitFromAtkAnimation BattleScript_SpitUpFail:: - isparentalbondlaststrike BattleScript_SpitUpEnd + checkparentalbondcounter 2, BattleScript_SpitUpEnd pause B_WAIT_TIME_SHORT printstring STRINGID_FAILEDTOSPITUP waitmessage B_WAIT_TIME_LONG diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 35966c13f..78c36a662 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -241,7 +241,7 @@ #define VARIOUS_BATTLER_ITEM_TO_LAST_USED_ITEM 150 #define VARIOUS_SET_BEAK_BLAST 151 #define VARIOUS_SWAP_SIDE_STATUSES 152 -#define VARIOUS_IS_PARENTAL_BOND_LAST_STRIKE 153 +#define VARIOUS_CHECK_PARENTAL_BOND_COUNTER 153 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index cc19a9da6..7f2ba2b89 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9727,12 +9727,17 @@ static void Cmd_various(void) case VARIOUS_SWAP_SIDE_STATUSES: CourtChangeSwapSideStatuses(); break; - case VARIOUS_IS_PARENTAL_BOND_LAST_STRIKE: - if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 2 && gBattleMons[gBattlerTarget].hp != 0) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + case VARIOUS_CHECK_PARENTAL_BOND_COUNTER: + { + // Some effects should only happen on the first or second strike of Parental Bond, + // so a way to check this in battle scripts is useful + u8 counter = T1_READ_8(gBattlescriptCurrInstr + 3); + if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == counter && gBattleMons[gBattlerTarget].hp != 0) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 4); else - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr += 8; return; + } } // End of switch (gBattlescriptCurrInstr[2]) gBattlescriptCurrInstr += 3; @@ -14468,8 +14473,7 @@ static bool32 CriticalCapture(u32 odds) bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId) { if (gBattleMoves[move].split != SPLIT_STATUS - && !(sForbiddenMoves[move] & FORBIDDEN_PARENTAL_BOND) - && gBattleMons[gBattlerAttacker].status2 & STATUS2_BIDE) + && !(sForbiddenMoves[move] & FORBIDDEN_PARENTAL_BOND)) { if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { From 57003c62fdd2a77fc1e006bf0a187fe4b6dbfb08 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 7 May 2022 14:20:56 +1200 Subject: [PATCH 21/58] EFFECT_SOLAR_BEAM Fix definition. --- include/constants/battle_move_effects.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 31b9b4cbb..c24fd02f7 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -150,7 +150,7 @@ #define EFFECT_FUTURE_SIGHT 146 #define EFFECT_GUST 147 #define EFFECT_FLINCH_MINIMIZE_HIT 148 -#define EFFECT_SOLARBEAM 149 +#define EFFECT_SOLAR_BEAM 149 #define EFFECT_THUNDER 150 #define EFFECT_TELEPORT 151 #define EFFECT_BEAT_UP 152 From 3e645b1839f22c64754fcad9872ae44b6e15e58a Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 7 May 2022 14:37:02 +1200 Subject: [PATCH 22/58] IsMoveAffectedByParentalBond supports dynamic move targeting Update IsMoveAffectedByParentalBond to properly handle Expanding Force. --- src/battle_script_commands.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 7f2ba2b89..5fd946407 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -14477,7 +14477,7 @@ bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId) { if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { - switch (gBattleMoves[move].target) + switch (GetBattlerMoveTargetType(battlerId, move)) { case MOVE_TARGET_BOTH: if (CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) >= 2) // Check for single target @@ -14487,12 +14487,12 @@ bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId) if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) >= 2) // Count mons on both sides; ignore attacker return FALSE; break; + default: + break; } } - return TRUE; } - return FALSE; } From bd00df400ad0c7882d4c217a7fb555313e2c4e9a Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 22 May 2022 11:51:20 +1200 Subject: [PATCH 23/58] Fix indentation in IsMoveAffectedByParentalBond --- src/battle_script_commands.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index e1f02c768..75a27c9de 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -14479,16 +14479,16 @@ bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId) { switch (GetBattlerMoveTargetType(battlerId, move)) { - case MOVE_TARGET_BOTH: - if (CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) >= 2) // Check for single target - return FALSE; - break; - case MOVE_TARGET_FOES_AND_ALLY: - if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) >= 2) // Count mons on both sides; ignore attacker - return FALSE; - break; - default: + case MOVE_TARGET_BOTH: + if (CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) >= 2) // Check for single target + return FALSE; break; + case MOVE_TARGET_FOES_AND_ALLY: + if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) >= 2) // Count mons on both sides; ignore attacker + return FALSE; + break; + default: + break; } } return TRUE; From d29293f71520604a851da1f66ebc99d591ba8145 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 22 May 2022 13:05:45 +1200 Subject: [PATCH 24/58] Prevent infinite Bide loop with Parental Bond Prevent infinite loop from Bide + Parental Bond until this interaction can be implemented properly. --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 8d78a8240..358a55e05 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -945,7 +945,7 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_BEHEMOTH_BLADE] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_BELCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_BESTOW] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, - [MOVE_BIDE] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_BIDE] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND, // Note: Bide should work with Parental Bond. This will be addressed in future. [MOVE_BLAST_BURN] = FORBIDDEN_INSTRUCT, [MOVE_BODY_PRESS] = FORBIDDEN_METRONOME, [MOVE_BONE_RUSH] = FORBIDDEN_PARENTAL_BOND, From 66177e795824676ac20aafa6edb35fdc961088d4 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 11 Sep 2022 13:54:55 -0400 Subject: [PATCH 25/58] Reworked shiny charm rerolls allow adding additional rerolls when necessary --- include/pokemon.h | 2 +- src/pokemon.c | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/include/pokemon.h b/include/pokemon.h index 39f6e406b..af14e18e4 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -385,7 +385,7 @@ struct FormChange | (((personality) & 0x00000003) >> 0) \ ) % NUM_UNOWN_FORMS) -#define GET_SHINY_VALUE(otId, personality)HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality) +#define GET_SHINY_VALUE(otId, personality) (HIHALF(otId) ^ LOHALF(otId) ^ HIHALF(personality) ^ LOHALF(personality)) extern u8 gPlayerPartyCount; extern struct Pokemon gPlayerParty[PARTY_SIZE]; diff --git a/src/pokemon.c b/src/pokemon.c index b421e5ace..19498810a 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3300,21 +3300,19 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, } else // Player is the OT { + u32 totalRerolls = 0; value = gSaveBlock2Ptr->playerTrainerId[0] | (gSaveBlock2Ptr->playerTrainerId[1] << 8) | (gSaveBlock2Ptr->playerTrainerId[2] << 16) | (gSaveBlock2Ptr->playerTrainerId[3] << 24); - + if (CheckBagHasItem(ITEM_SHINY_CHARM, 1)) + totalRerolls += I_SHINY_CHARM_REROLLS; + + while (GET_SHINY_VALUE(value, personality) >= SHINY_ODDS && totalRerolls > 0) { - u32 shinyValue; - u32 rolls = 0; - do - { - personality = Random32(); - shinyValue = HIHALF(value) ^ LOHALF(value) ^ HIHALF(personality) ^ LOHALF(personality); - rolls++; - } while (shinyValue >= SHINY_ODDS && rolls < I_SHINY_CHARM_REROLLS); + personality = Random32(); + totalRerolls--; } } From e3c19f5df52b8fde36ad1ff57fccbc3d3314b95d Mon Sep 17 00:00:00 2001 From: Deokishisu <6993375+Deokishisu@users.noreply.github.com> Date: Sat, 27 Aug 2022 19:46:59 -0400 Subject: [PATCH 26/58] Implement B2W2 Repel System The game now asks if the player would like to use another Repel when the one they used runs out. # Conflicts: # include/constants/vars.h --- data/scripts/repel.inc | 32 ++++++++++++++++++++++++++++++++ include/constants/vars.h | 2 +- src/item.c | 5 +++++ src/item_use.c | 1 + 4 files changed, 39 insertions(+), 1 deletion(-) diff --git a/data/scripts/repel.inc b/data/scripts/repel.inc index fc178603c..2c4e075f4 100644 --- a/data/scripts/repel.inc +++ b/data/scripts/repel.inc @@ -1,6 +1,38 @@ EventScript_RepelWoreOff:: + checkitem VAR_LAST_REPEL_USED, 1 + compare VAR_RESULT, TRUE + goto_if_eq EventScript_UseAnother + lock msgbox Text_RepelWoreOff, MSGBOX_SIGN + release + end + +EventScript_UseAnother: + lock + msgbox Text_UseAnother, MSGBOX_YESNO + compare VAR_RESULT, YES + goto_if_eq EventScript_UsedRepel + release + end + +EventScript_UsedRepel: + bufferitemname 0, VAR_LAST_REPEL_USED + playse SE_REPEL + lock + msgbox Text_UsedNewRepel, MSGBOX_SIGN + removeitem VAR_LAST_REPEL_USED, 1 + waitse + callnative HandleUseExpiredRepel + release end Text_RepelWoreOff: .string "REPEL's effect wore off…$" + +Text_UseAnother:: + .string "REPEL's effect wore off!\n" + .string "Use another?$" + +Text_UsedNewRepel:: + .string "{PLAYER} used the\n" + .string "{STR_VAR_1}.$" diff --git a/include/constants/vars.h b/include/constants/vars.h index 8128b6f32..aba1125c0 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -271,7 +271,7 @@ #define VAR_UNUSED_0x40FC 0x40FC // Unused Var #define VAR_UNUSED_0x40FD 0x40FD // Unused Var #define VAR_UNUSED_0x40FE 0x40FE // Unused Var -#define VAR_UNUSED_0x40FF 0x40FF // Unused Var +#define VAR_LAST_REPEL_USED 0x40FF // Unused Var #define VARS_END 0x40FF #define VARS_COUNT (VARS_END - VARS_START + 1) diff --git a/src/item.c b/src/item.c index f93e7adad..3a62d83e4 100644 --- a/src/item.c +++ b/src/item.c @@ -952,3 +952,8 @@ u8 ItemId_GetFlingPower(u16 itemId) { return gItems[SanitizeItemId(itemId)].flingPower; } + +void HandleUseExpiredRepel(void) +{ + VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(VAR_LAST_REPEL_USED))); +} diff --git a/src/item_use.c b/src/item_use.c index 5cd162519..e5e38c871 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -871,6 +871,7 @@ static void Task_UseRepel(u8 taskId) if (!IsSEPlaying()) { VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId)); + VarSet(VAR_LAST_REPEL_USED, gSpecialVar_ItemId); RemoveUsedItem(); if (!InBattlePyramid()) DisplayItemMessage(taskId, FONT_NORMAL, gStringVar4, CloseItemMessage); From 2d78ac019226615a66b5aea34dfbcac2c3472f3a Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 11 Sep 2022 19:48:27 -0400 Subject: [PATCH 27/58] Implemented Lures using the same vars as repels --- data/scripts/repel.inc | 39 ++++++++++++++- include/constants/item.h | 6 +++ include/constants/vars.h | 2 +- include/item_use.h | 1 + include/strings.h | 1 + src/data/items.h | 6 +-- src/item.c | 5 -- src/item_use.c | 51 +++++++++++++++++++- src/strings.c | 1 + src/wild_encounter.c | 102 +++++++++++++++++++++++++++++---------- 10 files changed, 175 insertions(+), 39 deletions(-) diff --git a/data/scripts/repel.inc b/data/scripts/repel.inc index 2c4e075f4..e5ecbcb41 100644 --- a/data/scripts/repel.inc +++ b/data/scripts/repel.inc @@ -19,7 +19,7 @@ EventScript_UsedRepel: bufferitemname 0, VAR_LAST_REPEL_USED playse SE_REPEL lock - msgbox Text_UsedNewRepel, MSGBOX_SIGN + msgbox Text_UsedNewRepelLure, MSGBOX_SIGN removeitem VAR_LAST_REPEL_USED, 1 waitse callnative HandleUseExpiredRepel @@ -33,6 +33,41 @@ Text_UseAnother:: .string "REPEL's effect wore off!\n" .string "Use another?$" -Text_UsedNewRepel:: +Text_UsedNewRepelLure:: .string "{PLAYER} used the\n" .string "{STR_VAR_1}.$" + +EventScript_LureWoreOff:: + checkitem VAR_LAST_REPEL_USED, 1 + compare VAR_RESULT, TRUE + goto_if_eq EventScript_LureUseAnother + lock + msgbox Text_LureWoreOff, MSGBOX_SIGN + release + end + +EventScript_LureUseAnother: + lock + msgbox Text_UseAnotherLure, MSGBOX_YESNO + compare VAR_RESULT, YES + goto_if_eq EventScript_UsedLure + release + end + +EventScript_UsedLure: + bufferitemname 0, VAR_LAST_REPEL_USED + playse SE_REPEL + lock + msgbox Text_UsedNewRepelLure, MSGBOX_SIGN + removeitem VAR_LAST_REPEL_USED, 1 + waitse + callnative HandleUseExpiredLure + release + end + +Text_LureWoreOff: + .string "Lure's effect wore off…$" + +Text_UseAnotherLure:: + .string "Lure's effect wore off!\n" + .string "Use another?$" diff --git a/include/constants/item.h b/include/constants/item.h index a224291fa..9b574417a 100644 --- a/include/constants/item.h +++ b/include/constants/item.h @@ -16,4 +16,10 @@ #define KEYITEMS_POCKET 4 #define POCKETS_COUNT 5 +#define REPEL_LURE_MASK (1 << 15) +#define IS_LAST_USED_LURE(var) (var & REPEL_LURE_MASK) +#define REPEL_LURE_STEPS(var) (var & (REPEL_LURE_MASK - 1)) +#define LURE_STEPS(var) (IS_LAST_USED_LURE(var) ? REPEL_LURE_STEPS(var) : 0) +#define REPEL_STEPS(var) (!IS_LAST_USED_LURE(var) ? REPEL_LURE_STEPS(var) : 0) + #endif // GUARD_ITEM_CONSTANTS_H diff --git a/include/constants/vars.h b/include/constants/vars.h index aba1125c0..5118f0533 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -47,7 +47,7 @@ // general purpose vars #define VAR_RECYCLE_GOODS 0x4020 -#define VAR_REPEL_STEP_COUNT 0x4021 +#define VAR_REPEL_LURE_STEP_COUNT 0x4021 #define VAR_ICE_STEP_COUNT 0x4022 #define VAR_STARTER_MON 0x4023 // 0=Treecko, 1=Torchic, 2=Mudkip #define VAR_MIRAGE_RND_H 0x4024 diff --git a/include/item_use.h b/include/item_use.h index d55f7cf0d..bdbf2cdea 100644 --- a/include/item_use.h +++ b/include/item_use.h @@ -20,6 +20,7 @@ void ItemUseOutOfBattle_PPUp(u8); void ItemUseOutOfBattle_RareCandy(u8); void ItemUseOutOfBattle_TMHM(u8); void ItemUseOutOfBattle_Repel(u8); +void ItemUseOutOfBattle_Lure(u8); void ItemUseOutOfBattle_EscapeRope(u8); void ItemUseOutOfBattle_BlackWhiteFlute(u8); void ItemUseOutOfBattle_EvolutionStone(u8); diff --git a/include/strings.h b/include/strings.h index 25a96eef0..626d63382 100644 --- a/include/strings.h +++ b/include/strings.h @@ -936,6 +936,7 @@ extern const u8 gText_BootedUpTM[]; extern const u8 gText_TMHMContainedVar1[]; extern const u8 gText_PlayerUsedVar2[]; extern const u8 gText_RepelEffectsLingered[]; +extern const u8 gText_LureEffectsLingered[]; extern const u8 gText_UsedVar2WildLured[]; extern const u8 gText_UsedVar2WildRepelled[]; extern const u8 gText_BoxFull[]; diff --git a/src/data/items.h b/src/data/items.h index b0b53c31f..5087ca03b 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -1565,7 +1565,7 @@ const struct Item gItems[] = .description = sLureDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .fieldUseFunc = ItemUseOutOfBattle_Lure, .secondaryId = 0, .flingPower = 30, }, @@ -1579,7 +1579,7 @@ const struct Item gItems[] = .description = sSuperLureDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .fieldUseFunc = ItemUseOutOfBattle_Lure, .secondaryId = 0, .flingPower = 30, }, @@ -1593,7 +1593,7 @@ const struct Item gItems[] = .description = sMaxLureDesc, .pocket = POCKET_ITEMS, .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .fieldUseFunc = ItemUseOutOfBattle_Lure, .secondaryId = 0, .flingPower = 30, }, diff --git a/src/item.c b/src/item.c index 3a62d83e4..f93e7adad 100644 --- a/src/item.c +++ b/src/item.c @@ -952,8 +952,3 @@ u8 ItemId_GetFlingPower(u16 itemId) { return gItems[SanitizeItemId(itemId)].flingPower; } - -void HandleUseExpiredRepel(void) -{ - VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(VAR_LAST_REPEL_USED))); -} diff --git a/src/item_use.c b/src/item_use.c index e5e38c871..1dddc5738 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -67,7 +67,9 @@ static void Task_ShowTMHMContainedMessage(u8); static void UseTMHMYesNo(u8); static void UseTMHM(u8); static void Task_StartUseRepel(u8); +static void Task_StartUseLure(u8 taskId); static void Task_UseRepel(u8); +static void Task_UseLure(u8 taskId); static void Task_CloseCantUseKeyItemMessage(u8); static void SetDistanceOfClosestHiddenItem(u8, s16, s16); static void CB2_OpenPokeblockFromBag(void); @@ -846,7 +848,7 @@ static void RemoveUsedItem(void) void ItemUseOutOfBattle_Repel(u8 taskId) { - if (VarGet(VAR_REPEL_STEP_COUNT) == 0) + if (REPEL_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT)) == 0) gTasks[taskId].func = Task_StartUseRepel; else if (!InBattlePyramid()) DisplayItemMessage(taskId, FONT_NORMAL, gText_RepelEffectsLingered, CloseItemMessage); @@ -870,7 +872,7 @@ static void Task_UseRepel(u8 taskId) { if (!IsSEPlaying()) { - VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId)); + VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId)); VarSet(VAR_LAST_REPEL_USED, gSpecialVar_ItemId); RemoveUsedItem(); if (!InBattlePyramid()) @@ -879,6 +881,51 @@ static void Task_UseRepel(u8 taskId) DisplayItemMessageInBattlePyramid(taskId, gStringVar4, Task_CloseBattlePyramidBagMessage); } } +void HandleUseExpiredRepel(void) +{ + VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(VAR_LAST_REPEL_USED))); +} + +void ItemUseOutOfBattle_Lure(u8 taskId) +{ + if (LURE_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT)) == 0) + gTasks[taskId].func = Task_StartUseLure; + else if (!InBattlePyramid()) + DisplayItemMessage(taskId, FONT_NORMAL, gText_LureEffectsLingered, CloseItemMessage); + else + DisplayItemMessageInBattlePyramid(taskId, gText_LureEffectsLingered, Task_CloseBattlePyramidBagMessage); +} + +static void Task_StartUseLure(u8 taskId) +{ + s16* data = gTasks[taskId].data; + + if (++data[8] > 7) + { + data[8] = 0; + PlaySE(SE_REPEL); + gTasks[taskId].func = Task_UseLure; + } +} + +static void Task_UseLure(u8 taskId) +{ + if (!IsSEPlaying()) + { + VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId) | REPEL_LURE_MASK); + VarSet(VAR_LAST_REPEL_USED, gSpecialVar_ItemId); + RemoveUsedItem(); + if (!InBattlePyramid()) + DisplayItemMessage(taskId, FONT_NORMAL, gStringVar4, CloseItemMessage); + else + DisplayItemMessageInBattlePyramid(taskId, gStringVar4, Task_CloseBattlePyramidBagMessage); + } +} + +void HandleUseExpiredLure(void) +{ + VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(VAR_LAST_REPEL_USED)) | REPEL_LURE_MASK); +} static void Task_UsedBlackWhiteFlute(u8 taskId) { diff --git a/src/strings.c b/src/strings.c index d199b92d4..4375adad2 100644 --- a/src/strings.c +++ b/src/strings.c @@ -244,6 +244,7 @@ const u8 gText_BootedUpHM[] = _("Booted up an HM."); const u8 gText_TMHMContainedVar1[] = _("It contained\n{STR_VAR_1}.\pTeach {STR_VAR_1}\nto a POKéMON?"); const u8 gText_PlayerUsedVar2[] = _("{PLAYER} used the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); const u8 gText_RepelEffectsLingered[] = _("But the effects of a REPEL\nlingered from earlier.{PAUSE_UNTIL_PRESS}"); +const u8 gText_LureEffectsLingered[] = _("But the effects of a Lure\nlingered from earlier.{PAUSE_UNTIL_PRESS}"); const u8 gText_UsedVar2WildLured[] = _("{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be lured.{PAUSE_UNTIL_PRESS}"); const u8 gText_UsedVar2WildRepelled[] = _("{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be repelled.{PAUSE_UNTIL_PRESS}"); const u8 gText_BoxFull[] = _("The BOX is full.{PAUSE_UNTIL_PRESS}"); diff --git a/src/wild_encounter.c b/src/wild_encounter.c index e49d09f54..1ac348793 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -20,11 +20,13 @@ #include "constants/abilities.h" #include "constants/battle_config.h" #include "constants/game_stat.h" +#include "constants/item.h" #include "constants/items.h" #include "constants/layouts.h" #include "constants/weather.h" extern const u8 EventScript_RepelWoreOff[]; +extern const u8 EventScript_LureWoreOff[]; #define MAX_ENCOUNTER_RATE 2880 @@ -181,58 +183,82 @@ static void FeebasSeedRng(u16 seed) // LAND_WILD_COUNT static u8 ChooseWildMonIndex_Land(void) { + u8 wildMonIndex = 0; + bool8 swap = FALSE; u8 rand = Random() % ENCOUNTER_CHANCE_LAND_MONS_TOTAL; if (rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_0) - return 0; + wildMonIndex = 0; else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_0 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_1) - return 1; + wildMonIndex = 1; else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_1 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_2) - return 2; + wildMonIndex = 2; else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_2 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_3) - return 3; + wildMonIndex = 3; else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_3 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_4) - return 4; + wildMonIndex = 4; else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_4 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_5) - return 5; + wildMonIndex = 5; else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_5 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_6) - return 6; + wildMonIndex = 6; else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_6 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_7) - return 7; + wildMonIndex = 7; else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_7 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_8) - return 8; + wildMonIndex = 8; else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_8 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_9) - return 9; + wildMonIndex = 9; else if (rand >= ENCOUNTER_CHANCE_LAND_MONS_SLOT_9 && rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_10) - return 10; + wildMonIndex = 10; else - return 11; + wildMonIndex = 11; + + if (LURE_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT)) && (Random() % 10 < 2)) + swap = TRUE; + + if (swap) + wildMonIndex = 11 - wildMonIndex; + + return wildMonIndex; } // ROCK_WILD_COUNT / WATER_WILD_COUNT static u8 ChooseWildMonIndex_WaterRock(void) { + u8 wildMonIndex = 0; + bool8 swap = FALSE; u8 rand = Random() % ENCOUNTER_CHANCE_WATER_MONS_TOTAL; if (rand < ENCOUNTER_CHANCE_WATER_MONS_SLOT_0) - return 0; + wildMonIndex = 0; else if (rand >= ENCOUNTER_CHANCE_WATER_MONS_SLOT_0 && rand < ENCOUNTER_CHANCE_WATER_MONS_SLOT_1) - return 1; + wildMonIndex = 1; else if (rand >= ENCOUNTER_CHANCE_WATER_MONS_SLOT_1 && rand < ENCOUNTER_CHANCE_WATER_MONS_SLOT_2) - return 2; + wildMonIndex = 2; else if (rand >= ENCOUNTER_CHANCE_WATER_MONS_SLOT_2 && rand < ENCOUNTER_CHANCE_WATER_MONS_SLOT_3) - return 3; + wildMonIndex = 3; else - return 4; + wildMonIndex = 4; + + if (LURE_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT)) && (Random() % 10 < 2)) + swap = TRUE; + + if (swap) + wildMonIndex = 4 - wildMonIndex; + + return wildMonIndex; } // FISH_WILD_COUNT static u8 ChooseWildMonIndex_Fishing(u8 rod) { u8 wildMonIndex = 0; + bool8 swap = FALSE; u8 rand = Random() % max(max(ENCOUNTER_CHANCE_FISHING_MONS_OLD_ROD_TOTAL, ENCOUNTER_CHANCE_FISHING_MONS_GOOD_ROD_TOTAL), ENCOUNTER_CHANCE_FISHING_MONS_SUPER_ROD_TOTAL); + if (LURE_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT)) && (Random() % 10 < 2)) + swap = TRUE; + switch (rod) { case OLD_ROD: @@ -241,6 +267,9 @@ static u8 ChooseWildMonIndex_Fishing(u8 rod) else wildMonIndex = 1; break; + + if (swap) + wildMonIndex = 1 - wildMonIndex; case GOOD_ROD: if (rand < ENCOUNTER_CHANCE_FISHING_MONS_GOOD_ROD_SLOT_2) wildMonIndex = 2; @@ -248,6 +277,9 @@ static u8 ChooseWildMonIndex_Fishing(u8 rod) wildMonIndex = 3; if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_GOOD_ROD_SLOT_3 && rand < ENCOUNTER_CHANCE_FISHING_MONS_GOOD_ROD_SLOT_4) wildMonIndex = 4; + + if (swap) + wildMonIndex = 6 - wildMonIndex; break; case SUPER_ROD: if (rand < ENCOUNTER_CHANCE_FISHING_MONS_SUPER_ROD_SLOT_5) @@ -260,6 +292,9 @@ static u8 ChooseWildMonIndex_Fishing(u8 rod) wildMonIndex = 8; if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_SUPER_ROD_SLOT_8 && rand < ENCOUNTER_CHANCE_FISHING_MONS_SUPER_ROD_SLOT_9) wildMonIndex = 9; + + if (swap) + wildMonIndex = 14 - wildMonIndex; break; } return wildMonIndex; @@ -521,6 +556,8 @@ static bool8 DoWildEncounterRateTest(u32 encounterRate, bool8 ignoreAbility) encounterRate = encounterRate * 80 / 100; ApplyFluteEncounterRateMod(&encounterRate); ApplyCleanseTagEncounterRateMod(&encounterRate); + if (LURE_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT)) != 0) + encounterRate *= 2; if (!ignoreAbility && !GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) { u32 ability = GetMonAbility(&gPlayerParty[0]); @@ -892,24 +929,37 @@ u16 GetLocalWaterMon(void) bool8 UpdateRepelCounter(void) { - u16 steps; + u16 repelLureVar = VarGet(VAR_REPEL_LURE_STEP_COUNT); + u16 steps = REPEL_LURE_STEPS(repelLureVar); + bool32 isLure = IS_LAST_USED_LURE(repelLureVar); if (InBattlePike() || InBattlePyramid()) return FALSE; if (InUnionRoom() == TRUE) return FALSE; - steps = VarGet(VAR_REPEL_STEP_COUNT); - if (steps != 0) { steps--; - VarSet(VAR_REPEL_STEP_COUNT, steps); - if (steps == 0) + if (!isLure) { - ScriptContext_SetupScript(EventScript_RepelWoreOff); - return TRUE; + VarSet(VAR_REPEL_LURE_STEP_COUNT, steps); + if (steps == 0) + { + ScriptContext_SetupScript(EventScript_RepelWoreOff); + return TRUE; + } } + else + { + VarSet(VAR_REPEL_LURE_STEP_COUNT, steps | REPEL_LURE_MASK); + if (steps == 0) + { + ScriptContext_SetupScript(EventScript_LureWoreOff); + return TRUE; + } + } + } return FALSE; } @@ -918,7 +968,7 @@ static bool8 IsWildLevelAllowedByRepel(u8 wildLevel) { u8 i; - if (!VarGet(VAR_REPEL_STEP_COUNT)) + if (!VarGet(VAR_REPEL_LURE_STEP_COUNT)) return TRUE; for (i = 0; i < PARTY_SIZE; i++) @@ -1006,7 +1056,7 @@ bool8 TryDoDoubleWildBattle(void) { if (GetSafariZoneFlag() || GetMonsStateToDoubles() != PLAYER_HAS_TWO_USABLE_MONS) return FALSE; -#if B_FLAG_FORCE_DOUBLE_WILD != 0 +#if B_FLAG_FORCE_DOUBLE_WILD != 0 else if (FlagGet(B_FLAG_FORCE_DOUBLE_WILD)) return TRUE; #endif From e3005e5275c04f2a09918577d8f47fdca167b398 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 11 Sep 2022 21:33:40 -0300 Subject: [PATCH 28/58] Item config for repel prompt --- data/event_scripts.s | 1 + data/scripts/repel.inc | 12 ++++++------ include/constants/item_config.h | 5 +++++ include/constants/vars.h | 2 +- src/item_use.c | 16 ++++++++++++---- src/wild_encounter.c | 2 +- 6 files changed, 26 insertions(+), 12 deletions(-) diff --git a/data/event_scripts.s b/data/event_scripts.s index 848a831fe..d77b9b9de 100644 --- a/data/event_scripts.s +++ b/data/event_scripts.s @@ -30,6 +30,7 @@ #include "constants/frontier_util.h" #include "constants/game_stat.h" #include "constants/item.h" +#include "constants/item_config.h" #include "constants/items.h" #include "constants/heal_locations.h" #include "constants/layouts.h" diff --git a/data/scripts/repel.inc b/data/scripts/repel.inc index e5ecbcb41..c57004a3c 100644 --- a/data/scripts/repel.inc +++ b/data/scripts/repel.inc @@ -1,5 +1,5 @@ EventScript_RepelWoreOff:: - checkitem VAR_LAST_REPEL_USED, 1 + checkitem I_VAR_LAST_REPEL_LURE_USED, 1 compare VAR_RESULT, TRUE goto_if_eq EventScript_UseAnother lock @@ -16,11 +16,11 @@ EventScript_UseAnother: end EventScript_UsedRepel: - bufferitemname 0, VAR_LAST_REPEL_USED + bufferitemname 0, I_VAR_LAST_REPEL_LURE_USED playse SE_REPEL lock msgbox Text_UsedNewRepelLure, MSGBOX_SIGN - removeitem VAR_LAST_REPEL_USED, 1 + removeitem I_VAR_LAST_REPEL_LURE_USED, 1 waitse callnative HandleUseExpiredRepel release @@ -38,7 +38,7 @@ Text_UsedNewRepelLure:: .string "{STR_VAR_1}.$" EventScript_LureWoreOff:: - checkitem VAR_LAST_REPEL_USED, 1 + checkitem I_VAR_LAST_REPEL_LURE_USED, 1 compare VAR_RESULT, TRUE goto_if_eq EventScript_LureUseAnother lock @@ -55,11 +55,11 @@ EventScript_LureUseAnother: end EventScript_UsedLure: - bufferitemname 0, VAR_LAST_REPEL_USED + bufferitemname 0, I_VAR_LAST_REPEL_LURE_USED playse SE_REPEL lock msgbox Text_UsedNewRepelLure, MSGBOX_SIGN - removeitem VAR_LAST_REPEL_USED, 1 + removeitem I_VAR_LAST_REPEL_LURE_USED, 1 waitse callnative HandleUseExpiredLure release diff --git a/include/constants/item_config.h b/include/constants/item_config.h index 9261241a5..584970f84 100644 --- a/include/constants/item_config.h +++ b/include/constants/item_config.h @@ -9,4 +9,9 @@ #define I_SITRUS_BERRY_HEAL GEN_LATEST // In Gen4+, Sitrus Berry was changed from healing 30 HP to healing 25% of Max HP. #define I_VITAMIN_EV_CAP GEN_LATEST // In Gen8, the Vitamins no longer have a cap of 100 EV per stat. +// Var settings +// To use the following features, replace the 0s with the var ID you're assigning it to. +// Eg: Replace with VAR_UNUSED_0x40F7 so you can use I_VAR_LAST_REPEL_LURE_USED for that feature. +#define I_VAR_LAST_REPEL_LURE_USED 0 // If this var has been assigned, B2W2's Repel prompt will trigger once it runs out. It also applies to Lures. + #endif // GUARD_CONSTANTS_ITEM_CONFIG_H diff --git a/include/constants/vars.h b/include/constants/vars.h index 5118f0533..a7a229a61 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -271,7 +271,7 @@ #define VAR_UNUSED_0x40FC 0x40FC // Unused Var #define VAR_UNUSED_0x40FD 0x40FD // Unused Var #define VAR_UNUSED_0x40FE 0x40FE // Unused Var -#define VAR_LAST_REPEL_USED 0x40FF // Unused Var +#define VAR_UNUSED_0x40FF 0x40FF // Unused Var #define VARS_END 0x40FF #define VARS_COUNT (VARS_END - VARS_START + 1) diff --git a/src/item_use.c b/src/item_use.c index 1dddc5738..995798331 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -873,7 +873,9 @@ static void Task_UseRepel(u8 taskId) if (!IsSEPlaying()) { VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId)); - VarSet(VAR_LAST_REPEL_USED, gSpecialVar_ItemId); + #if I_VAR_LAST_REPEL_LURE_USED != 0 + VarSet(I_VAR_LAST_REPEL_LURE_USED, gSpecialVar_ItemId); + #endif RemoveUsedItem(); if (!InBattlePyramid()) DisplayItemMessage(taskId, FONT_NORMAL, gStringVar4, CloseItemMessage); @@ -883,7 +885,9 @@ static void Task_UseRepel(u8 taskId) } void HandleUseExpiredRepel(void) { - VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(VAR_LAST_REPEL_USED))); +#if I_VAR_LAST_REPEL_LURE_USED != 0 + VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(I_VAR_LAST_REPEL_LURE_USED))); +#endif } void ItemUseOutOfBattle_Lure(u8 taskId) @@ -913,7 +917,9 @@ static void Task_UseLure(u8 taskId) if (!IsSEPlaying()) { VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId) | REPEL_LURE_MASK); - VarSet(VAR_LAST_REPEL_USED, gSpecialVar_ItemId); + #if I_VAR_LAST_REPEL_LURE_USED != 0 + VarSet(I_VAR_LAST_REPEL_LURE_USED, gSpecialVar_ItemId); + #endif RemoveUsedItem(); if (!InBattlePyramid()) DisplayItemMessage(taskId, FONT_NORMAL, gStringVar4, CloseItemMessage); @@ -924,7 +930,9 @@ static void Task_UseLure(u8 taskId) void HandleUseExpiredLure(void) { - VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(VAR_LAST_REPEL_USED)) | REPEL_LURE_MASK); +#if I_VAR_LAST_REPEL_LURE_USED != 0 + VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(I_VAR_LAST_REPEL_LURE_USED)) | REPEL_LURE_MASK); +#endif } static void Task_UsedBlackWhiteFlute(u8 taskId) diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 1ac348793..2a68f4e4d 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -968,7 +968,7 @@ static bool8 IsWildLevelAllowedByRepel(u8 wildLevel) { u8 i; - if (!VarGet(VAR_REPEL_LURE_STEP_COUNT)) + if (!REPEL_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT))) return TRUE; for (i = 0; i < PARTY_SIZE; i++) From 0944232059c7289ec3ba70c98a0f150f495613a7 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 12 Sep 2022 07:58:38 -0300 Subject: [PATCH 29/58] Added shiny rerolls to Lures + reverted repel var name --- include/constants/item.h | 4 ++-- include/constants/vars.h | 2 +- src/item_use.c | 12 ++++++------ src/pokemon.c | 2 ++ src/wild_encounter.c | 16 ++++++++-------- 5 files changed, 19 insertions(+), 17 deletions(-) diff --git a/include/constants/item.h b/include/constants/item.h index 9b574417a..a32f4545a 100644 --- a/include/constants/item.h +++ b/include/constants/item.h @@ -19,7 +19,7 @@ #define REPEL_LURE_MASK (1 << 15) #define IS_LAST_USED_LURE(var) (var & REPEL_LURE_MASK) #define REPEL_LURE_STEPS(var) (var & (REPEL_LURE_MASK - 1)) -#define LURE_STEPS(var) (IS_LAST_USED_LURE(var) ? REPEL_LURE_STEPS(var) : 0) -#define REPEL_STEPS(var) (!IS_LAST_USED_LURE(var) ? REPEL_LURE_STEPS(var) : 0) +#define LURE_STEP_COUNT (IS_LAST_USED_LURE(VarGet(VAR_REPEL_STEP_COUNT)) ? REPEL_LURE_STEPS(VarGet(VAR_REPEL_STEP_COUNT)) : 0) +#define REPEL_STEP_COUNT (!IS_LAST_USED_LURE(VarGet(VAR_REPEL_STEP_COUNT)) ? REPEL_LURE_STEPS(VarGet(VAR_REPEL_STEP_COUNT)) : 0) #endif // GUARD_ITEM_CONSTANTS_H diff --git a/include/constants/vars.h b/include/constants/vars.h index a7a229a61..8128b6f32 100644 --- a/include/constants/vars.h +++ b/include/constants/vars.h @@ -47,7 +47,7 @@ // general purpose vars #define VAR_RECYCLE_GOODS 0x4020 -#define VAR_REPEL_LURE_STEP_COUNT 0x4021 +#define VAR_REPEL_STEP_COUNT 0x4021 #define VAR_ICE_STEP_COUNT 0x4022 #define VAR_STARTER_MON 0x4023 // 0=Treecko, 1=Torchic, 2=Mudkip #define VAR_MIRAGE_RND_H 0x4024 diff --git a/src/item_use.c b/src/item_use.c index 995798331..e3d65d5a3 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -848,7 +848,7 @@ static void RemoveUsedItem(void) void ItemUseOutOfBattle_Repel(u8 taskId) { - if (REPEL_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT)) == 0) + if (REPEL_STEP_COUNT == 0) gTasks[taskId].func = Task_StartUseRepel; else if (!InBattlePyramid()) DisplayItemMessage(taskId, FONT_NORMAL, gText_RepelEffectsLingered, CloseItemMessage); @@ -872,7 +872,7 @@ static void Task_UseRepel(u8 taskId) { if (!IsSEPlaying()) { - VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId)); + VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId)); #if I_VAR_LAST_REPEL_LURE_USED != 0 VarSet(I_VAR_LAST_REPEL_LURE_USED, gSpecialVar_ItemId); #endif @@ -886,13 +886,13 @@ static void Task_UseRepel(u8 taskId) void HandleUseExpiredRepel(void) { #if I_VAR_LAST_REPEL_LURE_USED != 0 - VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(I_VAR_LAST_REPEL_LURE_USED))); + VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(I_VAR_LAST_REPEL_LURE_USED))); #endif } void ItemUseOutOfBattle_Lure(u8 taskId) { - if (LURE_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT)) == 0) + if (LURE_STEP_COUNT == 0) gTasks[taskId].func = Task_StartUseLure; else if (!InBattlePyramid()) DisplayItemMessage(taskId, FONT_NORMAL, gText_LureEffectsLingered, CloseItemMessage); @@ -916,7 +916,7 @@ static void Task_UseLure(u8 taskId) { if (!IsSEPlaying()) { - VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId) | REPEL_LURE_MASK); + VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId) | REPEL_LURE_MASK); #if I_VAR_LAST_REPEL_LURE_USED != 0 VarSet(I_VAR_LAST_REPEL_LURE_USED, gSpecialVar_ItemId); #endif @@ -931,7 +931,7 @@ static void Task_UseLure(u8 taskId) void HandleUseExpiredLure(void) { #if I_VAR_LAST_REPEL_LURE_USED != 0 - VarSet(VAR_REPEL_LURE_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(I_VAR_LAST_REPEL_LURE_USED)) | REPEL_LURE_MASK); + VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(I_VAR_LAST_REPEL_LURE_USED)) | REPEL_LURE_MASK); #endif } diff --git a/src/pokemon.c b/src/pokemon.c index 19498810a..2e6cee221 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -3308,6 +3308,8 @@ void CreateBoxMon(struct BoxPokemon *boxMon, u16 species, u8 level, u8 fixedIV, if (CheckBagHasItem(ITEM_SHINY_CHARM, 1)) totalRerolls += I_SHINY_CHARM_REROLLS; + if (LURE_STEP_COUNT != 0) + totalRerolls += 1; while (GET_SHINY_VALUE(value, personality) >= SHINY_ODDS && totalRerolls > 0) { diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 2a68f4e4d..bbf444d3a 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -212,7 +212,7 @@ static u8 ChooseWildMonIndex_Land(void) else wildMonIndex = 11; - if (LURE_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT)) && (Random() % 10 < 2)) + if (LURE_STEP_COUNT != 0 && (Random() % 10 < 2)) swap = TRUE; if (swap) @@ -239,7 +239,7 @@ static u8 ChooseWildMonIndex_WaterRock(void) else wildMonIndex = 4; - if (LURE_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT)) && (Random() % 10 < 2)) + if (LURE_STEP_COUNT != 0 && (Random() % 10 < 2)) swap = TRUE; if (swap) @@ -256,7 +256,7 @@ static u8 ChooseWildMonIndex_Fishing(u8 rod) u8 rand = Random() % max(max(ENCOUNTER_CHANCE_FISHING_MONS_OLD_ROD_TOTAL, ENCOUNTER_CHANCE_FISHING_MONS_GOOD_ROD_TOTAL), ENCOUNTER_CHANCE_FISHING_MONS_SUPER_ROD_TOTAL); - if (LURE_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT)) && (Random() % 10 < 2)) + if (LURE_STEP_COUNT != 0 && (Random() % 10 < 2)) swap = TRUE; switch (rod) @@ -556,7 +556,7 @@ static bool8 DoWildEncounterRateTest(u32 encounterRate, bool8 ignoreAbility) encounterRate = encounterRate * 80 / 100; ApplyFluteEncounterRateMod(&encounterRate); ApplyCleanseTagEncounterRateMod(&encounterRate); - if (LURE_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT)) != 0) + if (LURE_STEP_COUNT != 0) encounterRate *= 2; if (!ignoreAbility && !GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) { @@ -929,7 +929,7 @@ u16 GetLocalWaterMon(void) bool8 UpdateRepelCounter(void) { - u16 repelLureVar = VarGet(VAR_REPEL_LURE_STEP_COUNT); + u16 repelLureVar = VarGet(VAR_REPEL_STEP_COUNT); u16 steps = REPEL_LURE_STEPS(repelLureVar); bool32 isLure = IS_LAST_USED_LURE(repelLureVar); @@ -943,7 +943,7 @@ bool8 UpdateRepelCounter(void) steps--; if (!isLure) { - VarSet(VAR_REPEL_LURE_STEP_COUNT, steps); + VarSet(VAR_REPEL_STEP_COUNT, steps); if (steps == 0) { ScriptContext_SetupScript(EventScript_RepelWoreOff); @@ -952,7 +952,7 @@ bool8 UpdateRepelCounter(void) } else { - VarSet(VAR_REPEL_LURE_STEP_COUNT, steps | REPEL_LURE_MASK); + VarSet(VAR_REPEL_STEP_COUNT, steps | REPEL_LURE_MASK); if (steps == 0) { ScriptContext_SetupScript(EventScript_LureWoreOff); @@ -968,7 +968,7 @@ static bool8 IsWildLevelAllowedByRepel(u8 wildLevel) { u8 i; - if (!REPEL_STEPS(VarGet(VAR_REPEL_LURE_STEP_COUNT))) + if (!REPEL_STEP_COUNT) return TRUE; for (i = 0; i < PARTY_SIZE; i++) From ca048e1bc33717cc7ca332a012cfc67c78b10061 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Mon, 12 Sep 2022 10:18:09 -0300 Subject: [PATCH 30/58] Lures now increase the level of encountered mon to max + 1 --- src/wild_encounter.c | 95 +++++++++++++++++++++++++++++++------------- 1 file changed, 68 insertions(+), 27 deletions(-) diff --git a/src/wild_encounter.c b/src/wild_encounter.c index bbf444d3a..4a49efcbd 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -56,6 +56,7 @@ static void FeebasSeedRng(u16 seed); static bool8 IsWildLevelAllowedByRepel(u8 level); static void ApplyFluteEncounterRateMod(u32 *encRate); static void ApplyCleanseTagEncounterRateMod(u32 *encRate); +static u8 GetMaxLevelOfSpeciesInWildTable(const struct WildPokemon *wildMon, u16 species, u8 area); static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildMon, u8 type, u16 ability, u8 *monIndex); static bool8 IsAbilityAllowingEncounter(u8 level); @@ -300,41 +301,53 @@ static u8 ChooseWildMonIndex_Fishing(u8 rod) return wildMonIndex; } -static u8 ChooseWildMonLevel(const struct WildPokemon *wildPokemon) +static u8 ChooseWildMonLevel(const struct WildPokemon *wildPokemon, u8 wildMonIndex, u8 area) { u8 min; u8 max; u8 range; u8 rand; - // Make sure minimum level is less than maximum level - if (wildPokemon->maxLevel >= wildPokemon->minLevel) + if (LURE_STEP_COUNT == 0) { - min = wildPokemon->minLevel; - max = wildPokemon->maxLevel; + // Make sure minimum level is less than maximum level + if (wildPokemon[wildMonIndex].maxLevel >= wildPokemon[wildMonIndex].minLevel) + { + min = wildPokemon[wildMonIndex].minLevel; + max = wildPokemon[wildMonIndex].maxLevel; + } + else + { + min = wildPokemon[wildMonIndex].maxLevel; + max = wildPokemon[wildMonIndex].minLevel; + } + range = max - min + 1; + rand = Random() % range; + + // check ability for max level mon + if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) + { + u16 ability = GetMonAbility(&gPlayerParty[0]); + if (ability == ABILITY_HUSTLE || ability == ABILITY_VITAL_SPIRIT || ability == ABILITY_PRESSURE) + { + if (Random() % 2 == 0) + return max; + + if (rand != 0) + rand--; + } + } + return min + rand; } else { - min = wildPokemon->maxLevel; - max = wildPokemon->minLevel; + // Looks for the max level of all slots that share the same species as the selected slot. + max = GetMaxLevelOfSpeciesInWildTable(wildPokemon, wildPokemon[wildMonIndex].species, area); + if (max > 0) + return max + 1; + else // Failsafe + return wildPokemon[wildMonIndex].maxLevel + 1; } - range = max - min + 1; - rand = Random() % range; - - // check ability for max level mon - if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) - { - u16 ability = GetMonAbility(&gPlayerParty[0]); - if (ability == ABILITY_HUSTLE || ability == ABILITY_VITAL_SPIRIT || ability == ABILITY_PRESSURE) - { - if (Random() % 2 == 0) - return max; - - if (rand != 0) - rand--; - } - } - return min + rand; } static u16 GetCurrentMapWildMonHeaderId(void) @@ -496,7 +509,7 @@ static bool8 TryGenerateWildMon(const struct WildPokemonInfo *wildMonInfo, u8 ar break; } - level = ChooseWildMonLevel(&wildMonInfo->wildPokemon[wildMonIndex]); + level = ChooseWildMonLevel(wildMonInfo->wildPokemon, wildMonIndex, area); if (flags & WILD_CHECK_REPEL && !IsWildLevelAllowedByRepel(level)) return FALSE; if (gMapHeader.mapLayoutId != LAYOUT_BATTLE_FRONTIER_BATTLE_PIKE_ROOM_WILD_MONS && flags & WILD_CHECK_KEEN_EYE && !IsAbilityAllowingEncounter(level)) @@ -509,7 +522,7 @@ static bool8 TryGenerateWildMon(const struct WildPokemonInfo *wildMonInfo, u8 ar static u16 GenerateFishingWildMon(const struct WildPokemonInfo *wildMonInfo, u8 rod) { u8 wildMonIndex = ChooseWildMonIndex_Fishing(rod); - u8 level = ChooseWildMonLevel(&wildMonInfo->wildPokemon[wildMonIndex]); + u8 level = ChooseWildMonLevel(wildMonInfo->wildPokemon, wildMonIndex, WILD_AREA_FISHING); CreateWildMon(wildMonInfo->wildPokemon[wildMonIndex].species, level); return wildMonInfo->wildPokemon[wildMonIndex].species; @@ -862,7 +875,7 @@ void FishingWildEncounter(u8 rod) if (CheckFeebas() == TRUE) { - u8 level = ChooseWildMonLevel(&sWildFeebas); + u8 level = ChooseWildMonLevel(&sWildFeebas, 0, WILD_AREA_FISHING); species = sWildFeebas.species; CreateWildMon(species, level); @@ -1026,6 +1039,34 @@ static bool8 TryGetRandomWildMonIndexByType(const struct WildPokemon *wildMon, u return TRUE; } +#include "data.h" + +static u8 GetMaxLevelOfSpeciesInWildTable(const struct WildPokemon *wildMon, u16 species, u8 area) +{ + u8 i, maxLevel = 0, numMon = 0; + + switch (area) + { + case WILD_AREA_LAND: + numMon = LAND_WILD_COUNT; + break; + case WILD_AREA_WATER: + numMon = WATER_WILD_COUNT; + break; + case WILD_AREA_ROCKS: + numMon = ROCK_WILD_COUNT; + break; + } + + for (i = 0; i < numMon; i++) + { + if (wildMon[i].species == species && wildMon[i].maxLevel > maxLevel) + maxLevel = wildMon[i].maxLevel; + } + + return maxLevel; +} + static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildMon, u8 type, u16 ability, u8 *monIndex) { if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) From dc423ef7ff1ea54036e3655993af04e1e7487dd0 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 14 Sep 2022 00:17:04 -0300 Subject: [PATCH 31/58] Handling repel/lure menu --- data/scripts/repel.inc | 96 +++++++++++++++++++++++---------- include/constants/item_config.h | 8 +-- src/item_use.c | 16 +++--- src/script_menu.c | 82 ++++++++++++++++++++++++++-- 4 files changed, 160 insertions(+), 42 deletions(-) diff --git a/data/scripts/repel.inc b/data/scripts/repel.inc index c57004a3c..fc32df1d9 100644 --- a/data/scripts/repel.inc +++ b/data/scripts/repel.inc @@ -1,46 +1,64 @@ EventScript_RepelWoreOff:: - checkitem I_VAR_LAST_REPEL_LURE_USED, 1 - compare VAR_RESULT, TRUE - goto_if_eq EventScript_UseAnother +.if I_REPEL_LURE_MENU == TRUE + checkitem ITEM_REPEL, 1 + goto_if_eq VAR_RESULT, TRUE, EventScript_RepelUseAnother + checkitem ITEM_SUPER_REPEL, 1 + goto_if_eq VAR_RESULT, TRUE, EventScript_RepelUseAnother + checkitem ITEM_MAX_REPEL, 1 + goto_if_eq VAR_RESULT, TRUE, EventScript_RepelUseAnother +.else + checkitem VAR_LAST_REPEL_LURE_USED, 1 + goto_if_eq VAR_RESULT, TRUE, EventScript_RepelUseAnother +.endif lock msgbox Text_RepelWoreOff, MSGBOX_SIGN release end -EventScript_UseAnother: +EventScript_RepelUseAnother: lock - msgbox Text_UseAnother, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq EventScript_UsedRepel + msgbox Text_UseAnotherRepel, MSGBOX_YESNO +.if I_REPEL_LURE_MENU == TRUE + callnative TryDrawRepelMenu + goto_if_eq VAR_RESULT, FALSE, EventScript_RepelWoreOff_Chose + waitstate + goto_if_eq VAR_RESULT, 127, EventScript_RepelWoreOff_End +EventScript_RepelWoreOff_Chose: + callnative HandleRepelMenuChoice + bufferitemname 1, VAR_0x8004 + removeitem VAR_0x8004, 1 + playse SE_REPEL + msgbox Text_UsedNewRepelLure, MSGBOX_SIGN +.else + goto_if_eq VAR_RESULT, YES, EventScript_UsedRepel +.endif +EventScript_RepelWoreOff_End: release end EventScript_UsedRepel: - bufferitemname 0, I_VAR_LAST_REPEL_LURE_USED + bufferitemname 1, VAR_LAST_REPEL_LURE_USED playse SE_REPEL lock msgbox Text_UsedNewRepelLure, MSGBOX_SIGN - removeitem I_VAR_LAST_REPEL_LURE_USED, 1 + removeitem VAR_LAST_REPEL_LURE_USED, 1 waitse callnative HandleUseExpiredRepel release end -Text_RepelWoreOff: - .string "REPEL's effect wore off…$" - -Text_UseAnother:: - .string "REPEL's effect wore off!\n" - .string "Use another?$" - -Text_UsedNewRepelLure:: - .string "{PLAYER} used the\n" - .string "{STR_VAR_1}.$" - EventScript_LureWoreOff:: - checkitem I_VAR_LAST_REPEL_LURE_USED, 1 - compare VAR_RESULT, TRUE - goto_if_eq EventScript_LureUseAnother +.if I_REPEL_LURE_MENU == TRUE + checkitem ITEM_LURE, 1 + goto_if_eq VAR_RESULT, TRUE, EventScript_LureUseAnother + checkitem ITEM_SUPER_LURE, 1 + goto_if_eq VAR_RESULT, TRUE, EventScript_LureUseAnother + checkitem ITEM_MAX_LURE, 1 + goto_if_eq VAR_RESULT, TRUE, EventScript_LureUseAnother +.else + checkitem VAR_LAST_REPEL_LURE_USED, 1 + goto_if_eq VAR_RESULT, TRUE, EventScript_LureUseAnother +.endif lock msgbox Text_LureWoreOff, MSGBOX_SIGN release @@ -49,25 +67,49 @@ EventScript_LureWoreOff:: EventScript_LureUseAnother: lock msgbox Text_UseAnotherLure, MSGBOX_YESNO - compare VAR_RESULT, YES - goto_if_eq EventScript_UsedLure +.if I_REPEL_LURE_MENU == TRUE + callnative TryDrawLureMenu + goto_if_eq VAR_RESULT, FALSE, EventScript_LureWoreOff_Chose + waitstate + goto_if_eq VAR_RESULT, 127, EventScript_LureWoreOff_End +EventScript_LureWoreOff_Chose: + callnative HandleLureMenuChoice + bufferitemname 1, VAR_0x8004 + removeitem VAR_0x8004, 1 + playse SE_REPEL + msgbox Text_UsedNewRepelLure, MSGBOX_SIGN +.else + goto_if_eq VAR_RESULT, YES, EventScript_UsedLure +.endif +EventScript_LureWoreOff_End: release end EventScript_UsedLure: - bufferitemname 0, I_VAR_LAST_REPEL_LURE_USED + bufferitemname 1, VAR_LAST_REPEL_LURE_USED playse SE_REPEL lock msgbox Text_UsedNewRepelLure, MSGBOX_SIGN - removeitem I_VAR_LAST_REPEL_LURE_USED, 1 + removeitem VAR_LAST_REPEL_LURE_USED, 1 waitse callnative HandleUseExpiredLure release end +Text_RepelWoreOff: + .string "REPEL's effect wore off…$" + +Text_UseAnotherRepel:: + .string "REPEL's effect wore off!\n" + .string "Use another?$" + Text_LureWoreOff: .string "Lure's effect wore off…$" Text_UseAnotherLure:: .string "Lure's effect wore off!\n" .string "Use another?$" + +Text_UsedNewRepelLure:: + .string "{PLAYER} used the\n" + .string "{STR_VAR_2}.$" diff --git a/include/constants/item_config.h b/include/constants/item_config.h index 584970f84..e645b301d 100644 --- a/include/constants/item_config.h +++ b/include/constants/item_config.h @@ -9,9 +9,9 @@ #define I_SITRUS_BERRY_HEAL GEN_LATEST // In Gen4+, Sitrus Berry was changed from healing 30 HP to healing 25% of Max HP. #define I_VITAMIN_EV_CAP GEN_LATEST // In Gen8, the Vitamins no longer have a cap of 100 EV per stat. -// Var settings -// To use the following features, replace the 0s with the var ID you're assigning it to. -// Eg: Replace with VAR_UNUSED_0x40F7 so you can use I_VAR_LAST_REPEL_LURE_USED for that feature. -#define I_VAR_LAST_REPEL_LURE_USED 0 // If this var has been assigned, B2W2's Repel prompt will trigger once it runs out. It also applies to Lures. +// Repel/Lure config +// These two settings are both independent and complementary. +#define VAR_LAST_REPEL_LURE_USED 0 // If this var has been assigned, last Repel/Lure used will be saved and the player will get prompted with the vanilla repel YES/NO option, unless I_REPEL_LURE_MENU is set to TRUE. +#define I_REPEL_LURE_MENU TRUE // If TRUE, the player is able to choose which Repel/Lure to use once the previous one runs out. Cursor position is saved by VAR_LAST_REPEL_LURE_USED if not 0. #endif // GUARD_CONSTANTS_ITEM_CONFIG_H diff --git a/src/item_use.c b/src/item_use.c index e3d65d5a3..e91da96be 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -873,8 +873,8 @@ static void Task_UseRepel(u8 taskId) if (!IsSEPlaying()) { VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId)); - #if I_VAR_LAST_REPEL_LURE_USED != 0 - VarSet(I_VAR_LAST_REPEL_LURE_USED, gSpecialVar_ItemId); + #if VAR_LAST_REPEL_LURE_USED != 0 + VarSet(VAR_LAST_REPEL_LURE_USED, gSpecialVar_ItemId); #endif RemoveUsedItem(); if (!InBattlePyramid()) @@ -885,8 +885,8 @@ static void Task_UseRepel(u8 taskId) } void HandleUseExpiredRepel(void) { -#if I_VAR_LAST_REPEL_LURE_USED != 0 - VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(I_VAR_LAST_REPEL_LURE_USED))); +#if VAR_LAST_REPEL_LURE_USED != 0 + VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(VAR_LAST_REPEL_LURE_USED))); #endif } @@ -917,8 +917,8 @@ static void Task_UseLure(u8 taskId) if (!IsSEPlaying()) { VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_ItemId) | REPEL_LURE_MASK); - #if I_VAR_LAST_REPEL_LURE_USED != 0 - VarSet(I_VAR_LAST_REPEL_LURE_USED, gSpecialVar_ItemId); + #if VAR_LAST_REPEL_LURE_USED != 0 + VarSet(VAR_LAST_REPEL_LURE_USED, gSpecialVar_ItemId); #endif RemoveUsedItem(); if (!InBattlePyramid()) @@ -930,8 +930,8 @@ static void Task_UseLure(u8 taskId) void HandleUseExpiredLure(void) { -#if I_VAR_LAST_REPEL_LURE_USED != 0 - VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(I_VAR_LAST_REPEL_LURE_USED)) | REPEL_LURE_MASK); +#if VAR_LAST_REPEL_LURE_USED != 0 + VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(VarGet(VAR_LAST_REPEL_LURE_USED)) | REPEL_LURE_MASK); #endif } diff --git a/src/script_menu.c b/src/script_menu.c index d25f28cb2..d411f4a1c 100644 --- a/src/script_menu.c +++ b/src/script_menu.c @@ -90,12 +90,10 @@ static u16 GetLengthWithExpandedPlayerName(const u8 *str) return length; } -static void DrawMultichoiceMenu(u8 left, u8 top, u8 multichoiceId, bool8 ignoreBPress, u8 cursorPos) +static void DrawMultichoiceMenuInternal(u8 left, u8 top, u8 multichoiceId, bool8 ignoreBPress, u8 cursorPos, const struct MenuAction *actions, int count) { int i; u8 windowId; - u8 count = sMultichoiceLists[multichoiceId].count; - const struct MenuAction *actions = sMultichoiceLists[multichoiceId].list; int width = 0; u8 newWidth; @@ -114,6 +112,84 @@ static void DrawMultichoiceMenu(u8 left, u8 top, u8 multichoiceId, bool8 ignoreB InitMultichoiceCheckWrap(ignoreBPress, count, windowId, multichoiceId); } +static void DrawMultichoiceMenu(u8 left, u8 top, u8 multichoiceId, bool8 ignoreBPress, u8 cursorPos) +{ + DrawMultichoiceMenuInternal(left, top, multichoiceId, ignoreBPress, cursorPos, sMultichoiceLists[multichoiceId].list, sMultichoiceLists[multichoiceId].count); +} + +#if I_REPEL_LURE_MENU == TRUE +void TryDrawRepelMenu(void) +{ + static const u16 repelItems[] = {ITEM_REPEL, ITEM_SUPER_REPEL, ITEM_MAX_REPEL}; + struct MenuAction menuItems[ARRAY_COUNT(repelItems) + 1] = {NULL}; + int i, count = 0, menuPos = 0; + + for (i = 0; i < ARRAY_COUNT(repelItems); i++) + { + if (CheckBagHasItem(repelItems[i], 1)) + { + VarSet(VAR_0x8004 + count, repelItems[i]); + #if VAR_LAST_REPEL_LURE_USED != 0 + if (VarGet(VAR_LAST_REPEL_LURE_USED) == repelItems[i]) + menuPos = count; + #endif + menuItems[count].text = ItemId_GetName(repelItems[i]); + count++; + } + } + + if (count > 1) + DrawMultichoiceMenuInternal(0, 0, 0, FALSE, menuPos, menuItems, count); + + gSpecialVar_Result = (count > 1); +} + +void HandleRepelMenuChoice(void) +{ + gSpecialVar_0x8004 = VarGet(VAR_0x8004 + gSpecialVar_Result); // Get item Id; + VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_0x8004)); +#if VAR_LAST_REPEL_LURE_USED != 0 + VarSet(VAR_LAST_REPEL_LURE_USED, gSpecialVar_0x8004); +#endif +} + +void TryDrawLureMenu(void) +{ + static const u16 lureItems[] = {ITEM_LURE, ITEM_SUPER_LURE, ITEM_MAX_LURE}; + struct MenuAction menuItems[ARRAY_COUNT(lureItems) + 1] = {NULL}; + int i, count = 0, menuPos = 0; + + + for (i = 0; i < ARRAY_COUNT(lureItems); i++) + { + if (CheckBagHasItem(lureItems[i], 1)) + { + VarSet(VAR_0x8004 + count, lureItems[i]); + #if VAR_LAST_REPEL_LURE_USED != 0 + if (VarGet(VAR_LAST_REPEL_LURE_USED) == lureItems[i]) + menuPos = count; + #endif + menuItems[count].text = ItemId_GetName(lureItems[i]); + count++; + } + } + + if (count > 1) + DrawMultichoiceMenuInternal(0, 0, 0, FALSE, menuPos, menuItems, count); + + gSpecialVar_Result = (count > 1); +} + +void HandleLureMenuChoice(void) +{ + gSpecialVar_0x8004 = VarGet(VAR_0x8004 + gSpecialVar_Result); // Get item Id; + VarSet(VAR_REPEL_STEP_COUNT, ItemId_GetHoldEffectParam(gSpecialVar_0x8004) | REPEL_LURE_MASK); +#if VAR_LAST_REPEL_LURE_USED != 0 + VarSet(VAR_LAST_REPEL_LURE_USED, gSpecialVar_0x8004); +#endif +} +#endif //I_REPEL_LURE_MENU == TRUE + #define tLeft data[0] #define tTop data[1] #define tRight data[2] From b0bd5f98798fc6f009605cdfe607c47efcda4237 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 16 Sep 2022 14:42:11 -0300 Subject: [PATCH 32/58] Cleaned up trailing spaces and spaces instead of tabs --- src/wild_encounter.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 4a49efcbd..a87b04252 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -71,7 +71,7 @@ static const struct WildPokemon sWildFeebas = {20, 25, SPECIES_FEEBAS}; static const u16 sRoute119WaterTileData[] = { -//yMin, yMax, numSpots in previous sections +//yMin, yMax, numSpots in previous sections 0, 45, 0, 46, 91, NUM_FISHING_SPOTS_1, 92, 139, NUM_FISHING_SPOTS_1 + NUM_FISHING_SPOTS_2, @@ -149,7 +149,7 @@ static bool8 CheckFeebas(void) feebasSpots[i] = FeebasRandom() % NUM_FISHING_SPOTS; if (feebasSpots[i] == 0) feebasSpots[i] = NUM_FISHING_SPOTS; - + // < 1 below is a pointless check, it will never be TRUE. // >= 4 to skip fishing spots 1-3, because these are inaccessible // spots at the top of the map, at (9,7), (7,13), and (15,16). @@ -184,8 +184,8 @@ static void FeebasSeedRng(u16 seed) // LAND_WILD_COUNT static u8 ChooseWildMonIndex_Land(void) { - u8 wildMonIndex = 0; - bool8 swap = FALSE; + u8 wildMonIndex = 0; + bool8 swap = FALSE; u8 rand = Random() % ENCOUNTER_CHANCE_LAND_MONS_TOTAL; if (rand < ENCOUNTER_CHANCE_LAND_MONS_SLOT_0) @@ -216,17 +216,17 @@ static u8 ChooseWildMonIndex_Land(void) if (LURE_STEP_COUNT != 0 && (Random() % 10 < 2)) swap = TRUE; - if (swap) - wildMonIndex = 11 - wildMonIndex; + if (swap) + wildMonIndex = 11 - wildMonIndex; - return wildMonIndex; + return wildMonIndex; } // ROCK_WILD_COUNT / WATER_WILD_COUNT static u8 ChooseWildMonIndex_WaterRock(void) { - u8 wildMonIndex = 0; - bool8 swap = FALSE; + u8 wildMonIndex = 0; + bool8 swap = FALSE; u8 rand = Random() % ENCOUNTER_CHANCE_WATER_MONS_TOTAL; if (rand < ENCOUNTER_CHANCE_WATER_MONS_SLOT_0) @@ -243,17 +243,17 @@ static u8 ChooseWildMonIndex_WaterRock(void) if (LURE_STEP_COUNT != 0 && (Random() % 10 < 2)) swap = TRUE; - if (swap) - wildMonIndex = 4 - wildMonIndex; + if (swap) + wildMonIndex = 4 - wildMonIndex; - return wildMonIndex; + return wildMonIndex; } // FISH_WILD_COUNT static u8 ChooseWildMonIndex_Fishing(u8 rod) { u8 wildMonIndex = 0; - bool8 swap = FALSE; + bool8 swap = FALSE; u8 rand = Random() % max(max(ENCOUNTER_CHANCE_FISHING_MONS_OLD_ROD_TOTAL, ENCOUNTER_CHANCE_FISHING_MONS_GOOD_ROD_TOTAL), ENCOUNTER_CHANCE_FISHING_MONS_SUPER_ROD_TOTAL); @@ -269,8 +269,8 @@ static u8 ChooseWildMonIndex_Fishing(u8 rod) wildMonIndex = 1; break; - if (swap) - wildMonIndex = 1 - wildMonIndex; + if (swap) + wildMonIndex = 1 - wildMonIndex; case GOOD_ROD: if (rand < ENCOUNTER_CHANCE_FISHING_MONS_GOOD_ROD_SLOT_2) wildMonIndex = 2; @@ -279,8 +279,8 @@ static u8 ChooseWildMonIndex_Fishing(u8 rod) if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_GOOD_ROD_SLOT_3 && rand < ENCOUNTER_CHANCE_FISHING_MONS_GOOD_ROD_SLOT_4) wildMonIndex = 4; - if (swap) - wildMonIndex = 6 - wildMonIndex; + if (swap) + wildMonIndex = 6 - wildMonIndex; break; case SUPER_ROD: if (rand < ENCOUNTER_CHANCE_FISHING_MONS_SUPER_ROD_SLOT_5) @@ -294,8 +294,8 @@ static u8 ChooseWildMonIndex_Fishing(u8 rod) if (rand >= ENCOUNTER_CHANCE_FISHING_MONS_SUPER_ROD_SLOT_8 && rand < ENCOUNTER_CHANCE_FISHING_MONS_SUPER_ROD_SLOT_9) wildMonIndex = 9; - if (swap) - wildMonIndex = 14 - wildMonIndex; + if (swap) + wildMonIndex = 14 - wildMonIndex; break; } return wildMonIndex; From b2b308fe9ec6129439c302b9ca779ebdce174eeb Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 16 Sep 2022 15:16:51 -0300 Subject: [PATCH 33/58] Fixed Old Rod Lure swap --- src/wild_encounter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wild_encounter.c b/src/wild_encounter.c index a87b04252..69f60182f 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -267,10 +267,10 @@ static u8 ChooseWildMonIndex_Fishing(u8 rod) wildMonIndex = 0; else wildMonIndex = 1; - break; if (swap) wildMonIndex = 1 - wildMonIndex; + break; case GOOD_ROD: if (rand < ENCOUNTER_CHANCE_FISHING_MONS_GOOD_ROD_SLOT_2) wildMonIndex = 2; From f79205af084e8ac0a14cbbcd2f49b3f532dd423c Mon Sep 17 00:00:00 2001 From: tennis Date: Thu, 13 Oct 2022 15:32:08 +0100 Subject: [PATCH 34/58] Fix bug where badge boost flag is inverted --- src/battle_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index d83f8429e..9dbdb1abf 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -9852,7 +9852,7 @@ bool32 SetIllusionMon(struct Pokemon *mon, u32 battlerId) bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId) { -#if B_BADGE_BOOST != GEN_3 +#if B_BADGE_BOOST == GEN_3 if (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_EREADER_TRAINER | BATTLE_TYPE_RECORDED_LINK | BATTLE_TYPE_FRONTIER)) return FALSE; else if (GetBattlerSide(battlerId) != B_SIDE_PLAYER) From db013aab0b2a975e0675e32fff458c4bc3ff37d1 Mon Sep 17 00:00:00 2001 From: tennis Date: Thu, 13 Oct 2022 15:58:57 +0100 Subject: [PATCH 35/58] Fix AI issue giving decrementing score to confuse hit instead of confuse --- src/battle_ai_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 344dd1657..113d5d3e0 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1333,7 +1333,7 @@ bool32 IsConfusionMoveEffect(u16 moveEffect) { switch (moveEffect) { - case EFFECT_CONFUSE_HIT: + case EFFECT_CONFUSE: case EFFECT_SWAGGER: case EFFECT_FLATTER: case EFFECT_TEETER_DANCE: From 90f79999bb9cd067a02379600da8b142afaff04f Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Thu, 13 Oct 2022 12:18:20 -0300 Subject: [PATCH 36/58] =?UTF-8?q?Added=20class-based=20Pok=C3=A9=20Balls?= =?UTF-8?q?=20for=20trainers=20Thanks=20to=20Ghoulslash=20for=20helping=20?= =?UTF-8?q?me=20optimizing=20things.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/constants/battle_config.h | 1 + include/constants/trainers.h | 1 + src/battle_main.c | 32 +++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index ebdd7dfc8..21e203682 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -175,6 +175,7 @@ #define B_EVOLUTION_AFTER_WHITEOUT GEN_LATEST // In Gen6+, Pokemon that qualify for evolution after battle will evolve even if the player loses. #define B_WILD_NATURAL_ENEMIES TRUE // If set to TRUE, certain wild mon species will attack other species when partnered in double wild battles (eg. Zangoose vs Seviper) #define B_AFFECTION_MECHANICS FALSE // In Gen6+, there's a stat called affection that can trigger different effects in battle. From LGPE onwards, those effects use friendship instead. +#define B_TRAINER_CLASS_POKE_BALLS GEN_LATEST // In Gen7+, trainers will use certain types of Poké Balls depending on their trainer class. // Animation Settings #define B_NEW_SWORD_PARTICLE FALSE // If set to TRUE, it updates Swords Dance's particle. diff --git a/include/constants/trainers.h b/include/constants/trainers.h index 09ae72011..39ca2a2b8 100644 --- a/include/constants/trainers.h +++ b/include/constants/trainers.h @@ -352,6 +352,7 @@ #define TRAINER_CLASS_PIKE_QUEEN 0x3f #define TRAINER_CLASS_PYRAMID_KING 0x40 #define TRAINER_CLASS_RS_PROTAG 0x41 +#define TRAINER_CLASS_COUNT 0x42 #define TRAINER_ENCOUNTER_MUSIC_MALE 0 // standard male encounter music #define TRAINER_ENCOUNTER_MUSIC_FEMALE 1 // standard female encounter music diff --git a/src/battle_main.c b/src/battle_main.c index e79879662..385faf2e3 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -392,6 +392,32 @@ const struct TrainerMoney gTrainerMoneyTable[] = {0xFF, 5}, // Any trainer class not listed above uses this }; +#if B_TRAINER_CLASS_POKE_BALLS >= GEN_7 +static const u16 sTrainerBallTable[TRAINER_CLASS_COUNT] = +{ +#if B_TRAINER_CLASS_POKE_BALLS == GEN_7 + [TRAINER_CLASS_PKMN_BREEDER] = ITEM_FRIEND_BALL, +#elif B_TRAINER_CLASS_POKE_BALLS == GEN_8 + [TRAINER_CLASS_PKMN_BREEDER] = ITEM_HEAL_BALL, +#endif + [TRAINER_CLASS_COOLTRAINER] = ITEM_ULTRA_BALL, + [TRAINER_CLASS_COLLECTOR] = ITEM_PREMIER_BALL, + [TRAINER_CLASS_SWIMMER_M] = ITEM_DIVE_BALL, + [TRAINER_CLASS_BLACK_BELT] = ITEM_ULTRA_BALL, + [TRAINER_CLASS_AQUA_LEADER] = ITEM_MASTER_BALL, + [TRAINER_CLASS_GENTLEMAN] = ITEM_LUXURY_BALL, + [TRAINER_CLASS_ELITE_FOUR] = ITEM_ULTRA_BALL, +#if B_TRAINER_CLASS_POKE_BALLS == GEN_7 + [TRAINER_CLASS_FISHERMAN] = ITEM_LURE_BALL, +#elif B_TRAINER_CLASS_POKE_BALLS == GEN_8 + [TRAINER_CLASS_FISHERMAN] = ITEM_DIVE_BALL, +#endif + [TRAINER_CLASS_SWIMMER_F] = ITEM_DIVE_BALL, + [TRAINER_CLASS_COOLTRAINER_2] = ITEM_ULTRA_BALL, + [TRAINER_CLASS_MAGMA_LEADER] = ITEM_MASTER_BALL, +}; +#endif + #include "data/text/abilities.h" static void (* const sTurnActionsFuncsTable[])(void) = @@ -1847,6 +1873,7 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir u8 fixedIV; s32 i, j; u8 monsCount; + u16 ball; if (trainerNum == TRAINER_SECRET_BASE) return 0; @@ -1950,6 +1977,11 @@ static u8 CreateNPCTrainerParty(struct Pokemon *party, u16 trainerNum, bool8 fir break; } } + + #if B_TRAINER_CLASS_POKE_BALLS >= GEN_7 + ball = (sTrainerBallTable[gTrainers[trainerNum].trainerClass]) ? sTrainerBallTable[gTrainers[trainerNum].trainerClass] : ITEM_POKE_BALL; + SetMonData(&party[i], MON_DATA_POKEBALL, &ball); + #endif } gBattleTypeFlags |= gTrainers[trainerNum].doubleBattle; From 8a1a561b80defb27ce53c31afde51d830877a813 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 14 Oct 2022 11:28:15 -0300 Subject: [PATCH 37/58] Uncommented evo moves for each species --- src/data/pokemon/level_up_learnsets.h | 494 +++++++++++++------------- 1 file changed, 247 insertions(+), 247 deletions(-) diff --git a/src/data/pokemon/level_up_learnsets.h b/src/data/pokemon/level_up_learnsets.h index b501d9aae..bdcec3090 100644 --- a/src/data/pokemon/level_up_learnsets.h +++ b/src/data/pokemon/level_up_learnsets.h @@ -39,7 +39,7 @@ static const struct LevelUpMove sIvysaurLevelUpLearnset[] = { }; static const struct LevelUpMove sVenusaurLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PETAL_DANCE), + LEVEL_UP_MOVE( 0, MOVE_PETAL_DANCE), LEVEL_UP_MOVE( 1, MOVE_PETAL_DANCE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_GROWL), @@ -96,7 +96,7 @@ static const struct LevelUpMove sCharmeleonLevelUpLearnset[] = { }; static const struct LevelUpMove sCharizardLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_WING_ATTACK), + LEVEL_UP_MOVE( 0, MOVE_WING_ATTACK), LEVEL_UP_MOVE( 1, MOVE_WING_ATTACK), LEVEL_UP_MOVE( 1, MOVE_FLARE_BLITZ), LEVEL_UP_MOVE( 1, MOVE_HEAT_WAVE), @@ -189,13 +189,13 @@ static const struct LevelUpMove sCaterpieLevelUpLearnset[] = { }; static const struct LevelUpMove sMetapodLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HARDEN), + LEVEL_UP_MOVE( 0, MOVE_HARDEN), LEVEL_UP_MOVE( 1, MOVE_HARDEN), LEVEL_UP_END }; static const struct LevelUpMove sButterfreeLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_GUST), + LEVEL_UP_MOVE( 0, MOVE_GUST), LEVEL_UP_MOVE( 1, MOVE_GUST), LEVEL_UP_MOVE( 1, MOVE_CONFUSION), LEVEL_UP_MOVE(11, MOVE_CONFUSION), @@ -224,13 +224,13 @@ static const struct LevelUpMove sWeedleLevelUpLearnset[] = { }; static const struct LevelUpMove sKakunaLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HARDEN), + LEVEL_UP_MOVE( 0, MOVE_HARDEN), LEVEL_UP_MOVE( 1, MOVE_HARDEN), LEVEL_UP_END }; static const struct LevelUpMove sBeedrillLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_TWINEEDLE), + LEVEL_UP_MOVE( 0, MOVE_TWINEEDLE), LEVEL_UP_MOVE( 1, MOVE_TWINEEDLE), LEVEL_UP_MOVE( 1, MOVE_FURY_ATTACK), LEVEL_UP_MOVE(11, MOVE_FURY_ATTACK), @@ -326,7 +326,7 @@ static const struct LevelUpMove sRattataLevelUpLearnset[] = { }; static const struct LevelUpMove sRaticateLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SCARY_FACE), + LEVEL_UP_MOVE( 0, MOVE_SCARY_FACE), LEVEL_UP_MOVE( 1, MOVE_SCARY_FACE), LEVEL_UP_MOVE( 1, MOVE_SWORDS_DANCE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -406,7 +406,7 @@ static const struct LevelUpMove sEkansLevelUpLearnset[] = { }; static const struct LevelUpMove sArbokLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CRUNCH), + LEVEL_UP_MOVE( 0, MOVE_CRUNCH), LEVEL_UP_MOVE( 1, MOVE_CRUNCH), LEVEL_UP_MOVE( 1, MOVE_ICE_FANG), LEVEL_UP_MOVE( 1, MOVE_THUNDER_FANG), @@ -485,7 +485,7 @@ static const struct LevelUpMove sSandshrewLevelUpLearnset[] = { }; static const struct LevelUpMove sSandslashLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CRUSH_CLAW), + LEVEL_UP_MOVE( 0, MOVE_CRUSH_CLAW), LEVEL_UP_MOVE( 1, MOVE_CRUSH_CLAW), LEVEL_UP_MOVE( 1, MOVE_SCRATCH), LEVEL_UP_MOVE( 1, MOVE_DEFENSE_CURL), @@ -857,7 +857,7 @@ static const struct LevelUpMove sVenonatLevelUpLearnset[] = { }; static const struct LevelUpMove sVenomothLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_GUST), + LEVEL_UP_MOVE( 0, MOVE_GUST), LEVEL_UP_MOVE( 1, MOVE_GUST), LEVEL_UP_MOVE( 1, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_BUG_BUZZ), @@ -901,7 +901,7 @@ static const struct LevelUpMove sDiglettLevelUpLearnset[] = { }; static const struct LevelUpMove sDugtrioLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SAND_TOMB), + LEVEL_UP_MOVE( 0, MOVE_SAND_TOMB), LEVEL_UP_MOVE( 1, MOVE_SAND_TOMB), LEVEL_UP_MOVE( 1, MOVE_ROTOTILLER), LEVEL_UP_MOVE( 1, MOVE_NIGHT_SLASH), @@ -944,7 +944,7 @@ static const struct LevelUpMove sMeowthLevelUpLearnset[] = { }; static const struct LevelUpMove sPersianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SWIFT), + LEVEL_UP_MOVE( 0, MOVE_SWIFT), LEVEL_UP_MOVE( 1, MOVE_SWIFT), LEVEL_UP_MOVE( 1, MOVE_PLAY_ROUGH), LEVEL_UP_MOVE( 1, MOVE_SWITCHEROO), @@ -1036,7 +1036,7 @@ static const struct LevelUpMove sMankeyLevelUpLearnset[] = { }; static const struct LevelUpMove sPrimeapeLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_RAGE), + LEVEL_UP_MOVE( 0, MOVE_RAGE), LEVEL_UP_MOVE( 1, MOVE_RAGE), LEVEL_UP_MOVE( 1, MOVE_FINAL_GAMBIT), LEVEL_UP_MOVE( 1, MOVE_FLING), @@ -1130,7 +1130,7 @@ static const struct LevelUpMove sPoliwhirlLevelUpLearnset[] = { }; static const struct LevelUpMove sPoliwrathLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SUBMISSION), + LEVEL_UP_MOVE( 0, MOVE_SUBMISSION), LEVEL_UP_MOVE( 1, MOVE_SUBMISSION), LEVEL_UP_MOVE( 1, MOVE_CIRCLE_THROW), LEVEL_UP_MOVE( 1, MOVE_BUBBLE_BEAM), @@ -1148,7 +1148,7 @@ static const struct LevelUpMove sAbraLevelUpLearnset[] = { }; static const struct LevelUpMove sKadabraLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_KINESIS), + LEVEL_UP_MOVE( 0, MOVE_KINESIS), LEVEL_UP_MOVE( 1, MOVE_KINESIS), LEVEL_UP_MOVE( 1, MOVE_TELEPORT), LEVEL_UP_MOVE( 1, MOVE_CONFUSION), @@ -1169,7 +1169,7 @@ static const struct LevelUpMove sKadabraLevelUpLearnset[] = { }; static const struct LevelUpMove sAlakazamLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_KINESIS), + LEVEL_UP_MOVE( 0, MOVE_KINESIS), LEVEL_UP_MOVE( 1, MOVE_KINESIS), LEVEL_UP_MOVE( 1, MOVE_TELEPORT), LEVEL_UP_MOVE( 1, MOVE_CONFUSION), @@ -1234,7 +1234,7 @@ static const struct LevelUpMove sMachokeLevelUpLearnset[] = { }; static const struct LevelUpMove sMachampLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_STRENGTH), + LEVEL_UP_MOVE( 0, MOVE_STRENGTH), LEVEL_UP_MOVE( 1, MOVE_STRENGTH), LEVEL_UP_MOVE( 1, MOVE_WIDE_GUARD), LEVEL_UP_MOVE( 1, MOVE_LOW_KICK), @@ -1298,7 +1298,7 @@ static const struct LevelUpMove sWeepinbellLevelUpLearnset[] = { }; static const struct LevelUpMove sVictreebelLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_LEAF_TORNADO), + LEVEL_UP_MOVE( 0, MOVE_LEAF_TORNADO), LEVEL_UP_MOVE( 1, MOVE_LEAF_TORNADO), LEVEL_UP_MOVE( 1, MOVE_STOCKPILE), LEVEL_UP_MOVE( 1, MOVE_SWALLOW), @@ -1444,7 +1444,7 @@ static const struct LevelUpMove sPonytaLevelUpLearnset[] = { }; static const struct LevelUpMove sRapidashLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FURY_ATTACK), + LEVEL_UP_MOVE( 0, MOVE_FURY_ATTACK), LEVEL_UP_MOVE( 1, MOVE_FURY_ATTACK), LEVEL_UP_MOVE( 1, MOVE_POISON_JAB), LEVEL_UP_MOVE( 1, MOVE_MEGAHORN), @@ -1488,7 +1488,7 @@ static const struct LevelUpMove sSlowpokeLevelUpLearnset[] = { }; static const struct LevelUpMove sSlowbroLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_WITHDRAW), + LEVEL_UP_MOVE( 0, MOVE_WITHDRAW), LEVEL_UP_MOVE( 1, MOVE_WITHDRAW), LEVEL_UP_MOVE( 1, MOVE_HEAL_PULSE), LEVEL_UP_MOVE( 1, MOVE_CURSE), @@ -1534,7 +1534,7 @@ static const struct LevelUpMove sMagnemiteLevelUpLearnset[] = { }; static const struct LevelUpMove sMagnetonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_TRI_ATTACK), + LEVEL_UP_MOVE( 0, MOVE_TRI_ATTACK), LEVEL_UP_MOVE( 1, MOVE_TRI_ATTACK), LEVEL_UP_MOVE( 1, MOVE_ZAP_CANNON), LEVEL_UP_MOVE( 1, MOVE_ELECTRIC_TERRAIN), @@ -1605,7 +1605,7 @@ static const struct LevelUpMove sDoduoLevelUpLearnset[] = { }; static const struct LevelUpMove sDodrioLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_TRI_ATTACK), + LEVEL_UP_MOVE( 0, MOVE_TRI_ATTACK), LEVEL_UP_MOVE( 1, MOVE_TRI_ATTACK), LEVEL_UP_MOVE( 1, MOVE_PECK), LEVEL_UP_MOVE( 1, MOVE_GROWL), @@ -1650,7 +1650,7 @@ static const struct LevelUpMove sSeelLevelUpLearnset[] = { }; static const struct LevelUpMove sDewgongLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SHEER_COLD), + LEVEL_UP_MOVE( 0, MOVE_SHEER_COLD), LEVEL_UP_MOVE( 1, MOVE_SHEER_COLD), LEVEL_UP_MOVE( 1, MOVE_HEADBUTT), LEVEL_UP_MOVE( 1, MOVE_GROWL), @@ -1696,7 +1696,7 @@ static const struct LevelUpMove sGrimerLevelUpLearnset[] = { }; static const struct LevelUpMove sMukLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_VENOM_DRENCH), + LEVEL_UP_MOVE( 0, MOVE_VENOM_DRENCH), LEVEL_UP_MOVE( 1, MOVE_VENOM_DRENCH), LEVEL_UP_MOVE( 1, MOVE_POUND), LEVEL_UP_MOVE( 1, MOVE_POISON_GAS), @@ -1774,7 +1774,7 @@ static const struct LevelUpMove sGastlyLevelUpLearnset[] = { }; static const struct LevelUpMove sHaunterLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SHADOW_PUNCH), + LEVEL_UP_MOVE( 0, MOVE_SHADOW_PUNCH), LEVEL_UP_MOVE( 1, MOVE_SHADOW_PUNCH), LEVEL_UP_MOVE( 1, MOVE_HYPNOSIS), LEVEL_UP_MOVE( 1, MOVE_LICK), @@ -1796,7 +1796,7 @@ static const struct LevelUpMove sHaunterLevelUpLearnset[] = { }; static const struct LevelUpMove sGengarLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SHADOW_PUNCH), + LEVEL_UP_MOVE( 0, MOVE_SHADOW_PUNCH), LEVEL_UP_MOVE( 1, MOVE_SHADOW_PUNCH), LEVEL_UP_MOVE( 1, MOVE_HYPNOSIS), LEVEL_UP_MOVE( 1, MOVE_LICK), @@ -1997,7 +1997,7 @@ static const struct LevelUpMove sExeggcuteLevelUpLearnset[] = { }; static const struct LevelUpMove sExeggutorLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_STOMP), + LEVEL_UP_MOVE( 0, MOVE_STOMP), LEVEL_UP_MOVE( 1, MOVE_STOMP), LEVEL_UP_MOVE( 1, MOVE_SEED_BOMB), LEVEL_UP_MOVE( 1, MOVE_BARRAGE), @@ -2054,7 +2054,7 @@ static const struct LevelUpMove sMarowakLevelUpLearnset[] = { }; static const struct LevelUpMove sHitmonleeLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DOUBLE_KICK), + LEVEL_UP_MOVE( 0, MOVE_DOUBLE_KICK), LEVEL_UP_MOVE( 1, MOVE_DOUBLE_KICK), LEVEL_UP_MOVE( 1, MOVE_REVERSAL), LEVEL_UP_MOVE( 1, MOVE_CLOSE_COMBAT), @@ -2082,7 +2082,7 @@ static const struct LevelUpMove sHitmonleeLevelUpLearnset[] = { }; static const struct LevelUpMove sHitmonchanLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_COMET_PUNCH), + LEVEL_UP_MOVE( 0, MOVE_COMET_PUNCH), LEVEL_UP_MOVE( 1, MOVE_COMET_PUNCH), LEVEL_UP_MOVE( 1, MOVE_CLOSE_COMBAT), LEVEL_UP_MOVE( 1, MOVE_COUNTER), @@ -2149,7 +2149,7 @@ static const struct LevelUpMove sKoffingLevelUpLearnset[] = { }; static const struct LevelUpMove sWeezingLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DOUBLE_HIT), + LEVEL_UP_MOVE( 0, MOVE_DOUBLE_HIT), LEVEL_UP_MOVE( 1, MOVE_DOUBLE_HIT), LEVEL_UP_MOVE( 1, MOVE_POISON_GAS), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -2191,7 +2191,7 @@ static const struct LevelUpMove sRhyhornLevelUpLearnset[] = { }; static const struct LevelUpMove sRhydonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HAMMER_ARM), + LEVEL_UP_MOVE( 0, MOVE_HAMMER_ARM), LEVEL_UP_MOVE( 1, MOVE_HAMMER_ARM), LEVEL_UP_MOVE( 1, MOVE_HORN_DRILL), LEVEL_UP_MOVE( 1, MOVE_HORN_ATTACK), @@ -2547,7 +2547,7 @@ static const struct LevelUpMove sMagikarpLevelUpLearnset[] = { }; static const struct LevelUpMove sGyaradosLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BITE), + LEVEL_UP_MOVE( 0, MOVE_BITE), LEVEL_UP_MOVE( 1, MOVE_BITE), LEVEL_UP_MOVE( 1, MOVE_THRASH), LEVEL_UP_MOVE(21, MOVE_LEER), @@ -2611,7 +2611,7 @@ static const struct LevelUpMove sEeveeLevelUpLearnset[] = { }; static const struct LevelUpMove sVaporeonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_WATER_GUN), + LEVEL_UP_MOVE( 0, MOVE_WATER_GUN), LEVEL_UP_MOVE( 1, MOVE_WATER_GUN), LEVEL_UP_MOVE( 1, MOVE_HELPING_HAND), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -2631,7 +2631,7 @@ static const struct LevelUpMove sVaporeonLevelUpLearnset[] = { }; static const struct LevelUpMove sJolteonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_THUNDER_SHOCK), + LEVEL_UP_MOVE( 0, MOVE_THUNDER_SHOCK), LEVEL_UP_MOVE( 1, MOVE_THUNDER_SHOCK), LEVEL_UP_MOVE( 1, MOVE_HELPING_HAND), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -2651,7 +2651,7 @@ static const struct LevelUpMove sJolteonLevelUpLearnset[] = { }; static const struct LevelUpMove sFlareonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_EMBER), + LEVEL_UP_MOVE( 0, MOVE_EMBER), LEVEL_UP_MOVE( 1, MOVE_EMBER), LEVEL_UP_MOVE( 1, MOVE_HELPING_HAND), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -2708,7 +2708,7 @@ static const struct LevelUpMove sOmanyteLevelUpLearnset[] = { }; static const struct LevelUpMove sOmastarLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SPIKE_CANNON), + LEVEL_UP_MOVE( 0, MOVE_SPIKE_CANNON), LEVEL_UP_MOVE( 1, MOVE_SPIKE_CANNON), LEVEL_UP_MOVE( 1, MOVE_HYDRO_PUMP), LEVEL_UP_MOVE( 1, MOVE_CONSTRICT), @@ -2746,7 +2746,7 @@ static const struct LevelUpMove sKabutoLevelUpLearnset[] = { }; static const struct LevelUpMove sKabutopsLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SLASH), + LEVEL_UP_MOVE( 0, MOVE_SLASH), LEVEL_UP_MOVE( 1, MOVE_SLASH), LEVEL_UP_MOVE( 1, MOVE_NIGHT_SLASH), LEVEL_UP_MOVE( 1, MOVE_FEINT), @@ -2910,7 +2910,7 @@ static const struct LevelUpMove sDragonairLevelUpLearnset[] = { }; static const struct LevelUpMove sDragoniteLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_WING_ATTACK), + LEVEL_UP_MOVE( 0, MOVE_WING_ATTACK), LEVEL_UP_MOVE( 1, MOVE_WING_ATTACK), LEVEL_UP_MOVE( 1, MOVE_HURRICANE), LEVEL_UP_MOVE( 1, MOVE_FIRE_PUNCH), @@ -3016,7 +3016,7 @@ static const struct LevelUpMove sBayleefLevelUpLearnset[] = { }; static const struct LevelUpMove sMeganiumLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PETAL_DANCE), + LEVEL_UP_MOVE( 0, MOVE_PETAL_DANCE), LEVEL_UP_MOVE( 1, MOVE_PETAL_DANCE), LEVEL_UP_MOVE( 1, MOVE_PETAL_BLIZZARD), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -3188,7 +3188,7 @@ static const struct LevelUpMove sSentretLevelUpLearnset[] = { }; static const struct LevelUpMove sFurretLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_AGILITY), + LEVEL_UP_MOVE( 0, MOVE_AGILITY), LEVEL_UP_MOVE( 1, MOVE_AGILITY), LEVEL_UP_MOVE( 1, MOVE_COIL), LEVEL_UP_MOVE( 1, MOVE_SCRATCH), @@ -3318,7 +3318,7 @@ static const struct LevelUpMove sSpinarakLevelUpLearnset[] = { }; static const struct LevelUpMove sAriadosLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SWORDS_DANCE), + LEVEL_UP_MOVE( 0, MOVE_SWORDS_DANCE), LEVEL_UP_MOVE( 1, MOVE_SWORDS_DANCE), LEVEL_UP_MOVE( 1, MOVE_FOCUS_ENERGY), LEVEL_UP_MOVE( 1, MOVE_VENOM_DRENCH), @@ -3347,7 +3347,7 @@ static const struct LevelUpMove sAriadosLevelUpLearnset[] = { }; static const struct LevelUpMove sCrobatLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CROSS_POISON), + LEVEL_UP_MOVE( 0, MOVE_CROSS_POISON), LEVEL_UP_MOVE( 1, MOVE_CROSS_POISON), LEVEL_UP_MOVE( 1, MOVE_SCREECH), LEVEL_UP_MOVE( 1, MOVE_ABSORB), @@ -3392,9 +3392,9 @@ static const struct LevelUpMove sChinchouLevelUpLearnset[] = { }; static const struct LevelUpMove sLanturnLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_STOCKPILE), - //LEVEL_UP_MOVE( 0, MOVE_SWALLOW), - //LEVEL_UP_MOVE( 0, MOVE_SPIT_UP), + LEVEL_UP_MOVE( 0, MOVE_STOCKPILE), + LEVEL_UP_MOVE( 0, MOVE_SWALLOW), + LEVEL_UP_MOVE( 0, MOVE_SPIT_UP), LEVEL_UP_MOVE( 1, MOVE_STOCKPILE), LEVEL_UP_MOVE( 1, MOVE_SWALLOW), LEVEL_UP_MOVE( 1, MOVE_SPIT_UP), @@ -3515,7 +3515,7 @@ static const struct LevelUpMove sNatuLevelUpLearnset[] = { }; static const struct LevelUpMove sXatuLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_AIR_SLASH), + LEVEL_UP_MOVE( 0, MOVE_AIR_SLASH), LEVEL_UP_MOVE( 1, MOVE_AIR_SLASH), LEVEL_UP_MOVE( 1, MOVE_TAILWIND), LEVEL_UP_MOVE( 1, MOVE_PECK), @@ -3580,7 +3580,7 @@ static const struct LevelUpMove sFlaaffyLevelUpLearnset[] = { }; static const struct LevelUpMove sAmpharosLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_THUNDER_PUNCH), + LEVEL_UP_MOVE( 0, MOVE_THUNDER_PUNCH), LEVEL_UP_MOVE( 1, MOVE_THUNDER_PUNCH), LEVEL_UP_MOVE( 1, MOVE_ZAP_CANNON), LEVEL_UP_MOVE( 1, MOVE_MAGNETIC_FLUX), @@ -3609,7 +3609,7 @@ static const struct LevelUpMove sAmpharosLevelUpLearnset[] = { }; static const struct LevelUpMove sBellossomLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_MAGICAL_LEAF), + LEVEL_UP_MOVE( 0, MOVE_MAGICAL_LEAF), LEVEL_UP_MOVE( 1, MOVE_MAGICAL_LEAF), LEVEL_UP_MOVE( 1, MOVE_LEAF_STORM), LEVEL_UP_MOVE( 1, MOVE_LEAF_BLADE), @@ -3667,7 +3667,7 @@ static const struct LevelUpMove sAzumarillLevelUpLearnset[] = { }; static const struct LevelUpMove sSudowoodoLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SLAM), + LEVEL_UP_MOVE( 0, MOVE_SLAM), LEVEL_UP_MOVE( 1, MOVE_SLAM), LEVEL_UP_MOVE( 1, MOVE_WOOD_HAMMER), LEVEL_UP_MOVE( 1, MOVE_COPYCAT), @@ -3896,7 +3896,7 @@ static const struct LevelUpMove sQuagsireLevelUpLearnset[] = { }; static const struct LevelUpMove sEspeonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CONFUSION), + LEVEL_UP_MOVE( 0, MOVE_CONFUSION), LEVEL_UP_MOVE( 1, MOVE_CONFUSION), LEVEL_UP_MOVE( 1, MOVE_HELPING_HAND), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -3916,7 +3916,7 @@ static const struct LevelUpMove sEspeonLevelUpLearnset[] = { }; static const struct LevelUpMove sUmbreonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PURSUIT), + LEVEL_UP_MOVE( 0, MOVE_PURSUIT), LEVEL_UP_MOVE( 1, MOVE_PURSUIT), LEVEL_UP_MOVE( 1, MOVE_HELPING_HAND), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -4048,8 +4048,8 @@ static const struct LevelUpMove sPinecoLevelUpLearnset[] = { }; static const struct LevelUpMove sForretressLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_MIRROR_SHOT), - //LEVEL_UP_MOVE( 0, MOVE_AUTOTOMIZE), + LEVEL_UP_MOVE( 0, MOVE_MIRROR_SHOT), + LEVEL_UP_MOVE( 0, MOVE_AUTOTOMIZE), LEVEL_UP_MOVE( 1, MOVE_MIRROR_SHOT), LEVEL_UP_MOVE( 1, MOVE_AUTOTOMIZE), LEVEL_UP_MOVE( 1, MOVE_HEAVY_SLAM), @@ -4369,7 +4369,7 @@ static const struct LevelUpMove sSlugmaLevelUpLearnset[] = { }; static const struct LevelUpMove sMagcargoLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SHELL_SMASH), + LEVEL_UP_MOVE( 0, MOVE_SHELL_SMASH), LEVEL_UP_MOVE( 1, MOVE_SHELL_SMASH), LEVEL_UP_MOVE( 1, MOVE_EARTH_POWER), LEVEL_UP_MOVE( 1, MOVE_YAWN), @@ -4413,7 +4413,7 @@ static const struct LevelUpMove sSwinubLevelUpLearnset[] = { }; static const struct LevelUpMove sPiloswineLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FURY_ATTACK), + LEVEL_UP_MOVE( 0, MOVE_FURY_ATTACK), LEVEL_UP_MOVE( 1, MOVE_FURY_ATTACK), LEVEL_UP_MOVE( 1, MOVE_ANCIENT_POWER), LEVEL_UP_MOVE( 1, MOVE_PECK), @@ -4476,7 +4476,7 @@ static const struct LevelUpMove sRemoraidLevelUpLearnset[] = { }; static const struct LevelUpMove sOctilleryLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_OCTAZOOKA), + LEVEL_UP_MOVE( 0, MOVE_OCTAZOOKA), LEVEL_UP_MOVE( 1, MOVE_OCTAZOOKA), LEVEL_UP_MOVE( 1, MOVE_GUNK_SHOT), LEVEL_UP_MOVE( 1, MOVE_ROCK_BLAST), @@ -4634,7 +4634,7 @@ static const struct LevelUpMove sPhanpyLevelUpLearnset[] = { }; static const struct LevelUpMove sDonphanLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FURY_ATTACK), + LEVEL_UP_MOVE( 0, MOVE_FURY_ATTACK), LEVEL_UP_MOVE( 1, MOVE_FURY_ATTACK), LEVEL_UP_MOVE( 1, MOVE_FIRE_FANG), LEVEL_UP_MOVE( 1, MOVE_THUNDER_FANG), @@ -4719,7 +4719,7 @@ static const struct LevelUpMove sTyrogueLevelUpLearnset[] = { }; static const struct LevelUpMove sHitmontopLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ROLLING_KICK), + LEVEL_UP_MOVE( 0, MOVE_ROLLING_KICK), LEVEL_UP_MOVE( 1, MOVE_ROLLING_KICK), LEVEL_UP_MOVE( 1, MOVE_ENDEAVOR), LEVEL_UP_MOVE( 1, MOVE_CLOSE_COMBAT), @@ -5166,7 +5166,7 @@ static const struct LevelUpMove sTreeckoLevelUpLearnset[] = { }; static const struct LevelUpMove sGrovyleLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FURY_CUTTER), + LEVEL_UP_MOVE( 0, MOVE_FURY_CUTTER), LEVEL_UP_MOVE( 1, MOVE_FURY_CUTTER), LEVEL_UP_MOVE( 1, MOVE_POUND), LEVEL_UP_MOVE( 1, MOVE_LEER), @@ -5189,7 +5189,7 @@ static const struct LevelUpMove sGrovyleLevelUpLearnset[] = { }; static const struct LevelUpMove sSceptileLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DUAL_CHOP), + LEVEL_UP_MOVE( 0, MOVE_DUAL_CHOP), LEVEL_UP_MOVE( 1, MOVE_DUAL_CHOP), LEVEL_UP_MOVE( 1, MOVE_FURY_CUTTER), LEVEL_UP_MOVE( 1, MOVE_LEAF_STORM), @@ -5231,7 +5231,7 @@ static const struct LevelUpMove sTorchicLevelUpLearnset[] = { }; static const struct LevelUpMove sCombuskenLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DOUBLE_KICK), + LEVEL_UP_MOVE( 0, MOVE_DOUBLE_KICK), LEVEL_UP_MOVE( 1, MOVE_DOUBLE_KICK), LEVEL_UP_MOVE( 1, MOVE_SCRATCH), LEVEL_UP_MOVE( 1, MOVE_GROWL), @@ -5252,7 +5252,7 @@ static const struct LevelUpMove sCombuskenLevelUpLearnset[] = { }; static const struct LevelUpMove sBlazikenLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BLAZE_KICK), + LEVEL_UP_MOVE( 0, MOVE_BLAZE_KICK), LEVEL_UP_MOVE( 1, MOVE_BLAZE_KICK), LEVEL_UP_MOVE( 1, MOVE_DOUBLE_KICK), LEVEL_UP_MOVE( 1, MOVE_FLARE_BLITZ), @@ -5294,7 +5294,7 @@ static const struct LevelUpMove sMudkipLevelUpLearnset[] = { }; static const struct LevelUpMove sMarshtompLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_MUD_SHOT), + LEVEL_UP_MOVE( 0, MOVE_MUD_SHOT), LEVEL_UP_MOVE( 1, MOVE_MUD_SHOT), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_GROWL), @@ -5357,7 +5357,7 @@ static const struct LevelUpMove sPoochyenaLevelUpLearnset[] = { }; static const struct LevelUpMove sMightyenaLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SNARL), + LEVEL_UP_MOVE( 0, MOVE_SNARL), LEVEL_UP_MOVE( 1, MOVE_SNARL), LEVEL_UP_MOVE( 1, MOVE_FIRE_FANG), LEVEL_UP_MOVE( 1, MOVE_THUNDER_FANG), @@ -5439,13 +5439,13 @@ static const struct LevelUpMove sWurmpleLevelUpLearnset[] = { }; static const struct LevelUpMove sSilcoonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HARDEN), + LEVEL_UP_MOVE( 0, MOVE_HARDEN), LEVEL_UP_MOVE( 1, MOVE_HARDEN), LEVEL_UP_END }; static const struct LevelUpMove sBeautiflyLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_GUST), + LEVEL_UP_MOVE( 0, MOVE_GUST), LEVEL_UP_MOVE( 1, MOVE_GUST), LEVEL_UP_MOVE(12, MOVE_ABSORB), LEVEL_UP_MOVE(15, MOVE_STUN_SPORE), @@ -5463,13 +5463,13 @@ static const struct LevelUpMove sBeautiflyLevelUpLearnset[] = { }; static const struct LevelUpMove sCascoonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HARDEN), + LEVEL_UP_MOVE( 0, MOVE_HARDEN), LEVEL_UP_MOVE( 1, MOVE_HARDEN), LEVEL_UP_END }; static const struct LevelUpMove sDustoxLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_GUST), + LEVEL_UP_MOVE( 0, MOVE_GUST), LEVEL_UP_MOVE( 1, MOVE_GUST), LEVEL_UP_MOVE(12, MOVE_CONFUSION), LEVEL_UP_MOVE(15, MOVE_POISON_POWDER), @@ -5540,7 +5540,7 @@ static const struct LevelUpMove sSeedotLevelUpLearnset[] = { }; static const struct LevelUpMove sNuzleafLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_RAZOR_LEAF), + LEVEL_UP_MOVE( 0, MOVE_RAZOR_LEAF), LEVEL_UP_MOVE( 1, MOVE_RAZOR_LEAF), LEVEL_UP_MOVE( 1, MOVE_POUND), LEVEL_UP_MOVE( 3, MOVE_HARDEN), @@ -5583,9 +5583,9 @@ static const struct LevelUpMove sNincadaLevelUpLearnset[] = { }; static const struct LevelUpMove sNinjaskLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DOUBLE_TEAM), - //LEVEL_UP_MOVE( 0, MOVE_SCREECH), - //LEVEL_UP_MOVE( 0, MOVE_FURY_CUTTER), + LEVEL_UP_MOVE( 0, MOVE_DOUBLE_TEAM), + LEVEL_UP_MOVE( 0, MOVE_SCREECH), + LEVEL_UP_MOVE( 0, MOVE_FURY_CUTTER), LEVEL_UP_MOVE( 1, MOVE_DOUBLE_TEAM), LEVEL_UP_MOVE( 1, MOVE_SCREECH), LEVEL_UP_MOVE( 1, MOVE_FURY_CUTTER), @@ -5682,7 +5682,7 @@ static const struct LevelUpMove sShroomishLevelUpLearnset[] = { }; static const struct LevelUpMove sBreloomLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_MACH_PUNCH), + LEVEL_UP_MOVE( 0, MOVE_MACH_PUNCH), LEVEL_UP_MOVE( 1, MOVE_MACH_PUNCH), LEVEL_UP_MOVE( 1, MOVE_ABSORB), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -5738,7 +5738,7 @@ static const struct LevelUpMove sWingullLevelUpLearnset[] = { }; static const struct LevelUpMove sPelipperLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PROTECT), + LEVEL_UP_MOVE( 0, MOVE_PROTECT), LEVEL_UP_MOVE( 1, MOVE_PROTECT), LEVEL_UP_MOVE( 1, MOVE_HURRICANE), LEVEL_UP_MOVE( 1, MOVE_HYDRO_PUMP), @@ -5927,7 +5927,7 @@ static const struct LevelUpMove sBaltoyLevelUpLearnset[] = { }; static const struct LevelUpMove sClaydolLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HYPER_BEAM), + LEVEL_UP_MOVE( 0, MOVE_HYPER_BEAM), LEVEL_UP_MOVE( 1, MOVE_HYPER_BEAM), LEVEL_UP_MOVE( 1, MOVE_TELEPORT), LEVEL_UP_MOVE( 1, MOVE_HARDEN), @@ -6038,7 +6038,7 @@ static const struct LevelUpMove sBarboachLevelUpLearnset[] = { }; static const struct LevelUpMove sWhiscashLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_THRASH), + LEVEL_UP_MOVE( 0, MOVE_THRASH), LEVEL_UP_MOVE( 1, MOVE_THRASH), LEVEL_UP_MOVE( 1, MOVE_BELCH), LEVEL_UP_MOVE( 1, MOVE_ZEN_HEADBUTT), @@ -6105,7 +6105,7 @@ static const struct LevelUpMove sCorphishLevelUpLearnset[] = { }; static const struct LevelUpMove sCrawdauntLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SWIFT), + LEVEL_UP_MOVE( 0, MOVE_SWIFT), LEVEL_UP_MOVE( 1, MOVE_SWIFT), LEVEL_UP_MOVE( 1, MOVE_BUBBLE), LEVEL_UP_MOVE( 1, MOVE_HARDEN), @@ -6136,7 +6136,7 @@ static const struct LevelUpMove sFeebasLevelUpLearnset[] = { }; static const struct LevelUpMove sMiloticLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_WATER_PULSE), + LEVEL_UP_MOVE( 0, MOVE_WATER_PULSE), LEVEL_UP_MOVE( 1, MOVE_WATER_PULSE), LEVEL_UP_MOVE( 1, MOVE_WRAP), LEVEL_UP_MOVE( 1, MOVE_WATER_GUN), @@ -6178,7 +6178,7 @@ static const struct LevelUpMove sCarvanhaLevelUpLearnset[] = { }; static const struct LevelUpMove sSharpedoLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SLASH), + LEVEL_UP_MOVE( 0, MOVE_SLASH), LEVEL_UP_MOVE( 1, MOVE_SLASH), LEVEL_UP_MOVE( 1, MOVE_NIGHT_SLASH), LEVEL_UP_MOVE( 1, MOVE_FEINT), @@ -6225,7 +6225,7 @@ static const struct LevelUpMove sTrapinchLevelUpLearnset[] = { }; static const struct LevelUpMove sVibravaLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DRAGON_BREATH), + LEVEL_UP_MOVE( 0, MOVE_DRAGON_BREATH), LEVEL_UP_MOVE( 1, MOVE_DRAGON_BREATH), LEVEL_UP_MOVE( 1, MOVE_SAND_ATTACK), LEVEL_UP_MOVE( 1, MOVE_SONIC_BOOM), @@ -6248,7 +6248,7 @@ static const struct LevelUpMove sVibravaLevelUpLearnset[] = { }; static const struct LevelUpMove sFlygonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DRAGON_CLAW), + LEVEL_UP_MOVE( 0, MOVE_DRAGON_CLAW), LEVEL_UP_MOVE( 1, MOVE_DRAGON_CLAW), LEVEL_UP_MOVE( 1, MOVE_DRAGON_BREATH), LEVEL_UP_MOVE( 1, MOVE_DRAGON_DANCE), @@ -6378,7 +6378,7 @@ static const struct LevelUpMove sNumelLevelUpLearnset[] = { }; static const struct LevelUpMove sCameruptLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ROCK_SLIDE), + LEVEL_UP_MOVE( 0, MOVE_ROCK_SLIDE), LEVEL_UP_MOVE( 1, MOVE_ROCK_SLIDE), LEVEL_UP_MOVE( 1, MOVE_FISSURE), LEVEL_UP_MOVE( 1, MOVE_ERUPTION), @@ -6422,7 +6422,7 @@ static const struct LevelUpMove sSphealLevelUpLearnset[] = { }; static const struct LevelUpMove sSealeoLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SWAGGER), + LEVEL_UP_MOVE( 0, MOVE_SWAGGER), LEVEL_UP_MOVE( 1, MOVE_SWAGGER), LEVEL_UP_MOVE( 1, MOVE_DEFENSE_CURL), LEVEL_UP_MOVE( 1, MOVE_POWDER_SNOW), @@ -6443,7 +6443,7 @@ static const struct LevelUpMove sSealeoLevelUpLearnset[] = { }; static const struct LevelUpMove sWalreinLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ICE_FANG), + LEVEL_UP_MOVE( 0, MOVE_ICE_FANG), LEVEL_UP_MOVE( 1, MOVE_ICE_FANG), LEVEL_UP_MOVE( 1, MOVE_SWAGGER), LEVEL_UP_MOVE( 1, MOVE_CRUNCH), @@ -6487,7 +6487,7 @@ static const struct LevelUpMove sCacneaLevelUpLearnset[] = { }; static const struct LevelUpMove sCacturneLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SPIKY_SHIELD), + LEVEL_UP_MOVE( 0, MOVE_SPIKY_SHIELD), LEVEL_UP_MOVE( 1, MOVE_SPIKY_SHIELD), LEVEL_UP_MOVE( 1, MOVE_DESTINY_BOND), LEVEL_UP_MOVE( 1, MOVE_REVENGE), @@ -6531,7 +6531,7 @@ static const struct LevelUpMove sSnoruntLevelUpLearnset[] = { }; static const struct LevelUpMove sGlalieLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FREEZE_DRY), + LEVEL_UP_MOVE( 0, MOVE_FREEZE_DRY), LEVEL_UP_MOVE( 1, MOVE_FREEZE_DRY), LEVEL_UP_MOVE( 1, MOVE_SHEER_COLD), LEVEL_UP_MOVE( 1, MOVE_POWDER_SNOW), @@ -6631,7 +6631,7 @@ static const struct LevelUpMove sSpoinkLevelUpLearnset[] = { }; static const struct LevelUpMove sGrumpigLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_TEETER_DANCE), + LEVEL_UP_MOVE( 0, MOVE_TEETER_DANCE), LEVEL_UP_MOVE( 1, MOVE_TEETER_DANCE), LEVEL_UP_MOVE( 1, MOVE_BELCH), LEVEL_UP_MOVE( 1, MOVE_SPLASH), @@ -6800,7 +6800,7 @@ static const struct LevelUpMove sSwabluLevelUpLearnset[] = { }; static const struct LevelUpMove sAltariaLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DRAGON_BREATH), + LEVEL_UP_MOVE( 0, MOVE_DRAGON_BREATH), LEVEL_UP_MOVE( 1, MOVE_DRAGON_BREATH), LEVEL_UP_MOVE( 1, MOVE_SKY_ATTACK), LEVEL_UP_MOVE( 1, MOVE_PLUCK), @@ -6858,7 +6858,7 @@ static const struct LevelUpMove sDuskullLevelUpLearnset[] = { }; static const struct LevelUpMove sDusclopsLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SHADOW_PUNCH), + LEVEL_UP_MOVE( 0, MOVE_SHADOW_PUNCH), LEVEL_UP_MOVE( 1, MOVE_SHADOW_PUNCH), LEVEL_UP_MOVE( 1, MOVE_FUTURE_SIGHT), LEVEL_UP_MOVE( 1, MOVE_FIRE_PUNCH), @@ -6941,7 +6941,7 @@ static const struct LevelUpMove sVigorothLevelUpLearnset[] = { }; static const struct LevelUpMove sSlakingLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SWAGGER), + LEVEL_UP_MOVE( 0, MOVE_SWAGGER), LEVEL_UP_MOVE( 1, MOVE_SWAGGER), LEVEL_UP_MOVE( 1, MOVE_HAMMER_ARM), LEVEL_UP_MOVE( 1, MOVE_PUNISHMENT), @@ -6985,7 +6985,7 @@ static const struct LevelUpMove sGulpinLevelUpLearnset[] = { }; static const struct LevelUpMove sSwalotLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BODY_SLAM), + LEVEL_UP_MOVE( 0, MOVE_BODY_SLAM), LEVEL_UP_MOVE( 1, MOVE_BODY_SLAM), LEVEL_UP_MOVE( 1, MOVE_VENOM_DRENCH), LEVEL_UP_MOVE( 1, MOVE_GUNK_SHOT), @@ -7051,7 +7051,7 @@ static const struct LevelUpMove sWhismurLevelUpLearnset[] = { }; static const struct LevelUpMove sLoudredLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BITE), + LEVEL_UP_MOVE( 0, MOVE_BITE), LEVEL_UP_MOVE( 1, MOVE_BITE), LEVEL_UP_MOVE( 1, MOVE_POUND), LEVEL_UP_MOVE( 1, MOVE_ECHOED_VOICE), @@ -7073,7 +7073,7 @@ static const struct LevelUpMove sLoudredLevelUpLearnset[] = { }; static const struct LevelUpMove sExploudLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CRUNCH), + LEVEL_UP_MOVE( 0, MOVE_CRUNCH), LEVEL_UP_MOVE( 1, MOVE_CRUNCH), LEVEL_UP_MOVE( 1, MOVE_BITE), LEVEL_UP_MOVE( 1, MOVE_BOOMBURST), @@ -7583,7 +7583,7 @@ static const struct LevelUpMove sBagonLevelUpLearnset[] = { }; static const struct LevelUpMove sShelgonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PROTECT), + LEVEL_UP_MOVE( 0, MOVE_PROTECT), LEVEL_UP_MOVE( 1, MOVE_PROTECT), LEVEL_UP_MOVE( 1, MOVE_RAGE), LEVEL_UP_MOVE( 1, MOVE_EMBER), @@ -7605,7 +7605,7 @@ static const struct LevelUpMove sShelgonLevelUpLearnset[] = { }; static const struct LevelUpMove sSalamenceLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FLY), + LEVEL_UP_MOVE( 0, MOVE_FLY), LEVEL_UP_MOVE( 1, MOVE_FLY), LEVEL_UP_MOVE( 1, MOVE_PROTECT), LEVEL_UP_MOVE( 1, MOVE_DRAGON_TAIL), @@ -7636,8 +7636,8 @@ static const struct LevelUpMove sBeldumLevelUpLearnset[] = { }; static const struct LevelUpMove sMetangLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CONFUSION), - //LEVEL_UP_MOVE( 0, MOVE_METAL_CLAW), + LEVEL_UP_MOVE( 0, MOVE_CONFUSION), + LEVEL_UP_MOVE( 0, MOVE_METAL_CLAW), LEVEL_UP_MOVE( 1, MOVE_CONFUSION), LEVEL_UP_MOVE( 1, MOVE_METAL_CLAW), LEVEL_UP_MOVE( 1, MOVE_MAGNET_RISE), @@ -7656,7 +7656,7 @@ static const struct LevelUpMove sMetangLevelUpLearnset[] = { }; static const struct LevelUpMove sMetagrossLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HAMMER_ARM), + LEVEL_UP_MOVE( 0, MOVE_HAMMER_ARM), LEVEL_UP_MOVE( 1, MOVE_HAMMER_ARM), LEVEL_UP_MOVE( 1, MOVE_CONFUSION), LEVEL_UP_MOVE( 1, MOVE_METAL_CLAW), @@ -7939,7 +7939,7 @@ static const struct LevelUpMove sGrotleLevelUpLearnset[] = { }; static const struct LevelUpMove sTorterraLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_EARTHQUAKE), + LEVEL_UP_MOVE( 0, MOVE_EARTHQUAKE), LEVEL_UP_MOVE( 1, MOVE_EARTHQUAKE), LEVEL_UP_MOVE( 1, MOVE_WOOD_HAMMER), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -7978,7 +7978,7 @@ static const struct LevelUpMove sChimcharLevelUpLearnset[] = { }; static const struct LevelUpMove sMonfernoLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_MACH_PUNCH), + LEVEL_UP_MOVE( 0, MOVE_MACH_PUNCH), LEVEL_UP_MOVE( 1, MOVE_MACH_PUNCH), LEVEL_UP_MOVE( 1, MOVE_SCRATCH), LEVEL_UP_MOVE( 1, MOVE_LEER), @@ -7998,7 +7998,7 @@ static const struct LevelUpMove sMonfernoLevelUpLearnset[] = { }; static const struct LevelUpMove sInfernapeLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CLOSE_COMBAT), + LEVEL_UP_MOVE( 0, MOVE_CLOSE_COMBAT), LEVEL_UP_MOVE( 1, MOVE_CLOSE_COMBAT), LEVEL_UP_MOVE( 1, MOVE_MACH_PUNCH), LEVEL_UP_MOVE( 1, MOVE_FLARE_BLITZ), @@ -8037,7 +8037,7 @@ static const struct LevelUpMove sPiplupLevelUpLearnset[] = { }; static const struct LevelUpMove sPrinplupLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_METAL_CLAW), + LEVEL_UP_MOVE( 0, MOVE_METAL_CLAW), LEVEL_UP_MOVE( 1, MOVE_METAL_CLAW), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_GROWL), @@ -8058,7 +8058,7 @@ static const struct LevelUpMove sPrinplupLevelUpLearnset[] = { }; static const struct LevelUpMove sEmpoleonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_AQUA_JET), + LEVEL_UP_MOVE( 0, MOVE_AQUA_JET), LEVEL_UP_MOVE( 1, MOVE_AQUA_JET), LEVEL_UP_MOVE( 1, MOVE_METAL_CLAW), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -8113,7 +8113,7 @@ static const struct LevelUpMove sStaraviaLevelUpLearnset[] = { }; static const struct LevelUpMove sStaraptorLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CLOSE_COMBAT), + LEVEL_UP_MOVE( 0, MOVE_CLOSE_COMBAT), LEVEL_UP_MOVE( 1, MOVE_CLOSE_COMBAT), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_GROWL), @@ -8151,7 +8151,7 @@ static const struct LevelUpMove sBidoofLevelUpLearnset[] = { }; static const struct LevelUpMove sBibarelLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_WATER_GUN), + LEVEL_UP_MOVE( 0, MOVE_WATER_GUN), LEVEL_UP_MOVE( 1, MOVE_WATER_GUN), LEVEL_UP_MOVE( 1, MOVE_AQUA_JET), LEVEL_UP_MOVE( 1, MOVE_ROTOTILLER), @@ -8181,7 +8181,7 @@ static const struct LevelUpMove sKricketotLevelUpLearnset[] = { }; static const struct LevelUpMove sKricketuneLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FURY_CUTTER), + LEVEL_UP_MOVE( 0, MOVE_FURY_CUTTER), LEVEL_UP_MOVE( 1, MOVE_FURY_CUTTER), LEVEL_UP_MOVE( 1, MOVE_GROWL), LEVEL_UP_MOVE( 1, MOVE_BIDE), @@ -8292,7 +8292,7 @@ static const struct LevelUpMove sCranidosLevelUpLearnset[] = { }; static const struct LevelUpMove sRampardosLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ENDEAVOR), + LEVEL_UP_MOVE( 0, MOVE_ENDEAVOR), LEVEL_UP_MOVE( 1, MOVE_ENDEAVOR), LEVEL_UP_MOVE( 1, MOVE_HEADBUTT), LEVEL_UP_MOVE( 1, MOVE_LEER), @@ -8328,7 +8328,7 @@ static const struct LevelUpMove sShieldonLevelUpLearnset[] = { }; static const struct LevelUpMove sBastiodonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BLOCK), + LEVEL_UP_MOVE( 0, MOVE_BLOCK), LEVEL_UP_MOVE( 1, MOVE_BLOCK), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_PROTECT), @@ -8356,7 +8356,7 @@ static const struct LevelUpMove sBurmyLevelUpLearnset[] = { }; static const struct LevelUpMove sWormadamLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), + LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_SUCKER_PUNCH), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -8379,7 +8379,7 @@ static const struct LevelUpMove sWormadamLevelUpLearnset[] = { }; static const struct LevelUpMove sMothimLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), + LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_PROTECT), @@ -8409,7 +8409,7 @@ static const struct LevelUpMove sCombeeLevelUpLearnset[] = { }; static const struct LevelUpMove sVespiquenLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SLASH), + LEVEL_UP_MOVE( 0, MOVE_SLASH), LEVEL_UP_MOVE( 1, MOVE_SLASH), LEVEL_UP_MOVE( 1, MOVE_FELL_STINGER), LEVEL_UP_MOVE( 1, MOVE_DESTINY_BOND), @@ -8510,7 +8510,7 @@ static const struct LevelUpMove sCherubiLevelUpLearnset[] = { }; static const struct LevelUpMove sCherrimLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PETAL_DANCE), + LEVEL_UP_MOVE( 0, MOVE_PETAL_DANCE), LEVEL_UP_MOVE( 1, MOVE_PETAL_DANCE), LEVEL_UP_MOVE( 1, MOVE_MORNING_SUN), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -8645,7 +8645,7 @@ static const struct LevelUpMove sBunearyLevelUpLearnset[] = { }; static const struct LevelUpMove sLopunnyLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_RETURN), + LEVEL_UP_MOVE( 0, MOVE_RETURN), LEVEL_UP_MOVE( 1, MOVE_RETURN), LEVEL_UP_MOVE( 1, MOVE_HEALING_WISH), LEVEL_UP_MOVE( 1, MOVE_BOUNCE), @@ -8720,7 +8720,7 @@ static const struct LevelUpMove sGlameowLevelUpLearnset[] = { }; static const struct LevelUpMove sPuruglyLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SWAGGER), + LEVEL_UP_MOVE( 0, MOVE_SWAGGER), LEVEL_UP_MOVE( 1, MOVE_SWAGGER), LEVEL_UP_MOVE( 1, MOVE_FAKE_OUT), LEVEL_UP_MOVE( 1, MOVE_SCRATCH), @@ -8774,7 +8774,7 @@ static const struct LevelUpMove sStunkyLevelUpLearnset[] = { }; static const struct LevelUpMove sSkuntankLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FLAMETHROWER), + LEVEL_UP_MOVE( 0, MOVE_FLAMETHROWER), LEVEL_UP_MOVE( 1, MOVE_FLAMETHROWER), LEVEL_UP_MOVE( 1, MOVE_SCRATCH), LEVEL_UP_MOVE( 1, MOVE_FOCUS_ENERGY), @@ -8819,7 +8819,7 @@ static const struct LevelUpMove sBronzorLevelUpLearnset[] = { }; static const struct LevelUpMove sBronzongLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BLOCK), + LEVEL_UP_MOVE( 0, MOVE_BLOCK), LEVEL_UP_MOVE( 1, MOVE_BLOCK), LEVEL_UP_MOVE( 1, MOVE_SUNNY_DAY), LEVEL_UP_MOVE( 1, MOVE_RAIN_DANCE), @@ -8949,7 +8949,7 @@ static const struct LevelUpMove sGibleLevelUpLearnset[] = { }; static const struct LevelUpMove sGabiteLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DUAL_CHOP), + LEVEL_UP_MOVE( 0, MOVE_DUAL_CHOP), LEVEL_UP_MOVE( 1, MOVE_DUAL_CHOP), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_SAND_ATTACK), @@ -8967,7 +8967,7 @@ static const struct LevelUpMove sGabiteLevelUpLearnset[] = { }; static const struct LevelUpMove sGarchompLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CRUNCH), + LEVEL_UP_MOVE( 0, MOVE_CRUNCH), LEVEL_UP_MOVE( 1, MOVE_CRUNCH), LEVEL_UP_MOVE( 1, MOVE_DUAL_CHOP), LEVEL_UP_MOVE( 1, MOVE_FIRE_FANG), @@ -9027,7 +9027,7 @@ static const struct LevelUpMove sRioluLevelUpLearnset[] = { }; static const struct LevelUpMove sLucarioLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_AURA_SPHERE), + LEVEL_UP_MOVE( 0, MOVE_AURA_SPHERE), LEVEL_UP_MOVE( 1, MOVE_AURA_SPHERE), LEVEL_UP_MOVE( 1, MOVE_LASER_FOCUS), LEVEL_UP_MOVE( 1, MOVE_FORESIGHT), @@ -9496,7 +9496,7 @@ static const struct LevelUpMove sYanmegaLevelUpLearnset[] = { }; static const struct LevelUpMove sLeafeonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_RAZOR_LEAF), + LEVEL_UP_MOVE( 0, MOVE_RAZOR_LEAF), LEVEL_UP_MOVE( 1, MOVE_RAZOR_LEAF), LEVEL_UP_MOVE( 1, MOVE_HELPING_HAND), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -9516,7 +9516,7 @@ static const struct LevelUpMove sLeafeonLevelUpLearnset[] = { }; static const struct LevelUpMove sGlaceonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ICY_WIND), + LEVEL_UP_MOVE( 0, MOVE_ICY_WIND), LEVEL_UP_MOVE( 1, MOVE_ICY_WIND), LEVEL_UP_MOVE( 1, MOVE_HELPING_HAND), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -9610,7 +9610,7 @@ static const struct LevelUpMove sPorygonZLevelUpLearnset[] = { }; static const struct LevelUpMove sGalladeLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SLASH), + LEVEL_UP_MOVE( 0, MOVE_SLASH), LEVEL_UP_MOVE( 1, MOVE_SLASH), LEVEL_UP_MOVE( 1, MOVE_STORED_POWER), LEVEL_UP_MOVE( 1, MOVE_CLOSE_COMBAT), @@ -9640,7 +9640,7 @@ static const struct LevelUpMove sGalladeLevelUpLearnset[] = { }; static const struct LevelUpMove sProbopassLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_TRI_ATTACK), + LEVEL_UP_MOVE( 0, MOVE_TRI_ATTACK), LEVEL_UP_MOVE( 1, MOVE_TRI_ATTACK), LEVEL_UP_MOVE( 1, MOVE_MAGNETIC_FLUX), LEVEL_UP_MOVE( 1, MOVE_MAGNET_RISE), @@ -9697,7 +9697,7 @@ static const struct LevelUpMove sDusknoirLevelUpLearnset[] = { }; static const struct LevelUpMove sFroslassLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_OMINOUS_WIND), + LEVEL_UP_MOVE( 0, MOVE_OMINOUS_WIND), LEVEL_UP_MOVE( 1, MOVE_OMINOUS_WIND), LEVEL_UP_MOVE( 1, MOVE_DESTINY_BOND), LEVEL_UP_MOVE( 1, MOVE_POWDER_SNOW), @@ -10098,7 +10098,7 @@ static const struct LevelUpMove sTepigLevelUpLearnset[] = { }; static const struct LevelUpMove sPigniteLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ARM_THRUST), + LEVEL_UP_MOVE( 0, MOVE_ARM_THRUST), LEVEL_UP_MOVE( 1, MOVE_ARM_THRUST), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_TAIL_WHIP), @@ -10187,7 +10187,7 @@ static const struct LevelUpMove sDewottLevelUpLearnset[] = { }; static const struct LevelUpMove sSamurottLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SLASH), + LEVEL_UP_MOVE( 0, MOVE_SLASH), LEVEL_UP_MOVE( 1, MOVE_SLASH), LEVEL_UP_MOVE( 1, MOVE_MEGAHORN), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -10233,7 +10233,7 @@ static const struct LevelUpMove sPatratLevelUpLearnset[] = { }; static const struct LevelUpMove sWatchogLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CONFUSE_RAY), + LEVEL_UP_MOVE( 0, MOVE_CONFUSE_RAY), LEVEL_UP_MOVE( 1, MOVE_CONFUSE_RAY), LEVEL_UP_MOVE( 1, MOVE_ROTOTILLER), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -10600,7 +10600,7 @@ static const struct LevelUpMove sRoggenrolaLevelUpLearnset[] = { }; static const struct LevelUpMove sBoldoreLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_POWER_GEM), + LEVEL_UP_MOVE( 0, MOVE_POWER_GEM), LEVEL_UP_MOVE( 1, MOVE_POWER_GEM), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_HARDEN), @@ -10701,7 +10701,7 @@ static const struct LevelUpMove sDrilburLevelUpLearnset[] = { }; static const struct LevelUpMove sExcadrillLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HORN_DRILL), + LEVEL_UP_MOVE( 0, MOVE_HORN_DRILL), LEVEL_UP_MOVE( 1, MOVE_HORN_DRILL), LEVEL_UP_MOVE( 1, MOVE_ROTOTILLER), LEVEL_UP_MOVE( 1, MOVE_SCRATCH), @@ -10852,7 +10852,7 @@ static const struct LevelUpMove sPalpitoadLevelUpLearnset[] = { }; static const struct LevelUpMove sSeismitoadLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ACID), + LEVEL_UP_MOVE( 0, MOVE_ACID), LEVEL_UP_MOVE( 1, MOVE_ACID), LEVEL_UP_MOVE( 1, MOVE_BUBBLE), LEVEL_UP_MOVE( 1, MOVE_GROWL), @@ -10927,7 +10927,7 @@ static const struct LevelUpMove sSewaddleLevelUpLearnset[] = { }; static const struct LevelUpMove sSwadloonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PROTECT), + LEVEL_UP_MOVE( 0, MOVE_PROTECT), LEVEL_UP_MOVE( 1, MOVE_PROTECT), LEVEL_UP_MOVE( 1, MOVE_GRASS_WHISTLE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -10938,7 +10938,7 @@ static const struct LevelUpMove sSwadloonLevelUpLearnset[] = { }; static const struct LevelUpMove sLeavannyLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SLASH), + LEVEL_UP_MOVE( 0, MOVE_SLASH), LEVEL_UP_MOVE( 1, MOVE_SLASH), LEVEL_UP_MOVE( 1, MOVE_FALSE_SWIPE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -10978,7 +10978,7 @@ static const struct LevelUpMove sVenipedeLevelUpLearnset[] = { }; static const struct LevelUpMove sWhirlipedeLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_IRON_DEFENSE), + LEVEL_UP_MOVE( 0, MOVE_IRON_DEFENSE), LEVEL_UP_MOVE( 1, MOVE_IRON_DEFENSE), LEVEL_UP_MOVE( 1, MOVE_DEFENSE_CURL), LEVEL_UP_MOVE( 1, MOVE_ROLLOUT), @@ -11001,7 +11001,7 @@ static const struct LevelUpMove sWhirlipedeLevelUpLearnset[] = { }; static const struct LevelUpMove sScolipedeLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BATON_PASS), + LEVEL_UP_MOVE( 0, MOVE_BATON_PASS), LEVEL_UP_MOVE( 1, MOVE_BATON_PASS), LEVEL_UP_MOVE( 1, MOVE_IRON_DEFENSE), LEVEL_UP_MOVE( 1, MOVE_MEGAHORN), @@ -11202,7 +11202,7 @@ static const struct LevelUpMove sDarumakaLevelUpLearnset[] = { }; static const struct LevelUpMove sDarmanitanLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HAMMER_ARM), + LEVEL_UP_MOVE( 0, MOVE_HAMMER_ARM), LEVEL_UP_MOVE( 1, MOVE_HAMMER_ARM), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_ROLLOUT), @@ -11376,7 +11376,7 @@ static const struct LevelUpMove sYamaskLevelUpLearnset[] = { }; static const struct LevelUpMove sCofagrigusLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SCARY_FACE), + LEVEL_UP_MOVE( 0, MOVE_SCARY_FACE), LEVEL_UP_MOVE( 1, MOVE_SCARY_FACE), LEVEL_UP_MOVE( 1, MOVE_ASTONISH), LEVEL_UP_MOVE( 1, MOVE_PROTECT), @@ -11553,7 +11553,7 @@ static const struct LevelUpMove sZoruaLevelUpLearnset[] = { }; static const struct LevelUpMove sZoroarkLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_NIGHT_SLASH), + LEVEL_UP_MOVE( 0, MOVE_NIGHT_SLASH), LEVEL_UP_MOVE( 1, MOVE_NIGHT_SLASH), LEVEL_UP_MOVE( 1, MOVE_NIGHT_DAZE), LEVEL_UP_MOVE( 1, MOVE_IMPRISON), @@ -11721,7 +11721,7 @@ static const struct LevelUpMove sDuosionLevelUpLearnset[] = { }; static const struct LevelUpMove sReuniclusLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DIZZY_PUNCH), + LEVEL_UP_MOVE( 0, MOVE_DIZZY_PUNCH), LEVEL_UP_MOVE( 1, MOVE_DIZZY_PUNCH), LEVEL_UP_MOVE( 1, MOVE_PSYWAVE), LEVEL_UP_MOVE( 1, MOVE_REFLECT), @@ -11872,7 +11872,7 @@ static const struct LevelUpMove sDeerlingLevelUpLearnset[] = { }; static const struct LevelUpMove sSawsbuckLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HORN_LEECH), + LEVEL_UP_MOVE( 0, MOVE_HORN_LEECH), LEVEL_UP_MOVE( 1, MOVE_HORN_LEECH), LEVEL_UP_MOVE( 1, MOVE_MEGAHORN), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -12088,7 +12088,7 @@ static const struct LevelUpMove sJoltikLevelUpLearnset[] = { }; static const struct LevelUpMove sGalvantulaLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_STICKY_WEB), + LEVEL_UP_MOVE( 0, MOVE_STICKY_WEB), LEVEL_UP_MOVE( 1, MOVE_STICKY_WEB), LEVEL_UP_MOVE( 1, MOVE_STRING_SHOT), LEVEL_UP_MOVE( 1, MOVE_ABSORB), @@ -12130,7 +12130,7 @@ static const struct LevelUpMove sFerroseedLevelUpLearnset[] = { }; static const struct LevelUpMove sFerrothornLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_POWER_WHIP), + LEVEL_UP_MOVE( 0, MOVE_POWER_WHIP), LEVEL_UP_MOVE( 1, MOVE_POWER_WHIP), LEVEL_UP_MOVE( 1, MOVE_ROCK_CLIMB), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -12195,7 +12195,7 @@ static const struct LevelUpMove sKlangLevelUpLearnset[] = { }; static const struct LevelUpMove sKlinklangLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_MAGNETIC_FLUX), + LEVEL_UP_MOVE( 0, MOVE_MAGNETIC_FLUX), LEVEL_UP_MOVE( 1, MOVE_MAGNETIC_FLUX), LEVEL_UP_MOVE( 1, MOVE_GEAR_UP), LEVEL_UP_MOVE( 1, MOVE_VISE_GRIP), @@ -12228,7 +12228,7 @@ static const struct LevelUpMove sTynamoLevelUpLearnset[] = { }; static const struct LevelUpMove sEelektrikLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CRUNCH), + LEVEL_UP_MOVE( 0, MOVE_CRUNCH), LEVEL_UP_MOVE( 1, MOVE_CRUNCH), LEVEL_UP_MOVE( 1, MOVE_HEADBUTT), LEVEL_UP_MOVE( 1, MOVE_THUNDER_WAVE), @@ -12452,7 +12452,7 @@ static const struct LevelUpMove sCubchooLevelUpLearnset[] = { }; static const struct LevelUpMove sBearticLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ICICLE_CRASH), + LEVEL_UP_MOVE( 0, MOVE_ICICLE_CRASH), LEVEL_UP_MOVE( 1, MOVE_ICICLE_CRASH), LEVEL_UP_MOVE( 1, MOVE_SHEER_COLD), LEVEL_UP_MOVE( 1, MOVE_THRASH), @@ -12659,7 +12659,7 @@ static const struct LevelUpMove sGolettLevelUpLearnset[] = { }; static const struct LevelUpMove sGolurkLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HEAVY_SLAM), + LEVEL_UP_MOVE( 0, MOVE_HEAVY_SLAM), LEVEL_UP_MOVE( 1, MOVE_HEAVY_SLAM), LEVEL_UP_MOVE( 1, MOVE_HIGH_HORSEPOWER), LEVEL_UP_MOVE( 1, MOVE_POUND), @@ -12768,7 +12768,7 @@ static const struct LevelUpMove sRuffletLevelUpLearnset[] = { }; static const struct LevelUpMove sBraviaryLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SUPERPOWER), + LEVEL_UP_MOVE( 0, MOVE_SUPERPOWER), LEVEL_UP_MOVE( 1, MOVE_SUPERPOWER), LEVEL_UP_MOVE( 1, MOVE_THRASH), LEVEL_UP_MOVE( 1, MOVE_BRAVE_BIRD), @@ -12815,7 +12815,7 @@ static const struct LevelUpMove sVullabyLevelUpLearnset[] = { }; static const struct LevelUpMove sMandibuzzLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BONE_RUSH), + LEVEL_UP_MOVE( 0, MOVE_BONE_RUSH), LEVEL_UP_MOVE( 1, MOVE_BONE_RUSH), LEVEL_UP_MOVE( 1, MOVE_MIRROR_MOVE), LEVEL_UP_MOVE( 1, MOVE_BRAVE_BIRD), @@ -12969,7 +12969,7 @@ static const struct LevelUpMove sLarvestaLevelUpLearnset[] = { }; static const struct LevelUpMove sVolcaronaLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), + LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_FIERY_DANCE), LEVEL_UP_MOVE( 1, MOVE_HURRICANE), @@ -13274,7 +13274,7 @@ static const struct LevelUpMove sChespinLevelUpLearnset[] = { }; static const struct LevelUpMove sQuilladinLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_NEEDLE_ARM), + LEVEL_UP_MOVE( 0, MOVE_NEEDLE_ARM), LEVEL_UP_MOVE( 1, MOVE_NEEDLE_ARM), LEVEL_UP_MOVE( 1, MOVE_GROWL), LEVEL_UP_MOVE( 1, MOVE_VINE_WHIP), @@ -13294,7 +13294,7 @@ static const struct LevelUpMove sQuilladinLevelUpLearnset[] = { }; static const struct LevelUpMove sChesnaughtLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SPIKY_SHIELD), + LEVEL_UP_MOVE( 0, MOVE_SPIKY_SHIELD), LEVEL_UP_MOVE( 1, MOVE_SPIKY_SHIELD), LEVEL_UP_MOVE( 1, MOVE_NEEDLE_ARM), LEVEL_UP_MOVE( 1, MOVE_HAMMER_ARM), @@ -13363,7 +13363,7 @@ static const struct LevelUpMove sBraixenLevelUpLearnset[] = { }; static const struct LevelUpMove sDelphoxLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_MYSTICAL_FIRE), + LEVEL_UP_MOVE( 0, MOVE_MYSTICAL_FIRE), LEVEL_UP_MOVE( 1, MOVE_MYSTICAL_FIRE), LEVEL_UP_MOVE( 1, MOVE_FUTURE_SIGHT), LEVEL_UP_MOVE( 1, MOVE_ROLE_PLAY), @@ -13429,7 +13429,7 @@ static const struct LevelUpMove sFrogadierLevelUpLearnset[] = { }; static const struct LevelUpMove sGreninjaLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_WATER_SHURIKEN), + LEVEL_UP_MOVE( 0, MOVE_WATER_SHURIKEN), LEVEL_UP_MOVE( 1, MOVE_WATER_SHURIKEN), LEVEL_UP_MOVE( 1, MOVE_NIGHT_SLASH), LEVEL_UP_MOVE( 1, MOVE_HAZE), @@ -13520,7 +13520,7 @@ static const struct LevelUpMove sFletchlingLevelUpLearnset[] = { }; static const struct LevelUpMove sFletchinderLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_EMBER), + LEVEL_UP_MOVE( 0, MOVE_EMBER), LEVEL_UP_MOVE( 1, MOVE_EMBER), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_GROWL), @@ -13573,14 +13573,14 @@ static const struct LevelUpMove sScatterbugLevelUpLearnset[] = { }; static const struct LevelUpMove sSpewpaLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PROTECT), + LEVEL_UP_MOVE( 0, MOVE_PROTECT), LEVEL_UP_MOVE( 1, MOVE_PROTECT), LEVEL_UP_MOVE( 1, MOVE_HARDEN), LEVEL_UP_END }; static const struct LevelUpMove sVivillonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_GUST), + LEVEL_UP_MOVE( 0, MOVE_GUST), LEVEL_UP_MOVE( 1, MOVE_GUST), LEVEL_UP_MOVE( 1, MOVE_POWDER), LEVEL_UP_MOVE( 1, MOVE_SLEEP_POWDER), @@ -13715,7 +13715,7 @@ static const struct LevelUpMove sSkiddoLevelUpLearnset[] = { }; static const struct LevelUpMove sGogoatLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_AERIAL_ACE), + LEVEL_UP_MOVE( 0, MOVE_AERIAL_ACE), LEVEL_UP_MOVE( 1, MOVE_AERIAL_ACE), LEVEL_UP_MOVE( 1, MOVE_EARTHQUAKE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -13758,7 +13758,7 @@ static const struct LevelUpMove sPanchamLevelUpLearnset[] = { }; static const struct LevelUpMove sPangoroLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BULLET_PUNCH), + LEVEL_UP_MOVE( 0, MOVE_BULLET_PUNCH), LEVEL_UP_MOVE( 1, MOVE_BULLET_PUNCH), LEVEL_UP_MOVE( 1, MOVE_HAMMER_ARM), LEVEL_UP_MOVE( 1, MOVE_LOW_SWEEP), @@ -14099,7 +14099,7 @@ static const struct LevelUpMove sSkrelpLevelUpLearnset[] = { }; static const struct LevelUpMove sDragalgeLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_TWISTER), + LEVEL_UP_MOVE( 0, MOVE_TWISTER), LEVEL_UP_MOVE( 1, MOVE_TWISTER), LEVEL_UP_MOVE( 1, MOVE_DRAGON_TAIL), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -14141,7 +14141,7 @@ static const struct LevelUpMove sClauncherLevelUpLearnset[] = { }; static const struct LevelUpMove sClawitzerLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_AURA_SPHERE), + LEVEL_UP_MOVE( 0, MOVE_AURA_SPHERE), LEVEL_UP_MOVE( 1, MOVE_AURA_SPHERE), LEVEL_UP_MOVE( 1, MOVE_DARK_PULSE), LEVEL_UP_MOVE( 1, MOVE_DRAGON_PULSE), @@ -14212,7 +14212,7 @@ static const struct LevelUpMove sTyruntLevelUpLearnset[] = { }; static const struct LevelUpMove sTyrantrumLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ROCK_SLIDE), + LEVEL_UP_MOVE( 0, MOVE_ROCK_SLIDE), LEVEL_UP_MOVE( 1, MOVE_ROCK_SLIDE), LEVEL_UP_MOVE( 1, MOVE_HEAD_SMASH), LEVEL_UP_MOVE( 1, MOVE_TAIL_WHIP), @@ -14260,7 +14260,7 @@ static const struct LevelUpMove sAmauraLevelUpLearnset[] = { }; static const struct LevelUpMove sAurorusLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FREEZE_DRY), + LEVEL_UP_MOVE( 0, MOVE_FREEZE_DRY), LEVEL_UP_MOVE( 1, MOVE_FREEZE_DRY), LEVEL_UP_MOVE( 1, MOVE_GROWL), LEVEL_UP_MOVE( 1, MOVE_POWDER_SNOW), @@ -14286,7 +14286,7 @@ static const struct LevelUpMove sAurorusLevelUpLearnset[] = { }; static const struct LevelUpMove sSylveonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FAIRY_WIND), + LEVEL_UP_MOVE( 0, MOVE_FAIRY_WIND), LEVEL_UP_MOVE( 1, MOVE_FAIRY_WIND), LEVEL_UP_MOVE( 1, MOVE_DISARMING_VOICE), LEVEL_UP_MOVE( 1, MOVE_HELPING_HAND), @@ -14399,7 +14399,7 @@ static const struct LevelUpMove sSliggooLevelUpLearnset[] = { }; static const struct LevelUpMove sGoodraLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_AQUA_TAIL), + LEVEL_UP_MOVE( 0, MOVE_AQUA_TAIL), LEVEL_UP_MOVE( 1, MOVE_AQUA_TAIL), LEVEL_UP_MOVE( 1, MOVE_OUTRAGE), LEVEL_UP_MOVE( 1, MOVE_FEINT), @@ -14460,7 +14460,7 @@ static const struct LevelUpMove sPhantumpLevelUpLearnset[] = { }; static const struct LevelUpMove sTrevenantLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SHADOW_CLAW), + LEVEL_UP_MOVE( 0, MOVE_SHADOW_CLAW), LEVEL_UP_MOVE( 1, MOVE_SHADOW_CLAW), LEVEL_UP_MOVE( 1, MOVE_HORN_LEECH), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -14546,7 +14546,7 @@ static const struct LevelUpMove sBergmiteLevelUpLearnset[] = { }; static const struct LevelUpMove sAvaluggLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BODY_SLAM), + LEVEL_UP_MOVE( 0, MOVE_BODY_SLAM), LEVEL_UP_MOVE( 1, MOVE_BODY_SLAM), LEVEL_UP_MOVE( 1, MOVE_WIDE_GUARD), LEVEL_UP_MOVE( 1, MOVE_CRUNCH), @@ -14795,7 +14795,7 @@ static const struct LevelUpMove sDartrixLevelUpLearnset[] = { }; static const struct LevelUpMove sDecidueyeLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SPIRIT_SHACKLE), + LEVEL_UP_MOVE( 0, MOVE_SPIRIT_SHACKLE), LEVEL_UP_MOVE( 1, MOVE_SPIRIT_SHACKLE), LEVEL_UP_MOVE( 1, MOVE_PHANTOM_FORCE), LEVEL_UP_MOVE( 1, MOVE_LEAF_STORM), @@ -14865,7 +14865,7 @@ static const struct LevelUpMove sTorracatLevelUpLearnset[] = { }; static const struct LevelUpMove sIncineroarLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DARKEST_LARIAT), + LEVEL_UP_MOVE( 0, MOVE_DARKEST_LARIAT), LEVEL_UP_MOVE( 1, MOVE_DARKEST_LARIAT), LEVEL_UP_MOVE( 1, MOVE_BULK_UP), LEVEL_UP_MOVE( 1, MOVE_THROAT_CHOP), @@ -14934,7 +14934,7 @@ static const struct LevelUpMove sBrionneLevelUpLearnset[] = { }; static const struct LevelUpMove sPrimarinaLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SPARKLING_ARIA), + LEVEL_UP_MOVE( 0, MOVE_SPARKLING_ARIA), LEVEL_UP_MOVE( 1, MOVE_SPARKLING_ARIA), LEVEL_UP_MOVE( 1, MOVE_POUND), LEVEL_UP_MOVE( 1, MOVE_WATER_GUN), @@ -14996,7 +14996,7 @@ static const struct LevelUpMove sTrumbeakLevelUpLearnset[] = { }; static const struct LevelUpMove sToucannonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BEAK_BLAST), + LEVEL_UP_MOVE( 0, MOVE_BEAK_BLAST), LEVEL_UP_MOVE( 1, MOVE_BEAK_BLAST), LEVEL_UP_MOVE( 1, MOVE_ROCK_BLAST), LEVEL_UP_MOVE( 1, MOVE_PECK), @@ -15076,7 +15076,7 @@ static const struct LevelUpMove sGrubbinLevelUpLearnset[] = { }; static const struct LevelUpMove sCharjabugLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CHARGE), + LEVEL_UP_MOVE( 0, MOVE_CHARGE), LEVEL_UP_MOVE( 1, MOVE_CHARGE), LEVEL_UP_MOVE( 1, MOVE_VISE_GRIP), LEVEL_UP_MOVE( 1, MOVE_STRING_SHOT), @@ -15097,7 +15097,7 @@ static const struct LevelUpMove sCharjabugLevelUpLearnset[] = { }; static const struct LevelUpMove sVikavoltLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_THUNDERBOLT), + LEVEL_UP_MOVE( 0, MOVE_THUNDERBOLT), LEVEL_UP_MOVE( 1, MOVE_THUNDERBOLT), LEVEL_UP_MOVE( 1, MOVE_AIR_SLASH), LEVEL_UP_MOVE( 1, MOVE_CHARGE), @@ -15137,7 +15137,7 @@ static const struct LevelUpMove sCrabrawlerLevelUpLearnset[] = { }; static const struct LevelUpMove sCrabominableLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ICE_PUNCH), + LEVEL_UP_MOVE( 0, MOVE_ICE_PUNCH), LEVEL_UP_MOVE( 1, MOVE_ICE_PUNCH), LEVEL_UP_MOVE( 1, MOVE_BUBBLE), LEVEL_UP_MOVE( 1, MOVE_ROCK_SMASH), @@ -15194,7 +15194,7 @@ static const struct LevelUpMove sCutieflyLevelUpLearnset[] = { }; static const struct LevelUpMove sRibombeeLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_POLLEN_PUFF), + LEVEL_UP_MOVE( 0, MOVE_POLLEN_PUFF), LEVEL_UP_MOVE( 1, MOVE_POLLEN_PUFF), LEVEL_UP_MOVE( 1, MOVE_ABSORB), LEVEL_UP_MOVE( 1, MOVE_FAIRY_WIND), @@ -15233,7 +15233,7 @@ static const struct LevelUpMove sRockruffLevelUpLearnset[] = { }; static const struct LevelUpMove sLycanrocLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ACCELEROCK), + LEVEL_UP_MOVE( 0, MOVE_ACCELEROCK), LEVEL_UP_MOVE( 1, MOVE_ACCELEROCK), LEVEL_UP_MOVE( 1, MOVE_QUICK_GUARD), LEVEL_UP_MOVE( 1, MOVE_QUICK_ATTACK), @@ -15294,7 +15294,7 @@ static const struct LevelUpMove sMareanieLevelUpLearnset[] = { }; static const struct LevelUpMove sToxapexLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BANEFUL_BUNKER), + LEVEL_UP_MOVE( 0, MOVE_BANEFUL_BUNKER), LEVEL_UP_MOVE( 1, MOVE_BANEFUL_BUNKER), LEVEL_UP_MOVE( 1, MOVE_POISON_STING), LEVEL_UP_MOVE( 1, MOVE_PECK), @@ -15410,7 +15410,7 @@ static const struct LevelUpMove sFomantisLevelUpLearnset[] = { }; static const struct LevelUpMove sLurantisLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PETAL_BLIZZARD), + LEVEL_UP_MOVE( 0, MOVE_PETAL_BLIZZARD), LEVEL_UP_MOVE( 1, MOVE_PETAL_BLIZZARD), LEVEL_UP_MOVE( 1, MOVE_X_SCISSOR), LEVEL_UP_MOVE( 1, MOVE_NIGHT_SLASH), @@ -15489,7 +15489,7 @@ static const struct LevelUpMove sSalanditLevelUpLearnset[] = { }; static const struct LevelUpMove sSalazzleLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CAPTIVATE), + LEVEL_UP_MOVE( 0, MOVE_CAPTIVATE), LEVEL_UP_MOVE( 1, MOVE_CAPTIVATE), LEVEL_UP_MOVE( 1, MOVE_DISABLE), LEVEL_UP_MOVE( 1, MOVE_ENCORE), @@ -15532,7 +15532,7 @@ static const struct LevelUpMove sStuffulLevelUpLearnset[] = { }; static const struct LevelUpMove sBewearLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BIND), + LEVEL_UP_MOVE( 0, MOVE_BIND), LEVEL_UP_MOVE( 1, MOVE_BIND), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_LEER), @@ -15564,7 +15564,7 @@ static const struct LevelUpMove sBounsweetLevelUpLearnset[] = { }; static const struct LevelUpMove sSteeneeLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DOUBLE_SLAP), + LEVEL_UP_MOVE( 0, MOVE_DOUBLE_SLAP), LEVEL_UP_MOVE( 1, MOVE_DOUBLE_SLAP), LEVEL_UP_MOVE( 1, MOVE_SPLASH), LEVEL_UP_MOVE( 1, MOVE_PLAY_NICE), @@ -15585,7 +15585,7 @@ static const struct LevelUpMove sSteeneeLevelUpLearnset[] = { }; static const struct LevelUpMove sTsareenaLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_TROP_KICK), + LEVEL_UP_MOVE( 0, MOVE_TROP_KICK), LEVEL_UP_MOVE( 1, MOVE_TROP_KICK), LEVEL_UP_MOVE( 1, MOVE_PUNISHMENT), LEVEL_UP_MOVE( 1, MOVE_DOUBLE_SLAP), @@ -15677,7 +15677,7 @@ static const struct LevelUpMove sWimpodLevelUpLearnset[] = { }; static const struct LevelUpMove sGolisopodLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FIRST_IMPRESSION), + LEVEL_UP_MOVE( 0, MOVE_FIRST_IMPRESSION), LEVEL_UP_MOVE( 1, MOVE_FIRST_IMPRESSION), LEVEL_UP_MOVE( 1, MOVE_STRUGGLE_BUG), LEVEL_UP_MOVE( 1, MOVE_SAND_ATTACK), @@ -15779,7 +15779,7 @@ static const struct LevelUpMove sTypeNullLevelUpLearnset[] = { }; static const struct LevelUpMove sSilvallyLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_MULTI_ATTACK), + LEVEL_UP_MOVE( 0, MOVE_MULTI_ATTACK), LEVEL_UP_MOVE( 1, MOVE_MULTI_ATTACK), LEVEL_UP_MOVE( 1, MOVE_HEAL_BLOCK), LEVEL_UP_MOVE( 1, MOVE_IMPRISON), @@ -15979,7 +15979,7 @@ static const struct LevelUpMove sJangmooLevelUpLearnset[] = { }; static const struct LevelUpMove sHakamooLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SKY_UPPERCUT), + LEVEL_UP_MOVE( 0, MOVE_SKY_UPPERCUT), LEVEL_UP_MOVE( 1, MOVE_SKY_UPPERCUT), LEVEL_UP_MOVE( 1, MOVE_AUTOTOMIZE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -16004,7 +16004,7 @@ static const struct LevelUpMove sHakamooLevelUpLearnset[] = { }; static const struct LevelUpMove sKommooLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_CLANGING_SCALES), + LEVEL_UP_MOVE( 0, MOVE_CLANGING_SCALES), LEVEL_UP_MOVE( 1, MOVE_CLANGING_SCALES), LEVEL_UP_MOVE( 1, MOVE_SKY_UPPERCUT), LEVEL_UP_MOVE( 1, MOVE_BELLY_DRUM), @@ -16125,14 +16125,14 @@ static const struct LevelUpMove sCosmogLevelUpLearnset[] = { }; static const struct LevelUpMove sCosmoemLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_COSMIC_POWER), + LEVEL_UP_MOVE( 0, MOVE_COSMIC_POWER), LEVEL_UP_MOVE( 1, MOVE_COSMIC_POWER), LEVEL_UP_MOVE( 1, MOVE_TELEPORT), LEVEL_UP_END }; static const struct LevelUpMove sSolgaleoLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SUNSTEEL_STRIKE), + LEVEL_UP_MOVE( 0, MOVE_SUNSTEEL_STRIKE), LEVEL_UP_MOVE( 1, MOVE_SUNSTEEL_STRIKE), LEVEL_UP_MOVE( 1, MOVE_COSMIC_POWER), LEVEL_UP_MOVE( 1, MOVE_WAKE_UP_SLAP), @@ -16154,7 +16154,7 @@ static const struct LevelUpMove sSolgaleoLevelUpLearnset[] = { }; static const struct LevelUpMove sLunalaLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_MOONGEIST_BEAM), + LEVEL_UP_MOVE( 0, MOVE_MOONGEIST_BEAM), LEVEL_UP_MOVE( 1, MOVE_MOONGEIST_BEAM), LEVEL_UP_MOVE( 1, MOVE_COSMIC_POWER), LEVEL_UP_MOVE( 1, MOVE_HYPNOSIS), @@ -16426,7 +16426,7 @@ static const struct LevelUpMove sPoipoleLevelUpLearnset[] = { }; static const struct LevelUpMove sNaganadelLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_AIR_CUTTER), + LEVEL_UP_MOVE( 0, MOVE_AIR_CUTTER), LEVEL_UP_MOVE( 1, MOVE_AIR_CUTTER), LEVEL_UP_MOVE( 1, MOVE_DRAGON_PULSE), LEVEL_UP_MOVE( 1, MOVE_PECK), @@ -16511,7 +16511,7 @@ static const struct LevelUpMove sMeltanLevelUpLearnset[] = { }; static const struct LevelUpMove sMelmetalLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_THUNDER_PUNCH), + LEVEL_UP_MOVE( 0, MOVE_THUNDER_PUNCH), LEVEL_UP_MOVE( 1, MOVE_THUNDER_PUNCH), LEVEL_UP_MOVE( 1, MOVE_HEADBUTT), LEVEL_UP_MOVE( 1, MOVE_HARDEN), @@ -16548,7 +16548,7 @@ static const struct LevelUpMove sGrookeyLevelUpLearnset[] = { }; static const struct LevelUpMove sThwackeyLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DOUBLE_HIT), + LEVEL_UP_MOVE( 0, MOVE_DOUBLE_HIT), LEVEL_UP_MOVE( 1, MOVE_DOUBLE_HIT), LEVEL_UP_MOVE( 1, MOVE_SCRATCH), LEVEL_UP_MOVE( 1, MOVE_GROWL), @@ -16565,7 +16565,7 @@ static const struct LevelUpMove sThwackeyLevelUpLearnset[] = { }; static const struct LevelUpMove sRillaboomLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DRUM_BEATING), + LEVEL_UP_MOVE( 0, MOVE_DRUM_BEATING), LEVEL_UP_MOVE( 1, MOVE_DRUM_BEATING), LEVEL_UP_MOVE( 1, MOVE_DOUBLE_HIT), LEVEL_UP_MOVE( 1, MOVE_GRASSY_TERRAIN), @@ -16616,7 +16616,7 @@ static const struct LevelUpMove sRabootLevelUpLearnset[] = { }; static const struct LevelUpMove sCinderaceLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PYRO_BALL), + LEVEL_UP_MOVE( 0, MOVE_PYRO_BALL), LEVEL_UP_MOVE( 1, MOVE_PYRO_BALL), LEVEL_UP_MOVE( 1, MOVE_FEINT), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -16665,7 +16665,7 @@ static const struct LevelUpMove sDrizzileLevelUpLearnset[] = { }; static const struct LevelUpMove sInteleonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SNIPE_SHOT), + LEVEL_UP_MOVE( 0, MOVE_SNIPE_SHOT), LEVEL_UP_MOVE( 1, MOVE_SNIPE_SHOT), LEVEL_UP_MOVE( 1, MOVE_ACROBATICS), LEVEL_UP_MOVE( 1, MOVE_POUND), @@ -16701,7 +16701,7 @@ static const struct LevelUpMove sSkwovetLevelUpLearnset[] = { }; static const struct LevelUpMove sGreedentLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_COVET), + LEVEL_UP_MOVE( 0, MOVE_COVET), LEVEL_UP_MOVE( 1, MOVE_COVET), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_TAIL_WHIP), @@ -16750,7 +16750,7 @@ static const struct LevelUpMove sCorvisquireLevelUpLearnset[] = { }; static const struct LevelUpMove sCorviknightLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_STEEL_WING), + LEVEL_UP_MOVE( 0, MOVE_STEEL_WING), LEVEL_UP_MOVE( 1, MOVE_STEEL_WING), LEVEL_UP_MOVE( 1, MOVE_IRON_DEFENSE), LEVEL_UP_MOVE( 1, MOVE_METAL_SOUND), @@ -16774,9 +16774,9 @@ static const struct LevelUpMove sBlipbugLevelUpLearnset[] = { }; static const struct LevelUpMove sDottlerLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_REFLECT), - //LEVEL_UP_MOVE( 0, MOVE_LIGHT_SCREEN), - //LEVEL_UP_MOVE( 0, MOVE_CONFUSION), + LEVEL_UP_MOVE( 0, MOVE_REFLECT), + LEVEL_UP_MOVE( 0, MOVE_LIGHT_SCREEN), + LEVEL_UP_MOVE( 0, MOVE_CONFUSION), LEVEL_UP_MOVE( 1, MOVE_REFLECT), LEVEL_UP_MOVE( 1, MOVE_LIGHT_SCREEN), LEVEL_UP_MOVE( 1, MOVE_CONFUSION), @@ -16820,7 +16820,7 @@ static const struct LevelUpMove sNickitLevelUpLearnset[] = { }; static const struct LevelUpMove sThievulLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_THIEF), + LEVEL_UP_MOVE( 0, MOVE_THIEF), LEVEL_UP_MOVE( 1, MOVE_THIEF), LEVEL_UP_MOVE( 1, MOVE_QUICK_ATTACK), LEVEL_UP_MOVE( 1, MOVE_TAIL_WHIP), @@ -16853,7 +16853,7 @@ static const struct LevelUpMove sGossifleurLevelUpLearnset[] = { }; static const struct LevelUpMove sEldegossLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_COTTON_SPORE), + LEVEL_UP_MOVE( 0, MOVE_COTTON_SPORE), LEVEL_UP_MOVE( 1, MOVE_COTTON_SPORE), LEVEL_UP_MOVE( 1, MOVE_LEAFAGE), LEVEL_UP_MOVE( 1, MOVE_SING), @@ -16917,7 +16917,7 @@ static const struct LevelUpMove sChewtleLevelUpLearnset[] = { }; static const struct LevelUpMove sDrednawLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ROCK_TOMB), + LEVEL_UP_MOVE( 0, MOVE_ROCK_TOMB), LEVEL_UP_MOVE( 1, MOVE_ROCK_TOMB), LEVEL_UP_MOVE( 1, MOVE_RAZOR_SHELL), LEVEL_UP_MOVE( 1, MOVE_CRUNCH), @@ -16982,7 +16982,7 @@ static const struct LevelUpMove sRolycolyLevelUpLearnset[] = { }; static const struct LevelUpMove sCarkolLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FLAME_CHARGE), + LEVEL_UP_MOVE( 0, MOVE_FLAME_CHARGE), LEVEL_UP_MOVE( 1, MOVE_FLAME_CHARGE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_SMOKESCREEN), @@ -16999,7 +16999,7 @@ static const struct LevelUpMove sCarkolLevelUpLearnset[] = { }; static const struct LevelUpMove sCoalossalLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_TAR_SHOT), + LEVEL_UP_MOVE( 0, MOVE_TAR_SHOT), LEVEL_UP_MOVE( 1, MOVE_TAR_SHOT), LEVEL_UP_MOVE( 1, MOVE_FLAME_CHARGE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -17023,7 +17023,7 @@ static const struct LevelUpMove sApplinLevelUpLearnset[] = { }; static const struct LevelUpMove sFlappleLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_WING_ATTACK), + LEVEL_UP_MOVE( 0, MOVE_WING_ATTACK), LEVEL_UP_MOVE( 1, MOVE_WING_ATTACK), LEVEL_UP_MOVE( 1, MOVE_RECYCLE), LEVEL_UP_MOVE( 1, MOVE_WITHDRAW), @@ -17045,7 +17045,7 @@ static const struct LevelUpMove sFlappleLevelUpLearnset[] = { }; static const struct LevelUpMove sAppletunLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HEADBUTT), + LEVEL_UP_MOVE( 0, MOVE_HEADBUTT), LEVEL_UP_MOVE( 1, MOVE_HEADBUTT), LEVEL_UP_MOVE( 1, MOVE_RECYCLE), LEVEL_UP_MOVE( 1, MOVE_WITHDRAW), @@ -17156,7 +17156,7 @@ static const struct LevelUpMove sToxelLevelUpLearnset[] = { }; static const struct LevelUpMove sToxtricityLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SPARK), + LEVEL_UP_MOVE( 0, MOVE_SPARK), LEVEL_UP_MOVE( 1, MOVE_SPARK), LEVEL_UP_MOVE( 1, MOVE_EERIE_IMPULSE), LEVEL_UP_MOVE( 1, MOVE_BELCH), @@ -17236,7 +17236,7 @@ static const struct LevelUpMove sClobbopusLevelUpLearnset[] = { }; static const struct LevelUpMove sGrapploctLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_OCTOLOCK), + LEVEL_UP_MOVE( 0, MOVE_OCTOLOCK), LEVEL_UP_MOVE( 1, MOVE_OCTOLOCK), LEVEL_UP_MOVE( 1, MOVE_OCTAZOOKA), LEVEL_UP_MOVE( 1, MOVE_ROCK_SMASH), @@ -17271,7 +17271,7 @@ static const struct LevelUpMove sSinisteaLevelUpLearnset[] = { }; static const struct LevelUpMove sPolteageistLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_TEATIME), + LEVEL_UP_MOVE( 0, MOVE_TEATIME), LEVEL_UP_MOVE( 1, MOVE_TEATIME), LEVEL_UP_MOVE( 1, MOVE_STRENGTH_SAP), LEVEL_UP_MOVE( 1, MOVE_ASTONISH), @@ -17306,7 +17306,7 @@ static const struct LevelUpMove sHatennaLevelUpLearnset[] = { }; static const struct LevelUpMove sHattremLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_BRUTAL_SWING), + LEVEL_UP_MOVE( 0, MOVE_BRUTAL_SWING), LEVEL_UP_MOVE( 1, MOVE_BRUTAL_SWING), LEVEL_UP_MOVE( 1, MOVE_CONFUSION), LEVEL_UP_MOVE( 1, MOVE_PLAY_NICE), @@ -17323,7 +17323,7 @@ static const struct LevelUpMove sHattremLevelUpLearnset[] = { }; static const struct LevelUpMove sHattereneLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PSYCHO_CUT), + LEVEL_UP_MOVE( 0, MOVE_PSYCHO_CUT), LEVEL_UP_MOVE( 1, MOVE_PSYCHO_CUT), LEVEL_UP_MOVE( 1, MOVE_BRUTAL_SWING), LEVEL_UP_MOVE( 1, MOVE_CONFUSION), @@ -17359,7 +17359,7 @@ static const struct LevelUpMove sImpidimpLevelUpLearnset[] = { }; static const struct LevelUpMove sMorgremLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_FALSE_SURRENDER), + LEVEL_UP_MOVE( 0, MOVE_FALSE_SURRENDER), LEVEL_UP_MOVE( 1, MOVE_FALSE_SURRENDER), LEVEL_UP_MOVE( 1, MOVE_FAKE_OUT), LEVEL_UP_MOVE( 1, MOVE_CONFIDE), @@ -17378,7 +17378,7 @@ static const struct LevelUpMove sMorgremLevelUpLearnset[] = { }; static const struct LevelUpMove sGrimmsnarlLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SPIRIT_BREAK), + LEVEL_UP_MOVE( 0, MOVE_SPIRIT_BREAK), LEVEL_UP_MOVE( 1, MOVE_SPIRIT_BREAK), LEVEL_UP_MOVE( 1, MOVE_FALSE_SURRENDER), LEVEL_UP_MOVE( 1, MOVE_BULK_UP), @@ -17401,7 +17401,7 @@ static const struct LevelUpMove sGrimmsnarlLevelUpLearnset[] = { }; static const struct LevelUpMove sObstagoonLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_OBSTRUCT), + LEVEL_UP_MOVE( 0, MOVE_OBSTRUCT), LEVEL_UP_MOVE( 1, MOVE_OBSTRUCT), LEVEL_UP_MOVE( 1, MOVE_CROSS_CHOP), LEVEL_UP_MOVE( 1, MOVE_SUBMISSION), @@ -17427,7 +17427,7 @@ static const struct LevelUpMove sObstagoonLevelUpLearnset[] = { }; static const struct LevelUpMove sPerrserkerLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_IRON_HEAD), + LEVEL_UP_MOVE( 0, MOVE_IRON_HEAD), LEVEL_UP_MOVE( 1, MOVE_IRON_HEAD), LEVEL_UP_MOVE( 1, MOVE_METAL_BURST), LEVEL_UP_MOVE( 1, MOVE_IRON_DEFENSE), @@ -17466,7 +17466,7 @@ static const struct LevelUpMove sCursolaLevelUpLearnset[] = { }; static const struct LevelUpMove sSirfetchdLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_IRON_DEFENSE), + LEVEL_UP_MOVE( 0, MOVE_IRON_DEFENSE), LEVEL_UP_MOVE( 1, MOVE_IRON_DEFENSE), LEVEL_UP_MOVE( 1, MOVE_FIRST_IMPRESSION), LEVEL_UP_MOVE( 1, MOVE_PECK), @@ -17523,7 +17523,7 @@ static const struct LevelUpMove sMrRimeLevelUpLearnset[] = { }; static const struct LevelUpMove sRunerigusLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SHADOW_CLAW), + LEVEL_UP_MOVE( 0, MOVE_SHADOW_CLAW), LEVEL_UP_MOVE( 1, MOVE_SHADOW_CLAW), LEVEL_UP_MOVE( 1, MOVE_SCARY_FACE), LEVEL_UP_MOVE( 1, MOVE_ASTONISH), @@ -17562,7 +17562,7 @@ static const struct LevelUpMove sMilceryLevelUpLearnset[] = { }; static const struct LevelUpMove sAlcremieLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DECORATE), + LEVEL_UP_MOVE( 0, MOVE_DECORATE), LEVEL_UP_MOVE( 1, MOVE_DECORATE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_AROMATIC_MIST), @@ -17622,7 +17622,7 @@ static const struct LevelUpMove sSnomLevelUpLearnset[] = { }; static const struct LevelUpMove sFrosmothLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ICY_WIND), + LEVEL_UP_MOVE( 0, MOVE_ICY_WIND), LEVEL_UP_MOVE( 1, MOVE_ICY_WIND), LEVEL_UP_MOVE( 1, MOVE_POWDER_SNOW), LEVEL_UP_MOVE( 1, MOVE_STRUGGLE_BUG), @@ -17730,7 +17730,7 @@ static const struct LevelUpMove sCufantLevelUpLearnset[] = { }; static const struct LevelUpMove sCopperajahLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HEAVY_SLAM), + LEVEL_UP_MOVE( 0, MOVE_HEAVY_SLAM), LEVEL_UP_MOVE( 1, MOVE_HEAVY_SLAM), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 1, MOVE_GROWL), @@ -17842,7 +17842,7 @@ static const struct LevelUpMove sDreepyLevelUpLearnset[] = { }; static const struct LevelUpMove sDrakloakLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DRAGON_PULSE), + LEVEL_UP_MOVE( 0, MOVE_DRAGON_PULSE), LEVEL_UP_MOVE( 1, MOVE_DRAGON_PULSE), LEVEL_UP_MOVE( 1, MOVE_ASTONISH), LEVEL_UP_MOVE( 1, MOVE_INFESTATION), @@ -17864,7 +17864,7 @@ static const struct LevelUpMove sDrakloakLevelUpLearnset[] = { }; static const struct LevelUpMove sDragapultLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DRAGON_DARTS), + LEVEL_UP_MOVE( 0, MOVE_DRAGON_DARTS), LEVEL_UP_MOVE( 1, MOVE_DRAGON_DARTS), LEVEL_UP_MOVE( 1, MOVE_DRAGON_BREATH), LEVEL_UP_MOVE( 1, MOVE_SUCKER_PUNCH), @@ -17962,7 +17962,7 @@ static const struct LevelUpMove sKubfuLevelUpLearnset[] = { }; static const struct LevelUpMove sUrshifuLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_WICKED_BLOW), + LEVEL_UP_MOVE( 0, MOVE_WICKED_BLOW), LEVEL_UP_MOVE( 1, MOVE_WICKED_BLOW), LEVEL_UP_MOVE( 1, MOVE_SUCKER_PUNCH), LEVEL_UP_MOVE( 1, MOVE_ROCK_SMASH), @@ -18206,7 +18206,7 @@ static const struct LevelUpMove sRattataAlolanLevelUpLearnset[] = { }; static const struct LevelUpMove sRaticateAlolanLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SCARY_FACE), + LEVEL_UP_MOVE( 0, MOVE_SCARY_FACE), LEVEL_UP_MOVE( 1, MOVE_SCARY_FACE), LEVEL_UP_MOVE( 1, MOVE_SWORDS_DANCE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -18228,7 +18228,7 @@ static const struct LevelUpMove sRaticateAlolanLevelUpLearnset[] = { }; static const struct LevelUpMove sRaichuAlolanLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PSYCHIC), + LEVEL_UP_MOVE( 0, MOVE_PSYCHIC), LEVEL_UP_MOVE( 1, MOVE_PSYCHIC), LEVEL_UP_MOVE( 1, MOVE_SPEED_SWAP), LEVEL_UP_MOVE( 1, MOVE_THUNDER_SHOCK), @@ -18260,7 +18260,7 @@ static const struct LevelUpMove sSandshrewAlolanLevelUpLearnset[] = { }; static const struct LevelUpMove sSandslashAlolanLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ICICLE_SPEAR), + LEVEL_UP_MOVE( 0, MOVE_ICICLE_SPEAR), LEVEL_UP_MOVE( 1, MOVE_ICICLE_SPEAR), LEVEL_UP_MOVE( 1, MOVE_METAL_BURST), LEVEL_UP_MOVE( 1, MOVE_ICICLE_CRASH), @@ -18296,7 +18296,7 @@ static const struct LevelUpMove sVulpixAlolanLevelUpLearnset[] = { }; static const struct LevelUpMove sNinetalesAlolanLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DAZZLING_GLEAM), + LEVEL_UP_MOVE( 0, MOVE_DAZZLING_GLEAM), LEVEL_UP_MOVE( 1, MOVE_DAZZLING_GLEAM), LEVEL_UP_MOVE( 1, MOVE_IMPRISON), LEVEL_UP_MOVE( 1, MOVE_NASTY_PLOT), @@ -18326,7 +18326,7 @@ static const struct LevelUpMove sDiglettAlolanLevelUpLearnset[] = { }; static const struct LevelUpMove sDugtrioAlolanLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SAND_TOMB), + LEVEL_UP_MOVE( 0, MOVE_SAND_TOMB), LEVEL_UP_MOVE( 1, MOVE_SAND_TOMB), LEVEL_UP_MOVE( 1, MOVE_ROTOTILLER), LEVEL_UP_MOVE( 1, MOVE_NIGHT_SLASH), @@ -18370,7 +18370,7 @@ static const struct LevelUpMove sMeowthAlolanLevelUpLearnset[] = { }; static const struct LevelUpMove sPersianAlolanLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SWIFT), + LEVEL_UP_MOVE( 0, MOVE_SWIFT), LEVEL_UP_MOVE( 1, MOVE_SWIFT), LEVEL_UP_MOVE( 1, MOVE_QUASH), LEVEL_UP_MOVE( 1, MOVE_PLAY_ROUGH), @@ -18483,7 +18483,7 @@ static const struct LevelUpMove sGrimerAlolanLevelUpLearnset[] = { }; static const struct LevelUpMove sMukAlolanLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_VENOM_DRENCH), + LEVEL_UP_MOVE( 0, MOVE_VENOM_DRENCH), LEVEL_UP_MOVE( 1, MOVE_VENOM_DRENCH), LEVEL_UP_MOVE( 1, MOVE_POUND), LEVEL_UP_MOVE( 1, MOVE_POISON_GAS), @@ -18507,7 +18507,7 @@ static const struct LevelUpMove sMukAlolanLevelUpLearnset[] = { }; static const struct LevelUpMove sExeggutorAlolanLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DRAGON_HAMMER), + LEVEL_UP_MOVE( 0, MOVE_DRAGON_HAMMER), LEVEL_UP_MOVE( 1, MOVE_DRAGON_HAMMER), LEVEL_UP_MOVE( 1, MOVE_SEED_BOMB), LEVEL_UP_MOVE( 1, MOVE_BARRAGE), @@ -18579,7 +18579,7 @@ static const struct LevelUpMove sPonytaGalarianLevelUpLearnset[] = { }; static const struct LevelUpMove sRapidashGalarianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_PSYCHO_CUT), + LEVEL_UP_MOVE( 0, MOVE_PSYCHO_CUT), LEVEL_UP_MOVE( 1, MOVE_PSYCHO_CUT), LEVEL_UP_MOVE( 1, MOVE_MEGAHORN), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -18621,7 +18621,7 @@ static const struct LevelUpMove sSlowpokeGalarianLevelUpLearnset[] = { }; static const struct LevelUpMove sSlowbroGalarianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SHELL_SIDE_ARM), + LEVEL_UP_MOVE( 0, MOVE_SHELL_SIDE_ARM), LEVEL_UP_MOVE( 1, MOVE_SHELL_SIDE_ARM), LEVEL_UP_MOVE( 1, MOVE_WITHDRAW), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -18664,7 +18664,7 @@ static const struct LevelUpMove sFarfetchdGalarianLevelUpLearnset[] = { }; static const struct LevelUpMove sWeezingGalarianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_DOUBLE_HIT), + LEVEL_UP_MOVE( 0, MOVE_DOUBLE_HIT), LEVEL_UP_MOVE( 1, MOVE_DOUBLE_HIT), LEVEL_UP_MOVE( 1, MOVE_STRANGE_STEAM), LEVEL_UP_MOVE( 1, MOVE_DEFOG), @@ -18782,7 +18782,7 @@ static const struct LevelUpMove sMoltresGalarianLevelUpLearnset[] = { }; static const struct LevelUpMove sSlowkingGalarianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_EERIE_SPELL), + LEVEL_UP_MOVE( 0, MOVE_EERIE_SPELL), LEVEL_UP_MOVE( 1, MOVE_EERIE_SPELL), LEVEL_UP_MOVE( 1, MOVE_POWER_GEM), LEVEL_UP_MOVE( 1, MOVE_NASTY_PLOT), @@ -18843,7 +18843,7 @@ static const struct LevelUpMove sZigzagoonGalarianLevelUpLearnset[] = { }; static const struct LevelUpMove sLinooneGalarianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_NIGHT_SLASH), + LEVEL_UP_MOVE( 0, MOVE_NIGHT_SLASH), LEVEL_UP_MOVE( 1, MOVE_NIGHT_SLASH), LEVEL_UP_MOVE( 1, MOVE_SWITCHEROO), LEVEL_UP_MOVE( 1, MOVE_PIN_MISSILE), @@ -18885,7 +18885,7 @@ static const struct LevelUpMove sDarumakaGalarianLevelUpLearnset[] = { }; static const struct LevelUpMove sDarmanitanGalarianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ICICLE_CRASH), + LEVEL_UP_MOVE( 0, MOVE_ICICLE_CRASH), LEVEL_UP_MOVE( 1, MOVE_ICICLE_CRASH), LEVEL_UP_MOVE( 1, MOVE_POWDER_SNOW), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -18995,7 +18995,7 @@ static const struct LevelUpMove sElectrodeHisuianLevelUpLearnset[] = { }; static const struct LevelUpMove sTyphlosionHisuianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_HEX), + LEVEL_UP_MOVE( 0, MOVE_HEX), LEVEL_UP_MOVE( 1, MOVE_QUICK_ATTACK), LEVEL_UP_MOVE( 6, MOVE_EMBER), LEVEL_UP_MOVE(11, MOVE_ROLLOUT), @@ -19035,7 +19035,7 @@ static const struct LevelUpMove sSneaselHisuianLevelUpLearnset[] = { #if P_GEN_5_POKEMON == TRUE static const struct LevelUpMove sSamurottHisuianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_NIGHT_SLASH), + LEVEL_UP_MOVE( 0, MOVE_NIGHT_SLASH), LEVEL_UP_MOVE( 1, MOVE_TACKLE), //LEVEL_UP_MOVE( 6, MOVE_AQUA_JET), LEVEL_UP_MOVE(11, MOVE_SWORDS_DANCE), @@ -19049,7 +19049,7 @@ static const struct LevelUpMove sSamurottHisuianLevelUpLearnset[] = { }; static const struct LevelUpMove sLilligantHisuianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ROCK_SMASH), + LEVEL_UP_MOVE( 0, MOVE_ROCK_SMASH), LEVEL_UP_MOVE( 1, MOVE_ABSORB), //LEVEL_UP_MOVE( 5, MOVE_LEAFAGE), LEVEL_UP_MOVE( 9, MOVE_STUN_SPORE), @@ -19131,7 +19131,7 @@ static const struct LevelUpMove sGoodraHisuianLevelUpLearnset[] = { }; static const struct LevelUpMove sAvaluggHisuianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ROCK_SLIDE), + LEVEL_UP_MOVE( 0, MOVE_ROCK_SLIDE), LEVEL_UP_MOVE( 1, MOVE_TACKLE), LEVEL_UP_MOVE( 5, MOVE_POWDER_SNOW), //LEVEL_UP_MOVE( 9, MOVE_ICE_SHARD), @@ -19148,7 +19148,7 @@ static const struct LevelUpMove sAvaluggHisuianLevelUpLearnset[] = { #if P_GEN_7_POKEMON == TRUE static const struct LevelUpMove sDecidueyeHisuianLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_ROCK_SMASH), + LEVEL_UP_MOVE( 0, MOVE_ROCK_SMASH), LEVEL_UP_MOVE( 1, MOVE_GUST), //LEVEL_UP_MOVE( 6, MOVE_LEAFAGE), LEVEL_UP_MOVE(11, MOVE_ROOST), @@ -19222,7 +19222,7 @@ static const struct LevelUpMove sDeoxysSpeedLevelUpLearnset[] = { #if P_GEN_4_POKEMON == TRUE static const struct LevelUpMove sWormadamSandyCloakLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), + LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_SUCKER_PUNCH), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -19245,7 +19245,7 @@ static const struct LevelUpMove sWormadamSandyCloakLevelUpLearnset[] = { }; static const struct LevelUpMove sWormadamTrashCloakLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), + LEVEL_UP_MOVE( 0, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_QUIVER_DANCE), LEVEL_UP_MOVE( 1, MOVE_METAL_BURST), LEVEL_UP_MOVE( 1, MOVE_SUCKER_PUNCH), @@ -19398,7 +19398,7 @@ static const struct LevelUpMove sHoopaUnboundLevelUpLearnset[] = { #if P_GEN_7_POKEMON == TRUE static const struct LevelUpMove sLycanrocMidnightLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_COUNTER), + LEVEL_UP_MOVE( 0, MOVE_COUNTER), LEVEL_UP_MOVE( 1, MOVE_REVERSAL), LEVEL_UP_MOVE( 1, MOVE_TAUNT), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -19420,7 +19420,7 @@ static const struct LevelUpMove sLycanrocMidnightLevelUpLearnset[] = { }; static const struct LevelUpMove sLycanrocDuskLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_THRASH), + LEVEL_UP_MOVE( 0, MOVE_THRASH), LEVEL_UP_MOVE( 1, MOVE_ACCELEROCK), LEVEL_UP_MOVE( 1, MOVE_COUNTER), LEVEL_UP_MOVE( 1, MOVE_TACKLE), @@ -19444,7 +19444,7 @@ static const struct LevelUpMove sLycanrocDuskLevelUpLearnset[] = { #if P_GEN_8_POKEMON == TRUE static const struct LevelUpMove sToxtricityLowKeyLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SPARK), + LEVEL_UP_MOVE( 0, MOVE_SPARK), LEVEL_UP_MOVE( 1, MOVE_SPARK), LEVEL_UP_MOVE( 1, MOVE_EERIE_IMPULSE), LEVEL_UP_MOVE( 1, MOVE_BELCH), @@ -19491,7 +19491,7 @@ static const struct LevelUpMove sIndeedeeFemaleLevelUpLearnset[] = { }; static const struct LevelUpMove sUrshifuRapidStrikeStyleLevelUpLearnset[] = { - //LEVEL_UP_MOVE( 0, MOVE_SURGING_STRIKES), + LEVEL_UP_MOVE( 0, MOVE_SURGING_STRIKES), LEVEL_UP_MOVE( 1, MOVE_SURGING_STRIKES), LEVEL_UP_MOVE( 1, MOVE_AQUA_JET), LEVEL_UP_MOVE( 1, MOVE_ROCK_SMASH), From 4cbc6d4de1e083492ff9302fe9bd1b5fab0db1ef Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Fri, 14 Oct 2022 22:31:45 -0300 Subject: [PATCH 38/58] Config for running indoors --- include/constants/overworld_config.h | 7 +++++-- src/bike.c | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/include/constants/overworld_config.h b/include/constants/overworld_config.h index 50f45933d..64437ca9b 100644 --- a/include/constants/overworld_config.h +++ b/include/constants/overworld_config.h @@ -1,9 +1,12 @@ #ifndef GUARD_CONSTANTS_OVERWORLD_CONFIG_H #define GUARD_CONSTANTS_OVERWORLD_CONFIG_H +// Movement config +#define OW_RUNNING_INDOORS GEN_LATEST // In Gen4+, players are allowed to run indoors. + // Overworld flags -#define OW_FLAG_NO_ENCOUNTER 0 // If this flag is set, wild encounters will be disabled. -#define OW_FLAG_NO_TRAINER_SEE 0 // If this flag is set, trainers will not battle the player unless they're talked to. +#define OW_FLAG_NO_ENCOUNTER 0 // If this flag is set, wild encounters will be disabled. +#define OW_FLAG_NO_TRAINER_SEE 0 // If this flag is set, trainers will not battle the player unless they're talked to. // Debug options #define DEBUG_SYSTEM_ENABLE TRUE // Enables a overworld debug menu for changing flags, variables, giving pokemon and more, accessed by holding R and pressing START while in the overworld by default. diff --git a/src/bike.c b/src/bike.c index ae30ce288..8f3faa2da 100644 --- a/src/bike.c +++ b/src/bike.c @@ -1053,7 +1053,11 @@ void Bike_HandleBumpySlopeJump(void) bool32 IsRunningDisallowed(u8 metatile) { +#if OW_RUNNING_INDOORS == GEN_3 if (!gMapHeader.allowRunning || IsRunningDisallowedByMetatile(metatile) == TRUE) +#else + if (IsRunningDisallowedByMetatile(metatile) == TRUE) +#endif return TRUE; else return FALSE; From dd2d6107bded2f849524cbc5a9981f7027710bb5 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 16 Oct 2022 09:57:21 -0300 Subject: [PATCH 39/58] =?UTF-8?q?Fixed=20Z-Move=20not=20being=20cleared=20?= =?UTF-8?q?if=20Pok=C3=A9mon=20faints?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/battle_main.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/battle_main.c b/src/battle_main.c index 385faf2e3..5b6e724c9 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3303,6 +3303,11 @@ void FaintClearSetData(void) } } } + + // Clear Z-Move data + gBattleStruct->zmove.active = FALSE; + gBattleStruct->zmove.toBeUsed[gActiveBattler] = MOVE_NONE; + gBattleStruct->zmove.effect = EFFECT_HIT; } static void DoBattleIntro(void) From 160729198254b02890626fe609b09a8d25411b31 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Sun, 16 Oct 2022 20:20:13 -0300 Subject: [PATCH 40/58] Implemented Honey's Sweet Scent functionality --- include/fldeff.h | 1 + include/item_use.h | 1 + src/data/items.h | 4 ++-- src/fldeff_sweetscent.c | 6 +++--- src/item_use.c | 25 +++++++++++++++++++++++++ 5 files changed, 32 insertions(+), 5 deletions(-) diff --git a/include/fldeff.h b/include/fldeff.h index 0ad0e3d60..bed235a1b 100644 --- a/include/fldeff.h +++ b/include/fldeff.h @@ -35,6 +35,7 @@ bool8 FldEff_UseStrength(void); // sweet scent bool8 SetUpFieldMove_SweetScent(void); bool8 FldEff_SweetScent(void); +void StartSweetScentFieldEffect(void); // teleport bool8 SetUpFieldMove_Teleport(void); diff --git a/include/item_use.h b/include/item_use.h index d55f7cf0d..51d7fced4 100644 --- a/include/item_use.h +++ b/include/item_use.h @@ -27,6 +27,7 @@ void ItemUseOutOfBattle_Berry(u8); void ItemUseOutOfBattle_EnigmaBerry(u8); void ItemUseOutOfBattle_FormChange(u8); void ItemUseOutOfBattle_FormChange_ConsumedOnUse(u8); +void ItemUseOutOfBattle_Honey(u8); void ItemUseOutOfBattle_CannotUse(u8); void ItemUseInBattle_PokeBall(u8); void ItemUseInBattle_StatIncrease(u8); diff --git a/src/data/items.h b/src/data/items.h index b0b53c31f..847e326d2 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -2035,8 +2035,8 @@ const struct Item gItems[] = .price = 300, .description = sHoneyDesc, .pocket = POCKET_ITEMS, - .type = ITEM_USE_BAG_MENU, - .fieldUseFunc = ItemUseOutOfBattle_CannotUse, + .type = ITEM_USE_FIELD, + .fieldUseFunc = ItemUseOutOfBattle_Honey, .flingPower = 30, }, diff --git a/src/fldeff_sweetscent.c b/src/fldeff_sweetscent.c index 7e9352609..5ed133e5d 100644 --- a/src/fldeff_sweetscent.c +++ b/src/fldeff_sweetscent.c @@ -19,7 +19,6 @@ #include "constants/songs.h" static void FieldCallback_SweetScent(void); -static void StartSweetScentFieldEffect(void); static void TrySweetScentEncounter(u8 taskId); static void FailSweetScentEncounter(u8 taskId); @@ -47,14 +46,15 @@ bool8 FldEff_SweetScent(void) return FALSE; } -static void StartSweetScentFieldEffect(void) +void StartSweetScentFieldEffect(void) { u8 taskId; + u32 palettes = ~(1 << (gSprites[GetPlayerAvatarSpriteId()].oam.paletteNum + 16) | (1 << 13) | (1 << 14) | (1 << 15)); PlaySE(SE_M_SWEET_SCENT); CpuFastSet(gPlttBufferUnfaded, gPaletteDecompressionBuffer, 0x100); CpuFastSet(gPlttBufferFaded, gPlttBufferUnfaded, 0x100); - BeginNormalPaletteFade(~(1 << (gSprites[GetPlayerAvatarSpriteId()].oam.paletteNum + 16)), 4, 0, 8, RGB_RED); + BeginNormalPaletteFade(palettes, 4, 0, 8, RGB_RED); taskId = CreateTask(TrySweetScentEncounter, 0); gTasks[taskId].data[0] = 0; FieldEffectActiveListRemove(FLDEFF_SWEET_SCENT); diff --git a/src/item_use.c b/src/item_use.c index 913c0700f..f72213d42 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -18,6 +18,7 @@ #include "field_player_avatar.h" #include "field_screen_effect.h" #include "field_weather.h" +#include "fldeff.h" #include "item.h" #include "item_menu.h" #include "item_use.h" @@ -71,6 +72,7 @@ static void Task_UseRepel(u8); static void Task_CloseCantUseKeyItemMessage(u8); static void SetDistanceOfClosestHiddenItem(u8, s16, s16); static void CB2_OpenPokeblockFromBag(void); +static void ItemUseOnFieldCB_Honey(u8 taskId); // EWRAM variables EWRAM_DATA static void(*sItemUseOnFieldCB)(u8 taskId) = NULL; @@ -1202,6 +1204,29 @@ void ItemUseOutOfBattle_FormChange_ConsumedOnUse(u8 taskId) SetUpItemUseCallback(taskId); } +void Task_UseHoneyOnField(u8 taskId) +{ + //ResetInitialPlayerAvatarState(); + StartSweetScentFieldEffect(); + DestroyTask(taskId); +} + +static void ItemUseOnFieldCB_Honey(u8 taskId) +{ + Overworld_ResetStateAfterDigEscRope(); + RemoveUsedItem(); + gTasks[taskId].data[0] = 0; + DisplayItemMessageOnField(taskId, gStringVar4, Task_UseHoneyOnField); +} + +void ItemUseOutOfBattle_Honey(u8 taskId) +{ + sItemUseOnFieldCB = ItemUseOnFieldCB_Honey; + gFieldCallback = FieldCB_UseItemOnField; + gBagMenu->newScreenCallback = CB2_ReturnToField; + Task_FadeAndCloseBagMenu(taskId); +} + void ItemUseOutOfBattle_CannotUse(u8 taskId) { DisplayDadsAdviceCannotUseItemMessage(taskId, gTasks[taskId].tUsingRegisteredKeyItem); From 71023512fda99de8b86708c3399d39bb29a05d01 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 16 Oct 2022 19:20:24 -0400 Subject: [PATCH 41/58] update psycho cut anim --- data/battle_anim_scripts.s | 29 +++++++++++++++++------------ 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index e5f32e09a..19bc5edb0 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -2987,21 +2987,26 @@ Move_MUD_BOMB: end Move_PSYCHO_CUT: - loadspritegfx ANIM_TAG_SPIRAL - loadspritegfx ANIM_TAG_PSYCHO_CUT - monbg ANIM_ATK_PARTNER + loadspritegfx ANIM_TAG_SPIRAL + loadspritegfx ANIM_TAG_PSYCHO_CUT + loadspritegfx ANIM_TAG_CROSS_IMPACT + monbg ANIM_ATK_PARTNER + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_CROSS_IMPACT, 0, 9, 9, RGB_PURPLE + createvisualtask AnimTask_SwayMon, 5, 0, 6, 2048, 2, ANIM_ATTACKER createsprite gPsychoCutSpiralSpriteTemplate, 2, 4, 0, 0, 0, 0 createvisualtask AnimTask_BlendBattleAnimPal, 1, 1, 2, 0, 4, RGB_BLACK - createvisualtask AnimTask_BlendBattleAnimPal, 1, 2, 2, 0, 10, RGB(20, 12, 23) + createvisualtask AnimTask_BlendBattleAnimPal, 1, 2, 2, 0, 10, RGB(20, 12, 23) delay 30 - clearmonbg ANIM_ATK_PARTNER - waitforvisualfinish - monbg ANIM_TARGET - splitbgprio ANIM_TARGET - setalpha 12, 8 - playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER, - createsprite gPsychoCutSpriteTemplate, 130, 5, 20, 0, -8, 0, 20 - waitforvisualfinish + clearmonbg ANIM_ATK_PARTNER + waitforvisualfinish + monbg ANIM_TARGET + splitbgprio ANIM_TARGET + setalpha 12, 8 + playsewithpan SE_M_RAZOR_WIND2, SOUND_PAN_ATTACKER, + createsprite gPsychoCutSpriteTemplate, ANIM_TARGET, 2, 20, 0, -8, 0, 20 + waitforvisualfinish + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 7, 0, 9, 1 + createsprite gCrossImpactSpriteTemplate, ANIM_ATTACKER, 3, 0, 0, 1, 20 createvisualtask AnimTask_BlendBattleAnimPal, 1, 1, 2, 4, 0, RGB_BLACK createvisualtask AnimTask_BlendBattleAnimPal, 1, 2, 2, 10, 0, RGB(20, 12, 23) clearmonbg ANIM_TARGET From a585d56053af0f1b9664e184e91fd94139e4efd3 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 16 Oct 2022 23:39:12 -0400 Subject: [PATCH 42/58] fix whitespace --- data/battle_anim_scripts.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 19bc5edb0..ff407c0c4 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -2995,7 +2995,7 @@ Move_PSYCHO_CUT: createvisualtask AnimTask_SwayMon, 5, 0, 6, 2048, 2, ANIM_ATTACKER createsprite gPsychoCutSpiralSpriteTemplate, 2, 4, 0, 0, 0, 0 createvisualtask AnimTask_BlendBattleAnimPal, 1, 1, 2, 0, 4, RGB_BLACK - createvisualtask AnimTask_BlendBattleAnimPal, 1, 2, 2, 0, 10, RGB(20, 12, 23) + createvisualtask AnimTask_BlendBattleAnimPal, 1, 2, 2, 0, 10, RGB(20, 12, 23) delay 30 clearmonbg ANIM_ATK_PARTNER waitforvisualfinish From 610a8efb7d1f50c222d2bbd7b8cb299728605fde Mon Sep 17 00:00:00 2001 From: gruxor Date: Mon, 17 Oct 2022 11:21:06 -0400 Subject: [PATCH 43/58] Replaced busy-wait loops --- src/main.c | 4 +--- src/pokemon_debug.c | 6 +++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 99d2610bb..3a306b2cf 100644 --- a/src/main.c +++ b/src/main.c @@ -408,9 +408,7 @@ static void IntrDummy(void) static void WaitForVBlank(void) { gMain.intrCheck &= ~INTR_FLAG_VBLANK; - - while (!(gMain.intrCheck & INTR_FLAG_VBLANK)) - ; + VBlankIntrWait(); } void SetTrainerHillVBlankCounter(u32 *counter) diff --git a/src/pokemon_debug.c b/src/pokemon_debug.c index 8a047e397..447590e28 100644 --- a/src/pokemon_debug.c +++ b/src/pokemon_debug.c @@ -1380,7 +1380,7 @@ static void UpdateSubmenuOneOptionValue(u8 taskId, bool8 increment) UpdateBattlerValue(data); ReloadPokemonSprites(data); - while (!(gMain.intrCheck & INTR_FLAG_VBLANK)); + VBlankIntrWait(); PlaySE(SE_DEX_SCROLL); } break; @@ -1499,7 +1499,7 @@ static void Handle_Input_Debug_Pokemon(u8 taskId) PrintDigitChars(data); UpdateBattlerValue(data); ReloadPokemonSprites(data); - while (!(gMain.intrCheck & INTR_FLAG_VBLANK)); + VBlankIntrWait(); PlaySE(SE_DEX_SCROLL); } @@ -1531,7 +1531,7 @@ static void Handle_Input_Debug_Pokemon(u8 taskId) ResetOffsetSpriteValues(data); } PlaySE(SE_DEX_SCROLL); - while (!(gMain.intrCheck & INTR_FLAG_VBLANK)); + VBlankIntrWait(); } else if (JOY_NEW(DPAD_UP)) { From 3775c5d00c5ec5468388806d89a98d68864bc909 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 22 Oct 2022 18:54:25 +1300 Subject: [PATCH 44/58] Fix move effects Restore unintentionally removed MOVEEND_DEFROST, fix move effect definitions. --- include/constants/battle.h | 122 ++++--- include/constants/battle_move_effects.h | 358 ++++++++++----------- include/constants/battle_script_commands.h | 18 +- 3 files changed, 246 insertions(+), 252 deletions(-) diff --git a/include/constants/battle.h b/include/constants/battle.h index 9f79e7672..0cb022758 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -307,70 +307,66 @@ #define MOVE_EFFECT_PAYDAY 0xB #define MOVE_EFFECT_CHARGING 0xC #define MOVE_EFFECT_WRAP 0xD -#define MOVE_EFFECT_RECOIL_25 0xE -#define MOVE_EFFECT_ATK_PLUS_1 0xF -#define MOVE_EFFECT_DEF_PLUS_1 0x10 -#define MOVE_EFFECT_SPD_PLUS_1 0x11 -#define MOVE_EFFECT_SP_ATK_PLUS_1 0x12 -#define MOVE_EFFECT_SP_DEF_PLUS_1 0x13 -#define MOVE_EFFECT_ACC_PLUS_1 0x14 -#define MOVE_EFFECT_EVS_PLUS_1 0x15 -#define MOVE_EFFECT_ATK_MINUS_1 0x16 -#define MOVE_EFFECT_DEF_MINUS_1 0x17 -#define MOVE_EFFECT_SPD_MINUS_1 0x18 -#define MOVE_EFFECT_SP_ATK_MINUS_1 0x19 -#define MOVE_EFFECT_SP_DEF_MINUS_1 0x1A -#define MOVE_EFFECT_ACC_MINUS_1 0x1B -#define MOVE_EFFECT_EVS_MINUS_1 0x1C -#define MOVE_EFFECT_RECHARGE 0x1D -#define MOVE_EFFECT_RAGE 0x1E -#define MOVE_EFFECT_STEAL_ITEM 0x1F -#define MOVE_EFFECT_PREVENT_ESCAPE 0x20 -#define MOVE_EFFECT_NIGHTMARE 0x21 -#define MOVE_EFFECT_ALL_STATS_UP 0x22 -#define MOVE_EFFECT_RAPIDSPIN 0x23 -#define MOVE_EFFECT_REMOVE_STATUS 0x24 -#define MOVE_EFFECT_ATK_DEF_DOWN 0x25 -#define MOVE_EFFECT_RECOIL_33 0x26 -#define MOVE_EFFECT_ATK_PLUS_2 0x27 -#define MOVE_EFFECT_DEF_PLUS_2 0x28 -#define MOVE_EFFECT_SPD_PLUS_2 0x29 -#define MOVE_EFFECT_SP_ATK_PLUS_2 0x2A -#define MOVE_EFFECT_SP_DEF_PLUS_2 0x2B -#define MOVE_EFFECT_ACC_PLUS_2 0x2C -#define MOVE_EFFECT_EVS_PLUS_2 0x2D -#define MOVE_EFFECT_ATK_MINUS_2 0x2E -#define MOVE_EFFECT_DEF_MINUS_2 0x2F -#define MOVE_EFFECT_SPD_MINUS_2 0x30 -#define MOVE_EFFECT_SP_ATK_MINUS_2 0x31 -#define MOVE_EFFECT_SP_DEF_MINUS_2 0x32 -#define MOVE_EFFECT_ACC_MINUS_2 0x33 -#define MOVE_EFFECT_EVS_MINUS_2 0x34 -#define MOVE_EFFECT_THRASH 0x35 -#define MOVE_EFFECT_KNOCK_OFF 0x36 -#define MOVE_EFFECT_DEF_SPDEF_DOWN 0x37 -#define MOVE_EFFECT_RECOIL_33_STATUS 0x38 -#define MOVE_EFFECT_RECOIL_50 0x39 -#define MOVE_EFFECT_CLEAR_SMOG 0x3A -#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x3B -#define MOVE_EFFECT_SMACK_DOWN 0x3C -#define MOVE_EFFECT_FLAME_BURST 0x3D -#define MOVE_EFFECT_FEINT 0x3E -#define MOVE_EFFECT_SPECTRAL_THIEF 0x3F -#define MOVE_EFFECT_V_CREATE 0x40 -#define MOVE_EFFECT_HAPPY_HOUR 0x41 -#define MOVE_EFFECT_CORE_ENFORCER 0x42 -#define MOVE_EFFECT_THROAT_CHOP 0x43 -#define MOVE_EFFECT_INCINERATE 0x44 -#define MOVE_EFFECT_BUG_BITE 0x45 -#define MOVE_EFFECT_RECOIL_HP_25 0x46 -#define MOVE_EFFECT_RELIC_SONG 0x47 -#define MOVE_EFFECT_TRAP_BOTH 0x48 -#define MOVE_EFFECT_SKY_DROP 0x49 -#define MOVE_EFFECT_SCALE_SHOT 0x4A -#define MOVE_EFFECT_BURN_UP 0x4B +#define MOVE_EFFECT_ATK_PLUS_1 0xE +#define MOVE_EFFECT_DEF_PLUS_1 0xF +#define MOVE_EFFECT_SPD_PLUS_1 0x10 +#define MOVE_EFFECT_SP_ATK_PLUS_1 0x11 +#define MOVE_EFFECT_SP_DEF_PLUS_1 0x12 +#define MOVE_EFFECT_ACC_PLUS_1 0x13 +#define MOVE_EFFECT_EVS_PLUS_1 0x14 +#define MOVE_EFFECT_ATK_MINUS_1 0x15 +#define MOVE_EFFECT_DEF_MINUS_1 0x16 +#define MOVE_EFFECT_SPD_MINUS_1 0x17 +#define MOVE_EFFECT_SP_ATK_MINUS_1 0x18 +#define MOVE_EFFECT_SP_DEF_MINUS_1 0x19 +#define MOVE_EFFECT_ACC_MINUS_1 0x1A +#define MOVE_EFFECT_EVS_MINUS_1 0x1B +#define MOVE_EFFECT_RECHARGE 0x1C +#define MOVE_EFFECT_RAGE 0x1D +#define MOVE_EFFECT_STEAL_ITEM 0x1E +#define MOVE_EFFECT_PREVENT_ESCAPE 0x1F +#define MOVE_EFFECT_NIGHTMARE 0x20 +#define MOVE_EFFECT_ALL_STATS_UP 0x21 +#define MOVE_EFFECT_RAPIDSPIN 0x22 +#define MOVE_EFFECT_REMOVE_STATUS 0x23 +#define MOVE_EFFECT_ATK_DEF_DOWN 0x24 +#define MOVE_EFFECT_ATK_PLUS_2 0x25 +#define MOVE_EFFECT_DEF_PLUS_2 0x26 +#define MOVE_EFFECT_SPD_PLUS_2 0x27 +#define MOVE_EFFECT_SP_ATK_PLUS_2 0x28 +#define MOVE_EFFECT_SP_DEF_PLUS_2 0x29 +#define MOVE_EFFECT_ACC_PLUS_2 0x2A +#define MOVE_EFFECT_EVS_PLUS_2 0x2B +#define MOVE_EFFECT_ATK_MINUS_2 0x2C +#define MOVE_EFFECT_DEF_MINUS_2 0x2D +#define MOVE_EFFECT_SPD_MINUS_2 0x2E +#define MOVE_EFFECT_SP_ATK_MINUS_2 0x2F +#define MOVE_EFFECT_SP_DEF_MINUS_2 0x30 +#define MOVE_EFFECT_ACC_MINUS_2 0x31 +#define MOVE_EFFECT_EVS_MINUS_2 0x32 +#define MOVE_EFFECT_THRASH 0x33 +#define MOVE_EFFECT_KNOCK_OFF 0x34 +#define MOVE_EFFECT_DEF_SPDEF_DOWN 0x35 +#define MOVE_EFFECT_CLEAR_SMOG 0x36 +#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x37 +#define MOVE_EFFECT_SMACK_DOWN 0x38 +#define MOVE_EFFECT_FLAME_BURST 0x39 +#define MOVE_EFFECT_FEINT 0x3A +#define MOVE_EFFECT_SPECTRAL_THIEF 0x3B +#define MOVE_EFFECT_V_CREATE 0x3C +#define MOVE_EFFECT_HAPPY_HOUR 0x3D +#define MOVE_EFFECT_CORE_ENFORCER 0x3E +#define MOVE_EFFECT_THROAT_CHOP 0x3F +#define MOVE_EFFECT_INCINERATE 0x40 +#define MOVE_EFFECT_BUG_BITE 0x41 +#define MOVE_EFFECT_RECOIL_HP_25 0x42 +#define MOVE_EFFECT_RELIC_SONG 0x43 +#define MOVE_EFFECT_TRAP_BOTH 0x44 +#define MOVE_EFFECT_SKY_DROP 0x45 +#define MOVE_EFFECT_SCALE_SHOT 0x46 +#define MOVE_EFFECT_BURN_UP 0x47 -#define NUM_MOVE_EFFECTS 0x4C +#define NUM_MOVE_EFFECTS 0x48 #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 98e95a0cc..c941f1f92 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -215,186 +215,184 @@ #define EFFECT_CAMOUFLAGE 211 // New move effects -#define EFFECT_PLEDGE 214 -#define EFFECT_FLING 215 -#define EFFECT_NATURAL_GIFT 216 -#define EFFECT_WAKE_UP_SLAP 217 -#define EFFECT_WRING_OUT 218 -#define EFFECT_HEX 219 -#define EFFECT_ASSURANCE 220 -#define EFFECT_TRUMP_CARD 221 -#define EFFECT_ACROBATICS 222 -#define EFFECT_HEAT_CRASH 223 -#define EFFECT_PUNISHMENT 224 -#define EFFECT_STORED_POWER 225 -#define EFFECT_ELECTRO_BALL 226 -#define EFFECT_GYRO_BALL 227 -#define EFFECT_ECHOED_VOICE 228 -#define EFFECT_PAYBACK 229 -#define EFFECT_ROUND 230 -#define EFFECT_BRINE 231 -#define EFFECT_VENOSHOCK 232 -#define EFFECT_RETALIATE 233 -#define EFFECT_BULLDOZE 234 -#define EFFECT_FOUL_PLAY 235 -#define EFFECT_PSYSHOCK 236 -#define EFFECT_ROOST 237 -#define EFFECT_GRAVITY 238 -#define EFFECT_MIRACLE_EYE 239 -#define EFFECT_TAILWIND 240 -#define EFFECT_EMBARGO 241 -#define EFFECT_AQUA_RING 242 -#define EFFECT_TRICK_ROOM 243 -#define EFFECT_WONDER_ROOM 244 -#define EFFECT_MAGIC_ROOM 245 -#define EFFECT_MAGNET_RISE 246 -#define EFFECT_TOXIC_SPIKES 247 -#define EFFECT_GASTRO_ACID 248 -#define EFFECT_STEALTH_ROCK 249 -#define EFFECT_TELEKINESIS 250 -#define EFFECT_POWER_SWAP 251 -#define EFFECT_GUARD_SWAP 252 -#define EFFECT_HEART_SWAP 253 -#define EFFECT_POWER_SPLIT 254 -#define EFFECT_GUARD_SPLIT 255 -#define EFFECT_STICKY_WEB 256 -#define EFFECT_METAL_BURST 257 -#define EFFECT_LUCKY_CHANT 258 -#define EFFECT_SUCKER_PUNCH 259 -#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 260 -#define EFFECT_SIMPLE_BEAM 261 -#define EFFECT_ENTRAINMENT 262 -#define EFFECT_HEAL_PULSE 263 -#define EFFECT_QUASH 264 -#define EFFECT_ION_DELUGE 265 -#define EFFECT_FREEZE_DRY 266 -#define EFFECT_TOPSY_TURVY 267 -#define EFFECT_MISTY_TERRAIN 268 -#define EFFECT_GRASSY_TERRAIN 269 -#define EFFECT_ELECTRIC_TERRAIN 270 -#define EFFECT_PSYCHIC_TERRAIN 271 -#define EFFECT_ATTACK_ACCURACY_UP 272 -#define EFFECT_ATTACK_SPATK_UP 273 -#define EFFECT_HURRICANE 274 -#define EFFECT_TWO_TYPED_MOVE 275 -#define EFFECT_ME_FIRST 276 -#define EFFECT_SPEED_UP_HIT 277 -#define EFFECT_QUIVER_DANCE 278 -#define EFFECT_COIL 279 -#define EFFECT_ELECTRIFY 280 -#define EFFECT_SCALD 281 -#define EFFECT_REFLECT_TYPE 282 -#define EFFECT_SOAK 283 -#define EFFECT_GROWTH 284 -#define EFFECT_CLOSE_COMBAT 285 -#define EFFECT_LAST_RESORT 286 -#define EFFECT_RECOIL_33_STATUS 287 -#define EFFECT_FLINCH_STATUS 288 -#define EFFECT_RECOIL_50 289 -#define EFFECT_SHELL_SMASH 290 -#define EFFECT_SHIFT_GEAR 291 -#define EFFECT_DEFENSE_UP_3 292 -#define EFFECT_NOBLE_ROAR 293 -#define EFFECT_VENOM_DRENCH 294 -#define EFFECT_TOXIC_THREAD 295 -#define EFFECT_CLEAR_SMOG 296 -#define EFFECT_HIT_SWITCH_TARGET 297 -#define EFFECT_FINAL_GAMBIT 298 -#define EFFECT_CHANGE_TYPE_ON_ITEM 299 -#define EFFECT_AUTOTOMIZE 300 -#define EFFECT_COPYCAT 301 -#define EFFECT_DEFOG 302 -#define EFFECT_HIT_ENEMY_HEAL_ALLY 303 -#define EFFECT_SMACK_DOWN 304 -#define EFFECT_SYNCHRONOISE 305 -#define EFFECT_PSYCHO_SHIFT 306 -#define EFFECT_POWER_TRICK 307 -#define EFFECT_FLAME_BURST 308 -#define EFFECT_AFTER_YOU 309 -#define EFFECT_BESTOW 310 -#define EFFECT_ROTOTILLER 311 -#define EFFECT_FLOWER_SHIELD 312 -#define EFFECT_HIT_PREVENT_ESCAPE 313 -#define EFFECT_SPEED_SWAP 314 -#define EFFECT_DEFENSE_UP2_HIT 315 -#define EFFECT_REVELATION_DANCE 316 -#define EFFECT_AURORA_VEIL 317 -#define EFFECT_THIRD_TYPE 318 -#define EFFECT_FEINT 319 -#define EFFECT_SPARKLING_ARIA 320 -#define EFFECT_ACUPRESSURE 321 -#define EFFECT_AROMATIC_MIST 322 -#define EFFECT_POWDER 323 -#define EFFECT_SP_ATTACK_UP_HIT 324 -#define EFFECT_BELCH 325 -#define EFFECT_PARTING_SHOT 326 -#define EFFECT_SPECTRAL_THIEF 327 -#define EFFECT_V_CREATE 328 -#define EFFECT_MAT_BLOCK 329 -#define EFFECT_STOMPING_TANTRUM 330 -#define EFFECT_CORE_ENFORCER 331 -#define EFFECT_INSTRUCT 332 -#define EFFECT_THROAT_CHOP 333 -#define EFFECT_LASER_FOCUS 334 -#define EFFECT_MAGNETIC_FLUX 335 -#define EFFECT_GEAR_UP 336 -#define EFFECT_INCINERATE 337 -#define EFFECT_BUG_BITE 338 -#define EFFECT_STRENGTH_SAP 339 -#define EFFECT_MIND_BLOWN 340 -#define EFFECT_PURIFY 341 -#define EFFECT_BURN_UP 342 -#define EFFECT_SHORE_UP 343 -#define EFFECT_GEOMANCY 344 -#define EFFECT_FAIRY_LOCK 345 -#define EFFECT_ALLY_SWITCH 346 -#define EFFECT_RELIC_SONG 347 -#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 348 -#define EFFECT_BODY_PRESS 349 -#define EFFECT_EERIE_SPELL 350 -#define EFFECT_JUNGLE_HEALING 351 -#define EFFECT_COACHING 352 -#define EFFECT_LASH_OUT 353 -#define EFFECT_GRASSY_GLIDE 354 -#define EFFECT_REMOVE_TERRAIN 355 -#define EFFECT_DYNAMAX_DOUBLE_DMG 356 -#define EFFECT_DECORATE 357 -#define EFFECT_SNIPE_SHOT 358 -#define EFFECT_TRIPLE_HIT 359 -#define EFFECT_RECOIL_HP_25 360 -#define EFFECT_STUFF_CHEEKS 361 -#define EFFECT_GRAV_APPLE 362 -#define EFFECT_EVASION_UP_HIT 363 -#define EFFECT_DOUBLE_IRON_BASH 364 -#define EFFECT_GLITZY_GLOW 365 -#define EFFECT_BADDY_BAD 366 -#define EFFECT_SAPPY_SEED 367 -#define EFFECT_FREEZY_FROST 368 -#define EFFECT_SPARKLY_SWIRL 369 -#define EFFECT_PLASMA_FISTS 370 -#define EFFECT_HYPERSPACE_FURY 371 -#define EFFECT_AURA_WHEEL 372 -#define EFFECT_PHOTON_GEYSER 373 -#define EFFECT_SHELL_SIDE_ARM 374 -#define EFFECT_TERRAIN_PULSE 375 -#define EFFECT_JAW_LOCK 376 -#define EFFECT_NO_RETREAT 377 -#define EFFECT_TAR_SHOT 378 -#define EFFECT_POLTERGEIST 379 -#define EFFECT_OCTOLOCK 380 -#define EFFECT_CLANGOROUS_SOUL 381 -#define EFFECT_BOLT_BEAK 382 -#define EFFECT_SKY_DROP 383 -#define EFFECT_EXPANDING_FORCE 384 -#define EFFECT_SCALE_SHOT 385 -#define EFFECT_METEOR_BEAM 386 -#define EFFECT_RISING_VOLTAGE 387 -#define EFFECT_BEAK_BLAST 388 -#define EFFECT_COURT_CHANGE 389 -#define EFFECT_STEEL_BEAM 390 -#define EFFECT_EXTREME_EVOBOOST 391 -#define EFFECT_DAMAGE_SET_TERRAIN 392 // genesis supernova +#define EFFECT_PLEDGE 212 +#define EFFECT_FLING 213 +#define EFFECT_NATURAL_GIFT 214 +#define EFFECT_WAKE_UP_SLAP 215 +#define EFFECT_WRING_OUT 216 +#define EFFECT_HEX 217 +#define EFFECT_ASSURANCE 218 +#define EFFECT_TRUMP_CARD 219 +#define EFFECT_ACROBATICS 220 +#define EFFECT_HEAT_CRASH 221 +#define EFFECT_PUNISHMENT 222 +#define EFFECT_STORED_POWER 223 +#define EFFECT_ELECTRO_BALL 224 +#define EFFECT_GYRO_BALL 225 +#define EFFECT_ECHOED_VOICE 226 +#define EFFECT_PAYBACK 227 +#define EFFECT_ROUND 228 +#define EFFECT_BRINE 229 +#define EFFECT_VENOSHOCK 230 +#define EFFECT_RETALIATE 231 +#define EFFECT_BULLDOZE 232 +#define EFFECT_FOUL_PLAY 233 +#define EFFECT_PSYSHOCK 234 +#define EFFECT_ROOST 235 +#define EFFECT_GRAVITY 236 +#define EFFECT_MIRACLE_EYE 237 +#define EFFECT_TAILWIND 238 +#define EFFECT_EMBARGO 239 +#define EFFECT_AQUA_RING 240 +#define EFFECT_TRICK_ROOM 241 +#define EFFECT_WONDER_ROOM 242 +#define EFFECT_MAGIC_ROOM 243 +#define EFFECT_MAGNET_RISE 244 +#define EFFECT_TOXIC_SPIKES 245 +#define EFFECT_GASTRO_ACID 246 +#define EFFECT_STEALTH_ROCK 247 +#define EFFECT_TELEKINESIS 248 +#define EFFECT_POWER_SWAP 249 +#define EFFECT_GUARD_SWAP 250 +#define EFFECT_HEART_SWAP 251 +#define EFFECT_POWER_SPLIT 252 +#define EFFECT_GUARD_SPLIT 253 +#define EFFECT_STICKY_WEB 254 +#define EFFECT_METAL_BURST 255 +#define EFFECT_LUCKY_CHANT 256 +#define EFFECT_SUCKER_PUNCH 257 +#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 258 +#define EFFECT_SIMPLE_BEAM 259 +#define EFFECT_ENTRAINMENT 260 +#define EFFECT_HEAL_PULSE 261 +#define EFFECT_QUASH 262 +#define EFFECT_ION_DELUGE 263 +#define EFFECT_FREEZE_DRY 264 +#define EFFECT_TOPSY_TURVY 265 +#define EFFECT_MISTY_TERRAIN 266 +#define EFFECT_GRASSY_TERRAIN 267 +#define EFFECT_ELECTRIC_TERRAIN 268 +#define EFFECT_PSYCHIC_TERRAIN 269 +#define EFFECT_ATTACK_ACCURACY_UP 270 +#define EFFECT_ATTACK_SPATK_UP 271 +#define EFFECT_HURRICANE 272 +#define EFFECT_TWO_TYPED_MOVE 273 +#define EFFECT_ME_FIRST 274 +#define EFFECT_SPEED_UP_HIT 275 +#define EFFECT_QUIVER_DANCE 276 +#define EFFECT_COIL 277 +#define EFFECT_ELECTRIFY 278 +#define EFFECT_SCALD 279 +#define EFFECT_REFLECT_TYPE 280 +#define EFFECT_SOAK 281 +#define EFFECT_GROWTH 282 +#define EFFECT_CLOSE_COMBAT 283 +#define EFFECT_LAST_RESORT 284 +#define EFFECT_RECOIL_33_STATUS 285 +#define EFFECT_FLINCH_STATUS 286 +#define EFFECT_RECOIL_50 287 +#define EFFECT_SHELL_SMASH 288 +#define EFFECT_SHIFT_GEAR 289 +#define EFFECT_DEFENSE_UP_3 290 +#define EFFECT_NOBLE_ROAR 291 +#define EFFECT_VENOM_DRENCH 292 +#define EFFECT_TOXIC_THREAD 293 +#define EFFECT_CLEAR_SMOG 294 +#define EFFECT_HIT_SWITCH_TARGET 295 +#define EFFECT_FINAL_GAMBIT 296 +#define EFFECT_CHANGE_TYPE_ON_ITEM 297 +#define EFFECT_AUTOTOMIZE 298 +#define EFFECT_COPYCAT 299 +#define EFFECT_DEFOG 300 +#define EFFECT_HIT_ENEMY_HEAL_ALLY 301 +#define EFFECT_SMACK_DOWN 302 +#define EFFECT_SYNCHRONOISE 303 +#define EFFECT_PSYCHO_SHIFT 304 +#define EFFECT_POWER_TRICK 305 +#define EFFECT_FLAME_BURST 306 +#define EFFECT_AFTER_YOU 307 +#define EFFECT_BESTOW 308 +#define EFFECT_ROTOTILLER 309 +#define EFFECT_FLOWER_SHIELD 310 +#define EFFECT_HIT_PREVENT_ESCAPE 311 +#define EFFECT_SPEED_SWAP 312 +#define EFFECT_DEFENSE_UP2_HIT 313 +#define EFFECT_REVELATION_DANCE 314 +#define EFFECT_AURORA_VEIL 315 +#define EFFECT_THIRD_TYPE 316 +#define EFFECT_FEINT 317 +#define EFFECT_SPARKLING_ARIA 318 +#define EFFECT_ACUPRESSURE 319 +#define EFFECT_AROMATIC_MIST 320 +#define EFFECT_POWDER 321 +#define EFFECT_SP_ATTACK_UP_HIT 322 +#define EFFECT_BELCH 323 +#define EFFECT_PARTING_SHOT 324 +#define EFFECT_SPECTRAL_THIEF 325 +#define EFFECT_V_CREATE 326 +#define EFFECT_MAT_BLOCK 327 +#define EFFECT_STOMPING_TANTRUM 328 +#define EFFECT_CORE_ENFORCER 329 +#define EFFECT_INSTRUCT 330 +#define EFFECT_THROAT_CHOP 331 +#define EFFECT_LASER_FOCUS 332 +#define EFFECT_MAGNETIC_FLUX 333 +#define EFFECT_GEAR_UP 334 +#define EFFECT_INCINERATE 335 +#define EFFECT_BUG_BITE 336 +#define EFFECT_STRENGTH_SAP 337 +#define EFFECT_MIND_BLOWN 338 +#define EFFECT_PURIFY 339 +#define EFFECT_BURN_UP 340 +#define EFFECT_SHORE_UP 341 +#define EFFECT_GEOMANCY 342 +#define EFFECT_FAIRY_LOCK 343 +#define EFFECT_ALLY_SWITCH 344 +#define EFFECT_RELIC_SONG 345 +#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 346 +#define EFFECT_BODY_PRESS 347 +#define EFFECT_EERIE_SPELL 348 +#define EFFECT_JUNGLE_HEALING 349 +#define EFFECT_COACHING 350 +#define EFFECT_LASH_OUT 351 +#define EFFECT_GRASSY_GLIDE 352 +#define EFFECT_REMOVE_TERRAIN 353 +#define EFFECT_DYNAMAX_DOUBLE_DMG 354 +#define EFFECT_DECORATE 355 +#define EFFECT_SNIPE_SHOT 356 +#define EFFECT_RECOIL_HP_25 357 +#define EFFECT_STUFF_CHEEKS 358 +#define EFFECT_GRAV_APPLE 359 +#define EFFECT_EVASION_UP_HIT 360 +#define EFFECT_GLITZY_GLOW 361 +#define EFFECT_BADDY_BAD 362 +#define EFFECT_SAPPY_SEED 363 +#define EFFECT_FREEZY_FROST 364 +#define EFFECT_SPARKLY_SWIRL 365 +#define EFFECT_PLASMA_FISTS 366 +#define EFFECT_HYPERSPACE_FURY 367 +#define EFFECT_AURA_WHEEL 368 +#define EFFECT_PHOTON_GEYSER 369 +#define EFFECT_SHELL_SIDE_ARM 370 +#define EFFECT_TERRAIN_PULSE 371 +#define EFFECT_JAW_LOCK 372 +#define EFFECT_NO_RETREAT 373 +#define EFFECT_TAR_SHOT 374 +#define EFFECT_POLTERGEIST 375 +#define EFFECT_OCTOLOCK 376 +#define EFFECT_CLANGOROUS_SOUL 377 +#define EFFECT_BOLT_BEAK 378 +#define EFFECT_SKY_DROP 379 +#define EFFECT_EXPANDING_FORCE 380 +#define EFFECT_SCALE_SHOT 381 +#define EFFECT_METEOR_BEAM 382 +#define EFFECT_RISING_VOLTAGE 383 +#define EFFECT_BEAK_BLAST 384 +#define EFFECT_COURT_CHANGE 385 +#define EFFECT_STEEL_BEAM 386 +#define EFFECT_EXTREME_EVOBOOST 387 +#define EFFECT_DAMAGE_SET_TERRAIN 388 // genesis supernova -#define NUM_BATTLE_MOVE_EFFECTS 393 +#define NUM_BATTLE_MOVE_EFFECTS 389 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 9550ea09b..06a09fc17 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -298,15 +298,15 @@ #define MOVEEND_ATTACKER_VISIBLE 10 #define MOVEEND_TARGET_VISIBLE 11 #define MOVEEND_ITEM_EFFECTS_TARGET 12 -#define MOVEEND_MOVE_EFFECTS2 13 -#define MOVEEND_ITEM_EFFECTS_ALL 14 -#define MOVEEND_KINGSROCK 15 // These item effects will occur each strike of a multi-hit move -#define MOVEEND_SUBSTITUTE 16 -#define MOVEEND_SKY_DROP_CONFUSE 17 -#define MOVEEND_UPDATE_LAST_MOVES 18 -#define MOVEEND_MIRROR_MOVE 19 -#define MOVEEND_NEXT_TARGET 20 // Everything up until here is handled for each strike of a multi-hit move -#define MOVEEND_MULTIHIT_MOVE 21 +#define MOVEEND_ITEM_EFFECTS_ALL 13 +#define MOVEEND_KINGSROCK 14 // These item effects will occur each strike of a multi-hit move +#define MOVEEND_SUBSTITUTE 15 +#define MOVEEND_SKY_DROP_CONFUSE 16 +#define MOVEEND_UPDATE_LAST_MOVES 17 +#define MOVEEND_MIRROR_MOVE 18 +#define MOVEEND_NEXT_TARGET 19 // Everything up until here is handled for each strike of a multi-hit move +#define MOVEEND_MULTIHIT_MOVE 20 +#define MOVEEND_DEFROST 21 #define MOVEEND_MOVE_EFFECTS2 22 #define MOVEEND_RECOIL 23 #define MOVEEND_MAGICIAN 24 // Occurs after final multi-hit strike, and after other items/abilities would activate From c267c615c1e50a09810c160b8de6ce716fd475f2 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 22 Oct 2022 10:38:39 -0300 Subject: [PATCH 45/58] Fixed CanFling --- src/battle_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index 9dbdb1abf..125976fc8 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -9983,7 +9983,7 @@ bool32 CanFling(u8 battlerId) #endif || gFieldStatuses & STATUS_FIELD_MAGIC_ROOM || gDisableStructs[battlerId].embargoTimer != 0 - || GetFlingPowerFromItemId(item) != 0 + || GetFlingPowerFromItemId(item) == 0 || !CanBattlerGetOrLoseItem(battlerId, item)) return FALSE; From 1b056f904475317e2e2ed6891e09375476931dcc Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 23 Oct 2022 17:37:23 +1300 Subject: [PATCH 46/58] Fix various Parental Bond issues - Dragon Tail and Circle Throw strike twice and then switch the target - Z moves are unaffected by Parental Bond - Renamed parentalBondOn to parentalBondState - Added constants for possible values of parentalBondState - Fixed broken stat change animations and removed unused MOVE_EFFECT_SKY_DROP --- data/battle_scripts_1.s | 1 - include/battle.h | 2 +- include/constants/battle.h | 124 ++++++++++++++++++----------------- src/battle_main.c | 2 +- src/battle_script_commands.c | 39 ++++++----- src/battle_util.c | 2 +- 6 files changed, 91 insertions(+), 79 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 40ca3c091..7e94460ef 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1995,7 +1995,6 @@ BattleScript_EffectHitSwitchTarget: resultmessage waitmessage B_WAIT_TIME_LONG tryfaintmon BS_TARGET - checkparentalbondcounter 2, BattleScript_EffectHitSwitchTargetMoveEnd moveendall jumpifability BS_TARGET, ABILITY_SUCTION_CUPS, BattleScript_AbilityPreventsPhasingOut jumpifstatus3 BS_TARGET, STATUS3_ROOTED, BattleScript_PrintMonIsRooted diff --git a/include/battle.h b/include/battle.h index b452f16cd..8e9f6c300 100644 --- a/include/battle.h +++ b/include/battle.h @@ -174,7 +174,7 @@ struct SpecialStatus u8 berryReduced:1; u8 gemBoost:1; u8 rototillerAffected:1; // to be affected by rototiller - u8 parentalBondOn:2; + u8 parentalBondState:2; u8 multiHitOn:1; // End of byte, two bits unused u8 gemParam; diff --git a/include/constants/battle.h b/include/constants/battle.h index 0cb022758..1592a7af4 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -307,66 +307,65 @@ #define MOVE_EFFECT_PAYDAY 0xB #define MOVE_EFFECT_CHARGING 0xC #define MOVE_EFFECT_WRAP 0xD -#define MOVE_EFFECT_ATK_PLUS_1 0xE -#define MOVE_EFFECT_DEF_PLUS_1 0xF -#define MOVE_EFFECT_SPD_PLUS_1 0x10 -#define MOVE_EFFECT_SP_ATK_PLUS_1 0x11 -#define MOVE_EFFECT_SP_DEF_PLUS_1 0x12 -#define MOVE_EFFECT_ACC_PLUS_1 0x13 -#define MOVE_EFFECT_EVS_PLUS_1 0x14 -#define MOVE_EFFECT_ATK_MINUS_1 0x15 -#define MOVE_EFFECT_DEF_MINUS_1 0x16 -#define MOVE_EFFECT_SPD_MINUS_1 0x17 -#define MOVE_EFFECT_SP_ATK_MINUS_1 0x18 -#define MOVE_EFFECT_SP_DEF_MINUS_1 0x19 -#define MOVE_EFFECT_ACC_MINUS_1 0x1A -#define MOVE_EFFECT_EVS_MINUS_1 0x1B -#define MOVE_EFFECT_RECHARGE 0x1C -#define MOVE_EFFECT_RAGE 0x1D -#define MOVE_EFFECT_STEAL_ITEM 0x1E -#define MOVE_EFFECT_PREVENT_ESCAPE 0x1F -#define MOVE_EFFECT_NIGHTMARE 0x20 -#define MOVE_EFFECT_ALL_STATS_UP 0x21 -#define MOVE_EFFECT_RAPIDSPIN 0x22 -#define MOVE_EFFECT_REMOVE_STATUS 0x23 -#define MOVE_EFFECT_ATK_DEF_DOWN 0x24 -#define MOVE_EFFECT_ATK_PLUS_2 0x25 -#define MOVE_EFFECT_DEF_PLUS_2 0x26 -#define MOVE_EFFECT_SPD_PLUS_2 0x27 -#define MOVE_EFFECT_SP_ATK_PLUS_2 0x28 -#define MOVE_EFFECT_SP_DEF_PLUS_2 0x29 -#define MOVE_EFFECT_ACC_PLUS_2 0x2A -#define MOVE_EFFECT_EVS_PLUS_2 0x2B -#define MOVE_EFFECT_ATK_MINUS_2 0x2C -#define MOVE_EFFECT_DEF_MINUS_2 0x2D -#define MOVE_EFFECT_SPD_MINUS_2 0x2E -#define MOVE_EFFECT_SP_ATK_MINUS_2 0x2F -#define MOVE_EFFECT_SP_DEF_MINUS_2 0x30 -#define MOVE_EFFECT_ACC_MINUS_2 0x31 -#define MOVE_EFFECT_EVS_MINUS_2 0x32 -#define MOVE_EFFECT_THRASH 0x33 -#define MOVE_EFFECT_KNOCK_OFF 0x34 -#define MOVE_EFFECT_DEF_SPDEF_DOWN 0x35 -#define MOVE_EFFECT_CLEAR_SMOG 0x36 -#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x37 -#define MOVE_EFFECT_SMACK_DOWN 0x38 -#define MOVE_EFFECT_FLAME_BURST 0x39 -#define MOVE_EFFECT_FEINT 0x3A -#define MOVE_EFFECT_SPECTRAL_THIEF 0x3B -#define MOVE_EFFECT_V_CREATE 0x3C -#define MOVE_EFFECT_HAPPY_HOUR 0x3D -#define MOVE_EFFECT_CORE_ENFORCER 0x3E -#define MOVE_EFFECT_THROAT_CHOP 0x3F -#define MOVE_EFFECT_INCINERATE 0x40 -#define MOVE_EFFECT_BUG_BITE 0x41 -#define MOVE_EFFECT_RECOIL_HP_25 0x42 -#define MOVE_EFFECT_RELIC_SONG 0x43 -#define MOVE_EFFECT_TRAP_BOTH 0x44 -#define MOVE_EFFECT_SKY_DROP 0x45 -#define MOVE_EFFECT_SCALE_SHOT 0x46 -#define MOVE_EFFECT_BURN_UP 0x47 - -#define NUM_MOVE_EFFECTS 0x48 +#define MOVE_EFFECT_BURN_UP 0xE // MOVE_EFFECT_BURN_UP replaces unused MOVE_EFFECT_RECOIL_25 so that stat change animations don't break +#define MOVE_EFFECT_ATK_PLUS_1 0xF +#define MOVE_EFFECT_DEF_PLUS_1 0x10 +#define MOVE_EFFECT_SPD_PLUS_1 0x11 +#define MOVE_EFFECT_SP_ATK_PLUS_1 0x12 +#define MOVE_EFFECT_SP_DEF_PLUS_1 0x13 +#define MOVE_EFFECT_ACC_PLUS_1 0x14 +#define MOVE_EFFECT_EVS_PLUS_1 0x15 +#define MOVE_EFFECT_ATK_MINUS_1 0x16 +#define MOVE_EFFECT_DEF_MINUS_1 0x17 +#define MOVE_EFFECT_SPD_MINUS_1 0x18 +#define MOVE_EFFECT_SP_ATK_MINUS_1 0x19 +#define MOVE_EFFECT_SP_DEF_MINUS_1 0x1A +#define MOVE_EFFECT_ACC_MINUS_1 0x1B +#define MOVE_EFFECT_EVS_MINUS_1 0x1C +#define MOVE_EFFECT_RECHARGE 0x1D +#define MOVE_EFFECT_RAGE 0x1E +#define MOVE_EFFECT_STEAL_ITEM 0x1F +#define MOVE_EFFECT_PREVENT_ESCAPE 0x20 +#define MOVE_EFFECT_NIGHTMARE 0x21 +#define MOVE_EFFECT_ALL_STATS_UP 0x22 +#define MOVE_EFFECT_RAPIDSPIN 0x23 +#define MOVE_EFFECT_REMOVE_STATUS 0x24 +#define MOVE_EFFECT_ATK_DEF_DOWN 0x25 +#define MOVE_EFFECT_SCALE_SHOT 0x26 // MOVE_EFFECT_SCALE_SHOT replaces unused MOVE_EFFECT_RECOIL_33 so that stat change animations don't break +#define MOVE_EFFECT_ATK_PLUS_2 0x27 +#define MOVE_EFFECT_DEF_PLUS_2 0x28 +#define MOVE_EFFECT_SPD_PLUS_2 0x29 +#define MOVE_EFFECT_SP_ATK_PLUS_2 0x2A +#define MOVE_EFFECT_SP_DEF_PLUS_2 0x2B +#define MOVE_EFFECT_ACC_PLUS_2 0x2C +#define MOVE_EFFECT_EVS_PLUS_2 0x2D +#define MOVE_EFFECT_ATK_MINUS_2 0x2E +#define MOVE_EFFECT_DEF_MINUS_2 0x2F +#define MOVE_EFFECT_SPD_MINUS_2 0x30 +#define MOVE_EFFECT_SP_ATK_MINUS_2 0x31 +#define MOVE_EFFECT_SP_DEF_MINUS_2 0x32 +#define MOVE_EFFECT_ACC_MINUS_2 0x33 +#define MOVE_EFFECT_EVS_MINUS_2 0x34 +#define MOVE_EFFECT_THRASH 0x35 +#define MOVE_EFFECT_KNOCK_OFF 0x36 +#define MOVE_EFFECT_DEF_SPDEF_DOWN 0x37 +#define MOVE_EFFECT_CLEAR_SMOG 0x38 +#define MOVE_EFFECT_SP_ATK_TWO_DOWN 0x39 +#define MOVE_EFFECT_SMACK_DOWN 0x3A +#define MOVE_EFFECT_FLAME_BURST 0x3B +#define MOVE_EFFECT_FEINT 0x3C +#define MOVE_EFFECT_SPECTRAL_THIEF 0x3D +#define MOVE_EFFECT_V_CREATE 0x3E +#define MOVE_EFFECT_HAPPY_HOUR 0x3F +#define MOVE_EFFECT_CORE_ENFORCER 0x40 +#define MOVE_EFFECT_THROAT_CHOP 0x41 +#define MOVE_EFFECT_INCINERATE 0x42 +#define MOVE_EFFECT_BUG_BITE 0x43 +#define MOVE_EFFECT_RECOIL_HP_25 0x44 +#define MOVE_EFFECT_RELIC_SONG 0x45 +#define MOVE_EFFECT_TRAP_BOTH 0x46 + +#define NUM_MOVE_EFFECTS 0x47 #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 @@ -480,4 +479,9 @@ // For the second argument of GetMoveTarget, when no target override is needed #define NO_TARGET_OVERRIDE 0 +// Constants for Parental Bond +#define PARENTAL_BOND_1ST_HIT 2 +#define PARENTAL_BOND_2ND_HIT 1 +#define PARENTAL_BOND_OFF 0 + #endif // GUARD_CONSTANTS_BATTLE_H diff --git a/src/battle_main.c b/src/battle_main.c index bf2c92fee..b47085248 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4843,7 +4843,7 @@ static void TurnValuesCleanUp(bool8 var0) if (gDisableStructs[gActiveBattler].substituteHP == 0) gBattleMons[gActiveBattler].status2 &= ~(STATUS2_SUBSTITUTE); - gSpecialStatuses[gActiveBattler].parentalBondOn = 0; + gSpecialStatuses[gActiveBattler].parentalBondState = PARENTAL_BOND_OFF; } gSideStatuses[0] &= ~(SIDE_STATUS_QUICK_GUARD | SIDE_STATUS_WIDE_GUARD | SIDE_STATUS_CRAFTY_SHIELD | SIDE_STATUS_MAT_BLOCK); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 24ec0426e..e6192700e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1138,6 +1138,7 @@ static const u16 sFinalStrikeOnlyEffects[] = EFFECT_HIT_ESCAPE, EFFECT_RECOIL_HP_25, EFFECT_HIT_PREVENT_ESCAPE, + EFFECT_HIT_SWITCH_TARGET, }; static const u16 sNaturePowerMoves[BATTLE_TERRAIN_COUNT] = @@ -1449,12 +1450,13 @@ static void Cmd_attackcanceler(void) if (AtkCanceller_UnableToUseMove()) return; - if (!gSpecialStatuses[gBattlerAttacker].parentalBondOn + if (!gSpecialStatuses[gBattlerAttacker].parentalBondState && GetBattlerAbility(gBattlerAttacker) == ABILITY_PARENTAL_BOND && IsMoveAffectedByParentalBond(gCurrentMove, gBattlerAttacker) - && !(gAbsentBattlerFlags & gBitTable[gBattlerTarget])) + && !(gAbsentBattlerFlags & gBitTable[gBattlerTarget]) + && gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE) { - gSpecialStatuses[gBattlerAttacker].parentalBondOn = 2; + gSpecialStatuses[gBattlerAttacker].parentalBondState = PARENTAL_BOND_1ST_HIT; gMultiHitCounter = 2; PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) return; @@ -1591,6 +1593,13 @@ static void Cmd_attackcanceler(void) gMoveResultFlags |= MOVE_RESULT_MISSED; gLastLandedMoves[gBattlerTarget] = 0; gLastHitByType[gBattlerTarget] = 0; + + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT) + { + gSpecialStatuses[gBattlerAttacker].parentalBondState = PARENTAL_BOND_OFF; // No second hit if first hit was blocked + gSpecialStatuses[gBattlerAttacker].multiHitOn = 0; + gMultiHitCounter = 0; + } gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED; gBattlescriptCurrInstr++; } @@ -1840,7 +1849,7 @@ static void Cmd_accuracycheck(void) else if (!JumpIfMoveAffectedByProtect(0)) gBattlescriptCurrInstr += 7; } - else if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 1 + else if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT || (gSpecialStatuses[gBattlerAttacker].multiHitOn && (gBattleMoves[move].effect != EFFECT_TRIPLE_KICK || GetBattlerAbility(gBattlerAttacker) == ABILITY_SKILL_LINK))) { @@ -1930,7 +1939,7 @@ static void Cmd_ppreduce(void) if (gCurrentMove == gLastResultingMoves[gBattlerAttacker] && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && !WasUnableToUseMove(gBattlerAttacker) - && gSpecialStatuses[gBattlerAttacker].parentalBondOn != 2) // Don't increment counter on first hit + && gSpecialStatuses[gBattlerAttacker].parentalBondState != PARENTAL_BOND_1ST_HIT) // Don't increment counter on first hit gBattleStruct->sameMoveTurns[gBattlerAttacker]++; else gBattleStruct->sameMoveTurns[gBattlerAttacker] = 0; @@ -2247,7 +2256,7 @@ static void Cmd_attackanimation(void) } else { - if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 1) // No animation on second hit + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT) // No animation on second hit { gBattlescriptCurrInstr++; return; @@ -2780,7 +2789,7 @@ void SetMoveEffect(bool32 primary, u32 certain) u32 flags = 0; u16 battlerAbility; - if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 2 + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT && gBattleMons[gBattlerTarget].hp != 0 && IsFinalStrikeEffect(gCurrentMove)) { @@ -3156,7 +3165,7 @@ void SetMoveEffect(bool32 primary, u32 certain) break; case MOVE_EFFECT_PAYDAY: // Don't scatter coins on the second hit of Parental Bond - if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER && gSpecialStatuses[gBattlerAttacker].parentalBondOn != 1) + if (GET_BATTLER_SIDE(gBattlerAttacker) == B_SIDE_PLAYER && gSpecialStatuses[gBattlerAttacker].parentalBondState!= PARENTAL_BOND_2ND_HIT) { u16 payday = gPaydayMoney; gPaydayMoney += (gBattleMons[gBattlerAttacker].level * 5); @@ -5682,8 +5691,8 @@ static void Cmd_moveend(void) && (gChosenMove == MOVE_SLEEP_TALK || !(gBattleMons[gBattlerAttacker].status1 & STATUS1_SLEEP)) && !(gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE)) { - if (gSpecialStatuses[gBattlerAttacker].parentalBondOn) - gSpecialStatuses[gBattlerAttacker].parentalBondOn--; + if (gSpecialStatuses[gBattlerAttacker].parentalBondState) + gSpecialStatuses[gBattlerAttacker].parentalBondState--; gHitMarker |= (HITMARKER_NO_PPDEDUCT | HITMARKER_NO_ATTACKSTRING); gBattleScripting.animTargetsHit = 0; @@ -5706,7 +5715,7 @@ static void Cmd_moveend(void) } } gMultiHitCounter = 0; - gSpecialStatuses[gBattlerAttacker].parentalBondOn = 0; + gSpecialStatuses[gBattlerAttacker].parentalBondState = PARENTAL_BOND_OFF; gSpecialStatuses[gBattlerAttacker].multiHitOn = 0; gBattleScripting.moveendState++; break; @@ -10059,7 +10068,7 @@ static void Cmd_various(void) // Some effects should only happen on the first or second strike of Parental Bond, // so a way to check this in battle scripts is useful u8 counter = T1_READ_8(gBattlescriptCurrInstr + 3); - if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == counter && gBattleMons[gBattlerTarget].hp != 0) + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == counter && gBattleMons[gBattlerTarget].hp != 0) gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 4); else gBattlescriptCurrInstr += 8; @@ -10540,7 +10549,7 @@ static void Cmd_stockpiletobasedamage(void) if (gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED) gBattleScripting.animTurn = gDisableStructs[gBattlerAttacker].stockpileCounter; - if (!(gSpecialStatuses[gBattlerAttacker].parentalBondOn == 2 && gBattleMons[gBattlerTarget].hp != 0)) + if (!(gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_1ST_HIT && gBattleMons[gBattlerTarget].hp != 0)) { gDisableStructs[gBattlerAttacker].stockpileCounter = 0; // Restore stat changes from stockpile. @@ -12438,7 +12447,7 @@ static void Cmd_handlefurycutter(void) else { if (gDisableStructs[gBattlerAttacker].furyCutterCounter != 5 - && gSpecialStatuses[gBattlerAttacker].parentalBondOn != 2) // Don't increment counter on first hit + && gSpecialStatuses[gBattlerAttacker].parentalBondState != PARENTAL_BOND_1ST_HIT) // Don't increment counter on first hit gDisableStructs[gBattlerAttacker].furyCutterCounter++; gBattlescriptCurrInstr++; @@ -12469,7 +12478,7 @@ static void Cmd_presentdamagecalculation(void) * damage, the second strike will always deal damage too. This is a simple way * to replicate that effect. */ - if (gSpecialStatuses[gBattlerAttacker].parentalBondOn != 1) + if (gSpecialStatuses[gBattlerAttacker].parentalBondState != PARENTAL_BOND_2ND_HIT) { if (rand < 102) { diff --git a/src/battle_util.c b/src/battle_util.c index 698d676f1..1e99a2301 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -9292,7 +9292,7 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move } // Parental Bond Second Strike - if (gSpecialStatuses[gBattlerAttacker].parentalBondOn == 1) + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT) { if (B_PARENTAL_BOND_DAMAGE < GEN_7) MulModifier(&finalModifier, UQ_4_12(0.5)); From 9b076a9dcf278711af4769a5db140f05e413276d Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 23 Oct 2022 21:40:04 +1300 Subject: [PATCH 47/58] Fix spread moves, tidy up CANCELLER_MULTIHIT_MOVES - Parental Bond spread moves should now strike twice whenever there is a single target, even if the target is the user's ally. - Random chance to hit 2-5 times is now set in SetRandomMultiHitCounter(). --- include/constants/battle.h | 2 +- src/battle_script_commands.c | 8 +++-- src/battle_util.c | 62 ++++++++++++++++++++---------------- 3 files changed, 41 insertions(+), 31 deletions(-) diff --git a/include/constants/battle.h b/include/constants/battle.h index 1592a7af4..11a5a6a86 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -364,7 +364,7 @@ #define MOVE_EFFECT_RECOIL_HP_25 0x44 #define MOVE_EFFECT_RELIC_SONG 0x45 #define MOVE_EFFECT_TRAP_BOTH 0x46 - + #define NUM_MOVE_EFFECTS 0x47 #define MOVE_EFFECT_AFFECTS_USER 0x4000 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index e6192700e..480b18a90 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -14844,12 +14844,16 @@ bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId) { switch (GetBattlerMoveTargetType(battlerId, move)) { + // Both foes are alive, spread move strikes once case MOVE_TARGET_BOTH: - if (CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) >= 2) // Check for single target + if (IsBattlerAlive(gBattlerTarget) && IsBattlerAlive(BATTLE_PARTNER(gBattlerTarget))) return FALSE; break; + // Either both foes or one foe and its ally are alive; spread move strikes once case MOVE_TARGET_FOES_AND_ALLY: - if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ACTIVE) >= 2) // Count mons on both sides; ignore attacker + if (IsBattlerAlive(BATTLE_PARTNER(gBattlerTarget)) + || (IsBattlerAlive(BATTLE_PARTNER(battlerId)) + && (IsBattlerAlive(BATTLE_PARTNER(gBattlerTarget)) || IsBattlerAlive(gBattlerTarget)))) return FALSE; break; default: diff --git a/src/battle_util.c b/src/battle_util.c index 1e99a2301..79a698eb7 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -59,6 +59,7 @@ functions instead of at the top of the file with the other declarations. static bool32 TryRemoveScreens(u8 battler); static bool32 IsUnnerveAbilityOnOpposingSide(u8 battlerId); static u8 GetFlingPowerFromItemId(u16 itemId); +static void SetRandomMultiHitCounter(); extern const u8 *const gBattleScriptsForMoveEffects[]; extern const u8 *const gBattlescriptsForRunningByItem[]; @@ -3868,35 +3869,8 @@ u8 AtkCanceller_UnableToUseMove(void) } else { - if (B_MULTI_HIT_CHANCE >= GEN_5) - { - // Based on Gen 5's odds - // 35% for 2 hits - // 35% for 3 hits - // 15% for 4 hits - // 15% for 5 hits - gMultiHitCounter = Random() % 100; - if (gMultiHitCounter < 35) - gMultiHitCounter = 2; - else if (gMultiHitCounter < 35 + 35) - gMultiHitCounter = 3; - else if (gMultiHitCounter < 35 + 35 + 15) - gMultiHitCounter = 4; - else - gMultiHitCounter =5; - } - else - { - // 2 and 3 hits: 37.5% - // 4 and 5 hits: 12.5% - gMultiHitCounter = Random() % 4; - if (gMultiHitCounter > 1) - gMultiHitCounter = (Random() % 4) + 2; - else - gMultiHitCounter += 2; - } + SetRandomMultiHitCounter(); } - PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) } else if (gBattleMoves[gCurrentMove].flags & FLAG_TWO_STRIKES) @@ -10518,3 +10492,35 @@ bool32 CanTargetBattler(u8 battlerAtk, u8 battlerDef, u16 move) return FALSE; // Pokémon affected by Heal Block cannot target allies with Pollen Puff return TRUE; } + +static void SetRandomMultiHitCounter() +{ + #if (B_MULTI_HIT_CHANCE >= GEN_5) + { + // Based on Gen 5's odds + // 35% for 2 hits + // 35% for 3 hits + // 15% for 4 hits + // 15% for 5 hits + gMultiHitCounter = Random() % 100; + if (gMultiHitCounter < 35) + gMultiHitCounter = 2; + else if (gMultiHitCounter < 35 + 35) + gMultiHitCounter = 3; + else if (gMultiHitCounter < 35 + 35 + 15) + gMultiHitCounter = 4; + else + gMultiHitCounter = 5; + } + #else + { + // 2 and 3 hits: 37.5% + // 4 and 5 hits: 12.5% + gMultiHitCounter = Random() % 4; + if (gMultiHitCounter > 1) + gMultiHitCounter = (Random() % 4) + 2; + else + gMultiHitCounter += 2; + } + #endif +} From a5ede1ee90084c9d74656de1f696cd1b417e5dee Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 23 Oct 2022 21:41:42 +1300 Subject: [PATCH 48/58] Move B_PARENTAL_BOND_DAMAGE to damage settings Title. --- include/constants/battle_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 815d5ae6d..cf1d748a8 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -30,6 +30,7 @@ #define B_SPORT_DMG_REDUCTION GEN_LATEST // In Gen5+, Water/Mud Sport reduce Fire/Electric Damage by 67% instead of 50%. #define B_EXPLOSION_DEFENSE GEN_LATEST // In Gen5+, Self-Destruct and Explosion don't halve the targets' defense. #define B_BEAT_UP_DMG GEN_LATEST // In Gen5+, Beat Up uses a different formula to calculate the damage of each hit, and deals Dark-type damage. +#define B_PARENTAL_BOND_DAMAGE GEN_LATEST // In Gen7+, Parental Bond's second hit does 25% of the initial hits damage. Before, it did 50%. // Type settings #define B_GHOSTS_ESCAPE GEN_LATEST // In Gen6+, abilities like Shadow Tag or moves like Mean Look fail on Ghost-type Pokémon. They can also escape any Wild Battle. @@ -107,7 +108,6 @@ #define B_PLUS_MINUS_INTERACTION GEN_LATEST // In Gen5+, Plus and Minus can be activated with themselves and the opposite ability. Before, only the opposing ability could activate it. #define B_WEATHER_FORMS GEN_LATEST // In Gen5+, Castform and Cherrim revert to their base form upon losing their respective ability. Cherrim needs Flower Gift to swap forms. #define B_SYMBIOSIS_GEMS GEN_LATEST // In Gen7+, Symbiosis passes an item after a gem-boosted attack. Previously, items are passed before the gem-boosted attack hits, making the item effect apply. -#define B_PARENTAL_BOND_DAMAGE GEN_LATEST // In Gen7+, Parental Bond's second hit does 25% of the initial hits damage. Before, it did 50%. // 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. From 7bca475d7775a44b61e3d178393693ed17567073 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 23 Oct 2022 21:48:20 +1300 Subject: [PATCH 49/58] Add Misty Explosion to Parental Bond ban list Probably not needed, but just in case! --- src/battle_script_commands.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 480b18a90..607ad5a13 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1047,6 +1047,7 @@ static const u8 sForbiddenMoves[MOVES_COUNT] = [MOVE_MIND_BLOWN] = FORBIDDEN_METRONOME, [MOVE_MIRROR_COAT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT, [MOVE_MIRROR_MOVE] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, + [MOVE_MISTY_EXPLOSION] = FORBIDDEN_PARENTAL_BOND, [MOVE_MOONGEIST_BEAM] = FORBIDDEN_METRONOME, [MOVE_NATURE_POWER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT, [MOVE_NATURES_MADNESS] = FORBIDDEN_METRONOME, From d9cc98a4feef36d291c1ef1f0cd66a4677209e13 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Mon, 24 Oct 2022 22:19:35 +1300 Subject: [PATCH 50/58] Suggested changes - Various style fixes - Add BATTLE_ALIVE_EXCEPT_ATTACKER case to CountAliveMonsInBattle --- include/constants/pokemon.h | 7 ++--- src/battle_main.c | 2 +- src/battle_script_commands.c | 8 +++--- src/battle_util.c | 52 +++++++++++++++++------------------- src/pokemon.c | 7 +++++ 5 files changed, 39 insertions(+), 37 deletions(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 5167f5f55..514c2bd26 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -329,9 +329,10 @@ #define MON_PIC_HEIGHT 64 #define MON_PIC_SIZE (MON_PIC_WIDTH * MON_PIC_HEIGHT / 2) -#define BATTLE_ALIVE_EXCEPT_ACTIVE 0 -#define BATTLE_ALIVE_ATK_SIDE 1 -#define BATTLE_ALIVE_DEF_SIDE 2 +#define BATTLE_ALIVE_EXCEPT_ACTIVE 0 +#define BATTLE_ALIVE_ATK_SIDE 1 +#define BATTLE_ALIVE_DEF_SIDE 2 +#define BATTLE_ALIVE_EXCEPT_ATTACKER 3 #define SKIP_FRONT_ANIM (1 << 7) diff --git a/src/battle_main.c b/src/battle_main.c index b47085248..22de8440d 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4841,7 +4841,7 @@ static void TurnValuesCleanUp(bool8 var0) } if (gDisableStructs[gActiveBattler].substituteHP == 0) - gBattleMons[gActiveBattler].status2 &= ~(STATUS2_SUBSTITUTE); + gBattleMons[gActiveBattler].status2 &= ~STATUS2_SUBSTITUTE; gSpecialStatuses[gActiveBattler].parentalBondState = PARENTAL_BOND_OFF; } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 607ad5a13..686a44d6e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1451,7 +1451,7 @@ static void Cmd_attackcanceler(void) if (AtkCanceller_UnableToUseMove()) return; - if (!gSpecialStatuses[gBattlerAttacker].parentalBondState + if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_OFF && GetBattlerAbility(gBattlerAttacker) == ABILITY_PARENTAL_BOND && IsMoveAffectedByParentalBond(gCurrentMove, gBattlerAttacker) && !(gAbsentBattlerFlags & gBitTable[gBattlerTarget]) @@ -14847,14 +14847,12 @@ bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId) { // Both foes are alive, spread move strikes once case MOVE_TARGET_BOTH: - if (IsBattlerAlive(gBattlerTarget) && IsBattlerAlive(BATTLE_PARTNER(gBattlerTarget))) + if (CountAliveMonsInBattle(BATTLE_ALIVE_DEF_SIDE) >= 2) return FALSE; break; // Either both foes or one foe and its ally are alive; spread move strikes once case MOVE_TARGET_FOES_AND_ALLY: - if (IsBattlerAlive(BATTLE_PARTNER(gBattlerTarget)) - || (IsBattlerAlive(BATTLE_PARTNER(battlerId)) - && (IsBattlerAlive(BATTLE_PARTNER(gBattlerTarget)) || IsBattlerAlive(gBattlerTarget)))) + if (CountAliveMonsInBattle(BATTLE_ALIVE_EXCEPT_ATTACKER) >= 2) return FALSE; break; default: diff --git a/src/battle_util.c b/src/battle_util.c index 79a698eb7..385790b8c 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -10495,32 +10495,28 @@ bool32 CanTargetBattler(u8 battlerAtk, u8 battlerDef, u16 move) static void SetRandomMultiHitCounter() { - #if (B_MULTI_HIT_CHANCE >= GEN_5) - { - // Based on Gen 5's odds - // 35% for 2 hits - // 35% for 3 hits - // 15% for 4 hits - // 15% for 5 hits - gMultiHitCounter = Random() % 100; - if (gMultiHitCounter < 35) - gMultiHitCounter = 2; - else if (gMultiHitCounter < 35 + 35) - gMultiHitCounter = 3; - else if (gMultiHitCounter < 35 + 35 + 15) - gMultiHitCounter = 4; - else - gMultiHitCounter = 5; - } - #else - { - // 2 and 3 hits: 37.5% - // 4 and 5 hits: 12.5% - gMultiHitCounter = Random() % 4; - if (gMultiHitCounter > 1) - gMultiHitCounter = (Random() % 4) + 2; - else - gMultiHitCounter += 2; - } - #endif +#if (B_MULTI_HIT_CHANCE >= GEN_5) + // Based on Gen 5's odds + // 35% for 2 hits + // 35% for 3 hits + // 15% for 4 hits + // 15% for 5 hits + gMultiHitCounter = Random() % 100; + if (gMultiHitCounter < 35) + gMultiHitCounter = 2; + else if (gMultiHitCounter < 35 + 35) + gMultiHitCounter = 3; + else if (gMultiHitCounter < 35 + 35 + 15) + gMultiHitCounter = 4; + else + gMultiHitCounter = 5; +#else + // 2 and 3 hits: 37.5% + // 4 and 5 hits: 12.5% + gMultiHitCounter = Random() % 4; + if (gMultiHitCounter > 1) + gMultiHitCounter = (Random() % 4) + 2; + else + gMultiHitCounter += 2; +#endif } diff --git a/src/pokemon.c b/src/pokemon.c index 98ac99256..2d2f88972 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4238,6 +4238,13 @@ u8 CountAliveMonsInBattle(u8 caseId) retVal++; } break; + case BATTLE_ALIVE_EXCEPT_ATTACKER: + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { + if (i != gBattlerAttacker && !(gAbsentBattlerFlags & gBitTable[i])) + retVal++; + } + break; } return retVal; From 2cd0a0f86249039764143ed15714cc23c496d9eb Mon Sep 17 00:00:00 2001 From: kaisermg5 Date: Tue, 25 Oct 2022 18:48:06 -0300 Subject: [PATCH 51/58] Fix lock when teaching a TM/HM after learning a move by level up. --- src/party_menu.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/party_menu.c b/src/party_menu.c index eaeadabab..635cd3fe0 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -4928,6 +4928,7 @@ void ItemUseCB_TMHM(u8 taskId, TaskFunc task) u16 move = ItemIdToBattleMoveId(item); gPartyMenu.data1 = move; + gPartyMenu.learnMoveState = 0; PlaySE(SE_SELECT); mon = &gPlayerParty[gPartyMenu.slotId]; From 3327758cdbb32d569b8c6338f19b57e9e7b3131d Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 26 Oct 2022 23:29:09 +1300 Subject: [PATCH 52/58] Move B_BEAT_UP_DMG to other move settings This is more of a mechanical change like gen 8's change to Teleport, so it should go in the same block of settings. --- include/constants/battle_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index cf1d748a8..a83da731c 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -29,7 +29,6 @@ #define B_KNOCK_OFF_DMG GEN_LATEST // In Gen6+, Knock Off deals 50% more damage when knocking off an item. #define B_SPORT_DMG_REDUCTION GEN_LATEST // In Gen5+, Water/Mud Sport reduce Fire/Electric Damage by 67% instead of 50%. #define B_EXPLOSION_DEFENSE GEN_LATEST // In Gen5+, Self-Destruct and Explosion don't halve the targets' defense. -#define B_BEAT_UP_DMG GEN_LATEST // In Gen5+, Beat Up uses a different formula to calculate the damage of each hit, and deals Dark-type damage. #define B_PARENTAL_BOND_DAMAGE GEN_LATEST // In Gen7+, Parental Bond's second hit does 25% of the initial hits damage. Before, it did 50%. // Type settings @@ -91,6 +90,7 @@ #define B_ROOTED_GROUNDING GEN_LATEST // In Gen4+, Ingrain causes the affected Pokémon to become grounded. #define B_METRONOME_MOVES GEN_LATEST // This config will determine up to which generation will Metronome pull moves from. #define B_TELEPORT_BEHAVIOR GEN_LATEST // In Gen7+, starting with Pokémon LGPE, Teleport allows the user to swap out with another party member. +#define B_BEAT_UP_DMG GEN_LATEST // In Gen5+, Beat Up uses a different formula to calculate the damage of each hit, and deals Dark-type damage. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. From 224ca256cedb668e5b368b7851925f12c52b5871 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Thu, 27 Oct 2022 22:25:33 +1300 Subject: [PATCH 53/58] Requested clean up Rename constants, remove white space, improve B_BEAT_UP description. * Rename B_BEAT_UP_DMG to B_BEAT_UP * Shorten B_PARENTAL_BOND_DAMAGE to B_PARENTAL_BOND_DMG * Remove trailing whitespace * Replace boolean 1 with TRUE in MOVEEND_MULTIHIT_MOVE --- data/battle_scripts_1.s | 2 +- include/battle.h | 2 +- include/constants/battle_config.h | 4 ++-- src/battle_script_commands.c | 4 ++-- src/battle_util.c | 6 +++--- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 7e94460ef..61eca0c01 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -5117,7 +5117,7 @@ BattleScript_EffectTeleportNew: BattleScript_EffectTeleportNewEnd: goto BattleScript_MoveEnd -.if B_BEAT_UP_DMG < GEN_5 +.if B_BEAT_UP < GEN_5 BattleScript_EffectBeatUp:: attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE diff --git a/include/battle.h b/include/battle.h index 8e9f6c300..5d9f57e43 100644 --- a/include/battle.h +++ b/include/battle.h @@ -168,7 +168,7 @@ struct SpecialStatus u8 sturdied:1; u8 stormDrainRedirected:1; u8 switchInAbilityDone:1; - u8 switchInItemDone:1; + u8 switchInItemDone:1; u8 instructedChosenTarget:3; // End of byte u8 berryReduced:1; diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index a83da731c..aee3b78a0 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -29,7 +29,7 @@ #define B_KNOCK_OFF_DMG GEN_LATEST // In Gen6+, Knock Off deals 50% more damage when knocking off an item. #define B_SPORT_DMG_REDUCTION GEN_LATEST // In Gen5+, Water/Mud Sport reduce Fire/Electric Damage by 67% instead of 50%. #define B_EXPLOSION_DEFENSE GEN_LATEST // In Gen5+, Self-Destruct and Explosion don't halve the targets' defense. -#define B_PARENTAL_BOND_DAMAGE GEN_LATEST // In Gen7+, Parental Bond's second hit does 25% of the initial hits damage. Before, it did 50%. +#define B_PARENTAL_BOND_DMG GEN_LATEST // In Gen7+, Parental Bond's second hit does 25% of the initial hits damage. Before, it did 50%. // Type settings #define B_GHOSTS_ESCAPE GEN_LATEST // In Gen6+, abilities like Shadow Tag or moves like Mean Look fail on Ghost-type Pokémon. They can also escape any Wild Battle. @@ -90,7 +90,7 @@ #define B_ROOTED_GROUNDING GEN_LATEST // In Gen4+, Ingrain causes the affected Pokémon to become grounded. #define B_METRONOME_MOVES GEN_LATEST // This config will determine up to which generation will Metronome pull moves from. #define B_TELEPORT_BEHAVIOR GEN_LATEST // In Gen7+, starting with Pokémon LGPE, Teleport allows the user to swap out with another party member. -#define B_BEAT_UP_DMG GEN_LATEST // In Gen5+, Beat Up uses a different formula to calculate the damage of each hit, and deals Dark-type damage. +#define B_BEAT_UP GEN_LATEST // In Gen5+, Beat Up uses a different formula to calculate its damage, and deals Dark-type damage. Prior to Gen 5, each hit also announces the party member's name. // Ability settings #define B_EXPANDED_ABILITY_NAMES TRUE // If TRUE, ability names are increased from 12 characters to 16 characters. diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 686a44d6e..fd2129dbb 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -5678,7 +5678,7 @@ static void Cmd_moveend(void) { BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; - effect = 1; + effect = TRUE; } else { @@ -5711,7 +5711,7 @@ static void Cmd_moveend(void) { BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MultiHitPrintStrings; - effect = 1; + effect = TRUE; } } } diff --git a/src/battle_util.c b/src/battle_util.c index 385790b8c..033571ab0 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3887,7 +3887,7 @@ u8 AtkCanceller_UnableToUseMove(void) gMultiHitCounter = 3; PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0) } - #if B_BEAT_UP_DMG >= GEN_5 + #if B_BEAT_UP >= GEN_5 else if (gBattleMoves[gCurrentMove].effect == EFFECT_BEAT_UP) { struct Pokemon* party; @@ -8487,7 +8487,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; break; case EFFECT_BEAT_UP: - #if B_BEAT_UP_DMG >= GEN_5 + #if B_BEAT_UP >= GEN_5 basePower = CalcBeatUpPower(); #endif break; @@ -9268,7 +9268,7 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move // Parental Bond Second Strike if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT) { - if (B_PARENTAL_BOND_DAMAGE < GEN_7) + if (B_PARENTAL_BOND_DMG < GEN_7) MulModifier(&finalModifier, UQ_4_12(0.5)); else MulModifier(&finalModifier, UQ_4_12(0.25)); From 215604f5f75b130424f16236f2b9a5c226430617 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Thu, 27 Oct 2022 20:44:43 +0200 Subject: [PATCH 54/58] fix battle palace bug --- src/battle_ai_main.c | 13 ++- src/battle_controller_opponent.c | 174 +++++++++++++++---------------- src/battle_controller_player.c | 4 +- src/battle_gfx_sfx_util.c | 2 +- src/battle_main.c | 9 +- 5 files changed, 103 insertions(+), 99 deletions(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index b1154e793..b4b6a8d30 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -235,8 +235,17 @@ u8 BattleAI_ChooseMoveOrAction(void) u8 ComputeBattleAiScores(u8 battler) { sBattler_AI = battler; - BattleAI_SetupAIData(0xF); - return BattleAI_ChooseMoveOrAction(); + if (gBattleTypeFlags & BATTLE_TYPE_PALACE) + { + u16 retVal = ChooseMoveAndTargetInBattlePalace(); // first byte is moveId, secondId is target + gBattleStruct->aiChosenTarget[sBattler_AI] = (retVal >> 8) & 0xFF; + return (retVal & 0xFF); + } + else + { + BattleAI_SetupAIData(0xF); + return BattleAI_ChooseMoveOrAction(); + } } static void CopyBattlerDataToAIParty(u32 bPosition, u32 side) diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 5a307cfc9..55efd6091 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1548,116 +1548,108 @@ static void OpponentHandleYesNoBox(void) static void OpponentHandleChooseMove(void) { - if (gBattleTypeFlags & BATTLE_TYPE_PALACE) + u8 chosenMoveId; + struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[gActiveBattler][4]); + + if (gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER) + || IsWildMonSmart()) { - BtlController_EmitTwoReturnValues(BUFFER_B, 10, ChooseMoveAndTargetInBattlePalace()); + chosenMoveId = gBattleStruct->aiMoveOrAction[gActiveBattler]; + gBattlerTarget = gBattleStruct->aiChosenTarget[gActiveBattler]; + switch (chosenMoveId) + { + case AI_CHOICE_WATCH: + BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SAFARI_WATCH_CAREFULLY, 0); + break; + case AI_CHOICE_FLEE: + BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_RUN, 0); + break; + case AI_CHOICE_SWITCH: + BtlController_EmitTwoReturnValues(BUFFER_B, 10, 0xFFFF); + break; + case 6: + BtlController_EmitTwoReturnValues(BUFFER_B, 15, gBattlerTarget); + break; + default: + { + u16 chosenMove = moveInfo->moves[chosenMoveId]; + + if (GetBattlerMoveTargetType(gActiveBattler, chosenMove) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + gBattlerTarget = gActiveBattler; + if (GetBattlerMoveTargetType(gActiveBattler, chosenMove) & MOVE_TARGET_BOTH) + { + gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); + if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) + gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); + } + if (ShouldUseZMove(gActiveBattler, gBattlerTarget, chosenMove)) + QueueZMove(gActiveBattler, chosenMove); + if (CanMegaEvolve(gActiveBattler)) // If opponent can mega evolve, do it. + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (RET_MEGA_EVOLUTION) | (gBattlerTarget << 8)); + else + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gBattlerTarget << 8)); + } + break; + } OpponentBufferExecCompleted(); } - else + else // Wild pokemon - use random move { - u8 chosenMoveId; - struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[gActiveBattler][4]); - - if (gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER) - || IsWildMonSmart()) + u16 move; + u8 target; + do { - chosenMoveId = gBattleStruct->aiMoveOrAction[gActiveBattler]; - gBattlerTarget = gBattleStruct->aiChosenTarget[gActiveBattler]; - switch (chosenMoveId) - { - case AI_CHOICE_WATCH: - BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SAFARI_WATCH_CAREFULLY, 0); - break; - case AI_CHOICE_FLEE: - BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_RUN, 0); - break; - case AI_CHOICE_SWITCH: - BtlController_EmitTwoReturnValues(BUFFER_B, 10, 0xFFFF); - break; - case 6: - BtlController_EmitTwoReturnValues(BUFFER_B, 15, gBattlerTarget); - break; - default: - { - u16 chosenMove = moveInfo->moves[chosenMoveId]; + chosenMoveId = Random() & 3; + move = moveInfo->moves[chosenMoveId]; + } while (move == MOVE_NONE); - if (GetBattlerMoveTargetType(gActiveBattler, chosenMove) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) - gBattlerTarget = gActiveBattler; - if (GetBattlerMoveTargetType(gActiveBattler, chosenMove) & MOVE_TARGET_BOTH) - { - gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); - if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) - gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); - } - if (ShouldUseZMove(gActiveBattler, gBattlerTarget, chosenMove)) - QueueZMove(gActiveBattler, chosenMove); - if (CanMegaEvolve(gActiveBattler)) // If opponent can mega evolve, do it. - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (RET_MEGA_EVOLUTION) | (gBattlerTarget << 8)); - else - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gBattlerTarget << 8)); - } - break; - } - OpponentBufferExecCompleted(); - } - else // Wild pokemon - use random move + if (GetBattlerMoveTargetType(gActiveBattler, move) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gActiveBattler << 8)); + else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) { - u16 move; - u8 target; - do - { - chosenMoveId = Random() & 3; - move = moveInfo->moves[chosenMoveId]; - } while (move == MOVE_NONE); + do { + target = GetBattlerAtPosition(Random() & 2); + } while (!CanTargetBattler(gActiveBattler, target, move)); - if (GetBattlerMoveTargetType(gActiveBattler, move) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gActiveBattler << 8)); - else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + #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)) { - do { - target = GetBattlerAtPosition(Random() & 2); - } while (!CanTargetBattler(gActiveBattler, 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)) + u16 i, speciesAttacker, speciesTarget, isPartnerEnemy = FALSE; + static const u16 naturalEnemies[][2] = { - u16 i, speciesAttacker, speciesTarget, isPartnerEnemy = FALSE; - static const u16 naturalEnemies[][2] = - { - // Attacker Target - {SPECIES_ZANGOOSE, SPECIES_SEVIPER}, - {SPECIES_SEVIPER, SPECIES_ZANGOOSE}, - {SPECIES_HEATMOR, SPECIES_DURANT}, - {SPECIES_DURANT, SPECIES_HEATMOR}, - {SPECIES_SABLEYE, SPECIES_CARBINK}, - {SPECIES_MAREANIE, SPECIES_CORSOLA}, - }; - speciesAttacker = gBattleMons[gActiveBattler].species; - speciesTarget = gBattleMons[GetBattlerAtPosition(BATTLE_PARTNER(gActiveBattler))].species; + // Attacker Target + {SPECIES_ZANGOOSE, SPECIES_SEVIPER}, + {SPECIES_SEVIPER, SPECIES_ZANGOOSE}, + {SPECIES_HEATMOR, SPECIES_DURANT}, + {SPECIES_DURANT, SPECIES_HEATMOR}, + {SPECIES_SABLEYE, SPECIES_CARBINK}, + {SPECIES_MAREANIE, SPECIES_CORSOLA}, + }; + speciesAttacker = gBattleMons[gActiveBattler].species; + speciesTarget = gBattleMons[GetBattlerAtPosition(BATTLE_PARTNER(gActiveBattler))].species; - for (i = 0; i < ARRAY_COUNT(naturalEnemies); i++) + for (i = 0; i < ARRAY_COUNT(naturalEnemies); i++) + { + if (speciesAttacker == naturalEnemies[i][0] && speciesTarget == naturalEnemies[i][1]) { - if (speciesAttacker == naturalEnemies[i][0] && speciesTarget == naturalEnemies[i][1]) - { - isPartnerEnemy = TRUE; - break; - } + isPartnerEnemy = TRUE; + break; } - if (isPartnerEnemy && CanTargetBattler(gActiveBattler, target, move)) - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(BATTLE_PARTNER(gActiveBattler)) << 8)); - else - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (target << 8)); } + if (isPartnerEnemy && CanTargetBattler(gActiveBattler, target, move)) + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(BATTLE_PARTNER(gActiveBattler)) << 8)); else - #endif BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (target << 8)); } else - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) << 8)); - - OpponentBufferExecCompleted(); + #endif + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (target << 8)); } + else + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (GetBattlerAtPosition(B_POSITION_PLAYER_LEFT) << 8)); + + OpponentBufferExecCompleted(); } } diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 4be342640..95af66ac0 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2843,8 +2843,10 @@ static void PlayerChooseMoveInBattlePalace(void) { if (--*(gBattleStruct->arenaMindPoints + gActiveBattler) == 0) { + u32 chosenMoveId = gBattleStruct->aiMoveOrAction[gActiveBattler]; + gBattlerTarget = gBattleStruct->aiChosenTarget[gActiveBattler]; gBattlePalaceMoveSelectionRngValue = gRngValue; - BtlController_EmitTwoReturnValues(BUFFER_B, 10, ChooseMoveAndTargetInBattlePalace()); + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gBattlerTarget << 8)); PlayerBufferExecCompleted(); } } diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index 37dbf0aab..e2dcce3cf 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -171,7 +171,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) // If no moves matched the selected group, pick a new move from groups the pokemon has // In this case the AI is not checked again, so the choice may be worse // If a move is chosen this way, there's a 50% chance that it will be unable to use it anyway - if (chosenMoveId == -1) + if (chosenMoveId == -1 || chosenMoveId >= MAX_MON_MOVES) { if (unusableMovesBits != 0xF) { diff --git a/src/battle_main.c b/src/battle_main.c index 5b6e724c9..7b48d92d0 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3159,7 +3159,7 @@ void SwitchInClearSetData(void) // Reset damage to prevent things like red card activating if the switched-in mon is holding it gSpecialStatuses[gActiveBattler].physicalDmg = 0; gSpecialStatuses[gActiveBattler].specialDmg = 0; - + gBattleStruct->overwrittenAbilities[gActiveBattler] = ABILITY_NONE; Ai_UpdateSwitchInData(gActiveBattler); @@ -3264,7 +3264,7 @@ void FaintClearSetData(void) UndoMegaEvolution(gBattlerPartyIndexes[gActiveBattler]); gBattleStruct->overwrittenAbilities[gActiveBattler] = ABILITY_NONE; - + // If the fainted mon was involved in a Sky Drop if (gBattleStruct->skyDropTargets[gActiveBattler] != 0xFF) { @@ -3303,7 +3303,7 @@ void FaintClearSetData(void) } } } - + // Clear Z-Move data gBattleStruct->zmove.active = FALSE; gBattleStruct->zmove.toBeUsed[gActiveBattler] = MOVE_NONE; @@ -3973,7 +3973,8 @@ static void HandleTurnActionSelectionState(void) gBattleCommunication[gActiveBattler] = STATE_BEFORE_ACTION_CHOSEN; // Do AI score computations here so we can use them in AI_TrySwitchOrUseItem - if ((gBattleTypeFlags & BATTLE_TYPE_HAS_AI || IsWildMonSmart()) && IsBattlerAIControlled(gActiveBattler)) { + if ((gBattleTypeFlags & BATTLE_TYPE_HAS_AI || IsWildMonSmart()) + && (IsBattlerAIControlled(gActiveBattler) || gBattleTypeFlags & BATTLE_TYPE_PALACE)) { gBattleStruct->aiMoveOrAction[gActiveBattler] = ComputeBattleAiScores(gActiveBattler); } break; From 5ebc996c5144621bb843411006781cafaeb1789c Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 30 Oct 2022 22:03:14 -0300 Subject: [PATCH 55/58] Removed worthless DEBUG_FLAG_PC_FROM_DEBUG_MENU config --- include/constants/overworld_config.h | 1 - src/debug.c | 10 ---------- src/pokemon_storage_system.c | 16 ++++------------ 3 files changed, 4 insertions(+), 23 deletions(-) diff --git a/include/constants/overworld_config.h b/include/constants/overworld_config.h index 64437ca9b..4a27ded83 100644 --- a/include/constants/overworld_config.h +++ b/include/constants/overworld_config.h @@ -16,6 +16,5 @@ // Replace the used flags with others or disable with a 0 #define DEBUG_FLAG_NO_COLLISION 0 // If this flag is set, the debug function in the Utility submenu to disable player collision can be used. -#define DEBUG_FLAG_PC_FROM_DEBUG_MENU 0 // If this flag is set, the debug function in debug menu to access the player PC works. #endif // GUARD_CONSTANTS_OVERWORLD_CONFIG_H diff --git a/src/debug.c b/src/debug.c index aaf5a8131..dd0aab732 100644 --- a/src/debug.c +++ b/src/debug.c @@ -2792,16 +2792,6 @@ static void DebugAction_Give_CHEAT(u8 taskId) ScriptContext_SetupScript(Debug_CheatStart); } -static void Task_WaitFadeAccessPC(u8 taskId) -{ - if (!gPaletteFade.active) - { - DestroyTask(taskId); - FlagSet(DEBUG_FLAG_PC_FROM_DEBUG_MENU); - EnterPokeStorage(2); - } -} - static void DebugAction_AccessPC(u8 taskId) { Debug_DestroyMenu_Full(taskId); diff --git a/src/pokemon_storage_system.c b/src/pokemon_storage_system.c index 3f58daa86..2a321ff1a 100644 --- a/src/pokemon_storage_system.c +++ b/src/pokemon_storage_system.c @@ -1669,18 +1669,10 @@ static void FieldTask_ReturnToPcMenu(void) MainCallback vblankCb = gMain.vblankCallback; SetVBlankCallback(NULL); - if (!FlagGet(DEBUG_FLAG_PC_FROM_DEBUG_MENU)) - { - taskId = CreateTask(Task_PCMainMenu, 80); - gTasks[taskId].tState = 0; - gTasks[taskId].tSelectedOption = sPreviousBoxOption; - Task_PCMainMenu(taskId); - } - else - { - FlagClear(DEBUG_FLAG_PC_FROM_DEBUG_MENU); - ScriptContext_Enable(); - } + taskId = CreateTask(Task_PCMainMenu, 80); + gTasks[taskId].tState = 0; + gTasks[taskId].tSelectedOption = sPreviousBoxOption; + Task_PCMainMenu(taskId); SetVBlankCallback(vblankCb); FadeInFromBlack(); } From 52dda5fc0fa64733bfc14cd76b1e278f7246a73b Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 30 Oct 2022 22:52:22 -0300 Subject: [PATCH 56/58] Actually removed ItemId_GetId --- src/item.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/item.c b/src/item.c index 9266e28b3..18b6242c4 100644 --- a/src/item.c +++ b/src/item.c @@ -880,12 +880,6 @@ const u8 *ItemId_GetName(u16 itemId) return gItems[SanitizeItemId(itemId)].name; } -// Unused -u16 ItemId_GetId(u16 itemId) -{ - return gItems[SanitizeItemId(itemId)].itemId; -} - u16 ItemId_GetPrice(u16 itemId) { return gItems[SanitizeItemId(itemId)].price; From ea43b7732ca80a7ae809c3e4342d1d4e1161d8c0 Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 31 Oct 2022 13:16:48 +0100 Subject: [PATCH 57/58] Fix battle tent again --- src/battle_ai_main.c | 14 +------ src/battle_controller_opponent.c | 69 ++++++++++++++++++-------------- src/battle_controller_player.c | 4 +- src/battle_gfx_sfx_util.c | 2 + src/battle_main.c | 2 +- 5 files changed, 44 insertions(+), 47 deletions(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index b4b6a8d30..500680135 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -234,18 +234,8 @@ u8 BattleAI_ChooseMoveOrAction(void) // damages/other info computed in GetAIDataAndCalcDmg u8 ComputeBattleAiScores(u8 battler) { - sBattler_AI = battler; - if (gBattleTypeFlags & BATTLE_TYPE_PALACE) - { - u16 retVal = ChooseMoveAndTargetInBattlePalace(); // first byte is moveId, secondId is target - gBattleStruct->aiChosenTarget[sBattler_AI] = (retVal >> 8) & 0xFF; - return (retVal & 0xFF); - } - else - { - BattleAI_SetupAIData(0xF); - return BattleAI_ChooseMoveOrAction(); - } + BattleAI_SetupAIData(0xF); + return BattleAI_ChooseMoveOrAction(); } static void CopyBattlerDataToAIParty(u32 bPosition, u32 side) diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 55efd6091..3e168828d 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -1554,42 +1554,49 @@ static void OpponentHandleChooseMove(void) if (gBattleTypeFlags & (BATTLE_TYPE_TRAINER | BATTLE_TYPE_FIRST_BATTLE | BATTLE_TYPE_SAFARI | BATTLE_TYPE_ROAMER) || IsWildMonSmart()) { - chosenMoveId = gBattleStruct->aiMoveOrAction[gActiveBattler]; - gBattlerTarget = gBattleStruct->aiChosenTarget[gActiveBattler]; - switch (chosenMoveId) + if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { - case AI_CHOICE_WATCH: - BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SAFARI_WATCH_CAREFULLY, 0); - break; - case AI_CHOICE_FLEE: - BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_RUN, 0); - break; - case AI_CHOICE_SWITCH: - BtlController_EmitTwoReturnValues(BUFFER_B, 10, 0xFFFF); - break; - case 6: - BtlController_EmitTwoReturnValues(BUFFER_B, 15, gBattlerTarget); - break; - default: + BtlController_EmitTwoReturnValues(BUFFER_B, 10, ChooseMoveAndTargetInBattlePalace()); + } + else + { + chosenMoveId = gBattleStruct->aiMoveOrAction[gActiveBattler]; + gBattlerTarget = gBattleStruct->aiChosenTarget[gActiveBattler]; + switch (chosenMoveId) { - u16 chosenMove = moveInfo->moves[chosenMoveId]; - - if (GetBattlerMoveTargetType(gActiveBattler, chosenMove) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) - gBattlerTarget = gActiveBattler; - if (GetBattlerMoveTargetType(gActiveBattler, chosenMove) & MOVE_TARGET_BOTH) + case AI_CHOICE_WATCH: + BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SAFARI_WATCH_CAREFULLY, 0); + break; + case AI_CHOICE_FLEE: + BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_RUN, 0); + break; + case AI_CHOICE_SWITCH: + BtlController_EmitTwoReturnValues(BUFFER_B, 10, 0xFFFF); + break; + case 6: + BtlController_EmitTwoReturnValues(BUFFER_B, 15, gBattlerTarget); + break; + default: { - gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); - if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) - gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); + u16 chosenMove = moveInfo->moves[chosenMoveId]; + + if (GetBattlerMoveTargetType(gActiveBattler, chosenMove) & (MOVE_TARGET_USER_OR_SELECTED | MOVE_TARGET_USER)) + gBattlerTarget = gActiveBattler; + if (GetBattlerMoveTargetType(gActiveBattler, chosenMove) & MOVE_TARGET_BOTH) + { + gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_LEFT); + if (gAbsentBattlerFlags & gBitTable[gBattlerTarget]) + gBattlerTarget = GetBattlerAtPosition(B_POSITION_PLAYER_RIGHT); + } + if (ShouldUseZMove(gActiveBattler, gBattlerTarget, chosenMove)) + QueueZMove(gActiveBattler, chosenMove); + if (CanMegaEvolve(gActiveBattler)) // If opponent can mega evolve, do it. + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (RET_MEGA_EVOLUTION) | (gBattlerTarget << 8)); + else + BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gBattlerTarget << 8)); } - if (ShouldUseZMove(gActiveBattler, gBattlerTarget, chosenMove)) - QueueZMove(gActiveBattler, chosenMove); - if (CanMegaEvolve(gActiveBattler)) // If opponent can mega evolve, do it. - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (RET_MEGA_EVOLUTION) | (gBattlerTarget << 8)); - else - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gBattlerTarget << 8)); + break; } - break; } OpponentBufferExecCompleted(); } diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 95af66ac0..4be342640 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2843,10 +2843,8 @@ static void PlayerChooseMoveInBattlePalace(void) { if (--*(gBattleStruct->arenaMindPoints + gActiveBattler) == 0) { - u32 chosenMoveId = gBattleStruct->aiMoveOrAction[gActiveBattler]; - gBattlerTarget = gBattleStruct->aiChosenTarget[gActiveBattler]; gBattlePalaceMoveSelectionRngValue = gRngValue; - BtlController_EmitTwoReturnValues(BUFFER_B, 10, (chosenMoveId) | (gBattlerTarget << 8)); + BtlController_EmitTwoReturnValues(BUFFER_B, 10, ChooseMoveAndTargetInBattlePalace()); PlayerBufferExecCompleted(); } } diff --git a/src/battle_gfx_sfx_util.c b/src/battle_gfx_sfx_util.c index e2dcce3cf..1b78ec11c 100644 --- a/src/battle_gfx_sfx_util.c +++ b/src/battle_gfx_sfx_util.c @@ -164,6 +164,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) { gBattleStruct->palaceFlags &= 0xF; gBattleStruct->palaceFlags |= (selectedMoves << 4); + sBattler_AI = gActiveBattler; BattleAI_SetupAIData(selectedMoves); chosenMoveId = BattleAI_ChooseMoveOrAction(); } @@ -173,6 +174,7 @@ u16 ChooseMoveAndTargetInBattlePalace(void) // If a move is chosen this way, there's a 50% chance that it will be unable to use it anyway if (chosenMoveId == -1 || chosenMoveId >= MAX_MON_MOVES) { + chosenMoveId = -1; if (unusableMovesBits != 0xF) { validMoveFlags = 0, numValidMoveGroups = 0; diff --git a/src/battle_main.c b/src/battle_main.c index 7b48d92d0..f83ae13bb 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3974,7 +3974,7 @@ static void HandleTurnActionSelectionState(void) // Do AI score computations here so we can use them in AI_TrySwitchOrUseItem if ((gBattleTypeFlags & BATTLE_TYPE_HAS_AI || IsWildMonSmart()) - && (IsBattlerAIControlled(gActiveBattler) || gBattleTypeFlags & BATTLE_TYPE_PALACE)) { + && (IsBattlerAIControlled(gActiveBattler) && !(gBattleTypeFlags & BATTLE_TYPE_PALACE))) { gBattleStruct->aiMoveOrAction[gActiveBattler] = ComputeBattleAiScores(gActiveBattler); } break; From 51d8b57dccff24b0c947eaaaaa0c0982a027795f Mon Sep 17 00:00:00 2001 From: DizzyEggg Date: Mon, 31 Oct 2022 13:19:10 +0100 Subject: [PATCH 58/58] restore deleted line --- src/battle_ai_main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 500680135..b1154e793 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -234,6 +234,7 @@ u8 BattleAI_ChooseMoveOrAction(void) // damages/other info computed in GetAIDataAndCalcDmg u8 ComputeBattleAiScores(u8 battler) { + sBattler_AI = battler; BattleAI_SetupAIData(0xF); return BattleAI_ChooseMoveOrAction(); }