Skip to content

Commit

Permalink
Clean up file
Browse files Browse the repository at this point in the history
  • Loading branch information
ribbanya committed Feb 22, 2024
1 parent f4cac4c commit ce6e5a9
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 95 deletions.
2 changes: 1 addition & 1 deletion src/melee/it/it_26B1.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ s32 it_8026B47C(HSD_GObj* gobj) // Get heal value of healing items
case It_Kind_Foods:
return temp_item->xDD4_itemVar.Food.xDD8_heal;
case Pokemon_Lucky_Egg:
return temp_item->xDD4_itemVar.Egg.xE34_heal;
return temp_item->xDD4_itemVar.egg.heal_amount;
case It_Kind_WhispyHealApple:
return temp_item->xDD4_itemVar.WhispyApple.xDD4_heal;
default:
Expand Down
161 changes: 79 additions & 82 deletions src/melee/it/items/itegg.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@

/* 288DC4 */ static bool it_80288DC4(Item_GObj* gobj);
/* 288E6C */ static void it_80288E6C(Item_GObj* gobj);
/* 288EC4 */ static bool it_80288EC4(HSD_GObj* gobj);
/* 288ECC */ static void it_80288ECC(HSD_GObj* gobj);
/* 288EC4 */ static bool it_80288EC4(Item_GObj* gobj);
/* 288ECC */ static void it_80288ECC(Item_GObj* gobj);
/* 288ED0 */ static bool it_80288ED0(Item_GObj* gobj);
/* 288EFC */ static void it_80288EFC(HSD_GObj* gobj);
/* 288F24 */ static bool it_80288F24(HSD_GObj* gobj);
/* 288EFC */ static void it_80288EFC(Item_GObj* gobj);
/* 288F24 */ static bool it_80288F24(Item_GObj* gobj);
/* 288F2C */ static void it_80288F2C(Item_GObj* gobj);
/* 288F5C */ static bool it_80288F5C(Item_GObj* gobj);
/* 288FB0 */ static bool it_80288FB0(HSD_GObj* gobj);
/* 288FB8 */ static void it_80288FB8(HSD_GObj* gobj);
/* 288FB0 */ static bool it_80288FB0(Item_GObj* gobj);
/* 288FB8 */ static void it_80288FB8(Item_GObj* gobj);
/* 289004 */ static void it_80289004(Item_GObj* gobj);
/* 289050 */ static bool it_80289050(Item_GObj* gobj);
/* 289094 */ static void it_80289094(Item_GObj* gobj);
/* 28912C */ static bool it_8028912C(Item_GObj* gobj);
/* 28914C */ static void it_8028914C(HSD_GObj* gobj);
/* 289150 */ static bool it_80289150(HSD_GObj* gobj);
/* 289158 */ static void it_80289158(HSD_GObj* gobj);
/* 2891E0 */ static bool it_802891E0(HSD_GObj* gobj);
/* 28920C */ static void it_8028920C(HSD_GObj* gobj);
/* 289210 */ static bool it_80289210(HSD_GObj* gobj);
/* 28966C */ static bool it_8028966C(HSD_GObj* gobj);
/* 289674 */ static void it_80289674(HSD_GObj* gobj);
/* 28914C */ static void it_8028914C(Item_GObj* gobj);
/* 289150 */ static bool it_80289150(Item_GObj* gobj);
/* 289158 */ static void it_80289158(Item_GObj* gobj);
/* 2891E0 */ static bool it_802891E0(Item_GObj* gobj);
/* 28920C */ static void it_8028920C(Item_GObj* gobj);
/* 289210 */ static bool it_80289210(Item_GObj* gobj);
/* 28966C */ static bool it_8028966C(Item_GObj* gobj);
/* 289674 */ static void it_80289674(Item_GObj* gobj);
/* 289678 */ static bool it_80289678(Item_GObj* gobj);

