nearly matching PokemonItemEffects2
This commit is contained in:
+4
-4
@@ -13278,7 +13278,7 @@ _08125330:
|
|||||||
adds r0, r5, 0
|
adds r0, r5, 0
|
||||||
adds r1, r6, 0
|
adds r1, r6, 0
|
||||||
movs r3, 0
|
movs r3, 0
|
||||||
bl sub_8042414
|
bl PokemonUseItemEffects2
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
lsrs r4, r0, 24
|
lsrs r4, r0, 24
|
||||||
_08125342:
|
_08125342:
|
||||||
@@ -13882,7 +13882,7 @@ sub_812580C: @ 812580C
|
|||||||
ldrh r1, [r1]
|
ldrh r1, [r1]
|
||||||
ldrb r2, [r3, 0x9]
|
ldrb r2, [r3, 0x9]
|
||||||
ldrb r3, [r3, 0xE]
|
ldrb r3, [r3, 0xE]
|
||||||
bl sub_8042414
|
bl PokemonUseItemEffects2
|
||||||
adds r4, r0, 0
|
adds r4, r0, 0
|
||||||
lsls r4, 24
|
lsls r4, 24
|
||||||
lsrs r4, 24
|
lsrs r4, 24
|
||||||
@@ -15175,7 +15175,7 @@ dp05_rare_candy: @ 81262AC
|
|||||||
adds r0, r4, 0
|
adds r0, r4, 0
|
||||||
adds r1, r5, 0
|
adds r1, r5, 0
|
||||||
movs r3, 0
|
movs r3, 0
|
||||||
bl sub_8042414
|
bl PokemonUseItemEffects2
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
lsrs r4, r0, 24
|
lsrs r4, r0, 24
|
||||||
b _081262F6
|
b _081262F6
|
||||||
@@ -16210,7 +16210,7 @@ sub_8126B60: @ 8126B60
|
|||||||
ldrh r1, [r1]
|
ldrh r1, [r1]
|
||||||
ldrb r2, [r2, 0x9]
|
ldrb r2, [r2, 0x9]
|
||||||
movs r3, 0
|
movs r3, 0
|
||||||
bl sub_8042414
|
bl PokemonUseItemEffects2
|
||||||
lsls r0, 24
|
lsls r0, 24
|
||||||
cmp r0, 0
|
cmp r0, 0
|
||||||
beq _08126BC8
|
beq _08126BC8
|
||||||
|
|||||||
+3
-3
@@ -5,8 +5,8 @@
|
|||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
thumb_func_start sub_8042414
|
thumb_func_start PokemonUseItemEffects2
|
||||||
sub_8042414: @ 8042414
|
PokemonUseItemEffects2: @ 8042414
|
||||||
push {r4-r7,lr}
|
push {r4-r7,lr}
|
||||||
mov r7, r10
|
mov r7, r10
|
||||||
mov r6, r9
|
mov r6, r9
|
||||||
@@ -1000,7 +1000,7 @@ _08042BD8:
|
|||||||
pop {r4-r7}
|
pop {r4-r7}
|
||||||
pop {r1}
|
pop {r1}
|
||||||
bx r1
|
bx r1
|
||||||
thumb_func_end sub_8042414
|
thumb_func_end PokemonUseItemEffects2
|
||||||
|
|
||||||
thumb_func_start sub_8042BE8
|
thumb_func_start sub_8042BE8
|
||||||
sub_8042BE8: @ 8042BE8
|
sub_8042BE8: @ 8042BE8
|
||||||
|
|||||||
+543
-1
@@ -2830,4 +2830,546 @@ bool8 HealStatusConditions(struct Pokemon *mon, u32 unused, u32 healMask, u8 bat
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// continued in pokemon_3.s but i cant keep going
|
extern bool8 sub_8042BE8(struct Pokemon *mon, u32 unused, u32 healMask, u8 battleId);
|
||||||
|
|
||||||
|
static inline u32 get_in_battle(void)
|
||||||
|
{
|
||||||
|
return (u8)gMain.inBattle;
|
||||||
|
}
|
||||||
|
|
||||||
|
//bool8 PokemonUseItemEffects2(struct Pokemon *pkmn, u16 item, u8 partyIndex, u8 moveIndex, u8 e)
|
||||||
|
//{
|
||||||
|
// u32 data;
|
||||||
|
// s32 friendship;
|
||||||
|
// s32 cmdIndex;
|
||||||
|
// bool8 retVal = TRUE;
|
||||||
|
// const u8 *itemEffect;
|
||||||
|
// u8 sp24 = 6;
|
||||||
|
// u32 sp28;
|
||||||
|
// s8 sp2C = 0;
|
||||||
|
// u8 sp34 = 4;
|
||||||
|
// u16 heldItem;
|
||||||
|
// u8 r10;
|
||||||
|
// s32 r4;
|
||||||
|
// u8 field;
|
||||||
|
// u8 holdEffect;
|
||||||
|
//
|
||||||
|
// heldItem = GetMonData(pkmn, MON_DATA_HELD_ITEM, NULL);
|
||||||
|
// if (heldItem == ITEM_ENIGMA_BERRY)
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// if (gMain.inBattle)
|
||||||
|
// holdEffect = gEnigmaBerries[gBattlerInMenuId].holdEffect;
|
||||||
|
// else
|
||||||
|
// holdEffect = gSaveBlock1Ptr->enigmaBerry.holdEffect;
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// ItemId_GetHoldEffect(heldItem);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// gPotentialItemEffectBattler = gBattlerInMenuId;
|
||||||
|
// // grr. the original asm also u8 masks after loading the bitmask, despite
|
||||||
|
// // the fact that is a useless operation. what's going on here?
|
||||||
|
// if (gMain.inBattle)
|
||||||
|
// {
|
||||||
|
// gActiveBattler = gBattlerInMenuId;
|
||||||
|
// cmdIndex = (GetBattlerSide(gActiveBattler) != 0);
|
||||||
|
// while (cmdIndex < gBattlersCount)
|
||||||
|
// {
|
||||||
|
// if (gBattlerPartyIndexes[cmdIndex] == partyIndex)
|
||||||
|
// {
|
||||||
|
// sp34 = cmdIndex;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// cmdIndex += 2;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// sp34 = 4, gActiveBattler = 0;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// // _08042504
|
||||||
|
// if (!IS_POKEMON_ITEM(item))
|
||||||
|
// return TRUE;
|
||||||
|
// if (gItemEffectTable[item - 13] == NULL && item != ITEM_ENIGMA_BERRY)
|
||||||
|
// return TRUE;
|
||||||
|
//
|
||||||
|
// if (item == ITEM_ENIGMA_BERRY)
|
||||||
|
// {
|
||||||
|
// if (gMain.inBattle)
|
||||||
|
// itemEffect = gEnigmaBerries[gActiveBattler].itemEffect;
|
||||||
|
// else
|
||||||
|
// itemEffect = gSaveBlock1Ptr->enigmaBerry.itemEffect;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// itemEffect = gItemEffectTable[item - 13];
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// for (cmdIndex = 0; cmdIndex < 6; cmdIndex++)
|
||||||
|
// {
|
||||||
|
// switch (cmdIndex)
|
||||||
|
// {
|
||||||
|
// // status healing effects
|
||||||
|
// case 0:
|
||||||
|
// if ((itemEffect[cmdIndex] & 0x80)
|
||||||
|
// && gMain.inBattle && sp34 != 4 && (gBattleMons[sp34].status2 & STATUS2_INFATUATION))
|
||||||
|
// {
|
||||||
|
// //gBattleMons[sp34].status2 &= ~STATUS2_INFATUATION;
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// if ((itemEffect[cmdIndex] & 0x30)
|
||||||
|
// && !(gBattleMons[gActiveBattler].status2 & STATUS2_FOCUS_ENERGY))
|
||||||
|
// {
|
||||||
|
// //gBattleMons[gActiveBattler].status2 |= STATUS2_FOCUS_ENERGY;
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// if ((itemEffect[cmdIndex] & 0xF)
|
||||||
|
// && gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] < 12)
|
||||||
|
// {
|
||||||
|
// //gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] += itemEffect[cmdIndex] & 0xF;
|
||||||
|
// //if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] > 12)
|
||||||
|
// // gBattleMons[gActiveBattler].statStages[STAT_STAGE_ATK] = 12;
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// // in-battle stat boosting effects?
|
||||||
|
// case 1:
|
||||||
|
// if ((itemEffect[cmdIndex] & 0xF0)
|
||||||
|
// && gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] < 12)
|
||||||
|
// {
|
||||||
|
// //gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] += (itemEffect[cmdIndex] & 0xF0) >> 4;
|
||||||
|
// //if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] > 12)
|
||||||
|
// // gBattleMons[gActiveBattler].statStages[STAT_STAGE_DEF] = 12;
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// if ((itemEffect[cmdIndex] & 0xF)
|
||||||
|
// && gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] < 12)
|
||||||
|
// {
|
||||||
|
// //gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] += itemEffect[cmdIndex] & 0xF;
|
||||||
|
// //if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] > 12)
|
||||||
|
// // gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPEED] = 12;
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// // more stat boosting effects?
|
||||||
|
// case 2:
|
||||||
|
// if ((itemEffect[cmdIndex] & 0xF0)
|
||||||
|
// && gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] < 12)
|
||||||
|
// {
|
||||||
|
// //gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] += (itemEffect[cmdIndex] & 0xF0) >> 4;
|
||||||
|
// //if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] > 12)
|
||||||
|
// // gBattleMons[gActiveBattler].statStages[STAT_STAGE_ACC] = 12;
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// if ((itemEffect[cmdIndex] & 0xF)
|
||||||
|
// && gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] < 12)
|
||||||
|
// {
|
||||||
|
// //gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] += itemEffect[cmdIndex] & 0xF;
|
||||||
|
// //if (gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] > 12)
|
||||||
|
// // gBattleMons[gActiveBattler].statStages[STAT_STAGE_SPATK] = 12;
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// case 3:
|
||||||
|
// if ((itemEffect[cmdIndex] & 0x80)
|
||||||
|
// && gSideTimers[GetBattlerSide(gActiveBattler)].mistTimer == 0)
|
||||||
|
// {
|
||||||
|
// //gSideTimers[GetBattlerSide(gActiveBattler)].mistTimer = 5;
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// if ((itemEffect[cmdIndex] & 0x40) // raise level
|
||||||
|
// && GetMonData(pkmn, MON_DATA_LEVEL, NULL) != 100)
|
||||||
|
// {
|
||||||
|
// //data = gExperienceTables[gBaseStats[GetMonData(pkmn, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(pkmn, MON_DATA_LEVEL, NULL) + 1];
|
||||||
|
// //SetMonData(pkmn, MON_DATA_EXP, &data);
|
||||||
|
// //CalculateMonStats(pkmn);
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// if ((itemEffect[cmdIndex] & 0x20)
|
||||||
|
// && sub_8042BE8(pkmn, partyIndex, 7, sp34) == 0)
|
||||||
|
// {
|
||||||
|
// //if (sp34 != 4)
|
||||||
|
// // gBattleMons[sp34].status2 &= ~STATUS2_NIGHTMARE;
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// if ((itemEffect[cmdIndex] & 0x10) && sub_8042BE8(pkmn, partyIndex, 0xF88, sp34) == 0)
|
||||||
|
// retVal = FALSE;
|
||||||
|
// if ((itemEffect[cmdIndex] & 8) && sub_8042BE8(pkmn, partyIndex, 16, sp34) == 0)
|
||||||
|
// retVal = FALSE;
|
||||||
|
// if ((itemEffect[cmdIndex] & 4) && sub_8042BE8(pkmn, partyIndex, 32, sp34) == 0)
|
||||||
|
// retVal = FALSE;
|
||||||
|
// if ((itemEffect[cmdIndex] & 2) && sub_8042BE8(pkmn, partyIndex, 64, sp34) == 0)
|
||||||
|
// retVal = FALSE;
|
||||||
|
// if ((itemEffect[cmdIndex] & 1) // heal confusion
|
||||||
|
// && gMain.inBattle && sp34 != 4 && (gBattleMons[sp34].status2 & STATUS2_CONFUSION))
|
||||||
|
// {
|
||||||
|
// //gBattleMons[sp34].status2 &= ~STATUS2_CONFUSION;
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// // EV, HP, and PP raising effects
|
||||||
|
// case 4:
|
||||||
|
// r10 = itemEffect[cmdIndex];
|
||||||
|
// if (r10 & 0x20)
|
||||||
|
// {
|
||||||
|
// r10 &= ~0x20;
|
||||||
|
// data = (GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) & gUnknown_825DEA1[moveIndex]) >> (moveIndex * 2);
|
||||||
|
// sp28 = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex);
|
||||||
|
// if (data < 3 && sp28 > 4)
|
||||||
|
// {
|
||||||
|
// //data = GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) + gUnknown_825DEA9[moveIndex];
|
||||||
|
// //SetMonData(pkmn, MON_DATA_PP_BONUSES, &data);
|
||||||
|
// //
|
||||||
|
// //data = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), data, moveIndex) - sp28;
|
||||||
|
// //data = GetMonData(pkmn, MON_DATA_PP1 + moveIndex, NULL) + data;
|
||||||
|
// //SetMonData(pkmn, MON_DATA_PP1 + moveIndex, &data);
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// sp28 = 0;
|
||||||
|
// while (r10 != 0) // _080428C0
|
||||||
|
// {
|
||||||
|
// if (r10 & 1)
|
||||||
|
// {
|
||||||
|
// u16 evCount;
|
||||||
|
// u16 targetSpecies;
|
||||||
|
// s32 r5;
|
||||||
|
//
|
||||||
|
// switch (sp28)
|
||||||
|
// {
|
||||||
|
// case 0:
|
||||||
|
// case 1:
|
||||||
|
// evCount = GetMonEVCount(pkmn);
|
||||||
|
// if (evCount >= 510)
|
||||||
|
// return TRUE;
|
||||||
|
// data = GetMonData(pkmn, sGetMonDataEVConstants[sp28], NULL);
|
||||||
|
// if (data < 100)
|
||||||
|
// {
|
||||||
|
// //if (data + itemEffect[sp24] > 100)
|
||||||
|
// // r4 = 100 - (data + itemEffect[sp24]) + itemEffect[sp24];
|
||||||
|
// //else
|
||||||
|
// // r4 = itemEffect[sp24];
|
||||||
|
// //if (evCount + r4 > 510)
|
||||||
|
// // r4 += 510 - (evCount + r4);
|
||||||
|
// //data += r4;
|
||||||
|
// //SetMonData(pkmn, sGetMonDataEVConstants[sp28], &data);
|
||||||
|
// //CalculateMonStats(pkmn);
|
||||||
|
// sp24++;
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// case 2:
|
||||||
|
// // revive?
|
||||||
|
// if (r10 & 0x10)
|
||||||
|
// {
|
||||||
|
// if (GetMonData(pkmn, MON_DATA_HP, NULL) != 0)
|
||||||
|
// {
|
||||||
|
// sp24++;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// /*
|
||||||
|
// if (gMain.inBattle)
|
||||||
|
// {
|
||||||
|
// if (sp34 != 4)
|
||||||
|
// {
|
||||||
|
// gAbsentBattlerFlags &= ~gBitTable[sp34];
|
||||||
|
// CopyPlayerPartyMonToBattleData(sp34, pokemon_order_func(gBattlerPartyIndexes[sp34]));
|
||||||
|
// if (GetBattlerSide(gActiveBattler) == 0 && gBattleResults.unk4 < 255)
|
||||||
|
// gBattleResults.unk4++;
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// gAbsentBattlerFlags &= ~gBitTable[gActiveBattler ^ 2];
|
||||||
|
// if (GetBattlerSide(gActiveBattler) == 0 && gBattleResults.unk4 < 255)
|
||||||
|
// gBattleResults.unk4++;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// if (GetMonData(pkmn, MON_DATA_HP, NULL) == 0)
|
||||||
|
// {
|
||||||
|
// sp24++;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// /*
|
||||||
|
// data = itemEffect[sp24++];
|
||||||
|
// switch (data)
|
||||||
|
// {
|
||||||
|
// case 0xFF:
|
||||||
|
// data = GetMonData(pkmn, MON_DATA_MAX_HP, NULL) - GetMonData(pkmn, MON_DATA_HP, NULL);
|
||||||
|
// break;
|
||||||
|
// case 0xFE:
|
||||||
|
// data = GetMonData(pkmn, MON_DATA_MAX_HP, NULL) / 2;
|
||||||
|
// if (data == 0)
|
||||||
|
// data = 1;
|
||||||
|
// break;
|
||||||
|
// case 0xFD:
|
||||||
|
// data = gBattleScripting.field_23;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// */
|
||||||
|
// if (GetMonData(pkmn, MON_DATA_MAX_HP, NULL) != GetMonData(pkmn, MON_DATA_HP, NULL))
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// if (e == 0)
|
||||||
|
// {
|
||||||
|
// data = GetMonData(pkmn, MON_DATA_HP, NULL) + data;
|
||||||
|
// if (data > GetMonData(pkmn, MON_DATA_MAX_HP, NULL))
|
||||||
|
// data = GetMonData(pkmn, MON_DATA_MAX_HP, NULL);
|
||||||
|
// SetMonData(pkmn, MON_DATA_HP, &data);
|
||||||
|
// if (gMain.inBattle && sp34 != 4)
|
||||||
|
// {
|
||||||
|
// gBattleMons[sp34].hp = data;
|
||||||
|
// if (!(r10 & 0x10) && GetBattlerSide(gActiveBattler) == 0)
|
||||||
|
// {
|
||||||
|
// if (gBattleResults.unk3 < 255)
|
||||||
|
// gBattleResults.unk3++;
|
||||||
|
// // I have to re-use this variable to match.
|
||||||
|
// r5 = gActiveBattler;
|
||||||
|
// gActiveBattler = sp34;
|
||||||
|
// BtlController_EmitGetMonData(0, 0, 0);
|
||||||
|
// MarkBufferBankForExecution(gActiveBattler);
|
||||||
|
// gActiveBattler = r5;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// gBattleMoveDamage = -data;
|
||||||
|
// }
|
||||||
|
// */
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// sp24++;
|
||||||
|
// r10 &= 0xEF;
|
||||||
|
// break;
|
||||||
|
// case 3:
|
||||||
|
// if (!(r10 & 2))
|
||||||
|
// {
|
||||||
|
// for (r5 = 0; r5 < 4; r5++)
|
||||||
|
// {
|
||||||
|
// u16 r4;
|
||||||
|
//
|
||||||
|
// data = GetMonData(pkmn, MON_DATA_PP1 + r5, NULL);
|
||||||
|
// r4 = GetMonData(pkmn, MON_DATA_MOVE1 + r5, NULL);
|
||||||
|
// if (data != CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), r5))
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// data += itemEffect[sp24];
|
||||||
|
// r4 = GetMonData(pkmn, MON_DATA_MOVE1 + r5, NULL);
|
||||||
|
// if (data > CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), r5))
|
||||||
|
// {
|
||||||
|
// r4 = GetMonData(pkmn, MON_DATA_MOVE1 + r5, NULL);
|
||||||
|
// data = CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), r5);
|
||||||
|
// }
|
||||||
|
// SetMonData(pkmn, MON_DATA_PP1 + r5, &data);
|
||||||
|
// if (gMain.inBattle
|
||||||
|
// && sp34 != 4 && !(gBattleMons[sp34].status2 & 0x200000)
|
||||||
|
// && !(gDisableStructs[sp34].unk18_b & gBitTable[r5]))
|
||||||
|
// gBattleMons[sp34].pp[r5] = data;
|
||||||
|
// */
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// else // _080429FA
|
||||||
|
// {
|
||||||
|
// u16 r4;
|
||||||
|
//
|
||||||
|
// data = GetMonData(pkmn, MON_DATA_PP1 + moveIndex, NULL);
|
||||||
|
// r4 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL);
|
||||||
|
// if (data != CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex))
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// data += itemEffect[sp24++];
|
||||||
|
// r4 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL);
|
||||||
|
// if (data > CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex))
|
||||||
|
// {
|
||||||
|
// r4 = GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL);
|
||||||
|
// data = CalculatePPWithBonus(r4, GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex);
|
||||||
|
// }
|
||||||
|
// SetMonData(pkmn, MON_DATA_PP1 + moveIndex, &data);
|
||||||
|
// if (gMain.inBattle
|
||||||
|
// && sp34 != 4 && !(gBattleMons[sp34].status2 & 0x200000)
|
||||||
|
// && !(gDisableStructs[sp34].unk18_b & gBitTable[moveIndex]))
|
||||||
|
// gBattleMons[sp34].pp[moveIndex] = data;
|
||||||
|
// */
|
||||||
|
// sp24++;
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// case 7:
|
||||||
|
// {
|
||||||
|
// targetSpecies = GetEvolutionTargetSpecies(pkmn, 2, item);
|
||||||
|
//
|
||||||
|
// if (targetSpecies != SPECIES_NONE)
|
||||||
|
// {
|
||||||
|
// //BeginEvolutionScene(pkmn, targetSpecies, 0, partyIndex);
|
||||||
|
// return FALSE;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// sp28++;
|
||||||
|
// r10 >>= 1;
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// case 5:
|
||||||
|
// r10 = itemEffect[cmdIndex];
|
||||||
|
// sp28 = 0;
|
||||||
|
// while (r10 != 0)
|
||||||
|
// {
|
||||||
|
// if (r10 & 1)
|
||||||
|
// {
|
||||||
|
// u16 evCount;
|
||||||
|
//
|
||||||
|
// switch (sp28)
|
||||||
|
// {
|
||||||
|
// case 0:
|
||||||
|
// case 1:
|
||||||
|
// case 2:
|
||||||
|
// case 3:
|
||||||
|
// evCount = GetMonEVCount(pkmn);
|
||||||
|
// if (evCount >= 510)
|
||||||
|
// return TRUE;
|
||||||
|
// data = GetMonData(pkmn, sGetMonDataEVConstants[sp28 + 2], NULL);
|
||||||
|
// if (data < 100)
|
||||||
|
// {
|
||||||
|
// /*
|
||||||
|
// if (data + itemEffect[sp24] > 100)
|
||||||
|
// r4 = 100 - (data + itemEffect[sp24]) + itemEffect[sp24];
|
||||||
|
// else
|
||||||
|
// r4 = itemEffect[sp24];
|
||||||
|
// if (evCount + r4 > 510)
|
||||||
|
// r4 += 510 - (evCount + r4);
|
||||||
|
// data += r4;
|
||||||
|
// SetMonData(pkmn, sGetMonDataEVConstants[sp28 + 2], &data);
|
||||||
|
// CalculateMonStats(pkmn);
|
||||||
|
// */
|
||||||
|
// retVal = FALSE;
|
||||||
|
// sp24++;
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// case 4:
|
||||||
|
// data = (GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL) & gUnknown_825DEA1[moveIndex]) >> (moveIndex * 2);
|
||||||
|
// r4 = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL), moveIndex);
|
||||||
|
// if (data < 3)
|
||||||
|
// {
|
||||||
|
// if(r4 <= 4)
|
||||||
|
// break;
|
||||||
|
// /*
|
||||||
|
//
|
||||||
|
// data = GetMonData(pkmn, MON_DATA_PP_BONUSES, NULL);
|
||||||
|
// data &= gPPUpWriteMasks[moveIndex];
|
||||||
|
// data += gUnknown_825DEA9[moveIndex] * 3;
|
||||||
|
//
|
||||||
|
// SetMonData(pkmn, MON_DATA_PP_BONUSES, &data);
|
||||||
|
// data = CalculatePPWithBonus(GetMonData(pkmn, MON_DATA_MOVE1 + moveIndex, NULL), data, moveIndex) - r4;
|
||||||
|
// data = GetMonData(pkmn, MON_DATA_PP1 + moveIndex, NULL) + data;
|
||||||
|
// SetMonData(pkmn, MON_DATA_PP1 + moveIndex, &data);
|
||||||
|
// */
|
||||||
|
// retVal = FALSE;
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// case 5:
|
||||||
|
// if (GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL) < 100 && retVal == 0 && sp2C == 0)
|
||||||
|
// {
|
||||||
|
// sp2C = itemEffect[sp24];
|
||||||
|
// /*
|
||||||
|
// friendship = GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL);
|
||||||
|
// if (sp2C > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP)
|
||||||
|
// friendship += 150 * sp2C / 100;
|
||||||
|
// else
|
||||||
|
// friendship += sp2C;
|
||||||
|
// if (sp2C > 0)
|
||||||
|
// {
|
||||||
|
// if (GetMonData(pkmn, MON_DATA_POKEBALL, NULL) == 11)
|
||||||
|
// friendship++;
|
||||||
|
// if (GetMonData(pkmn, MON_DATA_MET_LOCATION, NULL) == sav1_map_get_name())
|
||||||
|
// friendship++;
|
||||||
|
// }
|
||||||
|
// if (friendship < 0)
|
||||||
|
// friendship = 0;
|
||||||
|
// if (friendship > 255)
|
||||||
|
// friendship = 255;
|
||||||
|
// SetMonData(pkmn, MON_DATA_FRIENDSHIP, &friendship);
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
// sp24++;
|
||||||
|
// break;
|
||||||
|
// case 6:
|
||||||
|
// if (GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL) >= 100 && GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL) < 200
|
||||||
|
// && retVal == 0 && sp2C == 0)
|
||||||
|
// {
|
||||||
|
// sp2C = itemEffect[sp24];
|
||||||
|
// /*
|
||||||
|
// friendship = GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL);
|
||||||
|
// if (sp2C > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP)
|
||||||
|
// friendship += 150 * sp2C / 100;
|
||||||
|
// else
|
||||||
|
// friendship += sp2C;
|
||||||
|
// if (sp2C > 0)
|
||||||
|
// {
|
||||||
|
// if (GetMonData(pkmn, MON_DATA_POKEBALL, NULL) == 11)
|
||||||
|
// friendship++;
|
||||||
|
// if (GetMonData(pkmn, MON_DATA_MET_LOCATION, NULL) == sav1_map_get_name())
|
||||||
|
// friendship++;
|
||||||
|
// }
|
||||||
|
// if (friendship < 0)
|
||||||
|
// friendship = 0;
|
||||||
|
// if (friendship > 255)
|
||||||
|
// friendship = 255;
|
||||||
|
// SetMonData(pkmn, MON_DATA_FRIENDSHIP, &friendship);
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
// sp24++;
|
||||||
|
// break;
|
||||||
|
// case 7:
|
||||||
|
// if (GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL) >= 200 && retVal == 0 && sp2C == 0)
|
||||||
|
// {
|
||||||
|
// sp2C = itemEffect[sp24];
|
||||||
|
// /*
|
||||||
|
// friendship = GetMonData(pkmn, MON_DATA_FRIENDSHIP, NULL);
|
||||||
|
// if (sp2C > 0 && holdEffect == HOLD_EFFECT_HAPPINESS_UP)
|
||||||
|
// friendship += 150 * sp2C / 100;
|
||||||
|
// else
|
||||||
|
// friendship += sp2C;
|
||||||
|
// if (sp2C > 0)
|
||||||
|
// {
|
||||||
|
// if (GetMonData(pkmn, MON_DATA_POKEBALL, NULL) == 11)
|
||||||
|
// friendship++;
|
||||||
|
// if (GetMonData(pkmn, MON_DATA_MET_LOCATION, NULL) == sav1_map_get_name())
|
||||||
|
// friendship++;
|
||||||
|
// }
|
||||||
|
// if (friendship < 0)
|
||||||
|
// friendship = 0;
|
||||||
|
// if (friendship > 255)
|
||||||
|
// friendship = 255;
|
||||||
|
// SetMonData(pkmn, MON_DATA_FRIENDSHIP, &friendship);
|
||||||
|
// */
|
||||||
|
// }
|
||||||
|
// sp24++;
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// sp28++;
|
||||||
|
// r10 >>= 1;
|
||||||
|
// }
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// return retVal;
|
||||||
|
//}
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user