From 9a5481a136c35e984ffb93f7b9c4614bc7590637 Mon Sep 17 00:00:00 2001 From: Alex <93446519+AlexOn1ine@users.noreply.github.com> Date: Mon, 19 Feb 2024 13:36:21 +0100 Subject: [PATCH] Partial fix for Teeter Dance and Ability Dancer interaction (#4129) * Parial fix for Teeter Dance and Ability Dancer interaction * Removes rest of teeter dance checks and make it work with effect_confuse * Update test/battle/ability/dancer.c Co-authored-by: Bassoonian * Update test/battle/ability/dancer.c Co-authored-by: ultima-soul <33333039+ultima-soul@users.noreply.github.com> --------- Co-authored-by: Bassoonian Co-authored-by: ultima-soul <33333039+ultima-soul@users.noreply.github.com> --- data/battle_scripts_1.s | 58 --- include/battle_ai_util.h | 2 +- include/constants/battle_move_effects.h | 447 ++++++++++++------------ src/battle_ai_main.c | 19 +- src/battle_ai_util.c | 26 +- src/battle_tv.c | 1 - src/data/battle_moves.h | 2 +- test/battle/ability/dancer.c | 35 ++ test/battle/move_effect/confuse.c | 58 +++ 9 files changed, 333 insertions(+), 315 deletions(-) create mode 100644 test/battle/ability/dancer.c create mode 100644 test/battle/move_effect/confuse.c diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 7f7b66652360..8cfdc83ce1a7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -216,7 +216,6 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_LOW_KICK .4byte BattleScript_EffectSecretPower @ EFFECT_SECRET_POWER .4byte BattleScript_EffectHit @ EFFECT_RECOIL_33 - .4byte BattleScript_EffectTeeterDance @ EFFECT_TEETER_DANCE .4byte BattleScript_EffectHitEscape @ EFFECT_HIT_ESCAPE .4byte BattleScript_EffectMudSport @ EFFECT_MUD_SPORT .4byte BattleScript_EffectPoisonFang @ EFFECT_POISON_FANG @@ -6129,63 +6128,6 @@ BattleScript_EffectRecoilHP25: incrementgamestat GAME_STAT_USED_STRUGGLE goto BattleScript_EffectHit -BattleScript_EffectTeeterDance:: - attackcanceler - attackstring - ppreduce - setbyte gBattlerTarget, 0 -BattleScript_TeeterDanceLoop:: - movevaluescleanup - setmoveeffect MOVE_EFFECT_CONFUSION - jumpifbyteequal gBattlerAttacker, gBattlerTarget, BattleScript_TeeterDanceLoopIncrement - jumpifability BS_TARGET, ABILITY_OWN_TEMPO, BattleScript_TeeterDanceOwnTempoPrevents - jumpifsubstituteblocks BattleScript_TeeterDanceSubstitutePrevents - jumpifstatus2 BS_TARGET, STATUS2_CONFUSION, BattleScript_TeeterDanceAlreadyConfused - jumpifhasnohp BS_TARGET, BattleScript_TeeterDanceLoopIncrement - accuracycheck BattleScript_TeeterDanceMissed, ACC_CURR_MOVE - jumpifsafeguard BattleScript_TeeterDanceSafeguardProtected - attackanimation - waitanimation - seteffectprimary - resultmessage - waitmessage B_WAIT_TIME_LONG -BattleScript_TeeterDanceDoMoveEndIncrement:: - moveendto MOVEEND_NEXT_TARGET -BattleScript_TeeterDanceLoopIncrement:: - addbyte gBattlerTarget, 1 - jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_TeeterDanceLoop - end - -BattleScript_TeeterDanceOwnTempoPrevents:: - pause B_WAIT_TIME_SHORT - printstring STRINGID_PKMNPREVENTSCONFUSIONWITH - waitmessage B_WAIT_TIME_LONG - goto BattleScript_TeeterDanceDoMoveEndIncrement - -BattleScript_TeeterDanceSafeguardProtected:: - pause B_WAIT_TIME_SHORT - printstring STRINGID_PKMNUSEDSAFEGUARD - waitmessage B_WAIT_TIME_LONG - goto BattleScript_TeeterDanceDoMoveEndIncrement - -BattleScript_TeeterDanceSubstitutePrevents:: - pause B_WAIT_TIME_SHORT - printstring STRINGID_BUTITFAILED - waitmessage B_WAIT_TIME_LONG - goto BattleScript_TeeterDanceDoMoveEndIncrement - -BattleScript_TeeterDanceAlreadyConfused:: - setalreadystatusedmoveattempt BS_ATTACKER - pause B_WAIT_TIME_SHORT - printstring STRINGID_PKMNALREADYCONFUSED - waitmessage B_WAIT_TIME_LONG - goto BattleScript_TeeterDanceDoMoveEndIncrement - -BattleScript_TeeterDanceMissed:: - resultmessage - waitmessage B_WAIT_TIME_LONG - goto BattleScript_TeeterDanceDoMoveEndIncrement - BattleScript_EffectMudSport:: BattleScript_EffectWaterSport:: attackcanceler diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index 983526510935..69b09eaaf968 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -139,7 +139,7 @@ bool32 HasSnatchAffectedMove(u32 battler); // status checks bool32 AI_CanBeBurned(u32 battler, u32 ability); bool32 AI_CanGetFrostbite(u32 battler, u32 ability); -bool32 AI_CanBeConfused(u32 battler, u32 ability); +bool32 AI_CanBeConfused(u32 battlerAtk, u32 battlerDef, u32 move, u32 ability); bool32 AI_CanSleep(u32 battler, u32 ability); bool32 IsBattlerIncapacitated(u32 battler, u32 ability); bool32 AI_CanPutToSleep(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u32 partnerMove); diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 056f0ce4f7be..4edbcc1ed05b 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -195,232 +195,231 @@ #define EFFECT_LOW_KICK 191 #define EFFECT_SECRET_POWER 192 #define EFFECT_RECOIL_33 193 -#define EFFECT_TEETER_DANCE 194 -#define EFFECT_HIT_ESCAPE 195 -#define EFFECT_MUD_SPORT 196 -#define EFFECT_POISON_FANG 197 -#define EFFECT_WEATHER_BALL 198 -#define EFFECT_OVERHEAT 199 -#define EFFECT_TICKLE 200 -#define EFFECT_COSMIC_POWER 201 -#define EFFECT_SKY_UPPERCUT 202 -#define EFFECT_BULK_UP 203 -#define EFFECT_PLACEHOLDER 204 -#define EFFECT_WATER_SPORT 205 -#define EFFECT_CALM_MIND 206 -#define EFFECT_DRAGON_DANCE 207 -#define EFFECT_CAMOUFLAGE 208 +#define EFFECT_HIT_ESCAPE 194 +#define EFFECT_MUD_SPORT 195 +#define EFFECT_POISON_FANG 196 +#define EFFECT_WEATHER_BALL 197 +#define EFFECT_OVERHEAT 198 +#define EFFECT_TICKLE 199 +#define EFFECT_COSMIC_POWER 200 +#define EFFECT_SKY_UPPERCUT 201 +#define EFFECT_BULK_UP 202 +#define EFFECT_PLACEHOLDER 203 +#define EFFECT_WATER_SPORT 204 +#define EFFECT_CALM_MIND 205 +#define EFFECT_DRAGON_DANCE 206 +#define EFFECT_CAMOUFLAGE 207 // New move effects -#define EFFECT_PLEDGE 209 -#define EFFECT_FLING 210 -#define EFFECT_NATURAL_GIFT 211 -#define EFFECT_WAKE_UP_SLAP 212 -#define EFFECT_WRING_OUT 213 -#define EFFECT_HEX 214 -#define EFFECT_ASSURANCE 215 -#define EFFECT_TRUMP_CARD 216 -#define EFFECT_ACROBATICS 217 -#define EFFECT_HEAT_CRASH 218 -#define EFFECT_PUNISHMENT 219 -#define EFFECT_STORED_POWER 220 -#define EFFECT_ELECTRO_BALL 221 -#define EFFECT_GYRO_BALL 222 -#define EFFECT_ECHOED_VOICE 223 -#define EFFECT_PAYBACK 224 -#define EFFECT_ROUND 225 -#define EFFECT_BRINE 226 -#define EFFECT_VENOSHOCK 227 -#define EFFECT_RETALIATE 228 -#define EFFECT_BULLDOZE 229 -#define EFFECT_FOUL_PLAY 230 -#define EFFECT_PSYSHOCK 231 -#define EFFECT_ROOST 232 -#define EFFECT_GRAVITY 233 -#define EFFECT_MIRACLE_EYE 234 -#define EFFECT_TAILWIND 235 -#define EFFECT_EMBARGO 236 -#define EFFECT_AQUA_RING 237 -#define EFFECT_TRICK_ROOM 238 -#define EFFECT_WONDER_ROOM 239 -#define EFFECT_MAGIC_ROOM 240 -#define EFFECT_MAGNET_RISE 241 -#define EFFECT_TOXIC_SPIKES 242 -#define EFFECT_GASTRO_ACID 243 -#define EFFECT_STEALTH_ROCK 244 -#define EFFECT_TELEKINESIS 245 -#define EFFECT_POWER_SWAP 246 -#define EFFECT_GUARD_SWAP 247 -#define EFFECT_HEART_SWAP 248 -#define EFFECT_POWER_SPLIT 249 -#define EFFECT_GUARD_SPLIT 250 -#define EFFECT_STICKY_WEB 251 -#define EFFECT_METAL_BURST 252 -#define EFFECT_LUCKY_CHANT 253 -#define EFFECT_SUCKER_PUNCH 254 -#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 255 -#define EFFECT_SIMPLE_BEAM 256 -#define EFFECT_ENTRAINMENT 257 -#define EFFECT_HEAL_PULSE 258 -#define EFFECT_QUASH 259 -#define EFFECT_ION_DELUGE 260 -#define EFFECT_FREEZE_DRY 261 -#define EFFECT_TOPSY_TURVY 262 -#define EFFECT_MISTY_TERRAIN 263 -#define EFFECT_GRASSY_TERRAIN 264 -#define EFFECT_ELECTRIC_TERRAIN 265 -#define EFFECT_PSYCHIC_TERRAIN 266 -#define EFFECT_ATTACK_ACCURACY_UP 267 -#define EFFECT_ATTACK_SPATK_UP 268 -#define EFFECT_HURRICANE 269 -#define EFFECT_TWO_TYPED_MOVE 270 -#define EFFECT_ME_FIRST 271 -#define EFFECT_SPEED_UP_HIT 272 -#define EFFECT_QUIVER_DANCE 273 -#define EFFECT_COIL 274 -#define EFFECT_ELECTRIFY 275 -#define EFFECT_REFLECT_TYPE 276 -#define EFFECT_SOAK 277 -#define EFFECT_GROWTH 278 -#define EFFECT_CLOSE_COMBAT 279 -#define EFFECT_LAST_RESORT 280 -#define EFFECT_RECOIL_33_STATUS 281 -#define EFFECT_FLINCH_STATUS 282 -#define EFFECT_RECOIL_50 283 -#define EFFECT_SHELL_SMASH 284 -#define EFFECT_SHIFT_GEAR 285 -#define EFFECT_DEFENSE_UP_3 286 -#define EFFECT_NOBLE_ROAR 287 -#define EFFECT_VENOM_DRENCH 288 -#define EFFECT_TOXIC_THREAD 289 -#define EFFECT_CLEAR_SMOG 290 -#define EFFECT_HIT_SWITCH_TARGET 291 -#define EFFECT_FINAL_GAMBIT 292 -#define EFFECT_CHANGE_TYPE_ON_ITEM 293 -#define EFFECT_AUTOTOMIZE 294 -#define EFFECT_COPYCAT 295 -#define EFFECT_DEFOG 296 -#define EFFECT_HIT_ENEMY_HEAL_ALLY 297 -#define EFFECT_SMACK_DOWN 298 -#define EFFECT_SYNCHRONOISE 299 -#define EFFECT_PSYCHO_SHIFT 300 -#define EFFECT_POWER_TRICK 301 -#define EFFECT_FLAME_BURST 302 -#define EFFECT_AFTER_YOU 303 -#define EFFECT_BESTOW 304 -#define EFFECT_ROTOTILLER 305 -#define EFFECT_FLOWER_SHIELD 306 -#define EFFECT_HIT_PREVENT_ESCAPE 307 -#define EFFECT_SPEED_SWAP 308 -#define EFFECT_DEFENSE_UP2_HIT 309 -#define EFFECT_REVELATION_DANCE 310 -#define EFFECT_AURORA_VEIL 311 -#define EFFECT_THIRD_TYPE 312 -#define EFFECT_FEINT 313 -#define EFFECT_SPARKLING_ARIA 314 -#define EFFECT_ACUPRESSURE 315 -#define EFFECT_AROMATIC_MIST 316 -#define EFFECT_POWDER 317 -#define EFFECT_SP_ATTACK_UP_HIT 318 -#define EFFECT_BELCH 319 -#define EFFECT_PARTING_SHOT 320 -#define EFFECT_SPECTRAL_THIEF 321 -#define EFFECT_V_CREATE 322 -#define EFFECT_MAT_BLOCK 323 -#define EFFECT_STOMPING_TANTRUM 324 -#define EFFECT_CORE_ENFORCER 325 -#define EFFECT_INSTRUCT 326 -#define EFFECT_THROAT_CHOP 327 -#define EFFECT_LASER_FOCUS 328 -#define EFFECT_MAGNETIC_FLUX 329 -#define EFFECT_GEAR_UP 330 -#define EFFECT_INCINERATE 331 -#define EFFECT_BUG_BITE 332 -#define EFFECT_STRENGTH_SAP 333 -#define EFFECT_MIND_BLOWN 334 -#define EFFECT_PURIFY 335 -#define EFFECT_BURN_UP 336 -#define EFFECT_SHORE_UP 337 -#define EFFECT_GEOMANCY 338 -#define EFFECT_FAIRY_LOCK 339 -#define EFFECT_ALLY_SWITCH 340 -#define EFFECT_RELIC_SONG 341 -#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 342 -#define EFFECT_BODY_PRESS 343 -#define EFFECT_EERIE_SPELL 344 -#define EFFECT_JUNGLE_HEALING 345 -#define EFFECT_COACHING 346 -#define EFFECT_LASH_OUT 347 -#define EFFECT_GRASSY_GLIDE 348 -#define EFFECT_DYNAMAX_DOUBLE_DMG 349 -#define EFFECT_DECORATE 350 -#define EFFECT_SNIPE_SHOT 351 -#define EFFECT_RECOIL_HP_25 352 -#define EFFECT_STUFF_CHEEKS 353 -#define EFFECT_GRAV_APPLE 354 -#define EFFECT_EVASION_UP_HIT 355 -#define EFFECT_GLITZY_GLOW 356 -#define EFFECT_BADDY_BAD 357 -#define EFFECT_SAPPY_SEED 358 -#define EFFECT_FREEZY_FROST 359 -#define EFFECT_SPARKLY_SWIRL 360 -#define EFFECT_PLASMA_FISTS 361 -#define EFFECT_HYPERSPACE_FURY 362 -#define EFFECT_AURA_WHEEL 363 -#define EFFECT_PHOTON_GEYSER 364 -#define EFFECT_SHELL_SIDE_ARM 365 -#define EFFECT_TERRAIN_PULSE 366 -#define EFFECT_JAW_LOCK 367 -#define EFFECT_NO_RETREAT 368 -#define EFFECT_TAR_SHOT 369 -#define EFFECT_POLTERGEIST 370 -#define EFFECT_OCTOLOCK 371 -#define EFFECT_CLANGOROUS_SOUL 372 -#define EFFECT_BOLT_BEAK 373 -#define EFFECT_SKY_DROP 374 -#define EFFECT_EXPANDING_FORCE 375 -#define EFFECT_METEOR_BEAM 376 -#define EFFECT_RISING_VOLTAGE 377 -#define EFFECT_BEAK_BLAST 378 -#define EFFECT_COURT_CHANGE 379 -#define EFFECT_MAX_HP_50_RECOIL 380 -#define EFFECT_EXTREME_EVOBOOST 381 -#define EFFECT_HIT_SET_REMOVE_TERRAIN 382 // genesis supernova -#define EFFECT_DARK_VOID 383 -#define EFFECT_SLEEP_HIT 384 -#define EFFECT_DOUBLE_SHOCK 385 -#define EFFECT_SPECIAL_ATTACK_UP_HIT 386 -#define EFFECT_VICTORY_DANCE 387 -#define EFFECT_TEATIME 388 -#define EFFECT_ATTACK_UP_USER_ALLY 389 // Howl 8th Gen -#define EFFECT_SHELL_TRAP 390 -#define EFFECT_PSYBLADE 391 -#define EFFECT_HYDRO_STEAM 392 -#define EFFECT_HIT_SET_ENTRY_HAZARD 393 -#define EFFECT_DIRE_CLAW 394 -#define EFFECT_BARB_BARRAGE 395 -#define EFFECT_REVIVAL_BLESSING 396 -#define EFFECT_FROSTBITE_HIT 397 -#define EFFECT_SNOWSCAPE 398 -#define EFFECT_TRIPLE_ARROWS 399 -#define EFFECT_INFERNAL_PARADE 400 -#define EFFECT_TAKE_HEART 401 -#define EFFECT_AXE_KICK 402 -#define EFFECT_COLLISION_COURSE 403 -#define EFFECT_SPIN_OUT 404 -#define EFFECT_MAKE_IT_RAIN 405 -#define EFFECT_CORROSIVE_GAS 406 -#define EFFECT_POPULATION_BOMB 407 -#define EFFECT_MORTAL_SPIN 408 -#define EFFECT_SALT_CURE 409 -#define EFFECT_CHILLY_RECEPTION 410 -#define EFFECT_MATCHA_GOTCHA 411 -#define EFFECT_SYRUP_BOMB 412 -#define EFFECT_MAX_MOVE 413 -#define EFFECT_GLAIVE_RUSH 414 -#define EFFECT_RAGING_BULL 415 -#define EFFECT_RAGE_FIST 416 +#define EFFECT_PLEDGE 208 +#define EFFECT_FLING 209 +#define EFFECT_NATURAL_GIFT 210 +#define EFFECT_WAKE_UP_SLAP 211 +#define EFFECT_WRING_OUT 212 +#define EFFECT_HEX 213 +#define EFFECT_ASSURANCE 214 +#define EFFECT_TRUMP_CARD 215 +#define EFFECT_ACROBATICS 216 +#define EFFECT_HEAT_CRASH 217 +#define EFFECT_PUNISHMENT 218 +#define EFFECT_STORED_POWER 219 +#define EFFECT_ELECTRO_BALL 220 +#define EFFECT_GYRO_BALL 221 +#define EFFECT_ECHOED_VOICE 222 +#define EFFECT_PAYBACK 223 +#define EFFECT_ROUND 224 +#define EFFECT_BRINE 225 +#define EFFECT_VENOSHOCK 226 +#define EFFECT_RETALIATE 227 +#define EFFECT_BULLDOZE 228 +#define EFFECT_FOUL_PLAY 229 +#define EFFECT_PSYSHOCK 230 +#define EFFECT_ROOST 231 +#define EFFECT_GRAVITY 232 +#define EFFECT_MIRACLE_EYE 233 +#define EFFECT_TAILWIND 234 +#define EFFECT_EMBARGO 235 +#define EFFECT_AQUA_RING 236 +#define EFFECT_TRICK_ROOM 237 +#define EFFECT_WONDER_ROOM 238 +#define EFFECT_MAGIC_ROOM 239 +#define EFFECT_MAGNET_RISE 240 +#define EFFECT_TOXIC_SPIKES 241 +#define EFFECT_GASTRO_ACID 242 +#define EFFECT_STEALTH_ROCK 243 +#define EFFECT_TELEKINESIS 244 +#define EFFECT_POWER_SWAP 245 +#define EFFECT_GUARD_SWAP 246 +#define EFFECT_HEART_SWAP 247 +#define EFFECT_POWER_SPLIT 248 +#define EFFECT_GUARD_SPLIT 249 +#define EFFECT_STICKY_WEB 250 +#define EFFECT_METAL_BURST 251 +#define EFFECT_LUCKY_CHANT 252 +#define EFFECT_SUCKER_PUNCH 253 +#define EFFECT_SPECIAL_DEFENSE_DOWN_HIT_2 254 +#define EFFECT_SIMPLE_BEAM 255 +#define EFFECT_ENTRAINMENT 256 +#define EFFECT_HEAL_PULSE 257 +#define EFFECT_QUASH 258 +#define EFFECT_ION_DELUGE 259 +#define EFFECT_FREEZE_DRY 260 +#define EFFECT_TOPSY_TURVY 261 +#define EFFECT_MISTY_TERRAIN 262 +#define EFFECT_GRASSY_TERRAIN 263 +#define EFFECT_ELECTRIC_TERRAIN 264 +#define EFFECT_PSYCHIC_TERRAIN 265 +#define EFFECT_ATTACK_ACCURACY_UP 266 +#define EFFECT_ATTACK_SPATK_UP 267 +#define EFFECT_HURRICANE 268 +#define EFFECT_TWO_TYPED_MOVE 269 +#define EFFECT_ME_FIRST 270 +#define EFFECT_SPEED_UP_HIT 271 +#define EFFECT_QUIVER_DANCE 272 +#define EFFECT_COIL 273 +#define EFFECT_ELECTRIFY 274 +#define EFFECT_REFLECT_TYPE 275 +#define EFFECT_SOAK 276 +#define EFFECT_GROWTH 277 +#define EFFECT_CLOSE_COMBAT 278 +#define EFFECT_LAST_RESORT 279 +#define EFFECT_RECOIL_33_STATUS 280 +#define EFFECT_FLINCH_STATUS 281 +#define EFFECT_RECOIL_50 282 +#define EFFECT_SHELL_SMASH 283 +#define EFFECT_SHIFT_GEAR 284 +#define EFFECT_DEFENSE_UP_3 285 +#define EFFECT_NOBLE_ROAR 286 +#define EFFECT_VENOM_DRENCH 287 +#define EFFECT_TOXIC_THREAD 288 +#define EFFECT_CLEAR_SMOG 289 +#define EFFECT_HIT_SWITCH_TARGET 290 +#define EFFECT_FINAL_GAMBIT 291 +#define EFFECT_CHANGE_TYPE_ON_ITEM 292 +#define EFFECT_AUTOTOMIZE 293 +#define EFFECT_COPYCAT 294 +#define EFFECT_DEFOG 295 +#define EFFECT_HIT_ENEMY_HEAL_ALLY 296 +#define EFFECT_SMACK_DOWN 297 +#define EFFECT_SYNCHRONOISE 298 +#define EFFECT_PSYCHO_SHIFT 299 +#define EFFECT_POWER_TRICK 300 +#define EFFECT_FLAME_BURST 301 +#define EFFECT_AFTER_YOU 302 +#define EFFECT_BESTOW 303 +#define EFFECT_ROTOTILLER 304 +#define EFFECT_FLOWER_SHIELD 305 +#define EFFECT_HIT_PREVENT_ESCAPE 306 +#define EFFECT_SPEED_SWAP 307 +#define EFFECT_DEFENSE_UP2_HIT 308 +#define EFFECT_REVELATION_DANCE 309 +#define EFFECT_AURORA_VEIL 310 +#define EFFECT_THIRD_TYPE 311 +#define EFFECT_FEINT 312 +#define EFFECT_SPARKLING_ARIA 313 +#define EFFECT_ACUPRESSURE 314 +#define EFFECT_AROMATIC_MIST 315 +#define EFFECT_POWDER 316 +#define EFFECT_SP_ATTACK_UP_HIT 317 +#define EFFECT_BELCH 318 +#define EFFECT_PARTING_SHOT 319 +#define EFFECT_SPECTRAL_THIEF 320 +#define EFFECT_V_CREATE 321 +#define EFFECT_MAT_BLOCK 322 +#define EFFECT_STOMPING_TANTRUM 323 +#define EFFECT_CORE_ENFORCER 324 +#define EFFECT_INSTRUCT 325 +#define EFFECT_THROAT_CHOP 326 +#define EFFECT_LASER_FOCUS 327 +#define EFFECT_MAGNETIC_FLUX 328 +#define EFFECT_GEAR_UP 329 +#define EFFECT_INCINERATE 330 +#define EFFECT_BUG_BITE 331 +#define EFFECT_STRENGTH_SAP 332 +#define EFFECT_MIND_BLOWN 333 +#define EFFECT_PURIFY 334 +#define EFFECT_BURN_UP 335 +#define EFFECT_SHORE_UP 336 +#define EFFECT_GEOMANCY 337 +#define EFFECT_FAIRY_LOCK 338 +#define EFFECT_ALLY_SWITCH 339 +#define EFFECT_RELIC_SONG 340 +#define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 341 +#define EFFECT_BODY_PRESS 342 +#define EFFECT_EERIE_SPELL 343 +#define EFFECT_JUNGLE_HEALING 344 +#define EFFECT_COACHING 345 +#define EFFECT_LASH_OUT 346 +#define EFFECT_GRASSY_GLIDE 347 +#define EFFECT_DYNAMAX_DOUBLE_DMG 348 +#define EFFECT_DECORATE 349 +#define EFFECT_SNIPE_SHOT 350 +#define EFFECT_RECOIL_HP_25 351 +#define EFFECT_STUFF_CHEEKS 352 +#define EFFECT_GRAV_APPLE 353 +#define EFFECT_EVASION_UP_HIT 354 +#define EFFECT_GLITZY_GLOW 355 +#define EFFECT_BADDY_BAD 356 +#define EFFECT_SAPPY_SEED 357 +#define EFFECT_FREEZY_FROST 358 +#define EFFECT_SPARKLY_SWIRL 359 +#define EFFECT_PLASMA_FISTS 360 +#define EFFECT_HYPERSPACE_FURY 361 +#define EFFECT_AURA_WHEEL 362 +#define EFFECT_PHOTON_GEYSER 363 +#define EFFECT_SHELL_SIDE_ARM 364 +#define EFFECT_TERRAIN_PULSE 365 +#define EFFECT_JAW_LOCK 366 +#define EFFECT_NO_RETREAT 367 +#define EFFECT_TAR_SHOT 368 +#define EFFECT_POLTERGEIST 369 +#define EFFECT_OCTOLOCK 370 +#define EFFECT_CLANGOROUS_SOUL 371 +#define EFFECT_BOLT_BEAK 372 +#define EFFECT_SKY_DROP 373 +#define EFFECT_EXPANDING_FORCE 374 +#define EFFECT_METEOR_BEAM 375 +#define EFFECT_RISING_VOLTAGE 376 +#define EFFECT_BEAK_BLAST 377 +#define EFFECT_COURT_CHANGE 378 +#define EFFECT_MAX_HP_50_RECOIL 379 +#define EFFECT_EXTREME_EVOBOOST 380 +#define EFFECT_HIT_SET_REMOVE_TERRAIN 381 // genesis supernova +#define EFFECT_DARK_VOID 382 +#define EFFECT_SLEEP_HIT 383 +#define EFFECT_DOUBLE_SHOCK 384 +#define EFFECT_SPECIAL_ATTACK_UP_HIT 385 +#define EFFECT_VICTORY_DANCE 386 +#define EFFECT_TEATIME 387 +#define EFFECT_ATTACK_UP_USER_ALLY 388 // Howl 8th Gen +#define EFFECT_SHELL_TRAP 389 +#define EFFECT_PSYBLADE 390 +#define EFFECT_HYDRO_STEAM 391 +#define EFFECT_HIT_SET_ENTRY_HAZARD 392 +#define EFFECT_DIRE_CLAW 393 +#define EFFECT_BARB_BARRAGE 394 +#define EFFECT_REVIVAL_BLESSING 395 +#define EFFECT_FROSTBITE_HIT 396 +#define EFFECT_SNOWSCAPE 397 +#define EFFECT_TRIPLE_ARROWS 398 +#define EFFECT_INFERNAL_PARADE 399 +#define EFFECT_TAKE_HEART 400 +#define EFFECT_AXE_KICK 401 +#define EFFECT_COLLISION_COURSE 402 +#define EFFECT_SPIN_OUT 403 +#define EFFECT_MAKE_IT_RAIN 404 +#define EFFECT_CORROSIVE_GAS 405 +#define EFFECT_POPULATION_BOMB 406 +#define EFFECT_MORTAL_SPIN 407 +#define EFFECT_SALT_CURE 408 +#define EFFECT_CHILLY_RECEPTION 409 +#define EFFECT_MATCHA_GOTCHA 410 +#define EFFECT_SYRUP_BOMB 411 +#define EFFECT_MAX_MOVE 412 +#define EFFECT_GLAIVE_RUSH 413 +#define EFFECT_RAGING_BULL 414 +#define EFFECT_RAGE_FIST 415 -#define NUM_BATTLE_MOVE_EFFECTS 417 +#define NUM_BATTLE_MOVE_EFFECTS 416 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 130770fec4da..f8ffac4c0648 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -1893,19 +1893,6 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) break; } break; - case EFFECT_TEETER_DANCE: - if (((gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) - || (!DoesBattlerIgnoreAbilityChecks(aiData->abilities[battlerAtk], move) && aiData->abilities[battlerDef] == ABILITY_OWN_TEMPO) - || (IsBattlerGrounded(battlerDef) && AI_IsTerrainAffected(battlerDef, STATUS_FIELD_MISTY_TERRAIN)) - || (DoesSubstituteBlockMove(battlerAtk, battlerDef, move))) - && ((gBattleMons[BATTLE_PARTNER(battlerDef)].status2 & STATUS2_CONFUSION) - || (!DoesBattlerIgnoreAbilityChecks(aiData->abilities[battlerAtk], move) && aiData->abilities[BATTLE_PARTNER(battlerDef)] == ABILITY_OWN_TEMPO) - || (IsBattlerGrounded(BATTLE_PARTNER(battlerDef)) && AI_IsTerrainAffected(BATTLE_PARTNER(battlerDef), STATUS_FIELD_MISTY_TERRAIN)) - || (DoesSubstituteBlockMove(battlerAtk, BATTLE_PARTNER(battlerDef), move)))) - { - ADJUST_SCORE(-10); - } - break; case EFFECT_TRANSFORM: if (gBattleMons[battlerAtk].status2 & STATUS2_TRANSFORMED || (gBattleMons[battlerDef].status2 & (STATUS2_TRANSFORMED | STATUS2_SUBSTITUTE))) //Leave out Illusion b/c AI is supposed to be fooled @@ -2945,7 +2932,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) case EFFECT_SWAGGER: if (gBattleMons[battlerAtkPartner].statStages[STAT_ATK] < MAX_STAT_STAGE && HasMoveWithSplit(battlerAtkPartner, SPLIT_PHYSICAL) - && (!AI_CanBeConfused(battlerAtkPartner, TRUE) + && (!AI_CanBeConfused(battlerAtk, battlerAtkPartner, move, TRUE) || atkPartnerHoldEffect == HOLD_EFFECT_CURE_CONFUSION || atkPartnerHoldEffect == HOLD_EFFECT_CURE_STATUS)) { @@ -2955,7 +2942,7 @@ static s32 AI_DoubleBattle(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) case EFFECT_FLATTER: if (gBattleMons[battlerAtkPartner].statStages[STAT_SPATK] < MAX_STAT_STAGE && HasMoveWithSplit(battlerAtkPartner, SPLIT_SPECIAL) - && (!AI_CanBeConfused(battlerAtkPartner, TRUE) + && (!AI_CanBeConfused(battlerAtk, battlerAtkPartner, move, TRUE) || atkPartnerHoldEffect == HOLD_EFFECT_CURE_CONFUSION || atkPartnerHoldEffect == HOLD_EFFECT_CURE_STATUS)) { @@ -4959,7 +4946,6 @@ static s32 AI_SetupFirstTurn(u32 battlerAtk, u32 battlerDef, u32 move, s32 score case EFFECT_WILL_O_WISP: case EFFECT_INGRAIN: case EFFECT_IMPRISON: - case EFFECT_TEETER_DANCE: case EFFECT_TICKLE: case EFFECT_COSMIC_POWER: case EFFECT_BULK_UP: @@ -5029,7 +5015,6 @@ static s32 AI_Risky(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) case EFFECT_MIRROR_COAT: case EFFECT_FOCUS_PUNCH: case EFFECT_REVENGE: - case EFFECT_TEETER_DANCE: if (Random() & 1) ADJUST_SCORE(2); break; diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index f675602fb968..e89380aad822 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -356,7 +356,6 @@ static const u16 sEncouragedEncoreEffects[] = EFFECT_IMPRISON, EFFECT_REFRESH, EFFECT_GRUDGE, - EFFECT_TEETER_DANCE, EFFECT_MUD_SPORT, EFFECT_WATER_SPORT, EFFECT_DRAGON_DANCE, @@ -1422,7 +1421,6 @@ bool32 IsConfusionMoveEffect(u32 moveEffect) case EFFECT_CONFUSE: case EFFECT_SWAGGER: case EFFECT_FLATTER: - case EFFECT_TEETER_DANCE: return TRUE; default: return FALSE; @@ -2819,25 +2817,27 @@ bool32 AI_CanParalyze(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, return TRUE; } -bool32 AI_CanBeConfused(u32 battler, u32 ability) +bool32 AI_CanBeConfused(u32 battlerAtk, u32 battlerDef, u32 move, u32 ability) { - if ((gBattleMons[battler].status2 & STATUS2_CONFUSION) - || (ability == ABILITY_OWN_TEMPO) - || (IsBattlerGrounded(battler) && (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN))) + if ((gBattleMons[battlerDef].status2 & STATUS2_CONFUSION) + || (ability == ABILITY_OWN_TEMPO && !DoesBattlerIgnoreAbilityChecks(AI_DATA->abilities[battlerAtk], move)) + || (IsBattlerGrounded(battlerDef) && (gFieldStatuses & STATUS_FIELD_MISTY_TERRAIN)) + || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD + || DoesSubstituteBlockMove(battlerAtk, battlerDef, move)) return FALSE; return TRUE; } bool32 AI_CanConfuse(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 battlerAtkPartner, u32 move, u32 partnerMove) { - if (!AI_CanBeConfused(battlerDef, defAbility) - || AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0 - || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD - || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) - || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) - { + if (gBattleMoves[move].target == MOVE_TARGET_FOES_AND_ALLY + && AI_CanBeConfused(battlerAtk, battlerDef, move, defAbility) + && !AI_CanBeConfused(battlerAtk, BATTLE_PARTNER(battlerDef), move, AI_DATA->abilities[BATTLE_PARTNER(battlerDef)])) + return FALSE; + + if (!AI_CanBeConfused(battlerAtk, battlerDef, move, defAbility) + || DoesPartnerHaveSameMoveEffect(battlerAtkPartner, battlerDef, move, partnerMove)) return FALSE; - } return TRUE; } diff --git a/src/battle_tv.c b/src/battle_tv.c index f22b9f96e5b9..d7af63cd68fe 100644 --- a/src/battle_tv.c +++ b/src/battle_tv.c @@ -281,7 +281,6 @@ static const u16 sPoints_MoveEffect[NUM_BATTLE_MOVE_EFFECTS] = [EFFECT_LOW_KICK] = 1, [EFFECT_SECRET_POWER] = 1, [EFFECT_RECOIL_33] = 2, - [EFFECT_TEETER_DANCE] = 6, // [EFFECT_BLAZE_KICK] = 1, [EFFECT_MUD_SPORT] = 4, [EFFECT_POISON_FANG] = 1, diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 1495a3a426cb..0a331e15d467 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -5340,7 +5340,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] = [MOVE_TEETER_DANCE] = { - .effect = EFFECT_TEETER_DANCE, + .effect = EFFECT_CONFUSE, .power = 0, .type = TYPE_NORMAL, .accuracy = 100, diff --git a/test/battle/ability/dancer.c b/test/battle/ability/dancer.c new file mode 100644 index 000000000000..4a7a58f47d6c --- /dev/null +++ b/test/battle/ability/dancer.c @@ -0,0 +1,35 @@ +#include "global.h" +#include "test/battle.h" + +SINGLE_BATTLE_TEST("Dancer can copy a dance move immediately after it was used and allow the user of Dancer to still use its move") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_QUIVER_DANCE].danceMove == TRUE); + PLAYER(SPECIES_WOBBUFFET) + OPPONENT(SPECIES_ORICORIO) { Ability(ABILITY_DANCER); } + } WHEN { + TURN { MOVE(player, MOVE_QUIVER_DANCE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUIVER_DANCE, player); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, player); + ABILITY_POPUP(opponent, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_QUIVER_DANCE, opponent); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_STATS_CHANGE, opponent); + ANIMATION(ANIM_TYPE_MOVE, MOVE_CELEBRATE, opponent); // Same turn + } +} + +SINGLE_BATTLE_TEST("Dancer can copy Teeter Dance") +{ + GIVEN { + ASSUME(gBattleMoves[MOVE_TEETER_DANCE].danceMove == TRUE); + PLAYER(SPECIES_WOBBUFFET) + OPPONENT(SPECIES_ORICORIO) { Ability(ABILITY_DANCER); Item(ITEM_LUM_BERRY); } + } WHEN { + TURN { MOVE(player, MOVE_TEETER_DANCE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, player); + ABILITY_POPUP(opponent, ABILITY_DANCER); + ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, opponent); + } +} diff --git a/test/battle/move_effect/confuse.c b/test/battle/move_effect/confuse.c new file mode 100644 index 000000000000..be4b8f596e22 --- /dev/null +++ b/test/battle/move_effect/confuse.c @@ -0,0 +1,58 @@ +#include "global.h" +#include "test/battle.h" + +ASSUMPTIONS +{ + ASSUME(gBattleMoves[MOVE_TEETER_DANCE].effect == EFFECT_CONFUSE); +} + +SINGLE_BATTLE_TEST("Teeter Dance confuses target") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_TEETER_DANCE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, opponent); + MESSAGE("Foe Wobbuffet became confused!"); + } +} + +SINGLE_BATTLE_TEST("Teeter Dance confusion is blocked by Own Tempo") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_SLOWPOKE) { Ability(ABILITY_OWN_TEMPO); } + } WHEN { + TURN { MOVE(player, MOVE_TEETER_DANCE); } + } SCENE { + ABILITY_POPUP(opponent, ABILITY_OWN_TEMPO); + NONE_OF { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, player); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, opponent); + MESSAGE("Foe Wobbuffet became confused!"); + } + } +} + +DOUBLE_BATTLE_TEST("Teeter Dance can confuse foes and allies") +{ + GIVEN { + PLAYER(SPECIES_WOBBUFFET); + PLAYER(SPECIES_WYNAUT); + OPPONENT(SPECIES_WOBBUFFET); + OPPONENT(SPECIES_WYNAUT); + } WHEN { + TURN { MOVE(playerLeft, MOVE_TEETER_DANCE); } + } SCENE { + ANIMATION(ANIM_TYPE_MOVE, MOVE_TEETER_DANCE, playerLeft); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, opponentLeft); + MESSAGE("Foe Wobbuffet became confused!"); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, playerRight); + MESSAGE("Wynaut became confused!"); + ANIMATION(ANIM_TYPE_STATUS, B_ANIM_STATUS_CONFUSION, opponentRight); + MESSAGE("Foe Wynaut became confused!"); + } +}