mirror of
https://github.com/zeldaret/tmc
synced 2026-07-08 14:36:41 -04:00
object1A complete
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
|
||||
extern void sub_0806ED78();
|
||||
extern void sub_08067C44();
|
||||
|
||||
extern void (*gCat[9])(Entity *);
|
||||
|
||||
//Main
|
||||
void sub_080677B4(Entity *ent)
|
||||
{
|
||||
gCat[ent->action](ent);
|
||||
sub_08067C44(ent);
|
||||
if (((ent->flags & 128) == 0) && ((ent->entityType).parameter1 != 5)) {
|
||||
sub_0806ED78(ent);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,71 @@
|
||||
#include "global.h"
|
||||
#include "entity.h"
|
||||
|
||||
extern Entity * CreateObject();
|
||||
extern void CopyPosition();
|
||||
extern void sub_08086A6C();
|
||||
extern s32 sub_080044EC();
|
||||
extern void sub_080AEF88();
|
||||
extern void sub_0805E780();
|
||||
extern u32 Random(void);
|
||||
|
||||
extern void (*gUnk_081206C4[99])(Entity *);
|
||||
|
||||
extern u32 gUnk_080FD1A8;
|
||||
|
||||
//Main
|
||||
void sub_080869C4(Entity *ent)
|
||||
{
|
||||
gUnk_081206C4[ent->action](ent);
|
||||
}
|
||||
|
||||
void sub_080869DC(Entity *ent)
|
||||
{
|
||||
Entity *itemEntity;
|
||||
|
||||
ent->action = 1;
|
||||
ent->spriteSettings.b.ss0 = 0;
|
||||
ent->boundingBox = &gUnk_080FD1A8;
|
||||
ent->field_0x3c = ent->field_0x3c | 16;
|
||||
itemEntity = CreateObject(0, ent->entityType.parameter1, 0);
|
||||
if (itemEntity != NULL) {
|
||||
itemEntity->parameter3 = 10;
|
||||
itemEntity->parent = ent;
|
||||
ent->attachedEntity = itemEntity;
|
||||
CopyPosition(ent, itemEntity);
|
||||
sub_08086A6C(ent);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08086A28(Entity *ent)
|
||||
{
|
||||
s32 iVar1;
|
||||
|
||||
if (ent->attachedEntity->field_0x4 == NULL) {
|
||||
ent->action = 2;
|
||||
}
|
||||
else {
|
||||
iVar1 = sub_080044EC(ent, 10240);
|
||||
if (iVar1 == 0) {
|
||||
ent->action = 2;
|
||||
}
|
||||
sub_080AEF88(ent);
|
||||
CopyPosition(ent,ent->attachedEntity);
|
||||
}
|
||||
}
|
||||
|
||||
void sub_08086A5C(Entity *ent)
|
||||
{
|
||||
ent->attachedEntity->parent = NULL;
|
||||
sub_0805E780();
|
||||
}
|
||||
|
||||
void sub_08086A6C(Entity *ent)
|
||||
{
|
||||
u32 uVar1;
|
||||
|
||||
uVar1 = Random();
|
||||
ent->field_0x20 = 163840;
|
||||
ent->direction = (uVar1 >> 16) & 31;
|
||||
ent->nonPlanarMovement = uVar1 & 480;
|
||||
}
|
||||
Reference in New Issue
Block a user