Convert move flags and bans into GCC bitfields (#2952)

* Slicing moves to new bitfield

* Wind moves to new bitfield

* Two-strike moves to new bitfield

* Forgot to add flagTwoStrikes to battle_moves.h

* Removed "flag" from field names

* FLAG_HIT_IN_SUBSTITUTE and FLAG_THAW_USER

* Airborne moves

* FLAG_POWDER, FLAG_TARGET_ABILITY_IGNORED and FLAG_DANCE

* FLAG_BALLISTIC and FLAG_PROTECTION_MOVE

* Fixed missing uses of MOVE_UNAVAILABLE in battle_ai_util.c

* FLAG_SOUND

* FLAG_DMG_UNDERGROUND and FLAG_DMG_UNDERWATER

* FLAG_DMG_MINIMIZE

* Cleanup

* FLAG_STAT_STAGES_IGNORED

* Updated Pollen Puff's ballistic flag

* FLAG_STRONG_JAW_BOOST and FLAG_MEGA_LAUNCHER_BOOST

* thaw

* FLAG_THREE_STRIKES

* FLAG_IRON_FIST_BOOST

* FLAG_RECKLESS_BOOST

* FLAG_HIGH_CRIT

* Removed empty flags

* Moves that fail when called by Me First + added missing Shell Trap

* Moves that fail when Gravity is active

* Better names for banned fields

* Moves that fail when called by Instruct

* Cleanup

* Contact Moves + Fixed Wandering Spirit skipping contact checks

* Inverted FLAG_PROTECT_AFFECTED so that there's a flag for moves that SKIP protect.

* Simplified B_MOVE_FLAGS configs

* FORBIDDEN_METRONOME

* Renamed hitsPastSubstitute to ignoresSubstitute

* FORBIDDEN_PARENTAL_BOND

* Struggle uncallable by Metronome

* FORBIDDEN_MIMIC

* FLAG_KINGS_ROCK_AFFECTED

* Made a single config for move flags

* Macro for checking move flags

* FLAG_MAGIC_COAT_AFFECTED

* Fixed HasMagicCoatAffectedMove

* FLAG_SNATCH_AFFECTED

* Removed unused EFFECT_FLINCH_MINIMIZE_HIT

* Fixed Stench/King's Rock interaction

* Removed sMovesNotAffectedByStench in favor of checking move effects

* Removed EFFECT_TWISTER, which was a repeat of EFFECT_FLINCH_HIT

* Changed Gen2 configs to less than Gen 3

* FORBIDDEN_SLEEP_TALK

* Cleanup

* Inverted FLAG_MIRROR_MOVE_AFFECTED

* FLAG_SHEER_FORCE_BOOST

* Ordered

* FORBIDDEN_ASSIST and FORBIDDEN_COPYCAT

* Removed TestMoveFlags and TestMoveFlagsInMoveset + flags field

* Fixed Triple Arrows test
This commit is contained in:
Eduardo Quezada D'Ottone 2023-07-03 04:01:59 -04:00 committed by GitHub
parent 40a5995ead
commit 1fa9a05470
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
30 changed files with 1906 additions and 2107 deletions

View File

@ -166,11 +166,9 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectPsychUp @ EFFECT_PSYCH_UP
.4byte BattleScript_EffectMirrorCoat @ EFFECT_MIRROR_COAT
.4byte BattleScript_EffectSkullBash @ EFFECT_SKULL_BASH
.4byte BattleScript_EffectTwister @ EFFECT_TWISTER
.4byte BattleScript_EffectEarthquake @ EFFECT_EARTHQUAKE
.4byte BattleScript_EffectFutureSight @ EFFECT_FUTURE_SIGHT
.4byte BattleScript_EffectGust @ EFFECT_GUST
.4byte BattleScript_EffectStomp @ EFFECT_FLINCH_MINIMIZE_HIT
.4byte BattleScript_EffectSolarBeam @ EFFECT_SOLAR_BEAM
.4byte BattleScript_EffectThunder @ EFFECT_THUNDER
.4byte BattleScript_EffectTeleport @ EFFECT_TELEPORT
@ -5390,12 +5388,6 @@ BattleScript_SkullBashEnd::
call BattleScript_PowerHerbActivation
goto BattleScript_TwoTurnMovesSecondTurn
BattleScript_EffectTwister:
BattleScript_FlinchEffect:
BattleScript_EffectStomp:
setmoveeffect MOVE_EFFECT_FLINCH
goto BattleScript_EffectHit
BattleScript_EffectBulldoze:
setmoveeffect MOVE_EFFECT_SPD_MINUS_1
BattleScript_EffectEarthquake:

View File

@ -685,6 +685,12 @@ struct BattleStruct
#define IS_MOVE_SPECIAL(move)(GetBattleMoveSplit(move) == SPLIT_SPECIAL)
#define IS_MOVE_STATUS(move)(gBattleMoves[move].split == SPLIT_STATUS)
#define IS_MOVE_RECOIL(move)(gBattleMoves[move].effect == EFFECT_RECOIL_25 \
|| gBattleMoves[move].effect == EFFECT_RECOIL_IF_MISS \
|| gBattleMoves[move].effect == EFFECT_RECOIL_50 \
|| gBattleMoves[move].effect == EFFECT_RECOIL_33 \
|| gBattleMoves[move].effect == EFFECT_RECOIL_33_STATUS)
#define BATTLER_MAX_HP(battlerId)(gBattleMons[battlerId].hp == gBattleMons[battlerId].maxHP)
#define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0))
#define BATTLER_DAMAGED(battlerId) ((gSpecialStatuses[battlerId].physicalDmg != 0 || gSpecialStatuses[battlerId].specialDmg != 0))
@ -703,7 +709,6 @@ struct BattleStruct
gBattleMons[battlerId].type3 = TYPE_MYSTERY; \
}
#define IS_BATTLER_PROTECTED(battlerId)(gProtectStructs[battlerId].protected \
|| gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_WIDE_GUARD \
|| gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_QUICK_GUARD \

View File

@ -98,7 +98,6 @@ bool32 HasMoveWithType(u32 battler, u8 type);
bool32 HasMoveWithTypeAndSplit(u32 battler, u8 type, u8 split);
bool32 HasMoveEffect(u32 battlerId, u16 moveEffect);
bool32 HasMoveWithLowAccuracy(u8, u8, u8, bool32, u16, u16, u16, u16);
bool32 TestMoveFlagsInMoveset(u8 battler, u32 flags);
bool32 IsAromaVeilProtectedMove(u16 move);
bool32 IsNonVolatileStatusMoveEffect(u16 moveEffect);
bool32 IsStatLoweringMoveEffect(u16 moveEffect);
@ -107,7 +106,6 @@ bool32 IsMoveEncouragedToHit(u8 battlerAtk, u8 battlerDef, u16 move);
bool32 IsHazardMoveEffect(u16 moveEffect);
bool32 MoveCallsOtherMove(u16 move);
bool32 MoveRequiresRecharging(u16 move);
bool32 IsInstructBannedMove(u16 move);
bool32 IsEncoreEncouragedEffect(u16 moveEffect);
void ProtectChecks(u8 battlerAtk, u8 battlerDef, u16 move, u16 predictedMove, s16 *score);
bool32 ShouldSetSandstorm(u8 battler, u16 ability, u16 holdEffect);
@ -121,13 +119,17 @@ bool32 HasHealingEffect(u32 battler);
bool32 IsTrappingMoveEffect(u16 effect);
bool32 HasTrappingMoveEffect(u8 battler);
bool32 ShouldFakeOut(u8 battlerAtk, u8 battlerDef, u16 move);
bool32 HasThawingMove(u8 battlerId);
bool32 HasThawingMove(u8 battler);
bool32 IsStatRaisingEffect(u16 effect);
bool32 IsStatLoweringEffect(u16 effect);
bool32 IsStatRaisingEffect(u16 effect);
bool32 IsAttackBoostMoveEffect(u16 effect);
bool32 IsUngroundingEffect(u16 effect);
bool32 IsSemiInvulnerable(u8 battlerDef, u16 move);
bool32 HasSoundMove(u8 battler);
bool32 HasHighCritRatioMove(u8 battler);
bool32 HasMagicCoatAffectedMove(u8 battler);
bool32 HasSnatchAffectedMove(u8 battler);
// status checks
bool32 AI_CanBeBurned(u8 battler, u16 ability);

View File

@ -185,7 +185,6 @@ void ClearIllusionMon(u32 battlerId);
bool32 SetIllusionMon(struct Pokemon *mon, u32 battlerId);
bool8 ShouldGetStatBadgeBoost(u16 flagId, u8 battlerId);
u8 GetBattleMoveSplit(u32 moveId);
bool32 TestMoveFlags(u16 move, u32 flag);
bool32 CanFling(u8 battlerId);
bool32 IsTelekinesisBannedSpecies(u16 species);
bool32 IsHealBlockPreventingMove(u32 battler, u32 move);

View File

@ -59,6 +59,7 @@
// Move data settings
#define B_UPDATED_MOVE_DATA GEN_LATEST // Updates move data in gBattleMoves, including Power, Accuracy, PP, stat changes, targets and chances of secondary effects.
#define B_UPDATED_MOVE_TYPES GEN_LATEST // Updates move types.
#define B_UPDATED_MOVE_FLAGS GEN_LATEST // Updates move flags.
#define B_PHYSICAL_SPECIAL_SPLIT GEN_LATEST // In Gen3, the move's type determines if it will do physical or special damage. The split icon in the summary will reflect this.
#define B_RECOIL_IF_MISS_DMG GEN_LATEST // In Gen5+, Jump Kick and High Jump Kick will always do half of the user's max HP when missing.
#define B_KLUTZ_FLING_INTERACTION GEN_LATEST // In Gen5+, Pokémon with the Klutz ability can't use Fling.

View File

