Skip to content

Commit

Permalink
Match ittogepy (#1275)
Browse files Browse the repository at this point in the history
* Match it_802D36B0

* Match ittogepy

* Remove .s file
  • Loading branch information
PsiLupan authored Feb 20, 2024
1 parent 604b21a commit 3c8eaf2
Show file tree
Hide file tree
Showing 8 changed files with 202 additions and 394 deletions.
385 changes: 0 additions & 385 deletions asm/melee/it/items/ittogepy.s

This file was deleted.

2 changes: 1 addition & 1 deletion config/GALE01/symbols.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20413,7 +20413,7 @@ it_803B86BC = .rodata:0x803B86BC; // type:object size:0xC scope:global data:4byt
it_803B86C8 = .rodata:0x803B86C8; // type:object size:0x10 scope:global data:4byte
it_803B86D8 = .rodata:0x803B86D8; // type:object size:0x10 scope:global data:4byte
it_803B86E8 = .rodata:0x803B86E8; // type:object size:0x10 scope:global data:4byte
it_803B86F8 = .rodata:0x803B86F8; // type:object size:0x10 scope:global data:4byte
@183 = .rodata:0x803B86F8; // type:object size:0xC scope:local data:4byte
it_803B8708 = .rodata:0x803B8708; // type:object size:0x10 scope:global data:4byte
it_803B8718 = .rodata:0x803B8718; // type:object size:0xC scope:global data:4byte
it_803B8724 = .rodata:0x803B8724; // type:object size:0xC scope:global data:4byte
Expand Down
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -989,7 +989,7 @@ def RuntimeLib(lib_name: str, objects: Objects) -> LibDict:
Object(NonMatching, "melee/it/items/ithouou.c"),
Object(Matching, "melee/it/items/itmetamon.c"),
Object(Matching, "melee/it/items/itpippi.c"),
Object(NonMatching, "melee/it/items/ittogepy.c"),
Object(Matching, "melee/it/items/ittogepy.c"),
Object(NonMatching, "melee/it/items/itmew.c"),
Object(Matching, "melee/it/items/itcerebi.c"),
Object(NonMatching, "melee/it/items/ithitodeman.c"),
Expand Down
2 changes: 1 addition & 1 deletion obj_files.mk
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ TEXT_O_FILES +=\
$(BUILD_DIR)/asm/melee/it/items/ithouou.s.o\
$(BUILD_DIR)/src/melee/it/items/itmetamon.c.o\
$(BUILD_DIR)/src/melee/it/items/itpippi.c.o\
$(BUILD_DIR)/asm/melee/it/items/ittogepy.s.o\
$(BUILD_DIR)/src/melee/it/items/ittogepy.c.o\
$(BUILD_DIR)/asm/melee/it/items/itmew.s.o\
$(BUILD_DIR)/src/melee/it/items/itcerebi.c.o\
$(BUILD_DIR)/asm/melee/it/items/ithitodeman.s.o\
Expand Down
1 change: 1 addition & 0 deletions src/melee/it/itCommonItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ typedef struct itPokemonAttributes {
s32 xC;
s32 x10;
s32 x14;
s32 x18;
} itPokemonAttributes;

typedef struct {
Expand Down
3 changes: 1 addition & 2 deletions src/melee/it/items/itpippi.c
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
#include "itpippi.h"

#include "ef/eflib.h"
#include "ef/efsync.h"
#include "it/inlines.h"
#include "it/it_266F.h"
#include "it/it_26B1.h"
#include "it/it_2725.h"
#include "it/types.h"

#include <baselib/gobj.h>
#include <baselib/random.h>

ItemStateTable it_803F7FF8[] = {
Expand Down
180 changes: 180 additions & 0 deletions src/melee/it/items/ittogepy.c
Original file line number Diff line number Diff line change
@@ -1 +1,181 @@
#include "ittogepy.h"

#include "it/inlines.h"
#include "it/it_266F.h"
#include "it/it_26B1.h"
#include "it/it_2725.h"
#include "it/types.h"

#include <baselib/gobj.h>
#include <baselib/random.h>

ItemStateTable it_803F8058[] = {
{ 0, it_802D3A68, it_802D3A8C, it_802D3AF0 },
{ 1, it_802D374C, it_802D37C0, it_802D37FC },
{ 2, it_802D390C, it_802D3970, it_802D39AC },
{ 3, it_802D390C, it_802D3970, it_802D39AC },
{ 4, it_802D390C, it_802D3970, it_802D39AC },
{ 5, it_802D390C, it_802D3970, it_802D39AC },
{ 6, it_802D390C, it_802D3970, it_802D39AC },
};

void it_802D36B0(Item_GObj* gobj)
{
Item* it = gobj->user_data;
Article* ap = it->xC4_article_data;
itPokemonAttributes* sa = ap->x4_specialAttributes;

it->facing_dir = 0.0f;
it->xDB4_itcmd_var2 = 0;
it->xDB0_itcmd_var1 = 0;
it->xDAC_itcmd_var0 = 0;
it_80279CDC(gobj, sa->x0);
it_802D39F8(gobj);
Item_8026AE84(it, 0x272C, 0x7F, 0x40);
}

void it_802D3728(Item_GObj* gobj)
{
return;
}

void it_802D372C(Item_GObj* gobj, Item_GObj* ref_gobj)
{
it_8026B894(gobj, ref_gobj);
}

bool it_802D374C(Item_GObj* gobj)
{
Item* it = gobj->user_data;
int timer;

if (it_80272C6C(gobj) == false) {
timer = --it->xDD4_itemVar.pokemon.timer;
if (it->xDD4_itemVar.pokemon.timer <= 0) {
it_802D3848(gobj);
} else {
Item_80268D34(gobj, it->xD0_itemStateDesc);
}
}
return false;
}

void it_802D37C0(Item_GObj* gobj)
{
Item* it = gobj->user_data;
if (it->ground_or_air == GA_Air) {
it_80272860(gobj, it->xCC_item_attr->x10_fall_speed,
it->xCC_item_attr->x14_fall_speed_max);
}
}

bool it_802D37FC(Item_GObj* gobj)
{
Item* it = gobj->user_data;
if (it->ground_or_air == GA_Air) {
it_8026E15C(gobj, it_802D3728);
} else {
it_8026D62C(gobj, it_802D3728);
}
return false;
}

void it_802D3848(Item_GObj* gobj)
{
Item* it = gobj->user_data;
Article* ap = it->xC4_article_data;
itPokemonAttributes* sa = ap->x4_specialAttributes;
int rand = HSD_Randi(sa->max);
int val = sa->xC;
int state;
PAD_STACK(8);

if (rand < val) {
state = 2;
} else {
val += sa->x10;
if (rand < val) {
state = 3;
} else {
val = sa->x14 + val;
if (rand < val) {
state = 4;
} else if (rand < sa->x18 + val) {
state = 5;
} else {
state = 6;
}
}
}
Item_80268E5C(gobj, state, ITEM_ANIM_UPDATE);
it->entered_hitlag = NULL;
it->exited_hitlag = NULL;
}

bool it_802D390C(Item_GObj* gobj)
{
Item* it = gobj->user_data;
if (it_80272C6C(gobj) == false) {
Item_80268D34(gobj, it->xD0_itemStateDesc);
}
if (it->xDAC_itcmd_var0) {
return true;
}
return false;
}

void it_802D3970(Item_GObj* gobj)
{
Item* it = GET_ITEM((HSD_GObj*) gobj);
if (it->ground_or_air == GA_Air) {
it_80272860(gobj, it->xCC_item_attr->x10_fall_speed,
it->xCC_item_attr->x14_fall_speed_max);
}
}

bool it_802D39AC(Item_GObj* gobj)
{
Item* it = GET_ITEM((HSD_GObj*) gobj);
if (it->ground_or_air == GA_Air) {
it_8026E15C(gobj, it_802D3728);
} else {
it_8026D62C(gobj, it_802D3728);
}
return false;
}

void it_802D39F8(Item_GObj* gobj)
{
Item* it = gobj->user_data;
Article* ap = it->xC4_article_data;
itPokemonAttributes* sa = ap->x4_specialAttributes;

it_802762BC(it);
Item_80268E5C(gobj, 0, ITEM_ANIM_UPDATE);
it->entered_hitlag = NULL;
it->exited_hitlag = NULL;
it->xDD4_itemVar.pokemon.timer = sa->timer;
}

bool it_802D3A68(Item_GObj* gobj)
{
it_80279FF8(gobj);

return false;
}

void it_802D3A8C(Item_GObj* gobj)
{
if (it_8027A09C(gobj)) {
Item* it = gobj->user_data;
it_80273454(gobj);
Item_80268E5C(gobj, 1, ITEM_ANIM_UPDATE);
it->entered_hitlag = NULL;
it->exited_hitlag = NULL;
}
}

bool it_802D3AF0(Item_GObj* gobj)
{
return it_8027A118(gobj, it_802D3728);
}
21 changes: 17 additions & 4 deletions src/melee/it/items/ittogepy.h
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
#ifndef GALE01_2D36B0
#define GALE01_2D36B0

#include "it/forward.h"
#include <platform.h>

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

/* 2D36B0 */ void it_802D36B0(Item_GObj*);
/* 2D372C */ void it_802D372C(Item_GObj*, Item_GObj*);
/* 3F8058 */ extern ItemStateTable it_803F8058[];
void it_802D36B0(Item_GObj*);
void it_802D3728(Item_GObj*);
void it_802D372C(Item_GObj*, Item_GObj*);
bool it_802D374C(Item_GObj*);
void it_802D37C0(Item_GObj*);
bool it_802D37FC(Item_GObj*);
void it_802D3848(Item_GObj*);
bool it_802D390C(Item_GObj*);
void it_802D3970(Item_GObj*);
bool it_802D39AC(Item_GObj*);
void it_802D39F8(Item_GObj*);
bool it_802D3A68(Item_GObj*);
void it_802D3A8C(Item_GObj*);
bool it_802D3AF0(Item_GObj*);
extern ItemStateTable it_803F8058[];

#endif

0 comments on commit 3c8eaf2

Please sign in to comment.