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 headers for Strollin' Stus and the classes it depends on #10

Merged
merged 7 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
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
48 changes: 39 additions & 9 deletions include/SMS/Enemy/BossGesso.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <JSystem/JDrama/JDRActor.hxx>
#include <JSystem/JGeometry/JGMVec.hxx>
#include <SMS/Enemy/SpineEnemy.hxx>
#include <SMS/Manager/EnemyManager.hxx>

class TBGPolDrop : JDrama::TActor {
public:
Expand Down Expand Up @@ -36,6 +37,7 @@ public:
virtual bool receiveMessage(THitActor *, u32) override;
virtual void moveObject() override;
virtual void calcRootMatrix() override;
virtual void reset() override;
virtual const char **getBasNameTable() const override;

bool beakHeld() const;
Expand All @@ -49,20 +51,48 @@ public:
void gotTentacleDamage();
bool is2ndFightNow() const;
void launchPolDrop();
f32 lenFromToeToMario();
void lenFromToeToMario();
void rumblePad(int, const JGeometry::TVec3<float> &);
void showMessage(u32);
void stopIfRoll();
bool tentacleHeld() const;

u32 _00[0x18 / 4]; // 0x0150
u32 mAttackState; // 0x0168
u32 *tentacle1; // 0x0150 (TBGTentacle **)
u32 *tentacle2; // 0x0154 (TBGTentacle **)
u32 *tentacle3; // 0x0158 (TBGTentacle **)
u32 *tentacle4; // 0x015C (TBGTentacle **)
u32 *beak; // 0x0160 (TBGBeakHit **)
u32 _164; // 0x0164 ? (TBossGessoMtxCalc uses this)
u32 mAttackState; // 0x0168
u32 mAttackTimer; // 0x016C
u32 _01[0x10 / 4]; // 0x0170
u32 _170; // 0x0170 ? (THitActor?)
u32 _174; // 0x0174 ? (THitActor?)
u32 *dirtyWhite; // 0x0178 ? (THitActor?)
u32 _17C; // 0x017C ? (MActor?)
TBGPolDrop *mPollutionDrop; // 0x0180
u32 _02[0xC / 4]; // 0x0184
J3DGXColor mGoopColor;
u16 mAttackCount; // 0x0194
u16 _05; // 0x0196
u32 _06[0x18 / 4]; // 0x0198
u32 _184; // 0x0184
f32 _188; // 0x0188
u32 _18C; // 0x018C
J3DGXColor mGoopColor; // 0x0190
u8 mAttackCount; // 0x0194
u8 _195; // 0x0195
u8 _196; // 0x0196
u8 _197; // 0x0197 (Padding?)
u32 _198; // 0x0198
u32 _19C; // 0x019C
u32 _1A0; // 0x01A0
u32 _1A4; // 0x01A4
u32 _1A8; // 0x01A8
u32 _1AC; // 0x01AC
};

class TBossGessoManager : public TEnemyManager {
public:
TBossGessoManager(const char *);
virtual ~TBossGessoManager();

virtual void load(JSUMemoryInputStream &) override;
virtual void createModelData() override;

void initJParticle();
};
142 changes: 142 additions & 0 deletions include/SMS/Enemy/HamuKuri.hxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,142 @@
#pragma once

#include <Dolphin/types.h>
#include <JSystem/JDrama/JDRActor.hxx>
#include <JSystem/JGeometry/JGMVec.hxx>
#include <SMS/Enemy/WalkerEnemy.hxx>
#include <SMS/MapObj/MapObjBase.hxx>
#include <SMS/System/Params.hxx>

