Merge branch '_RHH/master' into _RHH/upcoming

# Conflicts:
#	src/birch_pc.c
#	src/main.c
This commit is contained in:
Biffalo XIII 2024-01-09 09:19:12 -03:00
commit 4a3954ff34
60 changed files with 289 additions and 289 deletions

View File

@ -7027,6 +7027,10 @@ HurricaneGust:
createsprite gEllipticalGustSpriteTemplate, ANIM_ATTACKER, 2, 0, -16
createvisualtask AnimTask_AnimateGustTornadoPalette, 5, 1, 70
return
HurricaneGustCentered:
createsprite gEllipticalGustCenteredSpriteTemplate, ANIM_ATTACKER, 2, 0, -16
createvisualtask AnimTask_AnimateGustTornadoPalette, 5, 1, 70
return
Move_HEAD_CHARGE:
loadspritegfx ANIM_TAG_IMPACT
@ -15920,36 +15924,36 @@ Move_SPRINGTIDE_STORM::
loadspritegfx ANIM_TAG_GUST
loadspritegfx ANIM_TAG_RED_HEART
playsewithpan SE_M_GUST, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 4, 88, 1
createvisualtask AnimTask_BlendColorCycle, 2, F_PAL_TARGET, 2, 6, 0, 11, RGB(31, 22, 30)
call HurricaneGust
createvisualtaskontargets AnimTask_ShakeMon2, 2, 0, ANIM_TARGET, 0, 4, 0x58, 1
createvisualtask AnimTask_BlendColorCycle, 0x2, F_PAL_TARGET, 0x2, 0x6, 0x0, 0xB, 0x7ADF
call HurricaneGustCentered
call SpringtideStormHeartSwirl
call HurricaneGust
call HurricaneGustCentered
call SpringtideStormHeartSwirl
call HurricaneGust
call HurricaneGustCentered
call SpringtideStormHeartSwirl
call HurricaneGust
call HurricaneGustCentered
call SpringtideStormHeartSwirl
call HurricaneGust
call HurricaneGustCentered
call SpringtideStormHeartSwirl
call HurricaneGust
call HurricaneGustCentered
call SpringtideStormHeartSwirl
waitforvisualfinish
stopsound
end
SpringtideStormHeartSwirl:
createsprite gSpriteTemplate_SpringtideHeart, ANIM_TARGET, 2, 0x0, 0x20, 0x210, 0x1e, 0xa, 0x32, ANIM_TARGET
createspriteontargets gSpriteTemplate_SpringtideHeart, ANIM_TARGET, 2, 6, 0x0, 0x20, 0x210, 0x1e, 0xa, 0x32, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_SpringtideHeart, ANIM_TARGET, 2, 0x0, 0x24, 0x1e0, 0x14, 0xd, 0xffd2, ANIM_TARGET
createspriteontargets gSpriteTemplate_SpringtideHeart, ANIM_TARGET, 2, 6, 0x0, 0x24, 0x1e0, 0x14, 0xd, 0xffd2, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_SpringtideHeart, ANIM_TARGET, 2, 0x0, 0x25, 0x240, 0x14, 0x5, 0x2a, ANIM_TARGET
createspriteontargets gSpriteTemplate_SpringtideHeart, ANIM_TARGET, 2, 6, 0x0, 0x25, 0x240, 0x14, 0x5, 0x2a, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_SpringtideHeart, ANIM_TARGET, 2, 0x0, 0x23, 0x190, 0x19, 0x8, 0xffd6, ANIM_TARGET
createspriteontargets gSpriteTemplate_SpringtideHeart, ANIM_TARGET, 2, 6, 0x0, 0x23, 0x190, 0x19, 0x8, 0xffd6, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_SpringtideHeart, ANIM_TARGET, 2, 0x0, 0x20, 0x200, 0x19, 0xd, 0x2e, ANIM_TARGET
createspriteontargets gSpriteTemplate_SpringtideHeart, ANIM_TARGET, 2, 6, 0x0, 0x20, 0x200, 0x19, 0xd, 0x2e, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_SpringtideHeart, ANIM_TARGET, 2, 0x0, 0x25, 0x1d0, 0x1e, 0xc, 0xffce, ANIM_TARGET
createspriteontargets gSpriteTemplate_SpringtideHeart, ANIM_TARGET, 2, 6, 0x0, 0x25, 0x1d0, 0x1e, 0xc, 0xffce, ANIM_TARGET
return
@ -16490,37 +16494,37 @@ Move_BLEAKWIND_STORM::
loadspritegfx ANIM_TAG_GUST
loadspritegfx ANIM_TAG_ICE_CRYSTALS
playsewithpan SE_M_GUST, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 4, 88, 1
createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x7FFF
call HurricaneGust
createvisualtaskontargets AnimTask_ShakeMon2, 2, 0, ANIM_TARGET, 0, 4, 0x58, 1
createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x7FFF
call HurricaneGustCentered
call BleakwindStormIceSwirl
call HurricaneGust
call HurricaneGustCentered
call BleakwindStormIceSwirl
call HurricaneGust
call HurricaneGustCentered
call BleakwindStormIceSwirl
call HurricaneGust
call HurricaneGustCentered
call BleakwindStormIceSwirl
call HurricaneGust
call HurricaneGustCentered
call BleakwindStormIceSwirl
call HurricaneGust
call HurricaneGustCentered
call BleakwindStormIceSwirl
waitforvisualfinish
stopsound
createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0xB, 0x0, 0x7FFF
createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0xB, 0x0, 0x7FFF
waitforvisualfinish
end
BleakwindStormIceSwirl:
createsprite gSpriteTemplate_BleakwindIce, ANIM_TARGET, 2, 0x0, 0x20, 0x210, 0x1e, 0xa, 0x32, ANIM_TARGET
createspriteontargets gSpriteTemplate_BleakwindIce, ANIM_TARGET, 2, 6, 0x0, 0x20, 0x210, 0x1e, 0xa, 0x32, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_BleakwindIce, ANIM_TARGET, 2, 0x0, 0x24, 0x1e0, 0x14, 0xd, 0xffd2, ANIM_TARGET
createspriteontargets gSpriteTemplate_BleakwindIce, ANIM_TARGET, 2, 6, 0x0, 0x24, 0x1e0, 0x14, 0xd, 0xffd2, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_BleakwindIce, ANIM_TARGET, 2, 0x0, 0x25, 0x240, 0x14, 0x5, 0x2a, ANIM_TARGET
createspriteontargets gSpriteTemplate_BleakwindIce, ANIM_TARGET, 2, 6, 0x0, 0x25, 0x240, 0x14, 0x5, 0x2a, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_BleakwindIce, ANIM_TARGET, 2, 0x0, 0x23, 0x190, 0x19, 0x8, 0xffd6, ANIM_TARGET
createspriteontargets gSpriteTemplate_BleakwindIce, ANIM_TARGET, 2, 6, 0x0, 0x23, 0x190, 0x19, 0x8, 0xffd6, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_BleakwindIce, ANIM_TARGET, 2, 0x0, 0x20, 0x200, 0x19, 0xd, 0x2e, ANIM_TARGET
createspriteontargets gSpriteTemplate_BleakwindIce, ANIM_TARGET, 2, 6, 0x0, 0x20, 0x200, 0x19, 0xd, 0x2e, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_BleakwindIce, ANIM_TARGET, 2, 0x0, 0x25, 0x1d0, 0x1e, 0xc, 0xffce, ANIM_TARGET
createspriteontargets gSpriteTemplate_BleakwindIce, ANIM_TARGET, 2, 6, 0x0, 0x25, 0x1d0, 0x1e, 0xc, 0xffce, ANIM_TARGET
return
@ -16533,39 +16537,39 @@ Move_WILDBOLT_STORM::
createvisualtask AnimTask_StartSlidingBg, 0x5, 0xff00, 0x0, 0x1, 0xffff
waitbgfadein
playsewithpan SE_M_GUST, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 4, 88, 1
createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x07FE
call HurricaneGust
createvisualtaskontargets AnimTask_ShakeMon2, 2, 0, ANIM_TARGET, 0, 4, 0x58, 1
createvisualtask AnimTask_BlendBattleAnimPal, 10, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x07FE
call HurricaneGustCentered
call WildboltStormSparkSwirl
call HurricaneGust
call HurricaneGustCentered
call WildboltStormSparkSwirl
call HurricaneGust
call HurricaneGustCentered
call WildboltStormSparkSwirl
call HurricaneGust
call HurricaneGustCentered
call WildboltStormSparkSwirl
call HurricaneGust
call HurricaneGustCentered
call WildboltStormSparkSwirl
call HurricaneGust
call HurricaneGustCentered
call WildboltStormSparkSwirl
waitforvisualfinish
stopsound
createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0xB, 0x0, 0x07FE
createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0xB, 0x0, 0x07FE
call UnsetPsychicBg
waitforvisualfinish
end
WildboltStormSparkSwirl:
createsprite gSpriteTemplate_WildboltStormSpark, ANIM_TARGET, 2, 0x0, 0x20, 0x210, 0x1e, 0xa, 0x32, ANIM_TARGET
createspriteontargets gSpriteTemplate_WildboltStormSpark, ANIM_TARGET, 2, 6, 0x0, 0x20, 0x210, 0x1e, 0xa, 0x32, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_WildboltStormSpark, ANIM_TARGET, 2, 0x0, 0x24, 0x1e0, 0x14, 0xd, 0xffd2, ANIM_TARGET
createspriteontargets gSpriteTemplate_WildboltStormSpark, ANIM_TARGET, 2, 6, 0x0, 0x24, 0x1e0, 0x14, 0xd, 0xffd2, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_WildboltStormSpark, ANIM_TARGET, 2, 0x0, 0x25, 0x240, 0x14, 0x5, 0x2a, ANIM_TARGET
createspriteontargets gSpriteTemplate_WildboltStormSpark, ANIM_TARGET, 2, 6, 0x0, 0x25, 0x240, 0x14, 0x5, 0x2a, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_WildboltStormSpark, ANIM_TARGET, 2, 0x0, 0x23, 0x190, 0x19, 0x8, 0xffd6, ANIM_TARGET
createspriteontargets gSpriteTemplate_WildboltStormSpark, ANIM_TARGET, 2, 6, 0x0, 0x23, 0x190, 0x19, 0x8, 0xffd6, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_WildboltStormSpark, ANIM_TARGET, 2, 0x0, 0x20, 0x200, 0x19, 0xd, 0x2e, ANIM_TARGET
createspriteontargets gSpriteTemplate_WildboltStormSpark, ANIM_TARGET, 2, 6, 0x0, 0x20, 0x200, 0x19, 0xd, 0x2e, ANIM_TARGET
delay 0x2
createsprite gSpriteTemplate_WildboltStormSpark, ANIM_TARGET, 2, 0x0, 0x25, 0x1d0, 0x1e, 0xc, 0xffce, ANIM_TARGET
createspriteontargets gSpriteTemplate_WildboltStormSpark, ANIM_TARGET, 2, 6, 0x0, 0x25, 0x1d0, 0x1e, 0xc, 0xffce, ANIM_TARGET
return
@ -16575,38 +16579,38 @@ Move_SANDSEAR_STORM::
loadspritegfx ANIM_TAG_SMALL_EMBER
createvisualtask AnimTask_BlendParticle, 0x5, ANIM_TAG_GUST, 0x0, 0xA, 0xA, 0x190B
playsewithpan SE_M_GUST, SOUND_PAN_TARGET
createvisualtask AnimTask_ShakeMon, 2, ANIM_TARGET, 0, 4, 88, 1
createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x1F
call HurricaneGust
createvisualtaskontargets AnimTask_ShakeMon2, 2, 0, ANIM_TARGET, 0, 4, 0x58, 1
createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x4, 0x0, 0xB, 0x1F
call HurricaneGustCentered
call SandsearStormFireSpin
call HurricaneGust
call HurricaneGustCentered
call SandsearStormFireSpin
call HurricaneGust
call HurricaneGustCentered
call SandsearStormFireSpin
call HurricaneGust
call HurricaneGustCentered
call SandsearStormFireSpin
call HurricaneGust
call HurricaneGustCentered
call SandsearStormFireSpin
call HurricaneGust
call HurricaneGustCentered
call SandsearStormFireSpin
waitforvisualfinish
stopsound
createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0xB, 0x0, 0x1F
createvisualtask AnimTask_BlendBattleAnimPal, 0xa, F_PAL_TARGET, 0x1, 0xB, 0x0, 0x1F
waitforvisualfinish
end
SandsearStormFireSpin:
createsprite gFireSpinSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x1c, 0x210, 0x1e, 0xd, 0x32, ANIM_TARGET
createspriteontargets gFireSpinSpriteTemplate, ANIM_TARGET, 2, 6, 0x0, 0x1c, 0x210, 0x1e, 0xd, 0x32, ANIM_TARGET
delay 0x2
createsprite gFireSpinSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x20, 0x1e0, 0x14, 0x10, 0xffd2, ANIM_TARGET
createspriteontargets gFireSpinSpriteTemplate, ANIM_TARGET, 2, 6, 0x0, 0x20, 0x1e0, 0x14, 0x10, 0xffd2, ANIM_TARGET
delay 0x2
createsprite gFireSpinSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x21, 0x240, 0x14, 0x8, 0x2a, ANIM_TARGET
createspriteontargets gFireSpinSpriteTemplate, ANIM_TARGET, 2, 6, 0x0, 0x21, 0x240, 0x14, 0x8, 0x2a, ANIM_TARGET
delay 0x2
createsprite gFireSpinSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x1f, 0x190, 0x19, 0xb, 0xffd6, ANIM_TARGET
createspriteontargets gFireSpinSpriteTemplate, ANIM_TARGET, 2, 6, 0x0, 0x1f, 0x190, 0x19, 0xb, 0xffd6, ANIM_TARGET
delay 0x2
createsprite gFireSpinSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x1c, 0x200, 0x19, 0x10, 0x2e, ANIM_TARGET
createspriteontargets gFireSpinSpriteTemplate, ANIM_TARGET, 2, 6, 0x0, 0x1c, 0x200, 0x19, 0x10, 0x2e, ANIM_TARGET
delay 0x2
createsprite gFireSpinSpriteTemplate, ANIM_TARGET, 2, 0x0, 0x21, 0x1d0, 0x1e, 0xf, 0xffce, ANIM_TARGET
createspriteontargets gFireSpinSpriteTemplate, ANIM_TARGET, 2, 6, 0x0, 0x21, 0x1d0, 0x1e, 0xf, 0xffce, ANIM_TARGET
return

