mirror of
https://github.com/zeldaret/tmc
synced 2026-08-18 21:48:21 -04:00
decomp enemyUtils.c
This commit is contained in:
+42
-103
@@ -20,7 +20,33 @@ extern struct_080FD5B4 gUnk_080FD5B4[];
|
||||
extern u8 gUnk_0200AF13;
|
||||
extern u8 gUnk_0200AF14;
|
||||
extern u8 gUnk_080FE1C6[];
|
||||
extern Droptable gUnk_02034398;
|
||||
/*{
|
||||
0u,
|
||||
0x1u,
|
||||
0x2u,
|
||||
0x3u,
|
||||
0x4u,
|
||||
0x5u,
|
||||
0x6u,
|
||||
0x7u,
|
||||
0x8u,
|
||||
0x9u,
|
||||
0x8u,
|
||||
0x9u,
|
||||
0xau,
|
||||
0xau,
|
||||
0xbu,
|
||||
0xcu,
|
||||
0xdu,
|
||||
0xeu,
|
||||
0xfu,
|
||||
0x8u,
|
||||
0xfu,
|
||||
0x1u,
|
||||
0x8u,
|
||||
};
|
||||
*/
|
||||
extern Droptable gCurrentAreaDroptable;
|
||||
extern void (*const gUnk_080FE2A0[])(void);
|
||||
|
||||
void ForceEquipItem(u32, u8);
|
||||
@@ -158,7 +184,7 @@ NONMATCH("asm/non_matching/sub_08054524.inc", void sub_08054524(void)) {
|
||||
bVar1 = 0;
|
||||
}
|
||||
|
||||
MemCopy(&gUnk_080015BC[0] + gUnk_080FE1C6[bVar1] * 0x8, &gUnk_02034398, 0x20);
|
||||
MemCopy(&gDroptablesAreas[0] + gUnk_080FE1C6[bVar1] * 0x8, &gCurrentAreaDroptable, 0x20);
|
||||
}
|
||||
END_NONMATCH
|
||||
|
||||
@@ -170,8 +196,6 @@ void sub_08054570(void) {
|
||||
gRoomVars.field_0x2 = 0;
|
||||
}
|
||||
|
||||
// BUG?
|
||||
extern const Droptable gUnk_080014e4[];
|
||||
extern void sub_08000F14(s16*, const s16*, const s16*, const s16*);
|
||||
extern u32 sub_08000F2C(s16*, const s16*, const s16*, const s16*);
|
||||
u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter);
|
||||
@@ -188,11 +212,11 @@ u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
|
||||
Droptable s0;
|
||||
r3 = arg1;
|
||||
if (gRoomVars.field_0x2 != 1) {
|
||||
ptr2 = &gUnk_08001A1C[0];
|
||||
ptr2 = &gDroptablesModifiers[0];
|
||||
ptr4 = 0;
|
||||
switch (r3) {
|
||||
case 1 ... 12:
|
||||
ptr4 = &gUnk_0800137C[r3];
|
||||
ptr4 = &gDroptablesEnemies[r3];
|
||||
break;
|
||||
#ifndef EU
|
||||
case 24:
|
||||
@@ -208,9 +232,9 @@ u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
|
||||
#ifdef EU
|
||||
case 24:
|
||||
#endif
|
||||
ptr2 = &gUnk_0800161C[r3];
|
||||
ptr2 = &gDroptablesObjects[r3 - 16];
|
||||
case 15:
|
||||
ptr4 = &gUnk_02034398;
|
||||
ptr4 = &gCurrentAreaDroptable;
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
@@ -218,7 +242,8 @@ u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
|
||||
}
|
||||
if (ptr4 != 0) {
|
||||
if ((r1 = gSave.stats.unkB) == 0) {
|
||||
ptr3 = &gUnk_08001A1C[0];
|
||||
// nop
|
||||
ptr3 = &gDroptableModifierNone;
|
||||
} else {
|
||||
#ifdef EU
|
||||
ptr3 = &gUnk_0800143C[r1 + 3];
|
||||
@@ -240,16 +265,16 @@ u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
|
||||
if (gSave.stats.rupees <= 10) {
|
||||
s0.s.rupee5 += 1;
|
||||
}
|
||||
ptr2 = &gUnk_08001A1C[0];
|
||||
ptr2 = &gDroptableModifierNone;
|
||||
r0 = gSave.stats.hasAllFigurines;
|
||||
ptr3 = ptr2;
|
||||
ptr3 = &gDroptableModifierNone;
|
||||
// don't drop shells anymore
|
||||
if (r0 != 0) {
|
||||
ptr2++;
|
||||
ptr2 = &gDroptableModifierNoShells;
|
||||
}
|
||||
// don't drop kinstones anymore
|
||||
if (gSave.didAllFusions != 0) {
|
||||
ptr3 += 2;
|
||||
ptr3 = &gDroptableModifierNoKinstones;
|
||||
}
|
||||
// vector addition, s0 = s0 + ptr2 + ptr3
|
||||
// resulting values are clamped to be >= 0
|
||||
@@ -268,9 +293,8 @@ u32 CreateRandomItemDrop(Entity* arg0, u32 arg1) {
|
||||
}
|
||||
}
|
||||
r1 = gUnk_080FE1B4[r5];
|
||||
if (r1 != 0) {
|
||||
r2 = 0;
|
||||
return CreateItemDrop(arg0, r1, r2);
|
||||
if (r1 != ITEM_NONE) {
|
||||
return CreateItemDrop(arg0, r1, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -311,10 +335,10 @@ u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) {
|
||||
u32 rand;
|
||||
|
||||
if (GetInventoryValue(ITEM_KINSTONE_BAG) == 0) {
|
||||
return 0;
|
||||
return ITEM_NONE;
|
||||
}
|
||||
if (3 < gRoomVars.filler1[0]) {
|
||||
return 0;
|
||||
return ITEM_NONE;
|
||||
}
|
||||
|
||||
if (itemID != ITEM_KINSTONE) {
|
||||
@@ -362,91 +386,6 @@ u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) {
|
||||
}
|
||||
return itemID;
|
||||
}
|
||||
/*
|
||||
extern u8 gUnk_080FE1DD[];
|
||||
|
||||
u32 CreateItemDrop(Entity* arg0, u32 itemID, u32 itemParameter) {
|
||||
u32 prereqID;
|
||||
u32 adjustedParam;
|
||||
u32 uVar1;
|
||||
Entity* itemEntity;
|
||||
|
||||
adjustedParam = (u8)itemParameter;
|
||||
switch (adjustedParam) {
|
||||
case 0x3f:
|
||||
if (!GetInventoryValue(0x40)) {
|
||||
return 0;
|
||||
}
|
||||
if (itemParameter == 0) {
|
||||
adjustedParam = 1;
|
||||
}
|
||||
case 0x5d:
|
||||
if (!GetInventoryValue(0x65)) {
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 0x5e:
|
||||
if (!GetInventoryValue(0x9)) {
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
case 0x5c:
|
||||
case 0xfc ... 0xfe:
|
||||
if (GetInventoryValue(0x67) == 0) {
|
||||
return 0;
|
||||
}
|
||||
if (3 < gRoomVars.filler[5]) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (itemID != 0x5c) {
|
||||
adjustedParam = gUnk_080FE1DD[(Random() & 0x3f) + (itemID - 0xfc) * 0x40];
|
||||
if (adjustedParam == 0) {
|
||||
itemID = 0;
|
||||
}
|
||||
else {
|
||||
itemID = 0x5c;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 0xff:
|
||||
if (!GetInventoryValue(0x1)) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
if (itemID != 0) {
|
||||
if (itemID == 0xff) {
|
||||
itemEntity = CreateEnemy(BEETLE, 0);
|
||||
if (itemEntity != NULL) {
|
||||
itemEntity->x.HALF.HI = arg0->x.HALF.HI;
|
||||
itemEntity->y.HALF.HI = arg0->y.HALF.HI;
|
||||
itemEntity->collisionLayer = arg0->collisionLayer;
|
||||
UpdateSpriteOrderAndFlip(itemEntity);
|
||||
}
|
||||
} else {
|
||||
itemEntity = CreateObject(GROUND_ITEM, itemID, adjustedParam);
|
||||
if (itemEntity != NULL) {
|
||||
if (arg0 == &gPlayerEntity) {
|
||||
itemEntity->actionDelay = 1;
|
||||
} else {
|
||||
itemEntity->actionDelay = 0;
|
||||
}
|
||||
if (arg0->kind == OBJECT) {
|
||||
if (arg0->id == 99) {
|
||||
arg0->child = itemEntity;
|
||||
} else if (arg0->id == 0x1e) {
|
||||
itemEntity->direction = arg0->animationState << 3 | 0x80;
|
||||
itemEntity->speed = 0xc0;
|
||||
itementity->zVelocity = 0x18000;
|
||||
}
|
||||
}
|
||||
CopyPosition(arg0, itemEntity);
|
||||
}
|
||||
}
|
||||
}
|
||||
return itemID;
|
||||
}
|
||||
*/
|
||||
|
||||
void Subtask_WorldEvent(void) {
|
||||
#if !(defined(DEMO_USA) || defined(DEMO_JP))
|
||||
|
||||
+30
-30
@@ -1,7 +1,7 @@
|
||||
#include "global.h"
|
||||
#include "droptables.h"
|
||||
|
||||
const Droptable gUnk_0800137C[] = {
|
||||
const Droptable gDroptablesEnemies[] = {
|
||||
{ {
|
||||
.none = -999,
|
||||
.rupee1 = -999,
|
||||
@@ -331,8 +331,8 @@ const Droptable gUnk_0800143C[] = {
|
||||
} },
|
||||
};
|
||||
// not 100% sure
|
||||
const Droptable gUnk_080015BC[] = {
|
||||
{ {
|
||||
const Droptable gDroptablesAreas[] = {
|
||||
[0] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 15,
|
||||
.rupee5 = 5,
|
||||
@@ -350,7 +350,7 @@ const Droptable gUnk_080015BC[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[1] = { {
|
||||
.none = 900,
|
||||
.rupee1 = 0,
|
||||
.rupee5 = 0,
|
||||
@@ -368,7 +368,7 @@ const Droptable gUnk_080015BC[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[2] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 11,
|
||||
.rupee5 = 3,
|
||||
@@ -386,9 +386,7 @@ const Droptable gUnk_080015BC[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
};
|
||||
const Droptable gUnk_0800161C[] = {
|
||||
{ {
|
||||
[3] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 30,
|
||||
.rupee5 = 1,
|
||||
@@ -406,7 +404,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[4] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 6,
|
||||
.rupee5 = 1,
|
||||
@@ -424,7 +422,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[5] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 55,
|
||||
.rupee5 = 7,
|
||||
@@ -442,7 +440,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[6] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 23,
|
||||
.rupee5 = 5,
|
||||
@@ -460,7 +458,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[7] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 20,
|
||||
.rupee5 = 3,
|
||||
@@ -478,7 +476,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[8] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 25,
|
||||
.rupee5 = 6,
|
||||
@@ -496,7 +494,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[9] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 18,
|
||||
.rupee5 = 2,
|
||||
@@ -514,7 +512,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[0xa] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 30,
|
||||
.rupee5 = 1,
|
||||
@@ -536,7 +534,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[0xb] = { {
|
||||
.none = 900,
|
||||
.rupee1 = 16,
|
||||
.rupee5 = 4,
|
||||
@@ -554,7 +552,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[0xc] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 23,
|
||||
.rupee5 = 15,
|
||||
@@ -572,7 +570,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[0xd] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 25,
|
||||
.rupee5 = 25,
|
||||
@@ -590,7 +588,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[0xe] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 25,
|
||||
.rupee5 = 1,
|
||||
@@ -608,7 +606,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[0xf] = { {
|
||||
.none = 800,
|
||||
.rupee1 = 60,
|
||||
.rupee5 = 15,
|
||||
@@ -626,7 +624,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[0x10] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 15,
|
||||
.rupee5 = 5,
|
||||
@@ -644,7 +642,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[0x11] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 15,
|
||||
.rupee5 = 5,
|
||||
@@ -662,7 +660,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[0x12] = { {
|
||||
.none = 920,
|
||||
.rupee1 = 15,
|
||||
.rupee5 = 5,
|
||||
@@ -680,7 +678,9 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
};
|
||||
const Droptable gDroptablesObjects[] = {
|
||||
[0] = { {
|
||||
.none = 0,
|
||||
.rupee1 = 10,
|
||||
.rupee5 = 0,
|
||||
@@ -698,7 +698,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[1] = { {
|
||||
.none = 0,
|
||||
.rupee1 = 3,
|
||||
.rupee5 = 0,
|
||||
@@ -716,7 +716,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[2] = { {
|
||||
.none = 0,
|
||||
.rupee1 = 100,
|
||||
.rupee5 = 20,
|
||||
@@ -734,7 +734,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[3] = { {
|
||||
.none = 0,
|
||||
.rupee1 = 300,
|
||||
.rupee5 = 50,
|
||||
@@ -752,7 +752,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[4] = { {
|
||||
.none = 0,
|
||||
.rupee1 = -999,
|
||||
.rupee5 = -999,
|
||||
@@ -770,7 +770,7 @@ const Droptable gUnk_0800161C[] = {
|
||||
.none4 = 0,
|
||||
.none5 = 0,
|
||||
} },
|
||||
{ {
|
||||
[5] = { {
|
||||
.none = 0,
|
||||
.rupee1 = 2,
|
||||
.rupee5 = 2,
|
||||
@@ -1068,7 +1068,7 @@ const Droptable gUnk_0800191C[] = {
|
||||
};
|
||||
|
||||
// special treatment for shells and kinstones after finishing figurines/fusions
|
||||
const Droptable gUnk_08001A1C[] = {
|
||||
const Droptable gDroptablesModifiers[] = {
|
||||
// nop
|
||||
{ {
|
||||
.none = 0,
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
#include "definitions.h"
|
||||
#include "functions.h"
|
||||
#include "object.h"
|
||||
#include "save.h"
|
||||
#include "projectile.h"
|
||||
|
||||
extern void sub_08049CF4(Entity*);
|
||||
|
||||
extern EnemyDefinition gEnemyDefinitions[];
|
||||
|
||||
@@ -86,3 +90,136 @@ bool32 LoadEnemySprite(Entity* entity, const EnemyDefinition* definition) {
|
||||
LoadObjPalette(entity, definition->paletteIndex);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
ASM_FUNC("asm/non_matching/enemyUtils/sub_0804A720.inc", void sub_0804A720(Entity* this))
|
||||
|
||||
void CreateDeathFx(Entity* param_1, u32 param_2, u32 param_3);
|
||||
void sub_0804A7D4(Entity* param_1) {
|
||||
CreateDeathFx(param_1, (u32)param_1->id, 0);
|
||||
}
|
||||
|
||||
void CreateDeathFx(Entity* param_1, u32 param_2, u32 param_3) {
|
||||
Entity* pEVar2;
|
||||
Entity* pEVar3;
|
||||
u8 bVar3;
|
||||
|
||||
if ((param_1->field_0x6c.HALF.HI & 1) != 0) {
|
||||
if ((param_1->field_0x6c.HALF.HI & 2) != 0) {
|
||||
return;
|
||||
}
|
||||
pEVar2 = CreateObject(DEATH_FX, param_1->id, 0);
|
||||
if (pEVar2 == NULL) {
|
||||
return;
|
||||
}
|
||||
pEVar2->field_0x6c.HALF.LO = 1;
|
||||
PositionRelative(param_1, pEVar2, 0, 1);
|
||||
pEVar2->parent = param_1;
|
||||
param_1->field_0x6c.HALF.HI |= 2;
|
||||
if ((param_1->id == '7') && (gRoomTransition.field_0x39 != 0)) {
|
||||
DeleteThisEntity();
|
||||
}
|
||||
sub_0807CD9C();
|
||||
SoundReq(SONG_STOP_BGM);
|
||||
DeleteThisEntity();
|
||||
return;
|
||||
} else {
|
||||
int tmp = param_1->field_0x3a & 2;
|
||||
if (tmp == 0) {
|
||||
sub_08049CF4(param_1);
|
||||
gSave.unk50 += 1;
|
||||
param_1->field_0x3a |= 2;
|
||||
param_1->actionDelay = 0xff;
|
||||
SetDefaultPriority(param_1, 3);
|
||||
pEVar3 = CreateObject(DEATH_FX, param_1->id, 0);
|
||||
if (pEVar3 != NULL) {
|
||||
pEVar3->field_0x6c.HALF.LO = tmp;
|
||||
pEVar3->field_0x6c.HALF.HI = param_2;
|
||||
pEVar3->field_0x6e.HALF.LO = param_3;
|
||||
pEVar3->parent = param_1;
|
||||
pEVar3->child = param_1;
|
||||
CopyPosition(param_1, pEVar3);
|
||||
}
|
||||
if ((param_1->field_0x6c.HALF.HI & 8) != 0) {
|
||||
pEVar3->field_0x6c.HALF.LO |= 8;
|
||||
DeleteEntity(param_1);
|
||||
return;
|
||||
}
|
||||
if ((param_1->bitfield & 0x7f) == 0x13) {
|
||||
bVar3 = param_1->field_0x1c & 0xf;
|
||||
if (bVar3 != 1) {
|
||||
if ((bVar3 == 2) && (pEVar3 != NULL)) {
|
||||
pEVar3->field_0x6c.HALF.LO |= 2;
|
||||
}
|
||||
} else {
|
||||
if (pEVar3 != NULL) {
|
||||
pEVar3->field_0x6c.HALF.LO |= 4;
|
||||
}
|
||||
}
|
||||
pEVar3->parent = NULL;
|
||||
DeleteThisEntity();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (param_1->actionDelay == 0) {
|
||||
DeleteThisEntity();
|
||||
} else {
|
||||
if (--param_1->actionDelay == 0) {
|
||||
param_1->spriteSettings.draw = 0;
|
||||
SetDefaultPriority(param_1, 0);
|
||||
} else {
|
||||
if (param_1->actionDelay < 9) {
|
||||
if (param_1->spriteSettings.draw != 0) {
|
||||
param_1->spriteSettings.draw = 0;
|
||||
} else {
|
||||
param_1->spriteSettings.draw = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Entity* CreateProjectileWithParent(Entity* parent, u32 projectileId, u32 projectileType) {
|
||||
Entity* projectile;
|
||||
|
||||
projectile = CreateProjectile(projectileId);
|
||||
if (projectile != NULL) {
|
||||
projectile->type = projectileType;
|
||||
CopyPosition(parent, projectile);
|
||||
}
|
||||
return projectile;
|
||||
}
|
||||
|
||||
void SetChildOffset(Entity* entity, s32 xOffset, s32 yOffset, s32 zOffset) {
|
||||
Entity* other;
|
||||
|
||||
other = *(Entity**)&entity->field_0x68;
|
||||
if (other != NULL) {
|
||||
other->spriteRendering.b3 = entity->spriteRendering.b3;
|
||||
other->spriteOrientation.flipY = entity->spriteOrientation.flipY;
|
||||
other->x.HALF.HI = entity->x.HALF.HI + xOffset;
|
||||
other->y.HALF.HI = entity->y.HALF.HI + yOffset;
|
||||
other->z.HALF.HI = entity->z.HALF.HI + zOffset;
|
||||
other->collisionLayer = entity->collisionLayer;
|
||||
}
|
||||
}
|
||||
|
||||
Entity* sub_0804A9FC(Entity* parent, u32 fxType) {
|
||||
Entity* fx;
|
||||
|
||||
if ((*(Entity**)&parent->field_0x68 == NULL) && (fx = CreateFx(parent, fxType, 0), fx != NULL)) {
|
||||
*(Entity**)&parent->field_0x68 = fx;
|
||||
} else {
|
||||
fx = NULL;
|
||||
}
|
||||
return fx;
|
||||
}
|
||||
|
||||
void sub_0804AA1C(Entity* param_1) {
|
||||
if (*(Entity**)¶m_1->field_0x68 != NULL) {
|
||||
(*(Entity**)¶m_1->field_0x68)->parent = NULL;
|
||||
*(Entity**)¶m_1->field_0x68 = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -42,7 +42,7 @@ static void LoadLocationTile(TileEntity*);
|
||||
typedef struct {
|
||||
u8 filler[0x20];
|
||||
} VarStruct;
|
||||
extern VarStruct gUnk_080015BC[];
|
||||
extern VarStruct gDroptablesAreas[];
|
||||
|
||||
void LoadRoomEntityList(EntityData* listPtr) {
|
||||
if (listPtr != NULL) {
|
||||
@@ -302,7 +302,7 @@ void LoadRoomTileEntities(TileEntity* list) {
|
||||
}
|
||||
|
||||
static void LoadGrassDropTile(TileEntity* tile) {
|
||||
MemCopy(&gUnk_080015BC[tile->_1], &gRoomVars.filler4[44], 0x20);
|
||||
MemCopy(&gDroptablesAreas[tile->_1], &gRoomVars.filler4[44], 0x20);
|
||||
}
|
||||
|
||||
static void LoadLocationTile(TileEntity* tile) {
|
||||
|
||||
Reference in New Issue
Block a user