Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Fox item attr's and values #1457

Closed
wants to merge 49 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
9d0f47f
Foxblaster decomp work
AaronB-Hub Aug 12, 2024
0abaa8b
Update .pre-commit-config.yaml
AaronB-Hub Aug 12, 2024
dc0d972
formatting
AaronB-Hub Aug 12, 2024
e16541a
More formatting
AaronB-Hub Aug 12, 2024
50672d5
Merge branch 'upstream-master' into AaronB-Hub/master
ribbanya Aug 12, 2024
afb7dae
Fix newline
ribbanya Aug 12, 2024
a1ce72c
Merge branch 'doldecomp:master' into master
AaronB-Hub Aug 12, 2024
69e51ad
Merge branch 'doldecomp:master' into master
AaronB-Hub Aug 12, 2024
753ea33
Fox blaster demystification work
AaronB-Hub Aug 18, 2024
bfcb083
formatting previous commit
AaronB-Hub Aug 18, 2024
2c6a9a4
Update itCharItems.h
AaronB-Hub Aug 18, 2024
ccf5397
Merge branch 'doldecomp:master' into master
AaronB-Hub Aug 18, 2024
c47668c
clarifying fox blaster vars' uses
AaronB-Hub Aug 19, 2024
2944063
Update itfoxblaster.c
AaronB-Hub Aug 19, 2024
666eedb
Demystified blaster subaction flags
AaronB-Hub Aug 20, 2024
66cec7e
Fixed
AaronB-Hub Aug 23, 2024
af30713
Lgun ray decomp
AaronB-Hub Aug 23, 2024
7b00ff7
Formatting
AaronB-Hub Aug 23, 2024
ef010b9
Rolling back some function type changes so that I can make that all i…
AaronB-Hub Aug 23, 2024
b670b9a
Fix line endings
ribbanya Aug 23, 2024
e21fa22
Merge branch 'doldecomp:master' into master
AaronB-Hub Aug 23, 2024
3c3332c
Compatibility with item functions as they are now
AaronB-Hub Aug 23, 2024
69aed04
formatting
AaronB-Hub Aug 23, 2024
dfee783
lgun item work
AaronB-Hub Sep 21, 2024
b396c3a
formatting
AaronB-Hub Sep 21, 2024
6f605e6
Merge branch 'doldecomp:master' into master
AaronB-Hub Sep 21, 2024
34eaa21
formatting
AaronB-Hub Aug 23, 2024
ebab875
lgun item work
AaronB-Hub Sep 21, 2024
2c0f2fe
formatting
AaronB-Hub Sep 21, 2024
23a547b
Regenerate asm
ribbanya Sep 22, 2024
59a74b2
Fix issues
ribbanya Sep 22, 2024
eb65baa
Merge branch 'doldecomp:master' into master
AaronB-Hub Sep 22, 2024
582bf34
Merge branch 'master' of https://github.com/AaronB-Hub/doldecomp-melee
AaronB-Hub Sep 22, 2024
c7ecf71
Variable documentation
AaronB-Hub Sep 22, 2024
1280e71
Squashed commit of the following:
AaronB-Hub Sep 22, 2024
fde35bd
Variable documentation
AaronB-Hub Sep 22, 2024
54b9591
Variable documentation
AaronB-Hub Sep 22, 2024
c7e8b05
Fix `ItLGunBeamAttr`
ribbanya Sep 22, 2024
8f63b83
Fix struct offsets and names
ribbanya Sep 22, 2024
e5613d4
Fix callback names and comment
ribbanya Sep 22, 2024
64559fb
Fix build
ribbanya Sep 22, 2024
3f19cff
Fix assignment
ribbanya Sep 22, 2024
499f40f
Merge branch 'doldecomp:master' into master
AaronB-Hub Sep 22, 2024
ebf1fb2
Merge branch 'master' of https://github.com/AaronB-Hub/doldecomp-melee
AaronB-Hub Sep 22, 2024
7f26544
fox item attributes
AaronB-Hub Sep 22, 2024
185c42d
Added attr values and cleaned up formatting
AaronB-Hub Sep 22, 2024
e801ede
Fixed symbols.txt merge issue
AaronB-Hub Sep 22, 2024
27950e4
Fix other sync issue
AaronB-Hub Sep 22, 2024
8125ce4
Merge branch 'master' into master
AaronB-Hub Sep 22, 2024
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
45 changes: 38 additions & 7 deletions src/melee/it/itCharItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,50 @@ typedef struct {
/* x108 */ HSD_GObj* owner; // xE7C
} FoxBlasterVars;