Binary file not shown.

Before

Width:  |  Height:  |  Size: 337 B

After

Width:  |  Height:  |  Size: 353 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1001 B

After

Width:  |  Height:  |  Size: 999 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 507 B

After

Width:  |  Height:  |  Size: 463 B

View File

@ -7,13 +7,13 @@ JASC-PAL
160 136 120
184 160 144
216 200 184
88 72 56
24 24 24
59 48 38
13 13 13
144 128 120
48 120 152
104 176 216
248 248 248
112 112 112
0 0 0
96 79 62
0 0 0
0 0 0

View File

@ -2,18 +2,18 @@ JASC-PAL
0100
16
152 208 160
88 72 56
200 104 48
216 136 72
192 160 144
216 200 176
152 72 24
66 49 33
206 99 33
222 132 49
197 165 148
222 206 181
156 58 0
24 24 24
152 120 112
216 152 0
248 224 48
248 248 248
112 112 112
0 0 0
189 78 13
0 0 0
0 0 0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 989 B

After

Width:  |  Height:  |  Size: 999 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 679 B

After

Width:  |  Height:  |  Size: 619 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 597 B

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 625 B

After

Width:  |  Height:  |  Size: 811 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 642 B

After

Width:  |  Height:  |  Size: 600 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 951 B

