Skip to content

Commit

Permalink
Match itcoin
Browse files Browse the repository at this point in the history
  • Loading branch information
thefoxcam committed Jul 2, 2024
1 parent a60e81d commit 5af5914
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions src/melee/it/items/itcoin.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,22 +133,27 @@ bool it_802F1604(Item_GObj* gobj)
return false;
}

void inline itCoin_ResetRotation(Item_GObj* gobj)
{
HSD_JObj* jobj;
jobj = GET_JOBJ(gobj);
HSD_JObjSetRotationX(jobj, 0.0F);
HSD_JObjSetRotationY(jobj, 0.0F);
HSD_JObjSetRotationZ(jobj, 0.0F);
}

void it_802F1630(Item_GObj* gobj)
{
Item* ip;
HSD_JObj* jobj;

PAD_STACK(16);

ip = GET_ITEM(gobj);
ip->x40_vel.z = 0.0F;
ip->x40_vel.y = 0.0F;
ip->x40_vel.x = 0.0F;
jobj = GET_JOBJ(gobj);

HSD_JObjSetRotationX(jobj, 0.0F);
HSD_JObjSetRotationY(jobj, 0.0F);
HSD_JObjSetRotationZ(jobj, 0.0F);
itCoin_ResetRotation(gobj);

Item_80268E5C(gobj, 1, ITEM_UNK_0x1);
it_802756D0(gobj);
Expand Down Expand Up @@ -192,6 +197,7 @@ bool it_802F1910(Item_GObj* gobj)
{
Item* ip;
itCoinAttributes* attr;
f32 zero = 0.0F;

PAD_STACK(20);

Expand All @@ -200,18 +206,18 @@ bool it_802F1910(Item_GObj* gobj)
it_802762BC(ip);
ip->xC9C = ip->xC9C + it_8027CBFC(gobj);
it_8027B798(gobj, &ip->x40_vel);
if ((ip->x40_vel.x == 0.0F) && (ip->x40_vel.y == 0.0F)) {
if ((ip->x40_vel.x == zero) && (ip->x40_vel.y == zero)) {
ip->x40_vel.x = 0.1F * -ip->xCCC_incDamageDirection;
ip->x40_vel.y = 0.1F;
}
lbVector_Normalize(&ip->x40_vel);
if ((ip->pos.x > 0.0F) && (-1 == ip->xCCC_incDamageDirection)) {
if ((ip->pos.x > zero) && (-1 == ip->xCCC_incDamageDirection)) {
ip->x40_vel.x *= -1;
}
if ((ip->pos.x < 0.0F) && (1 == ip->xCCC_incDamageDirection)) {
if ((ip->pos.x < zero) && (1 == ip->xCCC_incDamageDirection)) {
ip->x40_vel.x *= -1;
}
if (ip->pos.x > 0.0F) {
if (ip->pos.x > zero) {
if (ip->xCCC_incDamageDirection == -1) {
ip->x40_vel.x *= attr->x30 * (attr->x24 + ip->xC9C);
} else {
Expand All @@ -234,7 +240,7 @@ bool it_802F1910(Item_GObj* gobj)
if (ip->x40_vel.y >= attr->x40) {
ip->x40_vel.y = attr->x40;
}
ip->x40_vel.z = 0.0F;
ip->x40_vel.z = zero;
ip->xC9C = 0;
switch (ip->xDD4_itemVar.coin.x4) {
case 2:
Expand Down Expand Up @@ -274,11 +280,9 @@ bool it_802F1CB4(Item_GObj* gobj)
void it_802F1CE0(Item_GObj* gobj)
{
HSD_JObj* jobj = GET_JOBJ(gobj);
PAD_STACK(24);
PAD_STACK(16);

HSD_JObjSetRotationX(jobj, 0.0F);
HSD_JObjSetRotationY(jobj, 0.0F);
HSD_JObjSetRotationZ(jobj, 0.0F);
itCoin_ResetRotation(gobj);

Item_80268E5C(gobj, 4, ITEM_UNK_0x1);
}
Expand Down

0 comments on commit 5af5914

Please sign in to comment.