mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-19 01:44:20 +01:00
SetPlayerAvatarFieldObjectIdAndObjectId
This commit is contained in:
parent
11786cc325
commit
f8e8adf82e
@ -5,32 +5,6 @@
|
|||||||
|
|
||||||
.text
|
.text
|
||||||
|
|
||||||
thumb_func_start SetPlayerAvatarFieldObjectIdAndObjectId
|
|
||||||
@ void SetPlayerAvatarFieldObjectIdAndObjectId(u8 fieldObjectId, u8 objectId)
|
|
||||||
SetPlayerAvatarFieldObjectIdAndObjectId: @ 808E3C4
|
|
||||||
push {r4,r5,lr}
|
|
||||||
lsls r0, 24
|
|
||||||
lsrs r0, 24
|
|
||||||
ldr r5, =gPlayerAvatar
|
|
||||||
strb r0, [r5, 0x5]
|
|
||||||
strb r1, [r5, 0x4]
|
|
||||||
ldr r1, =gMapObjects
|
|
||||||
lsls r4, r0, 3
|
|
||||||
adds r4, r0
|
|
||||||
lsls r4, 2
|
|
||||||
adds r4, r1
|
|
||||||
ldrb r0, [r4, 0x5]
|
|
||||||
bl GetPlayerAvatarGenderByGraphicsId
|
|
||||||
strb r0, [r5, 0x7]
|
|
||||||
ldrb r0, [r4, 0x5]
|
|
||||||
movs r1, 0x20
|
|
||||||
bl SetPlayerAvatarExtraStateTransition
|
|
||||||
pop {r4,r5}
|
|
||||||
pop {r0}
|
|
||||||
bx r0
|
|
||||||
.pool
|
|
||||||
thumb_func_end SetPlayerAvatarFieldObjectIdAndObjectId
|
|
||||||
|
|
||||||
thumb_func_start FieldObjectSetGraphicsId
|
thumb_func_start FieldObjectSetGraphicsId
|
||||||
@ void FieldObjectSetGraphicsId(npc_state *npcState, u8 graphicsId)
|
@ void FieldObjectSetGraphicsId(npc_state *npcState, u8 graphicsId)
|
||||||
FieldObjectSetGraphicsId: @ 808E3F8
|
FieldObjectSetGraphicsId: @ 808E3F8
|
||||||
|
@ -6,5 +6,7 @@
|
|||||||
#define POKEEMERALD_FIELD_PLAYER_AVATAR_H
|
#define POKEEMERALD_FIELD_PLAYER_AVATAR_H
|
||||||
|
|
||||||
void ClearPlayerAvatarInfo(void);
|
void ClearPlayerAvatarInfo(void);
|
||||||
|
void SetPlayerAvatarExtraStateTransition(u8, u8);
|
||||||
|
u8 GetPlayerAvatarGenderByGraphicsId(u8);
|
||||||
|
|
||||||
#endif //POKEEMERALD_FIELD_PLAYER_AVATAR_H
|
#endif //POKEEMERALD_FIELD_PLAYER_AVATAR_H
|
||||||
|
@ -36,7 +36,7 @@ static void MakeObjectTemplateFromFieldObjectTemplate(struct MapObjectTemplate *
|
|||||||
/*static*/ void sub_808E894(u16);
|
/*static*/ void sub_808E894(u16);
|
||||||
static void RemoveFieldObjectIfOutsideView(struct MapObject *);
|
static void RemoveFieldObjectIfOutsideView(struct MapObject *);
|
||||||
static void sub_808E1B8(u8, s16, s16);
|
static void sub_808E1B8(u8, s16, s16);
|
||||||
/*static*/ void SetPlayerAvatarFieldObjectIdAndObjectId(u8, u8);
|
static void SetPlayerAvatarFieldObjectIdAndObjectId(u8, u8);
|
||||||
/*static*/ void sub_808E38C(struct MapObject *);
|
/*static*/ void sub_808E38C(struct MapObject *);
|
||||||
|
|
||||||
// ROM data
|
// ROM data
|
||||||
@ -205,6 +205,8 @@ static u8 InitFieldObjectStateFromTemplate(struct MapObjectTemplate *template, u
|
|||||||
mapObject->mapobj_unk_20 = gUnknown_085055CD[template->movementType];
|
mapObject->mapobj_unk_20 = gUnknown_085055CD[template->movementType];
|
||||||
FieldObjectSetDirection(mapObject, mapObject->mapobj_unk_20);
|
FieldObjectSetDirection(mapObject, mapObject->mapobj_unk_20);
|
||||||
FieldObjectHandleDynamicGraphicsId(mapObject);
|
FieldObjectHandleDynamicGraphicsId(mapObject);
|
||||||
|
|
||||||
|
// This block is the culprit
|
||||||
if (gUnknown_0850557C[mapObject->animPattern])
|
if (gUnknown_0850557C[mapObject->animPattern])
|
||||||
{
|
{
|
||||||
if (mapObject->mapobj_unk_19 == 0)
|
if (mapObject->mapobj_unk_19 == 0)
|
||||||
@ -892,3 +894,11 @@ static void sub_808E1B8(u8 mapObjectId, s16 x, s16 y)
|
|||||||
mapObject->mapobj_bit_21 = FALSE;
|
mapObject->mapobj_bit_21 = FALSE;
|
||||||
FieldObjectClearAnim(mapObject);
|
FieldObjectClearAnim(mapObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void SetPlayerAvatarFieldObjectIdAndObjectId(u8 mapObjectId, u8 spriteId)
|
||||||
|
{
|
||||||
|
gPlayerAvatar.mapObjectId = mapObjectId;
|
||||||
|
gPlayerAvatar.spriteId = spriteId;
|
||||||
|
gPlayerAvatar.gender = GetPlayerAvatarGenderByGraphicsId(gMapObjects[mapObjectId].graphicsId);
|
||||||
|
SetPlayerAvatarExtraStateTransition(gMapObjects[mapObjectId].graphicsId, 0x20);
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user