Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Ivy Cudgel to be based on Ogerpon form rather than held item #3865

Merged
merged 6 commits into from
Dec 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions data/battle_scripts_1.s
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,7 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectHit @ EFFECT_RAGE_FIST
.4byte BattleScript_EffectDoodle @ EFFECT_DOODLE
.4byte BattleScript_EffectFilletAway @ EFFECT_FILLET_AWAY
.4byte BattleScript_EffectHit @ EFFECT_IVY_CUDGEL

BattleScript_EffectFilletAway:
attackcanceler
Expand Down
3 changes: 2 additions & 1 deletion include/constants/battle_move_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@
#define EFFECT_RAGE_FIST 412
#define EFFECT_DOODLE 413
#define EFFECT_FILLET_AWAY 414
#define EFFECT_IVY_CUDGEL 415
kittenchilly marked this conversation as resolved.
Show resolved Hide resolved

#define NUM_BATTLE_MOVE_EFFECTS 415
#define NUM_BATTLE_MOVE_EFFECTS 416

#endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H
1 change: 0 additions & 1 deletion include/constants/hold_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
#define HOLD_EFFECT_COVERT_CLOAK 179
#define HOLD_EFFECT_LOADED_DICE 180
#define HOLD_EFFECT_BOOSTER_ENERGY 181 // Not implemented.
#define HOLD_EFFECT_MASK 183

