Merge remote-tracking branch '_pret_origin/master' into _RHH/pr/master/pret_20240526

# Conflicts:
#	src/battle_anim_poison.c
#	src/pokemon.c
#	src/pokemon_icon.c
This commit is contained in:
Eduardo Quezada 2024-05-26 18:34:26 -04:00
commit 9e72271c8e
11 changed files with 105 additions and 100 deletions

View file

@ -53,6 +53,9 @@ SafariZone_EventScript_ChoosePokeblock::
special OpenPokeblockCaseOnFeeder special OpenPokeblockCaseOnFeeder
waitstate waitstate
goto_if_ne VAR_RESULT, 0xFFFF, SafariZone_EventScript_PokeblockPlaced goto_if_ne VAR_RESULT, 0xFFFF, SafariZone_EventScript_PokeblockPlaced
#ifdef BUGFIX
releaseall @ Only gets called from EventScript_PokeBlockFeeder which uses lockall.
#endif
end end
SafariZone_EventScript_PokeblockPlaced:: SafariZone_EventScript_PokeblockPlaced::

View file

@ -1,6 +1,6 @@
JASC-PAL JASC-PAL
0100 0100
48 96
123 131 0 123 131 0
255 255 255 255 255 255
222 222 222 222 222 222
@ -49,3 +49,51 @@ JASC-PAL
49 139 255 49 139 255
189 156 90 189 156 90
0 0 0 0 0 0
123 131 0
255 255 255
255 238 0
255 189 0
255 115 0
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
255 0 189
49 213 74
24 131 32
189 156 90
0 0 0
123 131 0
255 255 255
197 32 32
189 189 189
164 164 164
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
189 0 0
74 148 180
8 90 131
189 156 90
0 0 0
123 131 0
255 255 255
197 32 32
189 189 189
164 164 164
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
255 0 189
180 205 246
49 139 255
189 156 90
0 0 0

View file

@ -1,51 +0,0 @@
JASC-PAL
0100
48
123 131 0
255 255 255
255 238 0
255 189 0
255 115 0
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
255 0 189
49 213 74
24 131 32
189 156 90
0 0 0
123 131 0
255 255 255
197 32 32
189 189 189
164 164 164
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
189 0 0
74 148 180
8 90 131
189 156 90
0 0 0
123 131 0
255 255 255
197 32 32
189 189 189
164 164 164
98 98 115
41 57 65
41 57 106
0 0 41
255 255 255
238 246 57
255 0 189
180 205 246
49 139 255
189 156 90
0 0 0

View file

@ -0,0 +1,6 @@
#ifndef GUARD_CONSTANTS_POKEMON_ICON_H
#define GUARD_CONSTANTS_POKEMON_ICON_H
#define POKE_ICON_BASE_PAL_TAG 56000
#endif // GUARD_CONSTANTS_POKEMON_ICON_H

View file

@ -3950,7 +3950,7 @@ const struct SpriteTemplate gAppleAcidDripTemplate =
.tileTag = ANIM_TAG_POISON_BUBBLE, .tileTag = ANIM_TAG_POISON_BUBBLE,
.paletteTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_BUBBLE,
.oam = &gOamData_AffineDouble_ObjNormal_16x16, .oam = &gOamData_AffineDouble_ObjNormal_16x16,
.anims = gAnims_AcidPoisonDroplet, .anims = &gAnims_PoisonProjectile[1],
.images = NULL, .images = NULL,
.affineAnims = gAffineAnims_Droplet, .affineAnims = gAffineAnims_Droplet,
.callback = SpriteCB_AcidDripSingleTarget .callback = SpriteCB_AcidDripSingleTarget

View file

