Skip to content

Commit

Permalink
Revert "use itPokemonAttributes and itPokemonVars"
Browse files Browse the repository at this point in the history
This reverts commit bd71b0b.
  • Loading branch information
wyatt-avilla committed Mar 20, 2024
1 parent cb9ca90 commit 9d83971
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 16 deletions.
15 changes: 14 additions & 1 deletion src/melee/it/itCommonItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@ typedef struct itPokemonAttributes {
typedef struct {
u8 padding[0xE34 - 0xDD4];
s32 timer;
s32 x64;
} ItPokemonVars;

typedef struct {
Expand Down Expand Up @@ -217,4 +216,18 @@ typedef struct CoinVars {
int x14;
} CoinVars;

typedef struct itMarumineAttributes {
f32 x0;
s32 x4;
int x8;
s32 xC;
} itMarumineAttributes;

typedef struct itMarumineVars {
u8 x0_padding[0xE34 - 0xDD4];
s32 x60;
s32 x64;

} itMarumineVars;

#endif
30 changes: 15 additions & 15 deletions src/melee/it/items/itmarumine.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,18 @@ void it_802D09D0(Item_GObj* gobj)
void it_802D0A0C(Item_GObj* gobj)
{
Item* ip;
itPokemonAttributes* attr;
itMarumineAttributes* attr;

ip = GET_ITEM(gobj);
attr = ip->xC4_article_data->x4_specialAttributes;
ip->facing_dir = 0.0F;
ip->xDC8_word.flags.x0 = true;
ip->xDD4_itemVar.pokemon.timer = 0xB4 - attr->max;
ip->xDD4_itemVar.marumine.x60 = 0xB4 - attr->x8;
it_80279CDC(gobj, attr->x0);
it_80273454(gobj);
it_802D1320(gobj);
ip->xDC8_word.flags.x0 = true;
ip->xDD4_itemVar.pokemon.x64 = attr->xC;
ip->xDD4_itemVar.marumine.x64 = attr->xC;
ip->xDAC_itcmd_var0 = 1;
}

Expand Down Expand Up @@ -126,10 +126,10 @@ void it_802D0BB4(Item_GObj* gobj) {}
bool it_802D0BB8(Item_GObj* gobj)
{
Item* ip = GET_ITEM(gobj);
itPokemonAttributes* attr = ip->xC4_article_data->x4_specialAttributes;
itMarumineAttributes* attr = ip->xC4_article_data->x4_specialAttributes;

if (it_8026DA08(gobj) == false) {
if (ip->x5CC_currentAnimFrame >= attr->timer) {
if (ip->x5CC_currentAnimFrame >= attr->x4) {
it_802D0C44(gobj);
}
}
Expand Down Expand Up @@ -196,15 +196,15 @@ bool it_802D0DB4(Item_GObj* gobj)
void it_802D0DBC(Item_GObj* gobj)
{
f32 sp10;
itPokemonAttributes* attr;
itMarumineAttributes* attr;
Item* ip = GET_ITEM(gobj);

if (--ip->xDD4_itemVar.pokemon.x64 == 0) {
if (--ip->xDD4_itemVar.marumine.x64 == 0) {
attr = ip->xC4_article_data->x4_specialAttributes;
sp10 = 1.0F;
efSync_Spawn(0x471, gobj, (ip->xBBC_dynamicBoneTable->bones[3]),
&sp10);
ip->xDD4_itemVar.pokemon.x64 = attr->xC;
ip->xDD4_itemVar.marumine.x64 = attr->xC;
}
}

Expand Down Expand Up @@ -256,12 +256,12 @@ void fn_802D0F98(Item_GObj* gobj)
f32 sp10;
Item* ip = GET_ITEM(gobj);

if (--ip->xDD4_itemVar.pokemon.x64 == 0) {
itPokemonAttributes* attr =
if (--ip->xDD4_itemVar.marumine.x64 == 0) {
itMarumineAttributes* attr =
ip->xC4_article_data->x4_specialAttributes;
sp10 = 1.0F;
efSync_Spawn(0x471, gobj, ip->xBBC_dynamicBoneTable->bones[3], &sp10);
ip->xDD4_itemVar.pokemon.x64 = attr->xC;
ip->xDD4_itemVar.marumine.x64 = attr->xC;
}
}

Expand Down Expand Up @@ -310,17 +310,17 @@ void it_802D1140(Item_GObj* gobj)
{
f32 sp10;
Item* ip;
itPokemonAttributes* attr;
itMarumineAttributes* attr;

ip = GET_ITEM(gobj);

if (--ip->xDD4_itemVar.pokemon.timer < 0) {
if (--ip->xDD4_itemVar.pokemon.x64 == 0) {
if (--ip->xDD4_itemVar.marumine.x60 < 0) {
if (--ip->xDD4_itemVar.marumine.x64 == 0) {
attr = ip->xC4_article_data->x4_specialAttributes;
sp10 = 1.0F;
efSync_Spawn(0x471, gobj, ip->xBBC_dynamicBoneTable->bones[3],
&sp10);
ip->xDD4_itemVar.pokemon.x64 = attr->xC;
ip->xDD4_itemVar.marumine.x64 = attr->xC;
}
it_8026B390(gobj);
if (ip->xDAC_itcmd_var0 != 0) {
Expand Down
1 change: 1 addition & 0 deletions src/melee/it/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,7 @@ struct Item {
itShellVars shell;
itTargetVars target;
CoinVars coin;
itMarumineVars marumine;
u8 padding[0xFCC - 0xDD4];
} xDD4_itemVar;
};
Expand Down

0 comments on commit 9d83971

Please sign in to comment.