After

Width:  |  Height:  |  Size: 891 B

View File

@ -1,9 +1,9 @@
JASC-PAL
0100
16
49 93 139
98 133 172
156 210 164
98 133 172
49 93 139
106 52 57
16 16 16
123 129 148

View File

@ -1,9 +1,9 @@
JASC-PAL
0100
16
67 119 184
109 151 204
156 210 164
109 151 204
67 119 184
112 105 107
16 16 16
81 96 101

Binary file not shown.

Before

Width:  |  Height:  |  Size: 624 B

After

Width:  |  Height:  |  Size: 475 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 412 B

After

Width:  |  Height:  |  Size: 408 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 455 B

After

Width:  |  Height:  |  Size: 476 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 567 B

After

Width:  |  Height:  |  Size: 501 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 383 B

After

Width:  |  Height:  |  Size: 326 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 502 B

After

Width:  |  Height:  |  Size: 350 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 338 B

After

Width:  |  Height:  |  Size: 323 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 413 B

After

Width:  |  Height:  |  Size: 458 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 369 B

After

Width:  |  Height:  |  Size: 327 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 319 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 531 B

After

Width:  |  Height:  |  Size: 388 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 511 B

After

Width:  |  Height:  |  Size: 463 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 468 B

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 418 B

After

Width:  |  Height:  |  Size: 375 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 B

After

Width:  |  Height:  |  Size: 343 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 494 B

After

Width:  |  Height:  |  Size: 423 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 533 B

After

Width:  |  Height:  |  Size: 466 B

View File

@ -548,5 +548,6 @@ void AnimOutrageFlame(struct Sprite *sprite);
// battle_anim_new.c
void CoreEnforcerLoadBeamTarget(struct Sprite *sprite);
void SpriteCB_RandomCentredHits(struct Sprite *sprite);
void InitSpritePosToAnimTargetsCentre(struct Sprite *sprite, bool32 respectMonPicOffsets);
#endif // GUARD_BATTLE_ANIM_H

6
include/birch_pc.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef GUARD_BIRCH_PC_H
#define GUARD_BIRCH_PC_H
const u8 *GetPokedexRatingText(u16 count);
#endif // GUARD_BIRCH_PC_H

View File

@ -19,6 +19,7 @@
#endif
#define ALIGNED(n) __attribute__((aligned(n)))
#define PACKED __attribute__((packed))
#define SOUND_INFO_PTR (*(struct SoundInfo **)0x3007FF0)
#define INTR_CHECK (*(u16 *)0x3007FF8)

