Tweaked VARIOUS_PHOTON_GEYSER_CHECK and VARIOUS_SHELL_SIDE_ARM_CHECK
This commit is contained in:
parent
af6e72ecfe
commit
13029cd3b3
1 changed files with 28 additions and 28 deletions
|
@ -8996,50 +8996,50 @@ static void Cmd_various(void)
|
||||||
return;
|
return;
|
||||||
case VARIOUS_PHOTON_GEYSER_CHECK:
|
case VARIOUS_PHOTON_GEYSER_CHECK:
|
||||||
{
|
{
|
||||||
u32 attStat = gBattleMons[gActiveBattler].attack;
|
u32 attackerAtkStat = gBattleMons[gBattlerAttacker].attack;
|
||||||
u8 atkStage = gBattleMons[gActiveBattler].statStages[STAT_ATK];
|
u8 attackerAtkStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK];
|
||||||
u32 spaStat = gBattleMons[gActiveBattler].spAttack;
|
u32 attackerSpAtkStat = gBattleMons[gBattlerAttacker].spAttack;
|
||||||
|
|
||||||
attStat *= gStatStageRatios[atkStage][0];
|
attackerAtkStat *= gStatStageRatios[attackerAtkStage][0];
|
||||||
attStat /= gStatStageRatios[atkStage][1];
|
attackerAtkStat /= gStatStageRatios[attackerAtkStage][1];
|
||||||
|
|
||||||
atkStage = gBattleMons[gActiveBattler].statStages[STAT_SPATK];
|
attackerAtkStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK];
|
||||||
spaStat *= gStatStageRatios[atkStage][0];
|
attackerSpAtkStat *= gStatStageRatios[attackerAtkStage][0];
|
||||||
spaStat /= gStatStageRatios[atkStage][1];
|
attackerSpAtkStat /= gStatStageRatios[attackerAtkStage][1];
|
||||||
|
|
||||||
if (attStat > spaStat)
|
if (attackerAtkStat > attackerSpAtkStat)
|
||||||
gSwapDamageCategory = TRUE;
|
gSwapDamageCategory = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VARIOUS_SHELL_SIDE_ARM_CHECK: // 0% chance GameFreak actually checks this way according to DaWobblefet, but this is the only functional explanation at the moment
|
case VARIOUS_SHELL_SIDE_ARM_CHECK: // 0% chance GameFreak actually checks this way according to DaWobblefet, but this is the only functional explanation at the moment
|
||||||
{
|
{
|
||||||
u32 attStat = gBattleMons[gBattlerAttacker].attack;
|
u32 attackerAtkStat = gBattleMons[gBattlerAttacker].attack;
|
||||||
u8 atkStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK];
|
u32 targetDefStat = gBattleMons[gBattlerTarget].defense;
|
||||||
u32 attStatDef = gBattleMons[gBattlerTarget].attack;
|
u32 attackerSpAtkStat = gBattleMons[gBattlerAttacker].spAttack;
|
||||||
|
u32 targetSpDefStat = gBattleMons[gBattlerTarget].spDefense;
|
||||||
|
u8 statStage;
|
||||||
u32 physical;
|
u32 physical;
|
||||||
|
|
||||||
u32 spaStat = gBattleMons[gBattlerAttacker].spAttack;
|
|
||||||
u32 spaStatDef = gBattleMons[gBattlerTarget].spAttack;
|
|
||||||
u32 special;
|
u32 special;
|
||||||
|
|
||||||
attStat *= gStatStageRatios[atkStage][0];
|
statStage = = gBattleMons[gBattlerAttacker].statStages[STAT_ATK];
|
||||||
attStat /= gStatStageRatios[atkStage][1];
|
attackerAtkStat *= gStatStageRatios[statStage][0];
|
||||||
|
attackerAtkStat /= gStatStageRatios[statStage][1];
|
||||||
|
|
||||||
atkStage = gBattleMons[gBattlerTarget].statStages[STAT_ATK];
|
statStage = gBattleMons[gBattlerTarget].statStages[STAT_ATK];
|
||||||
attStatDef *= gStatStageRatios[atkStage][0];
|
targetDefStat *= gStatStageRatios[statStage][0];
|
||||||
attStatDef /= gStatStageRatios[atkStage][1];
|
targetDefStat /= gStatStageRatios[statStage][1];
|
||||||
|
|
||||||
physical = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gBattleMoves[gCurrentMove].power * attStat) / attStatDef) / 50);
|
physical = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gBattleMoves[gCurrentMove].power * attackerAtkStat) / targetDefStat) / 50);
|
||||||
|
|
||||||
atkStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK];
|
statStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK];
|
||||||
spaStat *= gStatStageRatios[atkStage][0];
|
attackerSpAtkStat *= gStatStageRatios[statStage][0];
|
||||||
spaStat /= gStatStageRatios[atkStage][1];
|
attackerSpAtkStat /= gStatStageRatios[statStage][1];
|
||||||
|
|
||||||
atkStage = gBattleMons[gBattlerTarget].statStages[STAT_SPATK];
|
statStage = gBattleMons[gBattlerTarget].statStages[STAT_SPATK];
|
||||||
spaStatDef *= gStatStageRatios[atkStage][0];
|
targetSpDefStat *= gStatStageRatios[statStage][0];
|
||||||
spaStatDef /= gStatStageRatios[atkStage][1];
|
targetSpDefStat /= gStatStageRatios[statStage][1];
|
||||||
|
|
||||||
special = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gBattleMoves[gCurrentMove].power * spaStat) / spaStatDef) / 50);
|
special = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gBattleMoves[gCurrentMove].power * attackerSpAtkStat) / targetSpDefStat) / 50);
|
||||||
|
|
||||||
if (((physical > special) || (physical == special && (Random() % 2) == 0)))
|
if (((physical > special) || (physical == special && (Random() % 2) == 0)))
|
||||||
gSwapDamageCategory = TRUE;
|
gSwapDamageCategory = TRUE;
|
||||||
|
|
Loading…
Reference in a new issue