From 3aac1a0dc0f3ec11f40c8f8f1cefea131b2213f1 Mon Sep 17 00:00:00 2001 From: hyunbin14 Date: Tue, 9 Dec 2025 11:32:09 +0900 Subject: [PATCH] =?UTF-8?q?[Fix]=20=EA=B3=A0=EB=B8=94=EB=A6=B0=20=EC=83=81?= =?UTF-8?q?=ED=83=9C=20=EC=88=98=EC=A0=95=20[Fix]=20=EA=B3=A0=EB=B8=94?= =?UTF-8?q?=EB=A6=B0=20=EC=8A=A4=ED=8E=99=ED=84=B0=20=EC=88=98=EC=A0=95=20?= =?UTF-8?q?[Add]=20=EA=B3=A0=EB=B8=94=EB=A6=B0=20=EB=8F=84=EB=81=BC=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Jusin154_Team3D/Client/Default/Client.vcxproj | 2 + .../Client/Default/Client.vcxproj.filters | 27 ++- Jusin154_Team3D/Client/Private/Goblin.cpp | 13 +- .../Client/Private/Goblin_BattleAxe.cpp | 180 ++++++++++++++++ .../Client/Private/Goblin_Dagger.cpp | 2 +- .../Client/Private/Goblin_Spector.cpp | 198 +++++------------- .../Client/Private/Goblin_States.cpp | 90 ++++++-- .../Client/Private/Level_GamePlay.cpp | 4 +- Jusin154_Team3D/Client/Private/Loader.cpp | 13 +- Jusin154_Team3D/Client/Private/Player.cpp | 1 + .../Client/Private/Player_States.cpp | 14 +- Jusin154_Team3D/Client/Private/Troll.cpp | 2 + .../Client/Private/Troll_States.cpp | 33 +-- Jusin154_Team3D/Client/Public/Goblin.h | 15 +- .../Client/Public/Goblin_BattleAxe.h | 48 +++++ .../Client/Public/Goblin_Spector.h | 29 ++- Jusin154_Team3D/Client/Public/Player.h | 1 + .../SK_WPN_GOB_BattleAxe01.bin | 3 + .../Goblin_Dagger/SK_WPN_GOB_SmallSword.bin | 3 + .../ShaderFiles/Shader_VtxAnimMesh.hlsl | 14 +- Jusin154_Team3D/Editor/Private/Loader.cpp | 4 +- Jusin154_Team3D/Engine/Private/Model.cpp | 6 +- Jusin154_Team3D/Engine/Public/Model.h | 2 +- Jusin154_Team3D/Engine/Public/State.h | 2 +- 24 files changed, 484 insertions(+), 222 deletions(-) create mode 100644 Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp create mode 100644 Jusin154_Team3D/Client/Public/Goblin_BattleAxe.h create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_BattleAxe/SK_WPN_GOB_BattleAxe01.bin create mode 100644 Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Dagger/SK_WPN_GOB_SmallSword.bin diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index 06ac4c4f5..a2d089788 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -168,6 +168,7 @@ call Update_Resources.bat + @@ -314,6 +315,7 @@ call Update_Resources.bat + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index fd4ebf99e..37c0a6641 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -424,13 +424,16 @@ 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Mage - - 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior - 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior + + + 02.GameObjects\Item\Goblin_BattleAxe + @@ -909,6 +912,9 @@ {234b3dd8-4ec9-4e81-ac7f-4eacb8f53780} + + {c770aac9-12b1-45f0-a64f-fc7819921e86} + @@ -1319,15 +1325,9 @@ 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Mage - - 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior - 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Mage - - 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior - 02.GameObjects\UI\GamePlay_Canvas\Enemy_Penel\Enemy_HpBar @@ -1342,6 +1342,15 @@ 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior + + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior + + + 02.GameObjects\Item\Goblin_BattleAxe + diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index 0b33cbbe3..cfc07b2f0 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -3,6 +3,7 @@ #include "GameInstance.h" #include "Goblin_Dagger.h" +#include "Goblin_Spector.h" #include "Effect_Container.h" #pragma region STATE @@ -127,7 +128,6 @@ void CGoblin::Late_Update(_float fTimeDelta) HRESULT CGoblin::Render() { - if (!m_bVisible) return S_OK; if (FAILED(Bind_ShaderResources())) { @@ -294,10 +294,17 @@ HRESULT CGoblin::Ready_Parts() { return E_FAIL; } - - Get_PartObject()->Set_Visible(false); + + CGoblin_Spector::GOBLIN_SPECTOR_DESC Goblin_SpectorDesc{}; + + Goblin_SpectorDesc.pParentTransform = m_pTransformCom; + + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER, &Goblin_SpectorDesc,this))) { + return E_FAIL; + } + #pragma region EFFECT /* EFFECT */ diff --git a/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp b/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp new file mode 100644 index 000000000..c83e46c8d --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Goblin_BattleAxe.cpp @@ -0,0 +1,180 @@ +#include "pch.h" +#include "Goblin_BattleAxe.h" + +#include "GameInstance.h" +#include "TrailObject.h" +#include "EffectParts.h" + +CGoblin_BattleAxe::CGoblin_BattleAxe(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CPartObject(pDevice, pContext) +{ +} + +CGoblin_BattleAxe::CGoblin_BattleAxe(const CGoblin_BattleAxe& Prototype) + : CPartObject(Prototype) +{ +} + +HRESULT CGoblin_BattleAxe::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CGoblin_BattleAxe::Initialize(void* pArg) +{ + GOBLIN_BATTLEAXE_DESC* pDesc = static_cast (pArg); + m_pSocketMatrices = pDesc->pSocketMatrices; + + if (FAILED(__super::Initialize(pArg))) { + return E_FAIL; + } + + + if (FAILED(Ready_Components())) { + return E_FAIL; + } + + return S_OK; +} + +void CGoblin_BattleAxe::Priority_Update(_float fTimeDelta) +{ + m_pModelCom->Combined_BoneMatrix(); + _matrix socketMatrix = {}; + + socketMatrix = XMLoadFloat4x4(m_pSocketMatrices); + + for (int i = 0; i < 3; ++i) { + socketMatrix.r[i] = XMVector3Normalize(socketMatrix.r[i]); + } + + m_pTransformCom->Set_WorldMatrix(socketMatrix * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr())); + +#ifdef _DEBUG + Describe_Entity(); + +#endif // _DEBUG +} + +void CGoblin_BattleAxe::Update(_float fTimeDelta) +{ + + +} + +void CGoblin_BattleAxe::Late_Update(_float fTimeDelta) +{ + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); +} + +HRESULT CGoblin_BattleAxe::Render() +{ + if (!m_pModelCom) + return S_OK; + + if (!m_bVisible) + return S_OK; + + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CGoblin_BattleAxe::Ready_Components() +{ + __super::Ready_Components(nullptr); + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Goblin_BattleAxe_Model"), + reinterpret_cast(&m_pModelCom)))) + return E_FAIL; + + /* Com_Shader */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, + reinterpret_cast(&m_pShaderCom)))) + return E_FAIL; + + return S_OK; +} + +HRESULT CGoblin_BattleAxe::Bind_ShaderResources() +{ + if (FAILED(m_pShaderCom->Bind_Matrix("g_WorldMatrix", m_pTransformCom->Get_WorldMatrixPtr()))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) { + return E_FAIL; + } + + return S_OK; +} + + +CGoblin_BattleAxe* CGoblin_BattleAxe::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CGoblin_BattleAxe* pInstance = new CGoblin_BattleAxe(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CGoblin_BattleAxe"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CGoblin_BattleAxe::Clone(void* pArg, CGameObject* pOwner) +{ + CGoblin_BattleAxe* pInstance = new CGoblin_BattleAxe(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CGoblin_BattleAxe"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CGoblin_BattleAxe::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); + +} +#ifdef _DEBUG + +void CGoblin_BattleAxe::Describe_Entity() +{ +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp b/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp index a444f8a1d..9000f9a41 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Dagger.cpp @@ -38,7 +38,7 @@ HRESULT CGoblin_Dagger::Initialize(void* pArg) void CGoblin_Dagger::Priority_Update(_float fTimeDelta) { - m_pModelCom->Combined_BoneMatrix(); + //m_pModelCom->Combined_BoneMatrix(); if (m_bAttach) { _matrix socketMatrix = {}; diff --git a/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp b/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp index f74d608e3..c30db5c0c 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp @@ -2,16 +2,9 @@ #include "Goblin_Spector.h" #include "GameInstance.h" +#include "Goblin.h" #include "Effect_Container.h" - -#pragma region STATE -#include "State_Idle.h" -#include "State_Dodge.h" -#include "State_Jump.h" -#include "State_Land.h" -#include "State_Move.h" -#include "State_Combat.h" -#pragma endregion +#include "Goblin_BattleAxe.h" #include "EffectParts.h" @@ -33,6 +26,8 @@ HRESULT CGoblin_Spector::Initialize_Prototype() HRESULT CGoblin_Spector::Initialize(void* pArg) { + GOBLIN_SPECTOR_DESC* pDesc = static_cast (pArg); + m_pParentTransformCom = pDesc->pParentTransform; if (FAILED(__super::Initialize(pArg))) return E_FAIL; @@ -42,6 +37,10 @@ HRESULT CGoblin_Spector::Initialize(void* pArg) if (FAILED(Ready_Parts())) return E_FAIL; + m_pGoblin = dynamic_cast(m_pOwner); + SAFE_ADDREF(m_pGoblin); + + m_vOriginScale = m_pTransformCom->Get_Scale(); return S_OK; } @@ -55,29 +54,37 @@ void CGoblin_Spector::Update(_float fTimeDelta) { __super::Update(fTimeDelta); - m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); + m_Offset = _float3(0.f, 0.3f, 0.f); + + _matrix Offset = XMMatrixTranslation(m_Offset.x, + m_Offset.y, m_Offset.z); + + m_pTransformCom->Set_WorldMatrix(Offset * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr())); + + if (m_pGoblin->Get_Swing()) + { + if (m_vScale.x <= 2.f) + { + m_vScale.x += fTimeDelta; + m_vScale.y += fTimeDelta; + m_vScale.z += fTimeDelta; + } + m_pTransformCom->Set_Scale(m_vScale); + m_pModelCom->Set_AnimationIndex(m_pGoblin->Get_Component()->Get_AnimIndex()); + m_pModelCom->Set_CurrentTrackPosition(m_pGoblin->Get_Component()->Get_CurrentTrackPosition()); + Get_PartObject()->Set_Visible(true); + m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); + } + else { + Get_PartObject()->Set_Visible(false); + m_vScale = { 1.f,1.f,1.f }; + m_pTransformCom->Set_Scale(m_vOriginScale); + m_pModelCom->Set_AnimationIndex(5); + } + Play_Event(); - GUI::Text("%d", m_pCharacter_Controller->IsActive()); - GUI::Text("%f %f", m_vStunTimer.x, m_vStunTimer.y); - if (true == m_pCharacter_Controller->IsActive()) { - m_pCharacter_Controller->Move(fTimeDelta); - m_vStunTimer.x = 0.f; - } - else { - if (0.f == m_vStunTimer.x) { - PSX::PxExtendedVec3 pxControlllerPos = m_pCharacter_Controller->Get_Controller()->getPosition(); - PSX::PxTransform pxTransform((_float)pxControlllerPos.x, (_float)pxControlllerPos.y + 100.f, (_float)pxControlllerPos.z); - m_pCharacter_Controller->Set_Position(XMLoadFloat3((_float3*)&pxTransform.p)); - //m_pCharacter_Controller->Move(fTimeDelta); - } - m_vStunTimer.x += fTimeDelta; - m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_Actor()->getGlobalPose()); - if (m_vStunTimer.y < m_vStunTimer.x) { - m_pRigidBody->ConvertToCCT(*m_pCharacter_Controller); - } - } #ifdef _DEBUG Describe_Entity(); #endif // _DEBUG @@ -87,31 +94,20 @@ void CGoblin_Spector::Update(_float fTimeDelta) void CGoblin_Spector::Late_Update(_float fTimeDelta) { __super::Late_Update(fTimeDelta); - if (true == m_pCharacter_Controller->IsActive()) { - m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition()); - } - else { - m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_FootPositionPxTransform()); - } - - - m_pTransformCom->LookAt_Horizontal(XMLoadFloat4(&m_vTargetPos)); m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); } HRESULT CGoblin_Spector::Render() { - if (!m_bVisible) + if (!m_bVisible || !m_pGoblin->Get_Swing()) return S_OK; - if (FAILED(Bind_ShaderResources())) { return E_FAIL; } _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); _uint iShaderPass = ENUM_CLASS(SHADER_PASS_ANIM::SPECTOR); - for (_uint i = 0; i < iNumMeshes; i++) { if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { @@ -131,68 +127,12 @@ HRESULT CGoblin_Spector::Render() } } - -#ifdef _DEBUG - if (true == m_pCharacter_Controller->IsActive()) { - if (FAILED(m_pCharacter_Controller->Render())) { - return E_FAIL; - } - } - else { - if (FAILED(m_pRigidBody->Render())) { - return E_FAIL; - } - } -#endif return S_OK; } -_vector CGoblin_Spector::Get_LockOnPos() -{ - if (nullptr != m_pCharacter_Controller && true == m_pCharacter_Controller->IsActive()) { - return m_pCharacter_Controller->Get_Position(); - } - else if (nullptr != m_pRigidBody) { - return m_pRigidBody->Get_Position(); - } - return Get_WorldPostion(); -} - void CGoblin_Spector::OnCollision(CGameObject* pOther, void* pDesc) { - /*if (true == m_bDead) { - return; - } - ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); - _uint iSkillType = dynamic_cast(pOther)->Get_SkillType(); - m_fHitRadius = CMyTools::Get_Direction2D(m_pTransformCom->Get_State(STATE::LOOK), XMLoadFloat4(&CollisionDesc->vHitDir)); - switch (iSkillType) - { - case ENUM_CLASS(SKILL_TYPE::DESCENDO): - m_eHitSpell = STATEANIM::KNOCKDOWN_FWD; - break; - case ENUM_CLASS(SKILL_TYPE::FLIPENDO): - m_eHitSpell = STATEANIM::TUMBLE2; - break; - case ENUM_CLASS(SKILL_TYPE::JAP): - m_eHitSpell = STATEANIM::HIT_LEVIOSO; - if (true == Get_Damage(60.f)) { - m_pFSM->Change_State(FSMSTATE::DEAD); - return; - } - break; - case ENUM_CLASS(SKILL_TYPE::LEVIOSO): - m_eHitSpell = STATEANIM::HIT_LEVIOSO; - break; - default: - m_eHitSpell = STATEANIM::KNOCKDOWN_FWD; - break; - } - if (!m_pFSM->IsEnable(FSMSTATE::BLINK)) { - m_pFSM->Change_State(FSMSTATE::HIT); - } -*/ } void CGoblin_Spector::OnHit(CGameObject* pOther, CGameObject* pCaller) @@ -217,36 +157,6 @@ HRESULT CGoblin_Spector::Ready_Components() return E_FAIL; } - { // CCT - CCharacter_Controller::Character_Controller_DESC Desc{}; - - Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR); - Desc.pTransform = m_pTransformCom; - Desc.eBodyType = ACTOR::CAPSULE; - Desc.fContactOffset = 0.001f; - Desc.fMaterial = { 1.2f, 1.0f, 0.0f }; - Desc.bAutoStepping = { false }; - Desc.fStepOffset = { 0.05f }; - Desc.fRadius = 0.6f; - Desc.fHeight = 0.7f; - Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Monster_HitReport::Create(); - Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Monster_Behavior::Create(); - Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; - Desc.fWalkableSlope = 45.f; - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_CCT_CAPSULE"), (CComponent**)&m_pCharacter_Controller, &Desc))) { - return E_FAIL; - } - } - m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION)); - { // DO - CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR); - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX"), (CComponent**)&m_pRigidBody, &Desc))) { - return E_FAIL; - } - m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor()); - } - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_GOBLIN"), (CComponent**)&m_pStat))) { return E_FAIL; } @@ -255,6 +165,18 @@ HRESULT CGoblin_Spector::Ready_Components() HRESULT CGoblin_Spector::Ready_Parts() { + + CGoblin_BattleAxe::GOBLIN_BATTLEAXE_DESC Goblin_BattleAxe_Desc{}; + + Goblin_BattleAxe_Desc.pParentTransform = m_pTransformCom; + Goblin_BattleAxe_Desc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_RightHand"); + + if (FAILED(Add_PartObject("Goblin_BattleAxe", g_iStaticLevel, nullptr, &Goblin_BattleAxe_Desc))) + { + return E_FAIL; + } + + #pragma region EFFECT /* EFFECT */ @@ -294,8 +216,6 @@ HRESULT CGoblin_Spector::Ready_Parts() #pragma endregion return S_OK; - - return S_OK; } HRESULT CGoblin_Spector::Bind_ShaderResources() @@ -331,7 +251,7 @@ CGoblin_Spector* CGoblin_Spector::Create(ID3D11Device* pDevice, ID3D11DeviceCont CGameObject* CGoblin_Spector::Clone(void* pArg, CGameObject* pOwner) { CGoblin_Spector* pInstance = new CGoblin_Spector(*this); - + pInstance->m_pOwner = pOwner; if (FAILED(pInstance->Initialize(pArg))) { MSG_BOX("Failed to Cloned : CGoblin_Spector"); @@ -344,25 +264,21 @@ void CGoblin_Spector::Free() { __super::Free(); - if (nullptr != m_pCallBack_Behavior) { - m_pCallBack_Behavior->Finalize(); - } - if (nullptr != m_pCallBack_HitReport) { - m_pCallBack_HitReport->Finalize(); - } - - SAFE_RELEASE(m_pCharacter_Controller); - SAFE_RELEASE(m_pRigidBody); SAFE_RELEASE(m_pSmoke); SAFE_RELEASE(m_pGoblin_Particle); SAFE_RELEASE(m_pGoblin_Particle2); - Safe_Delete(m_pCallBack_Behavior); - Safe_Delete(m_pCallBack_HitReport); + SAFE_RELEASE(m_pGoblin); } #ifdef _DEBUG void CGoblin_Spector::Describe_Entity() { + + GUI::Begin("GoblinSpector"); + _float3 vScale = m_pTransformCom->Get_Scale(); + GUI::DragFloat3("Scale", (_float*)&vScale); + + GUI::End(); } #endif // _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Goblin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_States.cpp index 0fabc287b..24383603f 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_States.cpp @@ -31,7 +31,7 @@ void CGoblin::Behavior_IdleEnter() HRESULT CGoblin::Behavior_IdleExitCheck() { - if (m_fTargetDistance <= 20.f && m_fTargetDistance >=1.f) + if (m_fTargetDistance <= 20.f && m_fTargetDistance != 0.f) { m_vOriginPos = m_pTransformCom->Get_State(STATE::POSITION); m_pFSM->Change_State(FSMSTATE::MOVE); @@ -49,21 +49,67 @@ void CGoblin::Behavior_MoveEnter() { pair<_uint, _bool> pairAnimInfo = {}; m_pFSM->Enable_State(FSMSTATE::MOVE); - + m_bLookAt = true; m_pFSM->Enable_State(FSMSTATE::JOG); - - pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; - - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - } -HRESULT CGoblin::Behavior_MoveExitCheck() +HRESULT CGoblin::Behavior_MoveExitCheck(_float fTimeDelta) { pair<_uint, _bool> pairAnimInfo = {}; _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); - if (m_fTargetDistance <= 15.f && m_fTargetDistance >=1.f) + + if (m_fTargetDistance >= 6.f) + { + pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + } + else { + if (!m_bFirstMove) + { + _uint Rand = m_pGameInstance->Real_Random_Int(0, 3); + + switch (Rand) + { + case 0: + pairAnimInfo = m_Animation[STATEANIM::JOG_112_L]; + break; + case 1: + pairAnimInfo = m_Animation[STATEANIM::JOG_112_R]; + break; + case 2: + if (iCurrAnimIndex == m_Animation[STATEANIM::JOG_90_R].first) { + pairAnimInfo = m_Animation[STATEANIM::JOG_112_R]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_90_L]; + } + break; + case 3: + if (iCurrAnimIndex == m_Animation[STATEANIM::JOG_90_L].first) { + pairAnimInfo = m_Animation[STATEANIM::JOG_112_L]; + } + else { + pairAnimInfo = m_Animation[STATEANIM::JOG_90_R]; + } + break; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 0.5f, true); + + m_bFirstMove = true; + m_fMoveTime = 0.f; + return S_OK; + } + m_fMoveTime += fTimeDelta; + + if (m_fMoveTime >= 2.5f) + { + m_bFirstMove = false; + m_fMoveTime = 0.f; + } + } + + if (m_fTargetDistance <= 15.f && m_fTargetDistance >= 6.f && m_fTargetDistance !=0.f) m_pFSM->Change_State(FSMSTATE::COMBAT); return E_FAIL; @@ -96,7 +142,7 @@ HRESULT CGoblin::Behavior_CombatExitCheck(_float fTimeDelta) return E_FAIL; } - if (m_fTargetDistance <= 7.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::SWING)] <= 0.f) + if (m_fTargetDistance <= 6.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::SWING)] <= 0.f) { m_pFSM->Change_State(FSMSTATE::SWING); } @@ -126,6 +172,7 @@ void CGoblin::Behavior_SwingEnter() 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)]; @@ -133,11 +180,16 @@ void CGoblin::Behavior_SwingEnter() [this]() {m_bStep = false; }, 0.2f); + Add_Event(pairAnimInfo.first, + [this]() {m_bSwing = true; }, + 0.05f); + Add_Event(pairAnimInfo.first, [&]() { m_bLookAt = true; m_bStep = true; + m_bSwing = false; m_pFSM->Change_State(FSMSTATE::SHUFFLE); }, - 0.4f); + 0.45f); } HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta) @@ -146,7 +198,7 @@ HRESULT CGoblin::Behavior_SwingExitCheck(_float fTimeDelta) _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); if (m_pFSM->IsEnable(FSMSTATE::SWING) && m_bStep) { - _float fDesiredRange = 1.f; + _float fDesiredRange = 2.f; _float dist = m_fTargetDistance; if (dist > fDesiredRange) @@ -228,7 +280,7 @@ void CGoblin::Behavior_BlinkEnter() _matrix rot = XMMatrixRotationY(randAngleRad); _vector offsetDir = XMVector3TransformNormal(vPlayerLook, rot); - _float randDist = m_pGameInstance->Real_Random_Float(1.f, 1.5f); + _float randDist = m_pGameInstance->Real_Random_Float(5.f, 5.5f); _vector vFinalPos = vPlayerPos + offsetDir * randDist; @@ -290,7 +342,7 @@ void CGoblin::Behavior_ShuffleEnter() Add_Event(pairAnimInfo.first, [this]() { m_pFSM->Change_State(FSMSTATE::COMBAT); }, - 0.2f); + 0.3f); } HRESULT CGoblin::Behavior_ShuffleExitCheck(_float fTimeDelta) @@ -456,7 +508,7 @@ void CGoblin::Add_FSM() CState_Move::STATE_MOVE_DESC Desc{}; Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); }; - Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(fTimedelta); }; Desc.funcExitEvent = [this]() { Behavior_MoveExit(); }; Desc.funcPriorityUpdate = nullptr; Desc.funcLateUpdate = nullptr; @@ -559,6 +611,10 @@ void CGoblin::Set_Anim() m_Animation[STATEANIM::JOG_FWD] = { 147,true }; // 147 m_Animation[STATEANIM::JOG_START] = { 157,false }; m_Animation[STATEANIM::JOG_BWD] = { 146,false }; + m_Animation[STATEANIM::JOG_112_L] = { 148,true }; + m_Animation[STATEANIM::JOG_112_R] = { 152,true }; + m_Animation[STATEANIM::JOG_90_L] = { 151,true }; + m_Animation[STATEANIM::JOG_90_R] = { 155,true }; m_Animation[STATEANIM::SHUFFLE1] = { 203,false }; m_Animation[STATEANIM::SHUFFLE2] = { 204,false }; @@ -654,5 +710,9 @@ void CGoblin::Set_Anim() //Jog 112도 L 148 //Jog 112도 R 152 + // Jog 90 L 151 + // Jog 90 R 155 + + } diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index 1f35ba9ec..b72f83e74 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -385,9 +385,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_Monster() if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { return E_FAIL; } - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { - return E_FAIL; - } + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index 04b5f360f..52821f460 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -18,6 +18,7 @@ #include "Troll_Rock.h" #include "Goblin_Dagger.h" #include "Wand.h" +#include "Goblin_BattleAxe.h" #pragma region ACTOR @@ -1360,7 +1361,7 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Troll_Weapon_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Object/SubTroll_Weapon/SK_WPN_Troll_Club07.fbx", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::PBR_ANIM, "../Bin/Resources/Models/Object/SubTroll_Weapon/SK_WPN_Troll_Club07.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Troll_Rock_Big_Model"), @@ -1368,7 +1369,11 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Dagger_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Goblin_Dagger/Goblin_Dagger.bin", XMMatrixScaling(0.0002f, 0.0002f, 0.0002f) * XMMatrixRotationX(XMConvertToRadians(90.f)) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Goblin_Dagger/SK_WPN_GOB_SmallSword.bin", XMMatrixIdentity())))) + return E_FAIL; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_BattleAxe_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Goblin_BattleAxe/SK_WPN_GOB_BattleAxe01.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) return E_FAIL; @@ -1905,6 +1910,10 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Dagger::Create(m_pDevice, m_pContext)))) return E_FAIL; + /* For.Prototype_GameObject_Goblin_BattleAxe */ + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_BattleAxe::Create(m_pDevice, m_pContext)))) + return E_FAIL; + /* For.Prototype_GameObject_Broom */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CBroom::Create(m_pDevice, m_pContext)))) return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index 0b07dca3d..facfcf06c 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -571,6 +571,7 @@ void CPlayer::Describe_Entity() GUI::Text("AnimTrack %.2f", m_pModelCom->Get_CurrentTrackPosition()); GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio()); + GUI::Text("AnimSpeed %.2f", m_pModelCom->Get_AnimSpeed()); GUI::Checkbox("Render", &m_bVisible); diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index dd913a3b7..77f672eed 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -518,6 +518,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta) } else { pairAnimInfo = m_Animation[STATEANIM::JOG_LEFT]; + m_fAnimSpeed = 1.2f; } } } @@ -525,7 +526,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta) pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; } - m_fAmount = 0.5f; + m_fAmount = 0.3f; m_bRatio = true; } else { @@ -550,6 +551,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta) } else { pairAnimInfo = m_Animation[STATEANIM::JOG_RIGHT]; + m_fAnimSpeed = 1.2f; } } } @@ -557,7 +559,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta) pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; } - m_fAmount = 0.5f; + m_fAmount = 0.3f; m_bRatio = true; } } @@ -575,6 +577,7 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta) else { pairAnimInfo = m_Animation[STATEANIM::JOG_BWD]; + m_fAnimSpeed = 1.2f; } } @@ -586,12 +589,13 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta) pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; } - m_fAmount = 0.5f; + m_fAmount = 0.3f; m_bRatio = true; } - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount, m_bRatio); + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, m_fAmount, m_bRatio, m_fAnimSpeed); m_fAmount = 1.f; + m_fAnimSpeed = 1.f; } } @@ -607,11 +611,13 @@ HRESULT CPlayer::Behavior_MoveExitCheck(_float fTimeDelta) m_pFSM->Enable_State(FSMSTATE::STOP); if (m_pFSM->IsEnable(FSMSTATE::WALK)) { m_bWalkToggle = false; + m_pFSM->Disable_State(FSMSTATE::WALK); pairAnimInfo = m_Animation[STATEANIM::WALK_STOP]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } else if (m_pFSM->IsEnable(FSMSTATE::SPRINT)) { m_bSprintToggle = false; + m_pFSM->Disable_State(FSMSTATE::SPRINT); pairAnimInfo = m_Animation[STATEANIM::JOG_STOP]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index 97ea4331f..0d7965737 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -106,6 +106,8 @@ void CTroll::Update(_float fTimeDelta) for (_uint i = 0; i < ENUM_CLASS(TROLL_SKILL::END); i++) m_fSkillCoolTime[i] = max(0.f, m_fSkillCoolTime[i] - fTimeDelta); + + } diff --git a/Jusin154_Team3D/Client/Private/Troll_States.cpp b/Jusin154_Team3D/Client/Private/Troll_States.cpp index 15a7c80be..b77ccabb3 100644 --- a/Jusin154_Team3D/Client/Private/Troll_States.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_States.cpp @@ -267,15 +267,18 @@ HRESULT CTroll::Behavior_RushExitCheck(_float fTimeDelta) } if (iCurrAnimIndex == m_Animation[STATEANIM::RUSH_END].first) { - 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); + if (m_fDegree >= 90.f) + { + 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); + Add_Event(pairAnimInfo.first, + [this]() {m_bLookAt = true; }, + 0.3f); + } } if (m_pModelCom->IsFinishedAnim()) @@ -346,8 +349,8 @@ void CTroll::Behavior_SwingEnter() m_pFSM->Enable_State(FSMSTATE::SWING); pairAnimInfo = m_Animation[STATEANIM::SWING_FWD]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SWING)]; @@ -382,8 +385,8 @@ void CTroll::Behavior_SlamEnter() m_pFSM->Enable_State(FSMSTATE::SLAM); pairAnimInfo = m_Animation[STATEANIM::SLAM]; - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)]; @@ -414,8 +417,10 @@ 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); + m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::BACKHAND_SWING)]; @@ -622,10 +627,10 @@ void CTroll::Set_Anim() m_Animation[STATEANIM::IDLE] = { 16,true }; 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 }; - m_Animation[STATEANIM::IDLE_BREAK4] = { 143,false }; + m_Animation[STATEANIM::IDLE_BREAK1] = { 11,false }; // 땅2번구르기 + m_Animation[STATEANIM::IDLE_BREAK2] = { 141,false }; // 방망이 + m_Animation[STATEANIM::IDLE_BREAK3] = { 14,false }; // 땅구르기 + m_Animation[STATEANIM::IDLE_BREAK4] = { 143,false }; // 소리지르기 m_Animation[STATEANIM::WALK_FWD] = { 22,true }; diff --git a/Jusin154_Team3D/Client/Public/Goblin.h b/Jusin154_Team3D/Client/Public/Goblin.h index 4cb6d514e..9b2f9ada5 100644 --- a/Jusin154_Team3D/Client/Public/Goblin.h +++ b/Jusin154_Team3D/Client/Public/Goblin.h @@ -29,7 +29,7 @@ class CGoblin final : public CMonster virtual _vector Get_LockOnPos() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override; virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override; - + _bool Get_Swing() { return m_bSwing; } private: CCallBack_Monster_Behavior* m_pCallBack_Behavior = { nullptr }; @@ -68,18 +68,21 @@ class CGoblin final : public CMonster _float m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::END)] = {}; _float m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::END)] = { 5.f,2.f,15.f }; - _bool m_bStep = { false }; - _float m_fTpTime = {}; - _float m_fAirTime = {}; + _bool m_bStep = { false }; + _float m_fTpTime = {}; + _float m_fAirTime = {}; _vector m_vOriginPos = {}; - _float m_fLength = {}; + _float m_fLength = {}; + _bool m_bSwing = { false }; + _float m_fMoveTime = {}; + _bool m_bFirstMove = {}; void Behavior_IdleEnter(); HRESULT Behavior_IdleExitCheck(); void Behavior_IdleExit(); void Behavior_MoveEnter(); - HRESULT Behavior_MoveExitCheck(); + HRESULT Behavior_MoveExitCheck(_float fTimeDelta); void Behavior_MoveExit(); void Behavior_CombatEnter(); diff --git a/Jusin154_Team3D/Client/Public/Goblin_BattleAxe.h b/Jusin154_Team3D/Client/Public/Goblin_BattleAxe.h new file mode 100644 index 000000000..5f2edcb42 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Goblin_BattleAxe.h @@ -0,0 +1,48 @@ +#pragma once + +#include "Client_Define.h" +#include "PartObject.h" + +NS_BEGIN(Client) + +class CGoblin_BattleAxe final : public CPartObject +{ +public: + typedef struct tagGoblinBattleAxe : public CPartObject::PARTOBJECT_DESC + { + const _float4x4* pSocketMatrices = { }; + }GOBLIN_BATTLEAXE_DESC; +private: + CGoblin_BattleAxe(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CGoblin_BattleAxe(const CGoblin_BattleAxe& Prototype); + virtual ~CGoblin_BattleAxe() = default; + +public: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; +public: + +private: + const _float4x4* m_pSocketMatrices = { }; + CShader* m_pShaderCom = { nullptr }; + CModel* m_pModelCom = { nullptr }; + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CGoblin_BattleAxe* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)override; + virtual void Free() override; + +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Goblin_Spector.h b/Jusin154_Team3D/Client/Public/Goblin_Spector.h index 466323dd3..dc83d6452 100644 --- a/Jusin154_Team3D/Client/Public/Goblin_Spector.h +++ b/Jusin154_Team3D/Client/Public/Goblin_Spector.h @@ -5,10 +5,19 @@ #include "CallBack_Monster_Behavior.h" #include "CallBack_Monster_HitReport.h" +NS_BEGIN(Engine) +class CTransform; +NS_END + NS_BEGIN(Client) class CGoblin_Spector final : public CMonster { +public: + typedef struct tagSpector + { + CTransform* pParentTransform = { nullptr }; + }GOBLIN_SPECTOR_DESC; private: CGoblin_Spector(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CGoblin_Spector(const CGoblin_Spector& Prototype); @@ -19,19 +28,18 @@ class CGoblin_Spector final : public CMonster virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; - virtual _vector Get_LockOnPos() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override; virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override; private: - CCallBack_Monster_Behavior* m_pCallBack_Behavior = { nullptr }; - CCallBack_Monster_HitReport* m_pCallBack_HitReport = { nullptr }; - - CCharacter_Controller* m_pCharacter_Controller = { nullptr }; - CRigidBody_Dynamic* m_pRigidBody = { nullptr }; - _float2 m_vStunTimer = { 0.f, 4.f }; + class CGoblin* m_pGoblin = { nullptr }; + CTransform* m_pParentTransformCom = { nullptr }; _uint iIndex; + _float3 m_Offset = {}; + _float3 m_vOriginScale = {}; + _float3 m_vScale = { 1.f, 1.f, 1.f }; + class CEffectParts* m_pSmoke = { nullptr }; @@ -54,6 +62,13 @@ class CGoblin_Spector final : public CMonster #endif // _DEBUG + + _bool m_bStep = { false }; + _float m_fTpTime = {}; + _float m_fAirTime = {}; + _vector m_vOriginPos = {}; + _float m_fLength = {}; + }; NS_END diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index dfe9334c8..ec5292d95 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -105,6 +105,7 @@ class CPlayer final : public CUnit _float m_fInputTime = {}; _bool m_bRatio = { false }; _bool m_bAim = { false }; + _float m_fAnimSpeed = {}; HRESULT InputAction(); HRESULT InputMove(); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_BattleAxe/SK_WPN_GOB_BattleAxe01.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_BattleAxe/SK_WPN_GOB_BattleAxe01.bin new file mode 100644 index 000000000..013c53717 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_BattleAxe/SK_WPN_GOB_BattleAxe01.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c3d49a44f7e1ac09e7f6515f5bb9536ace861d91f48f1363f4dd1c843ddb6efa +size 146389 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Dagger/SK_WPN_GOB_SmallSword.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Dagger/SK_WPN_GOB_SmallSword.bin new file mode 100644 index 000000000..470f226db --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Goblin_Dagger/SK_WPN_GOB_SmallSword.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40d27f6e472f28a616616df2d40d24749875230c9d16c2d2a37d5df156d9528d +size 86496 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index 49ad47556..53dc21f00 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -472,20 +472,14 @@ PS_OUT PS_SPECTOR_MAIN(PS_IN In) float4 vMtrlDiffuse = g_EmissiveTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); float4 vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); - //if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_TRANSMISSION], true)) - //{ - // float4 vTransmission = g_TransmissionTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); - // vMtrlDiffuse *= vTransmission; - //} - //if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_EMISSIVE], true)) - //{ - // float4 vEmissive = g_EmissiveTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord); - // vMtrlDiffuse += vEmissive; - //} if (vMtrlDiffuse.a < 0.2f) { discard; } + if (vMtrlDiffuse.r > 0.3f) + { + vMtrlDiffuse.rgb *= float3(2.f, 1.f, 1.f); + } float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, AnisoTropy_BLUR_Sampler, In.vTexcoord); float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal); diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index ad8da2d71..b0150972c 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -2030,8 +2030,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_SK_WPN_Troll_Club07_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::ANIM_LOCAL, "C:/MeshTable\\Game\\RiggedObjects\\Props\\Weapons\\Troll\\SK_WPN_Troll_Club07.fbx", XMMatrixIdentity())))) { + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_SK_WPN_GOB_SmallSword_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM_LOCAL, "C:/MeshTable\\Game\\RiggedObjects\\Props\\Weapons\\Goblins\\SK_WPN_GOB_SmallSword.fbx", XMMatrixIdentity())))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 4effff56e..55b1fedff 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -307,7 +307,7 @@ _bool CModel::Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform) return m_bIsFinishedAnim; } -void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop, _float fAmount, _bool bRatio) +void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop, _float fAmount, _bool bRatio, _float fAnimSpeed) { if (m_iCurrentAnimIndex == iIndex) return; @@ -324,7 +324,7 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop, _float fAmount, _boo m_iPreAnimIndex = m_iCurrentAnimIndex; m_Animations[m_iCurrentAnimIndex]->Depart_Animation(); - m_Animations[m_iCurrentAnimIndex]->ResetRootMotion(); + m_Animations[m_iCurrentAnimIndex]->Set_AnimSpeed(1.f); } m_fBlendTime = 0.f; @@ -336,7 +336,7 @@ void CModel::Set_AnimationIndex(_uint iIndex, _bool isLoop, _float fAmount, _boo m_bRatio = bRatio; m_Animations[m_iCurrentAnimIndex]->Depart_Animation(); - m_Animations[m_iCurrentAnimIndex]->ResetRootMotion(); + m_Animations[m_iCurrentAnimIndex]->Set_AnimSpeed(fAnimSpeed); } else { diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 11958b317..9e0d8694c 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -35,7 +35,7 @@ class ENGINE_DLL CModel final : public CComponent _bool Play_Animation(_float fTimeDelta, class CTransform* pTransform = nullptr); // 애니메이션에 델타타임을 넣어줌 _bool Play_Anim(_float fTimeDelta, CTransform* pTransform); _bool Play_Dual_Anim(_float fTimeDelta, CTransform* pTransform); - void Set_AnimationIndex(_uint iIndex, _bool isLoop = true, _float fAmount = 1.f, _bool bRatio = false); + void Set_AnimationIndex(_uint iIndex, _bool isLoop = true, _float fAmount = 1.f, _bool bRatio = false,_float fAnimSpeed = 1.f); void Set_Second_AnimationIndex(_uint iIndex, _uint BoneIndex, _bool isLoop = false); _bool IsFinishedAnim() const { return m_bIsFinishedAnim; } _bool IsFinishedSecondAnim() const { return m_bIsSecondFinishedAnim; } diff --git a/Jusin154_Team3D/Engine/Public/State.h b/Jusin154_Team3D/Engine/Public/State.h index 3a6446810..c8c63d440 100644 --- a/Jusin154_Team3D/Engine/Public/State.h +++ b/Jusin154_Team3D/Engine/Public/State.h @@ -7,7 +7,7 @@ enum ESTATE 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, + 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,JOG_112_L,JOG_112_R,JOG_90_L,JOG_90_R, SPRINT, JUMP,JUMP_JOG,JUMP_SPRINT, LAND,