View File

@ -41,7 +41,7 @@ struct BgCnt
u16 screenBaseBlock:5;
u16 areaOverflowMode:1;
u16 screenSize:2;
};
} PACKED;
typedef volatile struct BgCnt vBgCnt;
struct PlttData

View File

@ -666,6 +666,7 @@ static bool32 AI_IsMoveEffectInPlus(u32 battlerAtk, u32 battlerDef, u32 move, s3
if (ShouldLowerStat(battlerDef, abilityDef, STAT_DEF) && noOfHitsToKo != 1)
return TRUE;
break;
case EFFECT_BULLDOZE:
case EFFECT_SPEED_DOWN_HIT:
if (ShouldLowerStat(battlerDef, abilityDef, STAT_SPEED) && noOfHitsToKo != 1)
return TRUE;

View File

@ -10,6 +10,7 @@
extern const struct SpriteTemplate gFlashingHitSplatSpriteTemplate;
static void AnimEllipticalGustCentered(struct Sprite *sprite);
static void AnimEllipticalGust_Step(struct Sprite *);
static void AnimGustToTarget(struct Sprite *);
static void AnimGustToTarget_Step(struct Sprite *);
@ -32,6 +33,17 @@ static void AnimSkyAttackBird_Step(struct Sprite *);
static void AnimTask_AnimateGustTornadoPalette_Step(u8);
static void AnimTask_LoadWindstormBackground_Step(u8 taskId);
const struct SpriteTemplate gEllipticalGustCenteredSpriteTemplate =
{
.tileTag = ANIM_TAG_GUST,
.paletteTag = ANIM_TAG_GUST,
.oam = &gOamData_AffineOff_ObjNormal_32x64,
.anims = gDummySpriteAnimTable,
.images = NULL,
.affineAnims = gDummySpriteAffineAnimTable,
.callback = AnimEllipticalGustCentered,
};
const struct SpriteTemplate gEllipticalGustSpriteTemplate =
{
.tileTag = ANIM_TAG_GUST,
@ -344,6 +356,15 @@ const struct SpriteTemplate gSkyAttackBirdSpriteTemplate =
.callback = AnimSkyAttackBird,
};
// same as AnimEllipticalGust but centered on targets
static void AnimEllipticalGustCentered(struct Sprite *sprite)
{
InitSpritePosToAnimTargetsCentre(sprite, FALSE);
sprite->y += 20;
sprite->data[1] = 191;
sprite->callback = AnimEllipticalGust_Step;
sprite->callback(sprite);
}
void AnimEllipticalGust(struct Sprite *sprite)
{

View File

@ -7247,7 +7247,7 @@ static void InitSpritePosToGivenTarget(struct Sprite *sprite, u8 target)
sprite->y2 = gBattleAnimArgs[1];
}
static void InitSpritePosToAnimTargetsCentre(struct Sprite *sprite, bool8 respectMonPicOffsets)
void InitSpritePosToAnimTargetsCentre(struct Sprite *sprite, bool32 respectMonPicOffsets)
{
if (!respectMonPicOffsets)
{

View File

@ -413,6 +413,23 @@ u32 UnpackSelectedBattlePalettes(s16 selector)
bool8 targetPartner = (selector >> 4) & 1;
bool8 anim1 = (selector >> 5) & 1;
bool8 anim2 = (selector >> 6) & 1;
u32 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gAnimMoveIndex);
switch (moveTarget)
{
case MOVE_TARGET_BOTH:
if (target) {
targetPartner |= 1;
}
break;
case MOVE_TARGET_FOES_AND_ALLY:
if (target) {
targetPartner |= 1;
attackerPartner |= 1;
}
break;
}
return GetBattlePalettesMask(battleBackground, attacker, target, attackerPartner, targetPartner, anim1, anim2);
}

View File

@ -456,11 +456,7 @@ void AnimRockFragment(struct Sprite *sprite)
// Swirls particle in vortex. Used for moves like Fire Spin or Sand Tomb
void AnimParticleInVortex(struct Sprite *sprite)
{
if (gBattleAnimArgs[6] == ANIM_ATTACKER)
InitSpritePosToAnimAttacker(sprite, FALSE);
else
InitSpritePosToAnimTarget(sprite, FALSE);
InitSpritePosToAnimBattler(gBattleAnimArgs[6], sprite, FALSE);
sprite->data[0] = gBattleAnimArgs[3];
sprite->data[1] = gBattleAnimArgs[2];
sprite->data[2] = gBattleAnimArgs[4];

View File

@ -43,25 +43,25 @@ void SetAnimBgAttribute(u8 bgId, u8 attributeId, u8 value)
switch (attributeId)
{
case BG_ANIM_SCREEN_SIZE:
((struct BgCnt *)&bgCnt)->screenSize = value;
((vBgCnt *)&bgCnt)->screenSize = value;
break;
case BG_ANIM_AREA_OVERFLOW_MODE:
((struct BgCnt *)&bgCnt)->areaOverflowMode = value;
((vBgCnt *)&bgCnt)->areaOverflowMode = value;
break;
case BG_ANIM_MOSAIC:
((struct BgCnt *)&bgCnt)->mosaic = value;
((vBgCnt *)&bgCnt)->mosaic = value;
break;
case BG_ANIM_CHAR_BASE_BLOCK:
((struct BgCnt *)&bgCnt)->charBaseBlock = value;
((vBgCnt *)&bgCnt)->charBaseBlock = value;
break;
case BG_ANIM_PRIORITY:
((struct BgCnt *)&bgCnt)->priority = value;
((vBgCnt *)&bgCnt)->priority = value;
break;
case BG_ANIM_PALETTES_MODE:
((struct BgCnt *)&bgCnt)->palettes = value;
((vBgCnt *)&bgCnt)->palettes = value;
break;
case BG_ANIM_SCREEN_BASE_BLOCK:
((struct BgCnt *)&bgCnt)->screenBaseBlock = value;
((vBgCnt *)&bgCnt)->screenBaseBlock = value;
break;
}
@ -79,19 +79,19 @@ int GetAnimBgAttribute(u8 bgId, u8 attributeId)
switch (attributeId)
{
case BG_ANIM_SCREEN_SIZE:
return ((struct BgCnt *)&bgCnt)->screenSize;
return ((vBgCnt *)&bgCnt)->screenSize;
case BG_ANIM_AREA_OVERFLOW_MODE:
return ((struct BgCnt *)&bgCnt)->areaOverflowMode;
return ((vBgCnt *)&bgCnt)->areaOverflowMode;
case BG_ANIM_MOSAIC:
return ((struct BgCnt *)&bgCnt)->mosaic;
return ((vBgCnt *)&bgCnt)->mosaic;
case BG_ANIM_CHAR_BASE_BLOCK:
return ((struct BgCnt *)&bgCnt)->charBaseBlock;
return ((vBgCnt *)&bgCnt)->charBaseBlock;
case BG_ANIM_PRIORITY:
return ((struct BgCnt *)&bgCnt)->priority;
return ((vBgCnt *)&bgCnt)->priority;
case BG_ANIM_PALETTES_MODE:
return ((struct BgCnt *)&bgCnt)->palettes;
return ((vBgCnt *)&bgCnt)->palettes;
case BG_ANIM_SCREEN_BASE_BLOCK:
return ((struct BgCnt *)&bgCnt)->screenBaseBlock;
return ((vBgCnt *)&bgCnt)->screenBaseBlock;
}
}

View File

@ -4967,6 +4967,8 @@ static void TurnValuesCleanUp(bool8 var0)
gSideStatuses[B_SIDE_OPPONENT] &= ~(SIDE_STATUS_QUICK_GUARD | SIDE_STATUS_WIDE_GUARD | SIDE_STATUS_CRAFTY_SHIELD | SIDE_STATUS_MAT_BLOCK);
gSideTimers[B_SIDE_PLAYER].followmeTimer = 0;
gSideTimers[B_SIDE_OPPONENT].followmeTimer = 0;
gBattleStruct->pledgeMove = FALSE; // combined pledge move may not have been used due to a canceller
}
void SpecialStatusesClear(void)

