Merge branch 'followers' into followers-expanded-id

This commit is contained in:
Ariel A 2024-05-17 20:46:24 -04:00
commit d3849f2fc6
22 changed files with 154 additions and 335 deletions

View File

@ -427,7 +427,7 @@ $(ELF): $(OBJ_DIR)/ld_script.ld $(OBJS) libagbsyscall
$(ROM): $(ELF)
$(OBJCOPY) -O binary $< $@
$(FIX) $@ --silent
$(FIX) $@ -p --silent
modern: all

View File

@ -1,2 +1,2 @@
а2а2ба2а2а2а2а2а2а2ба2а2а2а2а2ба2а2а2аRаRбаRаRаRаRаRаRаRбаRаRаRаRаRбаRаRаRв2в2гв2в2в2в2в2в2в2гв2в2в2в2в2гв2в2в2дежзийкдежзийкдежзий 3 3с2т2у2ф2х2ц2ч23333333 3 3 3 3 3 3щ2ъыьэBюBяBCCC3 3 3 3 3 3 3ё2ђBѓBєBѕBіBїB C!C"C#C$C%C&3 3 3 3 3 3 3љ2њћќ§BўBџB(C)C*C+,-.3 3 3 3 3 3 3333301233435363 3 3 3 3 3 3 3
3 3 3 3338393:3;3<3=3>3>3 3 3 3
аабааааааабааааабааааабааааааабааааабаааввгвввввввгвввввгвввдежзийкдежзийкдежзий  стуфхцч      щъыьэюя      ёђѓєѕії !"#$%&      љњћќ§ўџ()*+,-.      0123456       
   89:;<=>>   

View File

@ -1,3 +1,8 @@
.macro IsFollowerFieldMoveUser var:req
callfunc ScrFunc_IsFollowerFieldMoveUser
.2byte \var
.endm
@ Interact with cuttable tree
EventScript_CutTree::
lockall
@ -12,8 +17,7 @@ EventScript_CutTree::
msgbox Text_MonUsedFieldMove, MSGBOX_DEFAULT
closemessage
EventScript_CutTreeCommon:
callfunc ScrFunc_IsFollowerFieldMoveUser
.2byte VAR_0x8004
IsFollowerFieldMoveUser VAR_0x8004
setfieldeffectargument 3, VAR_0x8004 @ skip pose if so
dofieldeffect FLDEFF_USE_CUT_ON_TREE
waitstate
@ -77,8 +81,7 @@ EventScript_RockSmash::
closemessage
EventScript_RockSmashCommon:
@ check if follower should use the field move
callfunc ScrFunc_IsFollowerFieldMoveUser
.2byte VAR_0x8004
IsFollowerFieldMoveUser VAR_0x8004
setfieldeffectargument 3, VAR_0x8004 @ skip pose if so
dofieldeffect FLDEFF_USE_ROCK_SMASH
waitstate

View File

