Skip to content

Commit

Permalink
efxEnemy progress
Browse files Browse the repository at this point in the history
  • Loading branch information
PikHacker committed Sep 26, 2023
1 parent f8df198 commit 7559314
Show file tree
Hide file tree
Showing 10 changed files with 477 additions and 2,856 deletions.
18 changes: 16 additions & 2 deletions include/JSystem/JParticle/JPAEmitter.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct JPABaseParticle {
f32 _70; // _70
f32 _74; // _74
unknown _78; // _78
uint _7C; // _7C
uint mFlags; // _7C
s16 _80; // _80
u16 _82; // _82
f32 _84; // _84
Expand Down Expand Up @@ -124,6 +124,13 @@ struct JPABaseEmitter {
_B4 = scaleXY;
}

inline void setScaleOnly(Vector3f& scale)
{
_98.x = scale.x;
_98.y = scale.y;
_98.z = scale.z;
}

inline void setScaleOnly(f32 scale) { _98 = JGeometry::TVec3f(scale); }

inline void setGlobalScale(f32 x, f32 y)
Expand Down Expand Up @@ -222,6 +229,13 @@ struct JPABaseEmitter {
mColor1.a = color.a;
}

inline void setTranslation(f32 x, f32 y, f32 z)
{
mPosition.x = x;
mPosition.y = y;
mPosition.z = z;
}

Vector3f mScale; // _00
JGeometry::TVec3f _0C; // _0C
JGeometry::TVec3f _18; // _18
Expand All @@ -237,7 +251,7 @@ struct JPABaseEmitter {
s16 _4C; // _4C
s16 _4E; // _4E
s16 _50; // _50
u16 _52; // _52
s16 mLifeTime; // _52
u16 _54; // _54
JSUPtrLink _58; // _58
Mtx mMatrix; // _68
Expand Down
11 changes: 11 additions & 0 deletions include/Vector3.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ struct Vector3 {

f32 length() const;
f32 distance(Vector3&);
f32 distance(JGeometry::TVec3f&);
f32 normalise();

void read(Stream&);
Expand Down Expand Up @@ -388,6 +389,16 @@ inline f32 Vector3f::distance(Vector3f& them)
return Vector3f(diffX, diffY, diffZ).length();
}

template <>
inline f32 Vector3f::distance(JGeometry::TVec3f& them)
{
f32 diffX = this->x - them.x;
f32 diffY = this->y - them.y;
f32 diffZ = this->z - them.z;

return Vector3f(diffX, diffY, diffZ).length();
}

inline f32 _normaliseDistance(Vector3f& vec1, Vector3f& vec2)
{
Vector3f vec = vec1 - vec2;
Expand Down
4 changes: 4 additions & 0 deletions include/efx/Arg.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ struct ArgChou : public Arg {
{
return "ArgChou";
}

int mType; // _10
};

struct ArgCursor : public Arg {
Expand Down Expand Up @@ -191,6 +193,8 @@ struct ArgImoEat : public Arg {
{
return "ArgImoEat";
}

int mType; // _10
};

struct ArgKchYodare : public Arg {
Expand Down
4 changes: 2 additions & 2 deletions include/efx/TBaba.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ struct TBabaFly_ver01 : public TChasePos {
{
}

virtual bool create(Arg*); // _08
virtual ~TBabaFly_ver01(); // _48 (weak)
virtual bool create(Arg*); // _08
virtual ~TBabaFly_ver01() { } // _48 (weak)

// _00 = VTBL
// _00-_14 = TChasePos
Expand Down
2 changes: 1 addition & 1 deletion include/efx/TChou.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace efx {
struct TChouDown : public TChasePos {
virtual bool create(Arg*); // _08
virtual ~TChouDown(); // _48 (weak)
virtual ~TChouDown() { } // _48 (weak)

// _00 = VTBL
// _00-_14 = TChasePos
Expand Down
4 changes: 2 additions & 2 deletions include/efx/TImo.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ struct TImoEat : public TChaseMtx {
}

virtual bool create(Arg*); // _08
virtual ~TImoEat(); // _48 (weak)
virtual ~TImoEat() { } // _48 (weak)

// _00 = VTBL
// _00-_14 = TChaseMtx
Expand All @@ -25,7 +25,7 @@ struct TImoSmoke : public TChasePos {
}

virtual bool create(Arg*); // _08
virtual ~TImoSmoke(); // _48 (weak)
virtual ~TImoSmoke() { } // _48 (weak)

// _00 = VTBL
// _00-_14 = TChasePos
Expand Down
2 changes: 1 addition & 1 deletion include/efx/TJgm.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct TJgmAttackW : public TChasePosYRot3 {

struct TJgmBack : public TChasePos {
virtual bool create(Arg*); // _08
virtual ~TJgmBack(); // _48 (weak)
virtual ~TJgmBack() { } // _48 (weak)

// _00 = VTBL
// _00-_14 = TChasePos
Expand Down
4 changes: 2 additions & 2 deletions include/efx/TPan.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ struct TPanHide : public TForever {
}

virtual bool create(Arg*); // _08
virtual ~TPanHide(); // _48 (weak)
virtual ~TPanHide() { } // _48 (weak)

// _00 = VTBL
// _00-_10 = TForever
Expand All @@ -38,7 +38,7 @@ struct TPanSmoke : public TChasePos {
}

virtual bool create(Arg*); // _08
virtual ~TPanSmoke(); // _48 (weak)
virtual ~TPanSmoke() { } // _48 (weak)

// _00 = VTBL
// _00-_14 = TChasePos
Expand Down
18 changes: 14 additions & 4 deletions include/efx/TTank.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,12 @@ struct TTankFire : public TBase {
}

virtual bool create(Arg*); // _08
virtual void forceKill(); // _0C (weak)
virtual void fade() // _10 (weak)
virtual void forceKill()
{
mEfxABC.forceKill();
mEfxIND.forceKill();
} // _0C (weak)
virtual void fade() // _10 (weak)
{
mEfxABC.fade();
mEfxIND.fade();
Expand Down Expand Up @@ -163,8 +167,14 @@ struct TTankWat : public TChaseMtx4 {
}

virtual bool create(Arg*); // _08
virtual void forceKill(); // _0C (weak)
virtual void fade() // _10 (weak)
virtual void forceKill()
{
TSyncGroup4::forceKill();
if (mParticleCallBack.mEfxHit != nullptr) {
mParticleCallBack.mEfxHit->forceKill();
}
} // _0C (weak)
virtual void fade() // _10 (weak)
{
TChaseMtx4::fade();
if (mParticleCallBack.mEfxHit) {
Expand Down
Loading

0 comments on commit 7559314

Please sign in to comment.