View File

@ -1587,9 +1587,11 @@ static bool32 AccuracyCalcHelper(u16 move)
if (WEATHER_HAS_EFFECT)
{
if ((IsBattlerWeatherAffected(gBattlerTarget, B_WEATHER_RAIN) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)))
if (IsBattlerWeatherAffected(gBattlerTarget, B_WEATHER_RAIN) &&
(gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE ||
move == MOVE_BLEAKWIND_STORM || move == MOVE_WILDBOLT_STORM || move == MOVE_SANDSEAR_STORM))
{
// thunder/hurricane ignore acc checks in rain unless target is holding utility umbrella
// thunder/hurricane/genie moves ignore acc checks in rain unless target is holding utility umbrella
JumpIfMoveFailed(7, move);
return TRUE;
}
@ -3161,20 +3163,25 @@ void SetMoveEffect(bool32 primary, u32 certain)
}
break;
case MOVE_EFFECT_FLINCH:
if (battlerAbility == ABILITY_INNER_FOCUS
&& (primary == TRUE || certain == MOVE_EFFECT_CERTAIN))
if (battlerAbility == ABILITY_INNER_FOCUS)
{
gLastUsedAbility = ABILITY_INNER_FOCUS;
gBattlerAbility = gEffectBattler;
RecordAbilityBattle(gEffectBattler, ABILITY_INNER_FOCUS);
gBattlescriptCurrInstr = BattleScript_FlinchPrevention;
if (primary == TRUE || certain == MOVE_EFFECT_CERTAIN)
{
gLastUsedAbility = ABILITY_INNER_FOCUS;
gBattlerAbility = gEffectBattler;
RecordAbilityBattle(gEffectBattler, ABILITY_INNER_FOCUS);
gBattlescriptCurrInstr = BattleScript_FlinchPrevention;
} else
{
gBattlescriptCurrInstr++;
}
}
else if (GetBattlerTurnOrderNum(gEffectBattler) > gCurrentTurnActionNumber
&& !IsDynamaxed(gEffectBattler))
&& !IsDynamaxed(gEffectBattler))
{
gBattleMons[gEffectBattler].status2 |= sStatusFlagsForMoveEffects[gBattleScripting.moveEffect];
gBattleMons[gEffectBattler].status2 |= sStatusFlagsForMoveEffects[gBattleScripting.moveEffect];
gBattlescriptCurrInstr++;
}
gBattlescriptCurrInstr++;
break;
case MOVE_EFFECT_UPROAR:
if (!(gBattleMons[gEffectBattler].status2 & STATUS2_UPROAR))

View File