typedef struct FoxBlasterAttr {
/* +0 */ float x0;
/* +4 */ float x4;
/* +8 */ float x8;
/* +C */ float xC;
/* +10 */ float x10;
/* +14 */ float x14;
/* +18 */ float x18; // [1]
/* +1C */ float x1C;
/* +20 */ float x20; // [2]
/* +24 */ float x24;
} FoxBlasterAttr;

typedef struct {
float xDD4;
float xDD8;
float xDDC;
Vec3 xDE0;
/* +0 ip+DD4 */ float scale;
/* +4 ip+DD8 */ float angle;
/* +8 ip+DDC */ float speed;
/* +C ip+DE0 */ Vec3 pos;
} FoxLaserVars;

typedef struct FoxLaserAttr {
/* +0 */ float lifetime; // [35]
/* +4 */ float scale; // [3]
/* +8 */ float x8;
/* +C */ float xC;
/* +10 */ float x10;
/* +14 */ float x14;
/* +18 */ float x18;
/* +1C */ float x1C;
/* +20 */ float x20;
/* +24 */ float x24; // [1]
} FoxLaserAttr;

typedef struct {
HSD_Joint* xDD4;
float xDD8;
HSD_JObj* xDDC;
/* +0 ip+DD4 */ HSD_Joint* xDD4;
/* +4 ip+DD8 */ float xDD8;
/* +8 ip+DDC */ HSD_JObj* xDDC;
} FoxIllusionVars;

typedef struct FoxIllusionAttr {
float x0; // [5]
float x4; // [2]
} FoxIllusionAttr;

typedef struct {
u32 x0;
} itKirbyHammerVars;
Expand Down
48 changes: 24 additions & 24 deletions src/melee/it/itCommonItems.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,22 +120,27 @@ typedef struct FoodVars {
s32 xDD8_heal;
} FoodVars;

typedef struct ItLGunVars {
/* +0 ip+DD4 */ int timer;
} ItLGunVars;

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

typedef struct ItLGunVars {
int timer;
} ItLGunVars;
typedef struct ItLGunRayVars {
/* +0 ip+DD4 */ float scale;
/* +4 ip+DD8 */ float angle;
/* +8 ip+DDC */ float speed;
/* +C ip+DE0 */ Vec3 pos;
} ItLGunRayVars;

typedef struct ItLGunBeamAttr {
float x0; // lifetime
float x4; // related to position calcs for var xDFC
float x8; // related to position calcs for var xDFC
float xC; // related to position calcs for var xDF8
float x10; // related to position calcs for var xDF8
} ItLGunBeamAttr;
typedef struct ItLGunRayAttr {
/* +0 */ float speed; // [5]
/* +4 */ float lifetime; // [80]
/* +8 */ float max_scale; // [3]
} ItLGunRayAttr;

typedef struct ItLGunBeamVars {
/* +0 ip+DD4 */ Vec3 position0;
Expand All @@ -147,18 +152,13 @@ typedef struct ItLGunBeamVars {
/* +30 ip+E04 */ int xE04;
} ItLGunBeamVars;

typedef struct ItLGunRayAttr {
/* +0 */ float speed;
/* +4 */ float lifetime;
/* +8 */ float max_scale;
} ItLGunRayAttr;

typedef struct ItLGunRayVars {
/* ip+DD4 */ float scale;
/* ip+DD8 */ float angle;
/* ip+DDC */ float speed;
/* ip+DE0 */ Vec3 pos;
} ItLGunRayVars;
typedef struct ItLGunBeamAttr {
float x0; // lifetime - [18]
float x4; // related to position calcs for var xDFC - [1]
float x8; // related to position calcs for var xDFC - [2]
float xC; // related to position calcs for var xDF8 - [1.22173]
float x10; // related to position calcs for var xDF8 - [2/3 * pi]
} ItLGunBeamAttr;

/// Eggs spawned on Yoshi stages / by Chansey
typedef struct EggVars {
Expand Down
2 changes: 1 addition & 1 deletion src/melee/it/items/itfoxblaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,4 +1131,4 @@ void it_802AF184(Item_GObj* item_gobj, HSD_GObj* ref_gobj)
// Remove all GObj interaction references from item
// Returns whether or not the referenced_gobj was the #Item::owner.
it_8026B894(item_gobj, ref_gobj);
}
}
57 changes: 29 additions & 28 deletions src/melee/it/items/itfoxlaser.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ inline void* getFoxLaser(Item* item)
bool it_8029C4D4(Item_GObj* item_gobj, CollData* arg1)
{
Item* item = GET_ITEM(item_gobj);
return it_8026E9A4(item_gobj, &item->xDD4_itemVar.foxlaser.xDE0,
&item->pos, 0);
return it_8026E9A4(item_gobj, &item->xDD4_itemVar.foxlaser.pos, &item->pos,
0);
}

