Skip to content

Commit

Permalink
Start enemyAction.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
HeartPiece44 committed Sep 11, 2023
1 parent 6e8f122 commit f723b16
Show file tree
Hide file tree
Showing 15 changed files with 314 additions and 577 deletions.
18 changes: 9 additions & 9 deletions docs/recommended_todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,10 @@
| File | Size (bytes) | File | Size (bytes) |
| ---- | ---- | ---- | ---- |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiTeki.cpp">aiTeki.cpp</a> | 5890 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gamePelletList.cpp">gamePelletList.cpp</a> | 8282 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/mapMgrTraceMove.cpp">mapMgrTraceMove.cpp</a> | 9030 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/cellIterator.cpp">cellIterator.cpp</a> | 9433 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/mapMgrTraceMove.cpp">mapMgrTraceMove.cpp</a> | 9030 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/cellIterator.cpp">cellIterator.cpp</a> | 9434 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemBarrel.cpp">itemBarrel.cpp</a> | 11148 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBreakGate.cpp">aiBreakGate.cpp</a> | 13918 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/flockMgr.cpp">flockMgr.cpp</a> | 13955 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemTreasure.cpp">itemTreasure.cpp</a> | 14296 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/naviWhistle.cpp">naviWhistle.cpp</a> | 16714 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBattle.cpp">aiBattle.cpp</a> | 17396 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/naviWhistle.cpp">naviWhistle.cpp</a> | 16714 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBattle.cpp">aiBattle.cpp</a> | 17401 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/creatureLOD.cpp">creatureLOD.cpp</a> | 18468 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/texCaster.cpp">texCaster.cpp</a> | 20776 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiRescue.cpp">aiRescue.cpp</a> | 21024 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameResultTexMgr.cpp">gameResultTexMgr.cpp</a> | 21442 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_CaveResult.cpp">singleGS_CaveResult.cpp</a> | 22846 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiCrop.cpp">aiCrop.cpp</a> | 26982 |
Expand All @@ -109,11 +109,11 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiEnter.cpp">aiEnter.cpp</a> | 31721 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_DayEnd.cpp">singleGS_DayEnd.cpp</a> | 32347 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameDynamics.cpp">gameDynamics.cpp</a> | 34058 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBore.cpp">aiBore.cpp</a> | 34883 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/baseGameSectionKantei.cpp">baseGameSectionKantei.cpp</a> | 35202 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gamePlayDataMemCard.cpp">gamePlayDataMemCard.cpp</a> | 36035 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/piki.cpp">piki.cpp</a> | 36418 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameGeneratorCache.cpp">gameGeneratorCache.cpp</a> | 36959 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/piki.cpp">piki.cpp</a> | 36397 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameGeneratorCache.cpp">gameGeneratorCache.cpp</a> | 36959 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiWeed.cpp">aiWeed.cpp</a> | 38056 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/collinfo.cpp">collinfo.cpp</a> | 42246 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiFormation.cpp">aiFormation.cpp</a> | 43348 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameCaveInfo.cpp">gameCaveInfo.cpp</a> | 43607 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameCPlate.cpp">gameCPlate.cpp</a> | 43761 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemGate.cpp">itemGate.cpp</a> | 50175 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pelletCarcass.cpp">pelletCarcass.cpp</a> | 55314 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameGenerator.cpp">gameGenerator.cpp</a> | 55920 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/cellPyramid.cpp">cellPyramid.cpp</a> | 51345 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pelletCarcass.cpp">pelletCarcass.cpp</a> | 55314 |

