Skip to content

Commit

Permalink
itrabbitc work
Browse files Browse the repository at this point in the history
  • Loading branch information
AaronB-Hub authored and ribbanya committed Sep 25, 2024
1 parent 0599747 commit c67a94c
Show file tree
Hide file tree
Showing 13 changed files with 224 additions and 77 deletions.
34 changes: 18 additions & 16 deletions src/melee/ft/chara/ftCommon/ftpickupitem.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ bool ftpickupitem_80094150(ftCo_GObj* gobj, Item_GObj* item_gobj)
return false;
}

HSD_GObj* ftpickupitem_800942A0(HSD_GObj* gobj, u32 flags)
Item_GObj* ftpickupitem_800942A0(ftCo_GObj* gobj, u32 flags)
{
ftCo_Fighter* fp = GET_FIGHTER(gobj);
itPickup* pickup = &fp->x294_itPickup;
Expand All @@ -85,8 +85,8 @@ HSD_GObj* ftpickupitem_800942A0(HSD_GObj* gobj, u32 flags)
}
{
float min_dist_sq = 30000;
HSD_GObj* cur = HSD_GObj_Entities->items;
HSD_GObj* result = NULL;
Item_GObj* cur = HSD_GObj_Entities->items;
Item_GObj* result = NULL;
while (cur != NULL) {
if (Item_IsGrabbable(cur)) {
enum_t unk_enum = it_8026B2B4(cur);
Expand All @@ -96,8 +96,10 @@ HSD_GObj* ftpickupitem_800942A0(HSD_GObj* gobj, u32 flags)
if ((unk_enum == 0 && flags & (1 << 0)) ||
(unk_enum == 1 && flags & (1 << 1)))
{
Vec4* vec;
Vec3 it_pos;
Vec4* vec;
PAD_STACK(4);

it_8026B344(cur, &it_pos);
{
float x_range = it_8026B378(cur);
Expand Down Expand Up @@ -134,7 +136,7 @@ HSD_GObj* ftpickupitem_800942A0(HSD_GObj* gobj, u32 flags)
}
}

bool ftpickupitem_8009447C(HSD_GObj* gobj, HSD_GObj* item_gobj)
bool ftpickupitem_8009447C(ftCo_GObj* gobj, Item_GObj* item_gobj)
{
ftCo_Fighter* fp = GET_FIGHTER(gobj);
if (item_gobj == NULL) {
Expand Down Expand Up @@ -189,7 +191,7 @@ bool ftpickupitem_8009447C(HSD_GObj* gobj, HSD_GObj* item_gobj)
return false;
}

void ftpickupitem_80094694(HSD_GObj* gobj, FtMotionId msid, bool loop)
void ftpickupitem_80094694(ftCo_GObj* gobj, FtMotionId msid, bool loop)
{
ftCo_Fighter* fp = gobj->user_data;
{
Expand Down Expand Up @@ -221,11 +223,11 @@ void ftpickupitem_80094694(HSD_GObj* gobj, FtMotionId msid, bool loop)
}
}

bool ftpickupitem_80094790(HSD_GObj* gobj)
bool ftpickupitem_80094790(ftCo_GObj* gobj)
{
u8 _[8] = { 0 };
if (GET_FIGHTER(gobj)->x1978 == NULL) {
HSD_GObj* unk_gobj = ftpickupitem_800942A0(gobj, 3);
Item_GObj* unk_gobj = ftpickupitem_800942A0(gobj, 3);
if (unk_gobj != NULL) {
if (!it_8026B2B4(unk_gobj)) {
ftpickupitem_80094694(gobj, 92, 0);
Expand All @@ -238,7 +240,7 @@ bool ftpickupitem_80094790(HSD_GObj* gobj)
return false;
}

void ftpickupitem_80094818(HSD_GObj* gobj, int arg1)
void ftpickupitem_80094818(ftCo_GObj* gobj, int arg1)
{
u8 _[8] = { 0 };
ftCo_Fighter* fp = gobj->user_data;
Expand Down Expand Up @@ -306,7 +308,7 @@ static inline enum_t inlineA0(ftCo_Fighter* fp)
return unk_enum;
}

void ftpickupitem_Anim(HSD_GObj* gobj)
void ftpickupitem_Anim(ftCo_GObj* gobj)
{
ftCo_Fighter* fp = gobj->user_data;
if (ftCheckThrowB3(fp)) {
Expand Down Expand Up @@ -335,19 +337,19 @@ void ftpickupitem_Anim(HSD_GObj* gobj)
}
}

void ftpickupitem_IASA(HSD_GObj* gobj) {}
void ftpickupitem_IASA(ftCo_GObj* gobj) {}

void ftpickupitem_Phys(HSD_GObj* gobj)
void ftpickupitem_Phys(ftCo_GObj* gobj)
{
ft_80084F3C(gobj);
}

void ftpickupitem_Coll(HSD_GObj* gobj)
void ftpickupitem_Coll(ftCo_GObj* gobj)
{
ft_800841B8(gobj, ftpickupitem_80094D90);
}

void ftpickupitem_80094B6C(HSD_GObj* gobj, HSD_GObj* item_gobj)
void ftpickupitem_80094B6C(ftCo_GObj* gobj, Item_GObj* item_gobj)
{
Vec3 vec;
u8 _[4] = { 0 };
Expand Down Expand Up @@ -403,7 +405,7 @@ void ftpickupitem_80094B6C(HSD_GObj* gobj, HSD_GObj* item_gobj)
}
}

void ftpickupitem_80094D90(HSD_GObj* gobj)
void ftpickupitem_80094D90(ftCo_GObj* gobj)
{
ftCo_Fighter* fp = gobj->user_data;
ftCo_8009750C(gobj);
Expand All @@ -417,7 +419,7 @@ void ftpickupitem_80094D90(HSD_GObj* gobj)
ftCo_800CC730(gobj);
}

void ftpickupitem_80094DF8(HSD_GObj* gobj)
void ftpickupitem_80094DF8(ftCo_GObj* gobj)
{
ftCo_Fighter* fp = gobj->user_data;
if (fp->item_gobj != NULL) {
Expand Down
2 changes: 1 addition & 1 deletion src/melee/ft/chara/ftCommon/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ union ftCommon_MotionVars {
/* fp+236C */ float x2C;
} guard;
struct {
/* fp+2340 */ bool x0;
/* fp+2340 */ bool x0; // itemget action is heavy type?
} itemget;
struct {
/* fp+2340 */ float facing_dir;
Expand Down
2 changes: 1 addition & 1 deletion src/melee/ft/ftcommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1632,7 +1632,7 @@ void ftCommon_8007FA00(HSD_GObj* gobj)
it_80294E78(fp->x197C, fp->x34_scale.y * vec[2].x);
}

void ftCommon_8007FA58(HSD_GObj* gobj, HSD_GObj* arg1)
void ftCommon_8007FA58(ftCo_GObj* gobj, Item_GObj* arg1)
{
Fighter* fp = gobj->user_data;
Vec3 vec;
Expand Down
3 changes: 2 additions & 1 deletion src/melee/ft/ftcommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

#include "ft/forward.h"
#include "ftCommon/forward.h"
#include "it/forward.h"
#include <baselib/forward.h>

/* 07C930 */ void ftCommon_8007C930(ftCo_Fighter*, float);
Expand Down Expand Up @@ -102,7 +103,7 @@
/* 07F948 */ void ftCommon_8007F948(ftCo_GObj*, ftCo_GObj*, s32);
/* 07F9B4 */ void ftCommon_8007F9B4(ftCo_GObj*);
/* 07FA00 */ void ftCommon_8007FA00(ftCo_GObj*);
/* 07FA58 */ void ftCommon_8007FA58(ftCo_GObj*, ftCo_GObj*);
/* 07FA58 */ void ftCommon_8007FA58(ftCo_GObj*, Item_GObj*);
/* 07FC7C */ void ftCommon_8007FC7C(ftCo_GObj*, float);
/* 07FDA0 */ void ftCommon_8007FDA0(ftCo_GObj*);
/* 07FE84 */ void ftCommon_8007FE84(ftCo_GObj*, ftCo_GObj*, s32, float);
Expand Down
2 changes: 1 addition & 1 deletion src/melee/ft/ftlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,7 +781,7 @@ void ftLib_80087140(HSD_GObj* gobj)
}
}

void ftLib_800871A8(HSD_GObj* gobj, HSD_GObj* item_gobj)
void ftLib_800871A8(Fighter_GObj* gobj, Item_GObj* item_gobj)
{
Fighter* fp = GET_FIGHTER(gobj);
HSD_ASSERT(1117, itGetKind(item_gobj) == It_Kind_MetalB);
Expand Down
2 changes: 1 addition & 1 deletion src/melee/ft/ftlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
/* 0870F0 */ void ftLib_800870F0(HSD_GObj*, s32);
/* 087120 */ s32 ftLib_80087120(HSD_GObj*);
/* 087140 */ void ftLib_80087140(HSD_GObj*);
/* 0871A8 */ void ftLib_800871A8(HSD_GObj*, HSD_GObj*);
/* 0871A8 */ void ftLib_800871A8(Fighter_GObj*, Item_GObj*);
/* 087284 */ bool ftLib_80087284(HSD_GObj*);
/* 0872A4 */ FighterKind ftLib_800872A4(HSD_GObj*);
/* 0872B0 */ void* ftLib_800872B0(HSD_GObj*);
Expand Down
6 changes: 3 additions & 3 deletions src/melee/it/itCommonItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ typedef struct {
} ItCapsuleVars;

typedef struct {
bool x0; // [1 or true]
bool x0; // [true]
s32 x4; // [8]
} ItCapsuleAttr;

Expand Down Expand Up @@ -152,8 +152,8 @@ typedef struct ItLGunVars {
} ItLGunVars;

typedef struct ItLGunAttr {
int x0; // [16]
Vec3 pos; // [0, 2.128, 6.668]
int max_ammo; // [16]
Vec3 pos; // [0, 2.128, 6.668]
} ItLGunAttr;

typedef struct ItLGunRayVars {
Expand Down
11 changes: 4 additions & 7 deletions src/melee/it/item.c
Original file line number Diff line number Diff line change
Expand Up @@ -2027,22 +2027,19 @@ void Item_8026A8EC(Item_GObj* gobj)
HSD_GObjPLink_80390228(gobj);
}

// These param names do no match up with those in function declaration
// (Item_GObj* gobj, HSD_GObj* owner_gobj, Fighter_Part part)
void Item_8026AB54(HSD_GObj* gobj, HSD_GObj* pickup_gfx,
Fighter_Part pickup_sfx)
void Item_8026AB54(Item_GObj* gobj, HSD_GObj* owner_gobj, Fighter_Part part)
{
u8 _[16];

Item* item_data = (Item*) HSD_GObjGetUserData(gobj);

it_80273168(gobj);
it_802742F4(gobj, pickup_gfx, pickup_sfx);
it_802742F4(gobj, owner_gobj, part);
RunCallback(gobj, item_data->xB8_itemLogicTable->picked_up);
Item_8026B074(item_data);
}

void Item_8026ABD8(HSD_GObj* gobj, Vec3* pos, f32 arg2)
void Item_8026ABD8(Item_GObj* gobj, Vec3* pos, f32 arg2)
{
u8 _[8];
Item* item_data = (Item*) HSD_GObjGetUserData(gobj);
Expand Down Expand Up @@ -2219,7 +2216,7 @@ static void Item_8026B0B4(HSD_GObj* gobj)
}

/// Check if item is grabbable
bool Item_IsGrabbable(HSD_GObj* gobj)
bool Item_IsGrabbable(Item_GObj* gobj)
{
Item* temp_item;

Expand Down
4 changes: 2 additions & 2 deletions src/melee/it/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ struct ItemStateDesc;
/* 26A8EC */ void Item_8026A8EC(Item_GObj* gobj);
/* 26AB54 */ void Item_8026AB54(HSD_GObj* gobj, HSD_GObj* owner_gobj,
Fighter_Part part);
/* 26ABD8 */ void Item_8026ABD8(HSD_GObj* gobj, Vec3* pos, float);
/* 26ABD8 */ void Item_8026ABD8(Item_GObj* gobj, Vec3* pos, float);
/* 26AC74 */ void Item_8026AC74(HSD_GObj* gobj, Vec3*, Vec3*, float);
/* 26AD20 */ void Item_8026AD20(HSD_GObj* gobj, Vec3*, Vec3*, float);
/* 26ADC0 */ void Item_8026ADC0(HSD_GObj* gobj);
Expand All @@ -54,7 +54,7 @@ struct ItemStateDesc;
int volume);
/* 26B034 */ void Item_8026B034(Item* item_data);
/* 26B074 */ void Item_8026B074(Item* item_data);
/* 26B1A4 */ bool Item_IsGrabbable(HSD_GObj* gobj);
/* 26B1A4 */ bool Item_IsGrabbable(Item_GObj* gobj);
/* 4A0C38 */ extern HSD_ObjAllocData Item_804A0C38;
/* 4A0C64 */ extern HSD_ObjAllocUnk Item_804A0C64;
/* 4A0CCC */ extern HSD_ObjAllocUnk2 Item_804A0CCC;
Expand Down
2 changes: 1 addition & 1 deletion src/melee/it/items/itlgun.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void it_8028E738(Item_GObj* gobj)
{
Item* ip = gobj->user_data;
ItLGunAttr* item_spec_attr = ip->xC4_article_data->x4_specialAttributes;
ip->xD4C = item_spec_attr->x0;
ip->xD4C = item_spec_attr->max_ammo;
ip->xDD4_itemVar.lgun.timer = 0;
it_8028E860(gobj);
}
Expand Down
Loading

0 comments on commit c67a94c

Please sign in to comment.