forked from DizzyEggg/pokeemerald
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds Thief/Covet config to send stolen item to bag and Pickup config …
…to pickup user's item in wild battles (#5829)
- Loading branch information
1 parent
8f59d9c
commit f4a0cc0
Showing
5 changed files
with
174 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
#include "global.h" | ||
#include "test/battle.h" | ||
|
||
ASSUMPTIONS | ||
{ | ||
ASSUME(MoveHasAdditionalEffect(MOVE_THIEF, MOVE_EFFECT_STEAL_ITEM) == TRUE); | ||
ASSUME(MoveHasAdditionalEffect(MOVE_COVET, MOVE_EFFECT_STEAL_ITEM) == TRUE); | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Thief and Covet steal target's held item") | ||
{ | ||
u32 move; | ||
PARAMETRIZE { move = MOVE_THIEF; } | ||
PARAMETRIZE { move = MOVE_COVET; } | ||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_HYPER_POTION); } | ||
} WHEN { | ||
TURN { MOVE(player, move); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, move, player); | ||
HP_BAR(opponent); | ||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_STEAL, opponent); | ||
} THEN { | ||
EXPECT_EQ(player->item, ITEM_HYPER_POTION); | ||
EXPECT_EQ(opponent->item, ITEM_NONE); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Thief and Covet steal player's held item if opponent is a trainer") | ||
{ | ||
u32 move; | ||
PARAMETRIZE { move = MOVE_THIEF; } | ||
PARAMETRIZE { move = MOVE_COVET; } | ||
GIVEN { | ||
ASSUME(B_TRAINERS_KNOCK_OFF_ITEMS == TRUE); | ||
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_HYPER_POTION); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(opponent, move); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, move, opponent); | ||
HP_BAR(player); | ||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_STEAL, player); | ||
} THEN { | ||
EXPECT_EQ(opponent->item, ITEM_HYPER_POTION); | ||
EXPECT_EQ(player->item, ITEM_NONE); | ||
} | ||
} | ||
|
||
WILD_BATTLE_TEST("Thief and Covet don't steal player's held item if opponent is a wild mon") | ||
{ | ||
u32 move; | ||
PARAMETRIZE { move = MOVE_THIEF; } | ||
PARAMETRIZE { move = MOVE_COVET; } | ||
GIVEN { | ||
ASSUME(B_TRAINERS_KNOCK_OFF_ITEMS == TRUE); | ||
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_HYPER_POTION); } | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(opponent, move); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, move, opponent); | ||
HP_BAR(player); | ||
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_STEAL, player); | ||
} THEN { | ||
EXPECT_EQ(player->item, ITEM_HYPER_POTION); | ||
EXPECT_EQ(opponent->item, ITEM_NONE); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Thief and Covet don't steal target's held item if user is holding an item") | ||
{ | ||
u32 move; | ||
PARAMETRIZE { move = MOVE_THIEF; } | ||
PARAMETRIZE { move = MOVE_COVET; } | ||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET) { Item(ITEM_POTION); } | ||
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_HYPER_POTION); } | ||
} WHEN { | ||
TURN { MOVE(player, move); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, move, player); | ||
HP_BAR(opponent); | ||
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_STEAL, opponent); | ||
} THEN { | ||
EXPECT_EQ(player->item, ITEM_POTION); | ||
EXPECT_EQ(opponent->item, ITEM_HYPER_POTION); | ||
} | ||
} | ||
|
||
SINGLE_BATTLE_TEST("Thief and Covet don't steal target's held item if target has no item") | ||
{ | ||
u32 move; | ||
PARAMETRIZE { move = MOVE_THIEF; } | ||
PARAMETRIZE { move = MOVE_COVET; } | ||
GIVEN { | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET); | ||
} WHEN { | ||
TURN { MOVE(player, move); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, move, player); | ||
HP_BAR(opponent); | ||
NOT ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_STEAL, opponent); | ||
} | ||
} | ||
|
||
// Test can't currently verify if the item is sent to Bag | ||
WILD_BATTLE_TEST("Thief and Covet steal target's held item and it's added to Bag in wild battles (Gen 9)") | ||
{ | ||
u32 move; | ||
PARAMETRIZE { move = MOVE_THIEF; } | ||
PARAMETRIZE { move = MOVE_COVET; } | ||
GIVEN { | ||
ASSUME(B_STEAL_WILD_ITEMS >= GEN_9); | ||
PLAYER(SPECIES_WOBBUFFET); | ||
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_HYPER_POTION); } | ||
} WHEN { | ||
TURN { MOVE(player, move); } | ||
} SCENE { | ||
ANIMATION(ANIM_TYPE_MOVE, move, player); | ||
HP_BAR(opponent); | ||
ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_ITEM_STEAL, opponent); | ||
} THEN { | ||
EXPECT_EQ(player->item, ITEM_NONE); | ||
EXPECT_EQ(opponent->item, ITEM_NONE); | ||
} | ||
} |