### <section id="plugProjectKonoU">plugProjectKonoU</section>
| File | Size (bytes) | File | Size (bytes) |
Expand All @@ -137,17 +137,17 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/nslibmath.cpp">nslibmath.cpp</a> | 4592 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/TyreShadow.cpp">TyreShadow.cpp</a> | 7234 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/MaroFrog.cpp">MaroFrog.cpp</a> | 7314 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/UmimushiShadow.cpp">UmimushiShadow.cpp</a> | 7565 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ContRumble.cpp">ContRumble.cpp</a> | 9005 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/SnakeJointMgr.cpp">SnakeJointMgr.cpp</a> | 10097 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/KumaChappy.cpp">KumaChappy.cpp</a> | 11401 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Kabuto.cpp">Kabuto.cpp</a> | 12286 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/BabyState.cpp">BabyState.cpp</a> | 12869 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Tank.cpp">Tank.cpp</a> | 13334 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/KumaChappy.cpp">KumaChappy.cpp</a> | 11401 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Kabuto.cpp">Kabuto.cpp</a> | 12291 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/BabyState.cpp">BabyState.cpp</a> | 12869 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Tank.cpp">Tank.cpp</a> | 13339 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Kogane.cpp">Kogane.cpp</a> | 14614 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/JointShadowBase.cpp">JointShadowBase.cpp</a> | 14958 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ElecBugState.cpp">ElecBugState.cpp</a> | 15715 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/RandMapMgr.cpp">RandMapMgr.cpp</a> | 17083 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/TadpoleState.cpp">TadpoleState.cpp</a> | 17593 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/SnakeWholeShadow.cpp">SnakeWholeShadow.cpp</a> | 19376 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/SnakeCrowShadow.cpp">SnakeCrowShadow.cpp</a> | 19385 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ImomushiState.cpp">ImomushiState.cpp</a> | 19863 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/SnakeCrowShadow.cpp">SnakeCrowShadow.cpp</a> | 19385 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ImomushiState.cpp">ImomushiState.cpp</a> | 19876 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/UjiaState.cpp">UjiaState.cpp</a> | 20924 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/RumbleMgr.cpp">RumbleMgr.cpp</a> | 21534 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Rock.cpp">Rock.cpp</a> | 21671 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ElecHiba.cpp">ElecHiba.cpp</a> | 21844 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Rock.cpp">Rock.cpp</a> | 21671 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ElecHiba.cpp">ElecHiba.cpp</a> | 21849 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Frog.cpp">Frog.cpp</a> | 22143 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/QueenState.cpp">QueenState.cpp</a> | 22713 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Ujia.cpp">Ujia.cpp</a> | 22966 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Ujib.cpp">Ujib.cpp</a> | 23602 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Queen.cpp">Queen.cpp</a> | 23619 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ElecBug.cpp">ElecBug.cpp</a> | 24345 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Queen.cpp">Queen.cpp</a> | 23624 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ElecBug.cpp">ElecBug.cpp</a> | 24345 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/ArmorState.cpp">ArmorState.cpp</a> | 24714 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/SaraiState.cpp">SaraiState.cpp</a> | 24923 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/TobiState.cpp">TobiState.cpp</a> | 24962 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/UjibState.cpp">UjibState.cpp</a> | 25505 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Armor.cpp">Armor.cpp</a> | 25780 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectNishimuraU/Tobi.cpp">Tobi.cpp</a> | 25937 |
Expand Down
2 changes: 2 additions & 0 deletions include/Dolphin/math.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ extern "C" {

#define DEG2RAD (1.0f / 180.0f)

#define TORADIANS(val) (PI * (DEG2RAD * val))

f64 cos(f64);
f32 cosf(f32);
f64 sin(f64);
Expand Down
14 changes: 7 additions & 7 deletions include/Game/Creature.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,13 +289,13 @@ struct Creature : public CellObject {
{
return getPosition();
}
virtual bool isSuckReady() { return true; } // _19C (weak)
virtual BOOL isSuckArriveWait() { return FALSE; } // _1A0 (weak)
virtual bool stimulate(Interaction& data); // _1A4 (weak)
virtual char* getCreatureName() { return "Creature"; } // _1A8 (weak)
virtual s32 getCreatureID() { return -1; } // _1AC (weak)
virtual u16 getObjType() { return mObjectTypeID; } // _28 (weak)
virtual bool collisionUpdatable() // _14 (weak)
virtual bool isSuckReady() { return true; } // _19C (weak)
virtual BOOL isSuckArriveWait() { return FALSE; } // _1A0 (weak)
virtual bool stimulate(Interaction& data) { return false; } // _1A4 (weak)
virtual char* getCreatureName() { return "Creature"; } // _1A8 (weak)
virtual s32 getCreatureID() { return -1; } // _1AC (weak)
virtual u16 getObjType() { return mObjectTypeID; } // _28 (weak)
virtual bool collisionUpdatable() // _14 (weak)
{
return mUpdateContext.updatable();
}
Expand Down
18 changes: 14 additions & 4 deletions include/Game/EnemyFunc.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,17 @@ struct Navi;
namespace Game {
namespace EnemyFunc {
struct ConditionPikminNearby : public Condition<Creature> {
inline ConditionPikminNearby(Creature* creature, f32 dist)
: mCreature(creature)
, mSearchDist(dist)
{
}

virtual bool satisfy(Creature*); // 08 (weak)

// _00 = VTBL
Creature* mCreature; // _00
f32 mSearchDist; // _04
};

struct EatPikminDefaultCondition : public Condition<Piki> {
Expand All @@ -27,11 +35,13 @@ struct EatPikminDefaultCondition : public Condition<Piki> {
// _00 = VTBL
};

Navi* getNearestNavi(Creature*, f32, f32, f32*, Condition<Navi>*);
Piki* getNearestPikmin(Creature*, f32, f32, f32*, Condition<Piki>*);
Creature* getNearestPikminOrNavi(Creature*, f32, f32, f32*, Condition<Navi>*, Condition<Piki>*);
Navi* getNearestNavi(Creature* creature, f32 searchAngle, f32 searchRadius, f32* naviDist, Condition<Navi>* condition);
Piki* getNearestPikmin(Creature* creature, f32 searchAngle, f32 searchRadius, f32* pikiDist, Condition<Piki>* condition);
Creature* getNearestPikminOrNavi(Creature* creature, f32 searchAngle, f32 searchRadius, f32* targetDist, Condition<Navi>* naviCond,
Condition<Piki>* pikiCond);

void flickStickPikmin(Creature*, f32, f32, f32, f32, Condition<Piki>*);
void flickCreature(Creature* flicker, Creature* toFlick, f32 knockback, f32 damage, f32 angle);
void flickStickPikmin(Creature* creature, f32 flickChance, f32 knockback, f32 damage, f32 angle, Condition<Piki>* condition);
void flickNearbyPikmin(Creature*, f32, f32, f32, f32, Condition<Piki>*);
void flickNearbyNavi(Creature*, f32, f32, f32, f32, Condition<Navi>*);

Expand Down
4 changes: 2 additions & 2 deletions include/Game/FakePiki.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ struct FakePiki : public Creature, public SysShape::MotionListener {
inline bool isFPFlag(u32 flag) { return mFakePikiFlags.typeView & flag; }

// vtable 1 (Creature)
virtual Vector3f getPosition(); // _08
virtual Vector3f getPosition() { return mPosition; } // _08
virtual void getBoundingSphere(Sys::Sphere& boundSphere); // _10 (weak)
virtual void doAnimation(); // _3C
virtual void doEntry(); // _40
Expand Down Expand Up @@ -201,7 +201,7 @@ struct FakePiki : public Creature, public SysShape::MotionListener {
Vector3f _1F0; // _1F0
f32 mFaceDir; // _1FC
Vector3f mSimVelocity; // _200
Vector3f mPosition3; // _20C, was mShadowParam.mPosition
Vector3f mPosition; // _20C
Sys::Sphere mBoundingSphere; // _218, was mShadowParam.mBoundingSphere
int mBoundAnimIdx; // _228, current animIdx for held/bound object
int _22C; // _22C, anim id of some description?
Expand Down
8 changes: 4 additions & 4 deletions include/Game/Interaction.h
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ struct InteractFlick : public Interaction {
inline InteractFlick(Creature* parent, f32 knockback, f32 damage, f32 angle)
: Interaction(parent)
, mKnockback(knockback)
, mIntensity(damage)
, mNaviDamage(damage)
, mAngle(angle)
{
}
Expand All @@ -246,9 +246,9 @@ struct InteractFlick : public Interaction {

// _00 = VTBL
// _04 = Creature*
f32 mKnockback; // _08
f32 mIntensity; // _0C
f32 mAngle; // _10
f32 mKnockback; // _08
f32 mNaviDamage; // _0C
f32 mAngle; // _10
};

struct InteractFlockAttack : public Interaction {
Expand Down
22 changes: 11 additions & 11 deletions include/Game/NaviState.h
Original file line number Diff line number Diff line change
Expand Up @@ -309,16 +309,16 @@ struct NaviFallMeckState : public NaviState {
};

struct NaviFlickArg : public StateArg {
NaviFlickArg(Creature* c, Vector3f& d, f32 i)
NaviFlickArg(Creature* flicker, Vector3f& direction, f32 damage)
{
mCreature = c;
mDirection = d;
mIntensity = i;
mCreature = flicker;
mDirection = direction;
mDamage = damage;
}

Creature* mCreature; // _0C
Vector3f mDirection; // _10
f32 mIntensity; // _1C
Creature* mCreature; // _00
Vector3f mDirection; // _04
f32 mDamage; // _10
};

struct NaviFlickState : public NaviState {
Expand All @@ -337,10 +337,10 @@ struct NaviFlickState : public NaviState {

// _00 = VTBL
// _00-_10 = NaviState
u32 _10; // _10
Creature* mFlicker; // _14
Vector3f _18; // _18
u8 _24[0x4]; // _24, unknown
u32 _10; // _10
Creature* mFlicker; // _14
Vector3f mDirection; // _18
f32 mDamage; // _24
};

struct NaviFollowArg : public StateArg {
Expand Down
10 changes: 10 additions & 0 deletions include/Game/Piki.h
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@ struct Piki : public FakePiki {
inline u16 getKind() { return (u16)mPikiKind; }
inline u16 getHappa() { return (u16)mHappaKind; }

inline bool isSearchable()
{
bool result = false;
if (isPikmin() && isAlive() && !isStickToMouth()) {
result = true;
}

return result;
}

inline efx::TPkEffect* getEffectObj() { return mEffectsObj; }

static Color4 pikiColors[PikiColorCount + 1];
Expand Down
16 changes: 8 additions & 8 deletions src/plugProjectKandoU/fakePiki.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ FakePiki::FakePiki()
mModel = nullptr;
mBoundingSphere.mRadius = 8.5f;
mFaceDir = 0.0f;
mPosition3 = Vector3f(0.0f);
mPosition = Vector3f(0.0f);
mSimVelocity = Vector3f(0.0f);
mVelocity = Vector3f(0.0f);
_1F0 = Vector3f(0.0f);
Expand All @@ -53,7 +53,7 @@ void FakePiki::initFakePiki()
mDoAnimCallback = nullptr;
mWaterBox = nullptr;
mFaceDir = 0.0f;
mPosition3 = Vector3f(0.0f);
mPosition = Vector3f(0.0f);
mVelocity = Vector3f(0.0f);
_1F0 = Vector3f(0.0f);
mSimVelocity = Vector3f(0.0f);
Expand Down Expand Up @@ -200,7 +200,7 @@ void FakePiki::clearDoAnimCallback() { mDoAnimCallback = nullptr; }
*/
void FakePiki::updateWalkAnimation()
{
Vector3f sep = Vector3f(mPosition3.x - _238.x, 0.0f, mPosition3.z - _238.z);
Vector3f sep = Vector3f(mPosition.x - _238.x, 0.0f, mPosition.z - _238.z);
f32 updateTime = sys->mDeltaTime;
f32 animSpeed = _lenVec(sep) / updateTime;

Expand Down Expand Up @@ -1238,7 +1238,7 @@ void FakePiki::updateLook()
*/
void FakePiki::turnTo(Vector3f& targetPos)
{
Vector3f diff = targetPos - mPosition3;
Vector3f diff = targetPos - mPosition;
if (diff.z != 0.0f) {
mFaceDir = roundAng(JMath::atanTable_.atan2_(diff.x, diff.z));
}
Expand Down Expand Up @@ -1603,7 +1603,7 @@ bool FakePiki::useMoveRotation() { return !isFPFlag(FPFLAGS_MoveRotationDisabled
void FakePiki::move(f32 p1)
{
f32 collRad = getMapCollisionRadius();
Vector3f pos = mPosition3;
Vector3f pos = mPosition;
pos.y += collRad;

if (isFPFlag(FPFLAGS_Unk5) && mModel) {
Expand Down Expand Up @@ -2505,7 +2505,7 @@ void FakePiki::updateTrMatrix()
{
if (useUpdateTrMatrix() && !isStickTo()) {
Vector3f rotation(0.0f, mFaceDir, 0.0f);
mObjMatrix.makeSRT(mScale, rotation, mPosition3);
mObjMatrix.makeSRT(mScale, rotation, mPosition);
}
}

Expand Down Expand Up @@ -3187,7 +3187,7 @@ void FakePiki::outWaterCallback() { }
*/
void FakePiki::onSetPosition(Vector3f& position)
{
mPosition3 = position;
mPosition = position;
onSetPosition();
}

Expand Down Expand Up @@ -3224,7 +3224,7 @@ void FakePiki::getVelocityAt(Vector3f& vec, Vector3f& velocity) { velocity = mSi
* Address: 8013F690
* Size: 000008
*/
Vector3f* FakePiki::getSound_PosPtr() { return &mPosition3; }
Vector3f* FakePiki::getSound_PosPtr() { return &mPosition; }

/*
* --INFO--
Expand Down
2 changes: 1 addition & 1 deletion src/plugProjectKandoU/interactNavi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ bool InteractFlick::actNavi(Game::Navi* navi)
f32 knockBack = (mKnockback * 0.1f) * randFloat() + mKnockback;

Vector3f direction(xRot * knockBack, randFloat() * 50.0f + 100.0f, zRot * knockBack);
NaviFlickArg flickArg(mCreature, direction, mIntensity);
NaviFlickArg flickArg(mCreature, direction, mNaviDamage);
navi->transit(NSID_Flick, &flickArg);
return true;
}
Expand Down
Loading

0 comments on commit f723b16

Please sign in to comment.