mirror of
https://github.com/pret/pokefirered.git
synced 2026-05-09 12:35:23 -05:00
updated up to Cmd_resetsentmonsvalue
This commit is contained in:
parent
09a32a59f3
commit
d1d0baad3f
|
|
@ -797,6 +797,7 @@ u16 GetFormChangeTargetSpeciesBoxMon(struct BoxPokemon *boxMon, u16 method, u32
|
|||
bool32 DoesSpeciesHaveFormChangeMethod(u16 species, u16 method);
|
||||
void TryToSetBattleFormChangeMoves(struct Pokemon *mon, u16 method);
|
||||
bool8 IsMonPastEvolutionLevel(struct Pokemon *mon);
|
||||
bool32 IsPersonalityFemale(u16 species, u32 personality);
|
||||
|
||||
|
||||
bool8 HealStatusConditions(struct Pokemon *mon, u32 healMask, u8 battleId);
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ extern const struct SpritePalette gMonIconPaletteTable[];
|
|||
extern const u16 gMonIconPalettes[][16];
|
||||
// extern const u8 gMonIconPaletteIndices[];
|
||||
|
||||
const u8 *GetMonIconPtr(u16 speciesId, u32 personality, u32 frameNo);
|
||||
const u8 *GetMonIconPtr(u16 speciesId, u32 personality);
|
||||
const u8 *GetMonIconTiles(u16 iconSpecies, bool32 extra);
|
||||
const u16 *GetValidMonIconPalettePtr(u16 speciesId);
|
||||
void LoadMonIconPalettes(void);
|
||||
|
|
|
|||
|
|
@ -699,9 +699,9 @@ void (* const gBattleScriptingCommandsTable[])(void) =
|
|||
Cmd_cancelallactions, //0x68 // done
|
||||
Cmd_setgravity, //0x69 // done
|
||||
Cmd_removeitem, //0x6A // done
|
||||
Cmd_atknameinbuff1, //0x6B
|
||||
Cmd_drawlvlupbox, //0x6C
|
||||
Cmd_resetsentmonsvalue, //0x6D
|
||||
Cmd_atknameinbuff1, //0x6B // done
|
||||
Cmd_drawlvlupbox, //0x6C // done
|
||||
Cmd_resetsentmonsvalue, //0x6D // done
|
||||
Cmd_setatktoplayer0, //0x6E
|
||||
Cmd_makevisible, //0x6F
|
||||
Cmd_recordability, //0x70 // done
|
||||
|
|
@ -8233,13 +8233,17 @@ static void Cmd_removeitem(void)
|
|||
|
||||
static void Cmd_atknameinbuff1(void)
|
||||
{
|
||||
PREPARE_MON_NICK_BUFFER(gBattleTextBuff1, gBattlerAttacker, gBattlerPartyIndexes[gBattlerAttacker])
|
||||
CMD_ARGS();
|
||||
|
||||
gBattlescriptCurrInstr++;
|
||||
PREPARE_MON_NICK_BUFFER(gBattleTextBuff1, gBattlerAttacker, gBattlerPartyIndexes[gBattlerAttacker]);
|
||||
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_drawlvlupbox(void)
|
||||
{
|
||||
CMD_ARGS();
|
||||
|
||||
if (gBattleScripting.drawlvlupboxState == 0)
|
||||
{
|
||||
// If the Pokémon getting exp is not in-battle then
|
||||
|
|
@ -8333,7 +8337,7 @@ static void Cmd_drawlvlupbox(void)
|
|||
SetBgAttribute(1, BG_ATTR_PRIORITY, 1);
|
||||
ShowBg(0);
|
||||
ShowBg(1);
|
||||
gBattlescriptCurrInstr++;
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -8388,15 +8392,14 @@ static bool8 SlideInLevelUpBanner(void)
|
|||
|
||||
static void DrawLevelUpBannerText(void)
|
||||
{
|
||||
u16 monLevel;
|
||||
u8 monGender;
|
||||
struct TextPrinterTemplate printerTemplate;
|
||||
u8 *txtPtr;
|
||||
u8 *txtPtr2;
|
||||
u32 var;
|
||||
|
||||
monLevel = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_LEVEL);
|
||||
monGender = GetMonGender(&gPlayerParty[gBattleStruct->expGetterMonId]);
|
||||
GetMonNickname(&gPlayerParty[gBattleStruct->expGetterMonId], gStringVar4);
|
||||
struct Pokemon *mon = &gPlayerParty[gBattleStruct->expGetterMonId];
|
||||
u32 monLevel = GetMonData(mon, MON_DATA_LEVEL);
|
||||
u8 monGender = GetMonGender(mon);
|
||||
GetMonNickname(mon, gStringVar4);
|
||||
|
||||
printerTemplate.currentChar = gStringVar4;
|
||||
printerTemplate.windowId = B_WIN_LEVEL_UP_BANNER;
|
||||
|
|
@ -8415,13 +8418,14 @@ static void DrawLevelUpBannerText(void)
|
|||
AddTextPrinter(&printerTemplate, TEXT_SKIP_DRAW, NULL);
|
||||
|
||||
txtPtr = gStringVar4;
|
||||
gStringVar4[0] = CHAR_EXTRA_SYMBOL;
|
||||
*++txtPtr = CHAR_LV_2;
|
||||
*++txtPtr = 0;
|
||||
txtPtr2 = txtPtr + 1;
|
||||
txtPtr = ConvertIntToDecimalStringN(++txtPtr, monLevel, STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||
txtPtr = StringFill(txtPtr, 0, 5);
|
||||
txtPtr = txtPtr2 + 4;
|
||||
*(txtPtr)++ = CHAR_EXTRA_SYMBOL;
|
||||
*(txtPtr)++ = CHAR_LV_2;
|
||||
|
||||
var = (u32)(txtPtr);
|
||||
txtPtr = ConvertIntToDecimalStringN(txtPtr, monLevel, STR_CONV_MODE_LEFT_ALIGN, 3);
|
||||
var = (u32)(txtPtr) - var;
|
||||
txtPtr = StringFill(txtPtr, CHAR_SPACER, 4 - var);
|
||||
|
||||
if (monGender != MON_GENDERLESS)
|
||||
{
|
||||
if (monGender == MON_MALE)
|
||||
|
|
@ -8465,20 +8469,18 @@ static bool8 SlideOutLevelUpBanner(void)
|
|||
static void PutMonIconOnLvlUpBanner(void)
|
||||
{
|
||||
u8 spriteId;
|
||||
const u16 *iconPal;
|
||||
struct SpriteSheet iconSheet;
|
||||
struct SpritePalette iconPalSheet;
|
||||
|
||||
u16 species = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_SPECIES);
|
||||
u32 personality = GetMonData(&gPlayerParty[gBattleStruct->expGetterMonId], MON_DATA_PERSONALITY);
|
||||
struct Pokemon *mon = &gPlayerParty[gBattleStruct->expGetterMonId];
|
||||
u32 species = GetMonData(mon, MON_DATA_SPECIES);
|
||||
u32 personality = GetMonData(mon, MON_DATA_PERSONALITY);
|
||||
|
||||
const u8 *iconPtr = GetMonIconPtr(species, personality, 1);
|
||||
iconSheet.data = iconPtr;
|
||||
iconSheet.data = GetMonIconPtr(species, personality);
|
||||
iconSheet.size = 0x200;
|
||||
iconSheet.tag = TAG_LVLUP_BANNER_MON_ICON;
|
||||
|
||||
iconPal = GetValidMonIconPalettePtr(species);
|
||||
iconPalSheet.data = iconPal;
|
||||
iconPalSheet.data = GetValidMonIconPalettePtr(species);
|
||||
iconPalSheet.tag = TAG_LVLUP_BANNER_MON_ICON;
|
||||
|
||||
LoadSpriteSheet(&iconSheet);
|
||||
|
|
@ -8489,7 +8491,7 @@ static void PutMonIconOnLvlUpBanner(void)
|
|||
gSprites[spriteId].sXOffset = gBattle_BG2_X;
|
||||
}
|
||||
|
||||
static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite* sprite)
|
||||
static void SpriteCB_MonIconOnLvlUpBanner(struct Sprite *sprite)
|
||||
{
|
||||
sprite->x2 = sprite->sXOffset - gBattle_BG2_X;
|
||||
|
||||
|
|
@ -8520,8 +8522,10 @@ bool32 IsMonGettingExpSentOut(void)
|
|||
|
||||
static void Cmd_resetsentmonsvalue(void)
|
||||
{
|
||||
CMD_ARGS();
|
||||
|
||||
ResetSentPokesToOpponentValue();
|
||||
gBattlescriptCurrInstr++;
|
||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||
}
|
||||
|
||||
static void Cmd_setatktoplayer0(void)
|
||||
|
|
|
|||
|
|
@ -733,7 +733,7 @@ void ListMenu_LoadMonIconPalette(u8 palOffset, u16 speciesId)
|
|||
|
||||
void ListMenu_DrawMonIconGraphics(u8 windowId, u16 speciesId, u32 personality, u16 x, u16 y)
|
||||
{
|
||||
BlitBitmapToWindow(windowId, GetMonIconPtr(speciesId, personality, 1), x, y, 32, 32);
|
||||
BlitBitmapToWindow(windowId, GetMonIconPtr(speciesId, personality), x, y, 32, 32);
|
||||
}
|
||||
|
||||
void ListMenuLoadStdPalAt(u8 palOffset, u8 palId)
|
||||
|
|
|
|||
|
|
@ -6398,3 +6398,8 @@ bool8 IsMonPastEvolutionLevel(struct Pokemon *mon)
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
bool32 IsPersonalityFemale(u16 species, u32 personality)
|
||||
{
|
||||
return GetGenderFromSpeciesAndPersonality(species, personality) == MON_FEMALE;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1018,7 +1018,7 @@ u8 CreateMonIcon(u16 species, SpriteCallback callback, s16 x, s16 y, u8 subprior
|
|||
struct MonIconSpriteTemplate iconTemplate =
|
||||
{
|
||||
.oam = &sMonIconOamData,
|
||||
.image = GetMonIconPtr(species, personality, extra),
|
||||
.image = GetMonIconPtr(species, personality),
|
||||
.anims = sMonIconAnims,
|
||||
.affineAnims = sMonIconAffineAnims,
|
||||
.callback = callback,
|
||||
|
|
@ -1048,7 +1048,7 @@ u8 CreateMonIcon_HandleDeoxys(u16 species, SpriteCallback callback, s16 x, s16 y
|
|||
.paletteTag = POKE_ICON_BASE_PAL_TAG + gSpeciesInfo[species].iconPalIndex,
|
||||
};
|
||||
|
||||
iconTemplate.image = GetMonIconTiles(species, extra);
|
||||
iconTemplate.image = GetMonIconTiles(species, 0);
|
||||
spriteId = CreateMonIconSprite(&iconTemplate, x, y, subpriority);
|
||||
|
||||
UpdateMonIconFrame(&gSprites[spriteId]);
|
||||
|
|
@ -1108,17 +1108,26 @@ u16 MailSpeciesToIconSpecies(u16 species)
|
|||
}
|
||||
}
|
||||
|
||||
const u8 *GetMonIconTiles(u16 species, bool32 extra)
|
||||
const u8 *GetMonIconTiles(u16 species, u32 personality)
|
||||
{
|
||||
const u8 *iconSprite = gSpeciesInfo[species].iconSprite;
|
||||
if (species == SPECIES_DEOXYS && extra == TRUE)
|
||||
iconSprite += 0x400;
|
||||
const u8 *iconSprite;
|
||||
|
||||
if (species > NUM_SPECIES)
|
||||
species = SPECIES_NONE;
|
||||
|
||||
if (gSpeciesInfo[species].iconSpriteFemale != NULL && IsPersonalityFemale(species, personality))
|
||||
iconSprite = gSpeciesInfo[species].iconSpriteFemale;
|
||||
else if (gSpeciesInfo[species].iconSprite != NULL)
|
||||
iconSprite = gSpeciesInfo[species].iconSprite;
|
||||
else
|
||||
iconSprite = gSpeciesInfo[SPECIES_NONE].iconSprite;
|
||||
|
||||
return iconSprite;
|
||||
}
|
||||
|
||||
const u8 *GetMonIconPtr(u16 species, u32 personality, bool32 extra)
|
||||
const u8 *GetMonIconPtr(u16 species, u32 personality)
|
||||
{
|
||||
return GetMonIconTiles(GetIconSpecies(species, personality), extra);
|
||||
return GetMonIconTiles(GetIconSpecies(species, personality), personality);
|
||||
}
|
||||
|
||||
void DestroyMonIcon(struct Sprite *sprite)
|
||||
|
|
|
|||
|
|
@ -938,7 +938,7 @@ static void SpriteCB_HeldMon(struct Sprite *sprite)
|
|||
sprite->y = gStorage->cursorSprite->y + gStorage->cursorSprite->y2 + 4;
|
||||
}
|
||||
|
||||
static u16 TryLoadMonIconTiles(u16 species)
|
||||
static u16 TryLoadMonIconTiles(u16 species, u32 personality)
|
||||
{
|
||||
u16 i, offset;
|
||||
|
||||
|
|
@ -964,7 +964,7 @@ static u16 TryLoadMonIconTiles(u16 species)
|
|||
gStorage->iconSpeciesList[i] = species;
|
||||
gStorage->numIconsPerSpecies[i]++;
|
||||
offset = 16 * i;
|
||||
CpuCopy32(GetMonIconTiles(species, TRUE), (void *)(OBJ_VRAM0) + offset * 32, 0x200);
|
||||
CpuCopy32(GetMonIconTiles(species, personality), (void *)(OBJ_VRAM0) + offset * 32, 0x200);
|
||||
|
||||
return offset;
|
||||
}
|
||||
|
|
@ -992,7 +992,7 @@ struct Sprite *CreateMonIconSprite(u16 species, u32 personality, s16 x, s16 y, u
|
|||
|
||||
species = GetIconSpecies(species, personality);
|
||||
template.paletteTag = PALTAG_MON_ICON_0 + gSpeciesInfo[species].iconPalIndex;
|
||||
tileNum = TryLoadMonIconTiles(species);
|
||||
tileNum = TryLoadMonIconTiles(species, personality);
|
||||
if (tileNum == 0xFFFF)
|
||||
return NULL;
|
||||
|
||||
|
|
|
|||
|
|
@ -405,7 +405,7 @@ static void MultiMove_SetIconToBg(u8 x, u8 y)
|
|||
|
||||
if (species != SPECIES_NONE)
|
||||
{
|
||||
const u8 *iconGfx = GetMonIconPtr(species, personality, 1);
|
||||
const u8 *iconGfx = GetMonIconPtr(species, personality);
|
||||
u8 palNum = GetValidMonIconPalIndex(species) + 8;
|
||||
BlitBitmapRectToWindow4BitTo8Bit(gStorage->multiMoveWindowId, iconGfx, 0, 0, 32, 32, 24 * x, 24 * y, 32, 32, palNum);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user