From 6688e752494fcfdb8eb06edcd0357b7c7d77d92e Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Thu, 2 Sep 2021 21:39:04 +1200 Subject: [PATCH 1/4] Cheap Power Items Cut Power item price to 1000 --- src/data/items.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/data/items.h b/src/data/items.h index 57004e016c4c..a5d15be62d45 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -3360,7 +3360,7 @@ const struct Item gItems[] = { .name = _("Power Bracer"), .itemId = ITEM_POWER_BRACER, - .price = 10000, + .price = 1000, .holdEffect = HOLD_EFFECT_POWER_ITEM, .holdEffectParam = 8, .description = sPowerBracerDesc, @@ -3374,7 +3374,7 @@ const struct Item gItems[] = { .name = _("Power Belt"), .itemId = ITEM_POWER_BELT, - .price = 10000, + .price = 1000, .holdEffect = HOLD_EFFECT_POWER_ITEM, .holdEffectParam = 8, .description = sPowerBeltDesc, @@ -3388,7 +3388,7 @@ const struct Item gItems[] = { .name = _("Power Lens"), .itemId = ITEM_POWER_LENS, - .price = 10000, + .price = 1000, .holdEffect = HOLD_EFFECT_POWER_ITEM, .holdEffectParam = 8, .description = sPowerLensDesc, @@ -3402,7 +3402,7 @@ const struct Item gItems[] = { .name = _("Power Band"), .itemId = ITEM_POWER_BAND, - .price = 10000, + .price = 1000, .holdEffect = HOLD_EFFECT_POWER_ITEM, .holdEffectParam = 8, .description = sPowerBandDesc, @@ -3416,7 +3416,7 @@ const struct Item gItems[] = { .name = _("Power Anklet"), .itemId = ITEM_POWER_ANKLET, - .price = 10000, + .price = 1000, .holdEffect = HOLD_EFFECT_POWER_ITEM, .holdEffectParam = 8, .description = sPowerAnkletDesc, @@ -3430,7 +3430,7 @@ const struct Item gItems[] = { .name = _("Power Weight"), .itemId = ITEM_POWER_WEIGHT, - .price = 10000, + .price = 1000, .holdEffect = HOLD_EFFECT_POWER_ITEM, .holdEffectParam = 8, .description = sPowerWeightDesc, From 2cfc74c0fce59c0f6b28e693758eeecb95b0d219 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Thu, 2 Sep 2021 21:39:26 +1200 Subject: [PATCH 2/4] Fix Glacia transition Oops --- src/battle_setup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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: From 2128ae2678c125c936116b09f81ba24527cfe354 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Thu, 2 Sep 2021 22:16:11 +1200 Subject: [PATCH 3/4] Power Items block other EV gains MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit While holding a Power Item, a Pokémon will only gain EVs from the item itself. E.g. kill Zubat with Power Weight, get 8 HP EVs, 0 Speed EVs. --- src/pokemon.c | 54 +++++++++++++++++++++++++++------------------------ 1 file changed, 29 insertions(+), 25 deletions(-) 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) From f3627e8f7de6e6ea2ca2d9808b9f81d15e1349b6 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Thu, 2 Sep 2021 22:24:57 +1200 Subject: [PATCH 4/4] Double Power item EV yield, price Set EV gain to 16, price to 2000. 1000 a bit too cheap with new effect. --- src/data/items.h | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/data/items.h b/src/data/items.h index a5d15be62d45..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 = 1000, + .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 = 1000, + .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 = 1000, + .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 = 1000, + .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 = 1000, + .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 = 1000, + .price = 2000, .holdEffect = HOLD_EFFECT_POWER_ITEM, - .holdEffectParam = 8, + .holdEffectParam = 16, .description = sPowerWeightDesc, .pocket = POCKET_BATTLE, .type = ITEM_USE_BAG_MENU,