commit
This commit is contained in:
@@ -323,7 +323,7 @@ void CPlayer::Behavior_MoveEnter()
|
||||
m_bSprintToggle = false;
|
||||
m_bWalkToggle = false;
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_FWD];
|
||||
//m_bRatio = true;
|
||||
m_bRatio = true;
|
||||
}
|
||||
}
|
||||
else { // While Moving
|
||||
@@ -732,13 +732,12 @@ void CPlayer::Behavior_DodgeEnter()
|
||||
|
||||
HRESULT CPlayer::Behavior_DodgeExitCheck()
|
||||
{
|
||||
_float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio();
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(InputMove()) && fRatio>=0.32f) {
|
||||
if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Throw")) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -908,7 +907,7 @@ void CPlayer::Behavior_LightAttackEnter()
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() {_uint iIndex = 0; m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, Get_PartObject<CWand>(), &iIndex); },
|
||||
0.08f);
|
||||
0.1f);
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::JAP_SIDE, Get_PartObject<CWand>()); },
|
||||
@@ -930,7 +929,7 @@ HRESULT CPlayer::Behavior_LightAttackExitCheck()
|
||||
pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK];
|
||||
pairAnimInfo.first = iNext;
|
||||
|
||||
if (fRatio >= 0.1f)
|
||||
if (fRatio >= 0.2f)
|
||||
{
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
|
||||
@@ -1058,13 +1057,24 @@ void CPlayer::Behavior_SpellEnter()
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPELL_FAIL];
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::WAND_END, Get_PartObject<CWand>()); },
|
||||
0.2f);
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPELL_FAIL];
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::WAND_END, Get_PartObject<CWand>()); },
|
||||
0.2f);
|
||||
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
@@ -1453,41 +1463,8 @@ void CPlayer::Add_FSM()
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); };
|
||||
Desc.funcPriorityUpdate = [this](_float fTimeDelta) {
|
||||
|
||||
_vector xmvInputDir = XMVectorZero();
|
||||
|
||||
_vector xmvCamLook = XMVector4Normalize(XMVectorSet(m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z, 0.f));
|
||||
_vector xmvCamRight = XMVector4Normalize(XMVectorSet(m_vCameraRightDir.x, 0.f, m_vCameraRightDir.z, 0.f));
|
||||
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W))
|
||||
xmvInputDir += xmvCamLook;
|
||||
if (m_pGameInstance->Key_Pressing(DIK_S))
|
||||
xmvInputDir -= xmvCamLook;
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A))
|
||||
xmvInputDir -= xmvCamRight;
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D))
|
||||
xmvInputDir += xmvCamRight;
|
||||
|
||||
xmvInputDir = XMVector3Normalize(xmvInputDir);
|
||||
|
||||
_float2 vInputDir = { XMVectorGetX(xmvInputDir),XMVectorGetZ(xmvInputDir) };
|
||||
|
||||
_vector xmvCurLook = XMVector4Normalize(
|
||||
XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f));
|
||||
_float2 vCurLook = { XMVectorGetX(xmvCurLook),XMVectorGetZ(xmvCurLook) };
|
||||
|
||||
_float vDir = CMyTools::Get_Direction2D(vCurLook, vInputDir);
|
||||
_float absDir = fabsf(vDir);
|
||||
|
||||
_float cross = vCurLook.x * vInputDir.y - vCurLook.y * vInputDir.x;
|
||||
|
||||
if (SUCCEEDED(InputMove()))
|
||||
{
|
||||
if(cross>0)
|
||||
m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
|
||||
else
|
||||
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); };
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc));
|
||||
@@ -1616,6 +1593,23 @@ void CPlayer::Add_FSM()
|
||||
m_pTransformCom->Set_WorldMatrix(finalMat);
|
||||
m_pCharacter_Controller->Set_Position(finalMat.r[3]);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::BROOM_RIDE, CState_Broom_Ride::Create(&Desc));
|
||||
|
||||
Reference in New Issue
Block a user