Problem: Photon Geyser is calculating as Shell Side Arm?? Needs: Poison effect, contact move for Shell Side Arm

This commit is contained in:
MissingNoL 2021-05-27 22:21:55 -07:00
parent 265824531e
commit f30a9542ee
9 changed files with 85 additions and 8 deletions

View File

@ -1726,6 +1726,14 @@
.4byte \ptr
.endm
.macro photongeysercheck
various BS_ATTACKER, VARIOUS_PHOTON_GEYSER_CHECK
.endm
.macro shellsidearmcheck
various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK
.endm
.macro trysetfairylock ptr:req
various BS_ATTACKER, VARIOUS_TRY_FAIRY_LOCK
.4byte \ptr

View File

@ -367,6 +367,14 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
.4byte BattleScript_EffectFairyLock
.4byte BattleScript_EffectAllySwitch
.4byte BattleScript_EffectSleepHit
.4byte BattleScript_EffectPhotonGeyser
.4byte BattleScript_EffectShellSideArm
BattleScript_EffectShellSideArm:
shellsidearmcheck
BattleScript_EffectPhotonGeyser:
photongeysercheck
BattleScript_EffectSleepHit:
setmoveeffect MOVE_EFFECT_SLEEP

View File

@ -858,4 +858,6 @@ extern u8 gBattleControllerData[MAX_BATTLERS_COUNT];
extern bool8 gHasFetchedBall;
extern u8 gLastUsedBall;
extern bool8 gSwapDamageCategory; // Photon Geyser, Shell Side Arm, Light That Burns the Sky
#endif // GUARD_BATTLE_H

View File

@ -351,7 +351,9 @@
#define EFFECT_FAIRY_LOCK 345
#define EFFECT_ALLY_SWITCH 346
#define EFFECT_SLEEP_HIT 347 // Relic Song
#define EFFECT_PHOTON_GEYSER 348
#define EFFECT_SHELL_SIDE_ARM 349
#define NUM_BATTLE_MOVE_EFFECTS 348
#define NUM_BATTLE_MOVE_EFFECTS 350
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H

View File

@ -173,6 +173,8 @@
#define VARIOUS_DESTROY_ABILITY_POPUP 102
#define VARIOUS_TOTEM_BOOST 103
#define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 104
#define VARIOUS_PHOTON_GEYSER_CHECK 105
#define VARIOUS_SHELL_SIDE_ARM_CHECK 106
// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0

View File

@ -229,6 +229,7 @@ EWRAM_DATA u16 gPartnerSpriteId = 0;
EWRAM_DATA struct TotemBoost gTotemBoosts[MAX_BATTLERS_COUNT] = {0};
EWRAM_DATA bool8 gHasFetchedBall = FALSE;
EWRAM_DATA u8 gLastUsedBall = 0;
EWRAM_DATA bool8 gSwapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky
// IWRAM common vars
void (*gPreBattleCallback1)(void);
@ -2928,6 +2929,8 @@ static void BattleStartClearSetData(void)
gBattleStruct->arenaLostOpponentMons = 0;
gBattleStruct->mega.triggerSpriteId = 0xFF;
gSwapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky
}
void SwitchInClearSetData(void)

View File

@ -7126,6 +7126,55 @@ static void Cmd_various(void)
switch (gBattlescriptCurrInstr[2])
{
case VARIOUS_PHOTON_GEYSER_CHECK:
{
u32 attStat = gBattleMons[gActiveBattler].attack;
u8 atkStage = gBattleMons[gActiveBattler].statStages[STAT_ATK];
u32 spaStat = gBattleMons[gActiveBattler].spAttack;
attStat *= gStatStageRatios[atkStage][0];
attStat /= gStatStageRatios[atkStage][1];
atkStage = gBattleMons[gActiveBattler].statStages[STAT_SPATK];
spaStat *= gStatStageRatios[atkStage][0];
spaStat /= gStatStageRatios[atkStage][1];
if (attStat > spaStat)
gSwapDamageCategory = TRUE;
}
case VARIOUS_SHELL_SIDE_ARM_CHECK: // according to DaWoblefet, 0% chance GameFreak actually checks this way, but this is the only functional explanation at the moment
{
u32 attStat = gBattleMons[gBattlerAttacker].attack;
u8 atkStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK];
u32 attStatDef = gBattleMons[gBattlerTarget].attack;
u32 physical;
u32 spaStat = gBattleMons[gBattlerAttacker].spAttack;
u32 spaStatDef = gBattleMons[gBattlerTarget].spAttack;
u32 special;
attStat *= gStatStageRatios[atkStage][0];
attStat /= gStatStageRatios[atkStage][1];
atkStage = gBattleMons[gBattlerTarget].statStages[STAT_ATK];
attStatDef *= gStatStageRatios[atkStage][0];
attStatDef /= gStatStageRatios[atkStage][1];
physical = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * 90 * attStat) / attStatDef) / 50);
atkStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK];
spaStat *= gStatStageRatios[atkStage][0];
spaStat /= gStatStageRatios[atkStage][1];
atkStage = gBattleMons[gBattlerTarget].statStages[STAT_SPATK];
spaStatDef *= gStatStageRatios[atkStage][0];
spaStatDef /= gStatStageRatios[atkStage][1];
special = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * 90 * spaStat) / spaStatDef) / 50);
if (((physical > special) || (physical == special && (Random() % 2) == 0)))
gSwapDamageCategory = TRUE;
}
// Roar will fail in a double wild battle when used by the player against one of the two alive wild mons.
// Also when an opposing wild mon uses it againt its partner.
case VARIOUS_JUMP_IF_ROAR_FAILS:

View File

@ -8367,8 +8367,11 @@ bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId)
u8 GetBattleMoveSplit(u32 moveId)
{
if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4)
if (gSwapDamageCategory == TRUE) // Photon Geyser, Shell Side Arm, Light That Burns the Sky
return SPLIT_PHYSICAL;
else
return gBattleMoves[moveId].split;
else if (gBattleMoves[moveId].type < TYPE_MYSTERY)
else if (gBattleMoves[moveId].type < TYPE_MYSTERY || gSwapDamageCategory == TRUE) // Photon Geyser, Shell Side Arm, Light That Burns the Sky
return SPLIT_PHYSICAL;
else
return SPLIT_SPECIAL;

View File

@ -10343,15 +10343,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_PHOTON_GEYSER] =
{
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
.effect = EFFECT_PHOTON_GEYSER,
.power = 100,
.type = TYPE_PSYCHIC,
.accuracy = 100,
.pp = 5,
.secondaryEffectChance = 0,
.secondaryEffectChance = 100,
.target = MOVE_TARGET_FOES_AND_ALLY,
.priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TARGET_ABILITY_IGNORED,
.split = SPLIT_SPECIAL,
},
@ -11178,12 +11178,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
[MOVE_SHELL_SIDE_ARM] =
{
.effect = EFFECT_PLACEHOLDER, //TODO
.effect = EFFECT_SHELL_SIDE_ARM,
.power = 90,
.type = TYPE_POISON,
.accuracy = 100,
.pp = 10,
.secondaryEffectChance = 0,
.secondaryEffectChance = 100,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED,