Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/melee/it/itCharItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,15 @@ typedef struct itClimbersBlizzardAttributes {

typedef struct itClimbersIce_ItemVars {
/* +0 */ Item_GObj* x0;
/* +4 */ f32 x4;
/* +8 */ u8 x8_b0 : 1;
} itClimbersIce_ItemVars;

typedef struct itClimbersIceAttributes {
/* +00 */ u8 pad_00[0x28];
/* +28 */ f32 x28;
} itClimbersIceAttributes;

typedef struct itNessbat_ItemVars {
/* +0 ip+DD4 */ HSD_GObj* x0;
} itNessbat_ItemVars;
Expand Down
11 changes: 7 additions & 4 deletions src/melee/it/itCommonItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,11 @@ typedef struct itKyasarinEggAttributes {

typedef struct itHououAttr {
/* +00 */ f32 timer;
/* +04 */ u8 x4_pad[0xC];
/* +04 */ u8 x4_pad[4];
/* +08 */ f32 x8;
/* +0C */ f32 xC;
/* +10 */ f32 x10;
/* +14 */ u8 x14_pad[0x4];
/* +14 */ s32 x14;
/* +18 */ f32 x18;
/* +1C */ f32 x1C;
} itHououAttr;
Expand All @@ -189,7 +191,7 @@ typedef struct itLugiaAttributes {
/* +08 */ f32 x8;
/* +0C */ f32 xC;
/* +10 */ f32 x10;
/* +14 */ f32 x14;
/* +14 */ s32 x14;
/* +18 */ f32 x18;
} itLugiaAttributes;

Expand Down Expand Up @@ -1540,7 +1542,8 @@ typedef struct itCrazyHandBombAttributes {
typedef struct itLugia_ItemVars {
/* +00 ip+DD4 */ u8 x0_pad[0x60];
/* +60 ip+E34 */ s32 x60;
/* +64 ip+E38 */ u8 x64_pad[0x18];
/* +64 ip+E38 */ Vec3 x64;
/* +70 ip+E44 */ u8 x70_pad[0xC];
/* +7C ip+E50 */ Vec3 xE50;
} itLugia_ItemVars;

Expand Down
24 changes: 23 additions & 1 deletion src/melee/it/items/itclimbersice.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,29 @@ void it_802C1950(Item_GObj* gobj)
Item_80268E5C(gobj, 0, ITEM_ANIM_UPDATE);
}

/// #itClimbersice_UnkMotion0_Anim
bool itClimbersice_UnkMotion0_Anim(Item_GObj* gobj)
{
Item* ip = GET_ITEM(gobj);
HSD_JObj* jobj = gobj->hsd_obj;
itClimbersIceAttributes* sa = ip->xC4_article_data->x4_specialAttributes;
HSD_JObj* child;
PAD_STACK(8);

if (jobj == NULL) {
child = NULL;
} else {
child = jobj->child;
}

if (ip->xDD4_itemVar.climbersice.x8_b0) {
ip->xDD4_itemVar.climbersice.x4 *= sa->x28;
it_80272F7C(child, ip->xDD4_itemVar.climbersice.x4);
if (ip->xDD4_itemVar.climbersice.x4 < 0.01F) {
return true;
}
}
return false;
}

void itClimbersice_UnkMotion0_Phys(Item_GObj* gobj) {}

Expand Down
56 changes: 53 additions & 3 deletions src/melee/it/items/itgamewatchchef.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include "math.h"

#include "it/inlines.h"
#include "it/it_266F.h"
#include "it/it_26B1.h"
#include "it/it_2725.h"
#include "it/item.h"
Expand All @@ -17,7 +18,20 @@ bool itGameWatchChef_Logic112_DmgDealt(Item_GObj* gobj)
return false;
}

/// #it_802C84A0
void it_802C84A0(Item_GObj* gobj, s32 index)
{
Item* ip = GET_ITEM(gobj);
itGamewatchchefAttributes* attrs =
ip->xC4_article_data->x4_specialAttributes;
ip->xDD4_itemVar.gamewatchchef.x4 = index;
it_80275158(gobj, attrs->x8);
ip->xD5C = 0;
ip->x40_vel.x =
attrs->entries[ip->xDD4_itemVar.gamewatchchef.x4].x0 * ip->facing_dir;
ip->x40_vel.y = attrs->entries[ip->xDD4_itemVar.gamewatchchef.x4].x4;
it_8026B3A8(gobj);
Item_80268E5C(gobj, 0, ITEM_ANIM_UPDATE);
}

/// #itGamewatchchef_UnkMotion0_Anim

Expand All @@ -30,7 +44,22 @@ void itGamewatchchef_UnkMotion0_Phys(Item_GObj* gobj)
it_80272860(gobj, attrs->entries[index].x8, attrs->entries[index].xC);
}