@ -145,273 +145,271 @@
#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_SOLAR_BEAM 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
#define EFFECT_EARTHQUAKE 144
#define EFFECT_FUTURE_SIGHT 145
#define EFFECT_GUST 146
#define EFFECT_SOLAR_BEAM 147
#define EFFECT_THUNDER 148
#define EFFECT_TELEPORT 149
#define EFFECT_BEAT_UP 150
#define EFFECT_SEMI_INVULNERABLE 151
#define EFFECT_DEFENSE_CURL 152
#define EFFECT_SOFTBOILED 153
#define EFFECT_FAKE_OUT 154
#define EFFECT_UPROAR 155
#define EFFECT_STOCKPILE 156
#define EFFECT_SPIT_UP 157
#define EFFECT_SWALLOW 158
#define EFFECT_WORRY_SEED 159
#define EFFECT_HAIL 160
#define EFFECT_TORMENT 161
#define EFFECT_FLATTER 162
#define EFFECT_WILL_O_WISP 163
#define EFFECT_MEMENTO 164
#define EFFECT_FACADE 165
#define EFFECT_FOCUS_PUNCH 166
#define EFFECT_SMELLINGSALT 167
#define EFFECT_FOLLOW_ME 168
#define EFFECT_NATURE_POWER 169
#define EFFECT_CHARGE 170
#define EFFECT_TAUNT 171
#define EFFECT_HELPING_HAND 172
#define EFFECT_TRICK 173
#define EFFECT_ROLE_PLAY 174
#define EFFECT_WISH 175
#define EFFECT_ASSIST 176
#define EFFECT_INGRAIN 177
#define EFFECT_SUPERPOWER 178
#define EFFECT_MAGIC_COAT 179
#define EFFECT_RECYCLE 180
#define EFFECT_REVENGE 181
#define EFFECT_BRICK_BREAK 182
#define EFFECT_YAWN 183
#define EFFECT_KNOCK_OFF 184
#define EFFECT_ENDEAVOR 185
#define EFFECT_ERUPTION 186
#define EFFECT_SKILL_SWAP 187
#define EFFECT_IMPRISON 188
#define EFFECT_REFRESH 189
#define EFFECT_GRUDGE 190
#define EFFECT_SNATCH 191
#define EFFECT_LOW_KICK 192
#define EFFECT_SECRET_POWER 193
#define EFFECT_RECOIL_33 194
#define EFFECT_TEETER_DANCE 195
#define EFFECT_HIT_ESCAPE 196
#define EFFECT_MUD_SPORT 197
#define EFFECT_POISON_FANG 198
#define EFFECT_WEATHER_BALL 199
#define EFFECT_OVERHEAT 200
#define EFFECT_TICKLE 201
#define EFFECT_COSMIC_POWER 202
#define EFFECT_SKY_UPPERCUT 203
#define EFFECT_BULK_UP 204
#define EFFECT_PLACEHOLDER 205
#define EFFECT_WATER_SPORT 206
#define EFFECT_CALM_MIND 207
#define EFFECT_DRAGON_DANCE 208
#define EFFECT_CAMOUFLAGE 209
// 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_REFLECT_TYPE 279
#define EFFECT_SOAK 280
#define EFFECT_GROWTH 281
#define EFFECT_CLOSE_COMBAT 282
#define EFFECT_LAST_RESORT 283
#define EFFECT_RECOIL_33_STATUS 284
#define EFFECT_FLINCH_STATUS 285
#define EFFECT_RECOIL_50 286
#define EFFECT_SHELL_SMASH 287
#define EFFECT_SHIFT_GEAR 288
#define EFFECT_DEFENSE_UP_3 289
#define EFFECT_NOBLE_ROAR 290
#define EFFECT_VENOM_DRENCH 291
#define EFFECT_TOXIC_THREAD 292
#define EFFECT_CLEAR_SMOG 293
#define EFFECT_HIT_SWITCH_TARGET 294
#define EFFECT_FINAL_GAMBIT 295
#define EFFECT_CHANGE_TYPE_ON_ITEM 296
#define EFFECT_AUTOTOMIZE 297
#define EFFECT_COPYCAT 298
#define EFFECT_DEFOG 299
#define EFFECT_HIT_ENEMY_HEAL_ALLY 300
#define EFFECT_SMACK_DOWN 301
#define EFFECT_SYNCHRONOISE 302
#define EFFECT_PSYCHO_SHIFT 303
#define EFFECT_POWER_TRICK 304
#define EFFECT_FLAME_BURST 305
#define EFFECT_AFTER_YOU 306
#define EFFECT_BESTOW 307
#define EFFECT_ROTOTILLER 308
#define EFFECT_FLOWER_SHIELD 309
#define EFFECT_HIT_PREVENT_ESCAPE 310
#define EFFECT_SPEED_SWAP 311
#define EFFECT_DEFENSE_UP2_HIT 312
#define EFFECT_REVELATION_DANCE 313
#define EFFECT_AURORA_VEIL 314
#define EFFECT_THIRD_TYPE 315
#define EFFECT_FEINT 316
#define EFFECT_SPARKLING_ARIA 317
#define EFFECT_ACUPRESSURE 318
#define EFFECT_AROMATIC_MIST 319
#define EFFECT_POWDER 320
#define EFFECT_SP_ATTACK_UP_HIT 321
#define EFFECT_BELCH 322
#define EFFECT_PARTING_SHOT 323
#define EFFECT_SPECTRAL_THIEF 324
#define EFFECT_V_CREATE 325
#define EFFECT_MAT_BLOCK 326
#define EFFECT_STOMPING_TANTRUM 327
#define EFFECT_CORE_ENFORCER 328
#define EFFECT_INSTRUCT 329
#define EFFECT_THROAT_CHOP 330
#define EFFECT_LASER_FOCUS 331
#define EFFECT_MAGNETIC_FLUX 332
#define EFFECT_GEAR_UP 333
#define EFFECT_INCINERATE 334
#define EFFECT_BUG_BITE 335
#define EFFECT_STRENGTH_SAP 336
#define EFFECT_MIND_BLOWN 337
#define EFFECT_PURIFY 338
#define EFFECT_BURN_UP 339
#define EFFECT_SHORE_UP 340
#define EFFECT_GEOMANCY 341
#define EFFECT_FAIRY_LOCK 342
#define EFFECT_ALLY_SWITCH 343
#define EFFECT_RELIC_SONG 344
#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 345
#define EFFECT_BODY_PRESS 346
#define EFFECT_EERIE_SPELL 347
#define EFFECT_JUNGLE_HEALING 348
#define EFFECT_COACHING 349
#define EFFECT_LASH_OUT 350
#define EFFECT_GRASSY_GLIDE 351
#define EFFECT_REMOVE_TERRAIN 352
#define EFFECT_DYNAMAX_DOUBLE_DMG 353
#define EFFECT_DECORATE 354
#define EFFECT_SNIPE_SHOT 355
#define EFFECT_RECOIL_HP_25 356
#define EFFECT_STUFF_CHEEKS 357
#define EFFECT_GRAV_APPLE 358
#define EFFECT_EVASION_UP_HIT 359
#define EFFECT_GLITZY_GLOW 360
#define EFFECT_BADDY_BAD 361
#define EFFECT_SAPPY_SEED 362
#define EFFECT_FREEZY_FROST 363
#define EFFECT_SPARKLY_SWIRL 364
#define EFFECT_PLASMA_FISTS 365
#define EFFECT_HYPERSPACE_FURY 366
#define EFFECT_AURA_WHEEL 367
#define EFFECT_PHOTON_GEYSER 368
#define EFFECT_SHELL_SIDE_ARM 369
#define EFFECT_TERRAIN_PULSE 370
#define EFFECT_JAW_LOCK 371
#define EFFECT_NO_RETREAT 372
#define EFFECT_TAR_SHOT 373
#define EFFECT_POLTERGEIST 374
#define EFFECT_OCTOLOCK 375
#define EFFECT_CLANGOROUS_SOUL 376
#define EFFECT_BOLT_BEAK 377
#define EFFECT_SKY_DROP 378
#define EFFECT_EXPANDING_FORCE 379
#define EFFECT_SCALE_SHOT 380
#define EFFECT_METEOR_BEAM 381
#define EFFECT_RISING_VOLTAGE 382
#define EFFECT_BEAK_BLAST 383
#define EFFECT_COURT_CHANGE 384
#define EFFECT_STEEL_BEAM 385
#define EFFECT_EXTREME_EVOBOOST 386
#define EFFECT_HIT_SET_REMOVE_TERRAIN 387 // genesis supernova
#define EFFECT_DARK_VOID 388
#define EFFECT_SLEEP_HIT 389
#define EFFECT_DOUBLE_SHOCK 390
#define EFFECT_SPECIAL_ATTACK_UP_HIT 391
#define EFFECT_VICTORY_DANCE 392
#define EFFECT_TEATIME 393
#define EFFECT_ATTACK_UP_USER_ALLY 394 // Howl 8th Gen
#define EFFECT_SHELL_TRAP 395
#define EFFECT_PSYBLADE 396
#define EFFECT_HYDRO_STEAM 397
#define EFFECT_HIT_SET_ENTRY_HAZARD 398
#define EFFECT_DIRE_CLAW 399
#define EFFECT_BARB_BARRAGE 400
#define EFFECT_REVIVAL_BLESSING 401
#define EFFECT_FROSTBITE_HIT 402
#define EFFECT_SNOWSCAPE 403
#define EFFECT_TRIPLE_ARROWS 404
#define EFFECT_INFERNAL_PARADE 405
#define EFFECT_TAKE_HEART 406
#define EFFECT_AXE_KICK 407
#define EFFECT_PLEDGE 210
#define EFFECT_FLING 211
#define EFFECT_NATURAL_GIFT 212
#define EFFECT_WAKE_UP_SLAP 213
#define EFFECT_WRING_OUT 214
#define EFFECT_HEX 215
#define EFFECT_ASSURANCE 216
#define EFFECT_TRUMP_CARD 217
#define EFFECT_ACROBATICS 218
#define EFFECT_HEAT_CRASH 219
#define EFFECT_PUNISHMENT 220
#define EFFECT_STORED_POWER 221
#define EFFECT_ELECTRO_BALL 222
#define EFFECT_GYRO_BALL 223
#define EFFECT_ECHOED_VOICE 224
#define EFFECT_PAYBACK 225
#define EFFECT_ROUND 226
#define EFFECT_BRINE 227
#define EFFECT_VENOSHOCK 228
#define EFFECT_RETALIATE 229
#define EFFECT_BULLDOZE 230
#define EFFECT_FOUL_PLAY 231
#define EFFECT_PSYSHOCK 232
#define EFFECT_ROOST 233
#define EFFECT_GRAVITY 234
#define EFFECT_MIRACLE_EYE 235
#define EFFECT_TAILWIND 236
#define EFFECT_EMBARGO 237
#define EFFECT_AQUA_RING 238
#define EFFECT_TRICK_ROOM 239
#define EFFECT_WONDER_ROOM 240
#define EFFECT_MAGIC_ROOM 241
#define EFFECT_MAGNET_RISE 242
#define EFFECT_TOXIC_SPIKES 243
#define EFFECT_GASTRO_ACID 244
#define EFFECT_STEALTH_ROCK 245
#define EFFECT_TELEKINESIS 246
#define EFFECT_POWER_SWAP 247
#define EFFECT_GUARD_SWAP 248
#define EFFECT_HEART_SWAP 249
#define EFFECT_POWER_SPLIT 250
#define EFFECT_GUARD_SPLIT 251
#define EFFECT_STICKY_WEB 252
#define EFFECT_METAL_BURST 253
#define EFFECT_LUCKY_CHANT 254
#define EFFECT_SUCKER_PUNCH 255
#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 256
#define EFFECT_SIMPLE_BEAM 257
#define EFFECT_ENTRAINMENT 258
#define EFFECT_HEAL_PULSE 259
#define EFFECT_QUASH 260
#define EFFECT_ION_DELUGE 261
#define EFFECT_FREEZE_DRY 262
#define EFFECT_TOPSY_TURVY 263
#define EFFECT_MISTY_TERRAIN 264
#define EFFECT_GRASSY_TERRAIN 265
#define EFFECT_ELECTRIC_TERRAIN 266
#define EFFECT_PSYCHIC_TERRAIN 267
#define EFFECT_ATTACK_ACCURACY_UP 268
#define EFFECT_ATTACK_SPATK_UP 269
#define EFFECT_HURRICANE 270
#define EFFECT_TWO_TYPED_MOVE 271
#define EFFECT_ME_FIRST 272
#define EFFECT_SPEED_UP_HIT 273
#define EFFECT_QUIVER_DANCE 274
#define EFFECT_COIL 275
#define EFFECT_ELECTRIFY 276
#define EFFECT_REFLECT_TYPE 277
#define EFFECT_SOAK 278
#define EFFECT_GROWTH 279
#define EFFECT_CLOSE_COMBAT 280
#define EFFECT_LAST_RESORT 281
#define EFFECT_RECOIL_33_STATUS 282
#define EFFECT_FLINCH_STATUS 283
#define EFFECT_RECOIL_50 284
#define EFFECT_SHELL_SMASH 285
#define EFFECT_SHIFT_GEAR 286
#define EFFECT_DEFENSE_UP_3 287
#define EFFECT_NOBLE_ROAR 288
#define EFFECT_VENOM_DRENCH 289
#define EFFECT_TOXIC_THREAD 290
#define EFFECT_CLEAR_SMOG 291
#define EFFECT_HIT_SWITCH_TARGET 292
#define EFFECT_FINAL_GAMBIT 293
#define EFFECT_CHANGE_TYPE_ON_ITEM 294
#define EFFECT_AUTOTOMIZE 295
#define EFFECT_COPYCAT 296
#define EFFECT_DEFOG 297
#define EFFECT_HIT_ENEMY_HEAL_ALLY 298
#define EFFECT_SMACK_DOWN 299
#define EFFECT_SYNCHRONOISE 300
#define EFFECT_PSYCHO_SHIFT 301
#define EFFECT_POWER_TRICK 302
#define EFFECT_FLAME_BURST 303
#define EFFECT_AFTER_YOU 304
#define EFFECT_BESTOW 305
#define EFFECT_ROTOTILLER 306
#define EFFECT_FLOWER_SHIELD 307
#define EFFECT_HIT_PREVENT_ESCAPE 308
#define EFFECT_SPEED_SWAP 309
#define EFFECT_DEFENSE_UP2_HIT 310
#define EFFECT_REVELATION_DANCE 311
#define EFFECT_AURORA_VEIL 312
#define EFFECT_THIRD_TYPE 313
#define EFFECT_FEINT 314
#define EFFECT_SPARKLING_ARIA 315
#define EFFECT_ACUPRESSURE 316
#define EFFECT_AROMATIC_MIST 317
#define EFFECT_POWDER 318
#define EFFECT_SP_ATTACK_UP_HIT 319
#define EFFECT_BELCH 320
#define EFFECT_PARTING_SHOT 321
#define EFFECT_SPECTRAL_THIEF 322
#define EFFECT_V_CREATE 323
#define EFFECT_MAT_BLOCK 324
#define EFFECT_STOMPING_TANTRUM 325
#define EFFECT_CORE_ENFORCER 326
#define EFFECT_INSTRUCT 327
#define EFFECT_THROAT_CHOP 328
#define EFFECT_LASER_FOCUS 329
#define EFFECT_MAGNETIC_FLUX 330
#define EFFECT_GEAR_UP 331
#define EFFECT_INCINERATE 332
#define EFFECT_BUG_BITE 333
#define EFFECT_STRENGTH_SAP 334
#define EFFECT_MIND_BLOWN 335
#define EFFECT_PURIFY 336
#define EFFECT_BURN_UP 337
#define EFFECT_SHORE_UP 338
#define EFFECT_GEOMANCY 339
#define EFFECT_FAIRY_LOCK 340
#define EFFECT_ALLY_SWITCH 341
#define EFFECT_RELIC_SONG 342
#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 343
#define EFFECT_BODY_PRESS 344
#define EFFECT_EERIE_SPELL 345
#define EFFECT_JUNGLE_HEALING 346
#define EFFECT_COACHING 347
#define EFFECT_LASH_OUT 348
#define EFFECT_GRASSY_GLIDE 349
#define EFFECT_REMOVE_TERRAIN 350
#define EFFECT_DYNAMAX_DOUBLE_DMG 351
#define EFFECT_DECORATE 352
#define EFFECT_SNIPE_SHOT 353
#define EFFECT_RECOIL_HP_25 354
#define EFFECT_STUFF_CHEEKS 355
#define EFFECT_GRAV_APPLE 356
#define EFFECT_EVASION_UP_HIT 357
#define EFFECT_GLITZY_GLOW 358
#define EFFECT_BADDY_BAD 359
#define EFFECT_SAPPY_SEED 360
#define EFFECT_FREEZY_FROST 361
#define EFFECT_SPARKLY_SWIRL 362
#define EFFECT_PLASMA_FISTS 363
#define EFFECT_HYPERSPACE_FURY 364
#define EFFECT_AURA_WHEEL 365
#define EFFECT_PHOTON_GEYSER 366
#define EFFECT_SHELL_SIDE_ARM 367
#define EFFECT_TERRAIN_PULSE 368
#define EFFECT_JAW_LOCK 369
#define EFFECT_NO_RETREAT 370
#define EFFECT_TAR_SHOT 371
#define EFFECT_POLTERGEIST 372
#define EFFECT_OCTOLOCK 373
#define EFFECT_CLANGOROUS_SOUL 374
#define EFFECT_BOLT_BEAK 375
#define EFFECT_SKY_DROP 376
#define EFFECT_EXPANDING_FORCE 377
#define EFFECT_SCALE_SHOT 378
#define EFFECT_METEOR_BEAM 379
#define EFFECT_RISING_VOLTAGE 380
#define EFFECT_BEAK_BLAST 381
#define EFFECT_COURT_CHANGE 382
#define EFFECT_STEEL_BEAM 383
#define EFFECT_EXTREME_EVOBOOST 384
#define EFFECT_HIT_SET_REMOVE_TERRAIN 385 // genesis supernova
#define EFFECT_DARK_VOID 386
#define EFFECT_SLEEP_HIT 387
#define EFFECT_DOUBLE_SHOCK 388
#define EFFECT_SPECIAL_ATTACK_UP_HIT 389
#define EFFECT_VICTORY_DANCE 390
#define EFFECT_TEATIME 391
#define EFFECT_ATTACK_UP_USER_ALLY 392 // Howl 6th Gen
#define EFFECT_SHELL_TRAP 393
#define EFFECT_PSYBLADE 394
#define EFFECT_HYDRO_STEAM 395
#define EFFECT_HIT_SET_ENTRY_HAZARD 396
#define EFFECT_DIRE_CLAW 397
#define EFFECT_BARB_BARRAGE 398
#define EFFECT_REVIVAL_BLESSING 399
#define EFFECT_FROSTBITE_HIT 400
#define EFFECT_SNOWSCAPE 401
#define EFFECT_TRIPLE_ARROWS 402
#define EFFECT_INFERNAL_PARADE 403
#define EFFECT_TAKE_HEART 404
#define EFFECT_AXE_KICK 405
#define NUM_BATTLE_MOVE_EFFECTS 408
#define NUM_BATTLE_MOVE_EFFECTS 406
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -213,39 +213,6 @@
#define EV_ITEM_RAISE_LIMIT 100
#endif
// Battle move flags
#define FLAG_MAKES_CONTACT (1 << 0)
#define FLAG_PROTECT_AFFECTED (1 << 1)
#define FLAG_MAGIC_COAT_AFFECTED (1 << 2)
#define FLAG_SNATCH_AFFECTED (1 << 3)
#define FLAG_MIRROR_MOVE_AFFECTED (1 << 4)
#define FLAG_KINGS_ROCK_AFFECTED (1 << 5)
#define FLAG_HIGH_CRIT (1 << 6)
#define FLAG_RECKLESS_BOOST (1 << 7)
#define FLAG_IRON_FIST_BOOST (1 << 8)
#define FLAG_SHEER_FORCE_BOOST (1 << 9)
#define FLAG_STRONG_JAW_BOOST (1 << 10)
#define FLAG_MEGA_LAUNCHER_BOOST (1 << 11)
#define FLAG_STAT_STAGES_IGNORED (1 << 12)
#define FLAG_DMG_MINIMIZE (1 << 13)
#define FLAG_DMG_UNDERGROUND (1 << 14)
#define FLAG_DMG_UNDERWATER (1 << 15)
#define FLAG_SOUND (1 << 16)
#define FLAG_BALLISTIC (1 << 17)
#define FLAG_PROTECTION_MOVE (1 << 18)
#define FLAG_POWDER (1 << 19)
#define FLAG_TARGET_ABILITY_IGNORED (1 << 20)
#define FLAG_DANCE (1 << 21)
#define FLAG_DMG_2X_IN_AIR (1 << 22) // If target is in the air, can hit and deal double damage.
#define FLAG_DMG_IN_AIR (1 << 23) // If target is in the air, can hit.
#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
#define FLAG_THREE_STRIKES (1 << 28) // A move with this flag will strike thrice, and may apply its effect on each hit
#define FLAG_WIND_MOVE (1 << 29)
#define FLAG_SLICING_MOVE (1 << 30)
// Split defines.
#define SPLIT_PHYSICAL 0x0
#define SPLIT_SPECIAL 0x1