struct THamuKuriSaveLoadParams : TWalkerEnemyParams {

THamuKuriSaveLoadParams(const char *prm)
: TWalkerEnemyParams(prm), SMS_TPARAM_INIT(mSLWaterCoeff, 25.0f),
SMS_TPARAM_INIT(mSLWaterAttackCoeff, 2.0f), SMS_TPARAM_INIT(mSLFirstVelocityY, 8.0f),
SMS_TPARAM_INIT(mSLVelocityRate, 0.8f), SMS_TPARAM_INIT(mSLBoundNum, 2),
SMS_TPARAM_INIT(mSLSearchActorTimer, 500), SMS_TPARAM_INIT(mSLCanSearchDist, 800.0f),
SMS_TPARAM_INIT(mSLJitabataTimer, 200), SMS_TPARAM_INIT(mSLFirstKickVelocityY, 2.0f),
SMS_TPARAM_INIT(mSLFlyTimer, 500), SMS_TPARAM_INIT(mSLTrampleBonusNum, 3),
SMS_TPARAM_INIT(mSLCrashBonusNum, 3), SMS_TPARAM_INIT(mSLSerialCrashFrame, 15),
SMS_TPARAM_INIT(mSLKyoroTimer, 500) {
load(prm);
}

TParamRT<f32> mSLWaterCoeff;
TParamRT<f32> mSLWaterAttackCoeff;
TParamRT<f32> mSLFirstVelocityY;
TParamRT<f32> mSLVelocityRate;
TParamRT<u32> mSLBoundNum;
TParamRT<u32> mSLSearchActorTimer;
TParamRT<f32> mSLCanSearchDist;
TParamRT<u32> mSLJitabataTimer;
TParamRT<f32> mSLFirstKickVelocityY;
TParamRT<u32> mSLFlyTimer;
TParamRT<u32> mSLTrampleBonusNum;
TParamRT<u32> mSLCrashBonusNum;
TParamRT<u32> mSLSerialCrashFrame;
TParamRT<u32> mSLKyoroTimer;
};

class THamuKuri : public TWalkerEnemy {

public:
THamuKuri(const char *);
virtual ~THamuKuri();

virtual void attackToMario() override;
virtual void behaveToFindMario() override;
virtual void behaveToWater(THitActor *) override;
virtual void bind() override;
virtual void endHitWaterJump() override;
virtual void genRandomItem() override;
virtual const char **getBasNameTable() const override;
virtual f32 getGravityY() const override;
virtual Mtx44 *getTakingMtx() override;
virtual void init(TLiveManager *) override;
virtual void initAttacker(THitActor *) override;
virtual bool isCollidMove(THitActor *) override;
virtual u32 isFindMario(f32) override;
virtual bool isHitValid(u32) override; //(ulong)
virtual bool isResignationAttack() override;
virtual void moveObject() override;
virtual void reset() override;
virtual void setAfterDeadEffect() override;
virtual void setBckAnm(int) override;
virtual void setDeadAnm() override;
virtual void setGenerateAnm() override;
virtual void setMActorAndKeeper() override;
virtual void setRunAnm() override;
virtual void setWaitAnm() override;
virtual void setWalkAnm() override;
virtual void walkBehavior(int, f32) override;

virtual void setRollAnm();
virtual void setCrashAnm();
virtual u8 canDoJitabata(); // uint
virtual void onHaveCap();

void forceRoll(JGeometry::TVec3<f32> &, bool);
void jumpToSearchActor();
void makeCapFly(TMapObjBase *);
/*f32 mCapGravityY;
f32 mCapSpeed;
f32 mLandAnimFrameNum;
f32 mVGenerateGravityY;*/
void selectCapHolder();
void setBehaviour();


f32 _194;
u32 hasCapOn; // 0x198
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mHasCapOn

u32 _19C; // int
u8 _1A0;
u8 _1A1;
u8 _1A2;
u8 _1A3;
u8 _1A4;
u8 _1A5;
u8 _1A6; //padding?
u8 _1A7; //padding?
u32 _1A8; // padding?

u32 _1AC[0x34 / 4]; // unknown

u32 _1E0;

u32 _1E4[0xC / 4]; // Unknown

u32 _1F0;
u32 _1F4; //TNerveWalkerGenerate*
u32 _1F8;

u32 _1FC; // Unknown

TVec3f _200; // 0x200 - 0x20B, detah particle related?
};

extern THamuKuri *hamukurianm_bastable;