@ -2933,7 +2933,7 @@ u8 DoBattlerEndTurnEffects(void)
gBattleStruct->turnEffectsTracker++;
break;
case ENDTURN_SEA_OF_FIRE_DAMAGE:
if (gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SEA_OF_FIRE)
if (IsBattlerAlive(battler) && gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SEA_OF_FIRE)
{
gBattleMoveDamage = gBattleMons[battler].maxHP / 8;
BtlController_EmitStatusAnimation(battler, BUFFER_A, FALSE, STATUS1_BURN);

View File

@ -171,7 +171,8 @@ bool32 IsViableZMove(u8 battler, u16 move)
if (gBattleStruct->zmove.used[battler])
return FALSE;
if (gBattleTypeFlags & (BATTLE_TYPE_SAFARI | BATTLE_TYPE_WALLY_TUTORIAL | BATTLE_TYPE_FRONTIER))
// Add '| BATTLE_TYPE_FRONTIER' to below if issues occur
if (gBattleTypeFlags & (BATTLE_TYPE_SAFARI | BATTLE_TYPE_WALLY_TUTORIAL))
return FALSE;
if ((GetBattlerPosition(battler) == B_POSITION_PLAYER_LEFT || (!(gBattleTypeFlags & BATTLE_TYPE_MULTI) && GetBattlerPosition(battler) == B_POSITION_PLAYER_RIGHT)) && !CheckBagHasItem(ITEM_Z_POWER_RING, 1))

View File

@ -20,66 +20,52 @@ bool16 ScriptGetPokedexInfo(void)
return IsNationalPokedexEnabled();
}
// Species in this array are ignored in the progress towards a full regional dex
static const u16 sRegionalNotCountedList[] = {
SPECIES_JIRACHI,
SPECIES_DEOXYS,
SPECIES_NONE
};
#define BIRCH_DEX_STRINGS 21
static const u8 *const sBirchDexRatingTexts[BIRCH_DEX_STRINGS] =
{
gBirchDexRatingText_LessThan10,
gBirchDexRatingText_LessThan20,
gBirchDexRatingText_LessThan30,
gBirchDexRatingText_LessThan40,
gBirchDexRatingText_LessThan50,
gBirchDexRatingText_LessThan60,
gBirchDexRatingText_LessThan70,
gBirchDexRatingText_LessThan80,
gBirchDexRatingText_LessThan90,
gBirchDexRatingText_LessThan100,
gBirchDexRatingText_LessThan110,
gBirchDexRatingText_LessThan120,
gBirchDexRatingText_LessThan130,
gBirchDexRatingText_LessThan140,
gBirchDexRatingText_LessThan150,
gBirchDexRatingText_LessThan160,
gBirchDexRatingText_LessThan170,
gBirchDexRatingText_LessThan180,
gBirchDexRatingText_LessThan190,
gBirchDexRatingText_LessThan200,
gBirchDexRatingText_DexCompleted,
};
// This shows your Hoenn Pokédex rating and not your National Dex.
const u8 *GetPokedexRatingText(u16 count)
{
if (count < 10)
return gBirchDexRatingText_LessThan10;
if (count < 20)
return gBirchDexRatingText_LessThan20;
if (count < 30)
return gBirchDexRatingText_LessThan30;
if (count < 40)
return gBirchDexRatingText_LessThan40;
if (count < 50)
return gBirchDexRatingText_LessThan50;
if (count < 60)
return gBirchDexRatingText_LessThan60;
if (count < 70)
return gBirchDexRatingText_LessThan70;
if (count < 80)
return gBirchDexRatingText_LessThan80;
if (count < 90)
return gBirchDexRatingText_LessThan90;
if (count < 100)
return gBirchDexRatingText_LessThan100;
if (count < 110)
return gBirchDexRatingText_LessThan110;
if (count < 120)
return gBirchDexRatingText_LessThan120;
if (count < 130)
return gBirchDexRatingText_LessThan130;
if (count < 140)
return gBirchDexRatingText_LessThan140;
if (count < 150)
return gBirchDexRatingText_LessThan150;
if (count < 160)
return gBirchDexRatingText_LessThan160;
if (count < 170)
return gBirchDexRatingText_LessThan170;
if (count < 180)
return gBirchDexRatingText_LessThan180;
if (count < 190)
return gBirchDexRatingText_LessThan190;
if (count < 200)
return gBirchDexRatingText_LessThan200;
if (count == 200)
u32 i;
u16 maxDex = HOENN_DEX_COUNT - 1;
for(i = 0; sRegionalNotCountedList[i] != SPECIES_NONE; i++)
{
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), FLAG_GET_CAUGHT)
|| GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), FLAG_GET_CAUGHT)) // Jirachi or Deoxys is not counted towards the dex completion. If either of these flags are enabled, it means the actual count is less than 200.
return gBirchDexRatingText_LessThan200;
return gBirchDexRatingText_DexCompleted;
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(sRegionalNotCountedList[i]), FLAG_GET_CAUGHT))
count--;
maxDex--;
}
if (count == HOENN_DEX_COUNT - 1)
{
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), FLAG_GET_CAUGHT)
&& GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), FLAG_GET_CAUGHT)) // If both of these flags are enabled, it means the actual count is less than 200.
return gBirchDexRatingText_LessThan200;
return gBirchDexRatingText_DexCompleted;
}
if (count == HOENN_DEX_COUNT)
return gBirchDexRatingText_DexCompleted;
return gBirchDexRatingText_LessThan10;
return sBirchDexRatingTexts[(count * (BIRCH_DEX_STRINGS - 1)) / maxDex];
}
void ShowPokedexRatingMessage(void)

View File

@ -12946,7 +12946,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
.type = TYPE_FLYING,
.accuracy = 80,
.secondaryEffectChance = 30,
.target = MOVE_TARGET_SELECTED,
.target = MOVE_TARGET_BOTH,
.priority = 0,
.category = BATTLE_CATEGORY_SPECIAL,
.sheerForceBoost = TRUE,
@ -12966,7 +12966,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
.type = TYPE_ELECTRIC,
.accuracy = 80,
.secondaryEffectChance = 20,
.target = MOVE_TARGET_SELECTED,
.target = MOVE_TARGET_BOTH,
.priority = 0,
.category = BATTLE_CATEGORY_SPECIAL,
.sheerForceBoost = TRUE,
@ -12986,7 +12986,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
.type = TYPE_GROUND,
.accuracy = 80,
.secondaryEffectChance = 20,
.target = MOVE_TARGET_SELECTED,
.target = MOVE_TARGET_BOTH,
.priority = 0,
.category = BATTLE_CATEGORY_SPECIAL,
.sheerForceBoost = TRUE,
@ -13419,7 +13419,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
.power = 100,
.type = TYPE_FIGHTING,
.accuracy = 100,
.pp = 10,
.pp = 5,
.secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED,
.priority = 0,
@ -13434,7 +13434,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
.power = 100,
.type = TYPE_ELECTRIC,
.accuracy = 100,
.pp = 10,
.pp = 5,
.secondaryEffectChance = 0,
.target = MOVE_TARGET_SELECTED,
.priority = 0,

View File