@ -1,5 +1,5 @@
gText_FollowerLovesYou::
.string "123456789012345678901234567890123\n$"
.string "{STR_VAR_1} is regarding you with\nadoration!$"
gText_FollowerLostInThought::
.string "{STR_VAR_1} seems lost in thought.$"
@ -36,8 +36,8 @@ EventScript_FollowerEnd::
end
EventScript_FollowerLovesYou::
applymovement 0xFE ContestHall_Movement_Heart
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER ContestHall_Movement_Heart
waitmovement OBJ_EVENT_ID_FOLLOWER
waitmoncry
msgbox gText_FollowerLovesYou, MSGBOX_DEFAULT
return
@ -54,8 +54,8 @@ EventScript_FollowerGenericSkipFace:
EventScript_FollowerJump::
faceplayer
applymovement 0xFE FollowerSplashMovement
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerSplashMovement
waitmovement OBJ_EVENT_ID_FOLLOWER
waitfieldeffect FLDEFF_EMOTE
message 0x0
waitmessage
@ -394,44 +394,44 @@ EventScript_FollowerIsShivering::
goto EventScript_FollowerGeneric
ShiverVertical:
applymovement 0xFE FollowerShiverVerticalMovement
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerShiverVerticalMovement
waitmovement OBJ_EVENT_ID_FOLLOWER
return
ShiverHorizontal:
applymovement 0xFE FollowerShiverHorizontalMovement
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerShiverHorizontalMovement
waitmovement OBJ_EVENT_ID_FOLLOWER
return
EventScript_FollowerNostalgia::
applymovement 0xFE FollowerNostalgiaMovement
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerNostalgiaMovement
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGeneric
EventScript_FollowerHopping::
faceplayer
applymovement 0xFE FollowerSkippingMovement
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerSkippingMovement
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGeneric
JumpOnN:
applymovement 0xFE FollowerJumpOnPlayerNorth
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerJumpOnPlayerNorth
waitmovement OBJ_EVENT_ID_FOLLOWER
return
JumpOnS:
applymovement 0xFE FollowerJumpOnPlayerSouth
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerJumpOnPlayerSouth
waitmovement OBJ_EVENT_ID_FOLLOWER
return
JumpOnE:
applymovement 0xFE FollowerJumpOnPlayerEast
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerJumpOnPlayerEast
waitmovement OBJ_EVENT_ID_FOLLOWER
return
JumpOnW:
applymovement 0xFE FollowerJumpOnPlayerWest
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerJumpOnPlayerWest
waitmovement OBJ_EVENT_ID_FOLLOWER
return
EventScript_FollowerJumpOnPlayer::
@ -447,23 +447,23 @@ EventScript_FollowerJumpOnPlayer::
goto EventScript_FollowerGeneric
CuddleN:
applymovement 0xFE FollowerCuddlingNorth
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerCuddlingNorth
waitmovement OBJ_EVENT_ID_FOLLOWER
return
CuddleS:
applymovement 0xFE FollowerCuddlingSouth
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerCuddlingSouth
waitmovement OBJ_EVENT_ID_FOLLOWER
return
CuddleE:
applymovement 0xFE FollowerCuddlingEast
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerCuddlingEast
waitmovement OBJ_EVENT_ID_FOLLOWER
return
CuddleW:
applymovement 0xFE FollowerCuddlingWest
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerCuddlingWest
waitmovement OBJ_EVENT_ID_FOLLOWER
return
EventScript_FollowerCuddling:: @ similar to Std_MsgboxDefault
@ -479,31 +479,31 @@ EventScript_FollowerCuddling:: @ similar to Std_MsgboxDefault
goto EventScript_FollowerGeneric
ShCuddleN:
applymovement 0xFE FollowerShiverVerticalMovement
waitmovement 0xFE
applymovement 0xFE FollowerCuddlingNorth
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerShiverVerticalMovement
waitmovement OBJ_EVENT_ID_FOLLOWER
applymovement OBJ_EVENT_ID_FOLLOWER FollowerCuddlingNorth
waitmovement OBJ_EVENT_ID_FOLLOWER
return
ShCuddleS:
applymovement 0xFE FollowerShiverVerticalMovement
waitmovement 0xFE
applymovement 0xFE FollowerCuddlingSouth
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerShiverVerticalMovement
waitmovement OBJ_EVENT_ID_FOLLOWER
applymovement OBJ_EVENT_ID_FOLLOWER FollowerCuddlingSouth
waitmovement OBJ_EVENT_ID_FOLLOWER
return
ShCuddleE:
applymovement 0xFE FollowerShiverHorizontalMovement
waitmovement 0xFE
applymovement 0xFE FollowerCuddlingEast
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerShiverHorizontalMovement
waitmovement OBJ_EVENT_ID_FOLLOWER
applymovement OBJ_EVENT_ID_FOLLOWER FollowerCuddlingEast
waitmovement OBJ_EVENT_ID_FOLLOWER
return
ShCuddleW:
applymovement 0xFE FollowerShiverHorizontalMovement
waitmovement 0xFE
applymovement 0xFE FollowerCuddlingWest
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerShiverHorizontalMovement
waitmovement OBJ_EVENT_ID_FOLLOWER
applymovement OBJ_EVENT_ID_FOLLOWER FollowerCuddlingWest
waitmovement OBJ_EVENT_ID_FOLLOWER
return
EventScript_FollowerShiverCuddling::
@ -519,23 +519,23 @@ EventScript_FollowerShiverCuddling::
goto EventScript_FollowerGeneric
CreepCloserN:
applymovement 0xFE FollowerGetCloserNorth
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserNorth
waitmovement OBJ_EVENT_ID_FOLLOWER
return
CreepCloserS:
applymovement 0xFE FollowerGetCloserSouth
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserSouth
waitmovement OBJ_EVENT_ID_FOLLOWER
return
CreepCloserE:
applymovement 0xFE FollowerGetCloserEast
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserEast
waitmovement OBJ_EVENT_ID_FOLLOWER
return
CreepCloserW:
applymovement 0xFE FollowerGetCloserWest
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserWest
waitmovement OBJ_EVENT_ID_FOLLOWER
return
EventScript_FollowerGetCloser::
@ -551,23 +551,23 @@ EventScript_FollowerGetCloser::
goto EventScript_FollowerGeneric
PokePlayerN:
applymovement 0xFE FollowerGetCloserNorth
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserNorth
waitmovement OBJ_EVENT_ID_FOLLOWER
return
PokePlayerS:
applymovement 0xFE FollowerGetCloserSouth
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserSouth
waitmovement OBJ_EVENT_ID_FOLLOWER
return
PokePlayerE:
applymovement 0xFE FollowerGetCloserEast
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserEast
waitmovement OBJ_EVENT_ID_FOLLOWER
return
PokePlayerW:
applymovement 0xFE FollowerGetCloserWest
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerGetCloserWest
waitmovement OBJ_EVENT_ID_FOLLOWER
return
EventScript_FollowerPokingPlayer::
@ -583,60 +583,60 @@ EventScript_FollowerPokingPlayer::
goto EventScript_FollowerGeneric
EventScript_FollowerLookAround::
applymovement 0xFE FollowerLookAround
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerLookAround
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGeneric
EventScript_FollowerLookAway::
applymovement 0xFE FollowerLookAway
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerLookAway
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGenericSkipFace
EventScript_FollowerLookAwayBark::
applymovement 0xFE FollowerLookAwayBark
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerLookAwayBark
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGenericSkipFace
EventScript_FollowerLookAwayPoke::
applymovement 0xFE FollowerLookAwayPokeG
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerLookAwayPokeG
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGenericSkipFace
EventScript_FollowerPokeGround::
faceplayer
applymovement 0xFE FollowerPokeGround
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerPokeGround
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGeneric
EventScript_FollowerStartled::
applymovement 0xFE FollowerStartled
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerStartled
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGenericSkipFace
EventScript_FollowerFastHopping::
applymovement 0xFE FollowerHopFast
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerHopFast
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGenericSkipFace
EventScript_FollowerDizzy::
applymovement 0xFE FollowerDizzy
applymovement OBJ_EVENT_ID_FOLLOWER FollowerDizzy
waitmovement 0
goto EventScript_FollowerGenericSkipFace
EventScript_FollowerLookAroundScared::
applymovement 0xFE FollowerLookAroundScared
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER FollowerLookAroundScared
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGeneric
EventScript_FollowerDance::
faceplayer
applymovement 0xFE FollowerDance
applymovement OBJ_EVENT_ID_FOLLOWER FollowerDance
waitmovement 0
goto EventScript_FollowerGenericSkipFace
EventScript_FollowerFaceUp::
applymovement 0xFE Common_Movement_FaceUp
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER Common_Movement_FaceUp
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGenericSkipFace
EventScript_FollowerFaceResult:: @ Face towards direction in VAR_RESULT
@ -648,16 +648,16 @@ EventScript_FollowerFaceResult:: @ Face towards direction in VAR_RESULT
goto EventScript_FollowerGeneric
EventScript_FollowerFaceDown:
applymovement 0xFE Common_Movement_FaceDown
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER Common_Movement_FaceDown
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGenericSkipFace
EventScript_FollowerFaceLeft:
applymovement 0xFE Common_Movement_FaceLeft
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER Common_Movement_FaceLeft
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGenericSkipFace
EventScript_FollowerFaceRight:
applymovement 0xFE Common_Movement_FaceRight
waitmovement 0xFE
applymovement OBJ_EVENT_ID_FOLLOWER Common_Movement_FaceRight
waitmovement OBJ_EVENT_ID_FOLLOWER
goto EventScript_FollowerGenericSkipFace

