Refactor Multi-Attack, Judgment, and Techno Blast to use the same move effect

This commit is contained in:
ExpoSeed 2020-11-07 22:53:26 -06:00
parent 7fb457a30e
commit d2566c8988
4 changed files with 59 additions and 65 deletions

View File

@ -302,55 +302,54 @@
#define EFFECT_CLEAR_SMOG 296 #define EFFECT_CLEAR_SMOG 296
#define EFFECT_HIT_SWITCH_TARGET 297 #define EFFECT_HIT_SWITCH_TARGET 297
#define EFFECT_FINAL_GAMBIT 298 #define EFFECT_FINAL_GAMBIT 298
#define EFFECT_TECHNO_BLAST 299 #define EFFECT_CHANGE_TYPE_ON_ITEM 299 // Techno Blast, Multi Attack, Judgment
#define EFFECT_JUDGMENT 300 #define EFFECT_AUTOTOMIZE 300
#define EFFECT_AUTOTOMIZE 301 #define EFFECT_COPYCAT 301
#define EFFECT_COPYCAT 302 #define EFFECT_DEFOG 302
#define EFFECT_DEFOG 303 #define EFFECT_HIT_ENEMY_HEAL_ALLY 303 // Pollen Puff
#define EFFECT_HIT_ENEMY_HEAL_ALLY 304 // Pollen Puff #define EFFECT_SMACK_DOWN 304
#define EFFECT_SMACK_DOWN 305 #define EFFECT_SYNCHRONOISE 305
#define EFFECT_SYNCHRONOISE 306 #define EFFECT_PSYCHO_SHIFT 306
#define EFFECT_PSYCHO_SHIFT 307 #define EFFECT_POWER_TRICK 307
#define EFFECT_POWER_TRICK 308 #define EFFECT_FLAME_BURST 308
#define EFFECT_FLAME_BURST 309 #define EFFECT_AFTER_YOU 309
#define EFFECT_AFTER_YOU 310 #define EFFECT_BESTOW 310
#define EFFECT_BESTOW 311 #define EFFECT_ROTOTILLER 311
#define EFFECT_ROTOTILLER 312 #define EFFECT_FLOWER_SHIELD 312
#define EFFECT_FLOWER_SHIELD 313 #define EFFECT_HIT_PREVENT_ESCAPE 313
#define EFFECT_HIT_PREVENT_ESCAPE 314 #define EFFECT_SPEED_SWAP 314
#define EFFECT_SPEED_SWAP 315 #define EFFECT_DEFENSE_UP2_HIT 315
#define EFFECT_DEFENSE_UP2_HIT 316 #define EFFECT_REVELATION_DANCE 316
#define EFFECT_REVELATION_DANCE 317 #define EFFECT_AURORA_VEIL 317
#define EFFECT_AURORA_VEIL 318 #define EFFECT_THIRD_TYPE 318
#define EFFECT_THIRD_TYPE 319 #define EFFECT_FEINT 319
#define EFFECT_FEINT 320 #define EFFECT_SPARKLING_ARIA 320
#define EFFECT_SPARKLING_ARIA 321 #define EFFECT_ACUPRESSURE 321
#define EFFECT_ACUPRESSURE 322 #define EFFECT_AROMATIC_MIST 322
#define EFFECT_AROMATIC_MIST 323 #define EFFECT_POWDER 323
#define EFFECT_POWDER 324 #define EFFECT_SP_ATTACK_UP_HIT 324
#define EFFECT_SP_ATTACK_UP_HIT 325 #define EFFECT_BELCH 325
#define EFFECT_BELCH 326 #define EFFECT_PARTING_SHOT 326
#define EFFECT_PARTING_SHOT 327 #define EFFECT_SPECTRAL_THIEF 327
#define EFFECT_SPECTRAL_THIEF 328 #define EFFECT_V_CREATE 328
#define EFFECT_V_CREATE 329 #define EFFECT_MAT_BLOCK 329
#define EFFECT_MAT_BLOCK 330 #define EFFECT_STOMPING_TANTRUM 330
#define EFFECT_STOMPING_TANTRUM 331 #define EFFECT_CORE_ENFORCER 331
#define EFFECT_CORE_ENFORCER 332 #define EFFECT_INSTRUCT 332
#define EFFECT_INSTRUCT 333 #define EFFECT_THROAT_CHOP 333
#define EFFECT_THROAT_CHOP 334 #define EFFECT_LASER_FOCUS 334
#define EFFECT_LASER_FOCUS 335 #define EFFECT_MAGNETIC_FLUX 335
#define EFFECT_MAGNETIC_FLUX 336 #define EFFECT_GEAR_UP 336
#define EFFECT_GEAR_UP 337 #define EFFECT_INCINERATE 337
#define EFFECT_INCINERATE 338 #define EFFECT_BUG_BITE 338
#define EFFECT_BUG_BITE 339 #define EFFECT_STRENGTH_SAP 339
#define EFFECT_STRENGTH_SAP 340 #define EFFECT_MIND_BLOWN 340
#define EFFECT_MIND_BLOWN 341 #define EFFECT_PURIFY 341
#define EFFECT_PURIFY 342 #define EFFECT_BURN_UP 342
#define EFFECT_BURN_UP 343 #define EFFECT_SHORE_UP 343
#define EFFECT_SHORE_UP 344 #define EFFECT_GEOMANCY 344
#define EFFECT_GEOMANCY 345 #define EFFECT_FAIRY_LOCK 345
#define EFFECT_FAIRY_LOCK 346 #define EFFECT_ALLY_SWITCH 346
#define EFFECT_ALLY_SWITCH 347 #define EFFECT_SLEEP_HIT 347 // Relic Song
#define EFFECT_SLEEP_HIT 348 // Relic Song
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -134,6 +134,7 @@
#define HOLD_EFFECT_SEEDS 151 #define HOLD_EFFECT_SEEDS 151
#define HOLD_EFFECT_ADRENALINE_ORB 152 #define HOLD_EFFECT_ADRENALINE_ORB 152
#define HOLD_EFFECT_MEMORY 153 #define HOLD_EFFECT_MEMORY 153
#define HOLD_EFFECT_PLATE 154
#define HOLD_EFFECT_CHOICE(holdEffect)((holdEffect == HOLD_EFFECT_CHOICE_BAND || holdEffect == HOLD_EFFECT_CHOICE_SCARF || holdEffect == HOLD_EFFECT_CHOICE_SPECS)) #define HOLD_EFFECT_CHOICE(holdEffect)((holdEffect == HOLD_EFFECT_CHOICE_BAND || holdEffect == HOLD_EFFECT_CHOICE_SCARF || holdEffect == HOLD_EFFECT_CHOICE_SPECS))