@ -3723,19 +3723,21 @@ const struct SpeciesInfo gSpeciesInfoGen1[] =
.formSpeciesIdTable = sDiglettFormSpeciesIdTable, \
DIGLETT_FAMILY_MISC_INFO
#define DUGTRIO_MISC_INFO \
.catchRate = 50, \
.expYield = 149, \
.evYield_Speed = 2, \
.speciesName = _("Dugtrio"), \
.cryId = CRY_DUGTRIO, \
.natDexNum = NATIONAL_DEX_DUGTRIO, \
.categoryName = _("Mole"), \
.height = 7, \
.pokemonScale = 406, \
.pokemonOffset = 18, \
.trainerScale = 256, \
.trainerOffset = 0, \
#define DUGTRIO_MISC_INFO \
.catchRate = 50, \
.expYield = 149, \
.evYield_Speed = 2, \
.speciesName = _("Dugtrio"), \
.cryId = CRY_DUGTRIO, \
.natDexNum = NATIONAL_DEX_DUGTRIO, \
.categoryName = _("Mole"), \
.height = 7, \
.pokemonScale = 406, \
.pokemonOffset = 18, \
.trainerScale = 256, \
.trainerOffset = 0, \
.footprint = gMonFootprint_Dugtrio, \
.formSpeciesIdTable = sDugtrioFormSpeciesIdTable, \
DIGLETT_FAMILY_MISC_INFO
#define DUGTRIO_ATTACK (P_UPDATED_STATS >= GEN_7 ? 100 : 80)

View File

@ -2860,7 +2860,7 @@ const struct SpeciesInfo gSpeciesInfoGen6[] =
.frontAnimFrames = sAnims_Tyrantrum,
.frontAnimId = ANIM_V_SHAKE,
BACK_PIC(Tyrantrum, 64, 56),
.backPicYOffset = 11,
.backPicYOffset = 5,
.backAnimId = BACK_ANIM_V_SHAKE_H_SLIDE,
PALETTES(Tyrantrum),
ICON(Tyrantrum, 0),

View File

@ -4259,7 +4259,7 @@ const struct SpeciesInfo gSpeciesInfoGen8[] =
.frontAnimFrames = sAnims_Duraludon,
//.frontAnimId = ANIM_V_SQUISH_AND_BOUNCE,
BACK_PIC(Duraludon, 64, 64),
.backPicYOffset = 1,
.backPicYOffset = 0,
//.backAnimId = BACK_ANIM_NONE,
PALETTES(Duraludon),
ICON(Duraludon, 0),

View File

