2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-06-03 15:21:19 +00:00

Working CParasite

This commit is contained in:
Jack Andersen 2018-11-18 19:04:33 -10:00
parent 22da3a0f89
commit fbe144bbbd
5 changed files with 15 additions and 16 deletions

View File

@ -267,7 +267,7 @@ void CParasite::Think(float dt, CStateManager& mgr)
if (x5d6_26_playerObstructed)
{
xf8_24_movable = x5d6_26_playerObstructed;
xf8_24_movable = false;
return;
}
@ -681,7 +681,7 @@ void CParasite::Generate(CStateManager&, EStateMsg msg, float)
x450_bodyController->GetCommandMgr().DeliverCmd(CBCGenerateCmd(pas::EGenerateType::Zero));
break;
case 1:
if (x450_bodyController->GetCurrentStateId() == pas::EAnimationState::Generate)
if (x450_bodyController->GetCurrentStateId() != pas::EAnimationState::Generate)
x5e8_stateProgress = 2;
break;
default:

View File

@ -62,6 +62,11 @@ x3e0_xDamageDelay(pInfo.xe4_xDamageDelay),
x3fc_flavor(flavor),
x460_knockBackController(kbVariant)
{
x328_25_verticalMovement = moveType == EMovementType::Flyer;
x328_27_onGround = moveType != EMovementType::Flyer;
x328_28_prevOnGround = true;
x328_30_lookAtDeathDir = true;
x329_24_ = true;
x400_25_alive = true;
x400_31_isFlyer = moveType == CPatterned::EMovementType::Flyer;
x402_29_drawParticles = true;

View File

@ -184,6 +184,8 @@ protected:
bool x328_28_prevOnGround : 1;
bool x328_29_noPatternShagging : 1;
bool x328_30_lookAtDeathDir : 1;
bool x328_31_ : 1;
bool x329_24_ : 1;
};
u32 _dummy = 0;
};

View File

@ -70,7 +70,7 @@ void CScriptActorKeyframe::Think(float dt, CStateManager& mgr)
}
x40_lifetime -= dt;
if (x40_lifetime <= 0.f)
if (x40_lifetime > 0.f)
{
CEntity::Think(dt, mgr);
return;
@ -79,7 +79,7 @@ void CScriptActorKeyframe::Think(float dt, CStateManager& mgr)
x44_28_playing = false;
for (const SConnection& conn : x20_conns)
{
if (conn.x0_state != EScriptObjectState::Play || conn.x4_msg!= EScriptObjectMessage::Play)
if (conn.x0_state != EScriptObjectState::Play || conn.x4_msg != EScriptObjectMessage::Play)
continue;
CEntity* ent = mgr.ObjectById(mgr.GetIdForScript(conn.x8_objId));
if (TCastToPtr<CScriptActor> act = ent)
@ -94,9 +94,6 @@ void CScriptActorKeyframe::Think(float dt, CStateManager& mgr)
animData->EnableLooping(false);
}
}
// TODO: Re-enable this
#if 0
else if (TCastToPtr<CPatterned> ai = ent)
{
CAnimData* animData = ai->ModelData()->AnimationData();
@ -110,7 +107,6 @@ void CScriptActorKeyframe::Think(float dt, CStateManager& mgr)
ai->BodyController()->GetCommandMgr().DeliverCmd(CBodyStateCmd(EBodyStateCmd::ExitState));
}
}
#endif
}
CEntity::Think(dt, mgr);
@ -145,8 +141,6 @@ void CScriptActorKeyframe::UpdateEntity(TUniqueId uid, CStateManager& mgr)
}
}
}
// TODO: Re-enable this
#if 0
else if (TCastToPtr<CPatterned> ai = ent)
{
CAnimData* animData = ai->ModelData()->AnimationData();
@ -160,6 +154,5 @@ void CScriptActorKeyframe::UpdateEntity(TUniqueId uid, CStateManager& mgr)
CBCScriptedCmd(x34_animationId, x44_24_looping, x44_27_timedLoop, x38_initialLifetime));
}
}
#endif
}
}

View File

@ -145,12 +145,11 @@ void CWallWalker::PreThink(float dt, CStateManager& mgr)
{
zeus::CPlane plane = x568_alignNormal.GetPlane();
const float futureDt = (10.f * dt);
SetTranslation(GetTranslation() * (1.f - futureDt) +
(((GetTranslation() - ((plane.vec.dot(GetTranslation())) - plane.d) -
x590_colSphere.GetSphere().radius - 0.1f) * plane.vec) * futureDt));
SetTranslation(zeus::CVector3f::lerp(GetTranslation(),
GetTranslation() - (plane.pointToPlaneDist(GetTranslation()) -
x590_colSphere.GetSphere().radius - 0.01f) * plane.vec, futureDt));
}
else
MoveCollisionPrimitive(zeus::CVector3f::skZero);
MoveCollisionPrimitive(zeus::CVector3f::skZero);
}
void CWallWalker::Think(float dt, CStateManager& mgr)