/// #itGamewatchchef_UnkMotion0_Coll
bool itGamewatchchef_UnkMotion0_Coll(Item_GObj* gobj)
{
Item* ip = GET_ITEM(gobj);
itGamewatchchefAttributes* attrs =
ip->xC4_article_data->x4_specialAttributes;
if (0.0f != ip->x40_vel.x) {
s32 result = it_8026DAA8(gobj);
if (result & 0xC) {
ip->x40_vel.x *= -attrs->x4;
}
if (result & 3) {
it_802C875C(gobj);
}
}
return false;
}

void it_802C875C(Item_GObj* gobj)
{
Expand Down Expand Up @@ -62,7 +91,28 @@ bool itGamewatchchef_UnkMotion1_Anim(Item_GObj* gobj)

void itGamewatchchef_UnkMotion1_Phys(Item_GObj* gobj) {}

/// #itGamewatchchef_UnkMotion1_Coll
bool itGamewatchchef_UnkMotion1_Coll(Item_GObj* gobj)
{
Item* ip = GET_ITEM(gobj);
itGamewatchchefAttributes* attrs =
ip->xC4_article_data->x4_specialAttributes;
PAD_STACK(8);
if (0.0f != ip->x40_vel.x) {
s32 result = it_8026DAA8(gobj);
if (result & 0xC) {
ip->x40_vel.x *= -attrs->x4;
}
if (result & 3) {
ip = GET_ITEM(gobj);
attrs = ip->xC4_article_data->x4_specialAttributes;
ip->x40_vel.y = 0.0f;
ip->x40_vel.x = 0.0f;
it_80275158(gobj, attrs->xC);
Item_80268E5C(gobj, 1, ITEM_ANIM_UPDATE);
}
}
return false;
}

bool it_2725_Logic112_Clanked(Item_GObj* gobj)
{
Expand Down
2 changes: 1 addition & 1 deletion src/melee/it/items/itgamewatchchef.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/* 2C837C */ HSD_GObj* it_802C837C(Item_GObj*, Vec3*, enum_t, u32, float);
/* 2C847C */ bool itGameWatchChef_Logic112_DmgDealt(Item_GObj*);
/* 2C84A0 */ UNK_RET it_802C84A0(UNK_PARAMS);
/* 2C84A0 */ void it_802C84A0(Item_GObj* gobj, s32 index);
/* 2C8540 */ bool itGamewatchchef_UnkMotion0_Anim(Item_GObj* gobj);
/* 2C8690 */ void itGamewatchchef_UnkMotion0_Phys(Item_GObj* gobj);
/* 2C86D0 */ bool itGamewatchchef_UnkMotion0_Coll(Item_GObj* gobj);
Expand Down
69 changes: 65 additions & 4 deletions src/melee/it/items/ithouou.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <platform.h>

#include "ef/eflib.h"
#include "gr/stage.h"
#include "it/inlines.h"
#include "it/it_266F.h"
#include "it/it_26B1.h"
Expand All @@ -12,7 +13,20 @@
#include "it/item.h"
#include "mp/mplib.h"

/// #it_2725_Logic18_Spawned
void it_2725_Logic18_Spawned(Item_GObj* gobj)
{
Item* ip = GET_ITEM(gobj);
itHououAttr* attr = ip->xC4_article_data->x4_specialAttributes;
*(Vec3*) &ip->xDD4_itemVar.pokemon.x64 = ip->pos;
ip->facing_dir = 0.0F;
ip->xDAC_itcmd_var0 = 0;
ip->xDB0_itcmd_var1 = 0;
ip->xDD4_itemVar.pokemon.timer = attr->x14;
ip->xDCC_flag.b3 = false;
it_802D2BE0(gobj);
it_80279CDC(gobj, attr->timer);
ip->xDD4_itemVar.pokemon.xE44 = 0.0F;
}

void it_802D25B8(void) {}

Expand Down Expand Up @@ -77,7 +91,26 @@ bool itHouou_UnkMotion2_Anim(Item_GObj* gobj)
return false;
}

/// #itHouou_UnkMotion2_Phys
void itHouou_UnkMotion2_Phys(Item_GObj* gobj)
{
Item* ip = GET_ITEM(gobj);
itHououAttr* attr = ip->xC4_article_data->x4_specialAttributes;

it_8027A344(gobj);

if (it_80272C6C(gobj)) {
ip->xDD4_itemVar.pokemon.xE44 += attr->x8;
} else {
ip->xDD4_itemVar.pokemon.xE44 += attr->xC;
}

ip->x40_vel.y += ip->xDD4_itemVar.pokemon.xE44;

if (ip->pos.y > Stage_GetBlastZoneTopOffset()) {
ip->x40_vel.y = 0.0F;
it_802D27B0(gobj);
}
}

bool itHouou_UnkMotion2_Coll(Item_GObj* gobj)
{
Expand Down Expand Up @@ -229,7 +262,23 @@ bool itHouou_UnkMotion5_Coll(Item_GObj* gobj)
return false;
}

/// #it_802D2B4C
void it_802D2B4C(Item_GObj* gobj)
{
Item* ip = GET_ITEM(gobj);

if (ip->xDAC_itcmd_var0 != 0) {
ip->xDAC_itcmd_var0 = 0;
it_8027ADEC(0x46F, gobj, ip->xBBC_dynamicBoneTable->bones[16],
1.3F);
it_8027ADEC(0x46F, gobj, ip->xBBC_dynamicBoneTable->bones[17],
1.3F);
}

if (ip->xDB0_itcmd_var1 != 0) {
ip->xDB0_itcmd_var1 = 0;
it_802D2D2C(gobj);
}
}

void it_802D2BE0(Item_GObj* gobj)
{
Expand All @@ -247,7 +296,19 @@ bool it_802D2C54(Item_GObj* gobj)
return false;
}

/// #it_802D2C78
void it_802D2C78(Item_GObj* gobj)
{
if (it_8027A09C(gobj)) {
Item* ip = GET_ITEM(gobj);
Item* ip2;
it_80273454(gobj);
ip2 = GET_ITEM(gobj);
Item_80268E5C(gobj, 1, ITEM_ANIM_UPDATE);
ip2->entered_hitlag = efLib_PauseAll;
ip2->exited_hitlag = efLib_ResumeAll;
ip->xDD1_flag.b1 = true;
}
}

bool it_802D2D04(Item_GObj* gobj)
{
Expand Down
4 changes: 2 additions & 2 deletions src/melee/it/items/ithouou.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@
/* 2D2AC0 */ bool itHouou_UnkMotion5_Anim(Item_GObj* gobj);
/* 2D2B24 */ void itHouou_UnkMotion5_Phys(Item_GObj* gobj);
/* 2D2B44 */ bool itHouou_UnkMotion5_Coll(Item_GObj* gobj);
/* 2D2B4C */ UNK_RET it_802D2B4C(UNK_PARAMS);
/* 2D2B4C */ void it_802D2B4C(Item_GObj*);
/* 2D2BE0 */ void it_802D2BE0(Item_GObj*);
/* 2D2C54 */ bool it_802D2C54(Item_GObj* gobj);
/* 2D2C78 */ void it_802D2C78(Item_GObj* gobj);
/* 2D2D04 */ bool it_802D2D04(Item_GObj* gobj);
/* 2D2D2C */ UNK_RET it_802D2D2C(UNK_PARAMS);
/* 2D2D2C */ void it_802D2D2C(Item_GObj*);
/* 2D2E80 */ void it_2725_Logic42_Spawned(Item_GObj*);
/* 2D2ED0 */ void it_802D2ED0(Item_GObj*, Item_GObj*);
/* 2D2EF0 */ void it_802D2EF0(Item_GObj* gobj);
Expand Down
46 changes: 43 additions & 3 deletions src/melee/it/items/itlugia.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,26 @@
#include <platform.h>

#include "ef/eflib.h"
#include "gr/stage.h"
#include "it/inlines.h"
#include "it/it_266F.h"
#include "it/it_26B1.h"
#include "it/it_2725.h"
#include "it/item.h"

/// #it_2725_Logic17_Spawned
void it_2725_Logic17_Spawned(Item_GObj* gobj)
{
Item* ip = GET_ITEM(gobj);
itLugiaAttributes* attrs = ip->xC4_article_data->x4_specialAttributes;
ip->xDD4_itemVar.lugia.x64 = ip->pos;
ip->facing_dir = it_804DD450;
ip->xDAC_itcmd_var0 = 0;
ip->xDD4_itemVar.lugia.x60 = attrs->x14;
ip->xDCC_flag.b3 = 0;
it_802D1D40(gobj);
it_80279CDC(gobj, attrs->x0);
ip->xDD4_itemVar.lugia.xE50.x = it_804DD450;
}

void it_802D14D0(void) {}

Expand Down Expand Up @@ -76,7 +89,22 @@ bool itLugia_UnkMotion2_Anim(Item_GObj* gobj)
return false;
}

/// #itLugia_UnkMotion2_Phys
void itLugia_UnkMotion2_Phys(Item_GObj* gobj)
{
Item* ip = GET_ITEM(gobj);
itLugiaAttributes* attrs = ip->xC4_article_data->x4_specialAttributes;
it_8027A344(gobj);
if (it_80272C6C(gobj)) {
ip->xDD4_itemVar.lugia.xE50.x += attrs->x8;
} else {
ip->xDD4_itemVar.lugia.xE50.x += attrs->xC;
}
ip->x40_vel.y += ip->xDD4_itemVar.lugia.xE50.x;
if (ip->pos.y > Stage_GetBlastZoneTopOffset()) {
ip->x40_vel.y = it_804DD450;
it_802D16D4(gobj);
}
}

bool itLugia_UnkMotion2_Coll(Item_GObj* gobj)
{
Expand Down Expand Up @@ -220,7 +248,19 @@ bool it_802D1DB4(Item_GObj* gobj)
return false;
}

/// #it_802D1DD8
void it_802D1DD8(Item_GObj* gobj)
{
if (it_8027A09C(gobj)) {
Item* old_ip = GET_ITEM(gobj);
Item* ip;
it_80273454(gobj);
ip = GET_ITEM(gobj);
Item_80268E5C(gobj, 1, ITEM_ANIM_UPDATE);
ip->entered_hitlag = efLib_PauseAll;
ip->exited_hitlag = efLib_ResumeAll;
old_ip->xDD1_flag.b1 = 1;
}
}

bool it_802D1E64(Item_GObj* gobj)
{
Expand Down
Loading
Loading