// Gen2 hold effect
#define HOLD_EFFECT_BERSERK_GENE 184
Expand Down
10 changes: 6 additions & 4 deletions src/battle_controller_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -1730,7 +1730,7 @@ static void MoveSelectionDisplayMoveType(u32 battler)
{
u8 *txtPtr;
u8 type;
u32 itemId;
u32 speciesId;
struct Pokemon *mon;
struct ChooseMoveStruct *moveInfo = (struct ChooseMoveStruct *)(&gBattleResources->bufferA[battler][4]);

Expand All @@ -1742,10 +1742,12 @@ static void MoveSelectionDisplayMoveType(u32 battler)
if (moveInfo->moves[gMoveSelectionCursor[battler]] == MOVE_IVY_CUDGEL)
{
mon = &GetSideParty(GetBattlerSide(battler))[gBattlerPartyIndexes[battler]];
itemId = GetMonData(mon, MON_DATA_HELD_ITEM);
speciesId = GetMonData(mon, MON_DATA_SPECIES);

if (ItemId_GetHoldEffect(itemId) == HOLD_EFFECT_MASK)
type = ItemId_GetSecondaryId(itemId);
if (speciesId == SPECIES_OGERPON_WELLSPRING_MASK || speciesId == SPECIES_OGERPON_WELLSPRING_MASK_TERA
|| speciesId == SPECIES_OGERPON_HEARTHFLAME_MASK || speciesId == SPECIES_OGERPON_HEARTHFLAME_MASK_TERA
|| speciesId == SPECIES_OGERPON_CORNERSTONE_MASK || speciesId == SPECIES_OGERPON_CORNERSTONE_MASK_TERA)
type = gBattleMons[battler].type2;
else
type = gBattleMoves[MOVE_IVY_CUDGEL].type;
}
Expand Down
7 changes: 7 additions & 0 deletions src/battle_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -5667,6 +5667,13 @@ void SetTypeBeforeUsingMove(u32 move, u32 battlerAtk)
{
gBattleStruct->dynamicMoveType = gBattleMons[battlerAtk].type2 | F_DYNAMIC_TYPE_SET;
}
else if (gBattleMoves[move].effect == EFFECT_IVY_CUDGEL
&& (gBattleMons[battlerAtk].species == SPECIES_OGERPON_WELLSPRING_MASK || gBattleMons[battlerAtk].species == SPECIES_OGERPON_WELLSPRING_MASK_TERA
|| gBattleMons[battlerAtk].species == SPECIES_OGERPON_HEARTHFLAME_MASK || gBattleMons[battlerAtk].species == SPECIES_OGERPON_HEARTHFLAME_MASK_TERA
|| gBattleMons[battlerAtk].species == SPECIES_OGERPON_CORNERSTONE_MASK || gBattleMons[battlerAtk].species == SPECIES_OGERPON_CORNERSTONE_MASK_TERA ))
{
gBattleStruct->dynamicMoveType = gBattleMons[battlerAtk].type2 | F_DYNAMIC_TYPE_SET;
}
else if (gBattleMoves[move].effect == EFFECT_NATURAL_GIFT)
{
if (ItemId_GetPocket(gBattleMons[battlerAtk].item) == POCKET_BERRIES)
Expand Down
3 changes: 1 addition & 2 deletions src/data/battle_moves.h
Original file line number Diff line number Diff line change
Expand Up @@ -13887,7 +13887,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =

[MOVE_IVY_CUDGEL] =
{
.effect = EFFECT_CHANGE_TYPE_ON_ITEM,
.effect = EFFECT_IVY_CUDGEL,
.power = 100,
.type = TYPE_GRASS,
.accuracy = 100,
Expand All @@ -13897,7 +13897,6 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
.target = MOVE_TARGET_SELECTED,
.priority = 0,
.category = BATTLE_CATEGORY_PHYSICAL,
.argument = HOLD_EFFECT_MASK,
.metronomeBanned = TRUE,
},

Expand Down
6 changes: 0 additions & 6 deletions src/data/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -11248,42 +11248,36 @@ const struct Item gItems[] =
{
.name = _("CornrstneMask"),
.price = 0,
.holdEffect = HOLD_EFFECT_MASK,
.description = COMPOUND_STRING("Allows Ogerpon to\n"
"wield the Rock-\n"
"type in battle."),
.pocket = POCKET_ITEMS,
.type = ITEM_USE_BAG_MENU,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
.secondaryId = TYPE_ROCK,
},

[ITEM_WELLSPRING_MASK] =
{
.name = _("WellsprngMask"),
.price = 0,
.holdEffect = HOLD_EFFECT_MASK,
.description = COMPOUND_STRING("Allows Ogerpon to\n"
"wield the Water-\n"
"type in battle."),
.pocket = POCKET_ITEMS,
.type = ITEM_USE_BAG_MENU,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
.secondaryId = TYPE_WATER,
},

[ITEM_HEARTHFLAME_MASK] =
{
.name = _("HrthflameMask"),
.price = 0,
.holdEffect = HOLD_EFFECT_MASK,
.description = COMPOUND_STRING("Allows Ogerpon to\n"
"wield the Fire-\n"
"type in battle."),
.pocket = POCKET_ITEMS,
.type = ITEM_USE_BAG_MENU,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
.secondaryId = TYPE_FIRE,
},

[ITEM_HEALTH_MOCHI] =
Expand Down
7 changes: 2 additions & 5 deletions src/pokemon_summary_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2841,7 +2841,7 @@ static void PrintNotEggInfo(void)

if (dexNum != 0xFFFF)
{
u8 digitCount = (NATIONAL_DEX_COUNT > 999 && IsNationalPokedexEnabled()) ? 4 : 3;
u8 digitCount = (NATIONAL_DEX_COUNT > 999 && IsNationalPokedexEnabled()) ? 4 : 3;
StringCopy(gStringVar1, &gText_NumberClear01[0]);
ConvertIntToDecimalStringN(gStringVar2, dexNum, STR_CONV_MODE_LEADING_ZEROS, digitCount);
StringAppend(gStringVar1, gStringVar2);
Expand Down Expand Up @@ -3958,10 +3958,7 @@ static void SetMoveTypeIcons(void)
{
if (summary->moves[i] != MOVE_NONE)
{
if (summary->moves[i] == MOVE_IVY_CUDGEL && ItemId_GetHoldEffect(summary->item) == HOLD_EFFECT_MASK)
SetTypeSpritePosAndPal(ItemId_GetSecondaryId(summary->item), 85, 32 + (i * 16), i + SPRITE_ARR_ID_TYPE);
else
SetTypeSpritePosAndPal(gBattleMoves[summary->moves[i]].type, 85, 32 + (i * 16), i + SPRITE_ARR_ID_TYPE);
SetTypeSpritePosAndPal(gBattleMoves[summary->moves[i]].type, 85, 32 + (i * 16), i + SPRITE_ARR_ID_TYPE);
}
else
SetSpriteInvisibility(i + SPRITE_ARR_ID_TYPE, TRUE);
Expand Down
37 changes: 29 additions & 8 deletions test/battle/move_effect/ivy_cudgel.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@

ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_IVY_CUDGEL].effect == EFFECT_CHANGE_TYPE_ON_ITEM);
ASSUME(gBattleMoves[MOVE_IVY_CUDGEL].argument == HOLD_EFFECT_MASK);
ASSUME(gBattleMoves[MOVE_IVY_CUDGEL].effect == EFFECT_IVY_CUDGEL);
}

SINGLE_BATTLE_TEST("Ivy Cudgel changes the move type depending on the mask the user holds")
SINGLE_BATTLE_TEST("Ivy Cudgel changes the move type depending on the form of Ogerpon")
{
u16 species;
u16 ogerpon;
u16 item;

PARAMETRIZE { species = SPECIES_BLASTOISE; item = ITEM_NONE; }
PARAMETRIZE { species = SPECIES_CHARIZARD; item = ITEM_CORNERSTONE_MASK; }
PARAMETRIZE { species = SPECIES_CHARIZARD; item = ITEM_WELLSPRING_MASK; }
PARAMETRIZE { species = SPECIES_VENUSAUR; item = ITEM_HEARTHFLAME_MASK; }
PARAMETRIZE { species = SPECIES_BLASTOISE; ogerpon = SPECIES_OGERPON_TEAL_MASK; item = ITEM_NONE; }
PARAMETRIZE { species = SPECIES_CHARIZARD; ogerpon = SPECIES_OGERPON_CORNERSTONE_MASK; item = ITEM_CORNERSTONE_MASK; }
PARAMETRIZE { species = SPECIES_CHARIZARD; ogerpon = SPECIES_OGERPON_WELLSPRING_MASK; item = ITEM_WELLSPRING_MASK; }
PARAMETRIZE { species = SPECIES_VENUSAUR; ogerpon = SPECIES_OGERPON_HEARTHFLAME_MASK; item = ITEM_HEARTHFLAME_MASK; }

GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(item); }
PLAYER(ogerpon) { Item(item); }
OPPONENT(species);
} WHEN {
TURN { MOVE(player, MOVE_IVY_CUDGEL); }
Expand All @@ -28,3 +28,24 @@ SINGLE_BATTLE_TEST("Ivy Cudgel changes the move type depending on the mask the u
MESSAGE("It's super effective!");
}
}

SINGLE_BATTLE_TEST("Ivy Cudgel does not change the move type if used by Pokémon other than Ogerpon")
{
u16 item;

PARAMETRIZE { item = ITEM_NONE; }
PARAMETRIZE { item = ITEM_CORNERSTONE_MASK; }
PARAMETRIZE { item = ITEM_WELLSPRING_MASK; }
PARAMETRIZE { item = ITEM_HEARTHFLAME_MASK; }

GIVEN {
PLAYER(SPECIES_WOBBUFFET) { Item(item); }
OPPONENT(SPECIES_BLASTOISE);
} WHEN {
TURN { MOVE(player, MOVE_IVY_CUDGEL); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_IVY_CUDGEL, player);
HP_BAR(opponent);
MESSAGE("It's super effective!"); // Should be super effective everytime if type isnt being changed
}
}
Loading