diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 089b8a6d2..6bee15006 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -263,10 +263,14 @@ call Update_Resources.bat + + + + @@ -274,6 +278,7 @@ call Update_Resources.bat + @@ -390,10 +395,14 @@ call Update_Resources.bat + + + + @@ -402,6 +411,7 @@ call Update_Resources.bat + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index f421e5a0b..b2460592f 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -346,9 +346,6 @@ 04.Mechanic\State\Hit - - 04.Mechanic\State\Troll_Combat - 04.Mechanic\State\State_Combat\State_Throw @@ -370,6 +367,24 @@ 02.GameObjects\Environment\03.MapElement\Interactable + + 04.Mechanic\State\State_Combat\State_Slam + + + 04.Mechanic\State\Troll_Combat\Troll_State_BackHand_Swing + + + 04.Mechanic\State\Movement\IdleBreak + + + 04.Mechanic\State\Troll_Combat\Troll_State_Rush + + + 04.Mechanic\State\State_Combat\State_LightAttack + + + 04.Mechanic\State\State_Combat\State_Spell + @@ -785,6 +800,24 @@ {17eaf081-6fbf-4965-b04d-10749e6032c6} + + {75479637-e795-4656-a4ef-3772d8a6d007} + + + {27d5a2b8-98db-4dbf-9916-0806cfa97c9c} + + + {a7f11f50-5740-4670-ad9e-d21640b2cca7} + + + {12ff4f09-ec6c-4b98-966a-0d84c9ad253c} + + + {7bb8a04a-00a0-4864-9781-8069d84806ca} + + + {e68261eb-a581-4bf5-b48d-b47cc81f7406} + {7e641382-9dfa-4da7-a8c8-a3ee06360e7a} @@ -1126,9 +1159,6 @@ 04.Mechanic\State\Hit - - 04.Mechanic\State\Troll_Combat - 04.Mechanic\State\State_Combat\State_Throw @@ -1152,6 +1182,27 @@ 02.GameObjects\Environment\03.MapElement\Interactable + + 04.Mechanic\State\State_Combat\State_Slam + + + 02.GameObjects\Environment\00.MapContainer + + + 04.Mechanic\State\Troll_Combat\Troll_State_BackHand_Swing + + + 04.Mechanic\State\Movement\IdleBreak + + + 04.Mechanic\State\Troll_Combat\Troll_State_Rush + + + 04.Mechanic\State\State_Combat\State_LightAttack + + + 04.Mechanic\State\State_Combat\State_Spell + diff --git a/Jusin154_Team3D/Client/Private/Goblin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_States.cpp index 244ccc520..f3fd39800 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_States.cpp @@ -55,6 +55,7 @@ HRESULT CGoblin::Behavior_MoveExitCheck() { pair<_uint, _bool> pairAnimInfo = {}; _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + if (iCurrAnimIndex == m_Animation[STATEANIM::JOG_FWD].first) { if (m_fTargetDistance <= 15.f && m_fTargetDistance != 0.f) m_pFSM->Change_State(FSMSTATE::COMBAT); @@ -94,15 +95,12 @@ void CGoblin::Behavior_CombatEnter() HRESULT CGoblin::Behavior_CombatExitCheck(_float fTimeDelta) { - pair<_uint, _bool> pairAnimInfo = {}; - _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); m_bLookAt = true; - if (m_fTargetDistance > 25.f && m_fTargetDistance != 0.f) - m_pFSM->Change_State(FSMSTATE::MOVE); - - else if (m_fTargetDistance > 30.f && m_fTargetDistance != 0.f) + if (m_fTargetDistance > 20.f && m_fTargetDistance != 0.f) m_pFSM->Change_State(FSMSTATE::MOVE); + else if (m_fTargetDistance > 25.f && m_fTargetDistance != 0.f) + m_pFSM->Change_State(FSMSTATE::IDLE); else { m_pFSM->Disable_State(FSMSTATE::COMBAT); @@ -121,17 +119,25 @@ void CGoblin::Behavior_SwingEnter() { pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::SWING); + pairAnimInfo = m_Animation[STATEANIM::SWING_FWD]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::SWING)] = m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::SWING)]; + Add_Event(pairAnimInfo.first, [this]() {m_bStep = false; }, 0.2f); + Add_Event(pairAnimInfo.first, + [&]() { + pairAnimInfo = m_Animation[STATEANIM::ATTACK_END]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); }, + 0.4f); } HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta) { pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); if (m_pFSM->IsEnable(FSMSTATE::SWING) && m_bStep) { _float fDesiredRange = 1.f; @@ -147,7 +153,6 @@ HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta) m_pTransformCom->AccumulateMomentum(vDistance * step *fTimeDelta*1.5f); } } - if (m_pModelCom->IsFinishedAnim()) { m_bLookAt = true; @@ -168,6 +173,7 @@ void CGoblin::Behavior_ThrowEnter() { pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::SKILL); + pairAnimInfo = m_Animation[STATEANIM::SKILL]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::THROW)] = m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::THROW)]; @@ -446,6 +452,7 @@ void CGoblin::Set_Anim() m_Animation[STATEANIM::SKILL] = { 85,false }; // 나이프 던지기 m_Animation[STATEANIM::BLINK] = { 426,false }; // 텔레포트 m_Animation[STATEANIM::SWING_FWD] = { 100,false }; // 도끼 스윙 444 + m_Animation[STATEANIM::ATTACK_END] = { 76,false }; m_Animation[STATEANIM::HIT_FWD] = { 353, false }; m_Animation[STATEANIM::HIT_BWD] = { 352, false }; @@ -491,7 +498,7 @@ void CGoblin::Set_Anim() m_Animation[STATEANIM::DEAD_R2] = { 324, false }; //Tp 426 - + // 76 공격끝 @@ -516,5 +523,6 @@ void CGoblin::Set_Anim() // 레비오소 피격 381 // 착지 376 + // } diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index e1338571e..25818fe76 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -165,7 +165,7 @@ HRESULT CLevel_GamePlay::Ready_Background() /* 전체 맵 */ //CInfoInstance::GetInstance()->Load_MapObjects("Hogsmeade_MapContainer_Data"); - /* 조명 오브젝트 */ + ///* 조명 오브젝트 */ //CInfoInstance::GetInstance()->Load_LightElements("LightElement"); ///* 상호작용 오브젝트 */ diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 751b65086..18659a9e4 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -233,9 +233,8 @@ HRESULT CLoader::Loading_For_GamePlay() { m_strMessage = TEXT("텍스쳐를(을) 로딩 중 입니다."); -//#pragma region MAP_MODELS -// vector*>> jobMapModels; -// +#pragma region MAP_MODELS + vector*>> jobMapModels; // { // { /* Terrain */ // jobMapModels.emplace_back(Deferred_FolderLoad( @@ -729,206 +728,206 @@ HRESULT CLoader::Loading_For_GamePlay() { return E_FAIL; } -//#pragma region UI_ANI -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Altering_Spell"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Altering_Spell\\Altering_Spell%d.png"), 349)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Alohomora"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Alohomora\\Alohomora%d.png"), 394)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Ancient_Magic"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Ancient_Magic\\Ancient_Magic%d.png"), 152)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Ancient_Magic_Throw"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Ancient_Magic_Throw\\Ancient_Magic_Throw%d.png"), 89)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Arresto_Momentum"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Arresto_Momentum\\Arresto_Momentum%d.png"), 120)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Avada_Kedavra"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Avada_Kedavra\\Avada_Kedavra%d.png"), 208)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Basic_Cast"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Basic_Cast\\Basic_Cast%d.png"), 308)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Beast_Feed"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Beast_Feed\\Beast_Feed%d.png"), 378)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Beast_Petting_Brush"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Beast_Petting_Brush\\Beast_Petting_Brush%d.png"), 327)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Bombarda"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Bombarda\\Bombarda%d.png"), 262)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Confringo"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Confringo\\Confringo%d.png"), 157)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Conjuring_Spell"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Conjuring_Spell\\Conjuring_Spell%d.png"), 115)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Descendo"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Descendo\\Descendo%d.png"), 155)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Depulso"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Depulso\\Depulso%d.png"), 152)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Diffindo"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Diffindo\\Diffindo%d.png"), 150)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Disillusionment"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Disillusionment\\Disillusionment%d.png"), 260)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Evanesco"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Evanesco\\Evanesco%d.png"), 136)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Expelliarmus"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Expelliarmus\\Expelliarmus%d.png"), 146)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Flipendo"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Flipendo\\Flipendo%d.png"), 188)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Glacius"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Glacius\\Glacius%d.png"), 156)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Imperio"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Imperio\\Imperio%d.png"), 462)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Incendio"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Incendio\\Incendio%d.png"), 213)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Levioso"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Levioso\\Levioso%d.png"), 180)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Lumos"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Lumos\\Lumos%d.png"), 365)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Nab_Sack"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Nab_Sack\\Nab_Sack%d.png"), 235)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Petrificus_Totalus"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Petrificus_Totalus\\Petrificus_Totalus%d.png"), 275)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Protego"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Protego\\Protego%d.png"), 285)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Reparo"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Reparo\\Reparo%d.png"), 385)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Revelio"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Revelio\\Revelio%d.png"), 227)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Stupefy"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Stupefy\\Stupefy%d.png"), 222)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Transformation"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Transformation\\Transformation%d.png"), 146)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Wingardium_Leviosa"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Wingardium_Leviosa\\Wingardium_Leviosa%d.png"), 273)))) -// { -// return E_FAIL; -// } -// -// if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Crucio"), -// CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Crucio\\Crucio%d.png"), 216)))) -// { -// return E_FAIL; -// } -// -//#pragma endregion +#pragma region UI_ANI + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Altering_Spell"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Altering_Spell\\Altering_Spell%d.png"), 349)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Alohomora"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Alohomora\\Alohomora%d.png"), 394)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Ancient_Magic"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Ancient_Magic\\Ancient_Magic%d.png"), 152)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Ancient_Magic_Throw"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Ancient_Magic_Throw\\Ancient_Magic_Throw%d.png"), 89)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Arresto_Momentum"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Arresto_Momentum\\Arresto_Momentum%d.png"), 120)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Avada_Kedavra"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Avada_Kedavra\\Avada_Kedavra%d.png"), 208)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Basic_Cast"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Basic_Cast\\Basic_Cast%d.png"), 308)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Beast_Feed"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Beast_Feed\\Beast_Feed%d.png"), 378)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Beast_Petting_Brush"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Beast_Petting_Brush\\Beast_Petting_Brush%d.png"), 327)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Bombarda"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Bombarda\\Bombarda%d.png"), 262)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Confringo"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Confringo\\Confringo%d.png"), 157)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Conjuring_Spell"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Conjuring_Spell\\Conjuring_Spell%d.png"), 115)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Descendo"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Descendo\\Descendo%d.png"), 155)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Depulso"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Depulso\\Depulso%d.png"), 152)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Diffindo"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Diffindo\\Diffindo%d.png"), 150)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Disillusionment"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Disillusionment\\Disillusionment%d.png"), 260)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Evanesco"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Evanesco\\Evanesco%d.png"), 136)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Expelliarmus"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Expelliarmus\\Expelliarmus%d.png"), 146)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Flipendo"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Flipendo\\Flipendo%d.png"), 188)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Glacius"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Glacius\\Glacius%d.png"), 156)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Imperio"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Imperio\\Imperio%d.png"), 462)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Incendio"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Incendio\\Incendio%d.png"), 213)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Levioso"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Levioso\\Levioso%d.png"), 180)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Lumos"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Lumos\\Lumos%d.png"), 365)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Nab_Sack"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Nab_Sack\\Nab_Sack%d.png"), 235)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Petrificus_Totalus"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Petrificus_Totalus\\Petrificus_Totalus%d.png"), 275)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Protego"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Protego\\Protego%d.png"), 285)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Reparo"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Reparo\\Reparo%d.png"), 385)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Revelio"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Revelio\\Revelio%d.png"), 227)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Stupefy"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Stupefy\\Stupefy%d.png"), 222)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Transformation"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Transformation\\Transformation%d.png"), 146)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Wingardium_Leviosa"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Wingardium_Leviosa\\Wingardium_Leviosa%d.png"), 273)))) + { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Crucio"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::INCREMENTAL, TEXT("C:\\MeshTable\\SpellAnim\\Crucio\\Crucio%d.png"), 216)))) + { + return E_FAIL; + } + +#pragma endregion #pragma region TERRAIN_TEXTURE /* Terrain_Diffuse */ diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index f003c95f8..410c707c1 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -122,11 +122,8 @@ void CPlayer::Priority_Update(_float fTimeDelta) void CPlayer::Update(_float fTimeDelta) { Update_CameraCoordinateSystem(); - m_pFSM->Update_State(fTimeDelta); - - m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index c7d204ad8..96239750f 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -21,6 +21,8 @@ #include "State_Land.h" #include "State_Move.h" #include "State_Combat.h" +#include "State_LightAttack.h" +#include "State_Spell.h" #include "State_Hit.h" #include "State_Broom_Ride.h" #pragma endregion @@ -747,103 +749,12 @@ void CPlayer::Behavior_CombatEnter() 0.4f); } else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) { - m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); - pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; - - Add_Event(pairAnimInfo.first, [this]() {_uint iIndex = 0; m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, Get_PartObject(), &iIndex); }, 0.1f); - - Add_Event(pairAnimInfo.first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::JAP_SIDE, Get_PartObject()); }, 0.0f); + m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK); + return; } else if (SUCCEEDED(InputSpell())) { - m_pFSM->Enable_State(FSMSTATE::SPELL); - if (m_eSpell != ENUM_CLASS(SKILL_TYPE::END)) - { - pairAnimInfo = m_Animation[STATEANIM::SPELL]; - switch (m_eSpell) - { - case ENUM_CLASS(SKILL_TYPE::BOMBARDA): - Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARDA, this); }, - 0.2f); - Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARDA_SIDE, Get_PartObject());}, - 0.f); - break; - case ENUM_CLASS(SKILL_TYPE::DESCENDO): - Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO, Get_PartObject()); }, - 0.2f); - Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO_SIDE, Get_PartObject()); }, - 0.f); - break; - case ENUM_CLASS(SKILL_TYPE::LEVIOSO): - Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::LEVIOSO, this); }, - 0.2f); - Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::LEVIOSO_SIDE, Get_PartObject()); }, - 0.f); - break; - case ENUM_CLASS(SKILL_TYPE::DIFFINDO): - pairAnimInfo = m_Animation[STATEANIM::DIFFINDO]; - break; - case ENUM_CLASS(SKILL_TYPE::DISILLUSIONMENT): - pairAnimInfo = m_Animation[STATEANIM::DISILLUSION_ENTER]; - break; - case ENUM_CLASS(SKILL_TYPE::LUMOS): - if (m_pModelCom->Get_SecondAnimIndex() != m_Animation[STATEANIM::LUMOS].first) - { - if (SUCCEEDED(InputMove())) - { - if (m_bSprintToggle) { - pairAnimInfo = m_Animation[STATEANIM::SPRINT]; - } - else if (m_bWalkToggle) { - pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; - } - else { - pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; - } - } - else { - pairAnimInfo = m_Animation[STATEANIM::IDLE]; - } - Add_Event(pairAnimInfo.first, - [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::LUMOS, Get_PartObject()); }, - 0.f); - m_pModelCom->Set_Second_AnimationIndex(m_Animation[STATEANIM::LUMOS].first, ENUM_CLASS(BLEND_BONE::SHOULDER_R), true); - } - else - { - if (SUCCEEDED(InputMove())) - { - if (m_bSprintToggle) { - pairAnimInfo = m_Animation[STATEANIM::SPRINT]; - } - else if (m_bWalkToggle) { - pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; - } - else { - pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; - } - } - else { - pairAnimInfo = m_Animation[STATEANIM::IDLE]; - } - m_pModelCom->Set_Second_AnimationIndex(m_Animation[STATEANIM::LUMOS_STOP].first, ENUM_CLASS(BLEND_BONE::SHOULDER_R)); - m_eSpell = STATEANIM::END; - } - break; - default: - pairAnimInfo = m_Animation[STATEANIM::SPELL_FAIL]; - break; - } - } - else - { - pairAnimInfo = m_Animation[STATEANIM::SPELL_FAIL]; - } + m_pFSM->Change_State(FSMSTATE::SPELL); + return; } else if (m_pGameInstance->Key_Down(DIK_V)) { m_pFSM->Enable_State(FSMSTATE::MAPHELP); @@ -894,40 +805,6 @@ HRESULT CPlayer::Behavior_CombatExitCheck() pairAnimInfo = m_Animation[STATEANIM::SKILL2]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } - else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) - { - m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); - _uint iIndex = m_pModelCom->Get_AnimIndex(); - if (m_Animation[STATEANIM::LIGHT_ATTACK].first <= iIndex && m_Animation[STATEANIM::LIGHT_ATTACK].first + 3 > iIndex) { - _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); - if (fRatio >= 0.1f) { - pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; - pairAnimInfo.first = iIndex + 1; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - - Add_Event(pairAnimInfo.first, - [this]() { - _uint iIndex = m_pModelCom->Get_AnimIndex() - m_Animation[STATEANIM::LIGHT_ATTACK].first; - m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, Get_PartObject(), &iIndex); }, - 0.05f); - - Add_Event(pairAnimInfo.first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::JAP_SIDE, Get_PartObject()); }, 0.0f); - } - } - } - else if (SUCCEEDED(InputSpell())) - { - m_pFSM->Enable_State(FSMSTATE::SPELL); - _uint iIndex = m_pModelCom->Get_AnimIndex(); - if (m_Animation[STATEANIM::SPELL].first <= iIndex && m_Animation[STATEANIM::SPELL].first + 3 > iIndex) { - _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); - if (fRatio >= 0.15f) { - pairAnimInfo = m_Animation[STATEANIM::SPELL]; - pairAnimInfo.first = iIndex + 1; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - } - } - } else if (m_pGameInstance->Key_Down(DIK_V)) { m_pFSM->Enable_State(FSMSTATE::MAPHELP); @@ -1017,10 +894,244 @@ HRESULT CPlayer::Behavior_CombatExitCheck() void CPlayer::Behavior_CombatExit() { - m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::LIGHT_ATTACK | FSMSTATE::SPELL | FSMSTATE::SKILL | + m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::SKILL | FSMSTATE::SKILL2 | FSMSTATE::MAPHELP | FSMSTATE::ANCIENT_THROW | FSMSTATE::POTION); } +void CPlayer::Behavior_LightAttackEnter() +{ + pair<_uint, _bool> pairAnimInfo; + m_pFSM->Enable_State(FSMSTATE::LIGHT_ATTACK); + pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + + Add_Event(pairAnimInfo.first, + [this]() {_uint iIndex = 0; m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, Get_PartObject(), &iIndex); }, + 0.1f); + + Add_Event(pairAnimInfo.first, + [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::JAP_SIDE, Get_PartObject()); }, + 0.0f); +} + +HRESULT CPlayer::Behavior_LightAttackExitCheck() +{ + pair<_uint, _bool> pairAnimInfo; + if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) + { + _uint iIndex = m_pModelCom->Get_AnimIndex(); + if (m_Animation[STATEANIM::LIGHT_ATTACK].first <= iIndex && m_Animation[STATEANIM::LIGHT_ATTACK].first + 3 > iIndex) { + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + if (fRatio >= 0.1f) { + pairAnimInfo = m_Animation[STATEANIM::LIGHT_ATTACK]; + pairAnimInfo.first = iIndex + 1; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + + Add_Event(pairAnimInfo.first, + [this]() { + _uint iIndex = m_pModelCom->Get_AnimIndex() - m_Animation[STATEANIM::LIGHT_ATTACK].first; + m_pEffectPool->Use_Skill(SKILL_TYPE::JAP, Get_PartObject(), &iIndex); }, + 0.05f); + + Add_Event(pairAnimInfo.first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::JAP_SIDE, Get_PartObject()); }, 0.0f); + } + } + } + + if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Combat")) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + + if (m_pModelCom->IsFinishedAnim()) { + if (SUCCEEDED(InputMove())) + { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + else { + m_pFSM->Change_State(FSMSTATE::IDLE); + } + } + + return E_FAIL; +} + +void CPlayer::Behavior_LightAttackExit() +{ + m_pFSM->Disable_State(FSMSTATE::LIGHT_ATTACK); +} + +void CPlayer::Behavior_SpellEnter() +{ + pair<_uint, _bool> pairAnimInfo; + m_pFSM->Enable_State(FSMSTATE::SPELL); + if (m_eSpell != ENUM_CLASS(SKILL_TYPE::END)) + { + pairAnimInfo = m_Animation[STATEANIM::SPELL]; + switch (m_eSpell) + { + case ENUM_CLASS(SKILL_TYPE::BOMBARDA): + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARDA, this); }, + 0.2f); + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARDA_SIDE, Get_PartObject()); }, + 0.f); + break; + case ENUM_CLASS(SKILL_TYPE::DESCENDO): + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO, Get_PartObject()); }, + 0.2f); + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO_SIDE, Get_PartObject()); }, + 0.f); + break; + case ENUM_CLASS(SKILL_TYPE::LEVIOSO): + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::LEVIOSO, this); }, + 0.2f); + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::LEVIOSO_SIDE, Get_PartObject()); }, + 0.f); + break; + case ENUM_CLASS(SKILL_TYPE::DIFFINDO): + pairAnimInfo = m_Animation[STATEANIM::DIFFINDO]; + break; + case ENUM_CLASS(SKILL_TYPE::DISILLUSIONMENT): + pairAnimInfo = m_Animation[STATEANIM::DISILLUSION_ENTER]; + break; + case ENUM_CLASS(SKILL_TYPE::LUMOS): + if (m_pModelCom->Get_SecondAnimIndex() != m_Animation[STATEANIM::LUMOS].first) + { + if (SUCCEEDED(InputMove())) + { + if (m_bSprintToggle) { + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } + else if (m_bWalkToggle) { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + } + else { + pairAnimInfo = m_Animation[STATEANIM::IDLE]; + } + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::LUMOS, Get_PartObject()); }, + 0.f); + m_pModelCom->Set_Second_AnimationIndex(m_Animation[STATEANIM::LUMOS].first, ENUM_CLASS(BLEND_BONE::SHOULDER_R), true); + } + else + { + if (SUCCEEDED(InputMove())) + { + if (m_bSprintToggle) { + pairAnimInfo = m_Animation[STATEANIM::SPRINT]; + } + else if (m_bWalkToggle) { + pairAnimInfo = m_Animation[STATEANIM::WALK_FWD]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + } + } + else { + pairAnimInfo = m_Animation[STATEANIM::IDLE]; + } + m_pModelCom->Set_Second_AnimationIndex(m_Animation[STATEANIM::LUMOS_STOP].first, ENUM_CLASS(BLEND_BONE::SHOULDER_R)); + m_eSpell = STATEANIM::END; + } + break; + default: + pairAnimInfo = m_Animation[STATEANIM::SPELL_FAIL]; + break; + } + } + else + { + pairAnimInfo = m_Animation[STATEANIM::SPELL_FAIL]; + } + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CPlayer::Behavior_SpellExitCheck() +{ + pair<_uint, _bool> pairAnimInfo; + _uint iIndex = m_pModelCom->Get_AnimIndex(); + + if (SUCCEEDED(InputSpell())) + { + if (m_Animation[STATEANIM::SPELL].first <= iIndex && m_Animation[STATEANIM::SPELL].first + 3 > iIndex) { + _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); + + if (fRatio >= 0.15f) { + pairAnimInfo = m_Animation[STATEANIM::SPELL]; + pairAnimInfo.first = iIndex + 1; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + + if (m_eSpell != ENUM_CLASS(SKILL_TYPE::END)) + { + switch (m_eSpell) + { + case ENUM_CLASS(SKILL_TYPE::BOMBARDA): + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARDA, this); }, + 0.2f); + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::BOMBARDA_SIDE, Get_PartObject()); }, + 0.f); + break; + case ENUM_CLASS(SKILL_TYPE::DESCENDO): + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO, Get_PartObject()); }, + 0.2f); + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::DESCENDO_SIDE, Get_PartObject()); }, + 0.f); + break; + case ENUM_CLASS(SKILL_TYPE::LEVIOSO): + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::LEVIOSO, this); }, + 0.2f); + Add_Event(pairAnimInfo.first, + [this]() {m_pEffectPool->Use_Skill(SKILL_TYPE::LEVIOSO_SIDE, Get_PartObject()); }, + 0.f); + break; + } + } + } + } + } + + + if (SUCCEEDED(InputMove()) && IsCurrentKeyFrame("Combat")) { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + + if (m_pModelCom->IsFinishedAnim()) { + if (SUCCEEDED(InputMove())) + { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + else { + m_pFSM->Change_State(FSMSTATE::IDLE); + } + } + + return E_FAIL; +} + +void CPlayer::Behavior_SpellExit() +{ + m_pFSM->Disable_State(FSMSTATE::SPELL); +} + void CPlayer::Behavior_HitEnter() { m_pFSM->Enable_State(FSMSTATE::HIT); @@ -1320,6 +1431,28 @@ void CPlayer::Add_FSM() Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc)); } + + { + CState_LightAttack::STATE_LIGHTATTACK_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_LightAttackEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_LightAttackExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_LightAttackExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::LIGHT_ATTACK, CState_LightAttack::Create(&Desc)); + } + + { + CState_Spell::STATE_SPELL_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_SpellEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_SpellExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_SpellExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SPELL, CState_Spell::Create(&Desc)); + } #pragma endregion #pragma region Behavior_Combat_Focus diff --git a/Jusin154_Team3D/Client/Private/State_IdleBreak.cpp b/Jusin154_Team3D/Client/Private/State_IdleBreak.cpp new file mode 100644 index 000000000..37935574c --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_IdleBreak.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_IdleBreak.h" +#include "GameInstance.h" +#include "Unit.h" + +CState_IdleBreak::CState_IdleBreak() + :CState_Root() +{ +} + +void CState_IdleBreak::Enter() +{ + __super::Enter(); +} + +HRESULT CState_IdleBreak::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_IdleBreak::Exit() +{ + __super::Exit(); +} + +HRESULT CState_IdleBreak::Initialize(STATE_IDLEBREAK_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_IdleBreak* CState_IdleBreak::Create(STATE_IDLEBREAK_DESC* pDesc) +{ + CState_IdleBreak* pInstance = new CState_IdleBreak; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_IdleBreak::Free() +{ + __super::Free(); +} + +void CState_IdleBreak::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_LightAttack.cpp b/Jusin154_Team3D/Client/Private/State_LightAttack.cpp new file mode 100644 index 000000000..74daf6bcf --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_LightAttack.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_LightAttack.h" +#include "Unit.h" + + +CState_LightAttack::CState_LightAttack() + :CState_Root() +{ +} + +void CState_LightAttack::Enter() +{ + __super::Enter(); +} + +HRESULT CState_LightAttack::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_LightAttack::Exit() +{ + __super::Exit(); +} + +HRESULT CState_LightAttack::Initialize(STATE_LIGHTATTACK_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_LightAttack* CState_LightAttack::Create(STATE_LIGHTATTACK_DESC* pDesc) +{ + CState_LightAttack* pInstance = new CState_LightAttack; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_LightAttack::Free() +{ + __super::Free(); +} + +void CState_LightAttack::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Slam.cpp b/Jusin154_Team3D/Client/Private/State_Slam.cpp new file mode 100644 index 000000000..76e36bbbf --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Slam.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_Slam.h" +#include "Unit.h" + + +CState_Slam::CState_Slam() + :CState_Root() +{ +} + +void CState_Slam::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Slam::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_Slam::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Slam::Initialize(STATE_SLAM_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Slam* CState_Slam::Create(STATE_SLAM_DESC* pDesc) +{ + CState_Slam* pInstance = new CState_Slam; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Slam::Free() +{ + __super::Free(); +} + +void CState_Slam::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/State_Spell.cpp b/Jusin154_Team3D/Client/Private/State_Spell.cpp new file mode 100644 index 000000000..ab2858457 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/State_Spell.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_Spell.h" +#include "Unit.h" + + +CState_Spell::CState_Spell() + :CState_Root() +{ +} + +void CState_Spell::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Spell::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CState_Spell::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Spell::Initialize(STATE_SPELL_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CState_Spell* CState_Spell::Create(STATE_SPELL_DESC* pDesc) +{ + CState_Spell* pInstance = new CState_Spell; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Spell::Free() +{ + __super::Free(); +} + +void CState_Spell::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index 3d04cf19f..688561087 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -119,7 +119,7 @@ void CTroll::Late_Update(_float fTimeDelta) } if (m_bLookAt) { - m_pTransformCom->LookAt_Lerp(XMLoadFloat4(&m_vTargetPos),fTimeDelta, 5.f); + m_pTransformCom->LookAt_Lerp(XMLoadFloat4(&m_vTargetPos),fTimeDelta, 3.f); } @@ -388,6 +388,8 @@ void CTroll::Describe_Entity() { m_pCharacter_Controller->Set_Position(XMLoadFloat3(&Pos)); } + GUI::TextColored(ImVec4(1.f, 0.f, 0.f, 1.f), "Degree %.2f", m_fDegree); + GUI::TextColored(ImVec4(1.f, 0.f, 0.f, 1.f), "Distance %.2f", m_fTargetDistance); GUI::End(); diff --git a/Jusin154_Team3D/Client/Private/Troll_State_BackHand_Swing.cpp b/Jusin154_Team3D/Client/Private/Troll_State_BackHand_Swing.cpp new file mode 100644 index 000000000..9f9f0384c --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Troll_State_BackHand_Swing.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "Troll_State_BackHand_Swing.h" +#include "GameInstance.h" +#include "Unit.h" + +CTroll_State_BackHand_Swing::CTroll_State_BackHand_Swing() + :CState_Root() +{ +} + +void CTroll_State_BackHand_Swing::Enter() +{ + __super::Enter(); +} + +HRESULT CTroll_State_BackHand_Swing::Update(_float fTimeDelta) +{ + if (nullptr != m_funcPriorityUpdate) { + m_funcPriorityUpdate(fTimeDelta); + } + if (E_FAIL == (__super::Update(fTimeDelta))) { + return E_FAIL; + } + if (nullptr != m_funcLateUpdate) { + m_funcLateUpdate(fTimeDelta); + } + return S_OK; +} + +void CTroll_State_BackHand_Swing::Exit() +{ + __super::Exit(); +} + +HRESULT CTroll_State_BackHand_Swing::Initialize(TROLL_STATE_BACK_HAND_SWING_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_funcPriorityUpdate = pDesc->funcPriorityUpdate; + m_funcLateUpdate = pDesc->funcLateUpdate; + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + + return S_OK; +} + +CTroll_State_BackHand_Swing* CTroll_State_BackHand_Swing::Create(TROLL_STATE_BACK_HAND_SWING_DESC* pDesc) +{ + CTroll_State_BackHand_Swing* pInstance = new CTroll_State_BackHand_Swing; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CTroll_State_BackHand_Swing::Free() +{ + __super::Free(); +} + +void CTroll_State_BackHand_Swing::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Troll_States.cpp b/Jusin154_Team3D/Client/Private/Troll_States.cpp index b1ab0790f..bd95cf27d 100644 --- a/Jusin154_Team3D/Client/Private/Troll_States.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_States.cpp @@ -7,12 +7,15 @@ #pragma region STATE #include "State_Idle.h" +#include "State_IdleBreak.h" #include "State_Move.h" #include "State_Combat.h" -#include "State_Hit.h" #include "Troll_State_Rush.h" +#include "Troll_State_BackHand_Swing.h" #include "State_Throw.h" #include "State_Swing.h" +#include "State_Slam.h" +#include "State_Hit.h" #pragma endregion @@ -26,7 +29,7 @@ void CTroll::Behavior_IdleEnter() HRESULT CTroll::Behavior_IdleExitCheck() { - if (m_fTargetDistance <= 25.f && m_fTargetDistance !=0) + if (m_fTargetDistance <= 19.f && m_fTargetDistance !=0) m_pFSM->Change_State(FSMSTATE::MOVE); return E_FAIL; @@ -37,6 +40,43 @@ void CTroll::Behavior_IdleExit() m_pFSM->Disable_State(FSMSTATE::IDLE); } +void CTroll::Behavior_IdleBreakEnter() +{ + m_pFSM->Enable_State(FSMSTATE::IDLEBREAK); + pair<_uint, _bool> pairAnimInfo; + m_bLookAt = true; + _int RandIndex = m_pGameInstance->Real_Random_Int(0, 3); + switch (RandIndex) + { + case 0: + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK1]; + break; + case 1: + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK2]; + break; + case 2: + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK3]; + break; + case 3: + pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK4]; + break; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.5f, true); +} + +HRESULT CTroll::Behavior_IdleBreakExitCheck() +{ + if (m_pModelCom->IsFinishedAnim()) + m_pFSM->Change_State(FSMSTATE::MOVE); + + return E_FAIL; +} + +void CTroll::Behavior_IdleBreakExit() +{ + m_pFSM->Disable_State(FSMSTATE::IDLEBREAK); +} + void CTroll::Behavior_MoveEnter() { pair<_uint, _bool> pairAnimInfo = {}; @@ -46,15 +86,18 @@ void CTroll::Behavior_MoveEnter() { m_pFSM->Enable_State(FSMSTATE::JOG); pairAnimInfo = m_Animation[STATEANIM::JOG_START]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } - - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } HRESULT CTroll::Behavior_MoveExitCheck(_float fTimeDelta) { pair<_uint, _bool> pairAnimInfo = {}; _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + _bool bTurnPlaying = + (iCurrAnimIndex == m_Animation[STATEANIM::JOG_LEFT_TURN].first) || + (iCurrAnimIndex == m_Animation[STATEANIM::JOG_RIGHT_TURN].first); + if (iCurrAnimIndex == m_Animation[STATEANIM::JOG_START].first) { if (m_pModelCom->IsFinishedAnim()) @@ -64,7 +107,62 @@ HRESULT CTroll::Behavior_MoveExitCheck(_float fTimeDelta) } } - if (m_fTargetDistance <= 20.f && m_fTargetDistance !=0.f) + if (m_fTargetDistance <= 19.f && m_fTargetDistance >= 14.f) { + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + + if (bTurnPlaying) + { + m_bLookAt = false; + + if (m_pModelCom->IsFinishedAnim()) + { + m_bLookAt = true; + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + + return S_OK; + } + + if (m_fDegree >= 90.f) + { + m_bLookAt = true; + + if (m_fCross > 0) + pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT_TURN]; + else + pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT_TURN]; + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + return S_OK; + } + + if (m_fTargetDistance > 8.f) + { + m_bLookAt = true; + + if (iCurrAnimIndex == m_Animation[STATEANIM::JOG_START].first) + { + if (m_pModelCom->IsFinishedAnim()) + { + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + } + else if (iCurrAnimIndex != m_Animation[STATEANIM::JOG_FWD].first) + { + pairAnimInfo = m_Animation[STATEANIM::JOG_START]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + + return S_OK; + } + + + if (m_fTargetDistance <= 6.f && m_fTargetDistance != 0.f) m_pFSM->Change_State(FSMSTATE::COMBAT); return E_FAIL; @@ -81,150 +179,47 @@ void CTroll::Behavior_CombatEnter() m_pFSM->Enable_State(FSMSTATE::COMBAT); m_bLookAt = true; - if (m_fTargetDistance <= 12.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] <= 0.f) + if (m_fTargetDistance <= 6.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] <= 0.f) { - m_pFSM->Enable_State(FSMSTATE::SLAM); + m_pFSM->Change_State(FSMSTATE::SLAM); } - else if (m_fTargetDistance <= 12.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] <= 0.f) + else if (m_fTargetDistance <= 6.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] <= 0.f) { - m_pFSM->Enable_State(FSMSTATE::BACKHAND_SWING); + m_pFSM->Change_State(FSMSTATE::BACKHAND_SWING); } - else if (m_fTargetDistance <= 12.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)] <= 0.f) + else if (m_fTargetDistance <= 6.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)] <= 0.f) { m_pFSM->Change_State(FSMSTATE::SWING); - return; } else if (m_fTargetDistance <= 15.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::THROWROCK)] <= 0.f) { m_pFSM->Change_State(FSMSTATE::THROW_ROCK); - return; } else if (m_fTargetDistance <= 18.f && m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::RUSH)] <= 0.f) { m_pFSM->Change_State(FSMSTATE::RUSH); - return; } else { - m_bLookAt = true; - _int RandIndex = m_pGameInstance->Real_Random_Int(0,3); - switch (RandIndex) - { - case 0: - pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK1]; - break; - case 1: - pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK2]; - break; - case 2: - pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK3]; - break; - case 3: - pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK4]; - break; - } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_pFSM->Change_State(FSMSTATE::IDLEBREAK); } } HRESULT CTroll::Behavior_CombatExitCheck(_float fTimeDelta) { - pair<_uint, _bool> pairAnimInfo = {}; - _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); - - if (m_pFSM->IsEnable(FSMSTATE::SLAM)) - { - if (m_fTargetDistance > 5.f) - { - if (m_fDegree >= 90.f && iCurrAnimIndex != m_Animation[STATEANIM::JOG_FWD].first) - { - if (m_fCross > 0) { - pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT_TURN]; - } - else { - pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT_TURN]; - } - } - else { - pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; - } - - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); - } - else - { - pairAnimInfo = m_Animation[STATEANIM::SLAM]; - - if (iCurrAnimIndex != pairAnimInfo.first) - { - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); - m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] =m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)]; - - Add_Event(pairAnimInfo.first, - [this]() { m_bLookAt = false;}, - 0.2f); - - m_pFSM->Disable_State(FSMSTATE::SLAM); - } - } - - return S_OK; - } - - - if (m_pFSM->IsEnable(FSMSTATE::BACKHAND_SWING)) - { - if (m_fTargetDistance > 5.f) - { - if (m_fDegree >= 90.f && iCurrAnimIndex != m_Animation[STATEANIM::JOG_FWD].first) - { - if (m_fCross > 0) { - pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT_TURN]; - } - else { - pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT_TURN]; - } - } - else { - pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; - } - - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); - } - else - { - pairAnimInfo = m_Animation[STATEANIM::BACKHAND_SWING_JOG]; - - if (iCurrAnimIndex != pairAnimInfo.first) - { - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); - m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)]; - - Add_Event(pairAnimInfo.first, - [this]() { m_bLookAt = false; }, - 0.2f); - - m_pFSM->Disable_State(FSMSTATE::BACKHAND_SWING); - } - } - - return S_OK; - } - - if (m_pModelCom->IsFinishedAnim()) - { - m_bLookAt = true; + m_bLookAt = true; + if (m_fTargetDistance > 25.f && m_fTargetDistance != 0.f) + m_pFSM->Change_State(FSMSTATE::MOVE); + else if (m_fTargetDistance > 30.f && m_fTargetDistance != 0.f) m_pFSM->Change_State(FSMSTATE::IDLE); - return E_FAIL; - } return E_FAIL; } void CTroll::Behavior_CombatExit() { - m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::SLAM | FSMSTATE::BACKHAND_SWING); + m_pFSM->Disable_State(FSMSTATE::COMBAT); } void CTroll::Behavior_RushEnter() @@ -248,7 +243,7 @@ HRESULT CTroll::Behavior_RushExitCheck(_float fTimeDelta) { m_bLookAt = false; pairAnimInfo = m_Animation[STATEANIM::RUSH_LOOP]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,1.f,true); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::RUSH)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::RUSH)]; } } @@ -267,15 +262,21 @@ HRESULT CTroll::Behavior_RushExitCheck(_float fTimeDelta) } if (iCurrAnimIndex == m_Animation[STATEANIM::RUSH_END].first) { - m_bLookAt = true; - pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + if (m_fCross > 0) + pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_L]; + else + pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_R]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + + Add_Event(pairAnimInfo.first, + [this]() {m_bLookAt = true; }, + 0.3f); } if (m_pModelCom->IsFinishedAnim()) { m_bLookAt = true; - m_pFSM->Change_State(FSMSTATE::IDLE); + m_pFSM->Change_State(FSMSTATE::IDLEBREAK); } return E_FAIL; } @@ -321,7 +322,7 @@ HRESULT CTroll::Behavior_ThrowExitCheck(_float fTimeDelta) if (m_pModelCom->IsFinishedAnim()) { m_bLookAt = true; - m_pFSM->Change_State(FSMSTATE::IDLE); + m_pFSM->Change_State(FSMSTATE::COMBAT); } return E_FAIL; } @@ -337,9 +338,12 @@ void CTroll::Behavior_SwingEnter() { pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::SWING); + pairAnimInfo = m_Animation[STATEANIM::SWING_FWD]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); - m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)]; + m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)] = + m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)]; + Add_Event(pairAnimInfo.first, [this]() {m_bLookAt = false; }, 0.2f); @@ -347,11 +351,16 @@ void CTroll::Behavior_SwingEnter() HRESULT CTroll::Behavior_SwingExitCheck(_float fTimeDelta) { + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + if (m_pModelCom->IsFinishedAnim()) { m_bLookAt = true; - m_pFSM->Change_State(FSMSTATE::IDLE); + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; } + return E_FAIL; } @@ -360,6 +369,72 @@ void CTroll::Behavior_SwingExit() m_pFSM->Disable_State(FSMSTATE::SWING); } +void CTroll::Behavior_SlamEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::SLAM); + + pairAnimInfo = m_Animation[STATEANIM::SLAM]; + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] = + m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)]; + + Add_Event(m_Animation[STATEANIM::SLAM].first, + [this]() { m_bLookAt = false; }, + 0.2f); +} + +HRESULT CTroll::Behavior_SlamExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + if (m_pModelCom->IsFinishedAnim()) + { + m_bLookAt = true; + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + return E_FAIL; +} + +void CTroll::Behavior_SlamExit() +{ + m_pFSM->Disable_State(FSMSTATE::SLAM); +} + +void CTroll::Behavior_BackHandSwingEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::BACKHAND_SWING); + pairAnimInfo = m_Animation[STATEANIM::BACKHAND_SWING_JOG]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] = + m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)]; + + Add_Event(m_Animation[STATEANIM::BACKHAND_SWING_JOG].first, + [this]() { m_bLookAt = false; }, + 0.2f); +} + +HRESULT CTroll::Behavior_BackHandSwingExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + if (m_pModelCom->IsFinishedAnim()) + { + m_bLookAt = true; + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + return E_FAIL; +} + +void CTroll::Behavior_BackHandSwingExit() +{ + m_pFSM->Disable_State(FSMSTATE::BACKHAND_SWING); +} + void CTroll::Behavior_HitEnter() { m_pFSM->Enable_State(FSMSTATE::HIT); @@ -404,7 +479,7 @@ HRESULT CTroll::Behavior_HitExitCheck() } if (m_pModelCom->IsFinishedAnim()) { - m_pFSM->Change_State(FSMSTATE::IDLE); + m_pFSM->Change_State(FSMSTATE::COMBAT); return E_FAIL; } return E_FAIL; @@ -429,6 +504,16 @@ void CTroll::Add_FSM() Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc)); } + { + CState_IdleBreak::STATE_IDLEBREAK_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_IdleBreakEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleBreakExitCheck(); }; + Desc.funcExitEvent = [this]() { Behavior_IdleBreakExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::IDLEBREAK, CState_IdleBreak::Create(&Desc)); + } { CState_Move::STATE_MOVE_DESC Desc{}; Desc.pOwner = this; @@ -484,6 +569,28 @@ void CTroll::Add_FSM() Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::SWING, CState_Swing::Create(&Desc)); } + + { + CState_Slam::STATE_SLAM_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_SlamEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_SlamExitCheck(fTimeDelta); }; + Desc.funcExitEvent = [this]() { Behavior_SlamExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SLAM, CState_Slam::Create(&Desc)); + } + + { + CTroll_State_BackHand_Swing::TROLL_STATE_BACK_HAND_SWING_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_BackHandSwingEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_BackHandSwingExitCheck(fTimeDelta); }; + Desc.funcExitEvent = [this]() { Behavior_BackHandSwingExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::BACKHAND_SWING, CTroll_State_BackHand_Swing::Create(&Desc)); + } #pragma endregion #pragma region Behavior_Hit @@ -505,7 +612,8 @@ void CTroll::Add_FSM() void CTroll::Set_Anim() { m_Animation[STATEANIM::IDLE] = { 16,true }; - m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD] = { 8,false }; + m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_R] = { 7,false }; + m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_L] = { 8,false }; m_Animation[STATEANIM::IDLE_BREAK1] = { 11,false }; m_Animation[STATEANIM::IDLE_BREAK2] = { 141,false }; m_Animation[STATEANIM::IDLE_BREAK3] = { 14,false }; @@ -514,8 +622,8 @@ void CTroll::Set_Anim() m_Animation[STATEANIM::WALK_FWD] = { 22,true }; m_Animation[STATEANIM::JOG_START] = { 104,false }; - m_Animation[STATEANIM::JOG_LEFT_TURN] = { 108,false }; - m_Animation[STATEANIM::JOG_RIGHT_TURN] = { 112,false }; + m_Animation[STATEANIM::JOG_LEFT_TURN] = { 112,false }; + m_Animation[STATEANIM::JOG_RIGHT_TURN] = { 108,false }; m_Animation[STATEANIM::JOG_FWD] = { 103,true }; m_Animation[STATEANIM::DODGE_LEFT] = { 125, false }; @@ -551,6 +659,7 @@ void CTroll::Set_Anim() //왼턴 108 //오른턴 112 - + // 106 우회전 + // 110 좌회전 } diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index de26fa24b..a63fa36e4 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -131,6 +131,14 @@ class CPlayer final : public CUnit HRESULT Behavior_CombatExitCheck(); void Behavior_CombatExit(); + void Behavior_LightAttackEnter(); + HRESULT Behavior_LightAttackExitCheck(); + void Behavior_LightAttackExit(); + + void Behavior_SpellEnter(); + HRESULT Behavior_SpellExitCheck(); + void Behavior_SpellExit(); + void Behavior_HitEnter(); HRESULT Behavior_HitExitCheck(); void Behavior_HitExit(); diff --git a/Jusin154_Team3D/Client/Public/State_IdleBreak.h b/Jusin154_Team3D/Client/Public/State_IdleBreak.h new file mode 100644 index 000000000..045791872 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_IdleBreak.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_IdleBreak final : public CState_Root +{ +public: + typedef struct tagIdleBreak : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_IDLEBREAK_DESC; +public: + CState_IdleBreak(); + virtual ~CState_IdleBreak() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_IDLEBREAK_DESC* pDesc); + +public: + static CState_IdleBreak* Create(STATE_IDLEBREAK_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_LightAttack.h b/Jusin154_Team3D/Client/Public/State_LightAttack.h new file mode 100644 index 000000000..53f61412a --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_LightAttack.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_LightAttack final : public CState_Root +{ +public: + typedef struct tagLightAttack : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_LIGHTATTACK_DESC; +private: + CState_LightAttack(); + virtual ~CState_LightAttack() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_LIGHTATTACK_DESC* pDesc); + +public: + static CState_LightAttack* Create(STATE_LIGHTATTACK_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Slam.h b/Jusin154_Team3D/Client/Public/State_Slam.h new file mode 100644 index 000000000..da6cd046a --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Slam.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_Slam final : public CState_Root +{ +public: + typedef struct tagSlam : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_SLAM_DESC; +private: + CState_Slam(); + virtual ~CState_Slam() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_SLAM_DESC* pDesc); + +public: + static CState_Slam* Create(STATE_SLAM_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/State_Spell.h b/Jusin154_Team3D/Client/Public/State_Spell.h new file mode 100644 index 000000000..34931a743 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/State_Spell.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CState_Spell final : public CState_Root +{ +public: + typedef struct tagSpell : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_SPELL_DESC; +private: + CState_Spell(); + virtual ~CState_Spell() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(STATE_SPELL_DESC* pDesc); + +public: + static CState_Spell* Create(STATE_SPELL_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Troll.h b/Jusin154_Team3D/Client/Public/Troll.h index dbff78f6d..a1dc4e9bf 100644 --- a/Jusin154_Team3D/Client/Public/Troll.h +++ b/Jusin154_Team3D/Client/Public/Troll.h @@ -73,11 +73,14 @@ class CTroll final : public CMonster _float m_fDegree = {}; _float m_fCross = {}; - void Behavior_IdleEnter(); HRESULT Behavior_IdleExitCheck(); void Behavior_IdleExit(); + void Behavior_IdleBreakEnter(); + HRESULT Behavior_IdleBreakExitCheck(); + void Behavior_IdleBreakExit(); + void Behavior_MoveEnter(); HRESULT Behavior_MoveExitCheck(_float fTimeDelta); void Behavior_MoveExit(); @@ -98,6 +101,14 @@ class CTroll final : public CMonster HRESULT Behavior_SwingExitCheck(_float fTimeDelta); void Behavior_SwingExit(); + void Behavior_SlamEnter(); + HRESULT Behavior_SlamExitCheck(_float fTimeDelta); + void Behavior_SlamExit(); + + void Behavior_BackHandSwingEnter(); + HRESULT Behavior_BackHandSwingExitCheck(_float fTimeDelta); + void Behavior_BackHandSwingExit(); + void Behavior_HitEnter(); HRESULT Behavior_HitExitCheck(); void Behavior_HitExit(); diff --git a/Jusin154_Team3D/Client/Public/Troll_State_BackHand_Swing.h b/Jusin154_Team3D/Client/Public/Troll_State_BackHand_Swing.h new file mode 100644 index 000000000..1096cf03d --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Troll_State_BackHand_Swing.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CTroll_State_BackHand_Swing final : public CState_Root +{ +public: + typedef struct tagTrollBackHandSwing : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }TROLL_STATE_BACK_HAND_SWING_DESC; +public: + CTroll_State_BackHand_Swing(); + virtual ~CTroll_State_BackHand_Swing() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + function m_funcPriorityUpdate = { nullptr }; + function m_funcLateUpdate = { nullptr }; + +private: + HRESULT Initialize(TROLL_STATE_BACK_HAND_SWING_DESC* pDesc); + +public: + static CTroll_State_BackHand_Swing* Create(TROLL_STATE_BACK_HAND_SWING_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Bin/AnimIndex.txt b/Jusin154_Team3D/Editor/Bin/AnimIndex.txt index 67eb89537..d4879fcb8 100644 --- a/Jusin154_Team3D/Editor/Bin/AnimIndex.txt +++ b/Jusin154_Team3D/Editor/Bin/AnimIndex.txt @@ -1,35 +1,214 @@ -0 Brm_STN_Sweep_Magic_BroomProp_ANM -1 Brm_STN_Sweep_Magic_BroomProp_Enter_ANM -2 Brm_STN_Sweep_Magic_BroomProp_Exit_ANM -3 Broom_Bristle_Fly_Fast_anm -4 Broom_Bristle_Fly_Slow_anm -5 Broom_Bristle_Hover_anm -6 Broom_Fly_2Hover_Stop_anm -7 Broom_Fly_2Hover_Stop_Dn_anm -8 Broom_Fly_2Hover_Stop_Lft_anm -9 Broom_Fly_2Hover_Stop_Rht_anm -10 Broom_Fly_2Hover_Stop_Up_anm -11 Broom_Fly_ADD_anm -12 Broom_Fly_Cntr_anm -13 Broom_Fly_Dn_anm -14 Broom_Fly_Idle_anm -15 Broom_Fly_Lft_anm -16 Broom_Fly_Rht_anm -17 Broom_Fly_Up_anm -18 Broom_Hover_2Fly_Dn_anm -19 Broom_Hover_2Fly_Start_anm -20 Broom_Hover_2Fly_Start_Lft_anm -21 Broom_Hover_2Fly_Start_Rht_anm -22 Broom_Hover_2Fly_Up_anm -23 Broom_Hover_Idle_ADD_anm -24 Broom_Hover_Idle_anm -25 Broom_Hover_Idle_Dn_anm -26 Broom_Hover_Idle_Lft_anm -27 Broom_Hover_Idle_Rht_anm -28 Broom_Hover_Idle_Up_anm -29 Broom_Hover_Mount_anm -30 Broom_Hover_Throw_anm -31 BroomSpline_Fly_BarrelRoll_Lft_anm -32 BroomSpline_Fly_BarrelRoll_Rht_anm -33 BroomSpline_Fly_Lft_anm -34 BroomSpline_Fly_Rht_anm +0 Hu_Rct_Accio_Loop_anm +1 Hu_Rct_Accio_Splat_anm +2 Hu_Rct_Accio_Start_anm +3 Hu_Rct_Bola_Frnt_anm +4 Hu_Rct_Bump_Stand_Rct2_Jogger_FwdLft_v02_anm +5 Hu_Rct_Bump_Stand_Rct2_Jogger_FwdRht_v01_anm +6 Hu_Rct_Bump_Stand_Rct2_Walker_BckRht_v02_anm +7 Hu_Rct_Dazed_Start_anm +8 Hu_Rct_Descendo_Grnd_anm +9 Hu_Rct_Descendo_Grnd_End_anm +10 Hu_Rct_Descendo_Grnd_Loop_anm +11 Hu_Rct_Descendo_Grnd_Start_anm +12 Hu_Rct_Dodge_Bwd_Duck_anm +13 Hu_Rct_Dodge_Fwd_Duck_anm +14 Hu_Rct_Dodge_Lft_anm +15 Hu_Rct_Dodge_Lft_Duck_135_anm +16 Hu_Rct_Dodge_Lft_Duck_45_anm +17 Hu_Rct_Dodge_Lft_Duck_anm +18 Hu_Rct_Dodge_Rht_anm +19 Hu_Rct_Dodge_Rht_Duck_135_anm +20 Hu_Rct_Dodge_Rht_Duck_45_anm +21 Hu_Rct_Dodge_Rht_Duck_anm +22 Hu_Rct_Env_UpperBody_Bats_anm +23 Hu_Rct_Env_UpperBody_SpdrWeb_anm +24 Hu_Rct_Flinch_BMIdle_Fwd_anm +25 Hu_Rct_Flinch_BMIdle_Lft_anm +26 Hu_Rct_Flinch_BMIdle_Rht_anm +27 Hu_Rct_Flinch_Fwd_Spine_ADD_anm +28 Hu_Rct_Flinch_LF_BMIdle_Fwd_anm +29 Hu_Rct_Flinch_LF_BMIdle_Lft_anm +30 Hu_Rct_Flinch_LF_BMIdle_Rht_anm +31 Hu_Rct_Flinch_Lft_anm +32 Hu_Rct_Flinch_Lft_Jog_Loop_anm +33 Hu_Rct_Flinch_Lft_Spine_ADD_anm +34 Hu_Rct_Flinch_Lft_Walk_Loop_anm +35 Hu_Rct_Flinch_Rht_anm +36 Hu_Rct_Flinch_Rht_Jog_Loop_anm +37 Hu_Rct_Flinch_Rht_Spine_ADD_anm +38 Hu_Rct_Flinch_Rht_Walk_Loop_anm +39 Hu_Rct_Flip_Bwd_01_anm +40 Hu_Rct_Frozen_ShakeOff_anm +41 Hu_Rct_Frozen_ShakeOff_v2_anm +42 Hu_Rct_Getup_Bck_2Crouch_anm +43 Hu_Rct_Getup_Bck_2Knee_anm +44 Hu_Rct_Getup_Frnt_2Crouch_anm +45 Hu_Rct_Getup_Frnt_2Knee_anm +46 Hu_Rct_Getup_Frnt_anm +47 Hu_Rct_Getup_Lftside_2Knee_anm +48 Hu_Rct_Getup_Lftside_FD_2Knee_anm +49 Hu_Rct_Getup_LftSide_FD_anm +50 Hu_Rct_Getup_Lftside_FU_2Knee_anm +51 Hu_Rct_Getup_LftSide_FU_anm +52 Hu_Rct_Getup_Rhtside_2Knee_anm +53 Hu_Rct_Getup_Rhtside_FD_2Knee_anm +54 Hu_Rct_Getup_RhtSide_FD_anm +55 Hu_Rct_Getup_Rhtside_FU_2Knee_anm +56 Hu_Rct_Getup_RhtSide_FU_anm +57 Hu_Rct_Getup_Slouch_2Knee_anm +58 Hu_Rct_Hit_2Cmbt_Bwd_anm +59 Hu_Rct_Hit_Bwd_anm +60 Hu_Rct_Hit_Fwd_anm +61 Hu_Rct_Hit_Lft_anm +62 Hu_Rct_Hit_Rht_anm +63 Hu_Rct_Hitch_Bwd_anm +64 Hu_Rct_Hitch_Fwd_anm +65 Hu_Rct_Hitch_Lft_anm +66 Hu_Rct_Hitch_Rht_anm +67 Hu_Rct_InAir_Hit_Frnt_anm +68 Hu_Rct_KnckBck_Loop_anm +69 Hu_Rct_KnckBck_Start_anm +70 Hu_Rct_KnckDn_Hvy_01_anm +71 Hu_Rct_KnckDn_Hvy_02_anm +72 Hu_Rct_KnckDn_Hvy_Fwd_01_anm +73 Hu_Rct_KnckDn_Hvy_Fwd_Splat_anm +74 Hu_Rct_KnckDn_Hvy_Splat_01_anm +75 Hu_Rct_KnckDn_Hvy_Splat_02_anm +76 Hu_Rct_Knockdown_Bwd_9m_Start_anm +77 Hu_Rct_Knockdown_Bwd_anm +78 Hu_Rct_Knockdown_Bwd_Getup_anm +79 Hu_Rct_Knockdown_Bwd_Land_anm +80 Hu_Rct_Knockdown_Bwd_SplatHold_anm +81 Hu_Rct_Knockdown_Bwd_Start_anm +82 Hu_Rct_Knockdown_Fwd_9m_Start_anm +83 Hu_Rct_Knockdown_Fwd_Getup_anm +84 Hu_Rct_Knockdown_Fwd_Land_anm +85 Hu_Rct_Knockdown_Fwd_SplatHold_anm +86 Hu_Rct_Knockdown_Fwd_Start_anm +87 Hu_Rct_Knockdown_Lft_9m_Start_anm +88 Hu_Rct_Knockdown_Lft_Getup_anm +89 Hu_Rct_Knockdown_Lft_Land_anm +90 Hu_Rct_Knockdown_Lft_SplatHold_anm +91 Hu_Rct_Knockdown_Lft_Start_anm +92 Hu_Rct_Knockdown_Rht_9m_Start_anm +93 Hu_Rct_Knockdown_Rht_Getup_anm +94 Hu_Rct_Knockdown_Rht_Land_anm +95 Hu_Rct_Knockdown_Rht_SplatHold_anm +96 Hu_Rct_Knockdown_Rht_Start_anm +97 Hu_Rct_Levioso_Loop_anm +98 Hu_Rct_Levitate_Land_anm +99 Hu_Rct_Levitate_Land_Fail_anm +100 Hu_Rct_Levitate_Loop_anm +101 Hu_Rct_Levitate_Rht_Arm_Fail_anm +102 Hu_Rct_Levitate_Rht_Arm_Success_anm +103 Hu_Rct_Levitate_Start_anm +104 Hu_Rct_LF_Spell_Trip_Catch_anm +105 Hu_Rct_LF_WallStop_anm +106 Hu_Rct_Ragdoll_Flail_anm +107 Hu_Rct_Ragdoll_Panic_Loop_anm +108 Hu_Rct_Ragdoll_Wall_Anticipate_anm +109 Hu_Rct_Ragdoll_Writhe_Loop_anm +110 Hu_Rct_RF_WallStop_anm +111 Hu_Rct_Send_Bwd_Getup_anm +112 Hu_Rct_Send_Bwd_Loop_02_anm +113 Hu_Rct_Send_Bwd_Loop_anm +114 Hu_Rct_Send_Bwd_SplatGround_anm +115 Hu_Rct_Send_Bwd_SplatHold_anm +116 Hu_Rct_Send_Bwd_Tumble_Loop_02_anm +117 Hu_Rct_Send_Bwd_Tumble_Loop_anm +118 Hu_Rct_Send_Fwd_Loop_anm +119 Hu_Rct_Send_Fwd_Start_anm +120 Hu_Rct_Send_Fwd_StartLoop_anm +121 Hu_Rct_Slam_Wall_Bck_Bounce_anm +122 Hu_Rct_Slam_Wall_Frnt_Bounce_anm +123 Hu_Rct_Spell_Dance_anm +124 Hu_Rct_Spell_Dance_v01_anm +125 Hu_Rct_Spell_Glacius_End_anm +126 Hu_Rct_Spell_Glacius_Fail_anm +127 Hu_Rct_Spell_Glacius_Fail_End_anm +128 Hu_Rct_Spell_Incarcerous_End_anm +129 Hu_Rct_Spell_Incarcerous_End_Fail_anm +130 Hu_Rct_Spell_Incarcerous_Loop_anm +131 Hu_Rct_Spell_Incarcerous_Start_anm +132 Hu_Rct_Spell_Petrificus_End_anm +133 Hu_Rct_Spell_Petrificus_End_Fail_anm +134 Hu_Rct_Spell_Petrificus_GetUp_anm +135 Hu_Rct_Spell_Petrificus_Loop_anm +136 Hu_Rct_Spell_Petrificus_SplatGround_anm +137 Hu_Rct_Spell_Petrificus_SplatGround_Hold_anm +138 Hu_Rct_Spell_Petrificus_Start_anm +139 Hu_Rct_Spell_Scalp_anm +140 Hu_Rct_Spell_Sneeze_anm +141 Hu_Rct_Spell_TimeDialation_v01_anm +142 Hu_Rct_Spell_Trip_Catch_v01_anm +143 Hu_Rct_Spell_Trip_Catch_v02_anm +144 Hu_Rct_Spell_Trip_Fall_anm +145 Hu_Rct_Spell_Trip_Fall_v01_anm +146 Hu_Rct_Spell_Web_End_anm +147 Hu_Rct_Spell_Web_End_Fail_anm +148 Hu_Rct_Spell_Web_End_Fail_Break_anm +149 Hu_Rct_Spell_Web_End_Fail_Loop_anm +150 Hu_Rct_Spell_Web_Hit_anm +151 Hu_Rct_Spell_Web_Loop_anm +152 Hu_Rct_SpellFlinch_Sit_Bck_v01_anm +153 Hu_Rct_SpellFlinch_Sit_Bck_v02_anm +154 Hu_Rct_SpellFlinch_Sit_Bck_v03_anm +155 Hu_Rct_SpellFlinch_Sit_Fwd_v01_anm +156 Hu_Rct_SpellFlinch_Sit_Fwd_v02_anm +157 Hu_Rct_SpellFlinch_Sit_Fwd_v03_anm +158 Hu_Rct_SpellFlinch_Sit_Lft_v01_anm +159 Hu_Rct_SpellFlinch_Sit_Lft_v02_anm +160 Hu_Rct_SpellFlinch_Sit_Rht_v01_anm +161 Hu_Rct_SpellFlinch_Sit_Rht_v02_anm +162 Hu_Rct_SpellFlinch_Sit_Rht_v03_anm +163 Hu_Rct_SpellFlinch_Stand_Bck_v01_anm +164 Hu_Rct_SpellFlinch_Stand_Bck_v02_anm +165 Hu_Rct_SpellFlinch_Stand_Bck_v03_anm +166 Hu_Rct_SpellFlinch_Stand_Fwd_v01_anm +167 Hu_Rct_SpellFlinch_Stand_Fwd_v02_anm +168 Hu_Rct_SpellFlinch_Stand_Fwd_v03_anm +169 Hu_Rct_SpellFlinch_Stand_Lft_v01_anm +170 Hu_Rct_SpellFlinch_Stand_Lft_v02_anm +171 Hu_Rct_SpellFlinch_Stand_Rht_v01_anm +172 Hu_Rct_SpellFlinch_Stand_Rht_v02_anm +173 Hu_Rct_SpellFlinch_Walk_Bck_v01_anm +174 Hu_Rct_SpellFlinch_Walk_Fwd_v01_anm +175 Hu_Rct_SpellFlinch_Walk_Lft_v01_anm +176 Hu_Rct_SpellFlinch_Walk_Lft_v03_anm +177 Hu_Rct_SpellFlinch_Walk_Lft_v04_anm +178 Hu_Rct_SpellFlinch_Walk_Rht_01_anm +179 Hu_Rct_SpellFlinch_Walk_Rht_02_anm +180 Hu_Rct_SpellImpact_Walk_Bck_v03_anm +181 Hu_Rct_SpellImpact_Walk_Fwd_v01_anm +182 Hu_Rct_SpellImpact_Walk_Fwd_v02_anm +183 Hu_Rct_SpellImpact_Walk_Lft_v02_anm +184 Hu_Rct_SpellImpact_Walk_Rht_v01_anm +185 Hu_Rct_SpelLook_Ground_DrunkSleep_Fwd_v01_anm +186 Hu_Rct_SpelLook_Ground_Fwd_v01_anm +187 Hu_Rct_SpelLook_WallLean_Fwd_v01_anm +188 Hu_Rct_SpelLook_WallLean_Fwd_v02_anm +189 Hu_Rct_Startled_Bwd_anm +190 Hu_Rct_Startled_Fwd_anm +191 Hu_Rct_Startled_Lft_anm +192 Hu_Rct_Startled_Rht_anm +193 Hu_Rct_Stumble2Knee_Bwd_anm +194 Hu_Rct_Stumble2Knee_Fwd_anm +195 Hu_Rct_Stumble_Bwd_01_Frozen_anm +196 Hu_Rct_Stumble_Bwd_anm +197 Hu_Rct_Stumble_Bwd_Fire_anm +198 Hu_Rct_Stumble_Bwd_Hvy_anm +199 Hu_Rct_Stumble_Bwd_Lft_anm +200 Hu_Rct_Stumble_Bwd_Rht_anm +201 Hu_Rct_Stumble_Fwd_anm +202 Hu_Rct_Stumble_Fwd_Frozen_01_anm +203 Hu_Rct_Stumble_Fwd_Lft_anm +204 Hu_Rct_Stumble_Lft_180_4m_anm +205 Hu_Rct_Stumble_Lft_anm +206 Hu_Rct_Stumble_Lft_Frozen_01_anm +207 Hu_Rct_Stumble_Rht_180_4m_anm +208 Hu_Rct_Stumble_Rht_anm +209 Hu_Rct_Stumble_Rht_Frozen_01_anm +210 Hu_Rct_Wounded_Knee_Death_Fwrd_anm +211 Hu_Rct_Wounded_Knee_End_anm +212 Hu_Rct_Wounded_Knee_Enter_anm +213 Hu_Rct_Wounded_Knee_Loop_anm diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/Npc.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/Npc.bin index 7a0c62327..936d8e008 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/Npc.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Human/Npc/Npc.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0bd9bce5d7e2a249cc92cc32dfbcd397671a249f211bb5a19977845df694f3a6 -size 2175828 +oid sha256:c8f1b3aa675b8473eef9ebadd93468d04943597403a7f01c1f692cc12ed98d6f +size 2180945 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.bin index 6e34567fa..dce35ef43 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:be254ecb748748080b015fa8e293d12445b835a341075bb79113d41ef788d426 -size 1457699 +oid sha256:c15a2e341dedd612d964382a7917faf2c5907111c6420f55858b8ff7ab6aa3d5 +size 1458037 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.fbx index 227b0eeaa..6d114cc35 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.fbx +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin.fbx @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c6590bf308dd22da41e048d111dd2de7425d111647d5d8aa24701f67ec52d912 -size 529804 +oid sha256:ae71d14a3a11c4744bca0d9abcfb19615befad7ab3570497d439f0b3dc962d9f +size 525932 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin_Anim.fbx b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin_Anim.fbx deleted file mode 100644 index 24f3df2f4..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/Goblin_Anim.fbx +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:7a79d73c0eeab355f9fbbab5ba1c4c42896d33efecb885325ea3c0f036dd4507 -size 43823420 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/T_GOB_M__T4GoblinMelee_INST_A_MRO.dds b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/T_GOB_M__T4GoblinMelee_INST_A_MRO.dds new file mode 100644 index 000000000..cbc1dc504 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/Goblin/T_GOB_M__T4GoblinMelee_INST_A_MRO.dds differ diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 055c1067c..09f2d01b5 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -1874,8 +1874,8 @@ HRESULT CLoader::Loading_For_ObjectViewer() m_strMessage = TEXT("Model Loading.."); - /*if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_NPC"), - CModel::Create(m_pDevice, m_pContext, MODEL::ENVIROMENT, "C:/MeshTable\\Game\\RiggedObjects\\Characters\\Human\\Body\\Generic_M\\SK_GenericDarkWizard_14.fbx", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity())))) { + /*if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_SK_GenericDarkWizard_14_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM_LOCAL, "C:/MeshTable\\Game\\RiggedObjects\\Characters\\Human\\Body\\Generic_M\\SK_GenericDarkWizard_14.fbx", XMMatrixIdentity())))) { return E_FAIL; }*/ @@ -1995,6 +1995,7 @@ HRESULT CLoader::Loading_For_ObjectViewer() MODEL::ANIM, "../Bin/Resources/Models/Monster/Troll/Troll.bin", XMMatrixIdentity(), TEXT("Prototype_Component_Troll_Model") )); + futures.emplace_back(Deferred_ModelLoad( MODEL::ANIM, "../Bin/Resources/Models/Monster/Dragon/Dragon.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(), TEXT("Prototype_Component_Dragon_Model") diff --git a/Jusin154_Team3D/Editor/Private/Player.cpp b/Jusin154_Team3D/Editor/Private/Player.cpp index 14bfd45f6..e446ce8c8 100644 --- a/Jusin154_Team3D/Editor/Private/Player.cpp +++ b/Jusin154_Team3D/Editor/Private/Player.cpp @@ -373,6 +373,7 @@ void CPlayer::SetGravity() } void CPlayer::Update_CameraCoordinateSystem() + { _vector xmvCameraLook = XMVector3Normalize(XMVectorSetY(m_pGameInstance->Get_CameraLook(), 0.f)); _vector xmvUp = XMVectorSet(0.f, 1.f, 0.f, 0.f); @@ -381,6 +382,7 @@ void CPlayer::Update_CameraCoordinateSystem() m_pInfoInstance->Update_CameraCoordinateSystem(m_vCameraLookDir, m_vRimLightColor); } + _matrix CPlayer::Get_WandPos() { CWand* pWand = Get_PartObject(); diff --git a/Jusin154_Team3D/Editor/Public/Player.h b/Jusin154_Team3D/Editor/Public/Player.h index d3aa41575..9c4bd2595 100644 --- a/Jusin154_Team3D/Editor/Public/Player.h +++ b/Jusin154_Team3D/Editor/Public/Player.h @@ -7,6 +7,15 @@ NS_BEGIN(Editor) class CPlayer final : public CUnit { +public: + struct PendingEvent + { + _float fRatio = 0.f; + _uint AnimIndex = 0; + function Callback; + _bool bLoop = false; + }; + private: CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CPlayer(const CPlayer& Prototype); @@ -91,6 +100,8 @@ class CPlayer final : public CUnit virtual void Set_Anim(); function m_InputAction = nullptr; + void Play_Event(); + void Add_Event(_uint AnimIndex, function Callback, _float fRatio = 0.f, _bool bLoop = false); _float3 m_OffsetPos = {}; diff --git a/Jusin154_Team3D/Engine/Private/Material.cpp b/Jusin154_Team3D/Engine/Private/Material.cpp index d5407460d..22a4b781e 100644 --- a/Jusin154_Team3D/Engine/Private/Material.cpp +++ b/Jusin154_Team3D/Engine/Private/Material.cpp @@ -369,6 +369,9 @@ HRESULT CMaterial::Add_Texture(const _char* pTextureFolderPath, string& FileType else if (!strcmp(FileType.c_str(), "SRXO")) { eTexture = aiTextureType::aiTextureType_SPECULAR; } + else if (!strcmp(FileType.c_str(), "A")) { + eTexture = aiTextureType::aiTextureType_AMBIENT; + } else { #ifndef 기무리 diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index be6484f42..401288758 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -269,6 +269,18 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform) } } + if (m_bIsFinishedAnim) + { + if (m_bIsLoop) + { + m_bLoopRestarted = true; + m_vPrevRootPos = { 0,0,0 }; + } + else { + XMStoreFloat3(&m_vPrevRootPos, m_vector[2]); + } + } + if (m_bRatio) { Update_RootBone(m_fAmount * m_fRatio); } @@ -279,14 +291,6 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform) if (m_bIsFinishedAnim) { - if (m_bIsLoop) - { - m_bLoopRestarted = true; - } - else{ - //XMStoreFloat3(&m_vPrevRootPos, m_vector[2]); - } - m_vPrevRootRot = { 0.f,0.f,0.f,0.f }; m_bInitialRootRotSaved = false; } @@ -735,6 +739,75 @@ HRESULT CModel::Ready_Materials_FromFile(const aiScene* pAIScene, const _char* p return S_OK; } +HRESULT CModel::Ready_Materials_FromFile_Anim(const aiScene* pAIScene, const _char* pModelFilePath) +{ + m_iNumMaterials = pAIScene->mNumMaterials; + m_Materials.reserve(m_iNumMaterials); + + _char szDrive[MAX_PATH] = {}; + _char szDir[MAX_PATH] = {}; + _char szFileName[MAX_PATH] = {}; + _char szMeshFilePath[MAX_PATH] = {}; + vector<_string> MaterialFilePathes; + string strFolderPath = pModelFilePath; + + size_t iFolderPos = strFolderPath.find("MeshTable"); + + strFolderPath = strFolderPath.substr(0, iFolderPos) + "MeshTable/"; + + _splitpath_s(pModelFilePath, szDrive, MAX_PATH, szDir, MAX_PATH, szFileName, MAX_PATH, nullptr, 0); + + strcpy_s(szMeshFilePath, szDrive); + strcat_s(szMeshFilePath, szDir); + strcat_s(szMeshFilePath, szFileName); + strcat_s(szMeshFilePath, ".props.txt"); + + ifstream file(szMeshFilePath); + + if (!file.is_open()) + { + return S_OK; + } + + string strText = {}; + _uint iNumParameter = {}; + + getline(file, strText); + getline(file, strText); + + for (_uint i = 0; i < m_iNumMaterials; ++i) + { + getline(file, strText); + + _int iBeginIndex = (_int)strText.find_first_of("/"); + _int iEndIndex = (_int)strText.find('.'); + if (-1 == iBeginIndex || -1 == iEndIndex) { + + MSG_BOX("Fail Path _ NotExist"); + return E_FAIL; + } + if ((_int)strText.size() < iEndIndex - iBeginIndex) + { + MSG_BOX("Fail Path"); + return E_FAIL; + } + + string strPath = strFolderPath + strText.substr(iBeginIndex + 1, iEndIndex - iBeginIndex - 1); + MaterialFilePathes.push_back(strPath); + } + + for (size_t i = 0; i < m_iNumMaterials; ++i) { + CMaterial* pMaterial = CMaterial::Create(m_pDevice, m_pContext, MaterialFilePathes[i].c_str(), strFolderPath.c_str()); + if (nullptr == pMaterial) { + return E_FAIL; + } + m_Materials.push_back(pMaterial); + } + m_Materials.shrink_to_fit(); + + return S_OK; +} + HRESULT CModel::Ready_Materials_Independent(MODEL eType, const aiScene* pAIScene, const _char* pModelFilePath) { m_iNumMaterials = pAIScene->mNumMaterials; @@ -1125,6 +1198,12 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma return E_FAIL; } } + else if (MODEL::ANIM_LOCAL == eType) + { + if (FAILED(Ready_Materials_FromFile_Anim(m_pAIScene, pModelFilePath))) { + return E_FAIL; + } + } else if (MODEL::PBR_NONANIM == eType || MODEL::PBR_ANIM == eType) { if (FAILED(Ready_Materials_Independent(eType, m_pAIScene, pModelFilePath))) { return E_FAIL; @@ -1734,7 +1813,7 @@ HRESULT CModel::Initialize(void* pArg) SAFE_ADDREF(m_pTransform); - if (m_eType == MODEL::ANIM || m_eType == MODEL::PBR_ANIM) + if (m_eType == MODEL::ANIM || m_eType == MODEL::PBR_ANIM || m_eType == MODEL::ANIM_LOCAL) { Initialize_RootBone(); InItialize_BoneIndex(); diff --git a/Jusin154_Team3D/Engine/Private/Unit.cpp b/Jusin154_Team3D/Engine/Private/Unit.cpp index 2a456ad04..91a63294d 100644 --- a/Jusin154_Team3D/Engine/Private/Unit.cpp +++ b/Jusin154_Team3D/Engine/Private/Unit.cpp @@ -118,7 +118,7 @@ HRESULT CUnit::Ready_Components(void *pArg) if (FAILED(Add_Component(g_iStaticLevel, &m_pFSM))){ return E_FAIL; } - + return S_OK; } @@ -129,24 +129,36 @@ void CUnit::Play_Event() _float ratio = m_pModelCom->Get_CurrentTrackProgressRatio(); _uint curAnim = m_pModelCom->Get_AnimIndex(); - if (curAnim == iter->AnimIndex && ratio >= iter->fRatio) + if (curAnim == iter->AnimIndex) { - iter->Callback(); - iter = m_PendingEvents.erase(iter); + if (!iter->bExecuted && ratio >= iter->fRatio) + { + iter->Callback(); + iter->bExecuted = true; + + if (!iter->bKeep) + { + iter = m_PendingEvents.erase(iter); + continue; + } + } } else { - ++iter; + iter->bExecuted = false; } + + ++iter; } } -void CUnit::Add_Event(_uint AnimIndex, function Callback, _float fRatio) +void CUnit::Add_Event(_uint AnimIndex, function Callback, _float fRatio,_bool bKeep) { PendingEvent Desc; Desc.AnimIndex = AnimIndex; Desc.fRatio = fRatio; Desc.Callback = Callback; + Desc.bKeep = bKeep; m_PendingEvents.push_back(Desc); } diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index 092e610a9..dc2d4b463 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -29,7 +29,7 @@ enum class PXBODYSTATE { enum class MOUSEKEYSTATE { LBUTTON, RBUTTON, WBUTTON, XBUTTON }; enum class MOUSEMOVESTATE { X, Y, W }; enum class D3DTS { VIEW, PROJ, VIEW_INV, PROJ_INV, END }; -enum class MODEL { ANIM, NONANIM, PBR_NONANIM, PBR_ANIM, ENVIROMENT }; +enum class MODEL { ANIM, NONANIM, PBR_NONANIM, PBR_ANIM, ENVIROMENT, ANIM_LOCAL}; enum class NAVI_POINT { A, B, C, END }; enum class NAVI_LINE { AB, BC, CA, END }; diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 9b8b2c9f7..a889c479b 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -5,33 +5,34 @@ enum ESTATE : _u64Flag { NOT_DEFINE = 0, IDLE = 1ULL << 0, - IDLE_TURN = 1ULL << 1, - MOVE = 1ULL << 2, - WALK = 1ULL << 3, - JOG = 1ULL << 4, - SPRINT = 1ULL << 5, - JUMP = 1ULL << 6, - LAND = 1ULL << 7, - DODGE = 1ULL << 8, - COMBAT = 1ULL << 9, - LIGHT_ATTACK = 1ULL << 10, - SPELL = 1ULL << 11, - SKILL = 1ULL << 12, - SKILL2 = 1ULL << 13, - ANCIENT_THROW = 1ULL << 14, - MAPHELP = 1ULL << 15, - POTION = 1ULL << 16, - STOP = 1ULL << 17, - HIT = 1ULL << 18, - BROOM_RIDE = 1ULL << 19, - MOUNT_B = 1ULL << 20, - DISMOUNT = 1ULL << 21, - RUSH = 1ULL << 22, - THROW_ROCK = 1ULL << 23, - BACKHAND_SWING = 1ULL << 24, - SWING = 1ULL << 25, - SLAM = 1ULL << 26, - BLINK = 1ULL << 27, + IDLEBREAK = 1ULL << 1, + IDLE_TURN = 1ULL << 2, + MOVE = 1ULL << 3, + WALK = 1ULL << 4, + JOG = 1ULL << 5, + SPRINT = 1ULL << 6, + JUMP = 1ULL << 7, + LAND = 1ULL << 8, + DODGE = 1ULL << 9, + COMBAT = 1ULL << 10, + LIGHT_ATTACK = 1ULL << 11, + SPELL = 1ULL << 12, + SKILL = 1ULL << 13, + SKILL2 = 1ULL << 14, + ANCIENT_THROW = 1ULL << 15, + MAPHELP = 1ULL << 16, + POTION = 1ULL << 17, + STOP = 1ULL << 18, + HIT = 1ULL << 19, + BROOM_RIDE = 1ULL << 20, + MOUNT_B = 1ULL << 21, + DISMOUNT = 1ULL << 22, + RUSH = 1ULL << 23, + THROW_ROCK = 1ULL << 24, + BACKHAND_SWING = 1ULL << 25, + SWING = 1ULL << 26, + SLAM = 1ULL << 27, + BLINK = 1ULL << 28, END }; NS_END diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 2290ce0f2..11958b317 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -94,6 +94,7 @@ class ENGINE_DLL CModel final : public CComponent HRESULT Ready_Materials(const aiScene* pAIScene, const _char* pModelFilePath); HRESULT Ready_Materials_FromFile(const aiScene* pAIScene, const _char* pModelFilePath); HRESULT Ready_Materials_Independent(MODEL eType, const aiScene* pAIScene, const _char* pModelFilePath); + HRESULT Ready_Materials_FromFile_Anim(const aiScene* pAIScene, const _char* pModelFilePath); HRESULT Ready_Animations(const aiScene* pAIScene); HRESULT Ready_Bones(const aiNode* pAINode, _int iParentIndex); // 바이너리 diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h index 82307f3cd..86e60e4e0 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -4,7 +4,7 @@ NS_BEGIN(STATEANIM) enum ESTATE { - IDLE,IDLE_AIM, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD, IDLE_COMBAT_TURN_BWD,IDLE_BREAK1,IDLE_BREAK2,IDLE_BREAK3,IDLE_BREAK4, + IDLE,IDLE_AIM, IDLE_TURN_L, IDLE_TURN_R, IDLE_TURN_BWD, IDLE_COMBAT_TURN_BWD_L, IDLE_COMBAT_TURN_BWD_R,IDLE_BREAK1,IDLE_BREAK2,IDLE_BREAK3,IDLE_BREAK4, MOVE, WALK, WALK_FWD,WALK_RIGHT,WALK_LEFT, WALK_BWD,WALK_START,WALK_STOP, JOG,JOG_START, JOG_FWD, JOG_RIGHT, JOG_LEFT, JOG_BWD, JOG_STOP, JOG_AIM_LEFT, JOG_AIM_RIGHT, JOG_AIM_BWD, JOG_AIM_STOP_L, JOG_AIM_STOP_R, JOG_AIM_STOP_BWD,JOG_LEFT_TURN,JOG_RIGHT_TURN, @@ -13,6 +13,7 @@ enum ESTATE LAND, DODGE,DODGE_BLINK, DODGE_LEFT, DODGE_RIGHT, COMBAT, LIGHT_ATTACK, SPELL, SKILL, SKILL2, + ATTACK_END, MAPHELP,POTION, ACCIO,DESCENDO,DIFFINDO,DEPULSO,LUMOS,LUMOS_STOP,DISILLUSION_ENTER,DISILLUSION_EXIT, ANCIENT_THROW, SPELL_FAIL, diff --git a/Jusin154_Team3D/Engine/Public/Unit.h b/Jusin154_Team3D/Engine/Public/Unit.h index 041e61d9a..d67d5249d 100644 --- a/Jusin154_Team3D/Engine/Public/Unit.h +++ b/Jusin154_Team3D/Engine/Public/Unit.h @@ -18,6 +18,8 @@ class ENGINE_DLL CUnit abstract : public CContainerObject _float fRatio = 0.f; _uint AnimIndex = 0; function Callback; + _bool bKeep = { false }; + _bool bExecuted = { false }; }; protected: CUnit(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); @@ -85,7 +87,7 @@ class ENGINE_DLL CUnit abstract : public CContainerObject protected: HRESULT Ready_Components(void*pArg); void Play_Event(); - void Add_Event(_uint AnimIndex, function Callback, _float fRatio = 0.f); + void Add_Event(_uint AnimIndex, function Callback, _float fRatio = 0.f, _bool bKeep = false); public: virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE; virtual void Free() override;