Skip to content

Commit

Permalink
Revert "Pre-1.8.4 pret merge (2024/05/26) (#4631)"
Browse files Browse the repository at this point in the history
This reverts commit 70ef93e.
  • Loading branch information
Bassoonian committed May 27, 2024
1 parent 70ef93e commit 5237f06
Show file tree
Hide file tree
Showing 11 changed files with 100 additions and 105 deletions.
3 changes: 0 additions & 3 deletions data/scripts/safari_zone.inc
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ SafariZone_EventScript_ChoosePokeblock::
special OpenPokeblockCaseOnFeeder
waitstate
goto_if_ne VAR_RESULT, 0xFFFF, SafariZone_EventScript_PokeblockPlaced
#ifdef BUGFIX
releaseall @ Only gets called from EventScript_PokeBlockFeeder which uses lockall.
#endif
end

SafariZone_EventScript_PokeblockPlaced::
Expand Down
50 changes: 1 addition & 49 deletions graphics/pokedex/bg_hoenn.pal
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
JASC-PAL
0100
96
48
123 131 0
255 255 255
222 222 222
Expand Down Expand Up @@ -49,51 +49,3 @@ JASC-PAL
49 139 255
189 156 90
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
51 changes: 51 additions & 0 deletions graphics/pokedex/caught_screen.pal
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
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
6 changes: 0 additions & 6 deletions include/constants/pokemon_icon.h

This file was deleted.

2 changes: 1 addition & 1 deletion src/battle_anim_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -3950,7 +3950,7 @@ const struct SpriteTemplate gAppleAcidDripTemplate =
.tileTag = ANIM_TAG_POISON_BUBBLE,
.paletteTag = ANIM_TAG_POISON_BUBBLE,
.oam = &gOamData_AffineDouble_ObjNormal_16x16,
.anims = &gAnims_PoisonProjectile[1],
.anims = gAnims_AcidPoisonDroplet,
.images = NULL,
.affineAnims = gAffineAnims_Droplet,
.callback = SpriteCB_AcidDripSingleTarget
Expand Down
14 changes: 11 additions & 3 deletions src/battle_anim_poison.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,15 @@ static const union AnimCmd sAnim_SludgeBombHit[] =
const union AnimCmd *const gAnims_PoisonProjectile[] =
{
sAnim_PoisonProjectile,
};

const union AnimCmd *const gAnims_AcidPoisonDroplet[] =
{
sAnim_AcidPoisonDroplet,
};

static const union AnimCmd *const sAnims_SludgeBombHit[] =
{
sAnim_SludgeBombHit,
};

Expand Down Expand Up @@ -117,7 +125,7 @@ const struct SpriteTemplate gSludgeBombHitParticleSpriteTemplate =
.tileTag = ANIM_TAG_POISON_BUBBLE,
.paletteTag = ANIM_TAG_POISON_BUBBLE,
.oam = &gOamData_AffineNormal_ObjNormal_16x16,
.anims = &gAnims_PoisonProjectile[2],
.anims = sAnims_SludgeBombHit,
.images = NULL,
.affineAnims = sAffineAnims_SludgeBombHit,
.callback = AnimSludgeBombHitParticle,
Expand All @@ -140,7 +148,7 @@ const struct SpriteTemplate gAcidPoisonDropletSpriteTemplate =
.tileTag = ANIM_TAG_POISON_BUBBLE,
.paletteTag = ANIM_TAG_POISON_BUBBLE,
.oam = &gOamData_AffineDouble_ObjNormal_16x16,
.anims = &gAnims_PoisonProjectile[1],
.anims = gAnims_AcidPoisonDroplet,
.images = NULL,
.affineAnims = gAffineAnims_Droplet,
.callback = AnimAcidPoisonDroplet,
Expand Down Expand Up @@ -185,7 +193,7 @@ const struct SpriteTemplate gGreenPoisonDrip =
.tileTag = ANIM_TAG_GREEN_POISON_BUBBLE,
.paletteTag = ANIM_TAG_GREEN_POISON_BUBBLE,
.oam = &gOamData_AffineDouble_ObjNormal_16x16,
.anims = &gAnims_PoisonProjectile[1],
.anims = gAnims_AcidPoisonDroplet,
.images = NULL,
.affineAnims = gAffineAnims_Droplet,
.callback = AnimAcidPoisonDroplet,
Expand Down
1 change: 1 addition & 0 deletions src/graphics.c
Original file line number Diff line number Diff line change
Expand Up @@ -1733,6 +1733,7 @@ const u16 gFrontierPassMedalsGold_Pal[] = INCBIN_U16("graphics/frontier_pass/gol

// Pokédex
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 gPokedexBgNational_Pal[] = INCBIN_U16("graphics/pokedex/bg_national.gbapal");
const u32 gPokedexMenu_Gfx[] = INCBIN_U32("graphics/pokedex/menu.4bpp.lz");
Expand Down
2 changes: 1 addition & 1 deletion src/pokedex.c
Original file line number Diff line number Diff line change
Expand Up @@ -4090,7 +4090,7 @@ static void Task_HandleCaughtMonPageInput(u8 taskId)
}
else
{
LoadPalette(gPokedexBgHoenn_Pal + 49, BG_PLTT_ID(3) + 1, PLTT_SIZEOF(7));
LoadPalette(gPokedexCaughtScreen_Pal + 1, BG_PLTT_ID(3) + 1, PLTT_SIZEOF(7));
}
}

