Support for two typed moves.
This commit is contained in:
parent
5fbeef860c
commit
de85f88bbb
4 changed files with 43 additions and 30 deletions
|
@ -289,6 +289,7 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
|
|||
.4byte BattleScript_EffectAttackAccUp
|
||||
.4byte BattleScript_EffectAttackSpAttackUp
|
||||
.4byte BattleScript_EffectHurricane
|
||||
.4byte BattleScript_EffectTwoTypedMove
|
||||
|
||||
BattleScript_EffectAttackSpAttackUp:
|
||||
attackcanceler
|
||||
|
@ -847,6 +848,7 @@ BattleScript_EffectPsyshock:
|
|||
BattleScript_EffectWeatherBall:
|
||||
BattleScript_EffectHiddenPower:
|
||||
BattleScript_EffectFreezeDry:
|
||||
BattleScript_EffectTwoTypedMove:
|
||||
jumpifnotmove MOVE_SURF, BattleScript_HitFromAtkCanceler
|
||||
jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_HitFromAtkCanceler
|
||||
orword gHitMarker, HITMARKER_IGNORE_UNDERWATER
|
||||
|
|
|
@ -278,5 +278,6 @@
|
|||
#define EFFECT_ATTACK_ACCURACY_UP 272
|
||||
#define EFFECT_ATTACK_SPATK_UP 273
|
||||
#define EFFECT_HURRICANE 274
|
||||
#define EFFECT_TWO_TYPED_MOVE 275
|
||||
|
||||
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
||||
|
|
|
@ -6724,7 +6724,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] =
|
|||
.split = SPLIT_PHYSICAL,
|
||||
},
|
||||
{ // MOVE_FLYING_PRESS
|
||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
||||
.effect = EFFECT_TWO_TYPED_MOVE,
|
||||
.power = 100,
|
||||
.type = TYPE_FIGHTING,
|
||||
.accuracy = 95,
|
||||
|
@ -6734,6 +6734,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_GEN6] =
|
|||
.priority = 0,
|
||||
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_MINIMIZE,
|
||||
.split = SPLIT_PHYSICAL,
|
||||
.argument = TYPE_FLYING,
|
||||
},
|
||||
{ // MOVE_MAT_BLOCK
|
||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
||||
|
|
|
@ -5447,12 +5447,8 @@ static void UpdateMoveResultFlags(u16 modifier)
|
|||
}
|
||||
}
|
||||
|
||||
u16 CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 battlerDef, bool32 recordAbilities)
|
||||
static u16 CalcTypeEffectivenessMultiplierInternal(u16 move, u8 moveType, u8 battlerAtk, u8 battlerDef, bool32 recordAbilities, u16 modifier)
|
||||
{
|
||||
u16 modifier = UQ_4_12(1.0);
|
||||
|
||||
if (move != MOVE_STRUGGLE && moveType != TYPE_MYSTERY)
|
||||
{
|
||||
u32 atkAbility = GetBattlerAbility(battlerAtk);
|
||||
MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, gBattleMons[battlerDef].type1, atkAbility);
|
||||
if (gBattleMons[battlerDef].type2 != gBattleMons[battlerDef].type1)
|
||||
|
@ -5482,6 +5478,19 @@ u16 CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 bat
|
|||
RecordAbilityBattle(battlerDef, ABILITY_WONDER_GUARD);
|
||||
}
|
||||
}
|
||||
|
||||
return modifier;
|
||||
}
|
||||
|
||||
u16 CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 battlerDef, bool32 recordAbilities)
|
||||
{
|
||||
u16 modifier = UQ_4_12(1.0);
|
||||
|
||||
if (move != MOVE_STRUGGLE && moveType != TYPE_MYSTERY)
|
||||
{
|
||||
modifier = CalcTypeEffectivenessMultiplierInternal(move, moveType, battlerAtk, battlerDef, recordAbilities, modifier);
|
||||
if (gBattleMoves[move].effect == EFFECT_TWO_TYPED_MOVE)
|
||||
modifier = CalcTypeEffectivenessMultiplierInternal(move, gBattleMoves[move].argument, battlerAtk, battlerDef, recordAbilities, modifier);
|
||||
}
|
||||
|
||||
UpdateMoveResultFlags(modifier);
|
||||
|
|
Loading…
Reference in a new issue