ItemStateTable it_803F5988[] = {
Expand All @@ -46,47 +46,44 @@ ItemStateTable it_803F5988[] = {
{ -1, it_802891E0, it_8028920C, it_80289210 },
};

Item_GObj* it_80288C88(HSD_GObj* arg_gobj, Vec3* pos, Vec3* vel, f32 dir)
Item_GObj* it_80288C88(Item_GObj* gobj, Vec3* pos, Vec3* vel, float dir)
{
SpawnItem spawn;
Item* item;
Item_GObj* ret = NULL;

Item_GObj* ret_gobj = NULL;
if (arg_gobj != NULL) {
item = GET_ITEM(arg_gobj);
if (gobj != NULL) {
Item* ip = GET_ITEM(gobj);
SpawnItem spawn;
spawn.kind = It_Kind_Egg;
spawn.prev_pos = *pos;
spawn.prev_pos.z = 0.0F;
spawn.pos = spawn.prev_pos;
spawn.facing_dir = dir;
spawn.x3C_damage = 0;
spawn.vel = *vel;
spawn.x0_parent_gobj = item->owner;
spawn.x4_parent_gobj2 = arg_gobj;
spawn.x44_flag.bits.b0 = 1;
spawn.x0_parent_gobj = ip->owner;
spawn.x4_parent_gobj2 = gobj;
spawn.x44_flag.bits.b0 = true;
spawn.x40 = 0;

ret_gobj = Item_80268B18(&spawn);
if (ret_gobj != NULL) {
Item* item;
item = GET_ITEM(ret_gobj);
item->xDD0_flag.bits.b6 = 1;
item->xD40 = 0.0F;
it_80279BBC(item);
if (!(item->xDD0_flag.bits.b7 & 1)) {
it_802756E0((HSD_GObj*) ret_gobj);
ret = Item_80268B18(&spawn);
if (ret != NULL) {
Item* ip = GET_ITEM(ret);
ip->xDD0_flag.bits.b6 = true;
ip->xD40 = 0.0F;
it_80279BBC(ip);
if (!ip->xDD0_flag.bits.b7) {
it_802756E0(ret);
}
}
}
return ret_gobj;

return ret;
}

void it_80288D98(Item_GObj* gobj)
{
Item* item = GET_ITEM(gobj);

item->xDD4_itemVar.capsule.x0 = 0;
it_80288EFC((HSD_GObj*) item);
GET_ITEM(gobj)->xDD4_itemVar.capsule.x0 = false;
it_80288EFC(gobj);
}

bool it_80288DC4(Item_GObj* gobj)
Expand All @@ -111,34 +108,34 @@ bool it_80288DC4(Item_GObj* gobj)

void it_80288E6C(Item_GObj* gobj)
{
u8 _[8] = { 0 };
Item* item = GET_ITEM(gobj);
PAD_STACK(8);

it_8026B390(gobj);
item->x40_vel.x = item->x40_vel.y = item->x40_vel.z = 0.0F;
Item_80268E5C((HSD_GObj*) gobj, 0, ITEM_ANIM_UPDATE);
Item_80268E5C(gobj, 0, ITEM_ANIM_UPDATE);
}

bool it_80288EC4(HSD_GObj* gobj)
bool it_80288EC4(Item_GObj* gobj)
{
return false;
}

void it_80288ECC(HSD_GObj* gobj) {}
void it_80288ECC(Item_GObj* gobj) {}

bool it_80288ED0(Item_GObj* gobj)
{
it_8026D62C(gobj, (HSD_GObjEvent) it_80288EFC);
it_8026D62C(gobj, it_80288EFC);
return false;
}

void it_80288EFC(HSD_GObj* gobj)
void it_80288EFC(Item_GObj* gobj)
{
Item_80268E5C(gobj, 1, ITEM_ANIM_UPDATE);
return;
}

bool it_80288F24(HSD_GObj* gobj)
bool it_80288F24(Item_GObj* gobj)
{
return false;
}
Expand All @@ -157,15 +154,15 @@ bool it_80288F5C(Item_GObj* gobj)

void it_80288F88(Item_GObj* gobj)
{
Item_80268E5C((HSD_GObj*) gobj, 2, ITEM_ANIM_UPDATE);
Item_80268E5C((Item_GObj*) gobj, 2, ITEM_ANIM_UPDATE);
}

bool it_80288FB0(HSD_GObj* gobj)
bool it_80288FB0(Item_GObj* gobj)
{
return false;
}

void it_80288FB8(HSD_GObj* gobj) {}
void it_80288FB8(Item_GObj* gobj) {}

void it_80288FBC(Item_GObj* gobj)
{
Expand All @@ -174,70 +171,70 @@ void it_80288FBC(Item_GObj* gobj)

void it_80288FDC(Item_GObj* gobj)
{
Item_80268E5C((HSD_GObj*) gobj, 3, 6);
Item_80268E5C(gobj, 3, 6);
}

void it_80289004(Item_GObj* gobj)
{
ItemAttr* temp_r4 = GET_ITEM(gobj)->xCC_item_attr;
it_80272860(gobj, temp_r4->x10_fall_speed, temp_r4->x14_fall_speed_max);
it_80274658((HSD_GObj*) gobj, it_804D6D28->x68_float);
ItemAttr* attr = GET_ITEM(gobj)->xCC_item_attr;
it_80272860(gobj, attr->x10_fall_speed, attr->x14_fall_speed_max);
it_80274658(gobj, it_804D6D28->x68_float);
}

bool it_80289050(Item_GObj* gobj)
{
if (it_8026DA08(gobj) != false) {
if (it_8026DA08(gobj)) {
return it_80289218(gobj);
}
return false;
}

void it_80289094(Item_GObj* gobj)
{
Item* item = GET_ITEM(gobj);
Item* ip = GET_ITEM(gobj);
it_8026BB44(gobj);
it_80272C08(gobj);
it_802756D0((HSD_GObj*) gobj);
it_802756D0(gobj);
it_8026B3A8(gobj);
it_8026BD24(gobj);
it_8027518C(gobj);
item->x40_vel.x = 0;
item->x40_vel.y = 0;
item->xDCF_flag.bits.b2 = 1;
item->xDD4_itemVar.capsule.x0 = 1;
item->xDD4_itemVar.capsule.x4 = 0x14;
Item_80268E5C((HSD_GObj*) gobj, 5, ITEM_ANIM_UPDATE);
ip->x40_vel.x = 0;
ip->x40_vel.y = 0;
ip->xDCF_flag.bits.b2 = true;
ip->xDD4_itemVar.egg.x0 = true;
ip->xDD4_itemVar.egg.rand_max = 20;
Item_80268E5C(gobj, 5, ITEM_ANIM_UPDATE);
}

bool it_8028912C(Item_GObj* gobj)
{
return it_802751D8(gobj);
}

void it_8028914C(HSD_GObj* gobj) {}
void it_8028914C(Item_GObj* gobj) {}

bool it_80289150(HSD_GObj* gobj)
bool it_80289150(Item_GObj* gobj)
{
return false;
}

void it_80289158(HSD_GObj* gobj)
void it_80289158(Item_GObj* gobj)
{
HSD_JObj* jobj = GET_JOBJ(gobj);
Item* item = GET_ITEM(gobj);
Item* ip = GET_ITEM(gobj);

HSD_JObjSetFlagsAll(jobj, JOBJ_HIDDEN);
it_802756D0(gobj);
item->x40_vel.x = 0.0F;
item->x40_vel.y = 0.0F;
item->xDCF_flag.bits.b2 = 1;
item->xDD4_itemVar.capsule.x0 = 1;
item->xDD4_itemVar.capsule.x4 = 0x28;
it_8026B3A8((Item_GObj*) gobj);
ip->x40_vel.x = 0.0F;
ip->x40_vel.y = 0.0F;
ip->xDCF_flag.bits.b2 = true;
ip->xDD4_itemVar.egg.x0 = true;
ip->xDD4_itemVar.egg.rand_max = 40;
it_8026B3A8(gobj);
Item_80268E5C(gobj, 6, ITEM_ANIM_UPDATE);
}

bool it_802891E0(HSD_GObj* gobj)
bool it_802891E0(Item_GObj* gobj)
{
Item* item = GET_ITEM(gobj);

Expand All @@ -250,9 +247,9 @@ bool it_802891E0(HSD_GObj* gobj)
}
}

void it_8028920C(HSD_GObj* gobj) {}
void it_8028920C(Item_GObj* gobj) {}

bool it_80289210(HSD_GObj* gobj)
bool it_80289210(Item_GObj* gobj)
{
return false;
}
Expand All @@ -268,46 +265,46 @@ bool it_80289218(Item_GObj* gobj)
return false;
}
efSync_Spawn(1232, gobj, &ip->pos);
Item_8026AE84(ip, 244, 0x7F, 0x40);
Item_8026AE84(ip, 244, 127, 64);
it_80289158(gobj);
return false;
}

bool it_802893D4(Item_GObj* gobj)
{
u8 _[4] = { 0 };
PAD_STACK(4);
return it_80289218(gobj);
}

bool it_80289470(Item_GObj* gobj)
{
u8 _[4] = { 0 };
PAD_STACK(4);
return it_80289218(gobj);
}

bool it_8028950C(Item_GObj* gobj)
{
u8 _[4] = { 0 };
PAD_STACK(4);
return it_80289218(gobj);
}

bool it_802895A8(Item_GObj* gobj)
{
u8 _[4] = { 0 };
PAD_STACK(4);
return it_80289218(gobj);
}

void it_80289644(Item_GObj* gobj)
{
Item_80268E5C((HSD_GObj*) gobj, 4, ITEM_ANIM_UPDATE);
Item_80268E5C(gobj, 4, ITEM_ANIM_UPDATE);
}

bool it_8028966C(HSD_GObj* gobj)
bool it_8028966C(Item_GObj* gobj)
{
return false;
}

void it_80289674(HSD_GObj* gobj) {}
void it_80289674(Item_GObj* gobj) {}

bool it_80289678(Item_GObj* gobj)
{
Expand All @@ -317,5 +314,5 @@ bool it_80289678(Item_GObj* gobj)

void it_802896AC(Item_GObj* gobj, Item_GObj* ref)
{
it_8026B894(gobj, (HSD_GObj*) ref);
it_8026B894(gobj, ref);
}
4 changes: 2 additions & 2 deletions src/melee/it/items/itegg.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
#define GALE01_288C88

#include "it/forward.h"
#include <dolphin/mtx/forward.h>

#include "it/items/types.h"
#include "it/types.h"

/* 288C88 */ Item_GObj* it_80288C88(HSD_GObj* arg_gobj, Vec3* pos, Vec3* vel,
f32 dir);
float dir);
/* 288D98 */ void it_80288D98(Item_GObj*);
/* 288F88 */ void it_80288F88(Item_GObj*);
/* 288FBC */ void it_80288FBC(Item_GObj*);
Expand Down
Loading

0 comments on commit ce6e5a9

Please sign in to comment.