class THamuKuriManager : public TSmallEnemyManager {
public:
THamuKuriManager(const char *);
virtual ~THamuKuriManager();

virtual THamuKuri *createEnemyInstance() override;
virtual void createModelData() override;
virtual void load(JSUMemoryInputStream &) override;
virtual void loadAfter() override;
virtual void perform(u32, JDrama::TGraphics *) override;
virtual void createAnmData() override;

void checkSerialKill();
void requestSerialKill(THamuKuri *);
void setSearchHamuKuri();

/*const f32 mSearchActSw;*/

u32 _60; // Something to do with 1up
u32 _64; // Something to do with 1up
u32 _68; // Something to do with 1up
u32 _6C;
u32 _70;
};
171 changes: 171 additions & 0 deletions include/SMS/Enemy/SmallEnemy.hxx
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
#pragma once

#include <Dolphin/types.h>
#include <SMS/Manager/EnemyManager.hxx>
#include <SMS/Enemy/SpineEnemy.hxx>
#include <SMS/System/Params.hxx>

struct TSmallEnemyParams : TSpineEnemyParams {

TSmallEnemyParams(const char *prm)
: TSpineEnemyParams(prm), SMS_TPARAM_INIT(mSLJumpForce, 5.0f),
SMS_TPARAM_INIT(mSLSearchLength, 600.0f), SMS_TPARAM_INIT(mSLSearchHeight, 600.0f),
SMS_TPARAM_INIT(mSLSearchAware, 150.0f), SMS_TPARAM_INIT(mSLSearchAngle, 140.0f),
SMS_TPARAM_INIT(mSLGiveUpLength, 1000.0f), SMS_TPARAM_INIT(mSLGiveUpHeight, 650.0f),
SMS_TPARAM_INIT(mSLAttackWait, 0), SMS_TPARAM_INIT(mSLFreezeWait, 50),
SMS_TPARAM_INIT(mSLDamageRadius, 115), SMS_TPARAM_INIT(mSLDamageHeight, 100),
SMS_TPARAM_INIT(mSLAttackRadius, 90), SMS_TPARAM_INIT(mSLAttackHeight, 60),
SMS_TPARAM_INIT(mSLTurnSpeedLow, 0.9f), SMS_TPARAM_INIT(mSLTurnSpeedHigh, 1.0f),
SMS_TPARAM_INIT(mSLBodyScaleLow, 1.0f), SMS_TPARAM_INIT(mSLBodyScaleHigh, 1.6f),
SMS_TPARAM_INIT(mSLGenItemRate, 10.0f), SMS_TPARAM_INIT(mSLGenEggRate, 50.0f),
SMS_TPARAM_INIT(mSLPolluteRange, 5), SMS_TPARAM_INIT(mSLWaitTime, 100),
SMS_TPARAM_INIT(mSLPolluteRMin, 1), SMS_TPARAM_INIT(mSLPolluteRMax, 3),
SMS_TPARAM_INIT(mSLPolluteCycle, 300), SMS_TPARAM_INIT(mSLStampRange, 5),
SMS_TPARAM_INIT(mSLPolluteInterval, 60), SMS_TPARAM_INIT(mSLGenerateOnlyDead, 0) {
load(prm);
}

TParamRT<f32> mSLJumpForce;
TParamRT<f32> mSLSearchLength;
TParamRT<f32> mSLSearchHeight;
TParamRT<f32> mSLSearchAware;
TParamRT<f32> mSLSearchAngle;
TParamRT<f32> mSLGiveUpLength;
TParamRT<f32> mSLGiveUpHeight;
TParamRT<u32> mSLAttackWait;
TParamRT<u32> mSLFreezeWait;
TParamRT<u32> mSLDamageRadius;
TParamRT<u32> mSLDamageHeight;
TParamRT<u32> mSLAttackRadius;
TParamRT<u32> mSLAttackHeight;
TParamRT<f32> mSLTurnSpeedLow;
TParamRT<f32> mSLTurnSpeedHigh;
TParamRT<f32> mSLBodyScaleLow;
TParamRT<f32> mSLBodyScaleHigh;
TParamRT<f32> mSLGenItemRate;
TParamRT<f32> mSLGenEggRate;
TParamRT<u8> mSLPolluteRange;
TParamRT<u32> mSLWaitTime;
TParamRT<u32> mSLPolluteRMin;
TParamRT<u32> mSLPolluteRMax;
TParamRT<u32> mSLPolluteCycle;
TParamRT<u8> mSLStampRange;
TParamRT<u32> mSLPolluteInterval;
TParamRT<u8> mSLGenerateOnlyDead;
};

