Revert "implementation of EXP candies"

This reverts commit 03c21c3b71.
This commit is contained in:
AgustinGDLV 2022-05-15 21:34:50 -07:00
parent 03c21c3b71
commit 3e44ce08b3
3 changed files with 16 additions and 56 deletions

View File

@ -1354,17 +1354,11 @@ const struct Item gItems[] =
// Candy
#define ONE_HUNDRED 1 << 4
#define ONE_THOUSAND 1 << 5
#define TEN_THOUSAND 1 << 6
#define FULL_LEVEL 1 << 7
[ITEM_RARE_CANDY] =
{
.name = _("Rare Candy"),
.itemId = ITEM_RARE_CANDY,
.price = 10000,
.holdEffectParam = FULL_LEVEL,
.description = sRareCandyDesc,
.pocket = POCKET_ITEMS,
.type = ITEM_USE_PARTY_MENU,
@ -1377,11 +1371,10 @@ const struct Item gItems[] =
.name = _("Exp.Candy XS"),
.itemId = ITEM_EXP_CANDY_XS,
.price = 20,
.holdEffectParam = 1 | ONE_HUNDRED,
.description = sExpCandyXSDesc,
.pocket = POCKET_ITEMS,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_RareCandy, // Todo
.type = ITEM_USE_BAG_MENU,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo
.flingPower = 30,
},
@ -1390,11 +1383,10 @@ const struct Item gItems[] =
.name = _("Exp.Candy S"),
.itemId = ITEM_EXP_CANDY_S,
.price = 240,
.holdEffectParam = 8 | ONE_HUNDRED,
.description = sExpCandyXSDesc,
.pocket = POCKET_ITEMS,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_RareCandy, // Todo
.type = ITEM_USE_BAG_MENU,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo
.flingPower = 30,
},
@ -1403,11 +1395,10 @@ const struct Item gItems[] =
.name = _("Exp.Candy M"),
.itemId = ITEM_EXP_CANDY_M,
.price = 1000,
.holdEffectParam = 3 | ONE_THOUSAND,
.description = sExpCandyMDesc,
.pocket = POCKET_ITEMS,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_RareCandy, // Todo
.type = ITEM_USE_BAG_MENU,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo
.flingPower = 30,
},
@ -1416,11 +1407,10 @@ const struct Item gItems[] =
.name = _("Exp.Candy L"),
.itemId = ITEM_EXP_CANDY_L,
.price = 3000,
.holdEffectParam = 1 | TEN_THOUSAND,
.description = sExpCandyLDesc,
.pocket = POCKET_ITEMS,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_RareCandy, // Todo
.type = ITEM_USE_BAG_MENU,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo
.flingPower = 30,
},
@ -1429,11 +1419,10 @@ const struct Item gItems[] =
.name = _("Exp.Candy XL"),
.itemId = ITEM_EXP_CANDY_XL,
.price = 10000,
.holdEffectParam = 3 | TEN_THOUSAND,
.description = sExpCandyXLDesc,
.pocket = POCKET_ITEMS,
.type = ITEM_USE_PARTY_MENU,
.fieldUseFunc = ItemUseOutOfBattle_RareCandy, // Todo
.type = ITEM_USE_BAG_MENU,
.fieldUseFunc = ItemUseOutOfBattle_CannotUse, // Todo
.flingPower = 30,
},
@ -1449,11 +1438,6 @@ const struct Item gItems[] =
.flingPower = 30,
},
#undef ONE_HUNDRED
#undef ONE_THOUSAND
#undef TEN_THOUSAND
#undef FULL_LEVEL
// Medicinal Flutes
[ITEM_BLUE_FLUTE] =

View File

@ -532,11 +532,11 @@ const u8 *const gItemEffectTable[] =
// Candy
[ITEM_RARE_CANDY - ITEM_POTION] = gItemEffect_RareCandy,
[ITEM_EXP_CANDY_XS - ITEM_POTION] = gItemEffect_RareCandy, // Todo
[ITEM_EXP_CANDY_S - ITEM_POTION] = gItemEffect_RareCandy, // Todo
[ITEM_EXP_CANDY_M - ITEM_POTION] = gItemEffect_RareCandy, // Todo
[ITEM_EXP_CANDY_L - ITEM_POTION] = gItemEffect_RareCandy, // Todo
[ITEM_EXP_CANDY_XL - ITEM_POTION] = gItemEffect_RareCandy, // Todo
//[ITEM_EXP_CANDY_XS - ITEM_POTION] = gItemEffect_ExpCandy, // Todo
//[ITEM_EXP_CANDY_S - ITEM_POTION] = gItemEffect_ExpCandy, // Todo
//[ITEM_EXP_CANDY_M - ITEM_POTION] = gItemEffect_ExpCandy, // Todo
//[ITEM_EXP_CANDY_L - ITEM_POTION] = gItemEffect_ExpCandy, // Todo
//[ITEM_EXP_CANDY_XL - ITEM_POTION] = gItemEffect_ExpCandy, // Todo
//[ITEM_DYNAMAX_CANDY - ITEM_POTION] = gItemEffect_DynamaxCandy, // Todo
// Medicinal Flutes

View File

@ -4873,40 +4873,16 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov
retVal = FALSE;
}
#define ONE_HUNDRED 1 << 4
#define ONE_THOUSAND 1 << 5
#define TEN_THOUSAND 1 << 6
#define FULL_LEVEL 1 << 7
// Rare Candy
if ((itemEffect[i] & ITEM3_LEVEL_UP)
&& GetMonData(mon, MON_DATA_LEVEL, NULL) != MAX_LEVEL)
{
if (ItemId_GetHoldEffectParam(item) & FULL_LEVEL)
dataUnsigned = gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(mon, MON_DATA_LEVEL, NULL) + 1];
else
{
temp1 = ItemId_GetHoldEffectParam(item) & 0x0F;
if (ItemId_GetHoldEffectParam(item) & ONE_HUNDRED)
temp1 *= 100;
if (ItemId_GetHoldEffectParam(item) & ONE_THOUSAND)
temp1 *= 1000;
if (ItemId_GetHoldEffectParam(item) & TEN_THOUSAND)
temp1 *= 10000;
dataUnsigned = temp1 + gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(mon, MON_DATA_LEVEL, NULL)];
if (dataUnsigned > gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][MAX_LEVEL])
dataUnsigned = gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][MAX_LEVEL];
}
dataUnsigned = gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(mon, MON_DATA_LEVEL, NULL) + 1];
SetMonData(mon, MON_DATA_EXP, &dataUnsigned);
CalculateMonStats(mon);
retVal = FALSE;
}
#undef ONE_HUNDRED
#undef ONE_THOUSAND
#undef TEN_THOUSAND
#undef FULL_LEVEL
// Cure status
if ((itemEffect[i] & ITEM3_SLEEP)
&& HealStatusConditions(mon, partyIndex, STATUS1_SLEEP, battlerId) == 0)