View File

@ -1,149 +0,0 @@
Happy (Special):
Specific map:
{STR_VAR_1} greeted your mom.
Landscape/map feature:
{STR_VAR_1} greeted everyone!
{STR_VAR_1} greeted the two. (when standing in front of 2 trainers).
{STR_VAR_1} is very eager! ( gym ) must have type advantage.
{STR_VAR_1} greeted Amphy!
Neutral (Special):
Specific map:
Why is it doing warm-up exercises? (Cerulean Gym).
{STR_VAR_1} is running along the side of the pool! (Cerulean Gym).
Map feature:
Your pokemon is smelling the scent of the flowers. (When next to flowers in Cherrygrove City).
{STR_VAR_1} Greeted Slowbro (Cerulean city, in front of Slowbro).
{STR_VAR_1} is playing on the sand.
{STR_VAR_1} is staring fixedly at the sea.
{STR_VAR_1} is stomping on the grass!
{STR_VAR_1} is playing around, Picking bits of grass.
{STR_VAR_1} seems highly interested in the tree.
{STR_VAR_1} is looking outside and frolicking!
Pokemon exclusive:
(MAGIKARP) is leaping around more than usual (lake of rage, During team rockets broadcast) ( Pokemon Exclusive ).
Pokemon feature:
{STR_VAR_1} seems happy to have taken a shower! (Celadon gym) (Grass,Water type).
Misc:
{STR_VAR_1} seems dazzled after seeing the sky.
{STR_VAR_1} is fidgeting in front of everyone (maybe baby pokemon).
{STR_VAR_1} roared!
{STR_VAR_1} spun around in a circle!
Sad (Special):
Pokemon feature:
Upset (Special):
Specific map(s):
It seems to have eaten something strange. It's making an odd face... (Olivine Cafe).
{STR_VAR_1} is staring at the crumbling floor (burnt tower).
{STR_VAR_1} seems to think that (Player) has disappeared! ( Morty's Gym ).
Map feature:
{STR_VAR_1} is splashing around in the wet grass.
Pokemon feature:
Your pokemon doesn't like splashing around on the ground (must be fire type).
Misc:
{STR_VAR_1} seems to feel a little claustrophobic.
{STR_VAR_1} is a bit nervous about the narrow space!
{STR_VAR_1} seems uneasy and is poking (PLAYER).
Angry (Special):
Map feature:
{STR_VAR_1} is staring at the Persian statue and glaring.
{STR_VAR_1} is glaring at the PERSIAN statue!
{STR_VAR_1} is glaring at your foe!
{STR_VAR_1} is intimidating your foe!
Pensive (Special):
Specific map(s):
{STR_VAR_1} seems to be listening to the sound of rustling leaves.
{STR_VAR_1} is preoccupied by the ceiling, which seems like it may collapse (burnt tower).
{STR_VAR_1} is concerned about the swaying pillar (sprout tower).
Your pokemon is drooling a little (Olivine Cafe).
{STR_VAR_1} is preoccupied by the floor, which seems like it may collapse (burnt tower).
Map feature:
{STR_VAR_1} is staring intently at the reflection of its face.
{STR_VAR_1} seems interested in Amphy...
{STR_VAR_1} has a sleepy look on its face... (Near Jigglypuff in Radio Tower.).
Misc:
Your pokemon turned to face the other way, showing a defiant expression.
Music (Special):
Map feature:
{STR_VAR_1} is pulling out the grass.
{STR_VAR_1} is happy to see what's out doors!
{STR_VAR_1} is listening intently to the sound of the waves.
Your pokemon is staring spellbound at the night sky!
Your pokemon seems to be enjoying sliding around!
{STR_VAR_1} is steadily observing the flow of the river.
{STR_VAR_1} is noticing the scent of the grass.
Misc:
{STR_VAR_1} seems happy at the sight of water on the window!
{STR_VAR_1} is looking up at the ceiling.
{STR_VAR_1} seems to be enjoying this a little bit!
{STR_VAR_1} is wandering around enjoying the forest scenery.
{STR_VAR_1} is playing around in the fallen leaves.
{STR_VAR_1} is playing around with a leaf.
{STR_VAR_1} is playing around, touching the leaves.
Your pokemon is happily gazing at the beautiful, starry sky!
{STR_VAR_1} is rolling around in the grass.
{STR_VAR_1} seems to want to return to the lab (after you receive the Mystery egg).
Your pokemon is staring at the various items.
{STR_VAR_1} is looking up the tall mountain... (Mt. Mortar).
{STR_VAR_1} seems concerned about the waterfall.
{STR_VAR_1} is sniffing around the room. (Inside Hero's Room).
{STR_VAR_1} is dancing around the pillar! (Seems to occur more for Bellsprout)(sprout tower).
{STR_VAR_1} swayed around, dancing in a strange manner.(Seems to occur more for Bellsprout)(sprout tower).
{STR_VAR_1} swayed and danced around as it pleased (Seems to occur more for Bellsprout)(sprout tower).
Your Pokemon is playing around and splashing in the water! (Water's edge).
{STR_VAR_1} is looking up at the sky.
{STR_VAR_1} is poking at garbage (Goldenrods underground path).
Your pokemon is rolling a screw from a bicycle around.
{STR_VAR_1} is looking up at the sky.
{STR_VAR_1} is clawing the grass!
{STR_VAR_1} is looking around restlessly at the Forest.
{STR_VAR_1} is playfully nibbling at the ground.
(CYNDAQUIL) blew out a fireball. ( Pokemon Exclusive ).
(CYNDAQUIL) blew out a couple of fireballs. ( Pokemon Exclusive ).
(CHIKORITA) is waving its leaf around ( Pokemon Exclusive ).
(CHIKORITA) is making its leaf twitch ( Pokemon Exclusive ).
(TODADILE) is moving its jaw ( Pokemon Exclusive ).
(TODADILE) is opening and closing its mouth ( Pokemon Exclusive ).
{STR_VAR_1} is playing in the puddle.
{STR_VAR_1} is gazing restlessly at the building ( in goldenrod).
Surprised (Special):
{STR_VAR_1} seems to have gotten caught in the clumps of grass.
{STR_VAR_1} slipped on the floor and seems likely to fall!
Your pokemon is very concerned about the room below ( Burnt tower ).
Careful! seems like the floor could collapse, and it might fall.
{STR_VAR_1} seems to think that (Player) has disappeared! ( Morty's Gym ).
{STR_VAR_1} gazed surprisingly at the rock!
Huh? your pokemon found something in top of the mountain ( outside Mt. Mortar) (!).
{STR_VAR_1} got tangled up in the branches and almost fell down!
{STR_VAR_1} looked up at the sky and shouted loudly.
{STR_VAR_1} seems to have found something!
{STR_VAR_1} almost forgot it was holding that (Held item).
{STR_VAR_1} is happy at the sight of the water on the window!
{STR_VAR_1} was surprised by the sounds in the thicket!
Seems the breeze is coming from here.
Oh! its slipping and came over here for support (on ice).
{STR_VAR_1} seems to have gotten a bit of zap! (Power plant).
{STR_VAR_1} is dazzled by the shiny brightness of the bridge! (Standing on Nugget Bridge).
{STR_VAR_1} is slipping on the water and almost fell over!
Curious (Special):
{STR_VAR_1} feels something... (burnt tower basement).
{STR_VAR_1} seems to be hearing a strange sound. (Rocket hideout in Mahogany).
{STR_VAR_1} seems to be hearing a strange sound. (Team rocket hide out).
{STR_VAR_1} is concerned about the other side of the fence, it seems.
{STR_VAR_1} is looking at the machine in a strange manner. (Power plant).

View File

@ -583,7 +583,7 @@ u8 CreateSpriteAt(u8 index, const struct SpriteTemplate *template, s16 x, s16 y,
if (sprite->oam.affineMode & ST_OAM_AFFINE_ON_MASK)
InitSpriteAffineAnim(sprite);
if (template->paletteTag != TAG_NONE) // TODO: Load sprite palette if tag not present
if (template->paletteTag != TAG_NONE)
sprite->oam.paletteNum = IndexOfSpritePaletteTag(template->paletteTag);
return index;

View File

@ -25,7 +25,7 @@ struct CompressedSpriteSheet
struct SpriteFrameImage
{
const void *data;
u16 size;
u16 size;
};
#define obj_frame_tiles(ptr) {.data = (u8 *)ptr, .size = sizeof ptr}

View File

@ -1,19 +0,0 @@
JASC-PAL
0100
16
110 198 165
255 213 18
255 214 38
254 217 39
254 218 53
255 220 65
255 221 76
255 223 86
254 225 95
254 228 104
254 229 112
254 230 120
255 232 132
255 235 148
255 237 162
255 240 176

View File

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 B

View File

@ -240,7 +240,7 @@
#define OBJ_EVENT_GFX_LINK_RS_MAY 236
#define OBJ_EVENT_GFX_LUGIA 237
#define OBJ_EVENT_GFX_HOOH 238
#define OBJ_EVENT_GFX_ANIMATED_BALL OBJ_EVENT_GFX_ITEM_BALL // replaces ITEM_BALL
#define OBJ_EVENT_GFX_POKE_BALL OBJ_EVENT_GFX_ITEM_BALL // replaces ITEM_BALL
#define OBJ_EVENT_GFX_OW_MON OBJ_EVENT_GFX_REGICE
// NOTE: By default, the max value for NUM_OBJ_EVENT_GFX is 239.

View File

@ -448,7 +448,7 @@ bool8 FollowablePlayerMovement_Step(struct ObjectEvent *, struct Sprite *, u8, b
bool8 FollowablePlayerMovement_GoSpeed1(struct ObjectEvent *, struct Sprite *, u8, bool8(u8));
bool8 FollowablePlayerMovement_GoSpeed2(struct ObjectEvent *, struct Sprite *, u8, bool8(u8));
bool8 FollowablePlayerMovement_Slide(struct ObjectEvent *, struct Sprite *, u8, bool8(u8));
bool8 fph_IM_DIFFERENT(struct ObjectEvent *, struct Sprite *, u8, bool8(u8));
bool8 FollowablePlayerMovement_JumpInPlace(struct ObjectEvent *, struct Sprite *, u8, bool8(u8));
bool8 FollowablePlayerMovement_GoSpeed4(struct ObjectEvent *, struct Sprite *, u8, bool8(u8));
bool8 FollowablePlayerMovement_Jump(struct ObjectEvent *, struct Sprite *, u8, bool8(u8));
bool8 CopyablePlayerMovement_Jump2(struct ObjectEvent *, struct Sprite *, u8, bool8(u8));

View File

@ -7,6 +7,7 @@ extern u32 gRng2Value;
//Returns a 16-bit pseudorandom number
u16 Random(void);
u16 Random2(void);
u8 RandomWeightedIndex(u8 *weights, u8 length);
//Returns a 32-bit pseudorandom number
#define Random32() (Random() | (Random() << 16))

View File

@ -469,7 +469,7 @@ $(OBJEVENTGFXDIR)/pokemon/wingull_old.4bpp: %.4bpp: %.png
$(OBJEVENTGFXDIR)/pokemon/zigzagoon_old.4bpp: %.4bpp: %.png
$(GFX) $< $@ -mwidth 2 -mheight 2
$(OBJEVENTGFXDIR)/misc/animated_ball.4bpp: %.4bpp: %.png
$(OBJEVENTGFXDIR)/misc/ball_poke.4bpp: %.4bpp: %.png
$(GFX) $< $@ -mwidth 2 -mheight 4
$(OBJEVENTGFXDIR)/berry_trees/aguav.4bpp: %.4bpp: %.png

View File

@ -414,7 +414,7 @@ bool8 (*const gFollowPlayerMovementFuncs[])(struct ObjectEvent *, struct Sprite
[COPY_MOVE_WALK_FAST] = FollowablePlayerMovement_GoSpeed1,
[COPY_MOVE_WALK_FASTER] = FollowablePlayerMovement_GoSpeed2,
[COPY_MOVE_SLIDE] = FollowablePlayerMovement_Slide,
[COPY_MOVE_JUMP_IN_PLACE] = fph_IM_DIFFERENT,
[COPY_MOVE_JUMP_IN_PLACE] = FollowablePlayerMovement_JumpInPlace,
[COPY_MOVE_JUMP] = FollowablePlayerMovement_GoSpeed4,
[COPY_MOVE_JUMP2] = FollowablePlayerMovement_Step,
[COPY_MOVE_EMPTY_1] = FollowablePlayerMovement_Idle,

View File

@ -124,7 +124,6 @@ const u32 gObjectEventPic_CyclingTriathleteF[] = INCBIN_U32("graphics/object_eve
const u32 gObjectEventPic_Man4[] = INCBIN_U32("graphics/object_events/pics/people/man_4.4bpp");
const u32 gObjectEventPic_Man5[] = INCBIN_U32("graphics/object_events/pics/people/man_5.4bpp");
const u32 gObjectEventPic_Nurse[] = INCBIN_U32("graphics/object_events/pics/people/nurse.4bpp");
const u32 gObjectEventPic_ItemBall[] = INCBIN_U32("graphics/object_events/pics/misc/item_ball.4bpp");
const u32 gObjectEventPic_ProfBirch[] = INCBIN_U32("graphics/object_events/pics/people/prof_birch.4bpp");
const u32 gObjectEventPic_ReporterM[] = INCBIN_U32("graphics/object_events/pics/people/reporter_m.4bpp");
const u32 gObjectEventPic_ReporterF[] = INCBIN_U32("graphics/object_events/pics/people/reporter_f.4bpp");
@ -342,7 +341,7 @@ const u32 gObjectEventPic_Greta[] = INCBIN_U32("graphics/object_events/pics/peop
const u32 gObjectEventPic_Noland[] = INCBIN_U32("graphics/object_events/pics/people/frontier_brains/noland.4bpp");
const u32 gObjectEventPic_Lucy[] = INCBIN_U32("graphics/object_events/pics/people/frontier_brains/lucy.4bpp");
const u32 gObjectEventPic_Brandon[] = INCBIN_U32("graphics/object_events/pics/people/frontier_brains/brandon.4bpp");
const u32 gObjectEventPic_AnimatedBall[] = INCBIN_U32("graphics/object_events/pics/misc/animated_ball.4bpp");
const u32 gObjectEventPic_PokeBall[] = INCBIN_U32("graphics/object_events/pics/misc/ball_poke.4bpp");
// Normally, INCBIN_COMP acts like INCBIN_U32, but appends `.lz` to the file, compressing it;
// If not compressing follower gfx, make this an alias to INCBIN_32, so gfx will *not* be compressed

View File

@ -58,7 +58,6 @@ const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hiker = {TAG_NONE,
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteM = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 4, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_CyclingTriathleteM, gDummySpriteAffineAnimTable};
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteF = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_BIKE_TIRE, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_AcroBike, sPicTable_CyclingTriathleteF, gDummySpriteAffineAnimTable};
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Nurse = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Nurse, sPicTable_Nurse, gDummySpriteAffineAnimTable};
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ItemBall = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 128, 16, 16, 4, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_Inanimate, sPicTable_ItemBall, gDummySpriteAffineAnimTable};
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTree = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, NULL, sAnimTable_BerryTree, sPicTable_PechaBerryTree, gDummySpriteAffineAnimTable};
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeEarlyStages = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 16, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x16, sOamTables_16x16, sAnimTable_BerryTree, sPicTable_PechaBerryTree, gDummySpriteAffineAnimTable};
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeLateStages = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_1, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_S, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_BerryTree, sPicTable_PechaBerryTree, gDummySpriteAffineAnimTable};
@ -243,5 +242,5 @@ const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireBrenda
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphireMay = {TAG_NONE, OBJ_EVENT_PAL_TAG_RS_MAY, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Standard, sPicTable_RubySapphireMay, gDummySpriteAffineAnimTable};
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lugia = {TAG_NONE, OBJ_EVENT_PAL_TAG_LUGIA, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Standard, sPicTable_LugiaOld, gDummySpriteAffineAnimTable};
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HoOh = {TAG_NONE, OBJ_EVENT_PAL_TAG_HO_OH, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 10, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_HoOh, sPicTable_HoOhOld, gDummySpriteAffineAnimTable};
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AnimatedBall = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Following, sPicTable_AnimatedBall, gDummySpriteAffineAnimTable};
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokeBall = {TAG_NONE, OBJ_EVENT_PAL_TAG_NPC_3, OBJ_EVENT_PAL_TAG_NONE, 256, 16, 32, 2, SHADOW_SIZE_M, TRUE, FALSE, TRACKS_NONE, &gObjectEventBaseOam_16x32, sOamTables_16x32, sAnimTable_Following, sPicTable_PokeBall, gDummySpriteAffineAnimTable};
const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Follower = {TAG_NONE, OBJ_EVENT_PAL_TAG_DYNAMIC, OBJ_EVENT_PAL_TAG_NONE, 512, 32, 32, 2, SHADOW_SIZE_M, FALSE, FALSE, TRACKS_FOOT, &gObjectEventBaseOam_32x32, sOamTables_32x32, sAnimTable_Following, sPicTable_Togetic, gDummySpriteAffineAnimTable};

View File

@ -57,7 +57,6 @@ extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Hiker;
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteM;
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_CyclingTriathleteF;
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Nurse;
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_ItemBall;
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTree;
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeEarlyStages;
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_BerryTreeLateStages;
@ -238,7 +237,7 @@ extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_RubySapphir
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Lugia;
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_HoOh;
// Begin pokemon event objects
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_AnimatedBall;
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_PokeBall;
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Follower;
extern const struct ObjectEventGraphicsInfo gObjectEventGraphicsInfo_Bard;
@ -310,7 +309,7 @@ const struct ObjectEventGraphicsInfo *const gObjectEventGraphicsInfoPointers[NUM
[OBJ_EVENT_GFX_CYCLING_TRIATHLETE_M] = &gObjectEventGraphicsInfo_CyclingTriathleteM,
[OBJ_EVENT_GFX_CYCLING_TRIATHLETE_F] = &gObjectEventGraphicsInfo_CyclingTriathleteF,
[OBJ_EVENT_GFX_NURSE] = &gObjectEventGraphicsInfo_Nurse,
// [OBJ_EVENT_GFX_ITEM_BALL] = &gObjectEventGraphicsInfo_AnimatedBall,
// [OBJ_EVENT_GFX_ITEM_BALL] = &gObjectEventGraphicsInfo_PokeBall,
[OBJ_EVENT_GFX_BERRY_TREE] = &gObjectEventGraphicsInfo_BerryTree,
[OBJ_EVENT_GFX_BERRY_TREE_EARLY_STAGES] = &gObjectEventGraphicsInfo_BerryTreeEarlyStages,
[OBJ_EVENT_GFX_BERRY_TREE_LATE_STAGES] = &gObjectEventGraphicsInfo_BerryTreeLateStages,
@ -490,7 +489,7 @@ const struct ObjectEventGraphicsInfo *const gObjectEventGraphicsInfoPointers[NUM
[OBJ_EVENT_GFX_LINK_RS_MAY] = &gObjectEventGraphicsInfo_RubySapphireMay,
[OBJ_EVENT_GFX_LUGIA] = &gObjectEventGraphicsInfo_Lugia,
[OBJ_EVENT_GFX_HOOH] = &gObjectEventGraphicsInfo_HoOh,
[OBJ_EVENT_GFX_ANIMATED_BALL] = &gObjectEventGraphicsInfo_AnimatedBall,
[OBJ_EVENT_GFX_POKE_BALL] = &gObjectEventGraphicsInfo_PokeBall,
[OBJ_EVENT_GFX_OW_MON] = &gObjectEventGraphicsInfo_Follower,
};

View File

@ -743,10 +743,6 @@ static const struct SpriteFrameImage sPicTable_Nurse[] = {
overworld_frame(gObjectEventPic_Nurse, 2, 4, 3),
};
static const struct SpriteFrameImage sPicTable_ItemBall[] = {
obj_frame_tiles(gObjectEventPic_ItemBall),
};
static const struct SpriteFrameImage sPicTable_ProfBirch[] = {
overworld_frame(gObjectEventPic_ProfBirch, 2, 4, 0),
overworld_frame(gObjectEventPic_ProfBirch, 2, 4, 1),
@ -1981,13 +1977,13 @@ static const struct SpriteFrameImage sPicTable_Brandon[] = {
overworld_frame(gObjectEventPic_Brandon, 2, 4, 8),
};
static const struct SpriteFrameImage sPicTable_AnimatedBall[] = {
overworld_frame(gObjectEventPic_AnimatedBall, 2, 4, 0),
overworld_frame(gObjectEventPic_AnimatedBall, 2, 4, 1),
overworld_frame(gObjectEventPic_AnimatedBall, 2, 4, 2),
overworld_frame(gObjectEventPic_AnimatedBall, 2, 4, 3),
overworld_frame(gObjectEventPic_AnimatedBall, 2, 4, 4),
overworld_frame(gObjectEventPic_AnimatedBall, 2, 4, 0),
static const struct SpriteFrameImage sPicTable_PokeBall[] = {
overworld_frame(gObjectEventPic_PokeBall, 2, 4, 0),
overworld_frame(gObjectEventPic_PokeBall, 2, 4, 1),
overworld_frame(gObjectEventPic_PokeBall, 2, 4, 2),
overworld_frame(gObjectEventPic_PokeBall, 2, 4, 3),
overworld_frame(gObjectEventPic_PokeBall, 2, 4, 4),
overworld_frame(gObjectEventPic_PokeBall, 2, 4, 0),
};
#if OW_MON_POKEBALLS

View File

@ -162,7 +162,7 @@ static const struct ObjectEventTemplate *GetObjectEventTemplateByLocalIdAndMap(u
static void RemoveObjectEventIfOutsideView(struct ObjectEvent *);
static void SpawnObjectEventOnReturnToField(u8, s16, s16);
static void SetPlayerAvatarObjectEventIdAndObjectId(u8, u8);
static u8 UpdateSpritePalette(const struct SpritePalette * spritePalette, struct Sprite * sprite);
static u8 UpdateSpritePalette(const struct SpritePalette *spritePalette, struct Sprite *sprite);
static void ResetObjectEventFldEffData(struct ObjectEvent *);
static u8 LoadSpritePaletteIfTagExists(const struct SpritePalette *);
static u8 FindObjectEventPaletteIndexByTag(u16);
@ -191,7 +191,7 @@ static void CreateLevitateMovementTask(struct ObjectEvent *);
static void DestroyLevitateMovementTask(u8);
static bool8 GetFollowerInfo(u16 *species, u8 *form, u8 *shiny);
static u8 LoadDynamicFollowerPalette(u16 species, u8 form, bool32 shiny);
static const struct ObjectEventGraphicsInfo * SpeciesToGraphicsInfo(u16 species, u8 form);
static const struct ObjectEventGraphicsInfo *SpeciesToGraphicsInfo(u16 species, u8 form);
static bool8 NpcTakeStep(struct Sprite *);
static bool8 IsElevationMismatchAt(u8, s16, s16);
static bool8 AreElevationsCompatible(u8, u8);
@ -1906,7 +1906,7 @@ u8 CreateVirtualObject(u16 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 elevati
return spriteId;
}
struct Pokemon * GetFirstLiveMon(void) { // Return address of first conscious party mon or NULL
struct Pokemon *GetFirstLiveMon(void) { // Return address of first conscious party mon or NULL
u32 i;
for (i = 0; i < PARTY_SIZE; i++) {
if (gPlayerParty[i].hp > 0 && !(gPlayerParty[i].box.isEgg || gPlayerParty[i].box.isBadEgg))
@ -1915,7 +1915,7 @@ struct Pokemon * GetFirstLiveMon(void) { // Return address of first conscious pa
return NULL;
}
struct ObjectEvent * GetFollowerObject(void) { // Return follower ObjectEvent or NULL
struct ObjectEvent *GetFollowerObject(void) { // Return follower ObjectEvent or NULL
u32 i;
for (i = 0; i < OBJECT_EVENTS_COUNT; i++) {
if (gObjectEvents[i].localId == OBJ_EVENT_ID_FOLLOWER && gObjectEvents[i].active)
@ -1925,7 +1925,7 @@ struct ObjectEvent * GetFollowerObject(void) { // Return follower ObjectEvent or
}
// Return graphicsInfo for a pokemon species & form
static const struct ObjectEventGraphicsInfo * SpeciesToGraphicsInfo(u16 species, u8 form) {
static const struct ObjectEventGraphicsInfo *SpeciesToGraphicsInfo(u16 species, u8 form) {
const struct ObjectEventGraphicsInfo *graphicsInfo;
switch (species)
{
@ -2010,16 +2010,14 @@ static void RefreshFollowerGraphics(struct ObjectEvent *objEvent) {
u32 i = FindObjectEventPaletteIndexByTag(graphicsInfo->paletteTag);
if (graphicsInfo->oam->size != sprite->oam.size) {
#if LARGE_OW_SUPPORT && !OW_GFX_COMPRESS
ReallocSpriteTiles(sprite, graphicsInfo->images->size);
#endif
if (LARGE_OW_SUPPORT && !OW_GFX_COMPRESS)
ReallocSpriteTiles(sprite, graphicsInfo->images->size);
// Add difference in Y vectors
sprite->y += -(graphicsInfo->height >> 1) - sprite->centerToCornerVecY;
}
#if OW_GFX_COMPRESS
LoadSheetGraphicsInfo(graphicsInfo, objEvent->graphicsId, sprite);
#endif
if (OW_GFX_COMPRESS)
LoadSheetGraphicsInfo(graphicsInfo, objEvent->graphicsId, sprite);
sprite->oam.shape = graphicsInfo->oam->shape;
sprite->oam.size = graphicsInfo->oam->size;
@ -2152,22 +2150,6 @@ static bool8 SpeciesHasType(u16 species, u8 type) {
return gSpeciesInfo[species].types[0] == type || gSpeciesInfo[species].types[1] == type;
}
// Returns a random index according to a list of weights
static u8 RandomWeightedIndex(u8 *weights, u8 length) {
u32 i;
u16 random_value;
u16 weightSum = 0;
for (i = 0; i < length; i++)
weightSum += weights[i];
random_value = Random() % weightSum;
weightSum = 0;
for (i = 0; i < length; i++) {
weightSum += weights[i];
if (random_value <= weightSum)
return i;
}
}
// Display an emote above an object event
// Note that this is not a movement action
static void ObjectEventEmote(struct ObjectEvent *objEvent, u8 emotion) {
@ -2624,7 +2606,7 @@ static void SetPlayerAvatarObjectEventIdAndObjectId(u8 objectEventId, u8 spriteI
}
// Update sprite's palette, freeing old palette if necessary
static u8 UpdateSpritePalette(const struct SpritePalette * spritePalette, struct Sprite * sprite) {
static u8 UpdateSpritePalette(const struct SpritePalette *spritePalette, struct Sprite *sprite) {
// Free palette if otherwise unused
sprite->inUse = FALSE;
FieldEffectFreePaletteIfUnused(sprite->oam.paletteNum);
@ -2633,7 +2615,7 @@ static u8 UpdateSpritePalette(const struct SpritePalette * spritePalette, struct
}
// Find and update based on template's paletteTag
u8 UpdateSpritePaletteByTemplate(const struct SpriteTemplate * template, struct Sprite * sprite) {
u8 UpdateSpritePaletteByTemplate(const struct SpriteTemplate *template, struct Sprite *sprite) {
u8 i = FindObjectEventPaletteIndexByTag(template->paletteTag);
if (i == 0xFF)
return i;
@ -2647,11 +2629,9 @@ static void ObjectEventSetGraphics(struct ObjectEvent *objectEvent, const struct
if (i != 0xFF)
UpdateSpritePalette(&sObjectEventSpritePalettes[i], sprite);
#if LARGE_OW_SUPPORT && !OW_GFX_COMPRESS
// If gfx size changes, we need to reallocate tiles
if (graphicsInfo->oam->size != sprite->oam.size)
if (LARGE_OW_SUPPORT && !OW_GFX_COMPRESS && graphicsInfo->oam->size != sprite->oam.size)
ReallocSpriteTiles(sprite, graphicsInfo->images->size);
#endif
#if OW_GFX_COMPRESS
LoadSheetGraphicsInfo(graphicsInfo, objectEvent->graphicsId, sprite);
@ -5494,7 +5474,7 @@ bool8 FollowablePlayerMovement_Slide(struct ObjectEvent *objectEvent, struct Spr
return TRUE;
}
bool8 fph_IM_DIFFERENT(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8))
bool8 FollowablePlayerMovement_JumpInPlace(struct ObjectEvent *objectEvent, struct Sprite *sprite, u8 playerDirection, bool8 tileCallback(u8))
{
u32 direction;
@ -7007,7 +6987,7 @@ static void ObjectEventSetPokeballGfx(struct ObjectEvent *objEvent) {
}
}
#endif
ObjectEventSetGraphicsId(objEvent, OBJ_EVENT_GFX_ANIMATED_BALL);
ObjectEventSetGraphicsId(objEvent, OBJ_EVENT_GFX_POKE_BALL);
}
#define sDuration data[3]
@ -7095,10 +7075,8 @@ bool8 MovementAction_ExitPokeball_Step1(struct ObjectEvent *objectEvent, struct
LoadFillColorPalette(RGB_WHITE, OBJ_EVENT_PAL_TAG_WHITE, sprite);
// Initialize affine animation
sprite->affineAnims = sAffineAnims_PokeballFollower;
#if LARGE_OW_SUPPORT
if (!IS_POW_OF_TWO(-sprite->centerToCornerVecX))
if (LARGE_OW_SUPPORT && !IS_POW_OF_TWO(-sprite->centerToCornerVecX))
return FALSE;
#endif
sprite->affineAnims = sAffineAnims_PokeballFollower;
sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL;
InitSpriteAffineAnim(sprite);
@ -7135,12 +7113,10 @@ bool8 MovementAction_EnterPokeball_Step1(struct ObjectEvent *objectEvent, struct
} else if (sprite->sDuration == 11) { // Set palette to white & start affine
LoadFillColorPalette(RGB_WHITE, OBJ_EVENT_PAL_TAG_WHITE, sprite);
sprite->subspriteTableNum = 0;
#if LARGE_OW_SUPPORT
// Only do affine if sprite width is power of 2
// (effect looks weird on sprites composed of subsprites like 48x48, etc)
if (!IS_POW_OF_TWO(-sprite->centerToCornerVecX))
if (LARGE_OW_SUPPORT && !IS_POW_OF_TWO(-sprite->centerToCornerVecX))
return FALSE;
#endif
sprite->affineAnims = sAffineAnims_PokeballFollower;
sprite->oam.affineMode = ST_OAM_AFFINE_NORMAL;
InitSpriteAffineAnim(sprite);
@ -9176,11 +9152,10 @@ static void UpdateObjectEventElevationAndPriority(struct ObjectEvent *objEvent,
ObjectEventUpdateElevation(objEvent, sprite);
if (objEvent->localId == OBJ_EVENT_ID_FOLLOWER) {
#if LARGE_OW_SUPPORT
// keep subspriteMode synced with player's
// so that it disappears under bridges when they do
sprite->subspriteMode |= gSprites[gPlayerAvatar.spriteId].subspriteMode & SUBSPRITES_IGNORE_PRIORITY;
#endif
if (LARGE_OW_SUPPORT)
sprite->subspriteMode |= gSprites[gPlayerAvatar.spriteId].subspriteMode & SUBSPRITES_IGNORE_PRIORITY;
// if transitioning between elevations, use the player's elevation
if (!objEvent->currentElevation)
objEvent = &gObjectEvents[gPlayerAvatar.objectEventId];
@ -9208,11 +9183,10 @@ void ObjectEventUpdateElevation(struct ObjectEvent *objEvent, struct Sprite *spr
u8 prevElevation = MapGridGetElevationAt(objEvent->previousCoords.x, objEvent->previousCoords.y);
if (curElevation == 15 || prevElevation == 15) {
#if LARGE_OW_SUPPORT
// Ignore subsprite priorities under bridges
// so all subsprites will display below it
sprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY;
#endif
if (LARGE_OW_SUPPORT)
sprite->subspriteMode = SUBSPRITES_IGNORE_PRIORITY;
return;
}
@ -10299,7 +10273,7 @@ static void DoShadowFieldEffect(struct ObjectEvent *objectEvent)
{
if (!objectEvent->hasShadow)
{
objectEvent->hasShadow = 1;
objectEvent->hasShadow = TRUE;
StartFieldEffectForObjectEvent(FLDEFF_SHADOW, objectEvent);
}
}

View File

@ -3100,7 +3100,7 @@ u8 FldEff_RayquazaSpotlight(void)
struct Sprite *sprite = &gSprites[spriteId];
sprite->oam.priority = 1;
sprite->oam.paletteNum = 4; // TODO: What (dynamic) palette should this Raquaza use?
sprite->oam.paletteNum = 4;
sprite->data[0] = 0;
sprite->data[1] = 0;
sprite->data[2] = 0;

View File

@ -31,3 +31,19 @@ u16 Random2(void)
gRng2Value = ISO_RANDOMIZE1(gRng2Value);
return gRng2Value >> 16;
}
// Returns a random index according to a list of weights
u8 RandomWeightedIndex(u8 *weights, u8 length) {
u32 i;
u16 random_value;
u16 weightSum = 0;
for (i = 0; i < length; i++)
weightSum += weights[i];
random_value = Random() % weightSum;
weightSum = 0;
for (i = 0; i < length; i++) {
weightSum += weights[i];
if (random_value <= weightSum)
return i;
}
}