diff --git a/include/config/item.h b/include/config/item.h index c0575a352a..08e5e4d3bb 100644 --- a/include/config/item.h +++ b/include/config/item.h @@ -13,6 +13,7 @@ #define I_GEM_BOOST_POWER GEN_LATEST // In Gen5+, the Gem boost power was reduced from 50% to 30%. #define I_USE_EVO_HELD_ITEMS_FROM_BAG FALSE // If TRUE, items such as Razor Claw or Electirizer will be usable from the bag to evolve a Pokémon just like in LA. #define I_TYPE_BOOST_POWER GEN_LATEST // In Gen4+, all regular type boosting held items had their power increased from 10% to 20%. eg. Charcoal +#define I_SELL_VALUE_FRACTION GEN_LATEST // In Gen9+, items sell for 1/4 of their value instead of 1/2. // TM config #define I_REUSABLE_TMS FALSE // In Gen5-8, TMs are reusable. Setting this to TRUE will make all vanilla TMs reusable, though they can also be cherry-picked by setting their importance to 1. diff --git a/include/item.h b/include/item.h index d130500c07..da6faa4864 100644 --- a/include/item.h +++ b/include/item.h @@ -9,17 +9,17 @@ typedef void (*ItemUseFunc)(u8); struct Item { + u32 price; + u16 secondaryId; + ItemUseFunc fieldUseFunc; + const u8 *description; u8 name[ITEM_NAME_LENGTH]; - u16 price; u8 holdEffect; u8 holdEffectParam; - const u8 *description; u8 importance; u8 pocket; u8 type; - ItemUseFunc fieldUseFunc; u8 battleUsage; - u16 secondaryId; u8 flingPower; }; diff --git a/src/data/items.h b/src/data/items.h index 6990e7cded..1093d29122 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -15,7 +15,7 @@ #endif #if I_TYPE_BOOST_POWER >= GEN_4 // For non Pokémon-specific type-boosting held items. - #define TYPE_BOOST_PARAM 20 + #define TYPE_BOOST_PARAM 20 #else #define TYPE_BOOST_PARAM 10 #endif diff --git a/src/item_menu.c b/src/item_menu.c index 2248e2836f..8067742579 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -2098,11 +2098,17 @@ static void Task_ItemContext_Sell(u8 taskId) } } +#if I_SELL_VALUE_FRACTION >= GEN_9 +#define ITEM_SELL_FACTOR 4 +#else +#define ITEM_SELL_FACTOR 2 +#endif + static void DisplaySellItemPriceAndConfirm(u8 taskId) { s16 *data = gTasks[taskId].data; - ConvertIntToDecimalStringN(gStringVar1, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount, STR_CONV_MODE_LEFT_ALIGN, 6); + ConvertIntToDecimalStringN(gStringVar1, (ItemId_GetPrice(gSpecialVar_ItemId) / ITEM_SELL_FACTOR) * tItemCount, STR_CONV_MODE_LEFT_ALIGN, 6); StringExpandPlaceholders(gStringVar4, gText_ICanPayVar1); DisplayItemMessage(taskId, FONT_NORMAL, gStringVar4, AskSellItems); } @@ -2127,7 +2133,7 @@ static void InitSellHowManyInput(u8 taskId) s16 *data = gTasks[taskId].data; u8 windowId = BagMenu_AddWindow(ITEMWIN_QUANTITY_WIDE); - PrintItemSoldAmount(windowId, 1, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount); + PrintItemSoldAmount(windowId, 1, (ItemId_GetPrice(gSpecialVar_ItemId) / ITEM_SELL_FACTOR) * tItemCount); DisplayCurrentMoneyWindow(); gTasks[taskId].func = Task_ChooseHowManyToSell; } @@ -2138,7 +2144,7 @@ static void Task_ChooseHowManyToSell(u8 taskId) if (AdjustQuantityAccordingToDPadInput(&tItemCount, tQuantity) == TRUE) { - PrintItemSoldAmount(gBagMenu->windowIds[ITEMWIN_QUANTITY_WIDE], tItemCount, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount); + PrintItemSoldAmount(gBagMenu->windowIds[ITEMWIN_QUANTITY_WIDE], tItemCount, (ItemId_GetPrice(gSpecialVar_ItemId) / ITEM_SELL_FACTOR) * tItemCount); } else if (JOY_NEW(A_BUTTON)) { @@ -2162,7 +2168,7 @@ static void ConfirmSell(u8 taskId) s16 *data = gTasks[taskId].data; CopyItemName(gSpecialVar_ItemId, gStringVar2); - ConvertIntToDecimalStringN(gStringVar1, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount, STR_CONV_MODE_LEFT_ALIGN, 6); + ConvertIntToDecimalStringN(gStringVar1, (ItemId_GetPrice(gSpecialVar_ItemId) / ITEM_SELL_FACTOR) * tItemCount, STR_CONV_MODE_LEFT_ALIGN, 6); StringExpandPlaceholders(gStringVar4, gText_TurnedOverVar1ForVar2); DisplayItemMessage(taskId, FONT_NORMAL, gStringVar4, SellItem); } @@ -2175,7 +2181,7 @@ static void SellItem(u8 taskId) PlaySE(SE_SHOP); RemoveBagItem(gSpecialVar_ItemId, tItemCount); - AddMoney(&gSaveBlock1Ptr->money, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount); + AddMoney(&gSaveBlock1Ptr->money, (ItemId_GetPrice(gSpecialVar_ItemId) / ITEM_SELL_FACTOR) * tItemCount); DestroyListMenuTask(tListTaskId, scrollPos, cursorPos); UpdatePocketItemList(gBagPosition.pocket); UpdatePocketListPosition(gBagPosition.pocket);