View File

@ -344,10 +344,47 @@ struct BattleMove
u8 secondaryEffectChance;
u16 target;
s8 priority;
u32 flags;
u8 split;
u16 argument;
u8 zMoveEffect;
// Flags
u32 makesContact:1;
u32 ignoresProtect:1;
u32 magicCoatAffected:1;
u32 snatchAffected:1;
u32 mirrorMoveBanned:1;
u32 ignoresKingsRock:1;
u32 highCritRatio:1;
u32 punchingMove:1;
u32 sheerForceBoost:1;
u32 bitingMove:1;
u32 pulseMove:1;
u32 soundMove:1;
u32 ballisticMove:1;
u32 protectionMove:1;
u32 powderMove:1;
u32 danceMove:1;
u32 windMove:1;
u32 slicingMove:1;
u32 minimizeDoubleDamage:1;
u32 ignoresTargetAbility:1;
u32 ignoresTargetDefenseEvasionStages:1;
u32 damagesUnderground:1;
u32 damagesUnderwater:1;
u32 damagesAirborne:1;
u32 damagesAirborneDoubleDamage:1;
u32 ignoreTypeIfFlyingAndUngrounded:1;
u32 thawsUser:1;
u32 ignoresSubstitute:1;
u32 twoStrikes:1; // May apply its effect on each hit.
u32 threeStrikes:1; // May apply its effect on each hit.
u32 meFirstBanned:1;
u32 gravityBanned:1;
u32 mimicBanned:1;
u32 metronomeBanned:1;
u32 copycatBanned:1;
u32 sleepTalkBanned:1;
u32 instructBanned:1;
};
#define SPINDA_SPOT_WIDTH 16

View File

