mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-02-05 10:52:35 +01:00
Merge branch 'SonikkuA-DatH-Quashh' of https://github.com/SonikkuA-DatH/pokeemerald-expansion into quash
This commit is contained in:
commit
06b4548603
@ -149,6 +149,7 @@ struct ProtectStruct
|
|||||||
u16 beakBlastCharge:1;
|
u16 beakBlastCharge:1;
|
||||||
u32 physicalDmg;
|
u32 physicalDmg;
|
||||||
u32 specialDmg;
|
u32 specialDmg;
|
||||||
|
u8 quash : 1;
|
||||||
u8 physicalBattlerId;
|
u8 physicalBattlerId;
|
||||||
u8 specialBattlerId;
|
u8 specialBattlerId;
|
||||||
};
|
};
|
||||||
|
@ -4515,6 +4515,10 @@ s8 GetMovePriority(u32 battlerId, u16 move)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (gProtectStructs[battlerId].quash == 1)
|
||||||
|
{
|
||||||
|
priority = -8;
|
||||||
|
}
|
||||||
|
|
||||||
return priority;
|
return priority;
|
||||||
}
|
}
|
||||||
@ -4736,6 +4740,7 @@ static void TurnValuesCleanUp(bool8 var0)
|
|||||||
gProtectStructs[gActiveBattler].spikyShielded = FALSE;
|
gProtectStructs[gActiveBattler].spikyShielded = FALSE;
|
||||||
gProtectStructs[gActiveBattler].kingsShielded = FALSE;
|
gProtectStructs[gActiveBattler].kingsShielded = FALSE;
|
||||||
gProtectStructs[gActiveBattler].banefulBunkered = FALSE;
|
gProtectStructs[gActiveBattler].banefulBunkered = FALSE;
|
||||||
|
gProtectStructs[gBattlerTarget].quash = FALSE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -625,7 +625,7 @@ static const u8 sText_PkmnBlewAwayToxicSpikes[] = _("{B_ATK_NAME_WITH_PREFIX} bl
|
|||||||
static const u8 sText_PkmnBlewAwayStickyWeb[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nSticky Web!");
|
static const u8 sText_PkmnBlewAwayStickyWeb[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nSticky Web!");
|
||||||
static const u8 sText_PkmnBlewAwayStealthRock[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nStealth Rock!");
|
static const u8 sText_PkmnBlewAwayStealthRock[] = _("{B_ATK_NAME_WITH_PREFIX} blew away\nStealth Rock!");
|
||||||
static const u8 sText_StickyWebUsed[] = _("A sticky web spreads out on the\nground around {B_DEF_TEAM2} team!");
|
static const u8 sText_StickyWebUsed[] = _("A sticky web spreads out on the\nground around {B_DEF_TEAM2} team!");
|
||||||
static const u8 sText_QuashSuccess[] = _("The opposing {B_ATK_NAME_WITH_PREFIX}'s move was postponed!");
|
static const u8 sText_QuashSuccess[] = _("The opposing {B_DEF_NAME_WITH_PREFIX}'s\nmove was postponed!");
|
||||||
static const u8 sText_IonDelugeOn[] = _("A deluge of ions showers\nthe battlefield!");
|
static const u8 sText_IonDelugeOn[] = _("A deluge of ions showers\nthe battlefield!");
|
||||||
static const u8 sText_TopsyTurvySwitchedStats[] = _("{B_DEF_NAME_WITH_PREFIX}'s stat changes were\nall reversed!");
|
static const u8 sText_TopsyTurvySwitchedStats[] = _("{B_DEF_NAME_WITH_PREFIX}'s stat changes were\nall reversed!");
|
||||||
static const u8 sText_TerrainBecomesMisty[] = _("Mist swirled about\nthe battlefield!");
|
static const u8 sText_TerrainBecomesMisty[] = _("Mist swirled about\nthe battlefield!");
|
||||||
|
@ -8454,28 +8454,14 @@ static void Cmd_various(void)
|
|||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case VARIOUS_TRY_QUASH:
|
case VARIOUS_TRY_QUASH:
|
||||||
if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget))
|
if (GetBattlerTurnOrderNum(gBattlerAttacker) > GetBattlerTurnOrderNum(gBattlerTarget)) // is true if foe is faster, has a bigger priority, or switches
|
||||||
{
|
{
|
||||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
|
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); // This replaces the current battlescript with the "fail" script, if the condition
|
||||||
}
|
} // we checked is true
|
||||||
else
|
else // If the condition is not true, it means we are faster than the foe, so we can set the quash bit
|
||||||
{
|
{
|
||||||
for (i = 0; i < gBattlersCount; i++)
|
gProtectStructs[gBattlerTarget].quash = 1;
|
||||||
data[i] = gBattlerByTurnOrder[i];
|
gBattlescriptCurrInstr += 7; // and then we proceed with the rest of our battlescript
|
||||||
for (i = 0; i < gBattlersCount; i++)
|
|
||||||
{
|
|
||||||
if (data[i] == gBattlerTarget)
|
|
||||||
{
|
|
||||||
for (j = i + 1; j < gBattlersCount; j++)
|
|
||||||
data[i++] = data[j];
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
gBattlerByTurnOrder[i] = data[i];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
gBattlerByTurnOrder[gBattlersCount - 1] = gBattlerTarget;
|
|
||||||
gBattlescriptCurrInstr += 7;
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
case VARIOUS_INVERT_STAT_STAGES:
|
case VARIOUS_INVERT_STAT_STAGES:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user