Fix Phantom Force

This commit is contained in:
DizzyEggg 2018-12-08 16:19:50 +01:00
parent d52fe8ac58
commit b60915539d
9 changed files with 43 additions and 35 deletions

View File

@ -1893,7 +1893,15 @@ Move_FELL_STINGER:
end end
Move_PHANTOM_FORCE: Move_PHANTOM_FORCE:
choosetwoturnanim PhantomForceSetUp, PhantomForceUnleash
PhantomForceEnd:
end end
PhantomForceSetUp:
invisible ANIM_ATTACKER
goto PhantomForceEnd
PhantomForceUnleash:
visible ANIM_ATTACKER
goto PhantomForceEnd
Move_TRICK_OR_TREAT: Move_TRICK_OR_TREAT:
end end

View File

@ -3495,17 +3495,19 @@ BattleScript_EffectSemiInvulnerable::
jumpifmove MOVE_FLY, BattleScript_FirstTurnFly jumpifmove MOVE_FLY, BattleScript_FirstTurnFly
jumpifmove MOVE_DIVE, BattleScript_FirstTurnDive jumpifmove MOVE_DIVE, BattleScript_FirstTurnDive
jumpifmove MOVE_BOUNCE, BattleScript_FirstTurnBounce jumpifmove MOVE_BOUNCE, BattleScript_FirstTurnBounce
jumpifmove MOVE_PHANTOM_FORCE, BattleScript_FirstTurnPhantomForce
jumpifmove MOVE_SHADOW_FORCE, BattleScript_FirstTurnPhantomForce
setbyte sTWOTURN_STRINGID, 0x5 setbyte sTWOTURN_STRINGID, 0x5
goto BattleScript_FirstTurnSemiInvulnerable goto BattleScript_FirstTurnSemiInvulnerable
BattleScript_FirstTurnBounce:: BattleScript_FirstTurnBounce::
setbyte sTWOTURN_STRINGID, 0x7 setbyte sTWOTURN_STRINGID, 0x7
goto BattleScript_FirstTurnSemiInvulnerable goto BattleScript_FirstTurnSemiInvulnerable
BattleScript_FirstTurnDive:: BattleScript_FirstTurnDive::
setbyte sTWOTURN_STRINGID, 0x6 setbyte sTWOTURN_STRINGID, 0x6
goto BattleScript_FirstTurnSemiInvulnerable goto BattleScript_FirstTurnSemiInvulnerable
BattleScript_FirstTurnPhantomForce:
setbyte sTWOTURN_STRINGID, 0x8
goto BattleScript_FirstTurnSemiInvulnerable
BattleScript_FirstTurnFly:: BattleScript_FirstTurnFly::
setbyte sTWOTURN_STRINGID, 0x4 setbyte sTWOTURN_STRINGID, 0x4
BattleScript_FirstTurnSemiInvulnerable:: BattleScript_FirstTurnSemiInvulnerable::
@ -3519,8 +3521,7 @@ BattleScript_SecondTurnSemiInvulnerable::
setbyte sB_ANIM_TURN, 0x1 setbyte sB_ANIM_TURN, 0x1
clearstatusfromeffect BS_ATTACKER clearstatusfromeffect BS_ATTACKER
orword gHitMarker, HITMARKER_NO_PPDEDUCT orword gHitMarker, HITMARKER_NO_PPDEDUCT
jumpifnotmove MOVE_BOUNCE, BattleScript_SemiInvulnerableTryHit argumenttomoveeffect
setmoveeffect MOVE_EFFECT_PARALYSIS
BattleScript_SemiInvulnerableTryHit:: BattleScript_SemiInvulnerableTryHit::
accuracycheck BattleScript_SemiInvulnerableMiss, ACC_CURR_MOVE accuracycheck BattleScript_SemiInvulnerableMiss, ACC_CURR_MOVE
clearsemiinvulnerablebit clearsemiinvulnerablebit

View File

