Add Crafty Shield effect
This commit is contained in:
parent
a3460c9e45
commit
a42bba755b
5 changed files with 19 additions and 5 deletions
|
@ -5230,7 +5230,7 @@ BattleScript_SelectingNotAllowedBelch::
|
|||
endselectionscript
|
||||
|
||||
BattleScript_SelectingNotAllowedBelchInPalace::
|
||||
printstring STRINGID_PKMNCANTUSEMOVETAUNT
|
||||
printstring STRINGID_BELCHCANTSELECT
|
||||
goto BattleScript_SelectingUnusableMoveInPalace
|
||||
|
||||
BattleScript_MoveUsedGravityPrevents::
|
||||
|
|
|
@ -211,7 +211,8 @@
|
|||
#define SIDE_STATUS_TOXIC_SPIKES_DAMAGED (1 << 16)
|
||||
#define SIDE_STATUS_STICKY_WEB_DAMAGED (1 << 17)
|
||||
#define SIDE_STATUS_QUICK_GUARD (1 << 18)
|
||||
#define SIDE_STATUS_WIDE_GUARD (1 << 18)
|
||||
#define SIDE_STATUS_WIDE_GUARD (1 << 19)
|
||||
#define SIDE_STATUS_CRAFTY_SHIELD (1 << 20)
|
||||
|
||||
// Field affecting statuses.
|
||||
#define STATUS_FIELD_MAGIC_ROOM 0x1
|
||||
|
|
|
@ -4590,8 +4590,8 @@ static void TurnValuesCleanUp(bool8 var0)
|
|||
gBattleMons[gActiveBattler].status2 &= ~(STATUS2_SUBSTITUTE);
|
||||
}
|
||||
|
||||
gSideStatuses[0] &= ~(SIDE_STATUS_QUICK_GUARD | SIDE_STATUS_WIDE_GUARD);
|
||||
gSideStatuses[1] &= ~(SIDE_STATUS_QUICK_GUARD | SIDE_STATUS_WIDE_GUARD);
|
||||
gSideStatuses[0] &= ~(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);
|
||||
gSideTimers[0].followmeTimer = 0;
|
||||
gSideTimers[1].followmeTimer = 0;
|
||||
}
|
||||
|
|
|
@ -904,6 +904,9 @@ bool32 IsBattlerProtected(u8 battlerId, u16 move)
|
|||
else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_QUICK_GUARD
|
||||
&& GetMovePriority(gBattlerAttacker) > 0)
|
||||
return TRUE;
|
||||
else if (gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_CRAFTY_SHIELD
|
||||
&& gBattleMoves[move].power == 0)
|
||||
return TRUE;
|
||||
else
|
||||
return FALSE;
|
||||
}
|
||||
|
@ -2719,6 +2722,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||
if (gProtectStructs[gBattlerTarget].protected
|
||||
|| gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_WIDE_GUARD
|
||||
|| gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_QUICK_GUARD
|
||||
|| gSideStatuses[GetBattlerSide(gBattlerTarget)] & SIDE_STATUS_CRAFTY_SHIELD
|
||||
|| gProtectStructs[gBattlerTarget].spikyShielded
|
||||
|| gProtectStructs[gBattlerTarget].kingsShielded
|
||||
|| gProtectStructs[gBattlerTarget].banefulBunkered)
|
||||
|
@ -2726,6 +2730,7 @@ void SetMoveEffect(bool8 primary, u8 certain)
|
|||
gProtectStructs[gBattlerTarget].protected = 0;
|
||||
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_WIDE_GUARD);
|
||||
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_QUICK_GUARD);
|
||||
gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_CRAFTY_SHIELD);
|
||||
gProtectStructs[gBattlerTarget].spikyShielded = 0;
|
||||
gProtectStructs[gBattlerTarget].kingsShielded = 0;
|
||||
gProtectStructs[gBattlerTarget].banefulBunkered = 0;
|
||||
|
@ -7264,6 +7269,13 @@ static void atk77_setprotectlike(void)
|
|||
gDisableStructs[gBattlerAttacker].protectUses++;
|
||||
fail = FALSE;
|
||||
}
|
||||
else if (gCurrentMove == MOVE_CRAFTY_SHIELD && !(gSideStatuses[side] & SIDE_STATUS_CRAFTY_SHIELD))
|
||||
{
|
||||
gSideStatuses[side] |= SIDE_STATUS_CRAFTY_SHIELD;
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 3;
|
||||
gDisableStructs[gBattlerAttacker].protectUses++;
|
||||
fail = FALSE;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8112,7 +8112,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
|||
|
||||
[MOVE_CRAFTY_SHIELD] =
|
||||
{
|
||||
.effect = EFFECT_PLACEHOLDER, // Needs a custom move effect
|
||||
.effect = EFFECT_PROTECT,
|
||||
.power = 0,
|
||||
.type = TYPE_FAIRY,
|
||||
.accuracy = 0,
|
||||
|
@ -8122,6 +8122,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] =
|
|||
.priority = 3,
|
||||
.flags = 0,
|
||||
.split = SPLIT_STATUS,
|
||||
.argument = TRUE, // Protects the whole side.
|
||||
},
|
||||
|
||||
[MOVE_FLOWER_SHIELD] =
|
||||
|
|
Loading…
Reference in a new issue