Gulp missile not triggering on faint fix and added form change type (#4502)
* Cramorant faint fix and add form change type * Fixed formatting, renamed form change type, changed various to callnative * Fix oops broke everything except gulp missile * Improved condition order * remove extra line * whitespace and alignment Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com> * whitespace and alignment Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com> * whitespace and alignment Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com> * whitespace and alignment Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com> * whitespace and alignment Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com> * whitespace and alignment Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com> * Added requested changes --------- Co-authored-by: BlueAnthem37510 <a@a.com> Co-authored-by: Eduardo Quezada <eduardo602002@gmail.com>
This commit is contained in:
parent
eca47fe209
commit
2d7c79e860
7 changed files with 66 additions and 28 deletions
|
@ -1635,7 +1635,11 @@
|
||||||
.macro trygulpmissile
|
.macro trygulpmissile
|
||||||
callnative BS_TryGulpMissile
|
callnative BS_TryGulpMissile
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
.macro tryactivategulpmissile
|
||||||
|
callnative BS_TryActivateGulpMissile
|
||||||
|
.endm
|
||||||
|
|
||||||
.macro tryquash failInstr:req
|
.macro tryquash failInstr:req
|
||||||
callnative BS_TryQuash
|
callnative BS_TryQuash
|
||||||
.4byte \failInstr
|
.4byte \failInstr
|
||||||
|
|
|
@ -5458,6 +5458,7 @@ BattleScript_EffectCamouflage::
|
||||||
|
|
||||||
BattleScript_FaintAttacker::
|
BattleScript_FaintAttacker::
|
||||||
tryillusionoff BS_ATTACKER
|
tryillusionoff BS_ATTACKER
|
||||||
|
tryactivategulpmissile
|
||||||
playfaintcry BS_ATTACKER
|
playfaintcry BS_ATTACKER
|
||||||
pause B_WAIT_TIME_LONG
|
pause B_WAIT_TIME_LONG
|
||||||
dofaintanimation BS_ATTACKER
|
dofaintanimation BS_ATTACKER
|
||||||
|
@ -5470,6 +5471,7 @@ BattleScript_FaintAttacker::
|
||||||
|
|
||||||
BattleScript_FaintTarget::
|
BattleScript_FaintTarget::
|
||||||
tryillusionoff BS_TARGET
|
tryillusionoff BS_TARGET
|
||||||
|
tryactivategulpmissile
|
||||||
playfaintcry BS_TARGET
|
playfaintcry BS_TARGET
|
||||||
pause B_WAIT_TIME_LONG
|
pause B_WAIT_TIME_LONG
|
||||||
dofaintanimation BS_TARGET
|
dofaintanimation BS_TARGET
|
||||||
|
|
|
@ -120,4 +120,7 @@
|
||||||
// param1: status
|
// param1: status
|
||||||
#define FORM_CHANGE_STATUS 20
|
#define FORM_CHANGE_STATUS 20
|
||||||
|
|
||||||
|
// Form change that activates after move is used. Currently only used for activating Gulp Missile.
|
||||||
|
#define FORM_CHANGE_HIT_BY_MOVE 21
|
||||||
|
|
||||||
#endif // GUARD_CONSTANTS_FORM_CHANGE_TYPES_H
|
#endif // GUARD_CONSTANTS_FORM_CHANGE_TYPES_H
|
||||||
|
|
|
@ -16880,6 +16880,39 @@ void BS_TryGulpMissile(void)
|
||||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BS_TryActivateGulpMissile(void)
|
||||||
|
{
|
||||||
|
NATIVE_ARGS();
|
||||||
|
|
||||||
|
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||||
|
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||||
|
&& TARGET_TURN_DAMAGED
|
||||||
|
&& gBattleMons[gBattlerTarget].species != SPECIES_CRAMORANT
|
||||||
|
&& GetBattlerAbility(gBattlerTarget) == ABILITY_GULP_MISSILE)
|
||||||
|
{
|
||||||
|
if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
|
||||||
|
{
|
||||||
|
gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4;
|
||||||
|
if (gBattleMoveDamage == 0)
|
||||||
|
gBattleMoveDamage = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(gBattleMons[gBattlerTarget].species)
|
||||||
|
{
|
||||||
|
case SPECIES_CRAMORANT_GORGING:
|
||||||
|
BattleScriptPushCursor();
|
||||||
|
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_HIT_BY_MOVE);
|
||||||
|
gBattlescriptCurrInstr = BattleScript_GulpMissileGorging;
|
||||||
|
return;
|
||||||
|
case SPECIES_CRAMORANT_GULPING:
|
||||||
|
BattleScriptPushCursor();
|
||||||
|
TryBattleFormChange(gBattlerTarget, FORM_CHANGE_HIT_BY_MOVE);
|
||||||
|
gBattlescriptCurrInstr = BattleScript_GulpMissileGulping;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
|
}
|
||||||
|
|
||||||
void BS_TryQuash(void)
|
void BS_TryQuash(void)
|
||||||
{
|
{
|
||||||
|
|
|
@ -5583,34 +5583,30 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32
|
||||||
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||||
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||||
&& TARGET_TURN_DAMAGED
|
&& TARGET_TURN_DAMAGED
|
||||||
&& IsBattlerAlive(battler))
|
&& IsBattlerAlive(battler)
|
||||||
|
&& gBattleMons[gBattlerTarget].species != SPECIES_CRAMORANT)
|
||||||
{
|
{
|
||||||
// TODO: Convert this to a proper FORM_CHANGE type.
|
if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
|
||||||
if (gBattleMons[gBattlerTarget].species == SPECIES_CRAMORANT_GORGING)
|
|
||||||
{
|
{
|
||||||
gBattleMons[gBattlerTarget].species = SPECIES_CRAMORANT;
|
gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4;
|
||||||
if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
|
if (gBattleMoveDamage == 0)
|
||||||
{
|
gBattleMoveDamage = 1;
|
||||||
gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4;
|
|
||||||
if (gBattleMoveDamage == 0)
|
|
||||||
gBattleMoveDamage = 1;
|
|
||||||
}
|
|
||||||
BattleScriptPushCursor();
|
|
||||||
gBattlescriptCurrInstr = BattleScript_GulpMissileGorging;
|
|
||||||
effect++;
|
|
||||||
}
|
}
|
||||||
else if (gBattleMons[gBattlerTarget].species == SPECIES_CRAMORANT_GULPING)
|
|
||||||
|
switch(gBattleMons[gBattlerTarget].species)
|
||||||
{
|
{
|
||||||
gBattleMons[gBattlerTarget].species = SPECIES_CRAMORANT;
|
case SPECIES_CRAMORANT_GORGING:
|
||||||
if (GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD)
|
TryBattleFormChange(battler, FORM_CHANGE_HIT_BY_MOVE);
|
||||||
{
|
BattleScriptPushCursor();
|
||||||
gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 4;
|
gBattlescriptCurrInstr = BattleScript_GulpMissileGorging;
|
||||||
if (gBattleMoveDamage == 0)
|
effect++;
|
||||||
gBattleMoveDamage = 1;
|
break;
|
||||||
}
|
case SPECIES_CRAMORANT_GULPING:
|
||||||
BattleScriptPushCursor();
|
TryBattleFormChange(battler, FORM_CHANGE_HIT_BY_MOVE);
|
||||||
gBattlescriptCurrInstr = BattleScript_GulpMissileGulping;
|
BattleScriptPushCursor();
|
||||||
effect++;
|
gBattlescriptCurrInstr = BattleScript_GulpMissileGulping;
|
||||||
|
effect++;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -10480,6 +10476,7 @@ u16 GetBattleFormChangeTargetSpecies(u32 battler, u16 method)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FORM_CHANGE_BATTLE_TURN_END:
|
case FORM_CHANGE_BATTLE_TURN_END:
|
||||||
|
case FORM_CHANGE_HIT_BY_MOVE:
|
||||||
if (formChanges[i].param1 == GetBattlerAbility(battler))
|
if (formChanges[i].param1 == GetBattlerAbility(battler))
|
||||||
targetSpecies = formChanges[i].targetSpecies;
|
targetSpecies = formChanges[i].targetSpecies;
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1098,6 +1098,7 @@ static const struct FormChange sSandacondaFormChangeTable[] =
|
||||||
static const struct FormChange sCramorantFormChangeTable[] = {
|
static const struct FormChange sCramorantFormChangeTable[] = {
|
||||||
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_CRAMORANT_GULPING, ABILITY_GULP_MISSILE, HP_HIGHER_THAN, 50},
|
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_CRAMORANT_GULPING, ABILITY_GULP_MISSILE, HP_HIGHER_THAN, 50},
|
||||||
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_CRAMORANT_GORGING, ABILITY_GULP_MISSILE, HP_LOWER_EQ_THAN, 50},
|
{FORM_CHANGE_BATTLE_HP_PERCENT, SPECIES_CRAMORANT_GORGING, ABILITY_GULP_MISSILE, HP_LOWER_EQ_THAN, 50},
|
||||||
|
{FORM_CHANGE_HIT_BY_MOVE, SPECIES_CRAMORANT, ABILITY_GULP_MISSILE},
|
||||||
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_CRAMORANT},
|
{FORM_CHANGE_BATTLE_SWITCH, SPECIES_CRAMORANT},
|
||||||
{FORM_CHANGE_FAINT, SPECIES_CRAMORANT},
|
{FORM_CHANGE_FAINT, SPECIES_CRAMORANT},
|
||||||
{FORM_CHANGE_END_BATTLE, SPECIES_CRAMORANT},
|
{FORM_CHANGE_END_BATTLE, SPECIES_CRAMORANT},
|
||||||
|
|
|
@ -116,9 +116,7 @@ SINGLE_BATTLE_TEST("(Gulp Missile) Cramorant in Gorging paralyzes the target if
|
||||||
}
|
}
|
||||||
|
|
||||||
SINGLE_BATTLE_TEST("(Gulp Missile) triggers even if the user is fainted by opposing mon")
|
SINGLE_BATTLE_TEST("(Gulp Missile) triggers even if the user is fainted by opposing mon")
|
||||||
{
|
{
|
||||||
// See: https://github.com/rh-hideout/pokeemerald-expansion/issues/4143
|
|
||||||
KNOWN_FAILING;
|
|
||||||
GIVEN {
|
GIVEN {
|
||||||
PLAYER(SPECIES_CRAMORANT) { HP(1); MaxHP(250); Ability(ABILITY_GULP_MISSILE); }
|
PLAYER(SPECIES_CRAMORANT) { HP(1); MaxHP(250); Ability(ABILITY_GULP_MISSILE); }
|
||||||
PLAYER(SPECIES_WOBBUFFET);
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
|
Loading…
Reference in a new issue