mirror of
https://github.com/rh-hideout/pokeemerald-expansion.git
synced 2026-04-26 02:14:22 -05:00
Fix incorrect wrap turn amount (#7667)
This commit is contained in:
parent
92ba0d813d
commit
6aead97a37
|
|
@ -214,6 +214,7 @@ enum RandomTag
|
|||
RNG_AI_ASSUME_ALL_STATUS,
|
||||
RNG_AI_REFRESH_TRICK_ROOM_ON_LAST_TURN,
|
||||
RNG_AI_APPLY_TAILWIND_ON_LAST_TURN_OF_TRICK_ROOM,
|
||||
RNG_WRAP,
|
||||
};
|
||||
|
||||
#define RandomWeighted(tag, ...) \
|
||||
|
|
|
|||
|
|
@ -763,8 +763,9 @@ static bool32 HandleEndTurnWrap(u32 battler)
|
|||
|
||||
if (gBattleMons[battler].volatiles.wrapped && IsBattlerAlive(battler))
|
||||
{
|
||||
if (--gDisableStructs[battler].wrapTurns != 0)
|
||||
if (gDisableStructs[battler].wrapTurns != 0)
|
||||
{
|
||||
gDisableStructs[battler].wrapTurns--;
|
||||
if (IsAbilityAndRecord(battler, GetBattlerAbility(battler), ABILITY_MAGIC_GUARD))
|
||||
return effect;
|
||||
|
||||
|
|
|
|||
|
|
@ -3173,7 +3173,7 @@ void SetMoveEffect(u32 battler, u32 effectBattler, bool32 primary, bool32 certai
|
|||
if (GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_GRIP_CLAW)
|
||||
gDisableStructs[gEffectBattler].wrapTurns = B_BINDING_TURNS >= GEN_5 ? 7 : 5;
|
||||
else
|
||||
gDisableStructs[gEffectBattler].wrapTurns = B_BINDING_TURNS >= GEN_5 ? (Random() % 2) + 4 : (Random() % 4) + 2;
|
||||
gDisableStructs[gEffectBattler].wrapTurns = B_BINDING_TURNS >= GEN_5 ? RandomUniform(RNG_WRAP, 4, 5) : RandomUniform(RNG_WRAP, 2, 5);
|
||||
|
||||
gBattleStruct->wrappedMove[gEffectBattler] = gCurrentMove;
|
||||
gBattleStruct->wrappedBy[gEffectBattler] = gBattlerAttacker;
|
||||
|
|
|
|||
86
test/battle/move_effect_secondary/wrap.c
Normal file
86
test/battle/move_effect_secondary/wrap.c
Normal file
|
|
@ -0,0 +1,86 @@
|
|||
#include "global.h"
|
||||
#include "test/battle.h"
|
||||
|
||||
ASSUMPTIONS
|
||||
{
|
||||
ASSUME(MoveHasAdditionalEffect(MOVE_WRAP, MOVE_EFFECT_WRAP));
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Wrap can damage the wrapped mon for 5 turns 50% of the time")
|
||||
{
|
||||
PASSES_RANDOMLY(50, 100, RNG_WRAP);
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_WRAP); }
|
||||
TURN {}
|
||||
TURN {}
|
||||
TURN {}
|
||||
TURN {}
|
||||
TURN {}
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_WRAP, player);
|
||||
HP_BAR(opponent); // Direct damage
|
||||
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
NOT HP_BAR(opponent); // Residual Damage
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Wrap can damage the wrapped mon for 4 turns 50% of the time")
|
||||
{
|
||||
PASSES_RANDOMLY(50, 100, RNG_WRAP);
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET);
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_WRAP); }
|
||||
TURN {}
|
||||
TURN {}
|
||||
TURN {}
|
||||
TURN {}
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_WRAP, player);
|
||||
HP_BAR(opponent); // Direct damage
|
||||
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
NOT HP_BAR(opponent); // Residual Damage
|
||||
}
|
||||
}
|
||||
|
||||
SINGLE_BATTLE_TEST("Wrap can damage the wrapped mon 7 turns while holding a Grip Claw")
|
||||
{
|
||||
GIVEN {
|
||||
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_GRIP_CLAW); }
|
||||
OPPONENT(SPECIES_WOBBUFFET);
|
||||
} WHEN {
|
||||
TURN { MOVE(player, MOVE_WRAP); }
|
||||
TURN {}
|
||||
TURN {}
|
||||
TURN {}
|
||||
TURN {}
|
||||
TURN {}
|
||||
TURN {}
|
||||
TURN {}
|
||||
} SCENE {
|
||||
ANIMATION(ANIM_TYPE_MOVE, MOVE_WRAP, player);
|
||||
HP_BAR(opponent); // Direct damage
|
||||
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
HP_BAR(opponent); // Residual Damage
|
||||
NOT HP_BAR(opponent); // Residual Damage
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user