Tree and Mountain Disguise FOCB
This commit is contained in:
parent
12885ca371
commit
6247fe742c
2 changed files with 38 additions and 118 deletions
|
@ -5,124 +5,6 @@
|
|||
|
||||
.text
|
||||
|
||||
thumb_func_start FieldObjectCB_TreeDisguise
|
||||
@ void FieldObjectCB_TreeDisguise(struct obj *object)
|
||||
FieldObjectCB_TreeDisguise: @ 809253C
|
||||
push {r4-r6,lr}
|
||||
adds r5, r0, 0
|
||||
movs r1, 0x2E
|
||||
ldrsh r0, [r5, r1]
|
||||
lsls r1, r0, 3
|
||||
adds r1, r0
|
||||
lsls r1, 2
|
||||
ldr r0, =gMapObjects
|
||||
adds r4, r1, r0
|
||||
adds r6, r4, 0
|
||||
adds r6, 0x21
|
||||
ldrb r0, [r6]
|
||||
cmp r0, 0
|
||||
beq _08092564
|
||||
cmp r0, 0x1
|
||||
bne _08092584
|
||||
movs r1, 0x3C
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0
|
||||
bne _08092584
|
||||
_08092564:
|
||||
ldr r1, =gFieldEffectSpawnParams
|
||||
adds r2, r1, 0x4
|
||||
adds r3, r1, 0
|
||||
adds r3, 0x8
|
||||
adds r0, r4, 0
|
||||
bl FieldObjectGetLocalIdAndMap
|
||||
movs r0, 0x1C
|
||||
bl FieldEffectStart
|
||||
strb r0, [r4, 0x1A]
|
||||
movs r0, 0x1
|
||||
strb r0, [r6]
|
||||
ldrh r0, [r5, 0x3C]
|
||||
adds r0, 0x1
|
||||
strh r0, [r5, 0x3C]
|
||||
_08092584:
|
||||
movs r0, 0x2E
|
||||
ldrsh r1, [r5, r0]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =gMapObjects
|
||||
adds r0, r1
|
||||
ldr r2, =sub_80925AC
|
||||
adds r1, r5, 0
|
||||
bl FieldObjectStep
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end FieldObjectCB_TreeDisguise
|
||||
|
||||
thumb_func_start sub_80925AC
|
||||
sub_80925AC: @ 80925AC
|
||||
push {lr}
|
||||
bl npc_reset
|
||||
movs r0, 0
|
||||
pop {r1}
|
||||
bx r1
|
||||
thumb_func_end sub_80925AC
|
||||
|
||||
thumb_func_start FieldObjectCB_MountainDisguise
|
||||
FieldObjectCB_MountainDisguise: @ 80925B8
|
||||
push {r4-r6,lr}
|
||||
adds r5, r0, 0
|
||||
movs r1, 0x2E
|
||||
ldrsh r0, [r5, r1]
|
||||
lsls r1, r0, 3
|
||||
adds r1, r0
|
||||
lsls r1, 2
|
||||
ldr r0, =gMapObjects
|
||||
adds r4, r1, r0
|
||||
adds r6, r4, 0
|
||||
adds r6, 0x21
|
||||
ldrb r0, [r6]
|
||||
cmp r0, 0
|
||||
beq _080925E0
|
||||
cmp r0, 0x1
|
||||
bne _08092600
|
||||
movs r1, 0x3C
|
||||
ldrsh r0, [r5, r1]
|
||||
cmp r0, 0
|
||||
bne _08092600
|
||||
_080925E0:
|
||||
ldr r1, =gFieldEffectSpawnParams
|
||||
adds r2, r1, 0x4
|
||||
adds r3, r1, 0
|
||||
adds r3, 0x8
|
||||
adds r0, r4, 0
|
||||
bl FieldObjectGetLocalIdAndMap
|
||||
movs r0, 0x1D
|
||||
bl FieldEffectStart
|
||||
strb r0, [r4, 0x1A]
|
||||
movs r0, 0x1
|
||||
strb r0, [r6]
|
||||
ldrh r0, [r5, 0x3C]
|
||||
adds r0, 0x1
|
||||
strh r0, [r5, 0x3C]
|
||||
_08092600:
|
||||
movs r0, 0x2E
|
||||
ldrsh r1, [r5, r0]
|
||||
lsls r0, r1, 3
|
||||
adds r0, r1
|
||||
lsls r0, 2
|
||||
ldr r1, =gMapObjects
|
||||
adds r0, r1
|
||||
ldr r2, =sub_80925AC
|
||||
adds r1, r5, 0
|
||||
bl FieldObjectStep
|
||||
pop {r4-r6}
|
||||
pop {r0}
|
||||
bx r0
|
||||
.pool
|
||||
thumb_func_end FieldObjectCB_MountainDisguise
|
||||
|
||||
thumb_func_start FieldObjectCB_Hidden1
|
||||
@ void FieldObjectCB_Hidden1(struct obj *object)
|
||||
FieldObjectCB_Hidden1: @ 8092628
|
||||
|
|
|
@ -3369,6 +3369,44 @@ bool8 mss_08062EA4(struct MapObject *mapObject, struct Sprite *sprite)
|
|||
return gUnknown_0850DA64[player_get_x22()](mapObject, sprite, player_get_direction_upper_nybble(), sub_8088E64);
|
||||
}
|
||||
|
||||
bool8 sub_80925AC(struct MapObject *, struct Sprite *);
|
||||
|
||||
void FieldObjectCB_TreeDisguise(struct Sprite *sprite)
|
||||
{
|
||||
struct MapObject *mapObject;
|
||||
|
||||
mapObject = &gMapObjects[sprite->data0];
|
||||
if (mapObject->mapobj_unk_21 == 0 || (mapObject->mapobj_unk_21 == 1 && !sprite->data7))
|
||||
{
|
||||
FieldObjectGetLocalIdAndMap(mapObject, (u8 *)&gFieldEffectSpawnParams[0], (u8 *)&gFieldEffectSpawnParams[1], (u8 *)&gFieldEffectSpawnParams[2]);
|
||||
mapObject->mapobj_unk_1A = FieldEffectStart(FLDEFF_TREE_DISGUISE);
|
||||
mapObject->mapobj_unk_21 = 1;
|
||||
sprite->data7 ++;
|
||||
}
|
||||
FieldObjectStep(&gMapObjects[sprite->data0], sprite, sub_80925AC);
|
||||
}
|
||||
|
||||
bool8 sub_80925AC(struct MapObject *mapObject, struct Sprite *sprite)
|
||||
{
|
||||
npc_reset(mapObject, sprite);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void FieldObjectCB_MountainDisguise(struct Sprite *sprite)
|
||||
{
|
||||
struct MapObject *mapObject;
|
||||
|
||||
mapObject = &gMapObjects[sprite->data0];
|
||||
if (mapObject->mapobj_unk_21 == 0 || (mapObject->mapobj_unk_21 == 1 && !sprite->data7))
|
||||
{
|
||||
FieldObjectGetLocalIdAndMap(mapObject, (u8 *)&gFieldEffectSpawnParams[0], (u8 *)&gFieldEffectSpawnParams[1], (u8 *)&gFieldEffectSpawnParams[2]);
|
||||
mapObject->mapobj_unk_1A = FieldEffectStart(FLDEFF_MOUNTAIN_DISGUISE);
|
||||
mapObject->mapobj_unk_21 = 1;
|
||||
sprite->data7 ++;
|
||||
}
|
||||
FieldObjectStep(&gMapObjects[sprite->data0], sprite, sub_80925AC);
|
||||
}
|
||||
|
||||
asm(".section .text.get_face_direction_anim_id");
|
||||
|
||||
void FieldObjectClearAnimIfSpecialAnimActive(struct MapObject *);
|
||||
|
|
Loading…
Reference in a new issue