@ -1574,8 +1574,16 @@ static void DebugTask_HandleMenuInput_FlagsVars(u8 taskId)
PlaySE(SE_SELECT);
if ((func = sDebugMenu_Actions_Flags[input]) != NULL)
{
Debug_RedrawListMenu(taskId);
func(taskId);
if (input == DEBUG_FLAGVAR_MENU_ITEM_FLAGS || input == DEBUG_FLAGVAR_MENU_ITEM_VARS)
{
Debug_RedrawListMenu(taskId);
func(taskId);
}
else
{
func(taskId);
Debug_RedrawListMenu(taskId);
}
// Remove TRUE/FALSE window for functions that haven't been assigned flags
if (gTasks[taskId].tInput == 0xFF)

View File

@ -1132,6 +1132,12 @@ static void HallOfFame_PrintMonInfo(struct HallofFameMon* currMon, u8 unused1, u
dexNumber = SpeciesToPokedexNum(currMon->species);
if (dexNumber != 0xFFFF)
{
if (IsNationalPokedexEnabled())
{
stringPtr[0] = (dexNumber / 1000) + CHAR_0;
stringPtr++;
dexNumber %= 1000;
}
stringPtr[0] = (dexNumber / 100) + CHAR_0;
stringPtr++;
dexNumber %= 100;

View File

@ -3,6 +3,7 @@
#include "battle.h"
#include "battle_setup.h"
#include "bg.h"
#include "birch_pc.h"
#include "data.h"
#include "event_data.h"
#include "event_object_movement.h"
@ -1965,90 +1966,10 @@ static u16 GetFrontierStreakInfo(u16 facilityId, u32 *topicTextId)
return streak;
}
static u8 GetPokedexRatingLevel(u16 numSeen)
{
if (numSeen < 10)
return 0;
if (numSeen < 20)
return 1;
if (numSeen < 30)
return 2;
if (numSeen < 40)
return 3;
if (numSeen < 50)
return 4;
if (numSeen < 60)
return 5;
if (numSeen < 70)
return 6;
if (numSeen < 80)
return 7;
if (numSeen < 90)
return 8;
if (numSeen < 100)
return 9;
if (numSeen < 110)
return 10;
if (numSeen < 120)
return 11;
if (numSeen < 130)
return 12;
if (numSeen < 140)
return 13;
if (numSeen < 150)
return 14;
if (numSeen < 160)
return 15;
if (numSeen < 170)
return 16;
if (numSeen < 180)
return 17;
if (numSeen < 190)
return 18;
if (numSeen < 200)
return 19;
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_DEOXYS), FLAG_GET_CAUGHT))
numSeen--;
if (GetSetPokedexFlag(SpeciesToNationalPokedexNum(SPECIES_JIRACHI), FLAG_GET_CAUGHT))
numSeen--;
if (numSeen < 200)
return 19;
else
return 20;
}
static const u8 *const sBirchDexRatingTexts[] =
{
gBirchDexRatingText_LessThan10,
gBirchDexRatingText_LessThan20,
gBirchDexRatingText_LessThan30,
gBirchDexRatingText_LessThan40,
gBirchDexRatingText_LessThan50,
gBirchDexRatingText_LessThan60,
gBirchDexRatingText_LessThan70,
gBirchDexRatingText_LessThan80,
gBirchDexRatingText_LessThan90,
gBirchDexRatingText_LessThan100,
gBirchDexRatingText_LessThan110,
gBirchDexRatingText_LessThan120,
gBirchDexRatingText_LessThan130,
gBirchDexRatingText_LessThan140,
gBirchDexRatingText_LessThan150,
gBirchDexRatingText_LessThan160,
gBirchDexRatingText_LessThan170,
gBirchDexRatingText_LessThan180,
gBirchDexRatingText_LessThan190,
gBirchDexRatingText_LessThan200,
gBirchDexRatingText_DexCompleted,
};
void BufferPokedexRatingForMatchCall(u8 *destStr)
{
int numSeen, numCaught;
u8 *str;
u8 dexRatingLevel;
u8 *buffer = Alloc(sizeof(gStringVar4));
if (!buffer)
@ -2061,12 +1982,11 @@ void BufferPokedexRatingForMatchCall(u8 *destStr)
numCaught = GetHoennPokedexCount(FLAG_GET_CAUGHT);
ConvertIntToDecimalStringN(gStringVar1, numSeen, STR_CONV_MODE_LEFT_ALIGN, 3);
ConvertIntToDecimalStringN(gStringVar2, numCaught, STR_CONV_MODE_LEFT_ALIGN, 3);
dexRatingLevel = GetPokedexRatingLevel(numCaught);
str = StringCopy(buffer, gBirchDexRatingText_AreYouCurious);
*(str++) = CHAR_PROMPT_CLEAR;
str = StringCopy(str, gBirchDexRatingText_SoYouveSeenAndCaught);
*(str++) = CHAR_PROMPT_CLEAR;
StringCopy(str, sBirchDexRatingTexts[dexRatingLevel]);
StringCopy(str, GetPokedexRatingText(numCaught));
str = StringExpandPlaceholders(destStr, buffer);
if (IsNationalPokedexEnabled())

View File

@ -2786,7 +2786,7 @@ static void SetPartyMonFieldSelectionActions(struct Pokemon *mons, u8 slotId)
// Add field moves to action list
for (i = 0; i < MAX_MON_MOVES; i++)
{
for (j = 0; sFieldMoves[j] != FIELD_MOVES_COUNT; j++)
for (j = 0; j != FIELD_MOVES_COUNT; j++)
{
if (GetMonData(&mons[slotId], i + MON_DATA_MOVE1) == sFieldMoves[j])
{

View File

@ -6440,13 +6440,37 @@ static u8 PrintPreEvolutions(u8 taskId, u16 species)
u16 preEvolutionTwo = 0;
u8 numPreEvolutions = 0;
bool8 isMega = FALSE;
u16 baseFormSpecies;
sPokedexView->sEvoScreenData.isMega = FALSE;
//Check if it's a mega
baseFormSpecies = GetFormSpeciesId(species, 0);
if (baseFormSpecies != species)
{
const struct FormChange *formChanges = GetSpeciesFormChanges(baseFormSpecies);
for (i = 0; formChanges != NULL && formChanges[i].method != FORM_CHANGE_TERMINATOR; i++)
{
if (formChanges[i].method == FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM
&& formChanges[i].targetSpecies == species)
{
preEvolutionOne = baseFormSpecies;
numPreEvolutions += 1;
sPokedexView->numPreEvolutions = numPreEvolutions;
sPokedexView->sEvoScreenData.numAllEvolutions += numPreEvolutions;
sPokedexView->sEvoScreenData.isMega = TRUE;
CopyItemName(GetSpeciesFormChanges(species)->param1, gStringVar2); //item
CreateCaughtBallEvolutionScreen(preEvolutionOne, base_x - 9 - 8, base_y + base_y_offset*(numPreEvolutions - 1), 0);
HandlePreEvolutionSpeciesPrint(taskId, preEvolutionOne, species, base_x - 8, base_y, base_y_offset, numPreEvolutions - 1);
return numPreEvolutions;
}
}
}
//Calculate previous evolution
for (i = 0; i < NUM_SPECIES; i++)
{
const struct Evolution *evolutions = GetSpeciesEvolutions(species);
const struct Evolution *evolutions = GetSpeciesEvolutions(i);
if (evolutions == NULL)
continue;
@ -6456,35 +6480,17 @@ static u8 PrintPreEvolutions(u8 taskId, u16 species)
{
preEvolutionOne = i;
numPreEvolutions += 1;
if (GetSpeciesFormChanges(species) != NULL
&& GetSpeciesFormChanges(species)->method == FORM_CHANGE_BATTLE_MEGA_EVOLUTION_ITEM)
{
CopyItemName(GetSpeciesFormChanges(species)->param1, gStringVar2); //item
isMega = TRUE;
}
break;
}
}
}
if (isMega)
{
sPokedexView->numPreEvolutions = numPreEvolutions;
sPokedexView->sEvoScreenData.numAllEvolutions += numPreEvolutions;
sPokedexView->sEvoScreenData.isMega = isMega;
CreateCaughtBallEvolutionScreen(preEvolutionOne, base_x - 9 - 8, base_y + base_y_offset*(numPreEvolutions - 1), 0);
HandlePreEvolutionSpeciesPrint(taskId, preEvolutionOne, species, base_x - 8, base_y, base_y_offset, numPreEvolutions - 1);
return numPreEvolutions;
}
//Calculate if previous evolution also has a previous evolution
if (numPreEvolutions != 0)
{
for (i = 0; i < NUM_SPECIES; i++)
{
const struct Evolution *evolutions = GetSpeciesEvolutions(species);
const struct Evolution *evolutions = GetSpeciesEvolutions(i);
if (evolutions == NULL)
continue;

View File

@ -6263,7 +6263,7 @@ u16 SanitizeSpeciesId(u16 species)
bool32 IsSpeciesEnabled(u16 species)
{
return gSpeciesInfo[species].baseHP > 0;
return gSpeciesInfo[species].baseHP > 0 || species == SPECIES_EGG;
}
void TryToSetBattleFormChangeMoves(struct Pokemon *mon, u16 method)

View File

@ -466,6 +466,21 @@ AI_DOUBLE_BATTLE_TEST("AI without any flags chooses moves at random - doubles")
}
}
AI_SINGLE_BATTLE_TEST("AI will choose either Rock Tomb or Bulldoze if Stat drop effect will activate and they kill with the same number of hits")
{
GIVEN {
AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT);
PLAYER(SPECIES_WOBBUFFET) { HP(46); Speed(20); }
PLAYER(SPECIES_WYNAUT) { Speed(20); }
OPPONENT(SPECIES_WOBBUFFET) { Speed(10); Moves(MOVE_BULLDOZE, MOVE_ROCK_TOMB); }
} WHEN {
TURN { EXPECT_MOVES(opponent, MOVE_BULLDOZE, MOVE_ROCK_TOMB); }
TURN { EXPECT_MOVES(opponent, MOVE_BULLDOZE, MOVE_ROCK_TOMB); SEND_OUT(player, 1); }
} SCENE {
MESSAGE("Wobbuffet fainted!");
}
}
AI_SINGLE_BATTLE_TEST("AI_FLAG_SMART_MON_CHOICES: AI will not switch in a Pokemon which is slower and gets 1HKOed after fainting")
{
bool32 alakazamFirst;