diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index afe7cf27192d..9f70bbdf8b59 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -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 diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index dbaa21f14d25..70d8f11eecfe 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -418,7 +418,8 @@ #define EFFECT_RAGE_FIST 412 #define EFFECT_DOODLE 413 #define EFFECT_FILLET_AWAY 414 +#define EFFECT_IVY_CUDGEL 415 -#define NUM_BATTLE_MOVE_EFFECTS 415 +#define NUM_BATTLE_MOVE_EFFECTS 416 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/hold_effects.h b/include/constants/hold_effects.h index a54f569cd29e..0f364d2462cf 100644 --- a/include/constants/hold_effects.h +++ b/include/constants/hold_effects.h @@ -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 diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 6d34badfd0e6..c039b7c454a4 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -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]); @@ -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; } diff --git a/src/battle_main.c b/src/battle_main.c index e47fdd4209f8..9930fa56fe74 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -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) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 94fec5691ac9..292804138a0b 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -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, @@ -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, }, diff --git a/src/data/items.h b/src/data/items.h index cc8c646223fc..39038cb99123 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -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] = diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index a9a70f127914..56e1ea51e9e5 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -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); @@ -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); diff --git a/test/battle/move_effect/ivy_cudgel.c b/test/battle/move_effect/ivy_cudgel.c index 819047f34a74..47db28f50d36 100644 --- a/test/battle/move_effect/ivy_cudgel.c +++ b/test/battle/move_effect/ivy_cudgel.c @@ -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); } @@ -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 + } +}