@ -62,15 +62,7 @@ static const union AnimCmd sAnim_SludgeBombHit[] =
const union AnimCmd *const gAnims_PoisonProjectile[] = const union AnimCmd *const gAnims_PoisonProjectile[] =
{ {
sAnim_PoisonProjectile, sAnim_PoisonProjectile,
};
const union AnimCmd *const gAnims_AcidPoisonDroplet[] =
{
sAnim_AcidPoisonDroplet, sAnim_AcidPoisonDroplet,
};
static const union AnimCmd *const sAnims_SludgeBombHit[] =
{
sAnim_SludgeBombHit, sAnim_SludgeBombHit,
}; };
@ -125,7 +117,7 @@ const struct SpriteTemplate gSludgeBombHitParticleSpriteTemplate =
.tileTag = ANIM_TAG_POISON_BUBBLE, .tileTag = ANIM_TAG_POISON_BUBBLE,
.paletteTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_BUBBLE,
.oam = &gOamData_AffineNormal_ObjNormal_16x16, .oam = &gOamData_AffineNormal_ObjNormal_16x16,
.anims = sAnims_SludgeBombHit, .anims = &gAnims_PoisonProjectile[2],
.images = NULL, .images = NULL,
.affineAnims = sAffineAnims_SludgeBombHit, .affineAnims = sAffineAnims_SludgeBombHit,
.callback = AnimSludgeBombHitParticle, .callback = AnimSludgeBombHitParticle,
@ -148,7 +140,7 @@ const struct SpriteTemplate gAcidPoisonDropletSpriteTemplate =
.tileTag = ANIM_TAG_POISON_BUBBLE, .tileTag = ANIM_TAG_POISON_BUBBLE,
.paletteTag = ANIM_TAG_POISON_BUBBLE, .paletteTag = ANIM_TAG_POISON_BUBBLE,
.oam = &gOamData_AffineDouble_ObjNormal_16x16, .oam = &gOamData_AffineDouble_ObjNormal_16x16,
.anims = gAnims_AcidPoisonDroplet, .anims = &gAnims_PoisonProjectile[1],
.images = NULL, .images = NULL,
.affineAnims = gAffineAnims_Droplet, .affineAnims = gAffineAnims_Droplet,
.callback = AnimAcidPoisonDroplet, .callback = AnimAcidPoisonDroplet,
@ -193,7 +185,7 @@ const struct SpriteTemplate gGreenPoisonDrip =
.tileTag = ANIM_TAG_GREEN_POISON_BUBBLE, .tileTag = ANIM_TAG_GREEN_POISON_BUBBLE,
.paletteTag = ANIM_TAG_GREEN_POISON_BUBBLE, .paletteTag = ANIM_TAG_GREEN_POISON_BUBBLE,
.oam = &gOamData_AffineDouble_ObjNormal_16x16, .oam = &gOamData_AffineDouble_ObjNormal_16x16,
.anims = gAnims_AcidPoisonDroplet, .anims = &gAnims_PoisonProjectile[1],
.images = NULL, .images = NULL,
.affineAnims = gAffineAnims_Droplet, .affineAnims = gAffineAnims_Droplet,
.callback = AnimAcidPoisonDroplet, .callback = AnimAcidPoisonDroplet,

View file

@ -1733,7 +1733,6 @@ const u16 gFrontierPassMedalsGold_Pal[] = INCBIN_U16("graphics/frontier_pass/gol
// Pokédex // Pokédex
const u16 gPokedexBgHoenn_Pal[] = INCBIN_U16("graphics/pokedex/bg_hoenn.gbapal"); const u16 gPokedexBgHoenn_Pal[] = INCBIN_U16("graphics/pokedex/bg_hoenn.gbapal");
const u16 gPokedexCaughtScreen_Pal[] = INCBIN_U16("graphics/pokedex/caught_screen.gbapal");
const u16 gPokedexSearchResults_Pal[] = INCBIN_U16("graphics/pokedex/search_results_bg.gbapal"); const u16 gPokedexSearchResults_Pal[] = INCBIN_U16("graphics/pokedex/search_results_bg.gbapal");
const u16 gPokedexBgNational_Pal[] = INCBIN_U16("graphics/pokedex/bg_national.gbapal"); const u16 gPokedexBgNational_Pal[] = INCBIN_U16("graphics/pokedex/bg_national.gbapal");
const u32 gPokedexMenu_Gfx[] = INCBIN_U32("graphics/pokedex/menu.4bpp.lz"); const u32 gPokedexMenu_Gfx[] = INCBIN_U32("graphics/pokedex/menu.4bpp.lz");

View file

@ -4090,7 +4090,7 @@ static void Task_HandleCaughtMonPageInput(u8 taskId)
} }
else else
{ {
LoadPalette(gPokedexCaughtScreen_Pal + 1, BG_PLTT_ID(3) + 1, PLTT_SIZEOF(7)); LoadPalette(gPokedexBgHoenn_Pal + 49, BG_PLTT_ID(3) + 1, PLTT_SIZEOF(7));
} }
} }

View file