static inline void normalizeAngle(f32* angle)
Expand All @@ -46,11 +46,12 @@ static inline void normalizeAngle(f32* angle)
}

void it_8029C504(HSD_GObj* parent, Vec3* pos, enum_t msid, int kind, f32 angle,
f32 arg9)
f32 speed)
{
SpawnItem spawn;
Item_GObj* item_gobj;
bool right_facing;
FoxLaserAttr* attr;

normalizeAngle(&angle);
spawn.kind = kind;
Expand All @@ -71,13 +72,13 @@ void it_8029C504(HSD_GObj* parent, Vec3* pos, enum_t msid, int kind, f32 angle,
item_gobj = Item_80268B18(&spawn);
if (item_gobj != NULL) {
Item* item = GET_ITEM(item_gobj);
FoxLaserVars* attr = item->xC4_article_data->x4_specialAttributes;
attr = item->xC4_article_data->x4_specialAttributes;
Item_80268E5C(item_gobj, msid, ITEM_ANIM_UPDATE);
it_80275158(item_gobj, attr->xDD4);
item->xDD4_itemVar.foxlaser.xDD4 = 0.0F;
item->xDD4_itemVar.foxlaser.xDD8 = angle;
item->xDD4_itemVar.foxlaser.xDDC = arg9;
item->xDD4_itemVar.foxlaser.xDE0 = spawn.pos;
it_80275158(item_gobj, attr->lifetime);
item->xDD4_itemVar.foxlaser.scale = 0.0F;
item->xDD4_itemVar.foxlaser.angle = angle;
item->xDD4_itemVar.foxlaser.speed = speed;
item->xDD4_itemVar.foxlaser.pos = spawn.pos;
db_80225DD8(item_gobj, parent);
}
}
Expand Down Expand Up @@ -105,7 +106,7 @@ bool it_8029C6F4(Item_GObj* item_gobj)
{
Article* article;
Item* item;
FoxLaserVars* attr;
FoxLaserAttr* attr;
HSD_JObj* jobj;
f32 dir;
f32 vel_x;
Expand All @@ -114,10 +115,10 @@ bool it_8029C6F4(Item_GObj* item_gobj)
jobj = GET_JOBJ(item_gobj);
article = item->xC4_article_data;
attr = article->x4_specialAttributes;
item->x40_vel.x = item->xDD4_itemVar.foxlaser.xDDC *
cosf(item->xDD4_itemVar.foxlaser.xDD8);
item->x40_vel.y = item->xDD4_itemVar.foxlaser.xDDC *
sinf(item->xDD4_itemVar.foxlaser.xDD8);
item->x40_vel.x = item->xDD4_itemVar.foxlaser.speed *
cosf(item->xDD4_itemVar.foxlaser.angle);
item->x40_vel.y = item->xDD4_itemVar.foxlaser.speed *
sinf(item->xDD4_itemVar.foxlaser.angle);
item->x40_vel.z = 0.0F;
if (item->x40_vel.x > 0.0F) {
dir = +1.0F;
Expand All @@ -132,22 +133,22 @@ bool it_8029C6F4(Item_GObj* item_gobj)
vel_x = +item->x40_vel.x;
}
HSD_JObjSetRotationX(jobj, M_PI + atan2f(item->x40_vel.y, vel_x));
item->xDD4_itemVar.foxlaser.xDD4 +=
fabsf(item->xDD4_itemVar.foxlaser.xDDC) / 11.25F;
if (item->xDD4_itemVar.foxlaser.xDD4 > attr->xDD8) {
item->xDD4_itemVar.foxlaser.xDD4 = attr->xDD8;
item->xDD4_itemVar.foxlaser.scale +=
fabsf(item->xDD4_itemVar.foxlaser.speed) / 11.25F;
if (item->xDD4_itemVar.foxlaser.scale > attr->scale) {
item->xDD4_itemVar.foxlaser.scale = attr->scale;
}
if (item->xDD4_itemVar.foxlaser.xDD4 < 1e-5F) {
item->xDD4_itemVar.foxlaser.xDD4 = 1e-3;
if (item->xDD4_itemVar.foxlaser.scale < 1e-5F) {
item->xDD4_itemVar.foxlaser.scale = 1e-3;
}
HSD_JObjSetScaleZ(jobj, item->xDD4_itemVar.foxlaser.xDD4);
HSD_JObjSetScaleZ(jobj, item->xDD4_itemVar.foxlaser.scale);
return it_80273130(item_gobj);
}

void it_8029C9CC(Item_GObj* item_gobj)
{
Item* item = GET_ITEM(item_gobj);
item->xDD4_itemVar.foxlaser.xDE0 = item->pos;
item->xDD4_itemVar.foxlaser.pos = item->pos;
}

bool it_8029C9EC(Item_GObj* item_gobj)
Expand Down Expand Up @@ -175,9 +176,9 @@ bool it_8029CA80(Item_GObj* item_gobj)
item->facing_dir = item->xC68;
HSD_JObjSetRotationY(jobj, (M_PI / 2) * item->facing_dir);
}
HSD_JObjSetScaleZ(jobj, item->xDD4_itemVar.foxlaser.xDD4 = 1e-3);
item->xDD4_itemVar.foxlaser.xDD8 += M_PI;
normalizeAngle(&item->xDD4_itemVar.foxlaser.xDD8);
HSD_JObjSetScaleZ(jobj, item->xDD4_itemVar.foxlaser.scale = 1e-3);
item->xDD4_itemVar.foxlaser.angle += M_PI;
normalizeAngle(&item->xDD4_itemVar.foxlaser.angle);
return false;
}

Expand All @@ -191,10 +192,10 @@ bool it_8029CC54(Item_GObj* item_gobj)
Item* item = GET_ITEM(item_gobj);
u8 _[4] = { 0 };
lbVector_Mirror(&item->x40_vel, &item->xC58);
item->xDD4_itemVar.foxlaser.xDD4 = 1e-3;
item->xDD4_itemVar.foxlaser.xDD8 =
item->xDD4_itemVar.foxlaser.scale = 1e-3;
item->xDD4_itemVar.foxlaser.angle =
atan2f(item->x40_vel.y, item->x40_vel.x);
normalizeAngle(&item->xDD4_itemVar.foxlaser.xDD8);
normalizeAngle(&item->xDD4_itemVar.foxlaser.angle);
return false;
}

