diff --git a/src/battle_setup.c b/src/battle_setup.c index 058dd27023a5..01dc842bf975 100644 --- a/src/battle_setup.c +++ b/src/battle_setup.c @@ -853,7 +853,7 @@ u8 GetTrainerBattleTransition(void) case TRAINER_GLACIA_2: case TRAINER_GLACIA_3: case TRAINER_GLACIA_4: - return B_TRANSITION_SIDNEY; + return B_TRANSITION_GLACIA; case TRAINER_DRAKE: case TRAINER_DRAKE_2: case TRAINER_DRAKE_3: diff --git a/src/data/items.h b/src/data/items.h index 57004e016c4c..1523ecd85375 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -3360,9 +3360,9 @@ const struct Item gItems[] = { .name = _("Power Bracer"), .itemId = ITEM_POWER_BRACER, - .price = 10000, + .price = 2000, .holdEffect = HOLD_EFFECT_POWER_ITEM, - .holdEffectParam = 8, + .holdEffectParam = 16, .description = sPowerBracerDesc, .pocket = POCKET_BATTLE, .type = ITEM_USE_BAG_MENU, @@ -3374,9 +3374,9 @@ const struct Item gItems[] = { .name = _("Power Belt"), .itemId = ITEM_POWER_BELT, - .price = 10000, + .price = 2000, .holdEffect = HOLD_EFFECT_POWER_ITEM, - .holdEffectParam = 8, + .holdEffectParam = 16, .description = sPowerBeltDesc, .pocket = POCKET_BATTLE, .type = ITEM_USE_BAG_MENU, @@ -3388,9 +3388,9 @@ const struct Item gItems[] = { .name = _("Power Lens"), .itemId = ITEM_POWER_LENS, - .price = 10000, + .price = 2000, .holdEffect = HOLD_EFFECT_POWER_ITEM, - .holdEffectParam = 8, + .holdEffectParam = 16, .description = sPowerLensDesc, .pocket = POCKET_BATTLE, .type = ITEM_USE_BAG_MENU, @@ -3402,9 +3402,9 @@ const struct Item gItems[] = { .name = _("Power Band"), .itemId = ITEM_POWER_BAND, - .price = 10000, + .price = 2000, .holdEffect = HOLD_EFFECT_POWER_ITEM, - .holdEffectParam = 8, + .holdEffectParam = 16, .description = sPowerBandDesc, .pocket = POCKET_BATTLE, .type = ITEM_USE_BAG_MENU, @@ -3416,9 +3416,9 @@ const struct Item gItems[] = { .name = _("Power Anklet"), .itemId = ITEM_POWER_ANKLET, - .price = 10000, + .price = 2000, .holdEffect = HOLD_EFFECT_POWER_ITEM, - .holdEffectParam = 8, + .holdEffectParam = 16, .description = sPowerAnkletDesc, .pocket = POCKET_BATTLE, .type = ITEM_USE_BAG_MENU, @@ -3430,9 +3430,9 @@ const struct Item gItems[] = { .name = _("Power Weight"), .itemId = ITEM_POWER_WEIGHT, - .price = 10000, + .price = 2000, .holdEffect = HOLD_EFFECT_POWER_ITEM, - .holdEffectParam = 8, + .holdEffectParam = 16, .description = sPowerWeightDesc, .pocket = POCKET_BATTLE, .type = ITEM_USE_BAG_MENU, diff --git a/src/pokemon.c b/src/pokemon.c index d98777533ab1..824854b6a7af 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -6801,6 +6801,8 @@ void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies) powerItemStat = ItemId_GetSecondaryId(heldItem); } + powerItemBonus = ItemId_GetHoldEffectParam(heldItem); + for (i = 0; i < NUM_STATS; i++) { if (totalEVs >= MAX_TOTAL_EVS) @@ -6811,35 +6813,37 @@ void MonGainEVs(struct Pokemon *mon, u16 defeatedSpecies) else multiplier = 1; - if ((holdEffect == HOLD_EFFECT_POWER_ITEM) && (powerItemStat == (STAT_HP + i))) + // Power items prevent EV gain from Pokemon + if (holdEffect == HOLD_EFFECT_POWER_ITEM) { - powerItemBonus = ItemId_GetHoldEffectParam(heldItem); + if (powerItemStat == (STAT_HP + i)) + evIncrease = powerItemBonus * multiplier; + else + evIncrease = 0; } else { - powerItemBonus = 0; - } - - switch (i) - { - case STAT_HP: - evIncrease = (gBaseStats[defeatedSpecies].evYield_HP + powerItemBonus) * multiplier; - break; - case STAT_ATK: - evIncrease = (gBaseStats[defeatedSpecies].evYield_Attack + powerItemBonus) * multiplier; - break; - case STAT_DEF: - evIncrease = (gBaseStats[defeatedSpecies].evYield_Defense + powerItemBonus) * multiplier; - break; - case STAT_SPEED: - evIncrease = (gBaseStats[defeatedSpecies].evYield_Speed + powerItemBonus) * multiplier; - break; - case STAT_SPATK: - evIncrease = (gBaseStats[defeatedSpecies].evYield_SpAttack + powerItemBonus) * multiplier; - break; - case STAT_SPDEF: - evIncrease = (gBaseStats[defeatedSpecies].evYield_SpDefense + powerItemBonus) * multiplier; - break; + switch (i) + { + case STAT_HP: + evIncrease = gBaseStats[defeatedSpecies].evYield_HP * multiplier; + break; + case STAT_ATK: + evIncrease = gBaseStats[defeatedSpecies].evYield_Attack * multiplier; + break; + case STAT_DEF: + evIncrease = gBaseStats[defeatedSpecies].evYield_Defense * multiplier; + break; + case STAT_SPEED: + evIncrease = gBaseStats[defeatedSpecies].evYield_Speed * multiplier; + break; + case STAT_SPATK: + evIncrease = gBaseStats[defeatedSpecies].evYield_SpAttack * multiplier; + break; + case STAT_SPDEF: + evIncrease = gBaseStats[defeatedSpecies].evYield_SpDefense * multiplier; + break; + } } if (holdEffect == HOLD_EFFECT_MACHO_BRACE)