class TSmallEnemy : public TSpineEnemy {

public:
TSmallEnemy(const char *name);
~TSmallEnemy();

virtual void load(JSUMemoryInputStream &) override;
virtual void perform(u32, JDrama::TGraphics *) override;
virtual bool receiveMessage(THitActor *, u32) override;
virtual void init(TLiveManager *) override;
virtual void reset() override;
virtual void moveObject() override;
virtual void kill() override;
virtual void updateAnmSound() override;
virtual void loadAfter() override;

virtual void genRandomItem();
virtual void genEventCoin();
virtual void generateItem();
virtual bool isEatenByYosshi();
virtual void setBehavior();
virtual void jumpBehavior();
virtual void behaveToWater(THitActor *);
virtual u32 changeByJuice(); // unknown4
virtual u8 changeMove(); // uint
virtual u32 getChangeBlockTime();
virtual void scalingChangeActor();
virtual void changeOut();
virtual void behaveToTaken(THitActor *);
virtual void behaveToRelease();
virtual void setGenerateAnm();
virtual void setWalkAnm();
virtual void setDeadAnm();
virtual void setFreezeAnm();
virtual void setMeltAnm();
virtual void setWaitAnm();
virtual void setRunAnm();
virtual void attackToMario();
virtual void forceKill();
virtual void setMActorAndKeeper();
virtual void initAttacker(THitActor *);
virtual bool isHitValid(u32); //(ulong)
virtual bool isCollidMove(THitActor *);
virtual bool isInhibitedForceMove();
virtual void endHitWaterJump();
virtual void sendAttackMsgToMario();
virtual void decHpByWater(THitActor *);
virtual void setBckAnm(int);
virtual void setDeadEffect();
virtual void setAfterDeadEffect();
virtual u32 doKeepDistance();
virtual void generateEffectColumWater();
virtual u32 isFindMario(f32);

void behaveToHitOthers(THitActor *);
void expandCollision();
u32 isEaten(); // 1 or 0
u32 isFindMarioFromParam(f32) const;
u32 isHitWallInBound();
u32 isMarioInWater() const;

/* const bool mIsAmpPolluter;
const bool mIsPolluter;*/

u32 _150;
f32 _154;
f32 _158;
u32 _15C; // int
u32 _160;
u8 _164;
u8 _165;
u8 _166; // padding?
u8 _167; // padding?
f32 _168; // code address
f32 _16C; // code address
f32 _170; // code address
u32 _174;
u32 _178;
u32 _17C;
u32 _180;
u8 _184;
u8 _185;
u8 _186; // padding?
u8 _187; // padding?
f32 _188; // code address
u32 _18C;
u32 _190; // code address, seems to be called for setting an anm index?
};

class TSmallEnemyManager : public TEnemyManager {
public:
TSmallEnemyManager(const char *);
virtual ~TSmallEnemyManager();

virtual void createEnemies(int) override;
virtual void load(JSUMemoryInputStream &) override;
virtual void createModelData() override;
virtual void loadAfter() override;

virtual void initSetEnemies();

int getHolder(int);

/*const f32 mBlockMoveSpeed;
const f32 mBlockWaitMoveY;
const u32 mBlockWaitTime;
const f32 mBlockXZScale;
const f32 mBlockYScale;
const u32 mChangeBlockTime;
const u8 mTestJuiceType;*/

u32 _54; // code executed after adding enemies
u32 _58; // something texStamp Replated
u32 _5C; // 60
};
Loading