CreateItemDrop WIP

This commit is contained in:
theo3
2020-08-14 21:56:34 -07:00
parent 149ae2e2d2
commit 693224e166
+86
View File
@@ -182,6 +182,92 @@ u32 sub_0805457C(u32 arg0, u32 arg1) {
asm(".include \"asm/non_matching/code_0805457C.inc\"");
}
/*
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(7, 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(0, itemID, adjustedParam);
if (itemEntity != NULL) {
if (arg0 == &gPlayerEntity) {
itemEntity->actionDelay = 1;
} else {
itemEntity->actionDelay = 0;
}
if ((arg0->entityType).type == 6) {
if (arg0->entityType.subtype == 99) {
arg0->attachedEntity = itemEntity;
} else if (arg0->entityType.subtype == 0x1e) {
itemEntity->direction = arg0->animationState << 3 | 0x80;
itemEntity->nonPlanarMovement = 0xc0;
itemEntity->field_0x20 = 0x18000;
}
}
CopyPosition(arg0, itemEntity);
}
}
}
return itemID;
}
*/
void sub_08054870(void)
{
gUnk_080FE2A0[gMenu.menuType]();