Expand Down
4 changes: 2 additions & 2 deletions src/melee/it/items/itfoxlaser.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

/* 29C4D4 */ bool it_8029C4D4(Item_GObj*, CollData*);
/* 29C504 */ void it_8029C504(HSD_GObj* parent, Vec3* pos, enum_t msid,
int kind, f32 angle, f32 arg9);
int kind, f32 angle, f32 speed);
/* 29C6A4 */ void it_8029C6A4(f32 angle, f32 vel, HSD_GObj* parent, Vec3* vec,
int kind);
/* 29C6CC */ void it_8029C6CC(f32 angle, f32 vel, HSD_GObj* parent, Vec3* vec,
Expand All @@ -24,7 +24,7 @@
/* 29CC4C */ bool it_8029CC4C(Item_GObj*);
/* 29CC54 */ bool it_8029CC54(Item_GObj*);
/* 29CCF0 */ bool it_8029CCF0(Item_GObj*);
/* 29CCF8 */ void it_8029CCF8(Item_GObj*, HSD_GObj* ref);
/* 29CCF8 */ void it_8029CCF8(Item_GObj*, HSD_GObj*);
/* 3F67D0 */ extern ItemStateTable it_803F67D0[];

#endif
1 change: 0 additions & 1 deletion src/melee/it/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,6 @@ struct Item {
UnkFlagStruct xDD2_flag;
UnkFlagStruct xDD3_flag;
union {
ItCapsuleAttrs capsule;
ItPokemonVars pokemon;
ItStarVars star;
itSword_ItemVars sword;
Expand Down
Loading