View File

@ -4972,20 +4972,11 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk)
gBattleStruct->dynamicMoveType++; gBattleStruct->dynamicMoveType++;
gBattleStruct->dynamicMoveType |= 0xC0; gBattleStruct->dynamicMoveType |= 0xC0;
} }
else if (gBattleMoves[move].effect == EFFECT_TECHNO_BLAST) else if (gBattleMoves[move].effect == EFFECT_CHANGE_TYPE_ON_ITEM)
{ {
if (GetBattlerHoldEffect(battlerAtk, TRUE) == HOLD_EFFECT_DRIVE) if (GetBattlerHoldEffect(battlerAtk, TRUE) == gBattleMoves[move].argument)
gBattleStruct->dynamicMoveType = ItemId_GetSecondaryId(gBattleMons[battlerAtk].item) | 0x80; gBattleStruct->dynamicMoveType = ItemId_GetSecondaryId(gBattleMons[battlerAtk].item) | 0x80;
} }
else if (move == MOVE_MULTI_ATTACK)
{
if (GetBattlerHoldEffect(battlerAtk, TRUE) == HOLD_EFFECT_MEMORY)
gBattleStruct->dynamicMoveType = ItemId_GetSecondaryId(gBattleMons[battlerAtk].item) | 0x80;
}
else if (gBattleMoves[move].effect == EFFECT_JUDGMENT)
{
// TODO:
}
else if (gBattleMoves[move].effect == EFFECT_REVELATION_DANCE) else if (gBattleMoves[move].effect == EFFECT_REVELATION_DANCE)
{ {
if (gBattleMons[battlerAtk].type1 != TYPE_MYSTERY) if (gBattleMons[battlerAtk].type1 != TYPE_MYSTERY)
@ -5011,7 +5002,7 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk)
else if (gBattleMoves[move].type == TYPE_NORMAL else if (gBattleMoves[move].type == TYPE_NORMAL
&& gBattleMoves[move].effect != EFFECT_HIDDEN_POWER && gBattleMoves[move].effect != EFFECT_HIDDEN_POWER
&& gBattleMoves[move].effect != EFFECT_WEATHER_BALL && gBattleMoves[move].effect != EFFECT_WEATHER_BALL
&& gBattleMoves[move].effect != EFFECT_JUDGMENT && gBattleMoves[move].effect != EFFECT_CHANGE_TYPE_ON_ITEM
&& gBattleMoves[move].effect != EFFECT_NATURAL_GIFT && gBattleMoves[move].effect != EFFECT_NATURAL_GIFT
&& ((attackerAbility == ABILITY_PIXILATE && (ateType = TYPE_FAIRY)) && ((attackerAbility == ABILITY_PIXILATE && (ateType = TYPE_FAIRY))
|| (attackerAbility == ABILITY_REFRIGERATE && (ateType = TYPE_ICE)) || (attackerAbility == ABILITY_REFRIGERATE && (ateType = TYPE_ICE))

View File

@ -7006,7 +7006,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_JUDGMENT] = [MOVE_JUDGMENT] =
{ {
.effect = EFFECT_JUDGMENT, .effect = EFFECT_CHANGE_TYPE_ON_ITEM,
.power = 100, .power = 100,
.type = TYPE_NORMAL, .type = TYPE_NORMAL,
.accuracy = 100, .accuracy = 100,
@ -7016,6 +7016,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.argument = HOLD_EFFECT_PLATE,
}, },
[MOVE_BUG_BITE] = [MOVE_BUG_BITE] =
@ -8456,7 +8457,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
#else #else
.power = 85, .power = 85,
#endif #endif
.effect = EFFECT_TECHNO_BLAST, .effect = EFFECT_CHANGE_TYPE_ON_ITEM,
.type = TYPE_NORMAL, .type = TYPE_NORMAL,
.accuracy = 100, .accuracy = 100,
.pp = 5, .pp = 5,
@ -8465,6 +8466,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.priority = 0, .priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED,
.split = SPLIT_SPECIAL, .split = SPLIT_SPECIAL,
.argument = HOLD_EFFECT_DRIVE
}, },
[MOVE_RELIC_SONG] = [MOVE_RELIC_SONG] =
@ -10263,7 +10265,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
#else #else
.power = 90, .power = 90,
#endif #endif
.effect = EFFECT_PLACEHOLDER, .effect = EFFECT_CHANGE_TYPE_ON_ITEM,
.type = TYPE_NORMAL, .type = TYPE_NORMAL,
.accuracy = 100, .accuracy = 100,
.pp = 10, .pp = 10,
@ -10272,6 +10274,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.priority = 0, .priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
.argument = HOLD_EFFECT_MEMORY,
}, },
[MOVE_MIND_BLOWN] = [MOVE_MIND_BLOWN] =