Advertisement
Guest User

Untitled

a guest
Feb 16th, 2022
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 2.23 KB | None | 0 0
  1.     case MENU_STATE_TRY_OVERWRITE_MOVE:
  2.         if (!gPaletteFade.active)
  3.         {
  4.             if (sMoveRelearnerStruct->moveSlot == MAX_MON_MOVES)
  5.             {
  6.                 sMoveRelearnerStruct->state = MENU_STATE_PRINT_STOP_TEACHING;
  7.             }
  8.             else
  9.             {
  10.                 u16 moveId = GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_MOVE1 + sMoveRelearnerStruct->moveSlot);
  11.                 u8 oldPP;
  12.  
  13.                 if (FlagGet(FLAG_PARTY_MOVES))
  14.                 {
  15.                     StringCopy(gStringVar3, gMoveNames[moveId]);
  16.                     RemoveMonPPBonus(&gPlayerParty[sMoveRelearnerStruct->partyMon], sMoveRelearnerStruct->moveSlot);
  17.                     oldPP = GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_PP1 + GetMoveSlotToReplace(), NULL);
  18.                     SetMonMoveSlot(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove(), sMoveRelearnerStruct->moveSlot);
  19.                     if (GetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_PP1 + GetMoveSlotToReplace(), NULL) > oldPP)
  20.                         SetMonData(&gPlayerParty[sMoveRelearnerStruct->partyMon], MON_DATA_PP1 + GetMoveSlotToReplace(), &oldPP);
  21.                     StringCopy(gStringVar2, gMoveNames[GetCurrentSelectedMove()]);
  22.                     FormatAndPrintText(gText_MoveRelearnerAndPoof);
  23.                     sMoveRelearnerStruct->state = MENU_STATE_DOUBLE_FANFARE_FORGOT_MOVE;
  24.                     gSpecialVar_0x8004 = TRUE;
  25.                 }
  26.                 else
  27.                 {
  28.                     StringCopy(gStringVar3, gMoveNames[moveId]);
  29.                     RemoveMonPPBonus(&gPlayerParty[sMoveRelearnerStruct->partyMon], sMoveRelearnerStruct->moveSlot);
  30.                     SetMonMoveSlot(&gPlayerParty[sMoveRelearnerStruct->partyMon], GetCurrentSelectedMove(), sMoveRelearnerStruct->moveSlot);
  31.                     StringCopy(gStringVar2, gMoveNames[GetCurrentSelectedMove()]);
  32.                     FormatAndPrintText(gText_MoveRelearnerAndPoof);
  33.                     sMoveRelearnerStruct->state = MENU_STATE_DOUBLE_FANFARE_FORGOT_MOVE;
  34.                     gSpecialVar_0x8004 = TRUE;
  35.                 }
  36.             }
  37.         }
  38.         break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement