mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 11:44:17 +01:00
Skill Link Tests, Loaded Dice stuff
This commit is contained in:
parent
bca29d8586
commit
5fa7a6d4c6
@ -1722,7 +1722,8 @@ static void Cmd_accuracycheck(void)
|
|||||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
}
|
}
|
||||||
else if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT
|
else if (gSpecialStatuses[gBattlerAttacker].parentalBondState == PARENTAL_BOND_2ND_HIT
|
||||||
|| (gSpecialStatuses[gBattlerAttacker].multiHitOn && (GetBattlerAbility(gBattlerAttacker) == ABILITY_SKILL_LINK
|
|| (gSpecialStatuses[gBattlerAttacker].multiHitOn
|
||||||
|
&& (GetBattlerAbility(gBattlerAttacker) == ABILITY_SKILL_LINK || GetBattlerHoldEffect(gBattlerAttacker, TRUE)
|
||||||
|| !(gBattleMoves[move].effect == EFFECT_TRIPLE_KICK || gBattleMoves[move].effect == EFFECT_POPULATION_BOMB))))
|
|| !(gBattleMoves[move].effect == EFFECT_TRIPLE_KICK || gBattleMoves[move].effect == EFFECT_POPULATION_BOMB))))
|
||||||
{
|
{
|
||||||
// No acc checks for second hit of Parental Bond or multi hit moves, except Triple Kick/Triple Axel/Population Bomb
|
// No acc checks for second hit of Parental Bond or multi hit moves, except Triple Kick/Triple Axel/Population Bomb
|
||||||
|
@ -3745,8 +3745,15 @@ u8 AtkCanceller_UnableToUseMove(void)
|
|||||||
}
|
}
|
||||||
else if (gBattleMoves[gCurrentMove].strikeCount > 1)
|
else if (gBattleMoves[gCurrentMove].strikeCount > 1)
|
||||||
{
|
{
|
||||||
gMultiHitCounter = gBattleMoves[gCurrentMove].strikeCount;
|
if (gBattleMoves[gCurrentMove].effect == EFFECT_POPULATION_BOMB && GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_LOADED_DICE)
|
||||||
PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 3, 0)
|
{
|
||||||
|
gMultiHitCounter = RandomUniform(RNG_LOADED_DICE, 4, 10);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gMultiHitCounter = gBattleMoves[gCurrentMove].strikeCount;
|
||||||
|
PREPARE_BYTE_NUMBER_BUFFER(gBattleScripting.multihitString, 3, 0)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#if B_BEAT_UP >= GEN_5
|
#if B_BEAT_UP >= GEN_5
|
||||||
else if (gBattleMoves[gCurrentMove].effect == EFFECT_BEAT_UP)
|
else if (gBattleMoves[gCurrentMove].effect == EFFECT_BEAT_UP)
|
||||||
|
135
test/move_effect_multi_hit.c
Normal file
135
test/move_effect_multi_hit.c
Normal file
@ -0,0 +1,135 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "test_battle.h"
|
||||||
|
|
||||||
|
ASSUMPTIONS
|
||||||
|
{
|
||||||
|
ASSUME(gBattleMoves[MOVE_BULLET_SEED].effect == EFFECT_MULTI_HIT);
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Multi hit Moves hit the maximum amount with Skill Link")
|
||||||
|
{
|
||||||
|
PASSES_RANDOMLY(100, 100, RNG_HITS);
|
||||||
|
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET) { Ability(ABILITY_SKILL_LINK); };
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_BULLET_SEED); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
MESSAGE("Hit 5 time(s)!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Multi hit Moves hit twice 35 Percent of the time")
|
||||||
|
{
|
||||||
|
PASSES_RANDOMLY(35, 100, RNG_HITS);
|
||||||
|
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_BULLET_SEED); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
MESSAGE("Hit 2 time(s)!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Multi hit Moves hit thrice 35 Percent of the time")
|
||||||
|
{
|
||||||
|
PASSES_RANDOMLY(35, 100, RNG_HITS);
|
||||||
|
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_BULLET_SEED); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
MESSAGE("Hit 3 time(s)!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Multi hit Moves hit four times 35 Percent of the time")
|
||||||
|
{
|
||||||
|
PASSES_RANDOMLY(15, 100, RNG_HITS);
|
||||||
|
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_BULLET_SEED); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
MESSAGE("Hit 4 time(s)!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Multi hit Moves hit four times 35 Percent of the time")
|
||||||
|
{
|
||||||
|
PASSES_RANDOMLY(15, 100, RNG_HITS);
|
||||||
|
|
||||||
|
GIVEN {
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_BULLET_SEED); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
MESSAGE("Hit 5 time(s)!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Multi hit Moves hit at least four times with Loaded Dice")
|
||||||
|
{
|
||||||
|
PASSES_RANDOMLY(50, 100, RNG_LOADED_DICE);
|
||||||
|
|
||||||
|
GIVEN {
|
||||||
|
ASSUME(gItems[ITEM_LOADED_DICE].holdEffect == HOLD_EFFECT_LOADED_DICE);
|
||||||
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_LOADED_DICE); }
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_BULLET_SEED); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
MESSAGE("Hit 4 time(s)!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Multi hit Moves hit five times 50 Percent of the time with Loaded Dice")
|
||||||
|
{
|
||||||
|
PASSES_RANDOMLY(50, 100, RNG_LOADED_DICE);
|
||||||
|
|
||||||
|
GIVEN {
|
||||||
|
ASSUME(gItems[ITEM_LOADED_DICE].holdEffect == HOLD_EFFECT_LOADED_DICE);
|
||||||
|
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_LOADED_DICE); }
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_BULLET_SEED); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_BULLET_SEED, player);
|
||||||
|
MESSAGE("Hit 5 time(s)!");
|
||||||
|
}
|
||||||
|
}
|
6
test/move_effect_population_bomb.c
Normal file
6
test/move_effect_population_bomb.c
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "global.h"
|
||||||
|
#include "test_battle.h"
|
||||||
|
|
||||||
|
TO_DO_BATTLE_TEST("Accuracy for Population Bomb is checked independently for each hit")
|
||||||
|
TO_DO_BATTLE_TEST("Accuracy for Population Bomb is only checked for the first hit with Skill Link")
|
||||||
|
TO_DO_BATTLE_TEST("Accuracy for Population Bomb is only checked for the first hit with Loaded Dice")
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
ASSUMPTIONS
|
ASSUMPTIONS
|
||||||
{
|
{
|
||||||
ASSUME(gBattleMoves[MOVE_TRIPLE_KICK].effect & EFFECT_TRIPLE_KICK);
|
ASSUME(gBattleMoves[MOVE_TRIPLE_KICK].effect == EFFECT_TRIPLE_KICK);
|
||||||
}
|
}
|
||||||
|
|
||||||
SINGLE_BATTLE_TEST("Triple Kick damage is increased by its base damage for each hit")
|
SINGLE_BATTLE_TEST("Triple Kick damage is increased by its base damage for each hit")
|
||||||
@ -29,3 +29,7 @@ SINGLE_BATTLE_TEST("Triple Kick damage is increased by its base damage for each
|
|||||||
EXPECT_MUL_EQ(firstHit, Q_4_12(3.0), thirdHit);
|
EXPECT_MUL_EQ(firstHit, Q_4_12(3.0), thirdHit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TO_DO_BATTLE_TEST("Accuracy for Triple Kick is checked independently for each hit")
|
||||||
|
TO_DO_BATTLE_TEST("Accuracy for Triple Kick is only checked for the first hit with Skill Link")
|
||||||
|
TO_DO_BATTLE_TEST("Accuracy for Triple Kick is only checked for the first hit with Loaded Dice")
|
||||||
|
@ -1,7 +1,22 @@
|
|||||||
#include "global.h"
|
#include "global.h"
|
||||||
#include "test_battle.h"
|
#include "test_battle.h"
|
||||||
|
|
||||||
SINGLE_BATTLE_TEST("Three-strike flag turns a move into a 3-hit move")
|
SINGLE_BATTLE_TEST("Two strike count turns a move into a 2-hit move")
|
||||||
|
{
|
||||||
|
GIVEN {
|
||||||
|
ASSUME(gBattleMoves[MOVE_DOUBLE_KICK].strikeCount == 2);
|
||||||
|
PLAYER(SPECIES_WOBBUFFET);
|
||||||
|
OPPONENT(SPECIES_WOBBUFFET);
|
||||||
|
} WHEN {
|
||||||
|
TURN { MOVE(player, MOVE_DOUBLE_KICK); }
|
||||||
|
} SCENE {
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_KICK, player);
|
||||||
|
ANIMATION(ANIM_TYPE_MOVE, MOVE_DOUBLE_KICK, player);
|
||||||
|
MESSAGE("Hit 2 time(s)!");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SINGLE_BATTLE_TEST("Three strike count turns a move into a 3-hit move")
|
||||||
{
|
{
|
||||||
s16 firstHit;
|
s16 firstHit;
|
||||||
s16 secondHit;
|
s16 secondHit;
|
Loading…
Reference in New Issue
Block a user