mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-19 01:44:20 +01:00
Mat Block
Nothing more needs to be said
This commit is contained in:
parent
17e74756cb
commit
ebe2dc6bbb
@ -345,6 +345,7 @@ gBattleScriptsForMoveEffects:: @ 82D86A8
|
|||||||
.4byte BattleScript_EffectPartingShot
|
.4byte BattleScript_EffectPartingShot
|
||||||
.4byte BattleScript_EffectSpectralThief
|
.4byte BattleScript_EffectSpectralThief
|
||||||
.4byte BattleScript_EffectVCreate
|
.4byte BattleScript_EffectVCreate
|
||||||
|
.4byte BattleScript_EffectMatBlock
|
||||||
|
|
||||||
BattleScript_EffectVCreate:
|
BattleScript_EffectVCreate:
|
||||||
setmoveeffect MOVE_EFFECT_V_CREATE | MOVE_EFFECT_AFFECTS_USER
|
setmoveeffect MOVE_EFFECT_V_CREATE | MOVE_EFFECT_AFFECTS_USER
|
||||||
@ -3148,9 +3149,15 @@ BattleScript_DoGhostCurse::
|
|||||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
|
BattleScript_EffectMatBlock::
|
||||||
|
attackcanceler
|
||||||
|
jumpifnotfirstturn BattleScript_ButItFailedAtkStringPpReduce
|
||||||
|
goto BattleScript_ProtectLikeAtkString
|
||||||
|
|
||||||
BattleScript_EffectProtect::
|
BattleScript_EffectProtect::
|
||||||
BattleScript_EffectEndure::
|
BattleScript_EffectEndure::
|
||||||
attackcanceler
|
attackcanceler
|
||||||
|
BattleScript_ProtectLikeAtkString:
|
||||||
attackstring
|
attackstring
|
||||||
ppreduce
|
ppreduce
|
||||||
setprotectlike
|
setprotectlike
|
||||||
|
@ -212,6 +212,7 @@
|
|||||||
#define SIDE_STATUS_QUICK_GUARD (1 << 18)
|
#define SIDE_STATUS_QUICK_GUARD (1 << 18)
|
||||||
#define SIDE_STATUS_WIDE_GUARD (1 << 19)
|
#define SIDE_STATUS_WIDE_GUARD (1 << 19)
|
||||||
#define SIDE_STATUS_CRAFTY_SHIELD (1 << 20)
|
#define SIDE_STATUS_CRAFTY_SHIELD (1 << 20)
|
||||||
|
#define SIDE_STATUS_MAT_BLOCK (1 << 21)
|
||||||
|
|
||||||
// Field affecting statuses.
|
// Field affecting statuses.
|
||||||
#define STATUS_FIELD_MAGIC_ROOM 0x1
|
#define STATUS_FIELD_MAGIC_ROOM 0x1
|
||||||
|
@ -333,5 +333,6 @@
|
|||||||
#define EFFECT_PARTING_SHOT 327
|
#define EFFECT_PARTING_SHOT 327
|
||||||
#define EFFECT_SPECTRAL_THIEF 328
|
#define EFFECT_SPECTRAL_THIEF 328
|
||||||
#define EFFECT_V_CREATE 329
|
#define EFFECT_V_CREATE 329
|
||||||
|
#define EFFECT_MAT_BLOCK 330
|
||||||
|
|
||||||
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
|
||||||
|
@ -4593,8 +4593,8 @@ static void TurnValuesCleanUp(bool8 var0)
|
|||||||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_SUBSTITUTE);
|
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_SUBSTITUTE);
|
||||||
}
|
}
|
||||||
|
|
||||||
gSideStatuses[0] &= ~(SIDE_STATUS_QUICK_GUARD | SIDE_STATUS_WIDE_GUARD | SIDE_STATUS_CRAFTY_SHIELD);
|
gSideStatuses[0] &= ~(SIDE_STATUS_QUICK_GUARD | SIDE_STATUS_WIDE_GUARD | SIDE_STATUS_CRAFTY_SHIELD | SIDE_STATUS_MAT_BLOCK);
|
||||||
gSideStatuses[1] &= ~(SIDE_STATUS_QUICK_GUARD | SIDE_STATUS_WIDE_GUARD | SIDE_STATUS_CRAFTY_SHIELD);
|
gSideStatuses[1] &= ~(SIDE_STATUS_QUICK_GUARD | SIDE_STATUS_WIDE_GUARD | SIDE_STATUS_CRAFTY_SHIELD | SIDE_STATUS_MAT_BLOCK);
|
||||||
gSideTimers[0].followmeTimer = 0;
|
gSideTimers[0].followmeTimer = 0;
|
||||||
gSideTimers[1].followmeTimer = 0;
|
gSideTimers[1].followmeTimer = 0;
|
||||||
}
|
}
|
||||||
|
@ -906,6 +906,9 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move)
|
|||||||
else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_CRAFTY_SHIELD
|
else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_CRAFTY_SHIELD
|
||||||
&& gBattleMoves[move].power == 0)
|
&& gBattleMoves[move].power == 0)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_MAT_BLOCK
|
||||||
|
&& gBattleMoves[move].power != 0)
|
||||||
|
return TRUE;
|
||||||
else
|
else
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
@ -2723,6 +2726,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||||||
|| gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_WIDE_GUARD
|
|| gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_WIDE_GUARD
|
||||||
|| gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_QUICK_GUARD
|
|| gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_QUICK_GUARD
|
||||||
|| gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_CRAFTY_SHIELD
|
|| gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_CRAFTY_SHIELD
|
||||||
|
|| gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_MAT_BLOCK
|
||||||
|| gProtectStructs[gBattlerTarget].spikyShielded
|
|| gProtectStructs[gBattlerTarget].spikyShielded
|
||||||
|| gProtectStructs[gBattlerTarget].kingsShielded
|
|| gProtectStructs[gBattlerTarget].kingsShielded
|
||||||
|| gProtectStructs[gBattlerTarget].banefulBunkered)
|
|| gProtectStructs[gBattlerTarget].banefulBunkered)
|
||||||
@ -2731,6 +2735,7 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
|||||||
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_WIDE_GUARD);
|
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_WIDE_GUARD);
|
||||||
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_QUICK_GUARD);
|
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_QUICK_GUARD);
|
||||||
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_CRAFTY_SHIELD);
|
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_CRAFTY_SHIELD);
|
||||||
|
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_MAT_BLOCK);
|
||||||
gProtectStructs[gBattlerTarget].spikyShielded = 0;
|
gProtectStructs[gBattlerTarget].spikyShielded = 0;
|
||||||
gProtectStructs[gBattlerTarget].kingsShielded = 0;
|
gProtectStructs[gBattlerTarget].kingsShielded = 0;
|
||||||
gProtectStructs[gBattlerTarget].banefulBunkered = 0;
|
gProtectStructs[gBattlerTarget].banefulBunkered = 0;
|
||||||
@ -7379,6 +7384,12 @@ static void atk77_setprotectlike(void)
|
|||||||
gDisableStructs[gBattlerAttacker].protectUses++;
|
gDisableStructs[gBattlerAttacker].protectUses++;
|
||||||
fail = FALSE;
|
fail = FALSE;
|
||||||
}
|
}
|
||||||
|
else if (gCurrentMove == MOVE_MAT_BLOCK && !(gSideStatuses[side] & SIDE_STATUS_MAT_BLOCK))
|
||||||
|
{
|
||||||
|
gSideStatuses[side] |= SIDE_STATUS_MAT_BLOCK;
|
||||||
|
gBattleCommunication[MULTISTRING_CHOOSER] = 3;
|
||||||
|
fail = FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7870,16 +7870,17 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
|||||||
|
|
||||||
[MOVE_MAT_BLOCK] =
|
[MOVE_MAT_BLOCK] =
|
||||||
{
|
{
|
||||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
.effect = EFFECT_MAT_BLOCK,
|
||||||
.power = 0,
|
.power = 0,
|
||||||
.type = TYPE_FIGHTING,
|
.type = TYPE_FIGHTING,
|
||||||
.accuracy = 0,
|
.accuracy = 0,
|
||||||
.pp = 15,
|
.pp = 15,
|
||||||
.secondaryEffectChance = 0,
|
.secondaryEffectChance = 0,
|
||||||
.target = MOVE_TARGET_SELECTED,
|
.target = MOVE_TARGET_USER,
|
||||||
.priority = 0,
|
.priority = 0,
|
||||||
.flags = 0,
|
.flags = 0,
|
||||||
.split = SPLIT_STATUS,
|
.split = SPLIT_STATUS,
|
||||||
|
.argument = TRUE, // Protects the whole side.
|
||||||
},
|
},
|
||||||
|
|
||||||
[MOVE_BELCH] =
|
[MOVE_BELCH] =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user