Expand Down
70 changes: 31 additions & 39 deletions src/pokemon.c
Original file line number Diff line number Diff line change
Expand Up @@ -4820,11 +4820,16 @@ u16 ModifyStatByNature(u8 nature, u16 stat, u8 statIndex)
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)
{
u16 species, heldItem;
u8 holdEffect;
s8 mod;

if (ShouldSkipFriendshipChange())
return;
Expand Down Expand Up @@ -4859,43 +4864,26 @@ void AdjustFriendship(struct Pokemon *mon, u8 event)
if (friendship > 199)
friendshipLevel++;

if (event == FRIENDSHIP_EVENT_WALKING)
{
// 50% chance every 128 steps
if (Random() & 1)
return;
}
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 ((event != FRIENDSHIP_EVENT_WALKING || !(Random() & 1))
&& (event != FRIENDSHIP_EVENT_LEAGUE_BATTLE || IS_LEAGUE_BATTLE(opponentTrainerClass)))
{
if (GetMonData(mon, MON_DATA_POKEBALL, NULL) == ITEM_LUXURY_BALL)
friendship++;
if (GetMonData(mon, MON_DATA_MET_LOCATION, NULL) == GetCurrentRegionMapSectionId())
friendship++;
s8 mod = sFriendshipEventModifiers[event][friendshipLevel];
if (mod > 0 && holdEffect == HOLD_EFFECT_FRIENDSHIP_UP)
mod = (150 * mod) / 100;
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 (friendship < 0)
friendship = 0;
if (friendship > MAX_FRIENDSHIP)
friendship = MAX_FRIENDSHIP;

SetMonData(mon, MON_DATA_FRIENDSHIP, &friendship);
}
}

Expand Down Expand Up @@ -5025,10 +5013,14 @@ void RandomlyGivePartyPokerus(struct Pokemon *party)

do
{
rnd = Random() % PARTY_SIZE;
mon = &party[rnd];
do
{
rnd = Random() % PARTY_SIZE;
mon = &party[rnd];
}
while (!GetMonData(mon, MON_DATA_SPECIES, 0));
}
while (!GetMonData(mon, MON_DATA_SPECIES, 0) || GetMonData(mon, MON_DATA_IS_EGG, 0));
while (GetMonData(mon, MON_DATA_IS_EGG, 0));

if (!(CheckPartyHasHadPokerus(party, gBitTable[rnd])))
{
Expand Down
3 changes: 2 additions & 1 deletion src/pokemon_icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
#include "pokemon_icon.h"
#include "sprite.h"
#include "data.h"
#include "constants/pokemon_icon.h"

#define POKE_ICON_BASE_PAL_TAG 56000

struct MonIconSpriteTemplate
{
Expand Down
3 changes: 1 addition & 2 deletions src/pokemon_storage_system.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@
#include "constants/moves.h"
#include "constants/rgb.h"
#include "constants/songs.h"
#include "constants/pokemon_icon.h"

/*
NOTE: This file is large. Some general groups of functions have
Expand Down Expand Up @@ -218,7 +217,7 @@ enum {
#define BOXID_CANCELED 201

enum {
PALTAG_MON_ICON_0 = POKE_ICON_BASE_PAL_TAG,
PALTAG_MON_ICON_0 = 56000,
PALTAG_MON_ICON_1, // Used implicitly in CreateMonIconSprite
PALTAG_MON_ICON_2, // Used implicitly in CreateMonIconSprite
PALTAG_MON_ICON_3, // Used implicitly in CreateMonIconSprite
Expand Down

0 comments on commit 5237f06

Please sign in to comment.