mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-28 22:33:53 +01:00
Merge pull request #1808 from AsparagusEduardo/BE_ghostEscape
Completed Ghost type trapping inmunity
This commit is contained in:
commit
289ec6ad40
@ -3977,6 +3977,9 @@ BattleScript_EffectMeanLook::
|
|||||||
accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON
|
accuracycheck BattleScript_ButItFailed, NO_ACC_CALC_CHECK_LOCK_ON
|
||||||
jumpifstatus2 BS_TARGET, STATUS2_ESCAPE_PREVENTION, BattleScript_ButItFailed
|
jumpifstatus2 BS_TARGET, STATUS2_ESCAPE_PREVENTION, BattleScript_ButItFailed
|
||||||
jumpifsubstituteblocks BattleScript_ButItFailed
|
jumpifsubstituteblocks BattleScript_ButItFailed
|
||||||
|
.if B_GHOSTS_ESCAPE >= GEN_6
|
||||||
|
jumpiftype BS_TARGET, TYPE_GHOST, BattleScript_ButItFailed
|
||||||
|
.endif
|
||||||
attackanimation
|
attackanimation
|
||||||
waitanimation
|
waitanimation
|
||||||
setmoveeffect MOVE_EFFECT_PREVENT_ESCAPE
|
setmoveeffect MOVE_EFFECT_PREVENT_ESCAPE
|
||||||
|
@ -111,7 +111,7 @@
|
|||||||
#define B_ROUGH_SKIN_DMG GEN_7 // In Gen4+, Rough Skin contact damage is 1/8th of max HP instead of 1/16th. This will also affect Iron Barbs.
|
#define B_ROUGH_SKIN_DMG GEN_7 // In Gen4+, Rough Skin contact damage is 1/8th of max HP instead of 1/16th. This will also affect Iron Barbs.
|
||||||
|
|
||||||
// Type settings
|
// Type settings
|
||||||
#define B_GHOSTS_ESCAPE GEN_7 // In Gen6+, Ghost-type Pokémon can escape even when blocked by abilities such as Shadow Tag.
|
#define B_GHOSTS_ESCAPE GEN_7 // In Gen6+, abilities like Shadow Tag or moves like Mean Look fail on Ghost-type Pokémon. They can also escape any Wild Battle.
|
||||||
#define B_PARALYZE_ELECTRIC GEN_7 // In Gen6+, Electric-type Pokémon can't be paralyzed.
|
#define B_PARALYZE_ELECTRIC GEN_7 // In Gen6+, Electric-type Pokémon can't be paralyzed.
|
||||||
#define B_POWDER_GRASS GEN_7 // In Gen6+, Grass-type Pokémon are immune to powder and spore moves.
|
#define B_POWDER_GRASS GEN_7 // In Gen6+, Grass-type Pokémon are immune to powder and spore moves.
|
||||||
#define B_STEEL_RESISTANCES GEN_7 // In Gen6+, Steel-type Pokémon are no longer resistant to Dark-type and Ghost-type moves.
|
#define B_STEEL_RESISTANCES GEN_7 // In Gen6+, Steel-type Pokémon are no longer resistant to Dark-type and Ghost-type moves.
|
||||||
|
@ -3335,7 +3335,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score)
|
|||||||
case EFFECT_TRAP:
|
case EFFECT_TRAP:
|
||||||
case EFFECT_MEAN_LOOK:
|
case EFFECT_MEAN_LOOK:
|
||||||
if (HasMoveEffect(battlerDef, EFFECT_RAPID_SPIN)
|
if (HasMoveEffect(battlerDef, EFFECT_RAPID_SPIN)
|
||||||
|| IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)
|
|| (B_GHOSTS_ESCAPE >= GEN_6 && IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST))
|
||||||
|| gBattleMons[battlerDef].status2 & STATUS2_WRAPPED)
|
|| gBattleMons[battlerDef].status2 & STATUS2_WRAPPED)
|
||||||
{
|
{
|
||||||
break; // in this case its a bad attacking move
|
break; // in this case its a bad attacking move
|
||||||
|
@ -3705,6 +3705,10 @@ u8 IsRunningFromBattleImpossible(void)
|
|||||||
|
|
||||||
if (holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)
|
if (holdEffect == HOLD_EFFECT_CAN_ALWAYS_RUN)
|
||||||
return 0;
|
return 0;
|
||||||
|
#if B_GHOSTS_ESCAPE >= GEN_6
|
||||||
|
if (IS_BATTLER_OF_TYPE(gActiveBattler, TYPE_GHOST))
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
if (gBattleTypeFlags & BATTLE_TYPE_LINK)
|
||||||
return 0;
|
return 0;
|
||||||
if (GetBattlerAbility(gActiveBattler) == ABILITY_RUN_AWAY)
|
if (GetBattlerAbility(gActiveBattler) == ABILITY_RUN_AWAY)
|
||||||
|
@ -621,6 +621,12 @@ bool8 TryRunFromBattle(u8 battler)
|
|||||||
gProtectStructs[battler].fleeFlag = 1;
|
gProtectStructs[battler].fleeFlag = 1;
|
||||||
effect++;
|
effect++;
|
||||||
}
|
}
|
||||||
|
#if B_GHOSTS_ESCAPE >= GEN_6
|
||||||
|
else if (IS_BATTLER_OF_TYPE(battler, TYPE_GHOST))
|
||||||
|
{
|
||||||
|
effect++;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
else if (gBattleMons[battler].ability == ABILITY_RUN_AWAY)
|
else if (gBattleMons[battler].ability == ABILITY_RUN_AWAY)
|
||||||
{
|
{
|
||||||
if (InBattlePyramid())
|
if (InBattlePyramid())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user