@ -129,6 +129,7 @@ struct UnknownFlags
#define RESOURCE_FLAG_FLASH_FIRE 0x1 #define RESOURCE_FLAG_FLASH_FIRE 0x1
#define RESOURCE_FLAG_ROOST 0x2 #define RESOURCE_FLAG_ROOST 0x2
#define RESOURCE_FLAG_UNBURDEN 0x4
struct DisableStruct struct DisableStruct
{ {

View File

@ -154,7 +154,7 @@
#define STATUS3_SMACKED_DOWN 0x200000 #define STATUS3_SMACKED_DOWN 0x200000
#define STATUS3_ME_FIRST 0x400000 #define STATUS3_ME_FIRST 0x400000
#define STATUS3_TELEKINESIS 0x800000 #define STATUS3_TELEKINESIS 0x800000
#define STATUS3_UNBURDEN 0x1000000 #define STATUS3_PHANTOM_FORCE 0x1000000
#define STATUS3_MIRACLE_EYED 0x2000000 #define STATUS3_MIRACLE_EYED 0x2000000
#define STATUS3_MAGNET_RISE 0x4000000 #define STATUS3_MAGNET_RISE 0x4000000
#define STATUS3_HEAL_BLOCK 0x8000000 #define STATUS3_HEAL_BLOCK 0x8000000
@ -162,7 +162,7 @@
#define STATUS3_LASER_FOCUS 0x20000000 #define STATUS3_LASER_FOCUS 0x20000000
#define STATUS3_ELECTRIFIED 0x40000000 #define STATUS3_ELECTRIFIED 0x40000000
#define STATUS3_POWER_TRICK 0x80000000 #define STATUS3_POWER_TRICK 0x80000000
#define STATUS3_SEMI_INVULNERABLE (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER) #define STATUS3_SEMI_INVULNERABLE (STATUS3_UNDERGROUND | STATUS3_ON_AIR | STATUS3_UNDERWATER | STATUS3_PHANTOM_FORCE)
// Not really sure what a "hitmarker" is. // Not really sure what a "hitmarker" is.
#define HITMARKER_x10 0x00000010 #define HITMARKER_x10 0x00000010

View File

@ -182,7 +182,6 @@ static const u8 sText_ShowOpponentHP[] = _("Opponent Hp");
static const u8 sText_Types[] = _("Types"); static const u8 sText_Types[] = _("Types");
static const u8 sText_GastroAcid[] = _("Gastro Acid"); static const u8 sText_GastroAcid[] = _("Gastro Acid");
static const u8 sText_SmackDown[] = _("Smacked Down"); static const u8 sText_SmackDown[] = _("Smacked Down");
static const u8 sText_Unburden[] = _("Unburden");
static const u8 sText_MiracleEye[] = _("Miracle Eye"); static const u8 sText_MiracleEye[] = _("Miracle Eye");
static const u8 sText_AquaRing[] = _("Aqua Ring"); static const u8 sText_AquaRing[] = _("Aqua Ring");
static const u8 sText_AuroraVeil[] = _("Aurora Veil"); static const u8 sText_AuroraVeil[] = _("Aurora Veil");
@ -265,7 +264,7 @@ static const struct BitfieldInfo sStatus3Bitfield[] =
{/*Smacked Down*/ 1, 21}, {/*Smacked Down*/ 1, 21},
// Me First 1, 22, // Me First 1, 22,
// Telekinesis 1, 23, // Telekinesis 1, 23,
{/*Unburden*/ 1, 24}, // Phantom Force 1, 24},
{/*Miracle Eyed*/ 1, 25}, {/*Miracle Eyed*/ 1, 25},
// Magnet Rise 1, 26, // Magnet Rise 1, 26,
// Heal Block 1, 27, // Heal Block 1, 27,
@ -379,9 +378,8 @@ static const struct ListMenuItem sStatus3ListItems[] =
{sText_NoCrit, 6}, {sText_NoCrit, 6},
{sText_GastroAcid, 7}, {sText_GastroAcid, 7},
{sText_SmackDown, 8}, {sText_SmackDown, 8},
{sText_Unburden, 9}, {sText_MiracleEye, 9},
{sText_MiracleEye, 10}, {sText_AquaRing, 10},
{sText_AquaRing, 11},
}; };
static const struct ListMenuItem sSideStatusListItems[] = static const struct ListMenuItem sSideStatusListItems[] =

View File

@ -4714,7 +4714,7 @@ u32 GetBattlerTotalSpeedStat(u8 battlerId)
// various effects // various effects
if (gSideStatuses[GET_BATTLER_SIDE(battlerId)] & SIDE_STATUS_TAILWIND) if (gSideStatuses[GET_BATTLER_SIDE(battlerId)] & SIDE_STATUS_TAILWIND)
speed *= 2; speed *= 2;
if (gStatuses3[battlerId] & STATUS3_UNBURDEN) if (gBattleResources->flags->flags[battlerId] & RESOURCE_FLAG_UNBURDEN)
speed *= 2; speed *= 2;
// paralysis drop // paralysis drop

View File

@ -550,7 +550,7 @@ static const u8 sText_PkmnTwistedDimensions[] = _("{B_ATK_NAME_WITH_PREFIX} twis
static const u8 sText_PointedStonesFloat[] =_("Pointed stones float in the air\naround your foe's team!"); static const u8 sText_PointedStonesFloat[] =_("Pointed stones float in the air\naround your foe's team!");
static const u8 sText_CloakedInMysticalMoonlight[] =_("It became cloaked in mystical\nmoonlight!"); static const u8 sText_CloakedInMysticalMoonlight[] =_("It became cloaked in mystical\nmoonlight!");
static const u8 sText_TrappedBySwirlingMagma[] =_("{B_DEF_NAME_WITH_PREFIX} became\ntrapped by swirling magma!"); static const u8 sText_TrappedBySwirlingMagma[] =_("{B_DEF_NAME_WITH_PREFIX} became\ntrapped by swirling magma!");
static const u8 sText_VanishedInstantly[] =_("{B_ATK_NAME_WITH_PREFIX} Vanished\ninstantly!"); static const u8 sText_VanishedInstantly[] =_("{B_ATK_NAME_WITH_PREFIX} vanished\ninstantly!");
static const u8 sText_ProtectedTeam[] =_("{B_CURRENT_MOVE} protected\nyour team!"); static const u8 sText_ProtectedTeam[] =_("{B_CURRENT_MOVE} protected\nyour team!");
static const u8 sText_SharedItsGuard[] =_("{B_ATK_NAME_WITH_PREFIX} shared its\nguard with the target!"); static const u8 sText_SharedItsGuard[] =_("{B_ATK_NAME_WITH_PREFIX} shared its\nguard with the target!");
static const u8 sText_SharedItsPower[] =_("{B_ATK_NAME_WITH_PREFIX} shared its\npower with the target!"); static const u8 sText_SharedItsPower[] =_("{B_ATK_NAME_WITH_PREFIX} shared its\npower with the target!");
@ -1287,7 +1287,7 @@ const u16 gStatDownStringIds[] =
const u16 gFirstTurnOfTwoStringIds[] = const u16 gFirstTurnOfTwoStringIds[] =
{ {
STRINGID_PKMNWHIPPEDWHIRLWIND, STRINGID_PKMNTOOKSUNLIGHT, STRINGID_PKMNLOWEREDHEAD, STRINGID_PKMNISGLOWING, STRINGID_PKMNWHIPPEDWHIRLWIND, STRINGID_PKMNTOOKSUNLIGHT, STRINGID_PKMNLOWEREDHEAD, STRINGID_PKMNISGLOWING,
STRINGID_PKMNFLEWHIGH, STRINGID_PKMNDUGHOLE, STRINGID_PKMNHIDUNDERWATER, STRINGID_PKMNSPRANGUP STRINGID_PKMNFLEWHIGH, STRINGID_PKMNDUGHOLE, STRINGID_PKMNHIDUNDERWATER, STRINGID_PKMNSPRANGUP, STRINGID_VANISHEDINSTANTLY
}; };
const u16 gWrappedStringIds[] = const u16 gWrappedStringIds[] =

View File

@ -1158,7 +1158,6 @@ static bool32 AccuracyCalcHelper(u16 move)
JumpIfMoveFailed(7, move); JumpIfMoveFailed(7, move);
return TRUE; return TRUE;
} }
gHitMarker &= ~HITMARKER_IGNORE_ON_AIR; gHitMarker &= ~HITMARKER_IGNORE_ON_AIR;
if (!(gHitMarker & HITMARKER_IGNORE_UNDERGROUND) && gStatuses3[gBattlerTarget] & STATUS3_UNDERGROUND) if (!(gHitMarker & HITMARKER_IGNORE_UNDERGROUND) && gStatuses3[gBattlerTarget] & STATUS3_UNDERGROUND)
@ -1167,7 +1166,6 @@ static bool32 AccuracyCalcHelper(u16 move)
JumpIfMoveFailed(7, move); JumpIfMoveFailed(7, move);
return TRUE; return TRUE;
} }
gHitMarker &= ~HITMARKER_IGNORE_UNDERGROUND; gHitMarker &= ~HITMARKER_IGNORE_UNDERGROUND;
if (!(gHitMarker & HITMARKER_IGNORE_UNDERWATER) && gStatuses3[gBattlerTarget] & STATUS3_UNDERWATER) if (!(gHitMarker & HITMARKER_IGNORE_UNDERWATER) && gStatuses3[gBattlerTarget] & STATUS3_UNDERWATER)
@ -1176,9 +1174,15 @@ static bool32 AccuracyCalcHelper(u16 move)
JumpIfMoveFailed(7, move); JumpIfMoveFailed(7, move);
return TRUE; return TRUE;
} }
gHitMarker &= ~HITMARKER_IGNORE_UNDERWATER; gHitMarker &= ~HITMARKER_IGNORE_UNDERWATER;
if (gStatuses3[gBattlerTarget] & STATUS3_PHANTOM_FORCE)
{
gMoveResultFlags |= MOVE_RESULT_MISSED;
JumpIfMoveFailed(7, move);
return TRUE;
}
if ((WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_RAIN_ANY) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) if ((WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_RAIN_ANY) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE))
|| (gBattleMoves[move].effect == EFFECT_VITAL_THROW) || (gBattleMoves[move].effect == EFFECT_VITAL_THROW)
|| (gBattleMoves[move].accuracy == 0)) || (gBattleMoves[move].accuracy == 0))
@ -2767,8 +2771,11 @@ void SetMoveEffect(bool8 primary, u8 certain)
gProtectStructs[gBattlerTarget].spikyShielded = 0; gProtectStructs[gBattlerTarget].spikyShielded = 0;
gProtectStructs[gBattlerTarget].kingsShielded = 0; gProtectStructs[gBattlerTarget].kingsShielded = 0;
gProtectStructs[gBattlerTarget].banefulBunkered = 0; gProtectStructs[gBattlerTarget].banefulBunkered = 0;
BattleScriptPush(gBattlescriptCurrInstr + 1); if (gCurrentMove == MOVE_FEINT)
gBattlescriptCurrInstr = BattleScript_MoveEffectFeint; {
BattleScriptPush(gBattlescriptCurrInstr + 1);
gBattlescriptCurrInstr = BattleScript_MoveEffectFeint;
}
} }
break; break;
} }
@ -9728,6 +9735,10 @@ static void atkC5_setsemiinvulnerablebit(void)
case MOVE_DIVE: case MOVE_DIVE:
gStatuses3[gBattlerAttacker] |= STATUS3_UNDERWATER; gStatuses3[gBattlerAttacker] |= STATUS3_UNDERWATER;
break; break;
case MOVE_PHANTOM_FORCE:
case MOVE_SHADOW_FORCE:
gStatuses3[gBattlerAttacker] |= STATUS3_PHANTOM_FORCE;
break;
} }
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
@ -9735,20 +9746,7 @@ static void atkC5_setsemiinvulnerablebit(void)
static void atkC6_clearsemiinvulnerablebit(void) static void atkC6_clearsemiinvulnerablebit(void)
{ {
switch (gCurrentMove) gStatuses3[gBattlerAttacker] &= ~(STATUS3_SEMI_INVULNERABLE);
{
case MOVE_FLY:
case MOVE_BOUNCE:
gStatuses3[gBattlerAttacker] &= ~STATUS3_ON_AIR;
break;
case MOVE_DIG:
gStatuses3[gBattlerAttacker] &= ~STATUS3_UNDERGROUND;
break;
case MOVE_DIVE:
gStatuses3[gBattlerAttacker] &= ~STATUS3_UNDERWATER;
break;
}
gBattlescriptCurrInstr++; gBattlescriptCurrInstr++;
} }

View File

@ -4774,6 +4774,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.priority = 0, .priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
.argument = MOVE_EFFECT_PARALYSIS,
}, },
[MOVE_MUD_SHOT] = [MOVE_MUD_SHOT] =
@ -7942,11 +7943,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
.type = TYPE_GHOST, .type = TYPE_GHOST,
.accuracy = 100, .accuracy = 100,
.pp = 10, .pp = 10,
.secondaryEffectChance = 0, .secondaryEffectChance = 100,
.target = MOVE_TARGET_SELECTED, .target = MOVE_TARGET_SELECTED,
.priority = 0, .priority = 0,
.flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_MINIMIZE, .flags = FLAG_MAKES_CONTACT | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGSROCK_AFFECTED | FLAG_DMG_MINIMIZE,
.split = SPLIT_PHYSICAL, .split = SPLIT_PHYSICAL,
.argument = MOVE_EFFECT_FEINT,
}, },
[MOVE_TRICK_OR_TREAT] = [MOVE_TRICK_OR_TREAT] =