@ -695,7 +695,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
{
// handle negative checks on non-user target
// check powder moves
if (TestMoveFlags(move, FLAG_POWDER) && !IsAffectedByPowder(battlerDef, AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerDef]))
if (gBattleMoves[move].powderMove && !IsAffectedByPowder(battlerDef, AI_DATA->abilities[battlerDef], AI_DATA->holdEffects[battlerDef]))
{
RETURN_SCORE_MINUS(20);
}
@ -782,11 +782,11 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
RETURN_SCORE_MINUS(10);
break;
case ABILITY_SOUNDPROOF:
if (TestMoveFlags(move, FLAG_SOUND))
if (gBattleMoves[move].soundMove)
RETURN_SCORE_MINUS(10);
break;
case ABILITY_BULLETPROOF:
if (TestMoveFlags(move, FLAG_BALLISTIC))
if (gBattleMoves[move].ballisticMove)
RETURN_SCORE_MINUS(10);
break;
case ABILITY_DAZZLING:
@ -807,7 +807,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
RETURN_SCORE_MINUS(10);
break;
case ABILITY_MAGIC_BOUNCE:
if (TestMoveFlags(move, FLAG_MAGIC_COAT_AFFECTED))
if (gBattleMoves[move].magicCoatAffected)
RETURN_SCORE_MINUS(20);
break;
case ABILITY_CONTRARY:
@ -868,7 +868,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
RETURN_SCORE_MINUS(20);
break;
case ABILITY_MAGIC_BOUNCE:
if (TestMoveFlags(move, FLAG_MAGIC_COAT_AFFECTED) && moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_OPPONENTS_FIELD))
if (gBattleMoves[move].magicCoatAffected && moveTarget & (MOVE_TARGET_BOTH | MOVE_TARGET_FOES_AND_ALLY | MOVE_TARGET_OPPONENTS_FIELD))
RETURN_SCORE_MINUS(20);
break;
case ABILITY_SWEET_VEIL:
@ -921,7 +921,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
// the following checks apply to any target (including user)
// throat chop check
if (gDisableStructs[battlerAtk].throatChopTimer && TestMoveFlags(move, FLAG_SOUND))
if (gDisableStructs[battlerAtk].throatChopTimer && gBattleMoves[move].soundMove)
return 0; // Can't even select move at all
// heal block check
if (gStatuses3[battlerAtk] & STATUS3_HEAL_BLOCK && IsHealBlockPreventingMove(battlerAtk, move))
@ -1404,7 +1404,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
else if (AI_DATA->hpPercents[battlerAtk] <= 25)
score -= 10;
#if B_SOUND_SUBSTITUTE >= GEN_6
else if (TestMoveFlagsInMoveset(battlerDef, FLAG_SOUND))
else if (HasSoundMove(battlerDef))
score -= 8;
#endif
break;
@ -1947,7 +1947,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
// TODO
break;
case EFFECT_HEAL_BELL:
if (!AnyPartyMemberStatused(battlerAtk, TestMoveFlags(move, FLAG_SOUND)) || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove))
if (!AnyPartyMemberStatused(battlerAtk, gBattleMoves[move].soundMove) || PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove))
score -= 10;
break;
case EFFECT_HIT_PREVENT_ESCAPE:
@ -2146,7 +2146,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
score -= 10; // no teammates to assist from
break;
case EFFECT_MAGIC_COAT:
if (!TestMoveFlagsInMoveset(battlerDef, FLAG_MAGIC_COAT_AFFECTED))
if (!HasMagicCoatAffectedMove(battlerDef))
score -= 10;
break;
case EFFECT_BELCH:
@ -2192,7 +2192,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
score -= 10;
break;
case EFFECT_SNATCH:
if (!TestMoveFlagsInMoveset(battlerDef, FLAG_SNATCH_AFFECTED)
if (!HasSnatchAffectedMove(battlerDef)
|| PartnerHasSameMoveEffectWithoutTarget(BATTLE_PARTNER(battlerAtk), move, AI_DATA->partnerMove))
score -= 10;
break;
@ -2500,7 +2500,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
instructedMove = gLastMoves[battlerDef];
if (instructedMove == MOVE_NONE
|| IsInstructBannedMove(instructedMove)
|| gBattleMoves[instructedMove].instructBanned
|| MoveRequiresRecharging(instructedMove)
|| MoveCallsOtherMove(instructedMove)
|| IsZMove(instructedMove)
@ -2683,7 +2683,7 @@ static s16 AI_TryToFaint(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
else
{
// this move isn't expected to faint the target
if (TestMoveFlags(move, FLAG_HIGH_CRIT))
if (gBattleMoves[move].highCritRatio)
score += 2; // crit makes it more likely to make them faint
if (GetMoveDamageResult(move) == MOVE_POWER_OTHER)
@ -3145,7 +3145,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
}
// check high crit
if (TestMoveFlags(move, FLAG_HIGH_CRIT) && effectiveness >= AI_EFFECTIVENESS_x2 && AI_RandLessThan(128))
if (gBattleMoves[move].highCritRatio && effectiveness >= AI_EFFECTIVENESS_x2 && AI_RandLessThan(128))
score++;
// check already dead
@ -3168,7 +3168,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
score++;
// check thawing moves
if ((gBattleMons[battlerAtk].status1 & (STATUS1_FREEZE | STATUS1_FROSTBITE)) && TestMoveFlags(move, FLAG_THAW_USER))
if ((gBattleMons[battlerAtk].status1 & (STATUS1_FREEZE | STATUS1_FROSTBITE)) && gBattleMoves[move].thawsUser)
score += (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) ? 20 : 10;
// check burn
@ -3604,7 +3604,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
if (AI_DATA->abilities[battlerAtk] == ABILITY_SUPER_LUCK
|| AI_DATA->abilities[battlerAtk] == ABILITY_SNIPER
|| AI_DATA->holdEffects[battlerAtk] == HOLD_EFFECT_SCOPE_LENS
|| TestMoveFlagsInMoveset(battlerAtk, FLAG_HIGH_CRIT))
|| HasHighCritRatioMove(battlerAtk))
score += 2;
break;
case EFFECT_CONFUSE_HIT:
@ -4461,7 +4461,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
case EFFECT_GRUDGE:
break;
case EFFECT_SNATCH:
if (predictedMove != MOVE_NONE && TestMoveFlags(predictedMove, FLAG_SNATCH_AFFECTED))
if (predictedMove != MOVE_NONE && gBattleMoves[predictedMove].snatchAffected)
score += 3; // Steal move
break;
case EFFECT_MUD_SPORT:
@ -4707,9 +4707,9 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
score++;
break;
case EFFECT_THROAT_CHOP:
if (predictedMove != MOVE_NONE && TestMoveFlags(predictedMove, FLAG_SOUND) && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER)
if (predictedMove != MOVE_NONE && gBattleMoves[predictedMove].soundMove && AI_WhoStrikesFirst(battlerAtk, battlerDef, move) == AI_IS_FASTER)
score += 3; // Ai goes first and predicts the target will use a sound move
else if (TestMoveFlagsInMoveset(battlerDef, FLAG_SOUND))
else if (HasSoundMove(battlerDef))
score += 3;
break;
case EFFECT_HEAL_BLOCK:
@ -5022,7 +5022,7 @@ static s16 AI_Risky(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
if (IsTargetingPartner(battlerAtk, battlerDef))
return score;
if (TestMoveFlags(move, FLAG_HIGH_CRIT))
if (gBattleMoves[move].highCritRatio)
score += 2;
switch (gBattleMoves[move].effect)

View File

@ -21,6 +21,16 @@
#include "constants/moves.h"
#include "constants/items.h"
#define CHECK_MOVE_FLAG(flag) \
s32 i; \
u16 *moves = GetMovesArray(battler); \
for (i = 0; i < MAX_MON_MOVES; i++) \
{ \
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && gBattleMoves[moves[i]].flag) \
return TRUE; \
} \
return FALSE
static u32 AI_GetEffectiveness(u16 multiplier);
// Const Data
@ -381,35 +391,6 @@ static const u16 sIgnoreMoldBreakerMoves[] =
MOVE_SEARING_SUNRAZE_SMASH,
};
static const u16 sInstructBannedMoves[] =
{
MOVE_INSTRUCT,
MOVE_BIDE,
MOVE_FOCUS_PUNCH,
MOVE_BEAK_BLAST,
MOVE_SHELL_TRAP,
MOVE_SKETCH,
MOVE_TRANSFORM,
MOVE_MIMIC,
MOVE_KINGS_SHIELD,
MOVE_STRUGGLE,
MOVE_BOUNCE,
MOVE_DIG,
MOVE_DIVE,
MOVE_FLY,
MOVE_FREEZE_SHOCK,
MOVE_GEOMANCY,
MOVE_ICE_BURN,
MOVE_PHANTOM_FORCE,
MOVE_RAZOR_WIND,
MOVE_SHADOW_FORCE,
MOVE_SKULL_BASH,
MOVE_SKY_ATTACK,
MOVE_SKY_DROP,
MOVE_SOLAR_BEAM,
MOVE_SOLAR_BLADE,
};
static const u16 sRechargeMoves[] =
{
MOVE_HYPER_BEAM,
@ -734,7 +715,7 @@ bool32 MovesWithSplitUnusable(u32 attacker, u32 target, u32 split)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE
&& moves[i] != 0xFFFF
&& moves[i] != MOVE_UNAVAILABLE
&& GetBattleMoveSplit(moves[i]) == split
&& !(unusable & gBitTable[i]))
{
@ -760,15 +741,15 @@ static bool32 AI_GetIfCrit(u32 move, u8 battlerAtk, u8 battlerDef)
isCrit = FALSE;
break;
case 1:
if (gBattleMoves[move].flags & FLAG_HIGH_CRIT && (Random() % 5 == 0))
if (gBattleMoves[move].highCritRatio && (Random() % 5 == 0))
isCrit = TRUE;
else
isCrit = FALSE;
break;
case 2:
if (gBattleMoves[move].flags & FLAG_HIGH_CRIT && (Random() % 2 == 0))
if (gBattleMoves[move].highCritRatio && (Random() % 2 == 0))
isCrit = TRUE;
else if (!(gBattleMoves[move].flags & FLAG_HIGH_CRIT) && (Random() % 4) == 0)
else if (!(gBattleMoves[move].highCritRatio) && (Random() % 4) == 0)
isCrit = TRUE;
else
isCrit = FALSE;
@ -855,9 +836,9 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 *typeEffectiveness,
}
// Handle other multi-strike moves
if (gBattleMoves[move].flags & FLAG_TWO_STRIKES)
if (gBattleMoves[move].twoStrikes)
dmg *= 2;
else if (gBattleMoves[move].flags & FLAG_THREE_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH))
else if (gBattleMoves[move].threeStrikes || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH))
dmg *= 3;
if (dmg == 0)
@ -899,30 +880,10 @@ static u32 WhichMoveBetter(u32 move1, u32 move2)
// Check recoil
if (GetBattlerAbility(sBattler_AI) != ABILITY_ROCK_HEAD)
{
if (((gBattleMoves[move1].effect == EFFECT_RECOIL_25
|| gBattleMoves[move1].effect == EFFECT_RECOIL_IF_MISS
|| gBattleMoves[move1].effect == EFFECT_RECOIL_50
|| gBattleMoves[move1].effect == EFFECT_RECOIL_33
|| gBattleMoves[move1].effect == EFFECT_RECOIL_33_STATUS)
&& (gBattleMoves[move2].effect != EFFECT_RECOIL_25
&& gBattleMoves[move2].effect != EFFECT_RECOIL_IF_MISS
&& gBattleMoves[move2].effect != EFFECT_RECOIL_50
&& gBattleMoves[move2].effect != EFFECT_RECOIL_33
&& gBattleMoves[move2].effect != EFFECT_RECOIL_33_STATUS
&& gBattleMoves[move2].effect != EFFECT_RECHARGE)))
if (IS_MOVE_RECOIL(move1) && !IS_MOVE_RECOIL(move2) && gBattleMoves[move2].effect != EFFECT_RECHARGE)
return 1;
if (((gBattleMoves[move2].effect == EFFECT_RECOIL_25
|| gBattleMoves[move2].effect == EFFECT_RECOIL_IF_MISS
|| gBattleMoves[move2].effect == EFFECT_RECOIL_50
|| gBattleMoves[move2].effect == EFFECT_RECOIL_33
|| gBattleMoves[move2].effect == EFFECT_RECOIL_33_STATUS)
&& (gBattleMoves[move1].effect != EFFECT_RECOIL_25
&& gBattleMoves[move1].effect != EFFECT_RECOIL_IF_MISS
&& gBattleMoves[move1].effect != EFFECT_RECOIL_50
&& gBattleMoves[move1].effect != EFFECT_RECOIL_33
&& gBattleMoves[move1].effect != EFFECT_RECOIL_33_STATUS
&& gBattleMoves[move1].effect != EFFECT_RECHARGE)))
if (IS_MOVE_RECOIL(move2) && !IS_MOVE_RECOIL(move1) && gBattleMoves[move1].effect != EFFECT_RECHARGE)
return 0;
}
// Check recharge
@ -1097,7 +1058,7 @@ u8 AI_WhoStrikesFirst(u8 battlerAI, u8 battler2, u16 moveConsidered)
for (i = 0; i < MAX_MON_MOVES; i++)
{
prioBattler2 = GetMovePriority(battler2, battler2Moves[i]);
if (battler2Moves[i] == 0 || battler2Moves[i] == 0xFFFF
if (battler2Moves[i] == MOVE_NONE || battler2Moves[i] == MOVE_UNAVAILABLE
|| (prioBattler2 > prioAI && !CanIndexMoveFaintTarget(battler2, battlerAI, i , 2)))
continue;
@ -1136,7 +1097,7 @@ bool32 CanTargetFaintAi(u8 battlerDef, u8 battlerAtk)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && !(unusable & gBitTable[i])
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && !(unusable & gBitTable[i])
&& AI_DATA->simulatedDmg[battlerDef][battlerAtk][moves[i]] >= gBattleMons[battlerAtk].hp)
{
return TRUE;
@ -1156,7 +1117,7 @@ bool32 CanAIFaintTarget(u8 battlerAtk, u8 battlerDef, u8 numHits)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && !(moveLimitations & gBitTable[i]))
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && !(moveLimitations & gBitTable[i]))
{
// Use the pre-calculated value in simulatedDmg instead of re-calculating it
dmg = AI_DATA->simulatedDmg[battlerAtk][battlerDef][i];
@ -1205,7 +1166,7 @@ bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgM
if (dmgMod)
dmg *= dmgMod;
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && !(unusable & gBitTable[i]) && dmg >= hpCheck)
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && !(unusable & gBitTable[i]) && dmg >= hpCheck)
{
return TRUE;
}
@ -1470,11 +1431,11 @@ bool32 IsSemiInvulnerable(u8 battlerDef, u16 move)
{
if (gStatuses3[battlerDef] & STATUS3_PHANTOM_FORCE)
return TRUE;
else if (!TestMoveFlags(move, FLAG_DMG_IN_AIR) && gStatuses3[battlerDef] & STATUS3_ON_AIR)
else if (!gBattleMoves[move].damagesAirborne && gStatuses3[battlerDef] & STATUS3_ON_AIR)
return TRUE;
else if (!TestMoveFlags(move, FLAG_DMG_UNDERWATER) && gStatuses3[battlerDef] & STATUS3_UNDERWATER)
else if (!gBattleMoves[move].damagesUnderwater && gStatuses3[battlerDef] & STATUS3_UNDERWATER)
return TRUE;
else if (!TestMoveFlags(move, FLAG_DMG_UNDERGROUND) && gStatuses3[battlerDef] & STATUS3_UNDERGROUND)
else if (!gBattleMoves[move].damagesUnderground && gStatuses3[battlerDef] & STATUS3_UNDERGROUND)
return TRUE;
else
return FALSE;
@ -1510,7 +1471,7 @@ bool32 IsMoveEncouragedToHit(u8 battlerAtk, u8 battlerDef, u16 move)
|| (((gBattleWeather & (B_WEATHER_HAIL | B_WEATHER_SNOW)) && move == MOVE_BLIZZARD))))
|| (gBattleMoves[move].effect == EFFECT_VITAL_THROW)
#if B_MINIMIZE_DMG_ACC >= GEN_6
|| ((gStatuses3[battlerDef] & STATUS3_MINIMIZED) && (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE))
|| ((gStatuses3[battlerDef] & STATUS3_MINIMIZED) && gBattleMoves[move].minimizeDoubleDamage)
#endif
|| (gBattleMoves[move].accuracy == 0))
{
@ -1927,7 +1888,7 @@ bool32 HasOnlyMovesWithSplit(u32 battlerId, u32 split, bool32 onlyOffensive)
{
if (onlyOffensive && IS_MOVE_STATUS(moves[i]))
continue;
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && GetBattleMoveSplit(moves[i]) != split)
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && GetBattleMoveSplit(moves[i]) != split)
return FALSE;
}
@ -1941,7 +1902,7 @@ bool32 HasMoveWithSplit(u32 battler, u32 split)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && GetBattleMoveSplit(moves[i]) == split)
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && GetBattleMoveSplit(moves[i]) == split)
return TRUE;
}
@ -1955,7 +1916,7 @@ bool32 HasMoveWithType(u32 battler, u8 type)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && gBattleMoves[moves[i]].type == type)
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && gBattleMoves[moves[i]].type == type)
return TRUE;
}
@ -1969,7 +1930,7 @@ bool32 HasMoveEffect(u32 battlerId, u16 moveEffect)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && gBattleMoves[moves[i]].effect == moveEffect)
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && gBattleMoves[moves[i]].effect == moveEffect)
return TRUE;
}
@ -1983,7 +1944,7 @@ bool32 HasMove(u32 battlerId, u32 move)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && moves[i] == move)
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && moves[i] == move)
return TRUE;
}
@ -1998,7 +1959,7 @@ bool32 HasMoveWithLowAccuracy(u8 battlerAtk, u8 battlerDef, u8 accCheck, bool32
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] == MOVE_NONE || moves[i] == 0xFFFF)
if (moves[i] == MOVE_NONE || moves[i] == MOVE_UNAVAILABLE)
continue;
if (!(gBitTable[i] & moveLimitations))
@ -2066,7 +2027,7 @@ bool32 HasHealingEffect(u32 battlerId)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && IsHealingMoveEffect(gBattleMoves[moves[i]].effect))
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && IsHealingMoveEffect(gBattleMoves[moves[i]].effect))
return TRUE;
}
@ -2095,25 +2056,16 @@ bool32 HasTrappingMoveEffect(u8 battler)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && IsTrappingMoveEffect(gBattleMoves[moves[i]].effect))
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && IsTrappingMoveEffect(gBattleMoves[moves[i]].effect))
return TRUE;
}
return FALSE;
}
bool32 HasThawingMove(u8 battlerId)
bool32 HasThawingMove(u8 battler)
{
s32 i;
u16 *moves = GetMovesArray(battlerId);
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && TestMoveFlags(moves[i], FLAG_THAW_USER))
return TRUE;
}
return FALSE;
CHECK_MOVE_FLAG(thawsUser);
}
bool32 IsUngroundingEffect(u16 effect)
@ -2228,7 +2180,7 @@ bool32 HasDamagingMove(u8 battlerId)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && gBattleMoves[moves[i]].power != 0)
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE && gBattleMoves[moves[i]].power != 0)
return TRUE;
}
@ -2242,7 +2194,7 @@ bool32 HasDamagingMoveOfType(u8 battlerId, u8 type)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF
if (moves[i] != MOVE_NONE && moves[i] != MOVE_UNAVAILABLE
&& gBattleMoves[moves[i]].type == type && gBattleMoves[moves[i]].power != 0)
return TRUE;
}
@ -2250,15 +2202,24 @@ bool32 HasDamagingMoveOfType(u8 battlerId, u8 type)
return FALSE;
}
bool32 IsInstructBannedMove(u16 move)
bool32 HasSoundMove(u8 battler)
{
u32 i;
for (i = 0; i < ARRAY_COUNT(sInstructBannedMoves); i++)
{
if (move == sInstructBannedMoves[i])
return TRUE;
}
return FALSE;
CHECK_MOVE_FLAG(soundMove);
}
bool32 HasHighCritRatioMove(u8 battler)
{
CHECK_MOVE_FLAG(highCritRatio);
}
bool32 HasMagicCoatAffectedMove(u8 battler)
{
CHECK_MOVE_FLAG(magicCoatAffected);
}
bool32 HasSnatchAffectedMove(u8 battler)
{
CHECK_MOVE_FLAG(snatchAffected);
}
bool32 IsEncoreEncouragedEffect(u16 moveEffect)
@ -2295,19 +2256,6 @@ bool32 MoveCallsOtherMove(u16 move)
return FALSE;
}
bool32 TestMoveFlagsInMoveset(u8 battler, u32 flags)
{
s32 i;
u16 *moves = GetMovesArray(battler);
for (i = 0; i < MAX_MON_MOVES; i++)
{
if (moves[i] != MOVE_NONE && moves[i] != 0xFFFF && TestMoveFlags(moves[i], flags))
return TRUE;
}
return FALSE;
}
static u32 GetLeechSeedDamage(u8 battlerId)
{
u32 damage = 0;
@ -3788,7 +3736,7 @@ void IncreaseFrostbiteScore(u8 battlerAtk, u8 battlerDef, u16 move, s16 *score)
bool32 AI_MoveMakesContact(u32 ability, u32 holdEffect, u16 move)
{
if (TestMoveFlags(move, FLAG_MAKES_CONTACT)
if (gBattleMoves[move].makesContact
&& ability != ABILITY_LONG_REACH
&& holdEffect != HOLD_EFFECT_PROTECTIVE_PADS)
return TRUE;

View File

@ -5715,8 +5715,7 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk)
gBattleStruct->dynamicMoveType = TYPE_NORMAL | F_DYNAMIC_TYPE_2;
gBattleStruct->ateBoost[battlerAtk] = 1;
}
else if (gBattleMoves[move].flags & FLAG_SOUND
&& attackerAbility == ABILITY_LIQUID_VOICE)
else if (gBattleMoves[move].soundMove && attackerAbility == ABILITY_LIQUID_VOICE)
{
gBattleStruct->dynamicMoveType = TYPE_WATER | F_DYNAMIC_TYPE_2;
}

View File

@ -968,236 +968,6 @@ static const struct SpriteTemplate sSpriteTemplate_MonIconOnLvlUpBanner =
static const u16 sProtectSuccessRates[] = {USHRT_MAX, USHRT_MAX / 2, USHRT_MAX / 4, USHRT_MAX / 8};
#define FORBIDDEN_MIMIC (1 << 0)
#define FORBIDDEN_METRONOME (1 << 1)
#define FORBIDDEN_ASSIST (1 << 2)
#define FORBIDDEN_COPYCAT (1 << 3)
#define FORBIDDEN_SLEEP_TALK (1 << 4)
#define FORBIDDEN_INSTRUCT (1 << 5)
#define FORBIDDEN_PARENTAL_BOND (1 << 6)
static const u8 sForbiddenMoves[MOVES_COUNT] =
{
[MOVE_NONE] = 0xFF, // Can't use a non-move lol
[MOVE_STRUGGLE] = 0xFF, // Neither Struggle
[MOVE_AFTER_YOU] = FORBIDDEN_METRONOME,
[MOVE_APPLE_ACID] = FORBIDDEN_METRONOME,
[MOVE_ARMOR_CANNON] = FORBIDDEN_METRONOME,
[MOVE_ARM_THRUST] = FORBIDDEN_PARENTAL_BOND,
[MOVE_ASSIST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_ASTRAL_BARRAGE] = FORBIDDEN_METRONOME,
[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 | FORBIDDEN_INSTRUCT,
[MOVE_BEAT_UP] = FORBIDDEN_PARENTAL_BOND,
[MOVE_BEHEMOTH_BASH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[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 | FORBIDDEN_PARENTAL_BOND, // Note: Bide should work with Parental Bond. This will be addressed in future.
[MOVE_BLAST_BURN] = FORBIDDEN_INSTRUCT,
[MOVE_BLAZING_TORQUE] = FORBIDDEN_MIMIC | FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_BODY_PRESS] = FORBIDDEN_METRONOME,
[MOVE_BONE_RUSH] = FORBIDDEN_PARENTAL_BOND,
[MOVE_BONEMERANG] = FORBIDDEN_PARENTAL_BOND,
[MOVE_BOUNCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | 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 | FORBIDDEN_INSTRUCT,
[MOVE_CHATTER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_CHILLING_WATER] = FORBIDDEN_METRONOME,
[MOVE_CHILLY_RECEPTION] = FORBIDDEN_METRONOME,
[MOVE_CIRCLE_THROW] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_CLANGOROUS_SOUL] = FORBIDDEN_METRONOME,
[MOVE_COLLISION_COURSE] = FORBIDDEN_METRONOME,
[MOVE_COMBAT_TORQUE] = FORBIDDEN_MIMIC | FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_COMET_PUNCH] = FORBIDDEN_PARENTAL_BOND,
[MOVE_COMEUPPANCE] = FORBIDDEN_METRONOME,
[MOVE_COPYCAT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_COUNTER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_COVET] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_CRAFTY_SHIELD] = FORBIDDEN_METRONOME,
[MOVE_DECORATE] = FORBIDDEN_METRONOME,
[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 | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_DIVE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_DOODLE] = FORBIDDEN_METRONOME,
[MOVE_DOUBLE_IRON_BASH] = FORBIDDEN_METRONOME | FORBIDDEN_PARENTAL_BOND,
[MOVE_DOUBLE_HIT] = FORBIDDEN_PARENTAL_BOND,
[MOVE_DOUBLE_KICK] = FORBIDDEN_PARENTAL_BOND,
[MOVE_DOUBLE_SHOCK] = FORBIDDEN_METRONOME,
[MOVE_DOUBLE_SLAP] = FORBIDDEN_PARENTAL_BOND,
[MOVE_DRAGON_ASCENT] = FORBIDDEN_METRONOME,
[MOVE_DRAGON_ENERGY] = FORBIDDEN_METRONOME,
[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_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_ELECTRO_DRIFT] = FORBIDDEN_METRONOME,
[MOVE_ENDEAVOR] = FORBIDDEN_PARENTAL_BOND,
[MOVE_ENDURE] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_ETERNABEAM] = FORBIDDEN_METRONOME | FORBIDDEN_INSTRUCT,
[MOVE_EXPLOSION] = FORBIDDEN_PARENTAL_BOND,
[MOVE_FALSE_SURRENDER] = FORBIDDEN_METRONOME,
[MOVE_FEINT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_FIERY_WRATH] = FORBIDDEN_METRONOME,
[MOVE_FILLET_AWAY] = FORBIDDEN_METRONOME,
[MOVE_FINAL_GAMBIT] = FORBIDDEN_PARENTAL_BOND,
[MOVE_FISSURE] = FORBIDDEN_PARENTAL_BOND,
[MOVE_FLEUR_CANNON] = FORBIDDEN_METRONOME,
[MOVE_FLING] = FORBIDDEN_PARENTAL_BOND,
[MOVE_FLOATY_FALL] = FORBIDDEN_METRONOME,
[MOVE_FLY] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_FOCUS_PUNCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_FOLLOW_ME] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_FREEZE_SHOCK] = FORBIDDEN_METRONOME | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT| FORBIDDEN_PARENTAL_BOND,
[MOVE_FREEZING_GLARE] = FORBIDDEN_METRONOME,
[MOVE_FREEZY_FROST] = FORBIDDEN_METRONOME,
[MOVE_FURY_ATTACK] = FORBIDDEN_PARENTAL_BOND,
[MOVE_FURY_SWIPES] = FORBIDDEN_PARENTAL_BOND,
[MOVE_GEAR_GRIND] = FORBIDDEN_PARENTAL_BOND,
[MOVE_GEOMANCY] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_GIGA_IMPACT] = FORBIDDEN_INSTRUCT,
[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 | FORBIDDEN_INSTRUCT,
[MOVE_HORN_DRILL] = FORBIDDEN_PARENTAL_BOND,
[MOVE_HYDRO_CANNON] = FORBIDDEN_INSTRUCT,
[MOVE_HYPER_BEAM] = FORBIDDEN_INSTRUCT,
[MOVE_HYPER_DRILL] = FORBIDDEN_METRONOME,
[MOVE_HYPERSPACE_FURY] = FORBIDDEN_METRONOME,
[MOVE_HYPERSPACE_HOLE] = FORBIDDEN_METRONOME,
[MOVE_ICE_BALL] = FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_ICE_BURN] = FORBIDDEN_METRONOME | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_ICICLE_SPEAR] = FORBIDDEN_PARENTAL_BOND,
[MOVE_INSTRUCT] = FORBIDDEN_METRONOME | FORBIDDEN_INSTRUCT,
[MOVE_JET_PUNCH] = FORBIDDEN_METRONOME,
[MOVE_JUNGLE_HEALING] = FORBIDDEN_METRONOME,
[MOVE_KINGS_SHIELD] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_INSTRUCT,
[MOVE_LIFE_DEW] = FORBIDDEN_METRONOME,
[MOVE_LIGHT_OF_RUIN] = FORBIDDEN_METRONOME,
[MOVE_MAKE_IT_RAIN] = FORBIDDEN_METRONOME,
[MOVE_MAGICAL_TORQUE] = FORBIDDEN_MIMIC | FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_MAT_BLOCK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_ME_FIRST] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_METEOR_ASSAULT] = FORBIDDEN_METRONOME | FORBIDDEN_INSTRUCT,
[MOVE_METEOR_BEAM] = FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_METRONOME] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_MIMIC] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[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,
[MOVE_NOXIOUS_TORQUE] = FORBIDDEN_MIMIC | FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_OBSTRUCT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_INSTRUCT,
[MOVE_ORDER_UP] = FORBIDDEN_METRONOME,
[MOVE_ORIGIN_PULSE] = FORBIDDEN_METRONOME,
[MOVE_OUTRAGE] = FORBIDDEN_INSTRUCT,
[MOVE_OVERDRIVE] = FORBIDDEN_METRONOME,
[MOVE_PHANTOM_FORCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_PHOTON_GEYSER] = FORBIDDEN_METRONOME,
[MOVE_PLASMA_FISTS] = FORBIDDEN_METRONOME,
[MOVE_POPULATION_BOMB] = FORBIDDEN_METRONOME,
[MOVE_POUNCE] = FORBIDDEN_METRONOME,
[MOVE_POWER_SHIFT] = FORBIDDEN_METRONOME,
[MOVE_PRECIPICE_BLADES] = FORBIDDEN_METRONOME,
[MOVE_PRISMATIC_LASER] = FORBIDDEN_INSTRUCT,
[MOVE_PROTECT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_PYRO_BALL] = FORBIDDEN_METRONOME,
[MOVE_QUASH] = FORBIDDEN_METRONOME,
[MOVE_QUICK_GUARD] = FORBIDDEN_METRONOME,
[MOVE_RAGE_FIST] = FORBIDDEN_METRONOME,
[MOVE_RAGE_POWDER] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_RAGING_BULL] = FORBIDDEN_METRONOME,
[MOVE_RAGING_FURY] = FORBIDDEN_METRONOME,
[MOVE_RAZOR_WIND] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_RELIC_SONG] = FORBIDDEN_METRONOME,
[MOVE_REVIVAL_BLESSING] = FORBIDDEN_METRONOME,
[MOVE_ROAR] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_ROAR_OF_TIME] = FORBIDDEN_INSTRUCT,
[MOVE_ROCK_BLAST] = FORBIDDEN_PARENTAL_BOND,
[MOVE_ROCK_WRECKER] = FORBIDDEN_INSTRUCT,
[MOVE_ROLLOUT] = FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_RUINATION] = FORBIDDEN_METRONOME,
[MOVE_SAPPY_SEED] = FORBIDDEN_METRONOME,
[MOVE_SALT_CURE] = FORBIDDEN_METRONOME,
[MOVE_SCALE_SHOT] = FORBIDDEN_PARENTAL_BOND,
[MOVE_SECRET_SWORD] = FORBIDDEN_METRONOME,
[MOVE_SELF_DESTRUCT] = FORBIDDEN_PARENTAL_BOND,
[MOVE_SHADOW_FORCE] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_SHED_TAIL] = FORBIDDEN_METRONOME,
[MOVE_SHEER_COLD] = FORBIDDEN_PARENTAL_BOND,
[MOVE_SHELL_TRAP] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_SILK_TRAP] = FORBIDDEN_METRONOME,
[MOVE_SIZZLY_SLIDE] = FORBIDDEN_METRONOME,
[MOVE_SKETCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_SKULL_BASH] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_SKY_ATTACK] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_SKY_DROP] = FORBIDDEN_ASSIST | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_SLEEP_TALK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_SNAP_TRAP] = FORBIDDEN_METRONOME,
[MOVE_SNARL] = FORBIDDEN_METRONOME,
[MOVE_SNATCH] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_INSTRUCT,
[MOVE_SNORE] = FORBIDDEN_METRONOME,
[MOVE_SNOWSCAPE] = FORBIDDEN_METRONOME,
[MOVE_SOLAR_BEAM] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_SOLAR_BLADE] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_SPARKLY_SWIRL] = FORBIDDEN_METRONOME,
[MOVE_SPECTRAL_THIEF] = FORBIDDEN_METRONOME,
[MOVE_SPICY_EXTRACT] = FORBIDDEN_METRONOME,
[MOVE_SPIKE_CANNON] = FORBIDDEN_PARENTAL_BOND,
[MOVE_SPIKY_SHIELD] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_SPIRIT_BREAK] = FORBIDDEN_METRONOME,
[MOVE_SPLISHY_SPLASH] = FORBIDDEN_METRONOME,
[MOVE_SPOTLIGHT] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_STEAM_ERUPTION] = FORBIDDEN_METRONOME,
[MOVE_STEEL_BEAM] = FORBIDDEN_METRONOME,
[MOVE_STRANGE_STEAM] = FORBIDDEN_METRONOME,
[MOVE_SUNSTEEL_STRIKE] = 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,
[MOVE_THOUSAND_WAVES] = FORBIDDEN_METRONOME,
[MOVE_THRASH] = FORBIDDEN_INSTRUCT,
[MOVE_THUNDER_CAGE] = FORBIDDEN_METRONOME,
[MOVE_THUNDEROUS_KICK] = FORBIDDEN_METRONOME,
[MOVE_TIDY_UP] = FORBIDDEN_METRONOME,
[MOVE_TRAILBLAZE] = FORBIDDEN_METRONOME,
[MOVE_TRANSFORM] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_MIMIC | FORBIDDEN_INSTRUCT,
[MOVE_TRICK] = FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_TRIPLE_AXEL] = FORBIDDEN_PARENTAL_BOND,
[MOVE_TRIPLE_KICK] = FORBIDDEN_PARENTAL_BOND,
[MOVE_TWINEEDLE] = FORBIDDEN_PARENTAL_BOND,
[MOVE_TWIN_BEAM] = FORBIDDEN_METRONOME,
[MOVE_UPROAR] = FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT | FORBIDDEN_PARENTAL_BOND,
[MOVE_V_CREATE] = FORBIDDEN_METRONOME,
[MOVE_VEEVEE_VOLLEY] = FORBIDDEN_METRONOME,
[MOVE_WATER_SHURIKEN] = FORBIDDEN_PARENTAL_BOND,
[MOVE_WHIRLWIND] = FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT,
[MOVE_WICKED_BLOW] = FORBIDDEN_METRONOME,
[MOVE_WICKED_TORQUE] = FORBIDDEN_MIMIC | FORBIDDEN_METRONOME | FORBIDDEN_ASSIST | FORBIDDEN_COPYCAT | FORBIDDEN_SLEEP_TALK | FORBIDDEN_INSTRUCT,
[MOVE_WIDE_GUARD] = FORBIDDEN_METRONOME,
[MOVE_ZIPPY_ZAP] = FORBIDDEN_METRONOME,
};
static const u16 sFinalStrikeOnlyEffects[] =
{
EFFECT_RELIC_SONG,
@ -1608,7 +1378,7 @@ static void Cmd_attackcanceler(void)
}
if (gProtectStructs[gBattlerTarget].bounceMove
&& gBattleMoves[gCurrentMove].flags & FLAG_MAGIC_COAT_AFFECTED
&& gBattleMoves[gCurrentMove].magicCoatAffected
&& !gProtectStructs[gBattlerAttacker].usesBouncedMove)
{
PressurePPLose(gBattlerAttacker, gBattlerTarget, MOVE_MAGIC_COAT);
@ -1629,7 +1399,7 @@ static void Cmd_attackcanceler(void)
return;
}
else if (GetBattlerAbility(gBattlerTarget) == ABILITY_MAGIC_BOUNCE
&& gBattleMoves[gCurrentMove].flags & FLAG_MAGIC_COAT_AFFECTED
&& gBattleMoves[gCurrentMove].magicCoatAffected
&& !gProtectStructs[gBattlerAttacker].usesBouncedMove)
{
gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE;
@ -1651,7 +1421,7 @@ static void Cmd_attackcanceler(void)
for (i = 0; i < gBattlersCount; i++)
{
if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gBattleMoves[gCurrentMove].flags & FLAG_SNATCH_AFFECTED)
if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gBattleMoves[gCurrentMove].snatchAffected)
{
PressurePPLose(gBattlerAttacker, gBattlerByTurnOrder[i], MOVE_SNATCH);
gProtectStructs[gBattlerByTurnOrder[i]].stealMove = FALSE;
@ -1794,9 +1564,9 @@ static bool32 AccuracyCalcHelper(u16 move)
}
if ((gStatuses3[gBattlerTarget] & STATUS3_PHANTOM_FORCE)
|| (!(gBattleMoves[move].flags & (FLAG_DMG_IN_AIR | FLAG_DMG_2X_IN_AIR)) && gStatuses3[gBattlerTarget] & STATUS3_ON_AIR)
|| (!(gBattleMoves[move].flags & FLAG_DMG_UNDERGROUND) && gStatuses3[gBattlerTarget] & STATUS3_UNDERGROUND)
|| (!(gBattleMoves[move].flags & FLAG_DMG_UNDERWATER) && gStatuses3[gBattlerTarget] & STATUS3_UNDERWATER))
|| ((gStatuses3[gBattlerTarget] & STATUS3_ON_AIR) && !(gBattleMoves[move].damagesAirborne || gBattleMoves[move].damagesAirborneDoubleDamage))
|| ((gStatuses3[gBattlerTarget] & STATUS3_UNDERGROUND) && !gBattleMoves[move].damagesUnderground)
|| ((gStatuses3[gBattlerTarget] & STATUS3_UNDERWATER) && !gBattleMoves[move].damagesUnderwater))
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
JumpIfMoveFailed(7, move);
@ -1828,7 +1598,7 @@ static bool32 AccuracyCalcHelper(u16 move)
}
#if B_MINIMIZE_DMG_ACC >= GEN_6
if ((gStatuses3[gBattlerTarget] & STATUS3_MINIMIZED) && (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE))
if ((gStatuses3[gBattlerTarget] & STATUS3_MINIMIZED) && gBattleMoves[move].minimizeDoubleDamage)
{
JumpIfMoveFailed(7, move);
return TRUE;
@ -1856,7 +1626,7 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move, u32 atkAbility, u
evasionStage = gBattleMons[battlerDef].statStages[STAT_EVASION];
if (atkAbility == ABILITY_UNAWARE || atkAbility == ABILITY_KEEN_EYE)
evasionStage = DEFAULT_STAT_STAGE;
if (gBattleMoves[move].flags & FLAG_STAT_STAGES_IGNORED)
if (gBattleMoves[move].ignoresTargetDefenseEvasionStages)
evasionStage = DEFAULT_STAT_STAGE;
if (defAbility == ABILITY_UNAWARE)
accStage = DEFAULT_STAT_STAGE;
@ -2115,7 +1885,7 @@ s32 CalcCritChanceStage(u8 battlerAtk, u8 battlerDef, u32 move, bool32 recordAbi
else
{
critChance = 2 * ((gBattleMons[gBattlerAttacker].status2 & STATUS2_FOCUS_ENERGY) != 0)
+ ((gBattleMoves[gCurrentMove].flags & FLAG_HIGH_CRIT) != 0)
+ (gBattleMoves[gCurrentMove].highCritRatio)
+ (holdEffectAtk == HOLD_EFFECT_SCOPE_LENS)
+ 2 * (holdEffectAtk == HOLD_EFFECT_LUCKY_PUNCH && gBattleMons[gBattlerAttacker].species == SPECIES_CHANSEY)
+ 2 * BENEFITS_FROM_LEEK(battlerAtk, holdEffectAtk)
@ -5626,7 +5396,7 @@ static void Cmd_moveend(void)
if (gBattleMons[gBattlerTarget].status1 & STATUS1_FROSTBITE
&& gBattleMons[gBattlerTarget].hp != 0
&& gBattlerAttacker != gBattlerTarget
&& gBattleMoves[originallyUsedMove].flags & FLAG_THAW_USER
&& gBattleMoves[originallyUsedMove].thawsUser
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
{
gBattleMons[gBattlerTarget].status1 &= ~STATUS1_FROSTBITE;
@ -5966,7 +5736,7 @@ static void Cmd_moveend(void)
case MOVEEND_MIRROR_MOVE: // mirror move
if (!(gAbsentBattlerFlags & gBitTable[gBattlerAttacker])
&& !(gBattleStruct->absentBattlerFlags & gBitTable[gBattlerAttacker])
&& gBattleMoves[originallyUsedMove].flags & FLAG_MIRROR_MOVE_AFFECTED
&& !gBattleMoves[originallyUsedMove].mirrorMoveBanned
&& gHitMarker & HITMARKER_OBEYS
&& gBattlerAttacker != gBattlerTarget
&& !(gHitMarker & HITMARKER_FAINTED(gBattlerTarget))
@ -6252,7 +6022,7 @@ static void Cmd_moveend(void)
gBattleScripting.moveendState++;
break;
case MOVEEND_DANCER: // Special case because it's so annoying
if (gBattleMoves[gCurrentMove].flags & FLAG_DANCE)
if (gBattleMoves[gCurrentMove].danceMove)
{
u8 battler, nextDancer = 0;
@ -9736,7 +9506,7 @@ static void Cmd_various(void)
}
else
{
if (GetBattlerAbility(gBattlerAttacker) == ABILITY_MEGA_LAUNCHER && gBattleMoves[gCurrentMove].flags & FLAG_MEGA_LAUNCHER_BOOST)
if (GetBattlerAbility(gBattlerAttacker) == ABILITY_MEGA_LAUNCHER && gBattleMoves[gCurrentMove].pulseMove)
gBattleMoveDamage = -(gBattleMons[gActiveBattler].maxHP * 75 / 100);
else
gBattleMoveDamage = -(gBattleMons[gActiveBattler].maxHP / 2);
@ -9782,35 +9552,17 @@ static void Cmd_various(void)
case VARIOUS_TRY_ME_FIRST:
{
VARIOUS_ARGS(const u8 *failInstr);
if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget))
gBattlescriptCurrInstr = cmd->failInstr;
else if (IS_MOVE_STATUS(gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]]))
u16 move = gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]];
if (IS_MOVE_STATUS(move) || gBattleMoves[move].meFirstBanned
|| GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget))
gBattlescriptCurrInstr = cmd->failInstr;
else
{
u16 move = gBattleMons[gBattlerTarget].moves[gBattleStruct->chosenMovePositions[gBattlerTarget]];
switch (move)
{
case MOVE_STRUGGLE:
case MOVE_CHATTER:
case MOVE_FOCUS_PUNCH:
case MOVE_THIEF:
case MOVE_COVET:
case MOVE_COUNTER:
case MOVE_MIRROR_COAT:
case MOVE_METAL_BURST:
case MOVE_ME_FIRST:
case MOVE_BEAK_BLAST:
gBattlescriptCurrInstr = cmd->failInstr;
break;
default:
gCalledMove = move;
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE);
gStatuses3[gBattlerAttacker] |= STATUS3_ME_FIRST;
gBattlescriptCurrInstr = cmd->nextInstr;
break;
}
gCalledMove = move;
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
gBattlerTarget = GetMoveTarget(gCalledMove, NO_TARGET_OVERRIDE);
gStatuses3[gBattlerAttacker] |= STATUS3_ME_FIRST;
gBattlescriptCurrInstr = cmd->nextInstr;
}
return;
}
@ -10009,7 +9761,7 @@ static void Cmd_various(void)
case VARIOUS_TRY_COPYCAT:
{
VARIOUS_ARGS(const u8 *failInstr);
if (gLastUsedMove == 0xFFFF || (sForbiddenMoves[gLastUsedMove] & FORBIDDEN_COPYCAT))
if (gLastUsedMove == MOVE_UNAVAILABLE || gBattleMoves[gLastUsedMove].copycatBanned)
{
gBattlescriptCurrInstr = cmd->failInstr;
}
@ -10025,8 +9777,8 @@ static void Cmd_various(void)
case VARIOUS_TRY_INSTRUCT:
{
VARIOUS_ARGS(const u8 *failInstr);
if ((sForbiddenMoves[gLastMoves[gBattlerTarget]] & FORBIDDEN_INSTRUCT)
|| gLastMoves[gBattlerTarget] == 0xFFFF)
u16 move = gLastMoves[gBattlerTarget];
if (move == MOVE_UNAVAILABLE || gBattleMoves[move].instructBanned)
{
gBattlescriptCurrInstr = cmd->failInstr;
}
@ -11254,7 +11006,7 @@ static void Cmd_setprotectlike(void)
bool32 fail = TRUE;
bool32 notLastTurn = TRUE;
if (!(gBattleMoves[gLastResultingMoves[gBattlerAttacker]].flags & FLAG_PROTECTION_MOVE))
if (!gBattleMoves[gLastResultingMoves[gBattlerAttacker]].protectionMove)
gDisableStructs[gBattlerAttacker].protectUses = 0;
if (gCurrentTurnActionNumber == (gBattlersCount - 1))
@ -12954,7 +12706,7 @@ static void Cmd_mimicattackcopy(void)
{
CMD_ARGS(const u8 *failInstr);
if ((sForbiddenMoves[gLastMoves[gBattlerTarget]] & FORBIDDEN_MIMIC)
if ((gBattleMoves[gLastMoves[gBattlerTarget]].mimicBanned)
|| (gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED)
|| gLastMoves[gBattlerTarget] == MOVE_UNAVAILABLE)
{
@ -13017,7 +12769,7 @@ static void Cmd_metronome(void)
if (gBattleMoves[gCurrentMove].effect == EFFECT_PLACEHOLDER)
continue;
if (!(sForbiddenMoves[gCurrentMove] & FORBIDDEN_METRONOME))
if (!gBattleMoves[gCurrentMove].metronomeBanned)
{
gHitMarker &= ~HITMARKER_ATTACKSTRING_PRINTED;
gBattlescriptCurrInstr = gBattleScriptsForMoveEffects[gBattleMoves[gCurrentMove].effect];
@ -13326,7 +13078,8 @@ static bool8 IsTwoTurnsMove(u16 move)
|| gBattleMoves[move].effect == EFFECT_SOLAR_BEAM
|| gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE
|| gBattleMoves[move].effect == EFFECT_BIDE
|| gBattleMoves[move].effect == EFFECT_METEOR_BEAM)
|| gBattleMoves[move].effect == EFFECT_METEOR_BEAM
|| gBattleMoves[move].effect == EFFECT_GEOMANCY)
return TRUE;
else
return FALSE;
@ -13360,7 +13113,7 @@ static void Cmd_trychoosesleeptalkmove(void)
for (i = 0; i < MAX_MON_MOVES; i++)
{
if ((sForbiddenMoves[gBattleMons[gBattlerAttacker].moves[i]] & FORBIDDEN_SLEEP_TALK)
if ((gBattleMoves[gBattleMons[gBattlerAttacker].moves[i]].sleepTalkBanned)
|| IsTwoTurnsMove(gBattleMons[gBattlerAttacker].moves[i]))
{
unusableMovesBits |= gBitTable[i];
@ -14281,7 +14034,7 @@ static void Cmd_setforcedtarget(void)
gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTimer = 1;
gSideTimers[GetBattlerSide(gBattlerTarget)].followmeTarget = gBattlerTarget;
gSideTimers[GetBattlerSide(gBattlerTarget)].followmePowder = TestMoveFlags(gCurrentMove, FLAG_POWDER);
gSideTimers[GetBattlerSide(gBattlerTarget)].followmePowder = gBattleMoves[gCurrentMove].powderMove;
gBattlescriptCurrInstr = cmd->nextInstr;
}
@ -14852,7 +14605,9 @@ static void Cmd_assistattackselect(void)
{
u16 move = GetMonData(&party[monId], MON_DATA_MOVE1 + moveId);
if (sForbiddenMoves[move] & FORBIDDEN_ASSIST)
if (gBattleMoves[move].copycatBanned
|| gBattleMoves[move].effect == EFFECT_SEMI_INVULNERABLE
|| gBattleMoves[move].effect == EFFECT_SKY_DROP)
continue;
validMoves[chooseableMovesNo++] = move;
@ -15211,10 +14966,10 @@ bool32 DoesSubstituteBlockMove(u8 battlerAtk, u8 battlerDef, u32 move)
if (!(gBattleMons[battlerDef].status2 & STATUS2_SUBSTITUTE))
return FALSE;
#if B_SOUND_SUBSTITUTE >= GEN_6
else if (gBattleMoves[move].flags & FLAG_SOUND)
else if (gBattleMoves[move].soundMove)
return FALSE;
#endif
else if (gBattleMoves[move].flags & FLAG_HIT_IN_SUBSTITUTE)
else if (gBattleMoves[move].ignoresSubstitute)
return FALSE;
else if (GetBattlerAbility(battlerAtk) == ABILITY_INFILTRATOR)
return FALSE;
@ -16252,11 +16007,43 @@ static bool32 CriticalCapture(u32 odds)
#endif
}
static const u16 sParentalBondBannedEffects[] =
{
EFFECT_BEAT_UP,
EFFECT_BIDE, // Note: Bide should work with Parental Bond. This will be addressed in future.
EFFECT_ENDEAVOR,
EFFECT_EXPLOSION,
EFFECT_FINAL_GAMBIT,
EFFECT_FLING,
EFFECT_GEOMANCY,
EFFECT_METEOR_BEAM,
EFFECT_MULTI_HIT,
EFFECT_OHKO,
EFFECT_ROLLOUT,
EFFECT_SCALE_SHOT,
EFFECT_SEMI_INVULNERABLE,
EFFECT_SKULL_BASH,
EFFECT_SKY_DROP,
EFFECT_SOLAR_BEAM,
EFFECT_TRIPLE_KICK,
EFFECT_TWO_TURNS_ATTACK,
EFFECT_UPROAR,
};
bool8 IsMoveAffectedByParentalBond(u16 move, u8 battlerId)
{
if (gBattleMoves[move].split != SPLIT_STATUS
&& !(sForbiddenMoves[move] & FORBIDDEN_PARENTAL_BOND))
if (move != MOVE_NONE && move != MOVE_STRUGGLE
&& gBattleMoves[move].split != SPLIT_STATUS
&& !gBattleMoves[move].twoStrikes
&& !gBattleMoves[move].threeStrikes)
{
u32 i;
for (i = 0; i < ARRAY_COUNT(sParentalBondBannedEffects); i++)
{
if (gBattleMoves[move].effect == sParentalBondBannedEffects[i])
return FALSE;
}
if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE)
{
switch (GetBattlerMoveTargetType(battlerId, move))

View File

@ -217,7 +217,7 @@ static const u16 sPoints_MoveEffect[NUM_BATTLE_MOVE_EFFECTS] =
[EFFECT_PURSUIT] = 2,
[EFFECT_RAPID_SPIN] = 2,
[EFFECT_SONICBOOM] = 1,
// [EFFECT_UNUSED_83] = 1,
// [EFFECT_UNUSED_83] = 1,
[EFFECT_MORNING_SUN] = 4,
[EFFECT_SYNTHESIS] = 4,
[EFFECT_MOONLIGHT] = 4,
@ -227,16 +227,16 @@ static const u16 sPoints_MoveEffect[NUM_BATTLE_MOVE_EFFECTS] =
[EFFECT_DEFENSE_UP_HIT] = 1,
[EFFECT_ATTACK_UP_HIT] = 1,
[EFFECT_ALL_STATS_UP_HIT] = 1,
// [EFFECT_UNUSED_8D] = 1,
// [EFFECT_UNUSED_8D] = 1,
[EFFECT_BELLY_DRUM] = 7,
[EFFECT_PSYCH_UP] = 7,
[EFFECT_MIRROR_COAT] = 6,
[EFFECT_SKULL_BASH] = 3,
[EFFECT_TWISTER] = 1,
// [EFFECT_TWISTER] = 1,
[EFFECT_EARTHQUAKE] = 1,
[EFFECT_FUTURE_SIGHT] = 1,
[EFFECT_GUST] = 1,
[EFFECT_FLINCH_MINIMIZE_HIT] = 1,
// [EFFECT_FLINCH_MINIMIZE_HIT] = 1,
[EFFECT_SOLAR_BEAM] = 1,
[EFFECT_THUNDER] = 1,
[EFFECT_TELEPORT] = 1,

View File

@ -889,43 +889,6 @@ void HandleAction_ActionFinished(void)
#endif
}
static const u8 sMovesNotAffectedByStench[] =
{
[MOVE_AIR_SLASH] = 1,
[MOVE_ASTONISH] = 1,
[MOVE_BITE] = 1,
[MOVE_BONE_CLUB] = 1,
[MOVE_DARK_PULSE] = 1,
[MOVE_DOUBLE_IRON_BASH] = 1,
[MOVE_DRAGON_RUSH] = 1,
[MOVE_EXTRASENSORY] = 1,
[MOVE_FAKE_OUT] = 1,
[MOVE_FIERY_WRATH] = 1,
[MOVE_FIRE_FANG] = 1,
[MOVE_FLING] = 1,
[MOVE_FLOATY_FALL] = 1,
[MOVE_HEADBUTT] = 1,
[MOVE_HEART_STAMP] = 1,
[MOVE_HYPER_FANG] = 1,
[MOVE_ICE_FANG] = 1,
[MOVE_ICICLE_CRASH] = 1,
[MOVE_IRON_HEAD] = 1,
[MOVE_NEEDLE_ARM] = 1,
[MOVE_NONE] = 1,
[MOVE_ROCK_SLIDE] = 1,
[MOVE_ROLLING_KICK] = 1,
[MOVE_SECRET_POWER] = 1,
[MOVE_SKY_ATTACK] = 1,
[MOVE_SNORE] = 1,
[MOVE_STEAMROLLER] = 1,
[MOVE_STOMP] = 1,
[MOVE_THUNDER_FANG] = 1,
[MOVE_TWISTER] = 1,
[MOVE_WATERFALL] = 1,
[MOVE_ZEN_HEADBUTT] = 1,
[MOVE_ZING_ZAP] = 1,
};
static const u8 sAbilitiesAffectedByMoldBreaker[] =
{
[ABILITY_BATTLE_ARMOR] = 1,
@ -1607,22 +1570,7 @@ static bool32 IsGravityPreventingMove(u32 move)
if (!(gFieldStatuses & STATUS_FIELD_GRAVITY))
return FALSE;
switch (move)
{
case MOVE_BOUNCE:
case MOVE_FLY:
case MOVE_FLYING_PRESS:
case MOVE_HIGH_JUMP_KICK:
case MOVE_JUMP_KICK:
case MOVE_MAGNET_RISE:
case MOVE_SKY_DROP:
case MOVE_SPLASH:
case MOVE_TELEKINESIS:
case MOVE_FLOATY_FALL:
return TRUE;
default:
return FALSE;
}
return gBattleMoves[move].gravityBanned;
}
bool32 IsHealBlockPreventingMove(u32 battler, u32 move)
@ -1715,7 +1663,7 @@ u8 TrySetCantSelectMoveBattleScript(void)
}
}
if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && gDisableStructs[gActiveBattler].throatChopTimer != 0 && gBattleMoves[move].flags & FLAG_SOUND)
if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && gDisableStructs[gActiveBattler].throatChopTimer != 0 && gBattleMoves[move].soundMove)
{
gCurrentMove = move;
if (gBattleTypeFlags & BATTLE_TYPE_PALACE)
@ -1933,7 +1881,7 @@ u8 CheckMoveLimitations(u8 battlerId, u8 unusableMoves, u16 check)
else if (check & MOVE_LIMITATION_BELCH && IsBelchPreventingMove(battlerId, gBattleMons[battlerId].moves[i]))
unusableMoves |= gBitTable[i];
// Throat Chop
else if (check & MOVE_LIMITATION_THROAT_CHOP && gDisableStructs[battlerId].throatChopTimer && gBattleMoves[gBattleMons[battlerId].moves[i]].flags & FLAG_SOUND)
else if (check & MOVE_LIMITATION_THROAT_CHOP && gDisableStructs[battlerId].throatChopTimer && gBattleMoves[gBattleMons[battlerId].moves[i]].soundMove)
unusableMoves |= gBitTable[i];
// Stuff Cheeks
else if (check & MOVE_LIMITATION_STUFF_CHEEKS && gBattleMons[battlerId].moves[i] == MOVE_STUFF_CHEEKS && ItemId_GetPocket(gBattleMons[gActiveBattler].item) != POCKET_BERRIES)
@ -3452,7 +3400,7 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattleStruct->atkCancellerTracker++;
break;
case CANCELLER_FROZEN: // check being frozen
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE && !(gBattleMoves[gCurrentMove].flags & FLAG_THAW_USER))
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FREEZE && !(gBattleMoves[gCurrentMove].thawsUser))
{
if (!RandomPercentage(RNG_FROZEN, 20))
{
@ -3674,7 +3622,7 @@ u8 AtkCanceller_UnableToUseMove(void)
}
effect = 2;
}
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FROSTBITE && (gBattleMoves[gCurrentMove].flags & FLAG_THAW_USER))
if (gBattleMons[gBattlerAttacker].status1 & STATUS1_FROSTBITE && gBattleMoves[gCurrentMove].thawsUser)
{
if (!(gBattleMoves[gCurrentMove].effect == EFFECT_BURN_UP && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE)))
{
@ -3688,7 +3636,7 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattleStruct->atkCancellerTracker++;
break;
case CANCELLER_POWDER_MOVE:
if ((gBattleMoves[gCurrentMove].flags & FLAG_POWDER) && (gBattlerAttacker != gBattlerTarget))
if ((gBattleMoves[gCurrentMove].powderMove) && (gBattlerAttacker != gBattlerTarget))
{
#if B_POWDER_GRASS >= GEN_6
if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_GRASS) || GetBattlerAbility(gBattlerTarget) == ABILITY_OVERCOAT)
@ -3730,7 +3678,7 @@ u8 AtkCanceller_UnableToUseMove(void)
gBattleStruct->atkCancellerTracker++;
break;
case CANCELLER_THROAT_CHOP:
if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && gDisableStructs[gBattlerAttacker].throatChopTimer && gBattleMoves[gCurrentMove].flags & FLAG_SOUND)
if (gBattleStruct->zmove.toBeUsed[gBattlerAttacker] == MOVE_NONE && gDisableStructs[gBattlerAttacker].throatChopTimer && gBattleMoves[gCurrentMove].soundMove)
{
gProtectStructs[gBattlerAttacker].usedThroatChopPreventedMove = TRUE;
CancelMultiTurnMoves(gBattlerAttacker);
@ -3789,7 +3737,7 @@ u8 AtkCanceller_UnableToUseMove(void)
PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0)
}
else if (gBattleMoves[gCurrentMove].flags & FLAG_TWO_STRIKES)
else if (gBattleMoves[gCurrentMove].twoStrikes)
{
gMultiHitCounter = 2;
PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0)
@ -3798,7 +3746,7 @@ u8 AtkCanceller_UnableToUseMove(void)
// TODO
}
}
else if (gBattleMoves[gCurrentMove].effect == EFFECT_TRIPLE_KICK || gBattleMoves[gCurrentMove].flags & FLAG_THREE_STRIKES)
else if (gBattleMoves[gCurrentMove].effect == EFFECT_TRIPLE_KICK || gBattleMoves[gCurrentMove].threeStrikes)
{
gMultiHitCounter = 3;
PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 1, 0)
@ -4950,8 +4898,8 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
u16 battlerAbility = GetBattlerAbility(battler);
u16 targetAbility = GetBattlerAbility(gBattlerTarget);
if ((gLastUsedAbility == ABILITY_SOUNDPROOF && gBattleMoves[move].flags & FLAG_SOUND && !(moveTarget & MOVE_TARGET_USER))
|| (gLastUsedAbility == ABILITY_BULLETPROOF && gBattleMoves[move].flags & FLAG_BALLISTIC))
if ((gLastUsedAbility == ABILITY_SOUNDPROOF && gBattleMoves[move].soundMove && !(moveTarget & MOVE_TARGET_USER))
|| (gLastUsedAbility == ABILITY_BULLETPROOF && gBattleMoves[move].ballisticMove))
{
if (gBattleMons[gBattlerAttacker].status2 & STATUS2_MULTIPLETURNS)
gHitMarker |= HITMARKER_NO_PPDEDUCT;
@ -5063,7 +5011,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
effect = 2, statId = STAT_DEF, statAmount = 2;
break;
case ABILITY_WIND_RIDER:
if (gBattleMoves[gCurrentMove].flags & FLAG_WIND_MOVE && !(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER))
if (gBattleMoves[gCurrentMove].windMove && !(GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove) & MOVE_TARGET_USER))
effect = 2, statId = STAT_ATK;
break;
case ABILITY_EARTH_EATER:
@ -5291,7 +5239,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& IsBattlerAlive(gBattlerAttacker)
&& TARGET_TURN_DAMAGED
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT))
&& IsMoveMakingContact(move, gBattlerAttacker))
{
switch (gBattleMons[gBattlerAttacker].ability)
{
@ -5676,7 +5624,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
}
break;
case ABILITY_WIND_POWER:
if (!(gBattleMoves[gCurrentMove].flags & FLAG_WIND_MOVE))
if (!(gBattleMoves[gCurrentMove].windMove))
break;
// fall through
case ABILITY_ELECTROMORPHOSIS:
@ -5733,7 +5681,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
&& RandomWeighted(RNG_STENCH, 9, 1)
&& !IS_MOVE_STATUS(move)
&& !sMovesNotAffectedByStench[gCurrentMove])
&& !gBattleMoves[gCurrentMove].effect != EFFECT_FLINCH_HIT
&& !gBattleMoves[gCurrentMove].effect != EFFECT_FLINCH_STATUS
&& !gBattleMoves[gCurrentMove].effect != EFFECT_TRIPLE_ARROWS)
{
gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH;
BattleScriptPushCursor();
@ -5758,7 +5708,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move
{
case ABILITY_DANCER:
if (IsBattlerAlive(battler)
&& (gBattleMoves[gCurrentMove].flags & FLAG_DANCE)
&& (gBattleMoves[gCurrentMove].danceMove)
&& !gSpecialStatuses[battler].dancerUsedMove
&& gBattlerAttacker != battler)
{
@ -6150,7 +6100,7 @@ u32 GetBattlerAbility(u8 battlerId)
|| gBattleMons[gBattlerAttacker].ability == ABILITY_TERAVOLT
|| gBattleMons[gBattlerAttacker].ability == ABILITY_TURBOBLAZE)
&& !(gStatuses3[gBattlerAttacker] & STATUS3_GASTRO_ACID))
|| gBattleMoves[gCurrentMove].flags & FLAG_TARGET_ABILITY_IGNORED)
|| gBattleMoves[gCurrentMove].ignoresTargetAbility)
&& sAbilitiesAffectedByMoldBreaker[gBattleMons[battlerId].ability]
&& gBattlerByTurnOrder[gCurrentTurnActionNumber] == gBattlerAttacker
&& gActionsByTurnOrder[gBattlerByTurnOrder[gBattlerAttacker]] == B_ACTION_USE_MOVE
@ -7545,21 +7495,25 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
switch (atkHoldEffect)
{
case HOLD_EFFECT_FLINCH:
#if B_SERENE_GRACE_BOOST >= GEN_5
if (GetBattlerAbility(gBattlerAttacker) == ABILITY_SERENE_GRACE)
atkHoldEffectParam *= 2;
#endif
if (gBattleMoveDamage != 0 // Need to have done damage
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& TARGET_TURN_DAMAGED
&& RandomPercentage(RNG_HOLD_EFFECT_FLINCH, atkHoldEffectParam)
&& gBattleMoves[gCurrentMove].flags & FLAG_KINGS_ROCK_AFFECTED
&& gBattleMons[gBattlerTarget].hp)
{
gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH;
BattleScriptPushCursor();
SetMoveEffect(FALSE, 0);
BattleScriptPop();
u16 ability = GetBattlerAbility(gBattlerAttacker);
#if B_SERENE_GRACE_BOOST >= GEN_5
if (ability == ABILITY_SERENE_GRACE)
atkHoldEffectParam *= 2;
#endif
if (gBattleMoveDamage != 0 // Need to have done damage
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
&& TARGET_TURN_DAMAGED
&& !gBattleMoves[gCurrentMove].ignoresKingsRock
&& gBattleMons[gBattlerTarget].hp
&& RandomPercentage(RNG_HOLD_EFFECT_FLINCH, atkHoldEffectParam)
&& ability != ABILITY_STENCH)
{
gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH;
BattleScriptPushCursor();
SetMoveEffect(FALSE, 0);
BattleScriptPop();
}
}
break;
case HOLD_EFFECT_BLUNDER_POLICY:
@ -7621,7 +7575,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn)
case HOLD_EFFECT_THROAT_SPRAY: // Does NOT need to be a damaging move
if (gProtectStructs[gBattlerAttacker].targetAffected
&& gBattleMons[gBattlerAttacker].hp != 0
&& gBattleMoves[gCurrentMove].flags & FLAG_SOUND
&& gBattleMoves[gCurrentMove].soundMove
&& CompareStat(gBattlerAttacker, STAT_SPATK, MAX_STAT_STAGE, CMP_LESS_THAN)
&& !NoAliveMonsForEitherParty()) // Don't activate if battle will end
{
@ -8135,14 +8089,14 @@ bool32 IsMoveMakingContact(u16 move, u8 battlerAtk)
{
u16 atkHoldEffect = GetBattlerHoldEffect(battlerAtk, TRUE);
if (!(gBattleMoves[move].flags & FLAG_MAKES_CONTACT))
if (!gBattleMoves[move].makesContact)
{
if (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gBattleStruct->swapDamageCategory)
return TRUE;
else
return FALSE;
}
else if ((atkHoldEffect == HOLD_EFFECT_PUNCHING_GLOVE && (gBattleMoves[move].flags & FLAG_IRON_FIST_BOOST))
else if ((atkHoldEffect == HOLD_EFFECT_PUNCHING_GLOVE && gBattleMoves[move].punchingMove)
|| atkHoldEffect == HOLD_EFFECT_PROTECTIVE_PADS
|| GetBattlerAbility(battlerAtk) == ABILITY_LONG_REACH)
{
@ -8179,11 +8133,11 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move)
// Protective Pads doesn't stop Unseen Fist from bypassing Protect effects, so IsMoveMakingContact() isn't used here.
// This means extra logic is needed to handle Shell Side Arm.
if (GetBattlerAbility(gBattlerAttacker) == ABILITY_UNSEEN_FIST
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT || (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gBattleStruct->swapDamageCategory)))
&& (gBattleMoves[move].makesContact || (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gBattleStruct->swapDamageCategory)))
return FALSE;
else if (!(gBattleMoves[move].flags & FLAG_PROTECT_AFFECTED))
else if (gBattleMoves[move].ignoresProtect)
return FALSE;
else if (gBattleMoves[move].effect == MOVE_EFFECT_FEINT)
else if (gBattleMoves[move].effect == EFFECT_FEINT)
return FALSE;
else if (gProtectStructs[battlerId].protected)
return TRUE;
@ -8734,15 +8688,15 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
MulModifier(&modifier, UQ_4_12(1.5));
break;
case ABILITY_RECKLESS:
if (gBattleMoves[move].flags & FLAG_RECKLESS_BOOST)
if (IS_MOVE_RECOIL(move))
MulModifier(&modifier, UQ_4_12(1.2));
break;
case ABILITY_IRON_FIST:
if (gBattleMoves[move].flags & FLAG_IRON_FIST_BOOST)
if (gBattleMoves[move].punchingMove)
MulModifier(&modifier, UQ_4_12(1.2));
break;
case ABILITY_SHEER_FORCE:
if (gBattleMoves[move].flags & FLAG_SHEER_FORCE_BOOST)
if (gBattleMoves[move].sheerForceBoost)
MulModifier(&modifier, UQ_4_12(1.3));
break;
case ABILITY_SAND_FORCE:
@ -8765,11 +8719,11 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
MulModifier(&modifier, UQ_4_12(1.3));
break;
case ABILITY_STRONG_JAW:
if (gBattleMoves[move].flags & FLAG_STRONG_JAW_BOOST)
if (gBattleMoves[move].bitingMove)
MulModifier(&modifier, UQ_4_12(1.5));
break;
case ABILITY_MEGA_LAUNCHER:
if (gBattleMoves[move].flags & FLAG_MEGA_LAUNCHER_BOOST)
if (gBattleMoves[move].pulseMove)
MulModifier(&modifier, UQ_4_12(1.5));
break;
case ABILITY_WATER_BUBBLE:
@ -8801,7 +8755,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
MulModifier(&modifier, UQ_4_12(1.2));
break;
case ABILITY_PUNK_ROCK:
if (gBattleMoves[move].flags & FLAG_SOUND)
if (gBattleMoves[move].soundMove)
MulModifier(&modifier, UQ_4_12(1.3));
break;
case ABILITY_STEELY_SPIRIT:
@ -8847,7 +8801,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
MulModifier(&modifier, UQ_4_12(1.3));
break;
case ABILITY_SHARPNESS:
if (gBattleMoves[move].flags & FLAG_SLICING_MOVE)
if (gBattleMoves[move].slicingMove)
MulModifier(&modifier, UQ_4_12(1.5));
break;
case ABILITY_SUPREME_OVERLORD:
@ -9013,7 +8967,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe
MulModifier(&modifier, holdEffectModifier);
break;
case HOLD_EFFECT_PUNCHING_GLOVE:
if (gBattleMoves[move].flags & FLAG_IRON_FIST_BOOST)
if (gBattleMoves[move].punchingMove)
MulModifier(&modifier, UQ_4_12(1.1));
break;
}
@ -9350,7 +9304,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType,
if (GetBattlerAbility(battlerAtk) == ABILITY_UNAWARE)
defStage = DEFAULT_STAT_STAGE;
// certain moves also ignore stat changes
if (gBattleMoves[move].flags & FLAG_STAT_STAGES_IGNORED)
if (gBattleMoves[move].ignoresTargetDefenseEvasionStages)
defStage = DEFAULT_STAT_STAGE;
defStat *= gStatStageRatios[defStage][0];
@ -9391,7 +9345,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType,
MulModifier(&modifier, UQ_4_12(1.5));
break;
case ABILITY_PUNK_ROCK:
if (gBattleMoves[move].flags & FLAG_SOUND)
if (gBattleMoves[move].soundMove)
MulModifier(&modifier, UQ_4_12(2.0));
break;
case ABILITY_PURIFYING_SALT:
@ -9635,13 +9589,13 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move
break;
}
if (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE && gStatuses3[battlerDef] & STATUS3_MINIMIZED)
if (gBattleMoves[move].minimizeDoubleDamage && gStatuses3[battlerDef] & STATUS3_MINIMIZED)
MulModifier(&finalModifier, UQ_4_12(2.0));
if (gBattleMoves[move].flags & FLAG_DMG_UNDERGROUND && gStatuses3[battlerDef] & STATUS3_UNDERGROUND)
if (gBattleMoves[move].damagesUnderground && gStatuses3[battlerDef] & STATUS3_UNDERGROUND)
MulModifier(&finalModifier, UQ_4_12(2.0));
if (gBattleMoves[move].flags & FLAG_DMG_UNDERWATER && gStatuses3[battlerDef] & STATUS3_UNDERWATER)
if (gBattleMoves[move].damagesUnderwater && gStatuses3[battlerDef] & STATUS3_UNDERWATER)
MulModifier(&finalModifier, UQ_4_12(2.0));
if (gBattleMoves[move].flags & FLAG_DMG_2X_IN_AIR && gStatuses3[battlerDef] & STATUS3_ON_AIR)
if (gBattleMoves[move].damagesAirborneDoubleDamage && gStatuses3[battlerDef] & STATUS3_ON_AIR)
MulModifier(&finalModifier, UQ_4_12(2.0));
dmg = ApplyModifier(finalModifier, dmg);
@ -9801,7 +9755,7 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat
}
#endif
}
else if (moveType == TYPE_GROUND && !IsBattlerGrounded2(battlerDef, TRUE) && !(gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING))
else if (moveType == TYPE_GROUND && !IsBattlerGrounded2(battlerDef, TRUE) && !(gBattleMoves[move].ignoreTypeIfFlyingAndUngrounded))
{
modifier = UQ_4_12(0.0);
if (recordAbilities && defAbility == ABILITY_LEVITATE)
@ -9821,7 +9775,7 @@ static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 bat
#endif
// Thousand Arrows ignores type modifiers for flying mons
if (!IsBattlerGrounded(battlerDef) && (gBattleMoves[move].flags & FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING)
if (!IsBattlerGrounded(battlerDef) && (gBattleMoves[move].ignoreTypeIfFlyingAndUngrounded)
&& (gBattleMons[battlerDef].type1 == TYPE_FLYING || gBattleMons[battlerDef].type2 == TYPE_FLYING || gBattleMons[battlerDef].type3 == TYPE_FLYING))
{
modifier = UQ_4_12(1.0);
@ -10430,13 +10384,6 @@ u8 GetSplitBasedOnStats(u8 battlerId)
return SPLIT_PHYSICAL;
}
bool32 TestMoveFlags(u16 move, u32 flag)
{
if (gBattleMoves[move].flags & flag)
return TRUE;
return FALSE;
}
static u8 GetFlingPowerFromItemId(u16 itemId)
{
if (itemId >= ITEM_TM01 && itemId <= ITEM_HM08)
@ -10678,7 +10625,7 @@ bool32 IsBattlerAffectedByHazards(u8 battlerId, bool32 toxicSpikes)
bool32 TestSheerForceFlag(u8 battler, u16 move)
{
if (GetBattlerAbility(battler) == ABILITY_SHEER_FORCE && gBattleMoves[move].flags & FLAG_SHEER_FORCE_BOOST)
if (GetBattlerAbility(battler) == ABILITY_SHEER_FORCE && gBattleMoves[move].sheerForceBoost)
return TRUE;
else
return FALSE;

File diff suppressed because it is too large Load Diff

View File

@ -7,15 +7,15 @@ SINGLE_BATTLE_TEST("Cute Charm inflicts infatuation on contact")
PARAMETRIZE { move = MOVE_TACKLE; }
PARAMETRIZE { move = MOVE_SWIFT; }
GIVEN {
ASSUME(gBattleMoves[MOVE_TACKLE].flags & FLAG_MAKES_CONTACT);
ASSUME(!(gBattleMoves[MOVE_SWIFT].flags & FLAG_MAKES_CONTACT));
ASSUME(gBattleMoves[MOVE_TACKLE].makesContact);
ASSUME(!gBattleMoves[MOVE_SWIFT].makesContact);
PLAYER(SPECIES_WOBBUFFET) { Gender(MON_MALE); }
OPPONENT(SPECIES_CLEFAIRY) { Gender(MON_FEMALE); Ability(ABILITY_CUTE_CHARM); }
} WHEN {
TURN { MOVE(player, move); }
TURN { MOVE(player, move); }
} SCENE {
if (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) {
if (gBattleMoves[move].makesContact) {
ABILITY_POPUP(opponent, ABILITY_CUTE_CHARM);
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_INFATUATION, player);
MESSAGE("Foe Clefairy's Cute Charm infatuated Wobbuffet!");

View File

@ -60,7 +60,7 @@ SINGLE_BATTLE_TEST("Damp prevents explosion-like moves from self")
SINGLE_BATTLE_TEST("Damp prevents damage from aftermath")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_TACKLE].flags & FLAG_MAKES_CONTACT);
ASSUME(gBattleMoves[MOVE_TACKLE].makesContact);
PLAYER(SPECIES_PARAS) { Ability(ABILITY_DAMP); }
OPPONENT(SPECIES_VOLTORB) { Ability(ABILITY_AFTERMATH); HP(1); }
OPPONENT(SPECIES_WOBBUFFET);

View File

@ -7,14 +7,14 @@ SINGLE_BATTLE_TEST("Flame Body inflicts burn on contact")
PARAMETRIZE { move = MOVE_TACKLE; }
PARAMETRIZE { move = MOVE_SWIFT; }
GIVEN {
ASSUME(gBattleMoves[MOVE_TACKLE].flags & FLAG_MAKES_CONTACT);
ASSUME(!(gBattleMoves[MOVE_SWIFT].flags & FLAG_MAKES_CONTACT));
ASSUME(gBattleMoves[MOVE_TACKLE].makesContact);
ASSUME(!gBattleMoves[MOVE_SWIFT].makesContact);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_MAGMAR) { Ability(ABILITY_FLAME_BODY); }
} WHEN {
TURN { MOVE(player, move); }
} SCENE {
if (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) {
if (gBattleMoves[move].makesContact) {
ABILITY_POPUP(opponent, ABILITY_FLAME_BODY);
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_BRN, player);
MESSAGE("Foe Magmar's Flame Body burned Wobbuffet!");

View File

@ -22,7 +22,7 @@ SINGLE_BATTLE_TEST("Magic Bounce bounces back status moves")
SINGLE_BATTLE_TEST("Magic Bounce bounces back powder moves")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_STUN_SPORE].flags & FLAG_POWDER);
ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove);
ASSUME(gBattleMoves[MOVE_STUN_SPORE].effect == EFFECT_PARALYZE);
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE); }
@ -40,7 +40,7 @@ SINGLE_BATTLE_TEST("Magic Bounce bounces back powder moves")
SINGLE_BATTLE_TEST("Magic Bounce cannot bounce back powder moves against Grass Types")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_STUN_SPORE].flags & FLAG_POWDER);
ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove);
ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS);
PLAYER(SPECIES_ODDISH);
OPPONENT(SPECIES_ESPEON) { Ability(ABILITY_MAGIC_BOUNCE); }

View File

@ -7,15 +7,15 @@ SINGLE_BATTLE_TEST("Poison Point inflicts poison on contact")
PARAMETRIZE { move = MOVE_TACKLE; }
PARAMETRIZE { move = MOVE_SWIFT; }
GIVEN {
ASSUME(gBattleMoves[MOVE_TACKLE].flags & FLAG_MAKES_CONTACT);
ASSUME(!(gBattleMoves[MOVE_SWIFT].flags & FLAG_MAKES_CONTACT));
ASSUME(gBattleMoves[MOVE_TACKLE].makesContact);
ASSUME(!gBattleMoves[MOVE_SWIFT].makesContact);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_NIDORAN_M) { Ability(ABILITY_POISON_POINT); }
} WHEN {
TURN { MOVE(player, move); }
TURN {}
} SCENE {
if (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) {
if (gBattleMoves[move].makesContact) {
ABILITY_POPUP(opponent, ABILITY_POISON_POINT);
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PSN, player);
MESSAGE("Wobbuffet was poisoned by Foe Nidoran♂'s Poison Point!");

View File

@ -7,14 +7,14 @@ SINGLE_BATTLE_TEST("Static inflicts paralysis on contact")
PARAMETRIZE { move = MOVE_TACKLE; }
PARAMETRIZE { move = MOVE_SWIFT; }
GIVEN {
ASSUME(gBattleMoves[MOVE_TACKLE].flags & FLAG_MAKES_CONTACT);
ASSUME(!(gBattleMoves[MOVE_SWIFT].flags & FLAG_MAKES_CONTACT));
ASSUME(gBattleMoves[MOVE_TACKLE].makesContact);
ASSUME(!gBattleMoves[MOVE_SWIFT].makesContact);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_PIKACHU) { Ability(ABILITY_STATIC); }
} WHEN {
TURN { MOVE(player, move); }
} SCENE {
if (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) {
if (gBattleMoves[move].makesContact) {
ABILITY_POPUP(opponent, ABILITY_STATIC);
ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_PRZ, player);
MESSAGE("Foe Pikachu's Static paralyzed Wobbuffet! It may be unable to move!");

View File

@ -17,7 +17,6 @@ SINGLE_BATTLE_TEST("Stench has a 10% chance to flinch")
SINGLE_BATTLE_TEST("Stench does not stack with King's Rock")
{
KNOWN_FAILING;
PASSES_RANDOMLY(1, 10, RNG_STENCH);
GIVEN {
ASSUME(gItems[ITEM_KINGS_ROCK].holdEffect == HOLD_EFFECT_FLINCH);

View File

@ -99,7 +99,7 @@ SINGLE_BATTLE_TEST("Critical hits occur at a 1/24 rate")
SINGLE_BATTLE_TEST("Slash's critical hits occur at a 1/8 rate")
{
ASSUME(B_CRIT_CHANCE >= GEN_7);
ASSUME(gBattleMoves[MOVE_SLASH].flags & FLAG_HIGH_CRIT);
ASSUME(gBattleMoves[MOVE_SLASH].highCritRatio);
PASSES_RANDOMLY(1, 8, RNG_CRITICAL_HIT);
GIVEN {
PLAYER(SPECIES_WOBBUFFET);

View File

@ -37,7 +37,7 @@ DOUBLE_BATTLE_TEST("Beak Blast burns all who make contact with the pokemon")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_BEAK_BLAST].priority < 0);
ASSUME(gBattleMoves[MOVE_TACKLE].flags & FLAG_MAKES_CONTACT);
ASSUME(gBattleMoves[MOVE_TACKLE].makesContact);
PLAYER(SPECIES_WYNAUT) { Speed(10); }
PLAYER(SPECIES_WOBBUFFET) { Speed(5); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(3); }
@ -80,9 +80,9 @@ SINGLE_BATTLE_TEST("Beak Blast burns only when contact moves are used")
PARAMETRIZE { move = MOVE_LEER; burn = FALSE; }
GIVEN {
ASSUME(gBattleMoves[MOVE_TACKLE].flags & FLAG_MAKES_CONTACT);
ASSUME(!(gBattleMoves[MOVE_WATER_GUN].flags & FLAG_MAKES_CONTACT));
ASSUME(!(gBattleMoves[MOVE_LEER].flags & FLAG_MAKES_CONTACT));
ASSUME(gBattleMoves[MOVE_TACKLE].makesContact);
ASSUME(!gBattleMoves[MOVE_WATER_GUN].makesContact);
ASSUME(!gBattleMoves[MOVE_LEER].makesContact);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {

View File

@ -27,7 +27,7 @@ SINGLE_BATTLE_TEST("Jump Kick has 50% recoil on protect")
{
s16 recoil;
GIVEN {
ASSUME(gBattleMoves[MOVE_JUMP_KICK].flags & FLAG_PROTECT_AFFECTED);
ASSUME(!gBattleMoves[MOVE_JUMP_KICK].ignoresProtect);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {

View File

@ -46,7 +46,7 @@ SINGLE_BATTLE_TEST("Triple Arrows makes the foe flinch 30% of the time")
SINGLE_BATTLE_TEST("Triple Arrows lands a critical hit")
{
ASSUME(B_CRIT_CHANCE >= GEN_7);
ASSUME(gBattleMoves[MOVE_TRIPLE_ARROWS].flags & FLAG_HIGH_CRIT);
ASSUME(gBattleMoves[MOVE_TRIPLE_ARROWS].highCritRatio == TRUE);
PASSES_RANDOMLY(1, 8, RNG_CRITICAL_HIT);
GIVEN {
PLAYER(SPECIES_WOBBUFFET);

View File

@ -8,7 +8,7 @@ SINGLE_BATTLE_TEST("Three-strike flag turns a move into a 3-hit move")
s16 thirdHit;
GIVEN {
ASSUME(gBattleMoves[MOVE_TRIPLE_DIVE].flags & FLAG_THREE_STRIKES);
ASSUME(gBattleMoves[MOVE_TRIPLE_DIVE].threeStrikes);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
@ -34,7 +34,7 @@ SINGLE_BATTLE_TEST("Surging Strikes hits 3 times with each hit being a critical
s16 thirdHit;
GIVEN {
ASSUME(gBattleMoves[MOVE_SURGING_STRIKES].flags & FLAG_THREE_STRIKES);
ASSUME(gBattleMoves[MOVE_SURGING_STRIKES].threeStrikes);
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {

View File

@ -4,7 +4,7 @@
SINGLE_BATTLE_TEST("Powder Moves are blocked by Grass Types")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_STUN_SPORE].flags & FLAG_POWDER);
ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove);
ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS);
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_ODDISH);
@ -19,7 +19,7 @@ SINGLE_BATTLE_TEST("Powder Moves are blocked by Grass Types")
SINGLE_BATTLE_TEST("Powder Moves are blocked by Ability Overcoat")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_STUN_SPORE].flags & FLAG_POWDER);
ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove);
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_PINECO) { Ability(ABILITY_OVERCOAT); }
} WHEN {
@ -34,7 +34,7 @@ SINGLE_BATTLE_TEST("Powder Moves are blocked by Ability Overcoat")
SINGLE_BATTLE_TEST("Powder Moves are blocked by Item Safety Goggles")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_STUN_SPORE].flags & FLAG_POWDER);
ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove);
ASSUME(gItems[ITEM_SAFETY_GOGGLES].holdEffect == HOLD_EFFECT_SAFETY_GOGGLES);
PLAYER(SPECIES_WYNAUT);
OPPONENT(SPECIES_ABRA) { Item(ITEM_SAFETY_GOGGLES); }

View File

@ -101,7 +101,7 @@ SINGLE_BATTLE_TEST("Freeze is thawed by opponent's Fire-type attacks")
SINGLE_BATTLE_TEST("Freeze is thawed by user's Flame Wheel")
{
GIVEN {
ASSUME(gBattleMoves[MOVE_FLAME_WHEEL].flags & FLAG_THAW_USER);
ASSUME(gBattleMoves[MOVE_FLAME_WHEEL].thawsUser);
PLAYER(SPECIES_WOBBUFFET) { Status1(STATUS1_FREEZE); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {

View File

@ -87,7 +87,7 @@
* SINGLE_BATTLE_TEST("Stun Spore does not affect Grass-types")
* {
* GIVEN {
* ASSUME(gBattleMoves[MOVE_STUN_SPORE].flags & FLAG_POWDER);
* ASSUME(gBattleMoves[MOVE_STUN_SPORE].powderMove);
* ASSUME(gSpeciesInfo[SPECIES_ODDISH].types[0] == TYPE_GRASS);
* PLAYER(SPECIES_ODDISH); // 1.
* OPPONENT(SPECIES_ODDISH); // 2.