@ -4820,16 +4820,11 @@ u16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex)
return retVal; return retVal;
} }
#define IS_LEAGUE_BATTLE(trainerClass) \
((gBattleTypeFlags & BATTLE_TYPE_TRAINER) \
&& (trainerClass == TRAINER_CLASS_ELITE_FOUR \
|| trainerClass == TRAINER_CLASS_LEADER \
|| trainerClass == TRAINER_CLASS_CHAMPION)) \
void AdjustFriendship(struct Pokemon *mon, u8 event) void AdjustFriendship(struct Pokemon *mon, u8 event)
{ {
u16 species, heldItem; u16 species, heldItem;
u8 holdEffect; u8 holdEffect;
s8 mod;
if (ShouldSkipFriendshipChange()) if (ShouldSkipFriendshipChange())
return; return;
@ -4864,26 +4859,43 @@ void AdjustFriendship(struct Pokemon *mon, u8 event)
if (friendship > 199) if (friendship > 199)
friendshipLevel++; friendshipLevel++;
if ((event != FRIENDSHIP_EVENT_WALKING || !(Random() & 1)) if (event == FRIENDSHIP_EVENT_WALKING)
&& (event != FRIENDSHIP_EVENT_LEAGUE_BATTLE || IS_LEAGUE_BATTLE(opponentTrainerClass)))
{ {
s8 mod = sFriendshipEventModifiers[event][friendshipLevel]; // 50% chance every 128 steps
if (mod > 0 && holdEffect == HOLD_EFFECT_FRIENDSHIP_UP) if (Random() & 1)
mod = (150 * mod) / 100; return;
friendship += mod;
if (mod > 0)
{
if (GetMonData(mon, MON_DATA_POKEBALL, 0) == ITEM_LUXURY_BALL)
friendship++;
if (GetMonData(mon, MON_DATA_MET_LOCATION, 0) == GetCurrentRegionMapSectionId())
friendship++;
}
if (friendship < 0)
friendship = 0;
if (friendship > MAX_FRIENDSHIP)
friendship = MAX_FRIENDSHIP;
SetMonData(mon, MON_DATA_FRIENDSHIP, &friendship);
} }
if (event == FRIENDSHIP_EVENT_LEAGUE_BATTLE)
{
// Only if it's a trainer battle with league progression significance
if (!(gBattleTypeFlags & BATTLE_TYPE_TRAINER))
return;
if (!(opponentTrainerClass == TRAINER_CLASS_LEADER
|| opponentTrainerClass == TRAINER_CLASS_ELITE_FOUR
|| opponentTrainerClass == TRAINER_CLASS_CHAMPION))
return;
}
mod = sFriendshipEventModifiers[event][friendshipLevel];
if (mod > 0 && holdEffect == HOLD_EFFECT_FRIENDSHIP_UP)
// 50% increase, rounding down
mod = (150 * mod) / 100;
friendship += mod;
if (mod > 0)
{
if (GetMonData(mon, MON_DATA_POKEBALL, NULL) == ITEM_LUXURY_BALL)
friendship++;
if (GetMonData(mon, MON_DATA_MET_LOCATION, NULL) == GetCurrentRegionMapSectionId())
friendship++;
}
if (friendship < 0)
friendship = 0;
if (friendship > MAX_FRIENDSHIP)
friendship = MAX_FRIENDSHIP;
SetMonData(mon, MON_DATA_FRIENDSHIP, &friendship);
} }
} }
@ -5013,14 +5025,10 @@ void RandomlyGivePartyPokerus(struct Pokemon *party)
do do
{ {
do rnd = Random() % PARTY_SIZE;
{ mon = &party[rnd];
rnd = Random() % PARTY_SIZE;
mon = &party[rnd];
}
while (!GetMonData(mon, MON_DATA_SPECIES, 0));
} }
while (GetMonData(mon, MON_DATA_IS_EGG, 0)); while (!GetMonData(mon, MON_DATA_SPECIES, 0) || GetMonData(mon, MON_DATA_IS_EGG, 0));
if (!(CheckPartyHasHadPokerus(party, gBitTable[rnd]))) if (!(CheckPartyHasHadPokerus(party, gBitTable[rnd])))
{ {

View file

@ -6,8 +6,7 @@
#include "pokemon_icon.h" #include "pokemon_icon.h"
#include "sprite.h" #include "sprite.h"
#include "data.h" #include "data.h"
#include "constants/pokemon_icon.h"
#define POKE_ICON_BASE_PAL_TAG 56000
struct MonIconSpriteTemplate struct MonIconSpriteTemplate
{ {

View file

@ -41,6 +41,7 @@
#include "constants/moves.h" #include "constants/moves.h"
#include "constants/rgb.h" #include "constants/rgb.h"
#include "constants/songs.h" #include "constants/songs.h"
#include "constants/pokemon_icon.h"
/* /*
NOTE: This file is large. Some general groups of functions have NOTE: This file is large. Some general groups of functions have
@ -217,7 +218,7 @@ enum {
#define BOXID_CANCELED 201 #define BOXID_CANCELED 201
enum { enum {
PALTAG_MON_ICON_0 = 56000, PALTAG_MON_ICON_0 = POKE_ICON_BASE_PAL_TAG,
PALTAG_MON_ICON_1, // Used implicitly in CreateMonIconSprite PALTAG_MON_ICON_1, // Used implicitly in CreateMonIconSprite
PALTAG_MON_ICON_2, // Used implicitly in CreateMonIconSprite PALTAG_MON_ICON_2, // Used implicitly in CreateMonIconSprite
PALTAG_MON_ICON_3, // Used implicitly in CreateMonIconSprite PALTAG_MON_ICON_3, // Used implicitly in CreateMonIconSprite