diff --git a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index c2d688ad7..2cd0683e4 100644 --- a/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Client/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1270,7 +1270,7 @@ PS_OUT PS_Camera_LockOn(PS_IN In) Color.a = tex1 * 0.3f; - if (g_iHover != 0) + if (g_iHover == 0) { float4 tex2 = g_Texture1.Sample(ClampSampler, maskuv); diff --git a/Jusin154_Team3D/Client/Default/Client.cpp b/Jusin154_Team3D/Client/Default/Client.cpp index 774dc7394..faf8b9092 100644 --- a/Jusin154_Team3D/Client/Default/Client.cpp +++ b/Jusin154_Team3D/Client/Default/Client.cpp @@ -83,6 +83,15 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, if (FAILED(pGameInstance->Add_Timer(TEXT("Timer_Present")))) { return E_FAIL; } + if (FAILED(pGameInstance->Add_Timer(TEXT("Timer_Picking")))) { + return E_FAIL; + } + if (FAILED(pGameInstance->Add_Timer(TEXT("Timer_PhysX")))) { + return E_FAIL; + } + if (FAILED(pGameInstance->Add_Timer(TEXT("Timer_Level")))) { + return E_FAIL; + } if (FAILED(pGameInstance->Add_Timer(TEXT("Timer_FrameCount")))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj b/Jusin154_Team3D/Client/Default/Client.vcxproj index e9bd1f049..d9164560a 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj @@ -160,7 +160,7 @@ call Update_Resources.bat - + @@ -172,8 +172,10 @@ call Update_Resources.bat + + @@ -182,6 +184,8 @@ call Update_Resources.bat + + @@ -296,7 +300,10 @@ call Update_Resources.bat + + + @@ -311,7 +318,7 @@ call Update_Resources.bat - + @@ -324,8 +331,10 @@ call Update_Resources.bat + + @@ -334,6 +343,8 @@ call Update_Resources.bat + + @@ -450,7 +461,10 @@ call Update_Resources.bat + + + diff --git a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters index df8efd929..426f212dc 100644 --- a/Jusin154_Team3D/Client/Default/Client.vcxproj.filters +++ b/Jusin154_Team3D/Client/Default/Client.vcxproj.filters @@ -389,7 +389,7 @@ 02.GameObjects\UI\Screen\Logo\Logo_Text - 04.Mechanic\State\State_Combat\Dead + 04.Mechanic\State\State_Combat\State_Dead 02.GameObjects\UI\GamePlay_Canvas\Enemy_Penel @@ -406,15 +406,16 @@ 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Mage + + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Spector 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior - - 02.GameObjects\Item\Goblin_BattleAxe - 02.GameObjects\PhysX\CallBack\Behavior\Player @@ -433,9 +434,12 @@ 02.GameObjects\PhysX\CallBack\HitReport\Player - + 02.GameObjects\PhysX\CallBack\HitReport\Monster\Troll + + 03.InfoInstance\03.InteractiveInfo + 02.GameObjects\Environment\04.Land @@ -445,6 +449,43 @@ 02.GameObjects\Environment\03.MapElement\Lake + + 02.GameObjects\Item\Goblin_Axe + + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior + + + 02.GameObjects\Effect\MonsterEffect\Goblin_Protego + + + 02.GameObjects\Effect\MonsterEffect\Troll_Nomal_Smoke + + + 02.GameObjects\Effect\MonsterEffect\Troll_Rush_Hit + + + 02.GameObjects\Effect\MonsterEffect\TrollSwing + + + + 02.GameObjects\Effect\Effects\WandEnd + + + 02.GameObjects\Environment\04.Land + + + 02.GameObjects\Environment\05.Unified + + + 02.GameObjects\Environment\03.MapElement\Lake + + + 02.GameObjects\Item\Goblin_Axe + + + 04.Mechanic\State\Troll_Combat\Troll_State_Stun + @@ -902,9 +943,6 @@ {0ed6a11e-5d22-4b9f-a39c-f2319c27caf4} - - {81add99f-7450-4730-8d3f-bf1de06b2b8d} - {5973b96c-42c3-4cda-9627-f741e12124cd} @@ -923,6 +961,21 @@ {234b3dd8-4ec9-4e81-ac7f-4eacb8f53780} + + {f174b2c8-8e1e-4922-9030-6b737be74117} + + + {e36cd3e4-7cd6-4a64-b343-363e83f1b2a4} + + + {60a4bad6-39d5-4c4a-8513-811ccb7ecc57} + + + {e78334fb-6e32-41fc-a856-865b91c9d8c6} + + + {7bd8bc85-e56c-40fc-b1a6-6e09da46897f} + {3f4bde42-c5a0-4c7a-8dde-23e0725534c9} @@ -944,6 +997,9 @@ {e12337a6-7563-4615-a8d2-a2e2e1ba1ca8} + + {14ad0431-680b-4c8b-93d7-601aee5ce435} + {ec267143-0bc1-4765-b8dc-6cccc50385d7} @@ -953,8 +1009,23 @@ {a357d495-f74d-4aec-919e-0f6bac3e0e7b} + + {e666a8b4-c92e-48ee-b63b-40d852b27b06} + + + {14ad0431-680b-4c8b-93d7-601aee5ce435} + + + {1d1dc743-5cf2-4b8f-a80e-16b16437c7aa} + + + {81add99f-7450-4730-8d3f-bf1de06b2b8d} + + + {2e2a53dc-9ea6-427f-88b3-d8857193d432} + - + 99.Define\00.DEFAULT @@ -1340,7 +1411,7 @@ 02.GameObjects\Item\Broom - 04.Mechanic\State\State_Combat\Dead + 04.Mechanic\State\State_Combat\State_Dead 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Mage @@ -1360,15 +1431,39 @@ 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\Effect\MonsterEffect\Goblin_Protego + + + 02.GameObjects\Effect\MonsterEffect\Troll_Nomal_Smoke + + + 02.GameObjects\Effect\MonsterEffect\Troll_Rush_Hit + + + 02.GameObjects\Effect\MonsterEffect\TrollSwing + + + + 02.GameObjects\Effect\Effects\WandEnd + + + 04.Mechanic\State\Troll_Combat\Troll_State_Stun + + + 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior 02.GameObjects\NPC\Hostile\Monster\Goblin\Goblin_Warrior - - 02.GameObjects\Item\Goblin_BattleAxe - 02.GameObjects\PhysX\CallBack\Behavior\Player @@ -1387,7 +1482,7 @@ 02.GameObjects\PhysX\CallBack\HitReport\Player - + 02.GameObjects\PhysX\CallBack\HitReport\Monster\Troll @@ -1399,11 +1494,16 @@ 02.GameObjects\Environment\03.MapElement\Lake + + 02.GameObjects\Item\Goblin_Axe + + + 03.InfoInstance\03.InteractiveInfo + 99.Define\00.DEFAULT - - \ No newline at end of file + \ No newline at end of file diff --git a/Jusin154_Team3D/Client/Private/Bombard.cpp b/Jusin154_Team3D/Client/Private/Bombard.cpp index b0869da87..57bb92e3a 100644 --- a/Jusin154_Team3D/Client/Private/Bombard.cpp +++ b/Jusin154_Team3D/Client/Private/Bombard.cpp @@ -5,6 +5,7 @@ #include "EffectParts.h" #include "Wand.h" #include "Player.h" +#include "InfoInstance.h" CBombard::CBombard(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CEffect_Container{ pDevice, pContext } @@ -12,7 +13,8 @@ CBombard::CBombard(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) } CBombard::CBombard(const CBombard& rhs) - : CEffect_Container(rhs) + : CEffect_Container(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -66,7 +68,7 @@ void CBombard::Update(_float fTimeDelta) CTransform* pPJTransform = m_pLight_Projectile->Get_Component(); - pPJTransform->Translation(m_vCameraLook * 2.f); + pPJTransform->Translation( XMLoadFloat3(&m_vCameraLook) * m_fLinearSpeed); } @@ -110,8 +112,6 @@ HRESULT CBombard::Pre_Setting(CGameObject* pObject, void* pArg) CPartObject* pShootPt = Get_PartObject("Bombard_Shoot_Pt"); CPartObject* pCircle0 = Get_PartObject("Bombard_Circle0"); - m_vCameraLook = m_pOwner->Get_Component()->Get_State(STATE::LOOK); - pShootPt->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); m_pLight_Projectile->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); @@ -122,7 +122,26 @@ HRESULT CBombard::Pre_Setting(CGameObject* pObject, void* pArg) m_pLight_Projectile->Set_Visible(true); - // 건드린 친구들 순서대로 다 가져옴 ( 정렬은 안되어있음 ) + _vector vDirection = m_pOwner->Get_Component()->Get_State(STATE::LOOK); + XMStoreFloat3(&m_vCameraLook, vDirection); + + _vector vStartPos = pWand->Get_WorldPostion(); + XMStoreFloat4(&m_vStartPos, vStartPos); + + { /* 대상 위치 지정 */ + + m_pInfoInstance->Get_LockOnInfo(m_Info); + if (nullptr != m_Info.pUnit) { + + XMStoreFloat4(&m_vTargetPos, m_Info.pUnit->Get_LockOnPos()); + + XMStoreFloat3(&m_vCameraLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + } + else { + // 타겟이 없다면 현재위치 -> 카메라 룩벡터 * duration간 예상 이동거리 를 대상으로 지정 + XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_fLinearSpeed * 0.5f); + } + } return S_OK; diff --git a/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp b/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp index 5086f601a..c9f77e0e3 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Playable_HitReport.cpp @@ -64,10 +64,18 @@ void CCallBack_Playable_HitReport::onShapeHit(const PSX::PxControllerShapeHit& h { case PXOBJECT::END: break; - default: + case PXOBJECT::BOX: { PSX::PxRigidDynamic* pDynamic = static_cast(pActor); - pDynamic->addForce(vDir * fLength * 100000.f, PSX::PxForceMode::eIMPULSE); + //pDynamic->setRigidBodyFlag(PSX::PxRigidBodyFlag::eKINEMATIC, false); + PSX::PxVec3 vCompressedDir = vDir; + vCompressedDir.y += -vDir.y * 2.f + 1.f; + vCompressedDir.normalize(); + pDynamic->addForce(vCompressedDir * fLength* 100.f, PSX::PxForceMode::eFORCE); + } + break; + default: + { } break; } } break; diff --git a/Jusin154_Team3D/Client/Private/CallBack_Troll_Behavior.cpp b/Jusin154_Team3D/Client/Private/CallBack_Troll_HitReport.cpp similarity index 73% rename from Jusin154_Team3D/Client/Private/CallBack_Troll_Behavior.cpp rename to Jusin154_Team3D/Client/Private/CallBack_Troll_HitReport.cpp index dfc4f419a..40058a340 100644 --- a/Jusin154_Team3D/Client/Private/CallBack_Troll_Behavior.cpp +++ b/Jusin154_Team3D/Client/Private/CallBack_Troll_HitReport.cpp @@ -1,19 +1,20 @@ #include "pch.h" -#include "CallBack_Troll_Behavior.h" +#include "CallBack_Troll_HitReport.h" #include "GameInstance.h" #include "Character_Controller.h" #include "RigidBody_Dynamic.h" +#include "Unit.h" #include "GameObject.h" -CCallBack_Troll_Behavior::CCallBack_Troll_Behavior() +CCallBack_Troll_HitReport::CCallBack_Troll_HitReport() { } -CCallBack_Troll_Behavior::~CCallBack_Troll_Behavior() +CCallBack_Troll_HitReport::~CCallBack_Troll_HitReport() { } -void CCallBack_Troll_Behavior::onShapeHit(const PSX::PxControllerShapeHit& hit) +void CCallBack_Troll_HitReport::onShapeHit(const PSX::PxControllerShapeHit& hit) { PSX::PxController* pController = hit.controller; PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점 @@ -38,17 +39,20 @@ void CCallBack_Troll_Behavior::onShapeHit(const PSX::PxControllerShapeHit& hit) switch ((PXOBJECT)pTargetActorData->iSubKind) { case PXOBJECT::TERRAIN: - //class CGameObject* pOwner = m_pController->Get_Owner(); - //_vector vLook = pOwner->Get_Component()->Get_State(STATE::LOOK); - //_float fDot = XMVectorGetX(XMVector3Dot(XMLoadFloat3((_float3*)&vDir), vLook)); - //if (fDot > cosf(XM_PIDIV4)) { - // CModel* pModel = pOwner->Get_Component(); - // _uint iAnimIndex = pModel->Get_AnimIndex(); - // if (STATEANIM::RUSH_LOOP == iAnimIndex) { - // CFSM* pFSM = pOwner->Get_Component(); - // pFSM->Change_State(FSMSTATE::STOP); - // } - //} + { + class CUnit* pOwner = (CUnit*)m_pController->Get_Owner(); + _vector vLook = pOwner->Get_Component()->Get_State(STATE::LOOK); + _float fDot = XMVectorGetX(XMVector3Dot(XMLoadFloat3((_float3*)&vDir), vLook)); + GUI::Text("DOTDOTResult %f", fDot); + if (fDot > cosf(XM_PIDIV4)) { + CModel* pModel = pOwner->Get_Component(); + _uint iAnimIndex = pModel->Get_AnimIndex(); + if (pOwner->Get_AnimInfo(STATEANIM::RUSH_LOOP).first == iAnimIndex) { + CFSM* pFSM = pOwner->Get_Component(); + pFSM->Change_State(FSMSTATE::STUN); + } + } + } break; default: break; @@ -80,7 +84,7 @@ void CCallBack_Troll_Behavior::onShapeHit(const PSX::PxControllerShapeHit& hit) } } -void CCallBack_Troll_Behavior::onControllerHit(const PSX::PxControllersHit& hit) +void CCallBack_Troll_HitReport::onControllerHit(const PSX::PxControllersHit& hit) { PSX::PxController* pController = hit.controller; PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점 @@ -127,7 +131,7 @@ void CCallBack_Troll_Behavior::onControllerHit(const PSX::PxControllersHit& hit) } } -void CCallBack_Troll_Behavior::onObstacleHit(const PSX::PxControllerObstacleHit& hit) +void CCallBack_Troll_HitReport::onObstacleHit(const PSX::PxControllerObstacleHit& hit) { PSX::PxController* pController = hit.controller; PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점 @@ -144,7 +148,7 @@ void CCallBack_Troll_Behavior::onObstacleHit(const PSX::PxControllerObstacleHit& //} } -HRESULT CCallBack_Troll_Behavior::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject) +HRESULT CCallBack_Troll_HitReport::Initialize(CCharacter_Controller* pController, CRigidBody_Dynamic* pPartDynamicObject) { m_pController = pController; m_pPartDynamicBody = pPartDynamicObject; @@ -155,7 +159,7 @@ HRESULT CCallBack_Troll_Behavior::Initialize(CCharacter_Controller* pController, return S_OK; } -HRESULT CCallBack_Troll_Behavior::Finalize() +HRESULT CCallBack_Troll_HitReport::Finalize() { SAFE_RELEASE(m_pGameInstance); SAFE_RELEASE(m_pPartDynamicBody); @@ -163,7 +167,7 @@ HRESULT CCallBack_Troll_Behavior::Finalize() return S_OK; } -CCallBack_Troll_Behavior* CCallBack_Troll_Behavior::Create() +CCallBack_Troll_HitReport* CCallBack_Troll_HitReport::Create() { - return new CCallBack_Troll_Behavior(); + return new CCallBack_Troll_HitReport(); } diff --git a/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp index 84e9f6242..9f0de81e1 100644 --- a/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp +++ b/Jusin154_Team3D/Client/Private/CamPosition_Shoulder.cpp @@ -130,7 +130,7 @@ void CCamPosition_Shoulder::Update(_float fTimeDelta) if (m_pGameInstance->Key_Up(DIK_GRAVE)) { m_bMovable = !m_bMovable; } - if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)) { + if (m_pGameInstance->Mouse_Down(DIM_MBUTTON)) { m_pGameInstance->Toggle_MouseCenter(); } if (m_pGameInstance->Key_Up(DIK_P)) { diff --git a/Jusin154_Team3D/Client/Private/CameraLockOn.cpp b/Jusin154_Team3D/Client/Private/CameraLockOn.cpp index d1425b14b..ab636c516 100644 --- a/Jusin154_Team3D/Client/Private/CameraLockOn.cpp +++ b/Jusin154_Team3D/Client/Private/CameraLockOn.cpp @@ -41,6 +41,7 @@ HRESULT CCameraLockOn::Initialize(void* pArg) m_fTimeMult = 0.5f; Set_Visible(false); m_pInfoInstance->Add_Event(TEXT("MouseTogggle"), [this](void* p) {this->Set_Visible(*reinterpret_cast<_bool*>(p)); }); + m_pInfoInstance->Add_Event(TEXT("CameraLockOn"), [this](void* p) {this->Visible(*reinterpret_cast<_bool*>(p)); }); return S_OK; } @@ -50,14 +51,11 @@ void CCameraLockOn::Priority_Update(_float fTimeDelta) void CCameraLockOn::Update(_float fTimeDelta) { - /*if (m_pGameInstance->Mouse_Pressing(DIM_RBUTTON)) + if (m_bVisible) { - m_bHover = true; + m_fTime += fTimeDelta * m_fTimeMult; + Update_Target(); } - else - m_bHover = false;*/ - - m_fTime += fTimeDelta * m_fTimeMult; } void CCameraLockOn::Late_Update(_float fTimeDelta) @@ -156,6 +154,30 @@ HRESULT CCameraLockOn::Ready_Components(void* pArg) return S_OK; } +void CCameraLockOn::Visible(_bool Visible) +{ + if (m_pInfoInstance->Get_UISTATE() == UI_STATE::GAMEPLAYER) + { + m_bVisible = Visible; + } + else + { + m_bVisible = false; + } +} + +void CCameraLockOn::Update_Target() +{ + if (m_pInfoInstance->Get_TargetMonster() == nullptr) + { + m_bHover = false; + } + else + { + m_bHover = true; + } +} + CCameraLockOn* CCameraLockOn::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CCameraLockOn* pInstance = new CCameraLockOn(pDevice, pContext); diff --git a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp index b7ae49307..4f9ae9950 100644 --- a/Jusin154_Team3D/Client/Private/Camera_Debug.cpp +++ b/Jusin154_Team3D/Client/Private/Camera_Debug.cpp @@ -32,7 +32,7 @@ void CCamera_Debug::Update(_float fTimeDelta) if (m_pGameInstance->Key_Up(DIK_GRAVE)) { m_bMovable = !m_bMovable; } - if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)) { + if (m_pGameInstance->Mouse_Down(DIM_MBUTTON)) { m_pGameInstance->Toggle_MouseCenter(); } if (m_bMovable) { diff --git a/Jusin154_Team3D/Client/Private/Decendo.cpp b/Jusin154_Team3D/Client/Private/Decendo.cpp index 618bc1b54..60a072c25 100644 --- a/Jusin154_Team3D/Client/Private/Decendo.cpp +++ b/Jusin154_Team3D/Client/Private/Decendo.cpp @@ -158,12 +158,14 @@ HRESULT CDecendo::Pre_Setting(CGameObject* pObject, void* pArg) XMStoreFloat3(&m_vCameraLook, vDirection); + + { /* 대상 위치 지정 */ - CUnit* pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); - if (nullptr != pTargetUnit) { + m_pInfoInstance->Get_LockOnInfo(m_Info); + if (nullptr != m_Info.pUnit) { - XMStoreFloat4(&m_vTargetPos, pTargetUnit->Get_LockOnPos()); + XMStoreFloat4(&m_vTargetPos, m_Info.pUnit->Get_LockOnPos()); XMStoreFloat3(&m_vCameraLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); } diff --git a/Jusin154_Team3D/Client/Private/EffectObject.cpp b/Jusin154_Team3D/Client/Private/EffectObject.cpp index 7d9f66942..8070bcf6b 100644 --- a/Jusin154_Team3D/Client/Private/EffectObject.cpp +++ b/Jusin154_Team3D/Client/Private/EffectObject.cpp @@ -509,6 +509,8 @@ HRESULT CEffectObject::Bind_ShaderResources() socketMatrix = socketMatrix * m_pParentTransformCom->Get_XMWorldMatrix(); m_pTransformCom->Set_State(STATE::POSITION, socketMatrix.r[3]); + + } diff --git a/Jusin154_Team3D/Client/Private/EffectPool.cpp b/Jusin154_Team3D/Client/Private/EffectPool.cpp index bfbf9fa75..af9aa87d6 100644 --- a/Jusin154_Team3D/Client/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Client/Private/EffectPool.cpp @@ -17,6 +17,12 @@ #include "NomalJapSide.h" #include "Lumos.h" +#include "WandEnd.h" + +#include "Troll_Rush_Hit.h" +#include "Troll_Nomal_Smoke.h" +#include "TrollSwing.h" +#include "Goblin_Protego.h" CEffectPool::CEffectPool(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CGameObject(pDevice, pContext) @@ -48,6 +54,10 @@ HRESULT CEffectPool::Initialize(void* pArg) return E_FAIL; } + if (FAILED(Ready_MonsterEffect())) { + return E_FAIL; + } + return S_OK; } @@ -239,11 +249,64 @@ HRESULT CEffectPool::Ready_Effect() return pEffect; } ))) return E_FAIL; + + if (FAILED(Create_Effect(SKILL_TYPE::WAND_END, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + + CWandEnd* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect; } + ))) return E_FAIL; + #endif // !기무리 return S_OK; } +HRESULT CEffectPool::Ready_MonsterEffect() +{ + + + if (FAILED(Create_Effect(SKILL_TYPE::TROLL_ATTACK, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + + CTrollSwing* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect; } + ))) return E_FAIL; + + if (FAILED(Create_Effect(SKILL_TYPE::TROLL_NOMAL_SMOKE, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + + CTroll_Nomal_Smoke* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect; } + ))) return E_FAIL; + + if (FAILED(Create_Effect(SKILL_TYPE::TROLL_RUSH_HIT, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + + CTroll_Rush_Hit* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect; } + ))) return E_FAIL; + + + if (FAILED(Create_Effect(SKILL_TYPE::GOBLIN_PROTEGO, 5, NEXT_LEVEL, NEXT_LEVEL, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* { + + CGoblin_Protego* pEffect = nullptr; + + pEffect = m_pGameInstance->Clone_Prototype(iPrototypeLevel, nullptr); + + return pEffect; } + ))) return E_FAIL; + return S_OK; +} + HRESULT CEffectPool::Create_Effect(SKILL_TYPE eType, _uint iNumEffect, _uint iPrototypeLevel, _uint iCloneLevel, function AddPrototypeEvent) { for (_uint i = 0; i < iNumEffect; i++) diff --git a/Jusin154_Team3D/Client/Private/Enemy_HpBar.cpp b/Jusin154_Team3D/Client/Private/Enemy_HpBar.cpp index 6d97f4142..adc2153e4 100644 --- a/Jusin154_Team3D/Client/Private/Enemy_HpBar.cpp +++ b/Jusin154_Team3D/Client/Private/Enemy_HpBar.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "Enemy_HpBar.h" #include "GameInstance.h" +#include "InfoInstance.h" +#include "Monster.h" CEnemy_HpBar::CEnemy_HpBar(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) @@ -8,7 +10,8 @@ CEnemy_HpBar::CEnemy_HpBar(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) } CEnemy_HpBar::CEnemy_HpBar(const CEnemy_HpBar& rhs) - :CElementObject(rhs) + :CElementObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -41,8 +44,9 @@ HRESULT CEnemy_HpBar::Initialize(void* pArg) m_fAlpha = 0.f; m_fAlphaTime = 10.f; m_vNine_Slice = _float4(15.f, 100.f, 5.f, 15.f); - m_fMaxHp = 200.f; - m_fCurrentHp = m_fMaxHp; + m_fMaxHp = 0.f; + m_fCurrentHp = 0.f; + m_fTargetHp = 0.f; SizeUpX(360.f); m_fMoveSpeed = 5.f; m_bAnimation = false; @@ -95,41 +99,18 @@ void CEnemy_HpBar::Update(_float fTimeDelta) } } - if (m_fCurrentHp < 0.f) - m_fCurrentHp = 0.f; - if (m_fDamage <= 0.f) - m_fDamage = 0.f; - m_fTargetHp = m_fMaxHp - m_fDamage; + Update_Target(); if (m_fTargetHp < m_fCurrentHp) Hit(fTimeDelta); + m_fHpBar = m_fCurrentHp / m_fMaxHp; - if (m_fHpBar <= 0.f) + if (m_fCurrentHp <= 0.f) { m_bAnimation = true; } - if (m_pGameInstance->Key_Down(DIK_3)) - { - Lerp_PosX(101.f); - } - - if (m_pGameInstance->Key_Down(DIK_K)) - { - Set_FadeIn(); - } - if (m_pGameInstance->Key_Down(DIK_L)) - { - Set_FadeOut(); - } - if (m_pGameInstance->Key_Down(DIK_J)) - { - m_bAnimation = true; - m_bHover = true; - m_fTime = 0.f; - SizeUpdate(m_fLerpX, m_fLerpY); - } if (m_bAnimation == true) { m_fTime += fTimeDelta * m_fTimeMult; @@ -139,12 +120,11 @@ void CEnemy_HpBar::Update(_float fTimeDelta) } if (m_fTime >= 0.9f) { + SizeUpdate(m_fLerpX, m_fLerpY); m_bAnimation = false; m_bHover = false; m_fTime = 0.f; - SizeUpdate(m_fLerpX, m_fLerpY); } - __super::Update(fTimeDelta); } @@ -177,7 +157,7 @@ HRESULT CEnemy_HpBar::Render() return E_FAIL; } } - + return S_OK; } @@ -202,14 +182,16 @@ void CEnemy_HpBar::SizeUpX(_float SizeX) m_fLerpX = SizeX; } -void CEnemy_HpBar::Set_Enemt_Info(void* pArg) +void CEnemy_HpBar::Update_Target() { - if(m_bAnimation == true) + if (m_pInfoInstance->Get_TargetMonster() == nullptr) { + Set_FadeOut(); return; } - //m_fMaxHp - //m_fCurrentHp + m_fMaxHp = m_pInfoInstance->Get_TargetMonster()->Get_Stat()->Get_Stat().fMaxHp; + m_fCurrentHp = m_pInfoInstance->Get_TargetMonster()->Get_Stat()->Get_Stat().fCurrentHp; + m_fTargetHp = m_pInfoInstance->Get_TargetMonster()->Get_Stat()->Get_Stat().fTargetHp; Set_FadeIn(); } @@ -279,7 +261,7 @@ HRESULT CEnemy_HpBar::Bind_ShaderResources() { return E_FAIL; } - + return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Enemy_Info.cpp b/Jusin154_Team3D/Client/Private/Enemy_Info.cpp index 5d1b0fc8d..6ee9b41de 100644 --- a/Jusin154_Team3D/Client/Private/Enemy_Info.cpp +++ b/Jusin154_Team3D/Client/Private/Enemy_Info.cpp @@ -1,6 +1,8 @@ #include "pch.h" #include "Enemy_Info.h" #include "GameInstance.h" +#include "InfoInstance.h" +#include "Monster.h" CEnemy_Info::CEnemy_Info(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CElementObject(pDevice, pContext) @@ -8,7 +10,8 @@ CEnemy_Info::CEnemy_Info(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) } CEnemy_Info::CEnemy_Info(const CEnemy_Info& rhs) - :CElementObject(rhs) + :CElementObject(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -104,6 +107,8 @@ void CEnemy_Info::Update(_float fTimeDelta) Set_FadeOut(); } + Update_Target(); + __super::Update(fTimeDelta); } @@ -136,13 +141,12 @@ HRESULT CEnemy_Info::Render() return E_FAIL; } - m_fFontOffSet = (m_pGameInstance->FontSizeX(TEXT("Font_size20"), m_pEnemy_Name.c_str()) - 29.f) * 0.5f; - m_fFont2OffSet = (m_pGameInstance->FontSizeX(TEXT("UI_size15"), m_pLevel.c_str()) - 13.f) * 0.5f; - m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pEnemy_Name.c_str(), _float2(m_fFontPos.x + m_fX - m_fFontOffSet, m_fFontPos.y + m_fY), XMVectorSet(1.f* m_fAlpha,1.f* m_fAlpha,1.f* m_fAlpha, m_fAlpha)); - m_pGameInstance->Render_Text(TEXT("UI_size15"), m_pLevel.c_str(), _float2(m_fFontX + m_fX - m_fFont2OffSet, m_fFontY + m_fY), XMVectorSet(0.f, (120.f / 255.f)* m_fAlpha, 0.f, m_fAlpha)); + + m_pGameInstance->Render_Text(TEXT("Font_size20"), m_pEnemy_Name.c_str(), _float2(m_fFontPos.x + m_fX - m_fFontOffSet, m_fFontPos.y + m_fY), XMVectorSet(1.f * m_fAlpha, 1.f * m_fAlpha, 1.f * m_fAlpha, m_fAlpha)); + m_pGameInstance->Render_Text(TEXT("UI_size15"), m_pLevel.c_str(), _float2(m_fFontX + m_fX - m_fFont2OffSet, m_fFontY + m_fY), XMVectorSet(0.f, (120.f / 255.f) * m_fAlpha, 0.f, m_fAlpha)); } - + return S_OK; } @@ -209,14 +213,17 @@ HRESULT CEnemy_Info::Ready_Components(void* pArg) return S_OK; } -void CEnemy_Info::Set_Info(_int Level, _wstring Name) +void CEnemy_Info::Update_Target() { - if (m_bAnimation == true) + if (m_pInfoInstance->Get_TargetMonster() == nullptr) { + Set_FadeOut(); return; } - m_pLevel = to_wstring(Level); - m_pEnemy_Name = Name; + m_pLevel = to_wstring(m_pInfoInstance->Get_TargetMonster()->Get_Stat()->Get_Stat().iLevel); + m_pEnemy_Name = m_pInfoInstance->Get_TargetMonster()->Get_Stat()->Get_Stat().pUnit_Name; + m_fFontOffSet = (m_pGameInstance->FontSizeX(TEXT("Font_size20"), m_pEnemy_Name.c_str()) - 29.f) * 0.5f; + m_fFont2OffSet = (m_pGameInstance->FontSizeX(TEXT("UI_size15"), m_pLevel.c_str()) - 13.f) * 0.5f; Set_FadeIn(); } diff --git a/Jusin154_Team3D/Client/Private/Goblin.cpp b/Jusin154_Team3D/Client/Private/Goblin.cpp index 7430ececa..0449f7919 100644 --- a/Jusin154_Team3D/Client/Private/Goblin.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin.cpp @@ -256,8 +256,8 @@ void CGoblin::OnCollision(CGameObject* pOther, void* pDesc) { m_eHitSpell = STATEANIM::HIT_LEVIOSO; _float fSkillRatio = m_pInfoInstance->Get_Spell_Info(ENUM_CLASS(SKILL_TYPE::JAP)).fSpell_Damage; - _float fCoefficient = CollisionDesc->pObject->Get_Component()->Get_Stat(ENUM_CLASS(STAT::MAGIC)); - if (true == Get_Damage(fSkillRatio * fCoefficient)) { + _float fCoefficient = CollisionDesc->pObject->Get_Component()->Get_Stat().fMagic; + if (true == Get_Damage(fSkillRatio * fCoefficient * 0.2f)) { m_pFSM->Change_State(FSMSTATE::DEAD); return; } @@ -392,7 +392,7 @@ HRESULT CGoblin::Ready_Parts() #pragma endregion - return S_OK; + return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp b/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp index c7d1b8020..1ecf8c179 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Mage.cpp @@ -64,7 +64,7 @@ HRESULT CGoblin_Mage::Initialize(void* pArg) m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); SAFE_ADDREF(m_pEffectPool); - m_pCharacter_Controller->Set_Position(XMVectorSet(m_pGameInstance->Random_Float(-20.f, 20.f), 0.f, m_pGameInstance->Random_Float(-20.f, 20.f), 1.f)); + m_pCharacter_Controller->Set_Position(XMVectorSet(-50.f, 5.f, -10.f, 1.f)); return S_OK; } @@ -224,6 +224,17 @@ HRESULT CGoblin_Mage::Render_Shadow() return S_OK; } +_vector CGoblin_Mage::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_Mage::OnCollision(CGameObject* pOther, void* pDesc) { ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); @@ -241,7 +252,7 @@ void CGoblin_Mage::OnCollision(CGameObject* pOther, void* pDesc) { m_eHitSpell = STATEANIM::HIT_LEVIOSO; _float fSkillRatio = m_pInfoInstance->Get_Spell_Info(ENUM_CLASS(SKILL_TYPE::JAP)).fSpell_Damage; - _float fCoefficient = CollisionDesc->pObject->Get_Component()->Get_Stat(ENUM_CLASS(STAT::MAGIC)); + _float fCoefficient = CollisionDesc->pObject->Get_Component()->Get_Stat().fMagic; if (true == Get_Damage(fSkillRatio * fCoefficient)) { m_pFSM->Change_State(FSMSTATE::DEAD); return; @@ -288,7 +299,7 @@ HRESULT CGoblin_Mage::Ready_Components() Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_MAGICIAN); Desc.pTransform = m_pTransformCom; Desc.eBodyType = ACTOR::CAPSULE; - Desc.fContactOffset = 0.3f; + Desc.fContactOffset = 0.001f; Desc.fMaterial = { 1.2f, 1.0f, 0.0f }; Desc.bAutoStepping = { false }; Desc.fStepOffset = { 0.05f }; @@ -311,7 +322,7 @@ HRESULT CGoblin_Mage::Ready_Components() } m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor()); } - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_GOBLIN"), (CComponent**)&m_pStat))) { + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_GOBLIN_WIZARD"), (CComponent**)&m_pStat))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Goblin_Mage_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_Mage_States.cpp index 6379d113e..7da4a452f 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Mage_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Mage_States.cpp @@ -30,7 +30,7 @@ HRESULT CGoblin_Mage::Behavior_IdleExitCheck() if (m_fTargetDistance <= 20.f && m_fTargetDistance != 0.f) { m_vOriginPos = m_pTransformCom->Get_State(STATE::POSITION); - m_pEffectPool->Use_Skill(SKILL_TYPE::PROTEGO, this); + m_pEffectPool->Use_Skill(SKILL_TYPE::GOBLIN_PROTEGO, this); m_pFSM->Change_State(FSMSTATE::MOVE); } @@ -211,6 +211,7 @@ void CGoblin_Mage::Behavior_BlinkEnter() _float randDist = m_pGameInstance->Real_Random_Float(-5.f, -3.f); _vector vFinalPos = vPos + offsetDir * randDist; + vFinalPos = XMVectorSetY(vFinalPos, XMVectorGetY(vPos) + 1.f); m_pCharacter_Controller->Set_Position(vFinalPos); } , 0.99f); diff --git a/Jusin154_Team3D/Client/Private/Goblin_Protego.cpp b/Jusin154_Team3D/Client/Private/Goblin_Protego.cpp new file mode 100644 index 000000000..4bcbad546 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Goblin_Protego.cpp @@ -0,0 +1,202 @@ +#include "pch.h" +#include "Goblin_Protego.h" + +#include "GameInstance.h" +#include "EffectParts.h" + + +CGoblin_Protego::CGoblin_Protego(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CGoblin_Protego::CGoblin_Protego(const CGoblin_Protego& rhs) + : CEffect_Container(rhs) +{ +} + +HRESULT CGoblin_Protego::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CGoblin_Protego::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/MonsterPackage/GoblinProtego"))) + return E_FAIL; + + m_pSphere = Get_PartObject("ProtegoSphere"); + m_pBottom = Get_PartObject("ProtegoBottom"); + m_pCircle = Get_PartObject("ProtegoCircle"); + + SAFE_ADDREF(m_pSphere); + SAFE_ADDREF(m_pBottom); + SAFE_ADDREF(m_pCircle); + + m_wstrEffectName = L"Goblin_Protego"; + + + m_fAmountSize = 0.1f; + m_fSpeed = 5.f; + + m_fDuration = 3.f; + + return S_OK; +} + +void CGoblin_Protego::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CGoblin_Protego::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + m_pSphere->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pBottom->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pCircle-> Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + + + /* 시작 사이즈 러프 */ + if (m_fSizeAccTime > XM_PIDIV2) + return; + + m_fSizeAccTime += fTimeDelta * m_fSpeed; + + _float fSize = 1 + sinf(m_fSizeAccTime) * m_fAmountSize; + _float3 vSize = _float3(fSize, fSize, fSize); + + m_pSphere->Get_Component()->Set_Scale(vSize); + m_pCircle->Get_Component()->Set_Scale(vSize); +} + +void CGoblin_Protego::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CGoblin_Protego::Pre_Setting(CGameObject* pObject, void* pArg) +{ + if (FAILED(__super::Pre_Setting(pObject, nullptr))) + return E_FAIL; + + m_pSphere->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pBottom->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + m_pCircle->Get_Component()->Set_State(STATE::POSITION, m_pOwner->Get_WorldPostion()); + + m_pSphere->Set_Visible(true); + m_pCircle->Set_Visible(true); + m_pBottom->Set_Visible(true); + + + _float3 vSize = _float3(1.f, 1.f, 1.f); + m_pSphere->Get_Component()->Set_Scale(vSize); + m_pCircle->Get_Component()->Set_Scale(vSize); + + m_fSizeAccTime = 0.f; + + return S_OK; +} + +HRESULT CGoblin_Protego::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CGoblin_Protego::Ready_Child() +{ + return S_OK; +} + +CGoblin_Protego* CGoblin_Protego::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CGoblin_Protego* pInstance = new CGoblin_Protego(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CGoblin_Protego"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CGoblin_Protego::Clone(void* pArg, CGameObject* pOwner) +{ + CGoblin_Protego* pInstance = new CGoblin_Protego(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CGoblin_Protego"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CGoblin_Protego::OnCollision(CGameObject* pOther, void* pDesc) +{ + //CTransform* pOtherTransform = p + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + +} + +void CGoblin_Protego::Free() +{ + __super::Free(); + + //if(m_pPhysHitBox != nullptr) + // if (m_pPhysHitBox->Get_Depth() == false) + // SAFE_RELEASE(m_pPhysHitBox); + + SAFE_RELEASE(m_pSphere); + SAFE_RELEASE(m_pBottom); + SAFE_RELEASE(m_pCircle); + +} +#ifdef _DEBUG + +void CGoblin_Protego::Describe_Entity() +{ + GUI::Begin("PROTEGO"); + + GUI::DragFloat("fAmountSize" ,&m_fAmountSize); + GUI::DragFloat("fSpeed" , &m_fSpeed); + + GUI::End(); +} + +#endif // _DEBUG + +HRESULT CGoblin_Protego::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp b/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp index c30db5c0c..13f3f7b8e 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_Spector.cpp @@ -176,45 +176,6 @@ HRESULT CGoblin_Spector::Ready_Parts() return E_FAIL; } - -#pragma region EFFECT - /* EFFECT */ - - CPartObject::PARTOBJECT_DESC PartsDesc{}; - - PartsDesc.pParentTransform = m_pTransformCom; - - - - if (FAILED(Add_PartObject("Goblin_Particle", g_iStaticLevel, &m_pGoblin_Particle, &PartsDesc))) - { - return E_FAIL; - } - - m_pGoblin_Particle->Load("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Particle", static_cast(NEXT_LEVEL)); - m_pGoblin_Particle->FollowParants(m_pModelCom->Get_BoneMatrixPtr("RightShoulder")); - - - - if (FAILED(Add_PartObject("Goblin_Particle2", g_iStaticLevel, &m_pGoblin_Particle2, &PartsDesc))) - { - return E_FAIL; - } - - m_pGoblin_Particle2->Load("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Particle2", static_cast(NEXT_LEVEL)); - m_pGoblin_Particle2->FollowParants(m_pModelCom->Get_BoneMatrixPtr("RightShoulder")); - - - if (FAILED(Add_PartObject("Goblin_Smoke", g_iStaticLevel, &m_pSmoke, &PartsDesc))) - { - return E_FAIL; - } - - m_pSmoke->Load("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Smoke", static_cast(NEXT_LEVEL)); - m_pSmoke->FollowParants(m_pModelCom->Get_BoneMatrixPtr("Spine2")); - - -#pragma endregion return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Goblin_States.cpp b/Jusin154_Team3D/Client/Private/Goblin_States.cpp index 65162b49c..06705a150 100644 --- a/Jusin154_Team3D/Client/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Client/Private/Goblin_States.cpp @@ -4,6 +4,7 @@ #include "GameInstance.h" #include "Player.h" #include "Goblin_Dagger.h" +#include "EffectParts.h" #pragma region STATE #include "State_Idle.h" @@ -102,14 +103,14 @@ HRESULT CGoblin::Behavior_MoveExitCheck(_float fTimeDelta) } m_fMoveTime += fTimeDelta; - if (m_fMoveTime >= 2.5f) + if (m_fMoveTime >= 2.f) { m_bFirstMove = false; m_fMoveTime = 0.f; } } - if (m_fTargetDistance <= 15.f && m_fTargetDistance >= 6.f && m_fTargetDistance !=0.f) + if (m_fTargetDistance <= 15.f && m_fTargetDistance >= 3.f && m_fTargetDistance !=0.f) m_pFSM->Change_State(FSMSTATE::COMBAT); return E_FAIL; @@ -283,6 +284,7 @@ void CGoblin::Behavior_BlinkEnter() _float randDist = m_pGameInstance->Real_Random_Float(5.f, 5.5f); _vector vFinalPos = vPlayerPos + offsetDir * randDist; + vFinalPos = XMVectorSetY(vFinalPos, XMVectorGetY(vPlayerPos) + 1.f); m_pCharacter_Controller->Set_Position(vFinalPos); } , 0.99f); @@ -479,6 +481,9 @@ void CGoblin::Behavior_DeadEnter() } pairAnimInfo = m_Animation[iState + bStrongerKnockDown]; + //Get_PartObject("Goblin_Particle")->Set_Visible(false); + //Get_PartObject("Goblin_Particle2")->Set_Visible(false); + //Get_PartObject("Goblin_Smoke")->Set_Visible(false); m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index 26265cc4c..365d7128d 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -4,6 +4,7 @@ #include "MapInfo.h" #include "MonsterInfo.h" #include "PlayerInfo.h" +#include "InteractiveInfo.h" #include "Skill_Data.h" IMPLEMENT_SINGLETON(CInfoInstance) @@ -19,7 +20,7 @@ void CInfoInstance::Update(_float fTimeDelta) m_pMonsterInfo->Update(fTimeDelta); m_pMapInfo->Update(fTimeDelta); m_pSkillInfo->Update(fTimeDelta); - + m_pInteractiveInfo->Update(fTimeDelta); } void CInfoInstance::Change_Level() @@ -28,6 +29,7 @@ void CInfoInstance::Change_Level() m_pMonsterInfo->Change_Level(); m_pMapInfo->Change_Level(); m_pSkillInfo->Change_Level(); + m_pInteractiveInfo->Change_Level(); } void CInfoInstance::Update_CameraCoordinateSystem(_float3& vLook, _float3& vRight) @@ -67,18 +69,22 @@ HRESULT CInfoInstance::Deregist_ActiveMonster(CMonster* pUnit) return m_pMonsterInfo->Deregist_ActiveMonster(pUnit); } -CUnit* CInfoInstance::Get_LockOnUnit() +void CInfoInstance::Get_LockOnInfo(LOCKON_INFO& Info) { - CUnit* pUnit = { nullptr }; - pUnit = m_pMonsterInfo->Get_LockOnUnit(); - // pUnit = m_pInfo->Get_LockOnUnit(); - return pUnit; + Info.pUnit = m_pMonsterInfo->Get_LockOnUnit(); + Info.pInteractive = m_pInteractiveInfo->Get_LockOnUnit(); } pair CInfoInstance::Get_NearestPlayerAlly(_fvector vPos) { return m_pMonsterInfo->Get_NearestPlayerAlly(vPos); } + +CMonster* CInfoInstance::Get_TargetMonster() +{ + return m_pMonsterInfo->Get_TargetMonster(); +} + #pragma endregion #pragma region MAP_INFO HRESULT CInfoInstance::Load_MapObjects(const _char* pFilePath) @@ -164,14 +170,16 @@ void CInfoInstance::Key_Input(_uint Input) void CInfoInstance::Mouse_Input(_uint Input) { m_eInput = Input; - + _bool bHover = false; switch (m_eInput) { - case ENUM_CLASS(KEYINPUT::INPUT_1): - Event_CallBack(TEXT("Spell"), &m_eInput); + case ENUM_CLASS(KEYINPUT::DIM_RBUTTON_UP): + bHover = false; + Event_CallBack(TEXT("CameraLockOn"), &bHover); break; - case ENUM_CLASS(KEYINPUT::INPUT_2): - Event_CallBack(TEXT("Spell"), &m_eInput); + case ENUM_CLASS(KEYINPUT::DIM_RBUTTON_DOWN): + bHover = true; + Event_CallBack(TEXT("CameraLockOn"), &bHover); break; default: break; @@ -185,6 +193,11 @@ void CInfoInstance::Set_UISTATE(UI_STATE eState) m_eUI_State = eState; } +UI_STATE CInfoInstance::Get_UISTATE() +{ + return m_eUI_State; +} + void CInfoInstance::Add_Event(_wstring EventName, function Event) { UI_Event.emplace(EventName, Event); @@ -199,6 +212,22 @@ void CInfoInstance::Event_CallBack(_wstring EventName, void* pArg) } } +HRESULT CInfoInstance::Regist_ActiveInteractive(CMapElement_Interactable* pInteractive) +{ + if (nullptr == s_pInstance || nullptr == m_pInteractiveInfo) { + return S_OK; // 게임 종료 된 상태 + } + return m_pInteractiveInfo->Regist_ActiveInteractive(pInteractive); +} + +HRESULT CInfoInstance::Deregist_ActiveInteractive(CMapElement_Interactable* pInteractive) +{ + if (nullptr == s_pInstance || nullptr == m_pInteractiveInfo) { + return S_OK; // 게임 종료 된 상태 + } + return m_pInteractiveInfo->Deregist_ActiveInteractive(pInteractive); +} + #pragma endregion LEVEL CInfoInstance::Get_RestartLevel() { @@ -230,6 +259,10 @@ HRESULT CInfoInstance::Initialize_Information(ID3D11Device* pDevice, ID3D11Devic if (nullptr == m_pSkillInfo) { return E_FAIL; } + m_pInteractiveInfo = CInteractiveInfo::Create(pDevice, pContext); + if (nullptr == m_pInteractiveInfo) { + return E_FAIL; + } return S_OK; @@ -237,13 +270,15 @@ HRESULT CInfoInstance::Initialize_Information(ID3D11Device* pDevice, ID3D11Devic void CInfoInstance::Release_Information() { - DestroyInstance(); + UI_Event.clear(); + DestroyInstance(); SAFE_RELEASE(m_pMapInfo); SAFE_RELEASE(m_pPlayerInfo); SAFE_RELEASE(m_pMonsterInfo); SAFE_RELEASE(m_pSkillInfo); + SAFE_RELEASE(m_pInteractiveInfo); SAFE_RELEASE(m_pDevice); SAFE_RELEASE(m_pContext); SAFE_RELEASE(m_pGameInstance); @@ -252,5 +287,6 @@ void CInfoInstance::Release_Information() void CInfoInstance::Free() { __super::Free(); + UI_Event.clear(); } diff --git a/Jusin154_Team3D/Client/Private/InteractiveInfo.cpp b/Jusin154_Team3D/Client/Private/InteractiveInfo.cpp new file mode 100644 index 000000000..f01b2c22d --- /dev/null +++ b/Jusin154_Team3D/Client/Private/InteractiveInfo.cpp @@ -0,0 +1,149 @@ +#include "pch.h" +#include "InteractiveInfo.h" +#include "GameInstance.h" +#include "InfoInstance.h" +#include "MapElement_Interactable.h" +#include "Monster.h" +#include "Layer.h" +#include "Player.h" + +CInteractiveInfo::CInteractiveInfo() +{ +} + +void CInteractiveInfo::Update(_float fTimeDelta) +{ + Refresh_LockOnTarget(); +} +void CInteractiveInfo::Change_Level() +{ + SAFE_RELEASE(m_pLockOnInteractive); + for (CMapElement_Interactable* pInteractive : m_ActiveInteractive) { + SAFE_RELEASE(pInteractive); + } m_ActiveInteractive.clear(); +} + +HRESULT CInteractiveInfo::Regist_ActiveInteractive(CMapElement_Interactable* pUnit) +{ + for (CMapElement_Interactable* pInteractive : m_ActiveInteractive) { + if (pInteractive == pUnit) { + return E_ACCESSDENIED; + } + } m_ActiveInteractive.push_back(pUnit); + SAFE_ADDREF(pUnit); + return S_OK; +} + +HRESULT CInteractiveInfo::Deregist_ActiveInteractive(CMapElement_Interactable* pUnit) +{ + for (list::iterator iter = m_ActiveInteractive.begin(); iter != m_ActiveInteractive.end();) { + if (*iter == pUnit) { + SAFE_RELEASE(*iter); + iter = m_ActiveInteractive.erase(iter); + break; + } + else { + ++iter; + } + } + return E_FAIL; +} + +CMapElement_Interactable* CInteractiveInfo::Get_LockOnUnit() +{ + return m_pLockOnInteractive; +} + +HRESULT CInteractiveInfo::Refresh_LockOnTarget() +{ + SAFE_RELEASE(m_pLockOnInteractive); + _vector vCameraLook = m_pGameInstance->Get_CameraLook(); + _vector vCameraPos = m_pGameInstance->Get_CamXMPosition(); + _float fMaxDot = { 0.f }; + + _vector vMonsterPos; + _vector vToMonsterDir; + _bool bAim = false; + _float fFovy = 0.f; + if (m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_PLAYER) != nullptr) + { + bAim = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_PLAYER)->Get_Object()->Get_Aim(); + } + if (true == bAim) + { + fFovy = max(m_pGameInstance->Get_CameraFov() - XMConvertToRadians(50.f), XMConvertToRadians(5.f)); + } + else { + fFovy = max(m_pGameInstance->Get_CameraFov() - XMConvertToRadians(30.f), XMConvertToRadians(20.f)); + } + + { // 뷰프러스텀 순회해서 가장 중앙에 근접한 물체 찾기 + for (list::iterator iter = m_ActiveInteractive.begin(); iter != m_ActiveInteractive.end(); ++iter) { + + // (카메라의 룩)과 (카메라 -> 몬스터 방향 벡터)를 내적해서 가장 큰 크기가 나온 몬스타가 락온 대상 + CMapElement_Interactable* pInteractive = (*iter); + + vMonsterPos = pInteractive->Get_LockOnPos(); + vToMonsterDir = vMonsterPos - vCameraPos; + _float fDotResult = CMyTools::DirectionCompare(vCameraLook, vToMonsterDir); + if (fDotResult <= cosf(fFovy)) { + continue; + } + + if (nullptr == m_pLockOnInteractive) { + m_pLockOnInteractive = pInteractive; + fMaxDot = fDotResult; + continue; + } + + if (fMaxDot < fDotResult) { + m_pLockOnInteractive = pInteractive; + fMaxDot = fDotResult; + } + } + } + if (nullptr != m_pLockOnInteractive) { + SAFE_ADDREF(m_pLockOnInteractive); + } + return S_OK; +} +HRESULT CInteractiveInfo::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + m_pGameInstance = CGameInstance::GetInstance(); + m_pInfoInstance = CInfoInstance::GetInstance(); + m_pDevice = pDevice; + m_pContext = pContex; + + SAFE_ADDREF(m_pGameInstance); + SAFE_ADDREF(m_pInfoInstance); + SAFE_ADDREF(m_pDevice); + SAFE_ADDREF(m_pContext); + + return S_OK; +} + +CInteractiveInfo* CInteractiveInfo::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + CInteractiveInfo* pInstance = new CInteractiveInfo(); + + if (FAILED(pInstance->Initialize(pDevice, pContex))) { + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CInteractiveInfo::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pLockOnInteractive); + for (CMapElement_Interactable* pInteractive : m_ActiveInteractive) { + SAFE_RELEASE(pInteractive); + } m_ActiveInteractive.clear(); + + SAFE_RELEASE(m_pGameInstance); + SAFE_RELEASE(m_pInfoInstance); + SAFE_RELEASE(m_pDevice); + SAFE_RELEASE(m_pContext); +} diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index a6752c22b..74936195d 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -246,8 +246,8 @@ HRESULT CLevel_GamePlay::Ready_Background() #ifdef gimch isReady_Background = false; #endif // gimch -#ifdef bin - isReady_Background = false; +#ifdef Bin + isReady_Background = true; #endif // #ifdef 진우 isReady_Background = false; @@ -453,7 +453,7 @@ HRESULT CLevel_GamePlay::Ready_Layer_SkyBox(const _wstring& strLayerTag) HRESULT CLevel_GamePlay::Ready_Layer_Monster() { - for (_uint i = 0; i < 5; ++i) + for (_uint i = 0; i < 1; ++i) { if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Levioso.cpp b/Jusin154_Team3D/Client/Private/Levioso.cpp index 6813d4568..9bc2530b8 100644 --- a/Jusin154_Team3D/Client/Private/Levioso.cpp +++ b/Jusin154_Team3D/Client/Private/Levioso.cpp @@ -6,6 +6,7 @@ #include "Player.h" #include "TrailObject.h" #include "Wand.h" +#include "InfoInstance.h" CLevioso::CLevioso(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -14,7 +15,8 @@ CLevioso::CLevioso(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) } CLevioso::CLevioso(const CLevioso& rhs) - : CEffect_Container(rhs) + : CEffect_Container(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -74,11 +76,8 @@ void CLevioso::Update(_float fTimeDelta) Update_Event(fTimeDelta); - m_pLeviosoPJ_0->Get_Component()->Translation(m_vOwnerLook * 0.25f); - - - m_pTrail_PT_0->Get_Component()->Translation(m_vOwnerLook * 0.25f); - + m_pLeviosoPJ_0->Get_Component()->Translation(XMLoadFloat3(&m_vCameraLook) * m_fLinearSpeed); + m_pTrail_PT_0->Get_Component()->Translation(XMLoadFloat3(&m_vCameraLook) * m_fLinearSpeed); _matrix WorldMat = m_pTrail_PT_0->Get_Component()->Get_XMWorldMatrix(); @@ -108,8 +107,6 @@ void CLevioso::Late_Update(_float fTimeDelta) } __super::Late_Update(fTimeDelta); - - } HRESULT CLevioso::Pre_Setting(CGameObject* pObject, void* pArg) @@ -129,9 +126,6 @@ HRESULT CLevioso::Pre_Setting(CGameObject* pObject, void* pArg) CEffectParts* pWandLight = Get_PartObject("Levioso_Wand_Light"); - m_pLeviosoPJ_0->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); - m_pTrail_PT_0->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); - m_pLeviosoPJ_0->Get_Component()->Set_State(STATE::POSITION, WandPos); m_pTrail_PT_0->Get_Component()->Set_State(STATE::POSITION, WandPos); @@ -146,6 +140,38 @@ HRESULT CLevioso::Pre_Setting(CGameObject* pObject, void* pArg) m_vOwnerLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); + _vector vDirection = m_pOwner->Get_Component()->Get_State(STATE::LOOK); + XMStoreFloat3(&m_vCameraLook, vDirection); + + _vector vStartPos = WandPos; + XMStoreFloat4(&m_vStartPos, vStartPos); + + { /* 대상 위치 지정 */ + + m_pInfoInstance->Get_LockOnInfo(m_Info); + if (nullptr != m_Info.pUnit) { + + XMStoreFloat4(&m_vTargetPos, m_Info.pUnit->Get_LockOnPos()); + + XMStoreFloat3(&m_vCameraLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + } + else { + // 타겟이 없다면 현재위치 -> 카메라 룩벡터 * duration간 예상 이동거리 를 대상으로 지정 + XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_fLinearSpeed * 0.5f); + } + + } + + _vector vDir = XMVector3Normalize(XMLoadFloat3(&m_vCameraLook)); + + _vector vRight = XMVector3Normalize(XMVector3Cross(XMVectorSet(0.f, 1.f, 0.f, 0.f), vDir)); + + _vector vUp = XMVector3Normalize(XMVector3Cross(vRight, vDir)); + + _matrix ProjMat = _matrix(vRight, vUp, vDir, vStartPos); + + m_pLeviosoPJ_0->Get_Component()->Set_WorldMatrix(ProjMat); + return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/Loader.cpp b/Jusin154_Team3D/Client/Private/Loader.cpp index c7104d98a..3237b2865 100644 --- a/Jusin154_Team3D/Client/Private/Loader.cpp +++ b/Jusin154_Team3D/Client/Private/Loader.cpp @@ -58,7 +58,6 @@ #include "NoMountIcon.h" #include "Loading_Panel.h" -#include "LoadingWidget.h" #include "LoadingWidget_Flame.h" #include "Action_Panel.h" @@ -126,6 +125,14 @@ #include "Lumos.h" +#include "TrollSwing.h" +#include "Troll_Nomal_Smoke.h" +#include "Troll_Rush_Hit.h" + +#include "WandEnd.h" +#include "Goblin_Protego.h" + + #pragma endregion @@ -290,8 +297,8 @@ HRESULT CLoader::Loading_For_GamePlay() #ifdef gimch isLoad_Background = false; #endif // gimch -#ifdef bin - isLoad_Background = false; +#ifdef Bin + isLoad_Background = true; #endif // #ifdef 진우 isLoad_Background = false; @@ -1361,8 +1368,8 @@ HRESULT CLoader::Loading_For_GamePlay() Desc.vhalfGeometryInfo = { 0.5f, 0.5f, 0.5f }; Desc.fDensity = 1.f; Desc.pxMassCenter = PSX::PxTransform(PSX::PxIDENTITY()); - Desc.eLockFlag = {}; - Desc.vAutoDamping = { 100.f, 100.f }; + Desc.eLockFlag = {}; + Desc.vAutoDamping = { 1.f, 1.f }; Desc.vLocalRotQ = { 0.f, 0.f, 0.f, 1.f }; Desc.vLocalTranslation = { 0.f, 0.f, 0.f }; } @@ -1378,7 +1385,7 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } - Desc.ePxRigidBodyFlags = { PSX::PxRigidBodyFlag::eKINEMATIC }; + //Desc.ePxRigidBodyFlags = { PSX::PxRigidBodyFlag::eKINEMATIC }; if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX_KIN"), CRigidBody_Dynamic::Create(m_pDevice, m_pContext, Desc)))) { return E_FAIL; } @@ -1428,7 +1435,7 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Troll_Rock_Big_Model"), - CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Troll_Rock/Troll_Rock_Big.bin", XMMatrixScaling(0.00004f, 0.00004f, 0.00004f) * XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Troll_Rock/VFX_SM_Rock_01.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) return E_FAIL; if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Dagger_Model"), @@ -1502,7 +1509,22 @@ HRESULT CLoader::Loading_For_GamePlay() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CTrollSwing::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CTroll_Nomal_Smoke::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CTroll_Rush_Hit::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CGoblin_Protego::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CWandEnd::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CEffectPool::Create(m_pDevice, m_pContext)))) { return E_FAIL; @@ -1625,10 +1647,6 @@ HRESULT CLoader::Loading_For_GamePlay() if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLoading_Panel::Create(m_pDevice, m_pContext)))) { return E_FAIL; } - /* For.Prototype_GameObject_LoadingWidget*/ - if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLoadingWidget::Create(m_pDevice, m_pContext)))) { - return E_FAIL; - } /* For.Prototype_GameObject_LoadingWidget_Flame*/ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLoadingWidget_Flame::Create(m_pDevice, m_pContext)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/LoadingWidget.cpp b/Jusin154_Team3D/Client/Private/LoadingWidget.cpp index 3fdd94bb7..e6cbd7789 100644 --- a/Jusin154_Team3D/Client/Private/LoadingWidget.cpp +++ b/Jusin154_Team3D/Client/Private/LoadingWidget.cpp @@ -21,8 +21,8 @@ HRESULT CLoadingWidget::Initialize(void* pArg) { CUIObject::UIOBJECT_DESC Desc{}; - Desc.fX = 600.f; - Desc.fY = 0.f; + Desc.fX = 800.f; + Desc.fY = 400.f; Desc.fSizeX = 200.f; Desc.fSizeY = 200.f; @@ -47,7 +47,7 @@ HRESULT CLoadingWidget::Initialize(void* pArg) m_iImageFrameX = 6; // 이미지의 x 갯수 m_iImageFrameY = 6; // 이미지의 y 갯수 - m_bActive = false; + m_bActive = true; return S_OK; } @@ -189,7 +189,7 @@ HRESULT CLoadingWidget::Ready_Components(void* pArg) { return E_FAIL; } - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Texture_LoadingWidget"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("LoadingWidget"), reinterpret_cast(&m_pDiffuse_TextureCom), nullptr))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Client/Private/Loading_Panel.cpp b/Jusin154_Team3D/Client/Private/Loading_Panel.cpp index b4c71ab91..4fc492be4 100644 --- a/Jusin154_Team3D/Client/Private/Loading_Panel.cpp +++ b/Jusin154_Team3D/Client/Private/Loading_Panel.cpp @@ -101,11 +101,12 @@ HRESULT CLoading_Panel::Ready_Components(void* pArg) HRESULT CLoading_Panel::Ready_Element(void* pArg) { - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pLoadingWidget)))) - { - return E_FAIL; - } - Add_Element(TEXT("LoadingWidget"), m_pLoadingWidget); + //if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pLoadingWidget)))) + //{ + // return E_FAIL; + //} + //Add_Element(TEXT("LoadingWidget"), m_pLoadingWidget); + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast(&m_pLoadingWidget_Flame)))) { return E_FAIL; diff --git a/Jusin154_Team3D/Client/Private/Loding_Panel.cpp b/Jusin154_Team3D/Client/Private/Loding_Panel.cpp index cb6ce598a..be9e9d9db 100644 --- a/Jusin154_Team3D/Client/Private/Loding_Panel.cpp +++ b/Jusin154_Team3D/Client/Private/Loding_Panel.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "Loding_Panel.h" #include "GameInstance.h" +#include "LoadingWidget.h" CLoding_Panel::CLoding_Panel(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) :CUIObject(pDevice, pContext) @@ -38,8 +39,10 @@ HRESULT CLoding_Panel::Initialize(void* pArg) m_fCanvasAlpha = 1.f; m_fOwnerAlpha = 1.f; m_fAlpha = 1.f; - m_fSortZ = 0.f; m_iImageNum = 0; + m_fSortZ = 0.1f; + Visible(true); + m_bActive = true; //m_vImageposSi = _float4(0.f, 0.f, 1792.f, 1024.f); #ifdef _DEBUG INHYUK = true; @@ -110,6 +113,7 @@ void CLoding_Panel::Update(_float fTimeDelta) break; } #endif // DEBUG + __super::Update(fTimeDelta); } void CLoding_Panel::Late_Update(_float fTimeDelta) @@ -222,6 +226,11 @@ HRESULT CLoding_Panel::Ready_Components(void* pArg) return E_FAIL; } + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, ENUM_CLASS(LEVEL::LOADING), LAYER_UI, nullptr, this, reinterpret_cast(&m_pLoadingWidget)))) + { + return E_FAIL; + } + return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/MainApp.cpp b/Jusin154_Team3D/Client/Private/MainApp.cpp index b2b307ef3..06a03fb36 100644 --- a/Jusin154_Team3D/Client/Private/MainApp.cpp +++ b/Jusin154_Team3D/Client/Private/MainApp.cpp @@ -7,6 +7,7 @@ #include "Loding_Panel.h" #include "Intro_Image.h" #include "Intro_BG.h" +#include "LoadingWidget.h" NS_BEGIN(Engine) @@ -153,6 +154,11 @@ HRESULT CMainApp::Ready_Prototypes() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("LoadingWidget"), + CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Loading/LoadingWidget.png"), 0)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, FX_UIEDITOR, CShader::Create(m_pDevice, m_pContext, TEXT("../Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl"), VTXPOSTEX::Elements, VTXPOSTEX::iNumElements)))) { @@ -182,6 +188,10 @@ HRESULT CMainApp::Ready_Prototypes() return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CLoadingWidget::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + return S_OK; } diff --git a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp index 11fd2cd25..ae73a9cc5 100644 --- a/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp +++ b/Jusin154_Team3D/Client/Private/MapElement_Interactable.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "MapElement_Interactable.h" +#include "InfoInstance.h" #include "GameInstance.h" CMapElement_Interactable::CMapElement_Interactable(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -9,7 +10,8 @@ CMapElement_Interactable::CMapElement_Interactable(ID3D11Device* pDevice, ID3D11 } CMapElement_Interactable::CMapElement_Interactable(const CMapElement_Interactable& rhs) - : CMapElement(rhs) + : CMapElement(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -39,11 +41,23 @@ HRESULT CMapElement_Interactable::Initialize(void* pArg) m_pTransformCom->Set_State(STATE::POSITION, XMVectorSetW(XMLoadFloat3(&pDesc->vPosition), 1.f)); m_pTransformCom->Set_Scale(pDesc->vScale); m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotation.x), XMConvertToRadians(pDesc->vRotation.y), XMConvertToRadians(pDesc->vRotation.z)); - + + ELEMENT_INTERACTABLE_DESC* pPhysXDummyDesc = static_cast(pArg); + + // RIGID_BODY + CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; + Desc.iSubKind = ENUM_CLASS(PXOBJECT::BOX);//pPhysXDummyDesc->iSubKind; + if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX_KIN"), (CComponent**)&m_pRigidBody, &Desc))) { + return E_FAIL; + } + m_pActor = static_cast(m_pRigidBody->Get_Actor()); static_cast(m_pRigidBody)->Set_HalfGeometryInfo(pDesc->vBoxSize); static_cast(m_pRigidBody)->Move_LocalPos(_float4(0.f, 0.f, 0.f, 0.f), pDesc->vBoxLocalPosition); + //static_cast(m_pRigidBody)->Set_Kinematic(false); + + m_pInfoInstance->Regist_ActiveInteractive(this); return S_OK; } @@ -58,7 +72,6 @@ void CMapElement_Interactable::Update(_float fTimeDelta) void CMapElement_Interactable::Late_Update(_float fTimeDelta) { - if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pModelComs[0]->Get_Radius())) { m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); } @@ -71,13 +84,17 @@ HRESULT CMapElement_Interactable::Render() _uint iNumMeshes = m_pModelComs[m_iLodIndex]->Get_NumMeshes(); + _uint iShaderPass = ENUM_CLASS(SHADER_PASS_MESH::DEFAULT); + if (true == m_bDrawOutLine) { + iShaderPass = ENUM_CLASS(SHADER_PASS_MESH::OUTLINE_WRITE); + } for (_uint i = 0; i < iNumMeshes; i++) { if (FAILED(m_pModelComs[0]->Bind_Material(i, m_pShaderCom))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::DEFAULT)))) { + if (FAILED(m_pShaderCom->Begin(iShaderPass))) { return E_FAIL; } @@ -86,6 +103,9 @@ HRESULT CMapElement_Interactable::Render() } } + if (m_bDrawOutLine) { + Render_OutLine(); + } #ifdef _DEBUG if (FAILED(m_pRigidBody->Render())) { return E_FAIL; @@ -115,16 +135,7 @@ HRESULT CMapElement_Interactable::Ready_Components(void* pArg) /* Com_Shader */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_MESH, - reinterpret_cast(&m_pShaderCom)))) - return E_FAIL; - - - ELEMENT_INTERACTABLE_DESC* pPhysXDummyDesc = static_cast(pArg); - - // RIGID_BODY - CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(PXOBJECT::BOX);//pPhysXDummyDesc->iSubKind; - if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("PHYSX_DYNAMIC_BOX_KIN"), (CComponent**)&m_pRigidBody, &Desc))) { + reinterpret_cast(&m_pShaderCom)))){ return E_FAIL; } @@ -151,6 +162,71 @@ HRESULT CMapElement_Interactable::Bind_ShaderResources() return S_OK; } +_vector CMapElement_Interactable::Get_LockOnPos() +{ + return m_pRigidBody->Get_Position(); +} + +void CMapElement_Interactable::Set_DrawOutLine() +{ + m_bDrawOutLine = true; +} + +HRESULT CMapElement_Interactable::Render_OutLine() +{ + m_bDrawOutLine = false; + if (FAILED(Bind_ShaderResources())) { + return E_FAIL; + } + + GUI::SetNextItemWidth(80.f); + GUI::ColorPicker3("vOutLineColor", (_float*)&m_vOutLineColor); + GUI::SliderFloat("Thickness", &m_fOutLineThickness, 0.1f, 2.f, "%.1f"); + GUI::SliderFloat("Scale", &m_fOutLineScale, 0.1f, 2.f, "%.1f"); + GUI::SliderFloat("Power", &m_fOutLinePower, 0.1f, 2.f, "%.1f"); + Compute_Depth(); + _float fRatio = (m_fCamDepth / *m_pGameInstance->Get_CurrentCameraFar()); + m_fOutLineThickness = CMyTools::Lerp_f1D(0.07f, 0.15f, fRatio); + if (m_fOutLineThickness > 0.15f) { + m_fOutLineThickness = 0.15f; + } + else if (m_fOutLineThickness < 0.07f) { + m_fOutLineThickness = 0.07f; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_vOutLineColor", &m_vOutLineColor, sizeof(_float3)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLineThickness", &m_fOutLineThickness, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLineScale", &m_fOutLineScale, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLinePower", &m_fOutLinePower, sizeof(_float)))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))) { + return E_FAIL; + } + _uint iNumMeshes = m_pModelComs[m_iLodIndex]->Get_NumMeshes(); + + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelComs[0]->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::OUTLINE_READ)))) { + return E_FAIL; + } + + if (FAILED(m_pModelComs[m_iLodIndex]->Render(i))) { + return E_FAIL; + } + } + return S_OK; +} + CMapElement_Interactable* CMapElement_Interactable::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CMapElement_Interactable* pInstance = new CMapElement_Interactable(pDevice, pContext); @@ -187,8 +263,14 @@ void CMapElement_Interactable::Free() SAFE_RELEASE(m_pRigidBody); SAFE_RELEASE(m_pShaderCom); - for (auto& pModel : m_pModelComs) + if (nullptr != m_pInfoInstance) { + CInfoInstance* pInfo = m_pInfoInstance; + m_pInfoInstance = nullptr; + pInfo->Deregist_ActiveInteractive(this); + } + for (auto& pModel : m_pModelComs){ SAFE_RELEASE(pModel); + } } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/Monster.cpp b/Jusin154_Team3D/Client/Private/Monster.cpp index 223f90e9e..ead8955e3 100644 --- a/Jusin154_Team3D/Client/Private/Monster.cpp +++ b/Jusin154_Team3D/Client/Private/Monster.cpp @@ -92,28 +92,25 @@ HRESULT CMonster::Render_OutLine() return E_FAIL; } - GUI::SetNextItemWidth(80.f); - static _float3 vOutLineColor = _float3(1.f, 0.960784376f, 0.933333397f); - static _float fOutLineThickness = { 5.f }; // 카메라로부터 거리가 멀어지면 늘어나게끔 바꾸는걸 추천함 - static _float fOutLineScale = { 1.f }; - static _float fOutLinePower = { 1.f }; - GUI::ColorPicker3("vOutLineColor", (_float*)&vOutLineColor); - GUI::SliderFloat("Thickness", &fOutLineThickness, 0.1f, 2.f, "%.1f"); - GUI::SliderFloat("Scale", &fOutLineScale, 0.1f, 2.f, "%.1f"); - GUI::SliderFloat("Power", &fOutLinePower, 0.1f, 2.f, "%.1f"); Compute_Depth(); _float fRatio = (m_fCamDepth / *m_pGameInstance->Get_CurrentCameraFar()); - fOutLineThickness = CMyTools::Lerp_f1D(2.f, 6.f, fRatio); - if (FAILED(m_pShaderCom->Bind_RawValue("g_vOutLineColor", &vOutLineColor, sizeof(_float3)))) { + m_fOutLineThickness = CMyTools::Lerp_f1D(2.f, 6.f, fRatio); + if (m_fOutLineThickness > 6.f) { + m_fOutLineThickness = 6.f; + } + else if (m_fOutLineThickness < 2.f) { + m_fOutLineThickness = 2.f; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_vOutLineColor", &m_vOutLineColor, sizeof(_float3)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLineThickness", &(fOutLineThickness), sizeof(_float)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLineThickness", &m_fOutLineThickness, sizeof(_float)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLineScale", &(fOutLineScale), sizeof(_float)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLineScale", &m_fOutLineScale, sizeof(_float)))) { return E_FAIL; } - if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLinePower", &(fOutLinePower), sizeof(_float)))) { + if (FAILED(m_pShaderCom->Bind_RawValue("g_fOutLinePower", &m_fOutLinePower, sizeof(_float)))) { return E_FAIL; } if (FAILED(m_pShaderCom->Bind_RawValue("g_vCamPosition", m_pGameInstance->Get_CamPosition(), sizeof(_float4)))) { @@ -154,7 +151,12 @@ _bool CMonster::Get_Damage(_float fDamage) _float2 CMonster::Get_Hp() { - return { m_pStat->Get_Stat(ENUM_CLASS(STAT::HP)), m_pStat->Get_Stat(ENUM_CLASS(STAT::MAXHP)) }; + return { m_pStat->Get_Stat().fCurrentHp, m_pStat->Get_Stat().fMaxHp }; +} + +CStat* CMonster::Get_Stat() +{ + return m_pStat; } HRESULT CMonster::Ready_Components(void*pArg) diff --git a/Jusin154_Team3D/Client/Private/MonsterInfo.cpp b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp index 46ff3b6c5..789d1815a 100644 --- a/Jusin154_Team3D/Client/Private/MonsterInfo.cpp +++ b/Jusin154_Team3D/Client/Private/MonsterInfo.cpp @@ -111,6 +111,11 @@ pair CMonsterInfo::Get_NearestPlayerAlly(_fvector vPos) return { pNearestPlayerAlly, pNearestPlayerAllyTransform }; } +CMonster* CMonsterInfo::Get_TargetMonster() +{ + return m_pLockOnMonster; +} + HRESULT CMonsterInfo::Refresh_LockOnMonsters() { SAFE_RELEASE(m_pLockOnMonster); @@ -122,9 +127,9 @@ HRESULT CMonsterInfo::Refresh_LockOnMonsters() _vector vToMonsterDir; _bool Aim = false; _float fFovy = 0.f; - if (m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::GAMEPLAY), LAYER_PLAYER) != nullptr) + if (m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_PLAYER) != nullptr) { - Aim = m_pGameInstance->Get_Layer(ENUM_CLASS(LEVEL::GAMEPLAY), LAYER_PLAYER)->Get_Object()->Get_Aim(); + Aim = m_pGameInstance->Get_Layer(CURRENT_LEVEL, LAYER_PLAYER)->Get_Object()->Get_Aim(); } if (Aim) { @@ -135,14 +140,15 @@ HRESULT CMonsterInfo::Refresh_LockOnMonsters() } { // 뷰프러스텀 순회해서 가장 중앙에 근접한 몬스터 찾기 - for (list::iterator iter = m_ActiveMonsters.begin(); iter != m_ActiveMonsters.end(); ++iter) { + for (list::iterator iter = m_ActiveMonsters.begin(); iter != m_ActiveMonsters.end(); ++iter) + { // (카메라의 룩)과 (카메라 -> 몬스터 방향 벡터)를 내적해서 가장 큰 크기가 나온 몬스타가 락온 대상 CMonster* pMonster = (*iter); if (pMonster->Get_Hp().x <= 0) { continue; } - vMonsterPos = pMonster->Get_WorldPostion(); + vMonsterPos = pMonster->Get_LockOnPos(); vToMonsterDir = vMonsterPos - vCameraPos; _float fDotResult = CMyTools::DirectionCompare(vCameraLook, vToMonsterDir); if (fDotResult <= cosf(fFovy)) { @@ -159,7 +165,10 @@ HRESULT CMonsterInfo::Refresh_LockOnMonsters() m_pLockOnMonster = pMonster; fMaxDot = fDotResult; } + + } + } if (nullptr != m_pLockOnMonster) { SAFE_ADDREF(m_pLockOnMonster); diff --git a/Jusin154_Team3D/Client/Private/NomalJap.cpp b/Jusin154_Team3D/Client/Private/NomalJap.cpp index 41a6b1429..40811795d 100644 --- a/Jusin154_Team3D/Client/Private/NomalJap.cpp +++ b/Jusin154_Team3D/Client/Private/NomalJap.cpp @@ -172,9 +172,9 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject, void* pArg) { /* 대상 위치 지정 */ m_bHit = false; - CUnit* pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); - if (nullptr != pTargetUnit) { - XMStoreFloat4(&m_vTargetPos, pTargetUnit->Get_LockOnPos()); + m_pInfoInstance->Get_LockOnInfo(m_Info); + if (nullptr != m_Info.pUnit) { + XMStoreFloat4(&m_vTargetPos, m_Info.pUnit->Get_LockOnPos()); if (XMVectorGetX(XMVector3Length(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))) >= 35.f) { //거리가 일정 이상이라면 그냥 정면으로 발사 XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_fLinearSpeed * 0.5f); diff --git a/Jusin154_Team3D/Client/Private/Player.cpp b/Jusin154_Team3D/Client/Private/Player.cpp index facfcf06c..952acf077 100644 --- a/Jusin154_Team3D/Client/Private/Player.cpp +++ b/Jusin154_Team3D/Client/Private/Player.cpp @@ -13,6 +13,7 @@ #include "CallBack_Playable_HitReport.h" #include "Monster.h" #include "Broom.h" +#include "MapElement_Interactable.h" #pragma region STATE #include "State_Idle.h" @@ -138,10 +139,10 @@ __super::Update(fTimeDelta); m_pCallBack_HitReport->Set_CurrentSlop(); } if (m_pGameInstance->Mouse_Down(DIM_RBUTTON)) - m_pInfoInstance->Key_Input(ENUM_CLASS(KEYINPUT::DIM_RBUTTON_DOWN)); + m_pInfoInstance->Mouse_Input(ENUM_CLASS(KEYINPUT::DIM_RBUTTON_DOWN)); if (m_pGameInstance->Mouse_Up(DIM_RBUTTON)) { - m_pInfoInstance->Key_Input(ENUM_CLASS(KEYINPUT::DIM_RBUTTON_UP)); + m_pInfoInstance->Mouse_Input(ENUM_CLASS(KEYINPUT::DIM_RBUTTON_UP)); m_bAim = false; } @@ -157,14 +158,17 @@ void CPlayer::Late_Update(_float fTimeDelta) __super::Late_Update(fTimeDelta); - if (nullptr != m_pLockOnMonster) { - if (false == m_pLockOnMonster->isDead()) { - static_cast(m_pLockOnMonster)->Set_DrawOutLine(); + if (nullptr != m_LockOnInfo.pUnit) { + if (false == m_LockOnInfo.pUnit->isDead()) { + static_cast(m_LockOnInfo.pUnit)->Set_DrawOutLine(); } else { - m_pLockOnMonster = nullptr; + m_LockOnInfo.pUnit = nullptr; } } + if (nullptr != m_LockOnInfo.pInteractive) { + static_cast(m_LockOnInfo.pInteractive)->Set_DrawOutLine(); + } //////////////////////////////////////////////////////////////////////////// _vector look = XMVector3Normalize(m_pTransformCom->Get_State(STATE::LOOK)); @@ -272,7 +276,7 @@ void CPlayer::Render_CameraCoordinateSystem() _vector xmvLook = XMVector4Normalize(XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); _float2 vLook = { XMVectorGetX(xmvLook), XMVectorGetZ(xmvLook) }; GUI::Begin("Player_CAM_COOORD"); - GUI::Text("%d", m_pLockOnMonster); + GUI::Text("%d", m_LockOnInfo.pUnit); GUI::Text("W : %.2f, %.2f, %.2f", m_vCameraLookDir.x, 0.f, m_vCameraLookDir.z); GUI::Text("A : %.2f, %.2f, %.2f", -m_vCameraRightDir.x, 0.f, -m_vCameraRightDir.z); @@ -433,12 +437,13 @@ HRESULT CPlayer::Bind_ShaderResources() } void CPlayer::ReLockOnTarget() { - m_pLockOnMonster = m_pInfoInstance->Get_LockOnUnit(); - if (nullptr != m_pLockOnMonster) { - if (true == m_pLockOnMonster->isDead()) { - m_pLockOnMonster = nullptr; + m_pInfoInstance->Get_LockOnInfo(m_LockOnInfo); + if (nullptr != m_LockOnInfo.pUnit) { + if (true == m_LockOnInfo.pUnit->isDead()) { + m_LockOnInfo.pUnit = nullptr; } } + //m_pLockOnMonster->Get_State } void CPlayer::SetGravity() diff --git a/Jusin154_Team3D/Client/Private/Player_States.cpp b/Jusin154_Team3D/Client/Private/Player_States.cpp index 77f672eed..a5cc803b3 100644 --- a/Jusin154_Team3D/Client/Private/Player_States.cpp +++ b/Jusin154_Team3D/Client/Private/Player_States.cpp @@ -1057,13 +1057,26 @@ void CPlayer::Behavior_SpellEnter() } break; default: + pairAnimInfo = m_Animation[STATEANIM::SPELL_FAIL]; + + Add_Event(pairAnimInfo.first, + [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::WAND_END, Get_PartObject()); }, + 0.2f); + + break; } } else { pairAnimInfo = m_Animation[STATEANIM::SPELL_FAIL]; + + Add_Event(pairAnimInfo.first, + [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::WAND_END, Get_PartObject()); }, + 0.2f); + + } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); diff --git a/Jusin154_Team3D/Client/Private/TrailObject.cpp b/Jusin154_Team3D/Client/Private/TrailObject.cpp index 283fdc52c..4040b2ee5 100644 --- a/Jusin154_Team3D/Client/Private/TrailObject.cpp +++ b/Jusin154_Team3D/Client/Private/TrailObject.cpp @@ -250,6 +250,9 @@ HRESULT CTrailObject::Ready_Components(void* pArg) void CTrailObject::Trail_Update(_fmatrix WorldMat, _float fTimeDelta) { + if (m_bVisible == false) + return; + m_pTrailCom->Trail_Update(fTimeDelta, WorldMat); } diff --git a/Jusin154_Team3D/Client/Private/Troll.cpp b/Jusin154_Team3D/Client/Private/Troll.cpp index 307db2b71..38794912e 100644 --- a/Jusin154_Team3D/Client/Private/Troll.cpp +++ b/Jusin154_Team3D/Client/Private/Troll.cpp @@ -7,6 +7,9 @@ #include "InfoInstance.h" #include "Effect_Container.h" #include "EffectParts.h" +#include "EffectPool.h" +#include "Layer.h" +#include "TrailObject.h" #pragma region STATE #include "State_Idle.h" @@ -61,7 +64,14 @@ HRESULT CTroll::Initialize(void* pArg) - m_pCharacter_Controller->Set_Position(XMVectorSet(3.f, 5.f, -20.f, 1.f)); + m_pCharacter_Controller->Set_Position(XMVectorSet(110.f, 24.f, 135.f, 1.f)); + + m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object(); + SAFE_ADDREF(m_pEffectPool); + + m_pLeftHand_BoneMat = m_pModelCom->Get_BoneMatrixPtr("LeftHand"); + m_pRightHand_BoneMat = m_pModelCom->Get_BoneMatrixPtr("RightHand"); + m_pWeapon_BoneMat = Get_PartObject()->Get_Component()->Get_BoneMatrixPtr("Bone"); return S_OK; } @@ -109,6 +119,32 @@ void CTroll::Update(_float fTimeDelta) +#pragma region TRAIL_UPDATE + + //_matrix WorldMat = m_pTransformCom->Get_XMWorldMatrix(); + + //_matrix LeftHandMatrix = {}; + //_matrix RightHandMatrix = {}; + //_matrix WeaponMatrix = {}; + + //LeftHandMatrix = XMLoadFloat4x4(m_pLeftHand_BoneMat); + //RightHandMatrix = XMLoadFloat4x4(m_pRightHand_BoneMat); + //WeaponMatrix = XMLoadFloat4x4(m_pWeapon_BoneMat); + + + //for (int i = 0; i < 3; ++i) { + // LeftHandMatrix.r[i] = XMVector3Normalize(LeftHandMatrix.r[i]); + // RightHandMatrix.r[i] = XMVector3Normalize(RightHandMatrix.r[i]); + // WeaponMatrix.r[i] = XMVector3Normalize(WeaponMatrix.r[i]); + //} + + //_matrix WeaponSoket = WeaponMatrix * Get_PartObject()->Get_Component()->Get_XMWorldMatrix(); + + //m_pLeftTrail->Trail_Update(LeftHandMatrix * WorldMat, fTimeDelta); + //m_pRightTrail->Trail_Update(RightHandMatrix * WorldMat, fTimeDelta); + //m_pWeaponTrail->Trail_Update(WeaponSoket, fTimeDelta); + +#pragma endregion } void CTroll::Late_Update(_float fTimeDelta) @@ -122,21 +158,21 @@ void CTroll::Late_Update(_float fTimeDelta) } if (m_bLookAt) { - m_pTransformCom->LookAt_Lerp(XMLoadFloat4(&m_vTargetPos),fTimeDelta, 3.f); + m_pTransformCom->LookAt_Lerp(XMLoadFloat4(&m_vTargetPos), fTimeDelta, 3.f); } - + _vector vDir = XMLoadFloat4(&m_vTargetPos) - Get_WorldPostion(); vDir = XMVector4Normalize(vDir); _vector vLook = XMVector3Normalize( XMVectorSetY(m_pTransformCom->Get_State(STATE::LOOK), 0.f)); float dot = XMVectorGetX(XMVector3Dot(vLook, vDir)); - dot = max(-1.f, min(1.f, dot)); + dot = max(-1.f, min(1.f, dot)); - float angle = acosf(dot); + float angle = acosf(dot); m_fDegree = XMConvertToDegrees(angle); - m_fCross = XMVectorGetY(XMVector3Cross(vLook, vDir)); + m_fCross = XMVectorGetY(XMVector3Cross(vLook, vDir)); m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); m_pGameInstance->Add_RenderGroup(RENDER::SHADOW, this); @@ -283,13 +319,13 @@ HRESULT CTroll::Ready_Components() Desc.iSubKind = ENUM_CLASS(PXOBJECT::TROLL); Desc.pTransform = m_pTransformCom; Desc.eBodyType = ACTOR::CAPSULE; - Desc.fContactOffset = 0.3f; + Desc.fContactOffset = 0.001f; Desc.fMaterial = { 1.2f, 1.0f, 0.0f }; Desc.bAutoStepping = { false }; Desc.fStepOffset = { 0.05f }; Desc.fRadius = 1.2f; Desc.fHeight = 1.5f; - Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Monster_HitReport::Create(); + Desc.pCallback_HitReport = m_pCallBack_HitReport = CCallBack_Troll_HitReport::Create(); Desc.pCallback_Behavior = m_pCallBack_Behavior = CCallBack_Monster_Behavior::Create(); Desc.eClimbingMode = PSX::PxCapsuleClimbingMode::eEASY; Desc.fWalkableSlope = 45.f; @@ -310,6 +346,7 @@ HRESULT CTroll::Ready_Components() if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_TROLL"), (CComponent**)&m_pStat))) { return E_FAIL; } + return S_OK; } @@ -345,7 +382,7 @@ HRESULT CTroll::Ready_Parts() PartsDesc.pParentTransform = m_pTransformCom; - + if (FAILED(Add_PartObject("Troll_Particle", g_iStaticLevel, &m_pTroll_Particle, &PartsDesc))) { @@ -382,6 +419,30 @@ HRESULT CTroll::Ready_Parts() m_pLeft_Smoke->Load("../Bin/Resources/Data/Effect/Troll/TrollSide/Troll_Smoke", static_cast(NEXT_LEVEL)); m_pLeft_Smoke->FollowParants(m_pModelCom->Get_BoneMatrixPtr("LeftArm")); + + if (FAILED(Add_PartObject("Left_Trail", g_iStaticLevel, &m_pLeftTrail, &PartsDesc))) { + return E_FAIL; + } + ; + + m_pLeftTrail->Load_Trail("../Bin/Resources/Data/Effect/Troll/TrollSide/Troll_Trail", static_cast(NEXT_LEVEL)); + m_pLeftTrail->Set_Visible(false); + + if (FAILED(Add_PartObject("Right_Trail", g_iStaticLevel, &m_pRightTrail, &PartsDesc))) { + return E_FAIL; + } + + m_pRightTrail->Load_Trail("../Bin/Resources/Data/Effect/Troll/TrollSide/Troll_Trail", static_cast(NEXT_LEVEL)); + m_pRightTrail->Set_Visible(false); + + if (FAILED(Add_PartObject("Weapon_Trail", g_iStaticLevel, &m_pWeaponTrail, &PartsDesc))) { + return E_FAIL; + } + + m_pWeaponTrail->Load_Trail("../Bin/Resources/Data/Effect/Troll/TrollSide/Troll_Swing_Trail", static_cast(NEXT_LEVEL)); + m_pWeaponTrail->Set_Visible(false); + + #pragma endregion return S_OK; } @@ -404,6 +465,15 @@ HRESULT CTroll::Bind_ShaderResources() return S_OK; } +void CTroll::Troll_Trail_Visible(_bool isTrailVisible) +{ + m_pLeftTrail->Set_Visible(isTrailVisible); + m_pRightTrail->Set_Visible(isTrailVisible); + + m_pLeftTrail->Get_Component()->Reset_Trail(); + m_pRightTrail->Get_Component()->Reset_Trail(); +} + CTroll* CTroll::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CTroll* pInstance = new CTroll(pDevice, pContext); @@ -448,36 +518,17 @@ void CTroll::Free() SAFE_RELEASE(m_pTroll_Particle2); SAFE_RELEASE(m_pRight_Smoke); SAFE_RELEASE(m_pLeft_Smoke); + SAFE_RELEASE(m_pEffectPool); + SAFE_RELEASE(m_pLeftTrail); + SAFE_RELEASE(m_pRightTrail); + SAFE_RELEASE(m_pWeaponTrail); } #ifdef _DEBUG void CTroll::Describe_Entity() { - GUI::Begin("Troll"); + __super::Describe_Entity(); - GUI::Checkbox("LookAt", &m_bLookAt); - - string AnimList = m_pModelCom->Get_AnimList(m_pModelCom->Get_AnimIndex()); - GUI::Text(AnimList.c_str()); - - GUI::Text("AnimTrack %.2f", m_pModelCom->Get_CurrentTrackPosition()); - GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio()); - - _float4 vMomentum = {}; - XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); - GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); - - _float3 Pos; - XMStoreFloat3(&Pos, Get_WorldPostion()); - - if (GUI::DragFloat3("Pos",(_float*)&Pos)) - { - 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/TrollSwing.cpp b/Jusin154_Team3D/Client/Private/TrollSwing.cpp new file mode 100644 index 000000000..8b362594e --- /dev/null +++ b/Jusin154_Team3D/Client/Private/TrollSwing.cpp @@ -0,0 +1,180 @@ +#include "pch.h" +#include "TrollSwing.h" + +#include "GameInstance.h" +#include "EffectParts.h" +#include "Wand.h" +#include "Player.h" + +CTrollSwing::CTrollSwing(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CTrollSwing::CTrollSwing(const CTrollSwing& rhs) + : CEffect_Container(rhs) +{ +} + +HRESULT CTrollSwing::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CTrollSwing::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/MonsterPackage/TrollSwing"))) + return E_FAIL; + + + m_wstrEffectName = L"TrollSwing"; + + + m_fDuration = 3.2f; + + return S_OK; +} + +void CTrollSwing::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CTrollSwing::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + + +} + +void CTrollSwing::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CTrollSwing::Pre_Setting(CGameObject* pObject, void* pArg) +{ + if (FAILED(__super::Pre_Setting(pObject, nullptr))) + return E_FAIL; + + _vector vPos = m_pOwner->Get_Component()->Get_State(STATE::POSITION); + + vPos += m_pOwner->Get_Component()->Get_State(STATE::LOOK) * 2.f; + + CEffectParts* pRockPT = Get_PartObject("Rock_PT_25"); + CEffectParts* pSmoke = Get_PartObject("Smoke"); + + pRockPT->Get_Component()->Set_State(STATE::POSITION, vPos + XMVectorSet(0.f, 0.5f, 0.f, 0.f)); + pSmoke->Get_Component()->Set_State(STATE::POSITION, vPos + XMVectorSet(0.f, 0.2f, 0.f, 0.f)); + + + pRockPT->Set_Visible(true); + pSmoke->Set_Visible(true); + + return S_OK; +} + +HRESULT CTrollSwing::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CTrollSwing::Ready_Child() +{ + return S_OK; +} + +CTrollSwing* CTrollSwing::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CTrollSwing* pInstance = new CTrollSwing(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CTrollSwing"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CTrollSwing::Clone(void* pArg, CGameObject* pOwner) +{ + CTrollSwing* pInstance = new CTrollSwing(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CTrollSwing"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CTrollSwing::OnCollision(CGameObject* pOther, void* pDesc) +{ + _int iIndex = CollisionCheck(); + + if (iIndex < 0) + return; + + if (m_isCollisionEnter == true) + return; + + m_isCollisionEnter = true; + + _vector vPos = XMVectorSet(m_Hitbuffer.touches[iIndex].position.x, m_Hitbuffer.touches[iIndex].position.y, m_Hitbuffer.touches[iIndex].position.z, 1.f); + + + for (auto& pPair : m_PartObjects) + { + pPair.second->Set_Visible(true); + pPair.second->Get_Component()->Set_State(STATE::POSITION, vPos); + } + + +} + +void CTrollSwing::Free() +{ + __super::Free(); + +} +#ifdef _DEBUG +void CTrollSwing::Describe_Entity() +{ + +} +#endif + +HRESULT CTrollSwing::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Client/Private/Troll_Nomal_Smoke.cpp b/Jusin154_Team3D/Client/Private/Troll_Nomal_Smoke.cpp new file mode 100644 index 000000000..5766c713b --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Troll_Nomal_Smoke.cpp @@ -0,0 +1,179 @@ +#include "pch.h" +#include "Troll_Nomal_Smoke.h" + +#include "GameInstance.h" +#include "EffectParts.h" +#include "Wand.h" +#include "Player.h" + +CTroll_Nomal_Smoke::CTroll_Nomal_Smoke(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CTroll_Nomal_Smoke::CTroll_Nomal_Smoke(const CTroll_Nomal_Smoke& rhs) + : CEffect_Container(rhs) +{ +} + +HRESULT CTroll_Nomal_Smoke::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CTroll_Nomal_Smoke::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/MonsterPackage/TrollNomalSmoke"))) + return E_FAIL; + + + m_wstrEffectName = L"Troll_Nomal_Smoke"; + + + m_fDuration = 2.5f; + + return S_OK; +} + +void CTroll_Nomal_Smoke::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CTroll_Nomal_Smoke::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + + +} + +void CTroll_Nomal_Smoke::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CTroll_Nomal_Smoke::Pre_Setting(CGameObject* pObject, void* pArg) +{ + if (FAILED(__super::Pre_Setting(pObject, nullptr))) + return E_FAIL; + + + _float4 vPos = *static_cast<_float4*>(pArg); // 위치 넘기기 + + CEffectParts* pRockPT = Get_PartObject("Rock_PT_15"); + CEffectParts* pSmoke = Get_PartObject("NomalSmoke"); + + + pRockPT->Get_Component()->Set_State(STATE::POSITION, XMLoadFloat4(&vPos) + XMVectorSet(0.f , 0.2f ,0.f, 0.f) ); + pSmoke->Get_Component()->Set_State(STATE::POSITION, XMLoadFloat4(&vPos) + XMVectorSet(0.f, 0.2f, 0.f, 0.f)); + + pRockPT->Set_Visible(true); + pSmoke->Set_Visible(true); + + return S_OK; +} + +HRESULT CTroll_Nomal_Smoke::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CTroll_Nomal_Smoke::Ready_Child() +{ + return S_OK; +} + +CTroll_Nomal_Smoke* CTroll_Nomal_Smoke::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CTroll_Nomal_Smoke* pInstance = new CTroll_Nomal_Smoke(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CTroll_Nomal_Smoke"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CTroll_Nomal_Smoke::Clone(void* pArg, CGameObject* pOwner) +{ + CTroll_Nomal_Smoke* pInstance = new CTroll_Nomal_Smoke(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CTroll_Nomal_Smoke"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CTroll_Nomal_Smoke::OnCollision(CGameObject* pOther, void* pDesc) +{ + _int iIndex = CollisionCheck(); + + if (iIndex < 0) + return; + + if (m_isCollisionEnter == true) + return; + + m_isCollisionEnter = true; + + _vector vPos = XMVectorSet(m_Hitbuffer.touches[iIndex].position.x, m_Hitbuffer.touches[iIndex].position.y, m_Hitbuffer.touches[iIndex].position.z, 1.f); + + + for (auto& pPair : m_PartObjects) + { + pPair.second->Set_Visible(true); + pPair.second->Get_Component()->Set_State(STATE::POSITION, vPos); + } + + +} + +void CTroll_Nomal_Smoke::Free() +{ + __super::Free(); + +} +#ifdef _DEBUG +void CTroll_Nomal_Smoke::Describe_Entity() +{ + +} +#endif + +HRESULT CTroll_Nomal_Smoke::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Client/Private/Troll_Rock.cpp b/Jusin154_Team3D/Client/Private/Troll_Rock.cpp index f7d2bc363..dfb5590e2 100644 --- a/Jusin154_Team3D/Client/Private/Troll_Rock.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_Rock.cpp @@ -58,7 +58,7 @@ void CTroll_Rock::Priority_Update(_float fTimeDelta) _matrix world = XMLoadFloat4x4(m_pTransformCom->Get_WorldMatrixPtr()); m_pTransformCom->Set_WorldMatrix(world); - m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::LOOK), fTimeDelta * 20.f); + m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::LOOK), fTimeDelta * 50.f); m_pTransformCom->Go_Straight(fTimeDelta); } diff --git a/Jusin154_Team3D/Client/Private/Troll_Rush_Hit.cpp b/Jusin154_Team3D/Client/Private/Troll_Rush_Hit.cpp new file mode 100644 index 000000000..16a5a8d98 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Troll_Rush_Hit.cpp @@ -0,0 +1,174 @@ +#include "pch.h" +#include "Troll_Rush_Hit.h" + +#include "GameInstance.h" +#include "EffectParts.h" +#include "Wand.h" +#include "Player.h" + +CTroll_Rush_Hit::CTroll_Rush_Hit(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CTroll_Rush_Hit::CTroll_Rush_Hit(const CTroll_Rush_Hit& rhs) + : CEffect_Container(rhs) +{ +} + +HRESULT CTroll_Rush_Hit::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CTroll_Rush_Hit::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/MonsterPackage/TrollRush"))) + return E_FAIL; + + + m_wstrEffectName = L"Troll_Nomal_Smoke"; + + + m_fDuration = 2.f; + + return S_OK; +} + +void CTroll_Rush_Hit::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CTroll_Rush_Hit::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + + +} + +void CTroll_Rush_Hit::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CTroll_Rush_Hit::Pre_Setting(CGameObject* pObject, void* pArg) +{ + if (FAILED(__super::Pre_Setting(pObject, nullptr))) + return E_FAIL; + + + _float4 vPos = *static_cast<_float4*>(pArg); // 위치 넘기기 + + CEffectParts* pSmoke = Get_PartObject("HitSmoke"); + + pSmoke->Get_Component()->Set_State(STATE::POSITION, XMLoadFloat4(&vPos)); + + pSmoke->Set_Visible(true); + return S_OK; +} + +HRESULT CTroll_Rush_Hit::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CTroll_Rush_Hit::Ready_Child() +{ + return S_OK; +} + +CTroll_Rush_Hit* CTroll_Rush_Hit::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CTroll_Rush_Hit* pInstance = new CTroll_Rush_Hit(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CTroll_Rush_Hit"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CTroll_Rush_Hit::Clone(void* pArg, CGameObject* pOwner) +{ + CTroll_Rush_Hit* pInstance = new CTroll_Rush_Hit(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CTroll_Rush_Hit"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CTroll_Rush_Hit::OnCollision(CGameObject* pOther, void* pDesc) +{ + _int iIndex = CollisionCheck(); + + if (iIndex < 0) + return; + + if (m_isCollisionEnter == true) + return; + + m_isCollisionEnter = true; + + _vector vPos = XMVectorSet(m_Hitbuffer.touches[iIndex].position.x, m_Hitbuffer.touches[iIndex].position.y, m_Hitbuffer.touches[iIndex].position.z, 1.f); + + + for (auto& pPair : m_PartObjects) + { + pPair.second->Set_Visible(true); + pPair.second->Get_Component()->Set_State(STATE::POSITION, vPos); + } + + +} + +void CTroll_Rush_Hit::Free() +{ + __super::Free(); + +} +#ifdef _DEBUG +void CTroll_Rush_Hit::Describe_Entity() +{ + +} +#endif + +HRESULT CTroll_Rush_Hit::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Client/Private/Troll_State_Stun.cpp b/Jusin154_Team3D/Client/Private/Troll_State_Stun.cpp new file mode 100644 index 000000000..66ba62201 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/Troll_State_Stun.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "Troll_State_Stun.h" +#include "GameInstance.h" +#include "Unit.h" + +CTroll_State_Stun::CTroll_State_Stun() + :CState_Root() +{ +} + +void CTroll_State_Stun::Enter() +{ + __super::Enter(); +} + +HRESULT CTroll_State_Stun::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_Stun::Exit() +{ + __super::Exit(); +} + +HRESULT CTroll_State_Stun::Initialize(TROLL_STATE_STUN* 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_Stun* CTroll_State_Stun::Create(TROLL_STATE_STUN* pDesc) +{ + CTroll_State_Stun* pInstance = new CTroll_State_Stun; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CTroll_State_Stun::Free() +{ + __super::Free(); +} + +void CTroll_State_Stun::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Client/Private/Troll_States.cpp b/Jusin154_Team3D/Client/Private/Troll_States.cpp index 12e7b516d..d3c97e8b2 100644 --- a/Jusin154_Team3D/Client/Private/Troll_States.cpp +++ b/Jusin154_Team3D/Client/Private/Troll_States.cpp @@ -4,12 +4,15 @@ #include "GameInstance.h" #include "Player.h" #include "Troll_Rock.h" +#include "EffectPool.h" +#include "TrailObject.h" #pragma region STATE #include "State_Idle.h" #include "State_IdleBreak.h" #include "State_Move.h" #include "State_Combat.h" +#include "Troll_State_Stun.h" #include "Troll_State_Rush.h" #include "Troll_State_BackHand_Swing.h" #include "State_Throw.h" @@ -29,7 +32,7 @@ void CTroll::Behavior_IdleEnter() HRESULT CTroll::Behavior_IdleExitCheck() { - if (m_fTargetDistance <= 18.f && m_fTargetDistance !=0) + if (m_fTargetDistance <= 18.f && m_fTargetDistance != 0) m_pFSM->Change_State(FSMSTATE::MOVE); return E_FAIL; @@ -48,16 +51,48 @@ void CTroll::Behavior_IdleBreakEnter() _int RandIndex = m_pGameInstance->Real_Random_Int(0, 3); switch (RandIndex) { - case 0: + case 0: //땅 두번구르기 왼발 오른발 pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK1]; + + Add_Event(pairAnimInfo.first, [this]() { + + _matrix HandMat = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("IK_LeftFoot")) * m_pTransformCom->Get_XMWorldMatrix(); + + _float4 vPosition = {}; + XMStoreFloat4(&vPosition, HandMat.r[3]); + + m_pEffectPool->Use_Skill(SKILL_TYPE::TROLL_NOMAL_SMOKE, this, &vPosition); + }, 0.3f); + + Add_Event(pairAnimInfo.first, [this]() { + + _matrix HandMat = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("IK_RightFoot")) * m_pTransformCom->Get_XMWorldMatrix(); + + _float4 vPosition = {}; + XMStoreFloat4(&vPosition, HandMat.r[3]); + + m_pEffectPool->Use_Skill(SKILL_TYPE::TROLL_NOMAL_SMOKE, this, &vPosition); + }, 0.7f); + break; - case 1: + case 1:// 방망이 pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK2]; break; - case 2: + case 2: // 발구르기 pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK3]; + + Add_Event(pairAnimInfo.first, [this]() { + + _matrix HandMat = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("IK_RightFoot")) * m_pTransformCom->Get_XMWorldMatrix(); + + _float4 vPosition = {}; + XMStoreFloat4(&vPosition, HandMat.r[3]); + + m_pEffectPool->Use_Skill(SKILL_TYPE::TROLL_NOMAL_SMOKE, this, &vPosition); + }, 0.2f); + break; - case 3: + case 3: //소리지르기 pairAnimInfo = m_Animation[STATEANIM::IDLE_BREAK4]; break; } @@ -66,8 +101,9 @@ void CTroll::Behavior_IdleBreakEnter() HRESULT CTroll::Behavior_IdleBreakExitCheck() { - if (m_pModelCom->IsFinishedAnim()) + if (m_pModelCom->IsFinishedAnim()){ m_pFSM->Change_State(FSMSTATE::MOVE); + } return E_FAIL; } @@ -85,7 +121,7 @@ void CTroll::Behavior_MoveEnter() m_pFSM->Enable_State(FSMSTATE::JOG); pairAnimInfo = m_Animation[STATEANIM::JOG_START]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); - + } HRESULT CTroll::Behavior_MoveExitCheck(_float fTimeDelta) @@ -111,7 +147,7 @@ HRESULT CTroll::Behavior_MoveExitCheck(_float fTimeDelta) return E_FAIL; } - + if (bTurnPlaying) { m_bLookAt = false; @@ -146,7 +182,7 @@ HRESULT CTroll::Behavior_MoveExitCheck(_float fTimeDelta) if (iCurrAnimIndex == m_Animation[STATEANIM::JOG_START].first) { _float fRatio = m_pModelCom->Get_CurrentTrackProgressRatio(); - if (fRatio >= 0.9f){ + if (fRatio >= 0.9f) { pairAnimInfo = m_Animation[STATEANIM::JOG_FWD]; m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } @@ -160,6 +196,7 @@ HRESULT CTroll::Behavior_MoveExitCheck(_float fTimeDelta) return S_OK; } + if (m_fTargetDistance <= 6.f && m_fTargetDistance != 0.f) m_pFSM->Change_State(FSMSTATE::COMBAT); @@ -194,7 +231,7 @@ HRESULT CTroll::Behavior_CombatExitCheck(_float fTimeDelta) return E_FAIL; } - if (m_fTargetDistance <= 6.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->Change_State(FSMSTATE::SLAM); } @@ -268,10 +305,12 @@ HRESULT CTroll::Behavior_RushExitCheck(_float fTimeDelta) { if (m_fDegree >= 90.f) { - if (m_fCross > 0) + if (m_fCross > 0){ pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_L]; - else + } + else{ pairAnimInfo = m_Animation[STATEANIM::IDLE_COMBAT_TURN_BWD_R]; + } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); Add_Event(pairAnimInfo.first, @@ -301,7 +340,7 @@ void CTroll::Behavior_ThrowEnter() m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); Add_Event(pairAnimInfo.first, - [this](){Get_PartObject()->Set_Visible(true);}, + [this]() {Get_PartObject()->Set_Visible(true); }, 0.95f); } @@ -323,6 +362,23 @@ HRESULT CTroll::Behavior_ThrowExitCheck(_float fTimeDelta) Add_Event(pairAnimInfo.first, [this]() {Get_PartObject()->Set_Attach(false); }, 0.25f); + + Add_Event(pairAnimInfo.first, + [this]() {Troll_Trail_Visible(false); }, + 0.6f); + + Add_Event(pairAnimInfo.first, [this]() { + + + Troll_Trail_Visible(true); + + _matrix HandMat = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("SKT_LeftHand")) * m_pTransformCom->Get_XMWorldMatrix(); + + _float4 vPosition = {}; + XMStoreFloat4(&vPosition, HandMat.r[3]); + + m_pEffectPool->Use_Skill(SKILL_TYPE::TROLL_NOMAL_SMOKE, this, &vPosition); + }, 0.1f); } } return S_OK; @@ -356,6 +412,18 @@ void CTroll::Behavior_SwingEnter() Add_Event(pairAnimInfo.first, [this]() {m_bLookAt = false; }, 0.2f); + + + Troll_Trail_Visible(true); + m_pWeaponTrail->Set_Visible(true); + m_pWeaponTrail->Get_Component()->Reset_Trail(); + + Add_Event(pairAnimInfo.first, + [this]() { + Troll_Trail_Visible(false); + m_pWeaponTrail->Set_Visible(false); + }, + 0.6f); } HRESULT CTroll::Behavior_SwingExitCheck(_float fTimeDelta) @@ -389,9 +457,26 @@ void CTroll::Behavior_SlamEnter() m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)]; + + Troll_Trail_Visible(true); + m_pWeaponTrail->Set_Visible(true); + + Add_Event(pairAnimInfo.first, + [this]() { + Troll_Trail_Visible(false); + m_pWeaponTrail->Set_Visible(false); + }, + 0.7f); + + Add_Event(m_Animation[STATEANIM::SLAM].first, [this]() { m_bLookAt = false; }, 0.2f); + + Add_Event(m_Animation[STATEANIM::SLAM].first, [this]() { + m_pEffectPool->Use_Skill(SKILL_TYPE::TROLL_ATTACK, this); + }, 0.3f); + } HRESULT CTroll::Behavior_SlamExitCheck(_float fTimeDelta) @@ -426,6 +511,17 @@ void CTroll::Behavior_BackHandSwingEnter() Add_Event(m_Animation[STATEANIM::BACKHAND_SWING_JOG].first, [this]() { m_bLookAt = false; }, 0.2f); + + Troll_Trail_Visible(true); + m_pWeaponTrail->Set_Visible(true); + m_pWeaponTrail->Get_Component()->Reset_Trail(); + + Add_Event(pairAnimInfo.first, + [this]() { + Troll_Trail_Visible(false); + m_pWeaponTrail->Set_Visible(false); + }, + 0.9f); } HRESULT CTroll::Behavior_BackHandSwingExitCheck(_float fTimeDelta) @@ -446,6 +542,34 @@ void CTroll::Behavior_BackHandSwingExit() m_pFSM->Disable_State(FSMSTATE::BACKHAND_SWING); } +void CTroll::Behavior_StunEnter() +{ + m_pFSM->Enable_State(FSMSTATE::STUN); + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + pair<_uint, _bool> pairAnimInfo; + + m_bLookAt = false; + if (iCurrAnimIndex == m_Animation[STATEANIM::RUSH_LOOP].first) + { + pairAnimInfo = m_Animation[STATEANIM::STUN]; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CTroll::Behavior_StunExitCheck(_float fTimeDelta) +{ + if (true == m_pModelCom->IsFinishedAnim()) { + m_pFSM->Change_State(FSMSTATE::IDLEBREAK); + return E_FAIL; + } + return S_OK; +} + +void CTroll::Behavior_StunExit() +{ + m_pFSM->Disable_State(FSMSTATE::STUN); +} + void CTroll::Behavior_HitEnter() { m_pFSM->Enable_State(FSMSTATE::HIT); @@ -471,7 +595,7 @@ void CTroll::Behavior_HitEnter() pairAnimInfo = m_Animation[STATEANIM::HIT_BWD3]; break; } - } + } m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); } @@ -488,7 +612,7 @@ HRESULT CTroll::Behavior_HitExitCheck() return S_OK; } } - + if (m_pModelCom->IsFinishedAnim()) { m_pFSM->Change_State(FSMSTATE::COMBAT); m_bLookAt = true; @@ -604,6 +728,18 @@ void CTroll::Add_FSM() m_States.emplace(FSMSTATE::BACKHAND_SWING, CTroll_State_BackHand_Swing::Create(&Desc)); } #pragma endregion +#pragma region Behavior_Combat_Focus + { + CTroll_State_Stun::TROLL_STATE_STUN Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_StunEnter(); }; + Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_StunExitCheck(fTimeDelta); }; + Desc.funcExitEvent = [this]() { Behavior_StunExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::STUN, CTroll_State_Stun::Create(&Desc)); + } +#pragma endregion #pragma region Behavior_Hit { @@ -643,12 +779,12 @@ void CTroll::Set_Anim() m_Animation[STATEANIM::SPRINT] = { 90, true }; m_Animation[STATEANIM::SLAM] = { 66,false }; // 도끼 찍기 - m_Animation[STATEANIM::SKILL2] = { 70,false }; + m_Animation[STATEANIM::SKILL2] = { 70,false }; m_Animation[STATEANIM::THROW_ROCK_START] = { 77,false }; m_Animation[STATEANIM::THROW_ROCK] = { 74,false }; - m_Animation[STATEANIM::RUSH_START] = { 55,false }; + m_Animation[STATEANIM::RUSH_START] = { 55,false }; m_Animation[STATEANIM::RUSH_LOOP] = { 54,true }; m_Animation[STATEANIM::RUSH_END] = { 56,false }; @@ -664,7 +800,7 @@ void CTroll::Set_Anim() m_Animation[STATEANIM::HIT_FACE_END] = { 157, false }; // m_Animation[STATEANIM::STUN] = { 60, false }; // - + m_Animation[STATEANIM::KNOCKDOWN_BWD] = { 165, false }; // diff --git a/Jusin154_Team3D/Client/Private/UI_Manager.cpp b/Jusin154_Team3D/Client/Private/UI_Manager.cpp index 34c238a3d..e5e5f05c5 100644 --- a/Jusin154_Team3D/Client/Private/UI_Manager.cpp +++ b/Jusin154_Team3D/Client/Private/UI_Manager.cpp @@ -210,6 +210,7 @@ void CUI_Manager::Free() { __super::Free(); + m_Event_map.clear(); SAFE_RELEASE(m_pVIBufferCom); } #ifdef _DEBUG diff --git a/Jusin154_Team3D/Client/Private/WandEnd.cpp b/Jusin154_Team3D/Client/Private/WandEnd.cpp new file mode 100644 index 000000000..366c24ff3 --- /dev/null +++ b/Jusin154_Team3D/Client/Private/WandEnd.cpp @@ -0,0 +1,178 @@ +#include "pch.h" +#include "WandEnd.h" + +#include "GameInstance.h" +#include "EffectParts.h" +#include "Wand.h" + +CWandEnd::CWandEnd(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CEffect_Container{ pDevice, pContext } +{ +} + +CWandEnd::CWandEnd(const CWandEnd& rhs) + : CEffect_Container(rhs) +{ +} + +HRESULT CWandEnd::Initialize_Prototype() +{ + + return S_OK; + +} + +HRESULT CWandEnd::Initialize(void* pArg) +{ + if (FAILED(__super::Initialize(pArg))) + return E_FAIL; + + if (FAILED(Ready_Components(pArg))) + return E_FAIL; + + + if (FAILED(Load_Package("../Bin/Resources/Data/Effect/Package/WandEnd"))) + return E_FAIL; + + m_wstrEffectName = L"Lumos"; + + m_pWandPt = Get_PartObject("WandParticle_R"); + + SAFE_ADDREF(m_pWandPt); + + m_fDuration = 2.f; + + m_Events.emplace(0.4f, [&]() { + m_isParticleEnd = true; + + m_pWandPt->Get_Component()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f)); + }); + + return S_OK; +} + +void CWandEnd::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); + +} + +void CWandEnd::Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Update(fTimeDelta); + + Update_Event(fTimeDelta); + + + if (m_isParticleEnd == true) + return; + + CWand* pWand = static_cast(m_pOwner); + + if (pWand == nullptr) + return; + + m_pWandPt->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); + +} + +void CWandEnd::Late_Update(_float fTimeDelta) +{ + if (m_bVisible == false) + return; + + __super::Late_Update(fTimeDelta); + + +} + +HRESULT CWandEnd::Pre_Setting(CGameObject* pObject, void* pArg) +{ + if (FAILED(__super::Pre_Setting(pObject))) + return E_FAIL; + + CWand* pWand = static_cast(m_pOwner); + + if (pWand == nullptr) + return E_FAIL; + + m_pWandPt->Set_Visible(true); + m_pWandPt->Get_Component()->Set_State(STATE::POSITION, pWand->Get_WorldPostion()); + m_isParticleEnd = false; + + return S_OK; +} + +HRESULT CWandEnd::Ready_Components(void* pArg) +{ + if (FAILED(__super::Ready_Components(pArg))) { + return E_FAIL; + } + + return S_OK; +} + +HRESULT CWandEnd::Ready_Child() +{ + return S_OK; +} + +CWandEnd* CWandEnd::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CWandEnd* pInstance = new CWandEnd(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CWandEnd"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + + +CGameObject* CWandEnd::Clone(void* pArg, CGameObject* pOwner) +{ + CWandEnd* pInstance = new CWandEnd(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CWandEnd"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CWandEnd::OnCollision(CGameObject* pOther, void* pDesc) +{ + //CTransform* pOtherTransform = p + ON_COLLISION_INFO* CollisionDesc = static_cast(pDesc); + +} + +void CWandEnd::Free() +{ + __super::Free(); + + Safe_Release(m_pWandPt); + +} +#ifdef _DEBUG + +void CWandEnd::Describe_Entity() +{ + +} + +#endif // _DEBUG + +HRESULT CWandEnd::Bind_ShaderResources() +{ + return S_OK; +} + + diff --git a/Jusin154_Team3D/Client/Public/Bombard.h b/Jusin154_Team3D/Client/Public/Bombard.h index 972a1e5ac..199da83b9 100644 --- a/Jusin154_Team3D/Client/Public/Bombard.h +++ b/Jusin154_Team3D/Client/Public/Bombard.h @@ -30,10 +30,17 @@ class CBombard final : public CEffect_Container HRESULT Ready_Child(); HRESULT Bind_ShaderResources() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; + +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; private: _wstring m_wstrEffectName = {}; class CEffectParts* m_pLight_Projectile = {}; - _vector m_vCameraLook = {}; + + _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; // 현재 발사 된 위치 + _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; // 현재 타게팅 된 위치 + _float m_fLinearSpeed = 2.f; + _float3 m_vCameraLook = {}; public: static CBombard* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Client/Public/CallBack_Troll_Behavior.h b/Jusin154_Team3D/Client/Public/CallBack_Troll_HitReport.h similarity index 88% rename from Jusin154_Team3D/Client/Public/CallBack_Troll_Behavior.h rename to Jusin154_Team3D/Client/Public/CallBack_Troll_HitReport.h index df57611c1..afaee6d62 100644 --- a/Jusin154_Team3D/Client/Public/CallBack_Troll_Behavior.h +++ b/Jusin154_Team3D/Client/Public/CallBack_Troll_HitReport.h @@ -5,7 +5,7 @@ NS_BEGIN(Client) -class CCallBack_Troll_Behavior final : public PSX::PxUserControllerHitReport +class CCallBack_Troll_HitReport final : public PSX::PxUserControllerHitReport { // 구현 예시 // CCT는 RigidBody의 PxSimulationEventCallback에 안걸리고, 이 전용 콜백에서 처리되는 구조임 @@ -14,9 +14,9 @@ class CCallBack_Troll_Behavior final : public PSX::PxUserControllerHitReport // PxControllerBehaviorCallback = "부딪힌 것에 대해 어떤 행동 정책을 쓸지 물어봄(질의)" // PxSimulationEventCallback = "씬 전체에 대한 글로벌 콜백(일반 물리 이벤트)" private: - CCallBack_Troll_Behavior(); + CCallBack_Troll_HitReport(); public: - ~CCallBack_Troll_Behavior(); + ~CCallBack_Troll_HitReport(); public: // PxUserControllerHitReport을(를) 통해 상속됨 @@ -37,6 +37,6 @@ class CCallBack_Troll_Behavior final : public PSX::PxUserControllerHitReport CGameInstance* m_pGameInstance = { nullptr }; public: - static CCallBack_Troll_Behavior* Create(); + static CCallBack_Troll_HitReport* Create(); }; NS_END diff --git a/Jusin154_Team3D/Client/Public/CameraLockOn.h b/Jusin154_Team3D/Client/Public/CameraLockOn.h index 60ddba7ea..e32e55754 100644 --- a/Jusin154_Team3D/Client/Public/CameraLockOn.h +++ b/Jusin154_Team3D/Client/Public/CameraLockOn.h @@ -32,6 +32,10 @@ class CCameraLockOn final : public CUIObject virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; +private: + virtual void Visible(_bool Visible) override; + void Update_Target(); + private: CInfoInstance* m_pInfoInstance = { nullptr }; CTexture* m_pDiffuse_TextureCom = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 3d4505fc2..5d21dc24a 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -29,7 +29,10 @@ namespace Client BEAST_PETTING_BRUSH, BEAST_FEED, NAB_SACK, // 하늘색 JAP, REVELIO, PROTEGO, STUPEFY, // 검은색 ANCIENT_MAGIC_THROW, ANCIENT_MAGIC, ALOHOMORA, PETRIFICUS_TOTALUS, - JAP_SIDE, BOMBARDA_SIDE, DESCENDO_SIDE, LEVIOSO_SIDE, END + JAP_SIDE, BOMBARDA_SIDE, DESCENDO_SIDE, LEVIOSO_SIDE, WAND_END, + + TROLL_ATTACK, TROLL_RUSH_HIT, TROLL_NOMAL_SMOKE, GOBLIN_PROTEGO, + END }; enum class BLOOM_TYPE { NONE, BASIC, MULTIPLY, END }; @@ -42,7 +45,7 @@ namespace Client DIM_RBUTTON_UP, DIM_RBUTTON_DOWN, END }; - enum class MOUSEINPUT { LBUTTON, RBUTTON }; + enum class ELEMENT_INTERACTABLE_ID { BARREL, BOX, TABLE, END }; } diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h index a3c50003b..96502e46a 100644 --- a/Jusin154_Team3D/Client/Public/Client_Struct.h +++ b/Jusin154_Team3D/Client/Public/Client_Struct.h @@ -2,6 +2,7 @@ NS_BEGIN(Engine) class CModel; class CRigidBody_Static; + class CUnit; NS_END namespace Client @@ -35,4 +36,26 @@ namespace Client _float fPreview{}; _float fVidio{}; }SPELL_INFO; + + typedef struct tagLockOnInfo { + CUnit* pUnit = { nullptr }; + class CMapElement_Interactable* pInteractive = { nullptr }; + }LOCKON_INFO; + + typedef struct tagUnitInfo + { + _wstring pUnit_Name; + _float fCurrentHp{}; + _float fMaxHp{}; + _float fTargetHp{}; + _float fMelee{}; + _float fMagic{}; + _float fDefense{}; + _float fSpeed{}; + _float fAgility{}; + _int iLevel{}; + _float fExprince{}; + _float fMaxExprience{}; + _int iGold{}; + }UNITINFO; }; diff --git a/Jusin154_Team3D/Client/Public/EffectPool.h b/Jusin154_Team3D/Client/Public/EffectPool.h index f3cc94e01..a1d0a1810 100644 --- a/Jusin154_Team3D/Client/Public/EffectPool.h +++ b/Jusin154_Team3D/Client/Public/EffectPool.h @@ -34,6 +34,7 @@ class CEffectPool final : public CGameObject HRESULT Ready_Components(); HRESULT Bind_ShaderResources(); HRESULT Ready_Effect(); + HRESULT Ready_MonsterEffect(); public: static CEffectPool* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; diff --git a/Jusin154_Team3D/Client/Public/Effect_Container.h b/Jusin154_Team3D/Client/Public/Effect_Container.h index b190a0fcc..648379041 100644 --- a/Jusin154_Team3D/Client/Public/Effect_Container.h +++ b/Jusin154_Team3D/Client/Public/Effect_Container.h @@ -24,7 +24,7 @@ class CEffect_Container abstract : public CContainerObject HRESULT Load_Directory(const _char* pPath); virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr); HRESULT Load_Package(const _char* pPath); - _uint Get_SkillType() const { return m_iSkillType; } + _uint Get_SkillType() const { return m_iSkillType; } void Reset_Light(); protected: @@ -58,7 +58,7 @@ class CEffect_Container abstract : public CContainerObject map<_float, function> m_Events = {}; _uint m_iSkillType = ENUM_CLASS(SKILL_TYPE::END); _bool m_bHasDamage = { false }; - + LOCKON_INFO m_Info = {}; public: virtual void Free() override; }; diff --git a/Jusin154_Team3D/Client/Public/Enemy_HpBar.h b/Jusin154_Team3D/Client/Public/Enemy_HpBar.h index 74d34a964..e2667fd8b 100644 --- a/Jusin154_Team3D/Client/Public/Enemy_HpBar.h +++ b/Jusin154_Team3D/Client/Public/Enemy_HpBar.h @@ -28,7 +28,8 @@ class CEnemy_HpBar final : public CElementObject void Hit(_float fTimeDelta); virtual void SizeUpX(_float SizeX) override; - void Set_Enemt_Info(void* pArg); + void Update_Target(); + private: virtual HRESULT Bind_ShaderResources() override; virtual HRESULT Ready_Components(void* pArg) override; @@ -41,12 +42,13 @@ class CEnemy_HpBar final : public CElementObject CTexture* m_pDiffuse_TextureCom2 = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + CInfoInstance* m_pInfoInstance = { nullptr }; _float m_fMaxHp{}; _float m_fCurrentHp{}; + _float m_fTargetHp{}; _float m_fHpBar{}; _float m_fDamage{}; - _float m_fTargetHp{}; _bool m_bAnimation = { false }; public: diff --git a/Jusin154_Team3D/Client/Public/Enemy_Info.h b/Jusin154_Team3D/Client/Public/Enemy_Info.h index 8a754a07a..7af86efd8 100644 --- a/Jusin154_Team3D/Client/Public/Enemy_Info.h +++ b/Jusin154_Team3D/Client/Public/Enemy_Info.h @@ -31,19 +31,20 @@ class CEnemy_Info final : public CElementObject virtual HRESULT Initialize(void* pArg) override; public: - void Set_Info(_int Level, _wstring Name); + void Update_Target(); private: CTexture* m_pDiffuse_TextureCom = { nullptr }; CShader* m_pShaderCom = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; + CInfoInstance* m_pInfoInstance = { nullptr }; _float2 m_fFontPos{}; _float m_fFont2OffSet{}; _wstring m_pEnemy_Name; _wstring m_pLevel; _bool m_bAnimation = {false}; - + _bool m_bTarget = { false }; public: static CEnemy_Info* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override; diff --git a/Jusin154_Team3D/Client/Public/Goblin_Mage.h b/Jusin154_Team3D/Client/Public/Goblin_Mage.h index 0d6026f22..a4328330e 100644 --- a/Jusin154_Team3D/Client/Public/Goblin_Mage.h +++ b/Jusin154_Team3D/Client/Public/Goblin_Mage.h @@ -27,6 +27,7 @@ class CGoblin_Mage final : public CMonster virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; virtual HRESULT Render_Shadow() 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; diff --git a/Jusin154_Team3D/Client/Public/Goblin_Protego.h b/Jusin154_Team3D/Client/Public/Goblin_Protego.h new file mode 100644 index 000000000..284adbc40 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Goblin_Protego.h @@ -0,0 +1,53 @@ +#pragma once + +#include "Client_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Client) + +class CGoblin_Protego final : public CEffect_Container +{ +private: + CGoblin_Protego(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CGoblin_Protego(const CGoblin_Protego& rhs); + virtual ~CGoblin_Protego() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +public: + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + + class CEffectParts* m_pSphere = { nullptr }; + class CEffectParts* m_pBottom = { nullptr }; + class CEffectParts* m_pCircle = { nullptr }; + + _float m_fSizeAccTime = {}; + _float m_fAmountSize = {}; + _float m_fSpeed = {}; + +public: + static CGoblin_Protego* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index ec4b93474..5b380deaf 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -7,6 +7,7 @@ NS_BEGIN(Engine) class CGameInstance; class CTransform; class CUnit; +class CState; NS_END NS_BEGIN(Client) @@ -35,8 +36,9 @@ DECLARE_SINGLETON(CInfoInstance) HRESULT Regist_ActiveMonster(class CMonster* pUnit); HRESULT Deregist_ActiveMonster(class CMonster* pUnit); - class CUnit* Get_LockOnUnit(); + void Get_LockOnInfo(LOCKON_INFO& Info); pair Get_NearestPlayerAlly(_fvector vPos); + CMonster* Get_TargetMonster(); #pragma endregion #pragma region MAP_INFO HRESULT Load_MapObjects(const _char* pFilePath); @@ -52,9 +54,14 @@ DECLARE_SINGLETON(CInfoInstance) void Key_Input(_uint Input); // 플레이어 키 입력 void Mouse_Input(_uint Input); // 플레이어 키 입력 void Set_UISTATE(UI_STATE eState); + UI_STATE Get_UISTATE(); void Add_Event(_wstring EventName, function Event); void Event_CallBack(_wstring EventName, void* pArg = nullptr); #pragma endregion +#pragma region Interactive_INFO + HRESULT Regist_ActiveInteractive(class CMapElement_Interactable* pInteractive); + HRESULT Deregist_ActiveInteractive(class CMapElement_Interactable* pInteractive); +#pragma endregion private: CGameInstance* m_pGameInstance = { nullptr }; ID3D11Device* m_pDevice = { nullptr }; @@ -63,7 +70,8 @@ DECLARE_SINGLETON(CInfoInstance) class CPlayerInfo* m_pPlayerInfo = { nullptr }; class CMonsterInfo* m_pMonsterInfo = { nullptr }; class CMapInfo* m_pMapInfo = { nullptr }; - class CSkill_Data* m_pSkillInfo= { nullptr }; + class CSkill_Data* m_pSkillInfo = { nullptr }; + class CInteractiveInfo* m_pInteractiveInfo = { nullptr }; _uint m_eInput = ENUM_CLASS(KEYINPUT::END); _int m_eSpell = ENUM_CLASS(SKILL_TYPE::END); diff --git a/Jusin154_Team3D/Client/Public/InteractiveInfo.h b/Jusin154_Team3D/Client/Public/InteractiveInfo.h new file mode 100644 index 000000000..60a2c1f04 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/InteractiveInfo.h @@ -0,0 +1,44 @@ +#pragma once + +#include "Client_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +class CUnit; +class CTransform; +NS_END + +NS_BEGIN(Client) + +class CInteractiveInfo final : public CBase +{ +private: + CInteractiveInfo(); + ~CInteractiveInfo() = default; +public: + void Update(_float fTimeDelta); + void Change_Level(); + + HRESULT Regist_ActiveInteractive(class CMapElement_Interactable* pUnit); + HRESULT Deregist_ActiveInteractive(class CMapElement_Interactable* pUnit); + + class CMapElement_Interactable* Get_LockOnUnit(); +private: + CGameInstance* m_pGameInstance = { nullptr }; + class CInfoInstance* m_pInfoInstance = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; + + class CMapElement_Interactable* m_pLockOnInteractive = { nullptr }; + list m_ActiveInteractive = {}; + +private: + HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + HRESULT Refresh_LockOnTarget(); +public: + static CInteractiveInfo* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Levioso.h b/Jusin154_Team3D/Client/Public/Levioso.h index 4c365ccee..c62cd31a4 100644 --- a/Jusin154_Team3D/Client/Public/Levioso.h +++ b/Jusin154_Team3D/Client/Public/Levioso.h @@ -30,6 +30,9 @@ class CLevioso final : public CEffect_Container HRESULT Ready_Child(); HRESULT Bind_ShaderResources() override; virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; + +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; private: _wstring m_wstrEffectName = {}; class CPlayer* m_pPlayer = {}; @@ -42,6 +45,11 @@ class CLevioso final : public CEffect_Container _float m_fAccRotateTime = {}; _float m_fTurnSpeed = {}; _float m_fRange = {}; + + _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; // 현재 발사 된 위치 + _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; // 현재 타게팅 된 위치 + _float m_fLinearSpeed = 0.25f; + _float3 m_vCameraLook = {}; public: static CLevioso* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Client/Public/Loding_Panel.h b/Jusin154_Team3D/Client/Public/Loding_Panel.h index 729621f8d..9b5224e89 100644 --- a/Jusin154_Team3D/Client/Public/Loding_Panel.h +++ b/Jusin154_Team3D/Client/Public/Loding_Panel.h @@ -43,6 +43,8 @@ class CLoding_Panel final : public CUIObject CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; CGameObject* m_pCurrent_Spell_Slot = { nullptr }; + CGameObject* m_pLoadingWidget = { nullptr }; + _int m_iImageNum{}; _float4 m_vImageposSi{}; diff --git a/Jusin154_Team3D/Client/Public/MapElement_Interactable.h b/Jusin154_Team3D/Client/Public/MapElement_Interactable.h index deb85b2f9..ba031a599 100644 --- a/Jusin154_Team3D/Client/Public/MapElement_Interactable.h +++ b/Jusin154_Team3D/Client/Public/MapElement_Interactable.h @@ -26,12 +26,21 @@ class CMapElement_Interactable final : public CMapElement virtual void Update(_float fTimeDelta) override; virtual void Late_Update(_float fTimeDelta) override; virtual HRESULT Render() override; + _vector Get_LockOnPos(); + virtual void Set_DrawOutLine(); + virtual HRESULT Render_OutLine() override; private: ELEMENT_INTERACTABLE_ID m_eInteractableID = { ELEMENT_INTERACTABLE_ID::END }; + class CInfoInstance* m_pInfoInstance = { nullptr }; - class CRigidBody* m_pRigidBody = { nullptr }; - PSX::PxRigidDynamic* m_pActor = { nullptr }; + class CRigidBody_Dynamic* m_pRigidBody = { nullptr }; + PSX::PxRigidDynamic* m_pActor = { nullptr }; + _bool m_bDrawOutLine = { false }; + _float4 m_vOutLineColor = CMyTools::ColorRGBA_HEXtoFLOAT4(0xfefefe00); + _float m_fOutLineThickness = { 5.f }; + _float m_fOutLineScale = { 1.f }; + _float m_fOutLinePower = { 1.f }; private: diff --git a/Jusin154_Team3D/Client/Public/Monster.h b/Jusin154_Team3D/Client/Public/Monster.h index dbb7ef481..0c9c1aa49 100644 --- a/Jusin154_Team3D/Client/Public/Monster.h +++ b/Jusin154_Team3D/Client/Public/Monster.h @@ -22,7 +22,7 @@ class CMonster abstract : public CUnit _float4 Get_TargetPos() { return m_vTargetPos; } virtual _bool Get_Damage(_float fDamage); virtual _float2 Get_Hp(); - + virtual CStat* Get_Stat(); protected: CInfoInstance* m_pInfoInstance = { nullptr }; CUnit* m_pTarget = { nullptr }; @@ -33,6 +33,10 @@ class CMonster abstract : public CUnit _float m_fDeadRatio = { 0.f }; _bool m_bDrawOutLine = { false }; _bool m_bLookAt = { true }; + _float4 m_vOutLineColor = CMyTools::ColorRGBA_HEXtoFLOAT4(0xfefefe00); + _float m_fOutLineThickness = { 5.f }; + _float m_fOutLineScale = { 1.f }; + _float m_fOutLinePower = { 1.f }; protected: virtual HRESULT Initialize_Prototype() override; diff --git a/Jusin154_Team3D/Client/Public/MonsterInfo.h b/Jusin154_Team3D/Client/Public/MonsterInfo.h index f2c0672d0..1ef31b769 100644 --- a/Jusin154_Team3D/Client/Public/MonsterInfo.h +++ b/Jusin154_Team3D/Client/Public/MonsterInfo.h @@ -28,6 +28,7 @@ class CMonsterInfo final : public CBase CUnit* Get_LockOnUnit(); pair Get_NearestPlayerAlly(_fvector vPos); + CMonster* Get_TargetMonster(); private: CGameInstance* m_pGameInstance = { nullptr }; class CInfoInstance* m_pInfoInstance = { nullptr }; diff --git a/Jusin154_Team3D/Client/Public/Player.h b/Jusin154_Team3D/Client/Public/Player.h index ec5292d95..d2a0b8840 100644 --- a/Jusin154_Team3D/Client/Public/Player.h +++ b/Jusin154_Team3D/Client/Public/Player.h @@ -28,7 +28,7 @@ class CPlayer final : public CUnit _matrix Get_WandPos(); private: CInfoInstance* m_pInfoInstance = { nullptr }; - CUnit* m_pLockOnMonster = { nullptr }; + LOCKON_INFO m_LockOnInfo = {}; _float m_fDirectionRadian = 0.f; _bool m_bSprintToggle = { false }; diff --git a/Jusin154_Team3D/Client/Public/Troll.h b/Jusin154_Team3D/Client/Public/Troll.h index a718d0f88..c9591b913 100644 --- a/Jusin154_Team3D/Client/Public/Troll.h +++ b/Jusin154_Team3D/Client/Public/Troll.h @@ -3,7 +3,7 @@ #include "Client_Define.h" #include "Monster.h" #include "CallBack_Monster_Behavior.h" -#include "CallBack_Monster_HitReport.h" +#include "CallBack_Troll_HitReport.h" NS_BEGIN(Client) @@ -33,11 +33,12 @@ class CTroll 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; - +private: + void Troll_Trail_Visible(_bool isTrailVisible); private: CCallBack_Monster_Behavior* m_pCallBack_Behavior = { nullptr }; - CCallBack_Monster_HitReport* m_pCallBack_HitReport = { nullptr }; + CCallBack_Troll_HitReport* m_pCallBack_HitReport = { nullptr }; CCharacter_Controller* m_pCharacter_Controller = { nullptr }; CRigidBody_Dynamic* m_pRigidBody = { nullptr }; @@ -49,6 +50,16 @@ class CTroll final : public CMonster class CEffectParts* m_pTroll_Particle = { nullptr }; class CEffectParts* m_pTroll_Particle2 = { nullptr }; + class CTrailObject* m_pLeftTrail = { nullptr }; + class CTrailObject* m_pRightTrail = { nullptr }; + class CTrailObject* m_pWeaponTrail = { nullptr }; + + const _float4x4* m_pLeftHand_BoneMat = { nullptr }; + const _float4x4* m_pRightHand_BoneMat = { nullptr }; + const _float4x4* m_pWeapon_BoneMat = { nullptr }; +private: + class CEffectPool* m_pEffectPool = nullptr; + private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; @@ -115,6 +126,10 @@ class CTroll final : public CMonster HRESULT Behavior_BackHandSwingExitCheck(_float fTimeDelta); void Behavior_BackHandSwingExit(); + void Behavior_StunEnter(); + HRESULT Behavior_StunExitCheck(_float fTimeDelta); + void Behavior_StunExit(); + void Behavior_HitEnter(); HRESULT Behavior_HitExitCheck(); void Behavior_HitExit(); diff --git a/Jusin154_Team3D/Client/Public/TrollSwing.h b/Jusin154_Team3D/Client/Public/TrollSwing.h new file mode 100644 index 000000000..975909e94 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/TrollSwing.h @@ -0,0 +1,43 @@ +#pragma once + +#include "Client_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Client) + +class CTrollSwing final : public CEffect_Container +{ +private: + CTrollSwing(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CTrollSwing(const CTrollSwing& rhs); + virtual ~CTrollSwing() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +public: + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + +public: + static CTrollSwing* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Troll_Nomal_Smoke.h b/Jusin154_Team3D/Client/Public/Troll_Nomal_Smoke.h new file mode 100644 index 000000000..57aadfb29 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Troll_Nomal_Smoke.h @@ -0,0 +1,43 @@ +#pragma once + +#include "Client_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Client) + +class CTroll_Nomal_Smoke final : public CEffect_Container +{ +private: + CTroll_Nomal_Smoke(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CTroll_Nomal_Smoke(const CTroll_Nomal_Smoke& rhs); + virtual ~CTroll_Nomal_Smoke() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +public: + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + +public: + static CTroll_Nomal_Smoke* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Troll_Rush_Hit.h b/Jusin154_Team3D/Client/Public/Troll_Rush_Hit.h new file mode 100644 index 000000000..feb24d740 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Troll_Rush_Hit.h @@ -0,0 +1,43 @@ +#pragma once + +#include "Client_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Client) + +class CTroll_Rush_Hit final : public CEffect_Container +{ +private: + CTroll_Rush_Hit(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CTroll_Rush_Hit(const CTroll_Rush_Hit& rhs); + virtual ~CTroll_Rush_Hit() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +public: + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + +public: + static CTroll_Rush_Hit* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; + void Describe_Entity() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/Troll_State_Stun.h b/Jusin154_Team3D/Client/Public/Troll_State_Stun.h new file mode 100644 index 000000000..2123d8040 --- /dev/null +++ b/Jusin154_Team3D/Client/Public/Troll_State_Stun.h @@ -0,0 +1,36 @@ +#pragma once +#include "Client_Define.h" +#include "State_Root.h" + +NS_BEGIN(Client) + +class CTroll_State_Stun final : public CState_Root +{ +public: + typedef struct tagTrollStun : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }TROLL_STATE_STUN; +public: + CTroll_State_Stun(); + virtual ~CTroll_State_Stun() = 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_STUN* pDesc); + +public: + static CTroll_State_Stun* Create(TROLL_STATE_STUN* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Client/Public/WandEnd.h b/Jusin154_Team3D/Client/Public/WandEnd.h new file mode 100644 index 000000000..b73ed10ad --- /dev/null +++ b/Jusin154_Team3D/Client/Public/WandEnd.h @@ -0,0 +1,49 @@ +#pragma once + +#include "Client_Define.h" +#include "Effect_Container.h" + +NS_BEGIN(Engine) +NS_END + +NS_BEGIN(Client) + +class CWandEnd final : public CEffect_Container +{ +private: + CWandEnd(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CWandEnd(const CWandEnd& rhs); + virtual ~CWandEnd() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + +public: + virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + virtual HRESULT Ready_Components(void* pArg) override; + HRESULT Ready_Child(); + HRESULT Bind_ShaderResources() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override; +private: + _wstring m_wstrEffectName = {}; + + class CEffectParts* m_pWandPt = { nullptr }; + + _bool m_isParticleEnd = {}; + +public: + static CWandEnd* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; + CGameObject* Clone(void* pArg, CGameObject* pOwner) override; +#ifdef _DEBUG + void Describe_Entity() override; +#endif // _DEBUG +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Bin/AnimIndex.txt b/Jusin154_Team3D/Editor/Bin/AnimIndex.txt index d4879fcb8..409d38ad4 100644 --- a/Jusin154_Team3D/Editor/Bin/AnimIndex.txt +++ b/Jusin154_Team3D/Editor/Bin/AnimIndex.txt @@ -1,214 +1,174 @@ -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 +0 Trl_BM_Alert_LF_Walk_Turn_Start_Lft_135_anm +1 Trl_BM_Alert_LF_Walk_Turn_Start_Lft_180_anm +2 Trl_BM_Alert_LF_Walk_Turn_Start_Lft_45_anm +3 Trl_BM_Alert_LF_Walk_Turn_Start_Lft_90_anm +4 Trl_BM_Alert_LF_Walk_Turn_Start_Rht_135_anm +5 Trl_BM_Alert_LF_Walk_Turn_Start_Rht_180_anm +6 Trl_BM_Alert_LF_Walk_Turn_Start_Rht_90_anm +7 Trl_BM_Alert_Look_2Cmbt_180L_anm +8 Trl_BM_Alert_Look_2Cmbt_180R_anm +9 Trl_BM_Alert_Look_2Cmbt_90L_anm +10 Trl_BM_Alert_Look_2Cmbt_90R_anm +11 Trl_BM_Alert_Look_2Cmbt_A_anm +12 Trl_BM_Alert_Look_2Cmbt_anm +13 Trl_BM_Alert_Look_2Cmbt_B_anm +14 Trl_BM_Alert_Look_2Cmbt_C_ClubSwing_anm +15 Trl_BM_Alert_Look_End_Fwd_anm +16 Trl_BM_Alert_Look_Loop_anm +17 Trl_BM_Alert_Look_Loop_v01_anm +18 Trl_BM_Alert_Look_Loop_v02_anm +19 Trl_BM_Alert_Look_Start_Fwd_anm +20 Trl_BM_Alert_Look_Turn_InPlace_A_anm +21 Trl_BM_Alert_Look_Turn_InPlace_B_anm +22 Trl_BM_Alert_Walk_Loop_Fwd_anm +23 Trl_BM_Alert_Walk_Loop_Fwd_End_anm +24 Trl_BM_Alert_Walk_Loop_Fwd_Start_anm +25 Trl_BM_Idle_01_Face_anm +26 Trl_BM_Idle_Break_01_anm +27 Trl_BM_Idle_Break_01_Face_anm +28 Trl_BM_Idle_Break_02_anm +29 Trl_BM_Idle_Break_02_Face_anm +30 Trl_BM_Idle_Break_03_anm +31 Trl_BM_Idle_Break_04_anm +32 Trl_BM_Lean_0_anm +33 Trl_BM_LF_Idle_anm +34 Trl_BM_LF_Walk_Turn_Start_Lft_135_anm +35 Trl_BM_LF_Walk_Turn_Start_Lft_180_anm +36 Trl_BM_LF_Walk_Turn_Start_Lft_45_anm +37 Trl_BM_LF_Walk_Turn_Start_Lft_90_anm +38 Trl_BM_LF_Walk_Turn_Start_Rht_135_anm +39 Trl_BM_LF_Walk_Turn_Start_Rht_180_anm +40 Trl_BM_LF_Walk_Turn_Start_Rht_45_anm +41 Trl_BM_LF_Walk_Turn_Start_Rht_90_anm +42 Trl_BM_Walk_Loop_Fwd_End_Wander_anm +43 Trl_BM_Walk_Loop_Fwd_Lft_45_Wander_anm +44 Trl_BM_Walk_Loop_Fwd_Rht_45_Wander_anm +45 Trl_BM_Walk_Loop_Fwd_Start_Wander_anm +46 Trl_BM_Walk_Loop_Fwd_Wander_anm +47 Trl_Cmbt_Atk_01_Face_anm +48 Trl_Cmbt_Atk_02_Face_anm +49 Trl_Cmbt_Atk_03_Face_anm +50 Trl_Cmbt_Atk_Charge_Check_anm +51 Trl_Cmbt_Atk_Charge_Knee_End_anm +52 Trl_Cmbt_Atk_Charge_Knee_Loop_anm +53 Trl_Cmbt_Atk_Charge_Knee_Start_anm +54 Trl_Cmbt_Atk_Charge_Loop_anm +55 Trl_Cmbt_Atk_Charge_Start_anm +56 Trl_Cmbt_Atk_Charge_Stop_RU_anm +57 Trl_Cmbt_Atk_Charge_Stop_Turn_Lft_anm +58 Trl_Cmbt_Atk_Charge_Stop_Turn_Rht_anm +59 Trl_Cmbt_Atk_Charge_Stumble_Fwd_anm +60 Trl_Cmbt_Atk_Charge_Stun_anm +61 Trl_Cmbt_Atk_Hop_Bckhnd_RU_anm +62 Trl_Cmbt_Atk_Hop_Forhnd_LU_anm +63 Trl_Cmbt_Atk_LF_Stomp_Bck_anm +64 Trl_Cmbt_Atk_LF_Stomp_Fwd_anm +65 Trl_Cmbt_Atk_LF_Stomp_Lft_anm +66 Trl_Cmbt_Atk_Overhead_Slam_anm +67 Trl_Cmbt_Atk_Overhead_Slam_BckHnd_anm +68 Trl_Cmbt_Atk_Overhead_Slam_Jog_anm +69 Trl_Cmbt_Atk_Overhead_Slam_Lft_180_anm +70 Trl_Cmbt_Atk_Overhead_Slam_Lft_90_anm +71 Trl_Cmbt_Atk_Overhead_Slam_Rht_180_anm +72 Trl_Cmbt_Atk_Overhead_Slam_Rht_90_anm +73 Trl_Cmbt_Atk_RF_Stomp_Rht_anm +74 Trl_cmbt_Atk_RockThrow_Fwd_anm +75 Trl_Cmbt_Atk_RockThrow_Lft_anm +76 Trl_Cmbt_Atk_RockThrow_Rht_anm +77 Trl_Cmbt_Atk_Rockthrow_Start_anm +78 Trl_Cmbt_Atk_StepBack_Swing_Fwd_anm +79 Trl_Cmbt_Atk_StepSwing_Fwd_BckHnd_anm +80 Trl_Cmbt_Atk_StepSwing_Fwd_BckHnd_Splt_anm +81 Trl_Cmbt_Atk_StepSwing_Fwd_ForHnd_anm +82 Trl_Cmbt_Atk_StepSwing_Fwd_ForHnd_Splt_anm +83 Trl_Cmbt_Atk_StepSwing_Lft_180_BckHnd_anm +84 Trl_Cmbt_Atk_StepSwing_Lft_90_BckHnd_anm +85 Trl_Cmbt_Atk_StepSwing_Rht_180_ForHnd_Splt_anm +86 Trl_Cmbt_Atk_StepSwing_Rht_90_ForHnd_anm +87 Trl_Cmbt_Atk_Swing_Fwd_anm +88 Trl_Cmbt_Atk_Swing_Fwd_BckHnd_anm +89 Trl_Cmbt_Atk_Swing_Fwd_BckHnd_Jog_anm +90 Trl_Cmbt_Atk_Swing_Fwd_BckHnd_Splt_anm +91 Trl_Cmbt_Atk_Swing_Fwd_Jog_anm +92 Trl_Cmbt_Atk_Swing_Fwd_Splt_anm +93 Trl_Cmbt_Atk_Swing_Lft_anm +94 Trl_Cmbt_Atk_Swing_Rht_anm +95 Trl_Cmbt_Atk_Swipe_anm +96 Trl_Cmbt_Atk_Swipe_Lft_180_anm +97 Trl_Cmbt_Atk_Swipe_Lft_90_anm +98 Trl_Cmbt_Atk_Swipe_Rht_90_anm +99 Trl_Cmbt_Atk_Tantrum_01_anm +100 Trl_Cmbt_Atk_Tantrum_02_anm +101 Trl_Cmbt_Idle_01_anm +102 Trl_Cmbt_idle_01_Face_anm +103 Trl_Cmbt_Jog_Loop_Fwd_anm +104 Trl_Cmbt_Jog_Start_Fwd_anm +105 Trl_Cmbt_Jog_Turn_Start_Lft_135_anm +106 Trl_Cmbt_Jog_Turn_Start_Lft_180_anm +107 Trl_Cmbt_Jog_Turn_Start_Lft_45_anm +108 Trl_Cmbt_Jog_Turn_Start_Lft_90_anm +109 Trl_Cmbt_Jog_Turn_Start_Rht_135_anm +110 Trl_Cmbt_Jog_Turn_Start_Rht_180_anm +111 Trl_Cmbt_Jog_Turn_Start_Rht_45_anm +112 Trl_Cmbt_Jog_Turn_Start_Rht_90_anm +113 Trl_Cmbt_LF_Idle_Turn_Lft_135_anm +114 Trl_Cmbt_LF_Idle_Turn_Lft_180_anm +115 Trl_Cmbt_LF_Idle_Turn_Lft_45_anm +116 Trl_Cmbt_LF_Idle_Turn_Lft_90_anm +117 Trl_Cmbt_LF_Idle_Turn_Rht_135_anm +118 Trl_Cmbt_LF_Idle_Turn_Rht_180_anm +119 Trl_Cmbt_LF_Idle_Turn_Rht_45_anm +120 Trl_Cmbt_LF_Idle_Turn_Rht_90_anm +121 Trl_Cmbt_Look_Lft_anm +122 Trl_Cmbt_Look_Rht_anm +123 Trl_Cmbt_OverHead_Slam_Taunt_01_anm +124 Trl_Cmbt_OverHead_Slam_Taunt_02_anm +125 Trl_Cmbt_Rct_Death_01_Face_anm +126 Trl_Cmbt_Rct_Death_02_Face_anm +127 Trl_Cmbt_Rct_Flinch_Charge_anm +128 Trl_Cmbt_Rct_Hit_01_Face_anm +129 Trl_Cmbt_Rct_Hit_02_Face_anm +130 Trl_Cmbt_Rct_Hit_03_Face_anm +131 Trl_Cmbt_Rct_Mandrake_Loop_anm +132 Trl_Cmbt_Rct_Mandrake_Start_anm +133 Trl_Cmbt_Rct_Mandrake_Stop_anm +134 Trl_Cmbt_Roar_01_Face_anm +135 Trl_Cmbt_Roar_02_Face_anm +136 Trl_Cmbt_Roar_03_Face_anm +137 Trl_Cmbt_Spawn_Ink_02_anm +138 Trl_Cmbt_Spawn_Ink_anm +139 Trl_Cmbt_Spwn_Breakthrough_01_anm +140 Trl_Cmbt_Spwn_Breakthrough_02_anm +141 Trl_Cmbt_Taunt_Fwd_05_anm +142 Trl_Cmbt_Taunt_Fwd_06_anm +143 Trl_Cmbt_Taunt_Fwd_07_anm +144 Trl_Cmbt_Taunt_Fwd_08_anm +145 Trl_Cmbt_Taunt_Fwd_09_anm +146 Trl_Cmbt_Taunt_Lft_135_anm +147 Trl_Cmbt_Taunt_Lft_180_anm +148 Trl_Cmbt_Taunt_Lft_45_07_anm +149 Trl_Cmbt_Taunt_Lft_90_07_anm +150 Trl_Cmbt_Taunt_Lft_90_anm +151 Trl_Cmbt_Taunt_Rht_135_anm +152 Trl_Cmbt_Taunt_Rht_180_anm +153 Trl_Cmbt_Taunt_Rht_45_07_anm +154 Trl_Cmbt_Taunt_Rht_90_07_anm +155 Trl_Cmbt_Taunt_Rht_90_anm +156 Trl_Rct_Club_Face_anm +157 Trl_Rct_Club_Face_End_anm +158 Trl_Rct_Dazed_End_anm +159 Trl_Rct_Dazed_Loop_anm +160 Trl_Rct_Dazed_Start_anm +161 Trl_Rct_Hitch_Bwd_Add_anm +162 Trl_Rct_Hitch_Fwd_Add_anm +163 Trl_Rct_Hitch_Lft_Add_anm +164 Trl_Rct_Hitch_Rht_Add_anm +165 Trl_Rct_KnckDn_Bck_anm +166 Trl_Rct_Spell_Petrificus_Start_anm +167 Trl_Rct_Stumble_Bck_02_anm +168 Trl_Rct_Stumble_Bck_03_anm +169 Trl_Rct_Stumble_Bck_04_anm +170 Trl_Rct_Stumble_Fwd_anm +171 Trl_Rct_Stumble_Lft_anm +172 Trl_Rct_Stumble_Rht_anm +173 Trl_STN_Grnd_Sleep_End_v01_anm diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_PT0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_PT0.bin index 2ef503ea1..c0cd17710 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_PT0.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_PT0.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7b3ed267395967eb9780d0bc00421dd4b96ecbd37ab68e25761ad82834cdd2ab -size 1082 +oid sha256:a3151cc9d02fd90132bb60936eb828a63fd008ce72eb7dd371f5b489ef43e356 +size 1054 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Ring.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Ring.bin index 485912ad6..7787d0ccf 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Ring.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Ring.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:cd2a595005be802b075ab785fd96287b50c9d835bb64b4aecfaaedaa713676b1 +oid sha256:65f6097f511de2b0ac9549694e0286bc2228d3c3c97eb2754261ea794a3d5013 size 1036 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Smoke.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Smoke.bin index edf67e9dc..beca0a038 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Smoke.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Decendo/Decendo_Smoke.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:883f62dfd809c08dd1a19af917f03186d2b9cf98985c6f24314a00a2be67c2da +oid sha256:b1d7727ea00182fce50d00a3ba3a3f2ec36711d9193ca80084583cf0787400cb size 1042 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/GoblinMage/Orb_P.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/GoblinMage/Orb_P.bin new file mode 100644 index 000000000..6062fd404 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/GoblinMage/Orb_P.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:e7de88fb5cc122dde2cac296d273104ebefd933ffb322f1f03098ac03511d9e5 +size 1120 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Trail_PT0.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Trail_PT0.bin index 6e7e1c0f3..df2b8e890 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Trail_PT0.bin +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Levioso/Trail_PT0.bin @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3507cb051a6c5b703d63ed65549587fde761d0d522da15838f49111f3bc28d55 -size 1045 +oid sha256:5bde6082a76193fc49dcdf57ba026c2e6f98a39bd87cc529c21b9df453e59721 +size 1059 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/WandEnd.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/WandEnd.bin new file mode 100644 index 000000000..a6be396b0 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Package/WandEnd.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ed8c71f3a2cef038462ada73b40abb17d81ffed78ac3ab65028972013e1a94e4 +size 68 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Troll/TrollSide/Troll_Swing_Trail.trail b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Troll/TrollSide/Troll_Swing_Trail.trail new file mode 100644 index 000000000..fc6d73396 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/Troll/TrollSide/Troll_Swing_Trail.trail differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/WandEnd/WandParticle_R.bin b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/WandEnd/WandParticle_R.bin new file mode 100644 index 000000000..f7cd21134 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Effect/WandEnd/WandParticle_R.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d9419051879b9e4bfa57067d92640a42db30954b7fcf874df8f79e1856a46393 +size 1059 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/E_INTER_TeaShopChair.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/E_INTER_TeaShopChair.xml index dfba86b5d..0deac8b7e 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/E_INTER_TeaShopChair.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/E_INTER_TeaShopChair.xml @@ -26,7 +26,7 @@ Prototype_GameObject_SM_HM_TeaShop_Chair_B - + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogwart_AlphaMap.dds b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogwart_AlphaMap.dds new file mode 100644 index 000000000..95887abf3 Binary files /dev/null and b/Jusin154_Team3D/Editor/Bin/Resources/Data/Map/Hogwart_AlphaMap.dds differ diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml index 9501aabdc..8b0085ade 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/Stat.xml @@ -1,5 +1,6 @@ - - - - + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Data.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Data.xml deleted file mode 100644 index d1182dea5..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Data.xml +++ /dev/null @@ -1,3 +0,0 @@ - - ¸¶Ʈ, ǪµåÄÚƮ, ÀǷù¸ÅÀå - diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Tooltip.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Tooltip.xml new file mode 100644 index 000000000..560148964 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/UI/Tooltip.xml @@ -0,0 +1,6 @@ + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/teroll1234.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/teroll1234.bin deleted file mode 100644 index 400f47ee8..000000000 --- a/Jusin154_Team3D/Editor/Bin/Resources/Models/Monster/SubTroll/teroll1234.bin +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:62cc099ed295d989f363f1cb09d528d755327a09e83513887c5cdcb6a4213afb -size 44266214 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Troll_Rock/VFX_SM_Rock_01.bin b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Troll_Rock/VFX_SM_Rock_01.bin new file mode 100644 index 000000000..868684b40 --- /dev/null +++ b/Jusin154_Team3D/Editor/Bin/Resources/Models/Object/Troll_Rock/VFX_SM_Rock_01.bin @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:be8e335c6f6491b5f37411d4d5b4abb2042c586965afd08ab54628b4ca26c66f +size 18969 diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl index bd75f7635..e141e7c12 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -105,7 +105,6 @@ void CS_MAIN( Particle particle = g_ParticleBufferInput[iIndex]; - ParticleValue particleValue = g_ParticleValueBufferInput[iIndex]; @@ -190,7 +189,7 @@ void CS_MAIN( particle.vTranslation.y -= 0.5f * particle.vLifeTime.x * fGravity; fOnlyDropY = particle.vTranslation.y; } - + if (isMoveForward) { @@ -304,7 +303,7 @@ void CS_MAIN( float fOldViewZ = vDepthDesc.y * fFar; - if (vProjPos.w >= fOldViewZ && particle.vLifeTime.x >= 0.2f) + if (vProjPos.w >= fOldViewZ && particle.vLifeTime.x >= 0.3f) { if (particleValue.isCompareStop == false) { diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl index c2d688ad7..2cd0683e4 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_UIEditor.hlsl @@ -1270,7 +1270,7 @@ PS_OUT PS_Camera_LockOn(PS_IN In) Color.a = tex1 * 0.3f; - if (g_iHover != 0) + if (g_iHover == 0) { float4 tex2 = g_Texture1.Sample(ClampSampler, maskuv); diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl index 8ffe32f47..5a0f8fddb 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxAnimMesh.hlsl @@ -13,7 +13,7 @@ float g_fRimStrength; float g_fRimPower; float3 g_vRimColor; float4 g_TestColor; -float3 g_vOutLineColor; +float4 g_vOutLineColor; float g_fOutLineScale; float g_fOutLineThickness; float g_fOutLinePower; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl index 078237d33..34e80e3fa 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl +++ b/Jusin154_Team3D/Editor/Bin/Resources/ShaderFiles/Shader_VtxMesh.hlsl @@ -12,10 +12,10 @@ float g_fFar; float g_fTime; float g_fDeltaU; float g_fDeltaV; -float3 g_vOutLineColor; +float4 g_vOutLineColor; float g_fOutLineScale; -float g_fOutLinePower; float g_fOutLineThickness; +float g_fOutLinePower; vector g_vCamPosition; uint g_iIndexU; uint g_iIndexV; @@ -178,7 +178,7 @@ VS_OUT_OUTLINE VS_MAIN_OUTLINE(VS_IN In) VS_OUT_OUTLINE Out; vector vPosition = vector(In.vPosition, 1.f); - vector vNormal = vector(In.vNormal, 1.f); + vector vNormal = vector(In.vNormal, 0.f); vPosition.xyz += (vNormal.xyz * g_fOutLineThickness).xyz; @@ -489,15 +489,13 @@ PS_OUT_OUTLINE PS_MAIN_OUTLINE(PS_IN_OUTLINE In) float fNdotV = saturate(dot(vNormal, vToView)); float fRim = saturate((1.0f - fNdotV) * g_fOutLineScale); - - fRim = pow(fRim, g_fOutLinePower); - + Out.vOutLine = float4(g_vOutLineColor.rgb, fRim); Out.vNormal = float4(vNormal * 0.5f + 0.5f, 0.f); Out.vDepth = float4((In.vProjPos.z / In.vProjPos.w), // NDC 깊이 ( 0~ 1) (In.vProjPos.w / g_fFar), // 뷰 스페이스 Z - 0, // 서페이스 파라미터 + AI_TEXTURE_TYPE_METALNESS, // 서페이스 파라미터 1.f); return Out; diff --git a/Jusin154_Team3D/Editor/Default/Editor.cpp b/Jusin154_Team3D/Editor/Default/Editor.cpp index 2957f0ad5..75a6fd0d1 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.cpp +++ b/Jusin154_Team3D/Editor/Default/Editor.cpp @@ -80,6 +80,15 @@ int APIENTRY wWinMain(_In_ HINSTANCE hInstance, if (FAILED(pGameInstance->Add_Timer(TEXT("Timer_Present")))) { return E_FAIL; } + if (FAILED(pGameInstance->Add_Timer(TEXT("Timer_Picking")))) { + return E_FAIL; + } + if (FAILED(pGameInstance->Add_Timer(TEXT("Timer_PhysX")))) { + return E_FAIL; + } + if (FAILED(pGameInstance->Add_Timer(TEXT("Timer_Level")))) { + return E_FAIL; + } if (FAILED(pGameInstance->Add_Timer(TEXT("Timer_FrameCount")))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj b/Jusin154_Team3D/Editor/Default/Editor.vcxproj index f1479f203..cfba68a06 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj @@ -176,9 +176,16 @@ call Update_Shaders.bat + + + + + + + @@ -370,9 +377,16 @@ call Update_Shaders.bat + + + + + + + diff --git a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters index 7b349ef5f..3bcbbe461 100644 --- a/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters +++ b/Jusin154_Team3D/Editor/Default/Editor.vcxproj.filters @@ -547,6 +547,18 @@ {3a12f2c2-0472-41b7-99ce-2c2f17f26e92} + + {0fdb9c5b-7edd-4915-8fce-a8e78c9e1e9a} + + + {0952e2b6-0430-42db-942f-75cb70310240} + + + {f4f76745-6de8-4670-bd96-a4a4beb39415} + + + {7ba1f85d-a9c4-4002-b425-43796bec6869} + @@ -1073,7 +1085,7 @@ 02.GameObjects\Layer_Effect\Effect\Monster_Effect\Goblin_Protego - + 50.UI\GamePlay_Canvas\Enemy_Panel @@ -1083,6 +1095,27 @@ 50.UI\GamePlay_Canvas\Enemy_Panel\Enemy_Info + + 02.GameObjects\Monster\Goblin\Item + + + 02.GameObjects\Monster\Goblin\Item + + + 02.GameObjects\Monster\Goblin\State + + + 02.GameObjects\Monster\Goblin\State + + + 02.GameObjects\Monster\Goblin\State + + + 02.GameObjects\Monster\Goblin\Item + + + 04.InfoInstance\03.Skill_Info + @@ -1621,6 +1654,27 @@ 02.GameObjects\Layer_Effect\Effect\Monster_Effect\Goblin_Protego + + 02.GameObjects\Monster\Goblin\Item + + + 02.GameObjects\Monster\Goblin\Item + + + 02.GameObjects\Monster\Goblin\State + + + 02.GameObjects\Monster\Goblin\State + + + 02.GameObjects\Monster\Goblin\State + + + 02.GameObjects\Monster\Goblin\Item + + + 04.InfoInstance\03.Skill_Info + diff --git a/Jusin154_Team3D/Editor/Private/CameraLockOn.cpp b/Jusin154_Team3D/Editor/Private/CameraLockOn.cpp index 0ce47f2ce..14335c131 100644 --- a/Jusin154_Team3D/Editor/Private/CameraLockOn.cpp +++ b/Jusin154_Team3D/Editor/Private/CameraLockOn.cpp @@ -47,7 +47,7 @@ void CCameraLockOn::Priority_Update(_float fTimeDelta) void CCameraLockOn::Update(_float fTimeDelta) { - if (m_pGameInstance->Mouse_Pressing(DIM_MBUTTON)) + if (m_pGameInstance->Mouse_Pressing(DIM_RBUTTON)) { m_bHover = true; } diff --git a/Jusin154_Team3D/Editor/Private/EffectPool.cpp b/Jusin154_Team3D/Editor/Private/EffectPool.cpp index 6db712412..8d4787972 100644 --- a/Jusin154_Team3D/Editor/Private/EffectPool.cpp +++ b/Jusin154_Team3D/Editor/Private/EffectPool.cpp @@ -44,8 +44,8 @@ HRESULT CEffectPool::Initialize(void* pArg) if (FAILED(Ready_Components())) return E_FAIL; - //if (FAILED(Ready_Effect())) - // return E_FAIL; + if (FAILED(Ready_Effect())) + return E_FAIL; if (FAILED(Ready_MonsterEffect())) return E_FAIL; diff --git a/Jusin154_Team3D/Editor/Private/Goblin.cpp b/Jusin154_Team3D/Editor/Private/Goblin.cpp index 773e4fe8c..ec6495f5d 100644 --- a/Jusin154_Team3D/Editor/Private/Goblin.cpp +++ b/Jusin154_Team3D/Editor/Private/Goblin.cpp @@ -2,7 +2,12 @@ #include "Goblin.h" #include "GameInstance.h" -#include "EditEffect.h" +#include "InfoInstance.h" +#include "Layer.h" +#include "Player.h" +#include "Goblin_Dagger.h" +#include "Goblin_Spector.h" +#include "Effect_Container.h" #pragma region STATE #include "State_Idle.h" @@ -11,9 +16,11 @@ #include "State_Land.h" #include "State_Move.h" #include "State_Combat.h" -#include "InfoInstance.h" #pragma endregion +#include "EditEffect.h" + + CGoblin::CGoblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) : CMonster(pDevice, pContext) { @@ -56,9 +63,7 @@ HRESULT CGoblin::Initialize(void* pArg) m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody); m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody); - m_pCharacter_Controller->Set_Position(XMVectorSet(-10.f, 0.f, -10.f, 1.f)); - - CInfoInstance::GetInstance()->Regist_ActiveMonster(this); + m_pCharacter_Controller->Set_Position(XMVectorSet(-40.f, 5.f, -20.f, 1.f)); return S_OK; } @@ -66,8 +71,6 @@ HRESULT CGoblin::Initialize(void* pArg) void CGoblin::Priority_Update(_float fTimeDelta) { __super::Priority_Update(fTimeDelta); - - m_pTransformCom->RewindMomentum(); } void CGoblin::Update(_float fTimeDelta) @@ -78,28 +81,68 @@ void CGoblin::Update(_float fTimeDelta) m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom); - //m_pCharacter_Controller->Move(fTimeDelta); - + 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 (true == m_pRigidBody->IsActive()) { + 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 + + for (_uint i = 0; i < ENUM_CLASS(GOBLIN_SKILL::END); i++) + m_fSkillCoolTime[i] = max(0.f, m_fSkillCoolTime[i] - fTimeDelta); + + + } void CGoblin::Late_Update(_float fTimeDelta) { __super::Late_Update(fTimeDelta); - m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position()); + if (true == m_pCharacter_Controller->IsActive()) { + m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_FootPosition()); + } + else if (true == m_pRigidBody->IsActive()) { + m_pTransformCom->Set_WorldMatrix(m_pRigidBody->Get_FootPositionPxTransform()); + } + if (true == m_bLookAt) { + m_pTransformCom->LookAt_Horizontal(XMLoadFloat4(&m_vTargetPos)); + } - //m_pTransformCom->LookAt(m_pPlayerTransform->Get_State(STATE::POSITION)); - - m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this); + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); + m_pGameInstance->Add_RenderGroup(RENDER::SHADOW, this); } HRESULT CGoblin::Render() { + if (!m_bVisible) + return S_OK; if (FAILED(Bind_ShaderResources())) { return E_FAIL; } _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); - + _uint iShaderPass = ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT); + if (true == m_bDrawOutLine) { + iShaderPass = ENUM_CLASS(SHADER_PASS_ANIM::OUTLINE_WRITE); + } for (_uint i = 0; i < iNumMeshes; i++) { if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { @@ -110,7 +153,7 @@ HRESULT CGoblin::Render() return E_FAIL; } - if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) { + if (FAILED(m_pShaderCom->Begin(iShaderPass))) { return E_FAIL; } @@ -119,14 +162,115 @@ HRESULT CGoblin::Render() } } + if (m_bDrawOutLine) { + Render_OutLine(); + } + #ifdef _DEBUG - m_pCharacter_Controller->Render(); - //m_pRigidBody->Render(); + if (true == m_pCharacter_Controller->IsActive()) { + if (FAILED(m_pCharacter_Controller->Render())) { + return E_FAIL; + } + } + else if (true == m_pRigidBody->IsActive()) { + if (FAILED(m_pRigidBody->Render())) { + return E_FAIL; + } + } #endif + return S_OK; } +HRESULT CGoblin::Render_Shadow() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ViewMatrix", D3DTS::VIEW))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Bind_Shadow_Resource(m_pShaderCom, "g_ProjMatrix", D3DTS::PROJ))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", &m_pGameInstance->Get_ShadowDesc()->fFar, sizeof(_float)))) { + return E_FAIL; + } + _uint iNumMeshes = m_pModelCom->Get_NumMeshes(); + for (_uint i = 0; i < iNumMeshes; i++) + { + if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) { + return E_FAIL; + } + if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::SHADOW)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +_vector CGoblin::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::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; + _float fSkillRatio = m_pInfoInstance->Get_Spell_Info(ENUM_CLASS(SKILL_TYPE::JAP)).fSpell_Damage; + _float fCoefficient = CollisionDesc->pObject->Get_Component()->Get_Stat(ENUM_CLASS(STAT::MAGIC)); + if (true == Get_Damage(fSkillRatio * fCoefficient)) { + 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::OnHit(CGameObject* pOther, CGameObject* pCaller) +{ +} + HRESULT CGoblin::Ready_Components() { CTransform::TRANSFORM_DESC Desc = {}; @@ -141,21 +285,22 @@ HRESULT CGoblin::Ready_Components() /* Com_Model */ if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, - reinterpret_cast(&m_pModelCom)))) + reinterpret_cast(&m_pModelCom)))) { return E_FAIL; + } { // CCT CCharacter_Controller::Character_Controller_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::MONSTER); + Desc.iSubKind = ENUM_CLASS(PXOBJECT::GOBLIN_WARRIOR); Desc.pTransform = m_pTransformCom; Desc.eBodyType = ACTOR::CAPSULE; - Desc.fContactOffset = 0.1f; - Desc.fMaterial = { 0.5f, 0.5f, 0.6f }; + Desc.fContactOffset = 0.001f; + Desc.fMaterial = { 1.2f, 1.0f, 0.0f }; Desc.bAutoStepping = { false }; Desc.fStepOffset = { 0.05f }; - Desc.fRadius = 0.5f; - Desc.fHeight = 1.0f; + 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; @@ -167,18 +312,42 @@ HRESULT CGoblin::Ready_Components() m_pCharacter_Controller->Set_Position(m_pTransformCom->Get_State(STATE::POSITION)); { // DO CRigidBody_Dynamic::RIGIDBODY_DYNAMIC_DESC Desc{}; - Desc.iSubKind = ENUM_CLASS(COLLIDABLEOBJECT::MONSTER); + 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; + //} return S_OK; } HRESULT CGoblin::Ready_Parts() { + CGoblin_Dagger::GOBLINDAGGER_DESC Goblin_DaggerDesc{}; + + Goblin_DaggerDesc.pParentTransform = m_pTransformCom; + Goblin_DaggerDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("LeftHand"); + + if (FAILED(Add_PartObject("Goblin_Dagger", g_iStaticLevel, nullptr, &Goblin_DaggerDesc))) + { + 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 */ @@ -186,41 +355,39 @@ HRESULT CGoblin::Ready_Parts() PartsDesc.pParentTransform = m_pTransformCom; - - - if (FAILED(Add_PartObject("Goblin_Particle", ENUM_CLASS(LEVEL::EFFECT), &m_pTroll_Particle, &PartsDesc))) + if (FAILED(Add_PartObject("Goblin_Particle", NEXT_LEVEL, &m_pGoblin_Particle, &PartsDesc))) { return E_FAIL; } - m_pTroll_Particle->Load("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Particle", static_cast(NEXT_LEVEL)); - m_pTroll_Particle->FollowParants(m_pModelCom->Get_BoneMatrixPtr("RightShoulder")); + m_pGoblin_Particle->Load("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Particle", static_cast(NEXT_LEVEL)); + m_pGoblin_Particle->FollowParants(m_pModelCom->Get_BoneMatrixPtr("RightShoulder")); - if (FAILED(Add_PartObject("Goblin_Particle2", ENUM_CLASS(LEVEL::EFFECT), &m_pTroll_Particle2, &PartsDesc))) + if (FAILED(Add_PartObject("Goblin_Particle2", NEXT_LEVEL, &m_pGoblin_Particle2, &PartsDesc))) { return E_FAIL; } - m_pTroll_Particle2->Load("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Particle2", static_cast(NEXT_LEVEL)); - m_pTroll_Particle2->FollowParants(m_pModelCom->Get_BoneMatrixPtr("RightShoulder")); + m_pGoblin_Particle2->Load("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Particle2", static_cast(NEXT_LEVEL)); + m_pGoblin_Particle2->FollowParants(m_pModelCom->Get_BoneMatrixPtr("RightShoulder")); - if (FAILED(Add_PartObject("Goblin_Smoke", ENUM_CLASS(LEVEL::EFFECT), &m_pRight_Smoke, &PartsDesc))) + if (FAILED(Add_PartObject("Goblin_Smoke", NEXT_LEVEL, &m_pSmoke, &PartsDesc))) { return E_FAIL; } - m_pRight_Smoke->Load("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Smoke", static_cast(NEXT_LEVEL)); - m_pRight_Smoke->FollowParants(m_pModelCom->Get_BoneMatrixPtr("Spine2")); + m_pSmoke->Load("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Smoke", static_cast(NEXT_LEVEL)); + m_pSmoke->FollowParants(m_pModelCom->Get_BoneMatrixPtr("Spine2")); #pragma endregion + return S_OK; } - HRESULT CGoblin::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { @@ -276,39 +443,51 @@ void CGoblin::Free() 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_pTroll_Particle); - SAFE_RELEASE(m_pTroll_Particle2); - SAFE_RELEASE(m_pRight_Smoke); - SAFE_RELEASE(m_pLeft_Smoke); } +#ifdef _DEBUG void CGoblin::Describe_Entity() { - for (auto& pComponent : m_Components) - { - if (GUI::TreeNode(typeid(*pComponent).name())) - { - pComponent->Describe_Entity(); + GUI::Begin("Goblin"); - GUI::TreePop(); - } + GUI::Checkbox("LookAt", &m_bLookAt); + + string AnimList = m_pModelCom->Get_AnimList(m_pModelCom->Get_AnimIndex()); + GUI::Text(AnimList.c_str()); + + GUI::Text("AnimTrack %.2f", m_pModelCom->Get_CurrentTrackPosition()); + GUI::Text("AnimRatio %.2f", m_pModelCom->Get_CurrentTrackProgressRatio()); + + _float4 vMomentum = {}; + XMStoreFloat4(&vMomentum, m_pTransformCom->Get_CurrentMomentum()); + GUI::Text("%.2f %.2f %.2f %.2f ", vMomentum.x, vMomentum.y, vMomentum.z, vMomentum.w); + + _float3 Pos; + XMStoreFloat3(&Pos, Get_WorldPostion()); + + if (GUI::DragFloat3("Pos", (_float*)&Pos)) + { + m_pCharacter_Controller->Set_Position(XMLoadFloat3(&Pos)); } - _uint iIndex = {}; + XMFLOAT3 f3; + XMStoreFloat3(&f3, m_vOriginPos); - for (auto& pParts : m_PartObjects) - { - _string strName = to_string(iIndex++) + " : " + typeid(*pParts.second).name(); + GUI::Text("Origin: %.2f, %.2f, %.2f", f3.x, f3.y, f3.z); - if (GUI::TreeNode(strName.c_str())) - { - pParts.second->Describe_Entity(); + m_fLength = XMVectorGetX(XMVector2Length(m_pTransformCom->Get_State(STATE::POSITION) - m_vOriginPos)); - GUI::TreePop(); - } - } + GUI::Text("Length %.2f", m_fLength); + GUI::TextColored(ImVec4(1.f, 0.f, 0.f, 1.f), "Distance %.2f", m_fTargetDistance); + + + GUI::End(); } + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Private/Goblin_BattleAxe.cpp b/Jusin154_Team3D/Editor/Private/Goblin_BattleAxe.cpp new file mode 100644 index 000000000..c4f8a58a0 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Goblin_BattleAxe.cpp @@ -0,0 +1,180 @@ +#include "pch.h" +#include "Goblin_BattleAxe.h" + +#include "GameInstance.h" +#include "TrailObject.h" +#include "EditEffect.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/Editor/Private/Goblin_Dagger.cpp b/Jusin154_Team3D/Editor/Private/Goblin_Dagger.cpp new file mode 100644 index 000000000..9000f9a41 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Goblin_Dagger.cpp @@ -0,0 +1,197 @@ +#include "pch.h" +#include "Goblin_Dagger.h" + +#include "GameInstance.h" +#include "Goblin.h" + +CGoblin_Dagger::CGoblin_Dagger(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CPartObject(pDevice, pContext) +{ +} + +CGoblin_Dagger::CGoblin_Dagger(const CGoblin_Dagger& Prototype) + : CPartObject(Prototype) +{ +} + +HRESULT CGoblin_Dagger::Initialize_Prototype() +{ + return S_OK; +} + +HRESULT CGoblin_Dagger::Initialize(void* pArg) +{ + GOBLINDAGGER_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_Dagger::Priority_Update(_float fTimeDelta) +{ + //m_pModelCom->Combined_BoneMatrix(); + if (m_bAttach) + { + _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())); + _float4 vTargetPos = static_cast(m_pOwner)->Get_TargetPos(); + m_pTransformCom->LookAt(XMLoadFloat4(&vTargetPos)); + } + else + { + _matrix world = XMLoadFloat4x4(m_pTransformCom->Get_WorldMatrixPtr()); + m_pTransformCom->Set_WorldMatrix(world); + m_pTransformCom->Go_Straight(fTimeDelta); + } + + +#ifdef _DEBUG + Describe_Entity(); + +#endif // _DEBUG +} + +void CGoblin_Dagger::Update(_float fTimeDelta) +{ +} + +void CGoblin_Dagger::Late_Update(_float fTimeDelta) +{ + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); +} + +HRESULT CGoblin_Dagger::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_ANIM::DEFAULT)))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +HRESULT CGoblin_Dagger::Ready_Components() +{ + + CTransform::TRANSFORM_DESC Desc = {}; + + Desc.fSpeedPerSec = 25.f; + Desc.fRotationPerSec = XMConvertToRadians(180.0f); + Desc.fRadius = 10.f; + + __super::Ready_Components(&Desc); + + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Goblin_Dagger_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_Dagger::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_Dagger* CGoblin_Dagger::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CGoblin_Dagger* pInstance = new CGoblin_Dagger(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CGoblin_Dagger"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +CGameObject* CGoblin_Dagger::Clone(void* pArg, CGameObject* pOwner) +{ + CGoblin_Dagger* pInstance = new CGoblin_Dagger(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CGoblin_Dagger"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CGoblin_Dagger::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pShaderCom); + SAFE_RELEASE(m_pModelCom); + +} +#ifdef _DEBUG + +void CGoblin_Dagger::Describe_Entity() +{ +} + +#endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Private/Goblin_Spector.cpp b/Jusin154_Team3D/Editor/Private/Goblin_Spector.cpp new file mode 100644 index 000000000..68aa1b4bf --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Goblin_Spector.cpp @@ -0,0 +1,245 @@ +#include "pch.h" +#include "Goblin_Spector.h" + +#include "GameInstance.h" +#include "Goblin.h" +#include "Effect_Container.h" +#include "Goblin_BattleAxe.h" + +#include "EditEffect.h" + + +CGoblin_Spector::CGoblin_Spector(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) + : CMonster(pDevice, pContext) +{ +} + +CGoblin_Spector::CGoblin_Spector(const CGoblin_Spector& Prototype) + : CMonster(Prototype) +{ +} + +HRESULT CGoblin_Spector::Initialize_Prototype() +{ + return S_OK; +} + +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; + + if (FAILED(Ready_Components())) + return E_FAIL; + + 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; +} + +void CGoblin_Spector::Priority_Update(_float fTimeDelta) +{ + __super::Priority_Update(fTimeDelta); +} + +void CGoblin_Spector::Update(_float fTimeDelta) +{ + __super::Update(fTimeDelta); + + 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(); + +#ifdef _DEBUG + Describe_Entity(); +#endif // _DEBUG + +} + +void CGoblin_Spector::Late_Update(_float fTimeDelta) +{ + __super::Late_Update(fTimeDelta); + + m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this); +} + +HRESULT CGoblin_Spector::Render() +{ + 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"))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) { + return E_FAIL; + } + + if (FAILED(m_pShaderCom->Begin(iShaderPass))) { + return E_FAIL; + } + + if (FAILED(m_pModelCom->Render(i))) { + return E_FAIL; + } + } + + return S_OK; +} + +void CGoblin_Spector::OnCollision(CGameObject* pOther, void* pDesc) +{ + +} + +void CGoblin_Spector::OnHit(CGameObject* pOther, CGameObject* pCaller) +{ +} + +HRESULT CGoblin_Spector::Ready_Components() +{ + CTransform::TRANSFORM_DESC Desc = {}; + + Desc.fSpeedPerSec = 10.f; + Desc.fRotationPerSec = XMConvertToRadians(180.0f); + Desc.fRadius = 10.f; + + __super::Ready_Components(&Desc); + + m_strModelPrototypeTag = TEXT("Prototype_Component_Goblin_Spector_Model"); + + /* Com_Model */ + if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag, + reinterpret_cast(&m_pModelCom)))) { + return E_FAIL; + } + + //if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_GOBLIN"), (CComponent**)&m_pStat))) { + // return E_FAIL; + //} + return S_OK; +} + +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; + } + + return S_OK; +} + +HRESULT CGoblin_Spector::Bind_ShaderResources() +{ + if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { + 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_Spector* CGoblin_Spector::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CGoblin_Spector* pInstance = new CGoblin_Spector(pDevice, pContext); + + if (FAILED(pInstance->Initialize_Prototype())) + { + MSG_BOX("Failed to Created : CGoblin_Spector"); + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +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"); + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CGoblin_Spector::Free() +{ + __super::Free(); + + SAFE_RELEASE(m_pSmoke); + SAFE_RELEASE(m_pGoblin_Particle); + SAFE_RELEASE(m_pGoblin_Particle2); + 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/Editor/Private/Goblin_States.cpp b/Jusin154_Team3D/Editor/Private/Goblin_States.cpp index ff4a55c37..9daf4e7c4 100644 --- a/Jusin154_Team3D/Editor/Private/Goblin_States.cpp +++ b/Jusin154_Team3D/Editor/Private/Goblin_States.cpp @@ -1,8 +1,10 @@ #include "pch.h" #include "Goblin.h" - +#include "InfoInstance.h" #include "GameInstance.h" #include "Player.h" +#include "Goblin_Dagger.h" +#include "EditEffect.h" #pragma region STATE #include "State_Idle.h" @@ -11,6 +13,12 @@ #include "State_Land.h" #include "State_Move.h" #include "State_Combat.h" +#include "State_Swing.h" +#include "State_Throw.h" +#include "State_Blink.h" +#include "State_Hit.h" +#include "State_Dead.h" +#include "State_Shuffle.h" #pragma endregion @@ -24,8 +32,11 @@ void CGoblin::Behavior_IdleEnter() HRESULT CGoblin::Behavior_IdleExitCheck() { - if (m_fTargetDistance <= 15.f) + if (m_fTargetDistance <= 20.f && m_fTargetDistance != 0.f) + { + m_vOriginPos = m_pTransformCom->Get_State(STATE::POSITION); m_pFSM->Change_State(FSMSTATE::MOVE); + } return E_FAIL; } @@ -38,18 +49,68 @@ void CGoblin::Behavior_IdleExit() 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) { - if (m_fTargetDistance <= 3.f) + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + + + 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.f) + { + m_bFirstMove = false; + m_fMoveTime = 0.f; + } + } + + if (m_fTargetDistance <= 15.f && m_fTargetDistance >= 3.f && m_fTargetDistance != 0.f) m_pFSM->Change_State(FSMSTATE::COMBAT); return E_FAIL; @@ -63,28 +124,381 @@ void CGoblin::Behavior_MoveExit() void CGoblin::Behavior_CombatEnter() { pair<_uint, _bool> pairAnimInfo = {}; - m_pFSM->Enable_State(FSMSTATE::COMBAT); - - m_pFSM->Enable_State(FSMSTATE::SKILL); - - pairAnimInfo = m_Animation[STATEANIM::SKILL]; - - m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); + m_bLookAt = true; } -HRESULT CGoblin::Behavior_CombatExitCheck() +HRESULT CGoblin::Behavior_CombatExitCheck(_float fTimeDelta) { - if (m_pModelCom->IsFinishedAnim()) + m_bLookAt = true; + + if (m_fTargetDistance > 25.f && m_fTargetDistance != 0.f) { m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; } + else if (m_fTargetDistance > 20.f && m_fTargetDistance != 0.f) + { + m_pFSM->Change_State(FSMSTATE::MOVE); + return E_FAIL; + } + + if (m_fTargetDistance <= 6.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::SWING)] <= 0.f) + { + m_pFSM->Change_State(FSMSTATE::SWING); + } + else if (m_fTargetDistance >= 7.f && m_fTargetDistance <= 12.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::THROW)] <= 0.f) + { + m_pFSM->Change_State(FSMSTATE::SKILL); + } + else if (m_fTargetDistance <= 15.f && m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::TP)] <= 0.f) + { + m_pFSM->Change_State(FSMSTATE::BLINK); + } + else { + m_pFSM->Change_State(FSMSTATE::MOVE); + } + return E_FAIL; } void CGoblin::Behavior_CombatExit() { - m_pFSM->Disable_State(FSMSTATE::COMBAT | FSMSTATE::SKILL | FSMSTATE::SKILL2); + m_pFSM->Disable_State(FSMSTATE::COMBAT); +} + +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, + [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.45f); +} + +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 = 2.f; + _float dist = m_fTargetDistance; + + if (dist > fDesiredRange) + { + _vector vPos = Get_WorldPostion(); + _vector vDistance = XMLoadFloat4(&m_vTargetPos) - vPos; + vDistance = XMVector4Normalize(vDistance); + _float step = dist - fDesiredRange; + + m_pTransformCom->AccumulateMomentum(vDistance * step * fTimeDelta * 1.5f); + } + } + + return E_FAIL; +} + +void CGoblin::Behavior_SwingExit() +{ + m_pFSM->Disable_State(FSMSTATE::SWING); +} + +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)]; + + Add_Event(pairAnimInfo.first, + [this]() { + Get_PartObject()->Set_Visible(true); + Get_PartObject()->Set_Attach(false); }, + 0.3f); +} + +HRESULT CGoblin::Behavior_ThrowExitCheck(_float fTimeDelta) +{ + if (m_pModelCom->IsFinishedAnim()) + { + m_bLookAt = true; + m_bStep = true; + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + return E_FAIL; +} + +void CGoblin::Behavior_ThrowExit() +{ + m_pFSM->Disable_State(FSMSTATE::SKILL); + Get_PartObject()->Set_Attach(true); + Get_PartObject()->Set_Visible(false); +} + +void CGoblin::Behavior_BlinkEnter() +{ + + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::BLINK); + + pairAnimInfo = m_Animation[STATEANIM::BLINK_START]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + + Add_Event(pairAnimInfo.first, + [this]() { + m_bVisible = false; + m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::TP)] = m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::TP)]; + _vector vPlayerPos = XMLoadFloat4(&m_vTargetPos); + _vector vPlayerLook = m_pTarget->Get_Component()->Get_State(STATE::LOOK); + vPlayerLook = XMVectorSetY(vPlayerLook, 1.f); + vPlayerLook = XMVector3Normalize(vPlayerLook); + + _float randAngleDeg = m_pGameInstance->Real_Random_Float(-60.f, 60.f); + _float randAngleRad = XMConvertToRadians(randAngleDeg); + + _matrix rot = XMMatrixRotationY(randAngleRad); + _vector offsetDir = XMVector3TransformNormal(vPlayerLook, rot); + + _float randDist = m_pGameInstance->Real_Random_Float(5.f, 5.5f); + + _vector vFinalPos = vPlayerPos + offsetDir * randDist; + vFinalPos = XMVectorSetY(vFinalPos, XMVectorGetY(vPlayerPos) + 1.f); + + m_pCharacter_Controller->Set_Position(vFinalPos); } + , 0.99f); +} + +HRESULT CGoblin::Behavior_BlinkExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + m_fTpTime += fTimeDelta; + if (m_fTpTime >= 1.5f) + { + m_bVisible = true; + m_fTpTime = 0.f; + pairAnimInfo = m_Animation[STATEANIM::BLINK]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + } + + if (m_pModelCom->IsFinishedAnim() && iCurrAnimIndex == m_Animation[STATEANIM::BLINK].first) + { + m_bLookAt = true; + m_fTpTime = 0.f; + m_pFSM->Change_State(FSMSTATE::COMBAT); + return E_FAIL; + } + + return E_FAIL; +} + +void CGoblin::Behavior_BlinkExit() +{ + m_pFSM->Disable_State(FSMSTATE::BLINK); +} + +void CGoblin::Behavior_ShuffleEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::SHUFFLE); + _uint iRand = m_pGameInstance->Real_Random_Int(0, 3); + switch (iRand) + { + case 0: + pairAnimInfo = m_Animation[STATEANIM::SHUFFLE1]; + break; + case 1: + pairAnimInfo = m_Animation[STATEANIM::SHUFFLE2]; + break; + case 2: + pairAnimInfo = m_Animation[STATEANIM::SHUFFLE3]; + break; + case 3: + pairAnimInfo = m_Animation[STATEANIM::SHUFFLE4]; + break; + } + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f, true); + + Add_Event(pairAnimInfo.first, + [this]() { + m_pFSM->Change_State(FSMSTATE::COMBAT); }, + 0.3f); +} + +HRESULT CGoblin::Behavior_ShuffleExitCheck(_float fTimeDelta) +{ + return E_FAIL; +} + +void CGoblin::Behavior_ShuffleExit() +{ + m_pFSM->Disable_State(FSMSTATE::SHUFFLE); +} + +void CGoblin::Behavior_HitEnter() +{ + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::HIT); + + m_bLookAt = false; + switch (m_eHitSpell) + { + case STATEANIM::KNOCKDOWN_FWD: + pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_FWD]; + break; + case STATEANIM::TUMBLE2: + pairAnimInfo = m_Animation[STATEANIM::TUMBLE2]; + break; + case STATEANIM::HIT_LEVIOSO: + { + pairAnimInfo = m_Animation[STATEANIM::HIT_LEVIOSO]; + break; + } + default: + pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_FWD]; + break; + } + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CGoblin::Behavior_HitExitCheck(_float fTimeDelta) +{ + pair<_uint, _bool> pairAnimInfo = {}; + _uint iCurrAnimIndex = m_pModelCom->Get_AnimIndex(); + + if (iCurrAnimIndex == m_Animation[STATEANIM::KNOCKDOWN_FWD].first) + { + if (m_pModelCom->Get_CurrentTrackProgressRatio() >= 0.5f) + { + pairAnimInfo = m_Animation[STATEANIM::KNOCKDOWN_FWD_SPLT]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f); + } + } + + if (iCurrAnimIndex == m_Animation[STATEANIM::HIT_LEVIOSO].first) + { + _vector vDir = m_pTransformCom->Get_State(STATE::UP); + vDir = XMVector4Normalize(vDir); + _vector vPos = m_pCharacter_Controller->Get_Position(); + m_fAirTime += fTimeDelta; + _vector Force = vDir * fTimeDelta; + if (m_fAirTime < 1.3f) { + m_pCharacter_Controller->Set_Position(vPos + Force); + } + else { + m_pCharacter_Controller->Set_Position(vPos); + } + m_pCharacter_Controller->SetGravity(false); + + if (m_pModelCom->Get_CurrentTrackProgressRatio() >= 0.31f) + { + m_fAirTime = 0.f; + m_pCharacter_Controller->SetGravity(true); + pairAnimInfo = m_Animation[STATEANIM::LAND]; + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second, 1.f); + } + } + + + if (m_pModelCom->IsFinishedAnim()) + { + m_bLookAt = true; + m_pFSM->Change_State(FSMSTATE::IDLE); + return E_FAIL; + } + return E_FAIL; +} + +void CGoblin::Behavior_HitExit() +{ + m_pFSM->Disable_State(FSMSTATE::HIT); +} + +void CGoblin::Behavior_DeadEnter() +{ + m_bLookAt = false; + pair<_uint, _bool> pairAnimInfo = {}; + m_pFSM->Enable_State(FSMSTATE::DEAD); + 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_pRigidBody->SetActive(false); + m_pCharacter_Controller->SetActive(false); + + _bool bStrongerKnockDown = { false }; + + switch (m_eHitSpell) + { + case STATEANIM::KNOCKDOWN_FWD: + bStrongerKnockDown = true; + break; + case STATEANIM::TUMBLE2: + bStrongerKnockDown = true; + break; + default: + break; + } + + _float fabsRadius = fabsf(m_fHitRadius); + _uint iState = { UINT_MAX }; + + if (fabsRadius > 135.f) { + iState = STATEANIM::DEAD_FWD; + } + else if (fabsRadius < 45.f) { + iState = STATEANIM::DEAD_BWD; + } + else { + if (m_fHitRadius < 0.f) { + iState = STATEANIM::DEAD_L; + } + else { + iState = STATEANIM::DEAD_R; + } + } + pairAnimInfo = m_Animation[iState + bStrongerKnockDown]; + + Get_PartObject("Goblin_Particle")->Set_Visible(false); + Get_PartObject("Goblin_Particle2")->Set_Visible(false); + Get_PartObject("Goblin_Smoke")->Set_Visible(false); + + m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second); +} + +HRESULT CGoblin::Behavior_DeadExitCheck(_float fTimeDelta) +{ + if (FLT_EPSILON > m_pModelCom->Get_CurrentTrackProgressRatio()) { + return E_PENDING; + } + return S_OK; +} + +void CGoblin::Behavior_DeadExit() +{ + m_bDead = true; } @@ -105,46 +519,219 @@ 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 = [this](_float fTimeDelta) { - if (m_pGameInstance->Key_Pressing(DIK_A)) { m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta); } - if (m_pGameInstance->Key_Pressing(DIK_D)) { m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta); }; - }; + Desc.funcPriorityUpdate = nullptr; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc)); } #pragma endregion - #pragma region Behavior_Combat_NotFocus { CState_Combat::STATE_COMBAT_DESC Desc{}; Desc.pOwner = this; Desc.funcEnterEvent = [this]() { Behavior_CombatEnter(); }; - Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_CombatExitCheck(fTimedelta); }; Desc.funcExitEvent = [this]() { Behavior_CombatExit(); }; Desc.funcPriorityUpdate = nullptr; Desc.funcLateUpdate = nullptr; m_States.emplace(FSMSTATE::COMBAT, CState_Combat::Create(&Desc)); } + { + CState_Swing::STATE_SWING_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_SwingEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_SwingExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_SwingExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SWING, CState_Swing::Create(&Desc)); + } + { + CState_Throw::STATE_THROW_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_ThrowEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_ThrowExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_ThrowExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SKILL, CState_Throw::Create(&Desc)); + } + { + CState_Blink::STATE_BLINK_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_BlinkEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_BlinkExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_BlinkExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::BLINK, CState_Blink::Create(&Desc)); + } + + { + CState_Shuffle::STATE_SHUFFLE_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_ShuffleEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_ShuffleExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_ShuffleExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::SHUFFLE, CState_Shuffle::Create(&Desc)); + } #pragma endregion #pragma region Behavior_Combat_Focus + { + CState_Dead::STATE_DEAD_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_DeadEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_DeadExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_DeadExit(); }; + Desc.funcLateUpdate = [this](_float fDeadRatio) { + m_fDeadRatio = fDeadRatio; + if (m_fDeadRatio > 1.f) { + m_bDead = true; + } + }; + Desc.vDeadTimer.x = FLT_EPSILON5; + Desc.vDeadTimer.y = 2.f; + m_States.emplace(FSMSTATE::DEAD, CState_Dead::Create(&Desc)); + } +#pragma endregion + +#pragma region Hit + { + CState_Hit::STATE_HIT_DESC Desc{}; + Desc.pOwner = this; + Desc.funcEnterEvent = [this]() { Behavior_HitEnter(); }; + Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_HitExitCheck(fTimedelta); }; + Desc.funcExitEvent = [this]() { Behavior_HitExit(); }; + Desc.funcPriorityUpdate = nullptr; + Desc.funcLateUpdate = nullptr; + m_States.emplace(FSMSTATE::HIT, CState_Hit::Create(&Desc)); + } #pragma endregion + } void CGoblin::Set_Anim() { - m_Animation[STATEANIM::IDLE] = { 22,true }; + m_Animation[STATEANIM::IDLE_TURN_BWD] = { 24, false }; + m_Animation[STATEANIM::IDLE_TURN_L] = { 26, false }; + m_Animation[STATEANIM::IDLE_TURN_R] = { 30, false }; - m_Animation[STATEANIM::WALK_FWD] = { 50,true }; + m_Animation[STATEANIM::WALK_FWD] = { 45,true }; + m_Animation[STATEANIM::WALK_START] = { 57,false }; m_Animation[STATEANIM::WALK_STOP] = { 58,false }; + m_Animation[STATEANIM::WALK_BWD] = { 252, true }; + + 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 }; + m_Animation[STATEANIM::SHUFFLE3] = { 205,false }; + m_Animation[STATEANIM::SHUFFLE4] = { 206,false }; + + m_Animation[STATEANIM::DODGE_LEFT] = { 125, false }; + m_Animation[STATEANIM::DODGE_RIGHT] = { 126, false }; + m_Animation[STATEANIM::SPRINT] = { 90, true }; + + m_Animation[STATEANIM::SKILL] = { 85,false }; // 나이프 던지기 + m_Animation[STATEANIM::BLINK_START] = { 428,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 }; + m_Animation[STATEANIM::HIT_BWD2] = { 349, false }; + m_Animation[STATEANIM::HIT_BWD3] = { 350, false }; + m_Animation[STATEANIM::HIT_BWD4] = { 351, false }; + m_Animation[STATEANIM::HIT_L] = { 354, false }; + m_Animation[STATEANIM::HIT_R] = { 355, false }; + + m_Animation[STATEANIM::KNOCKDOWN_BWD] = { 374, false }; + m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT] = { 375, false }; + m_Animation[STATEANIM::KNOCKDOWN_BWD_SPLT_HOLD] = { 370, false }; + m_Animation[STATEANIM::KNOCKDOWN_FWD] = { 371, false }; + m_Animation[STATEANIM::KNOCKDOWN_FWD_SPLT] = { 372, false }; + m_Animation[STATEANIM::KNOCKDOWN_FWD_SPLT_HOLD] = { 373, false }; + + m_Animation[STATEANIM::GETUP_BWD] = { 330, false }; + m_Animation[STATEANIM::GETUP_FWD] = { 332, false }; + m_Animation[STATEANIM::GETUP_L] = { 334, false }; + m_Animation[STATEANIM::GETUP_L_FD] = { 336, false }; + m_Animation[STATEANIM::GETUP_L_FU] = { 338, false }; + m_Animation[STATEANIM::GETUP_R] = { 340, false }; + m_Animation[STATEANIM::GETUP_R_FD] = { 342, false }; + m_Animation[STATEANIM::GETUP_R_FU] = { 344, false }; + m_Animation[STATEANIM::GETUP_SLOUCH] = { 346, false }; + + m_Animation[STATEANIM::KNOCKBACK] = { 377, true }; + m_Animation[STATEANIM::KNOCKBACK2] = { 378, true }; + m_Animation[STATEANIM::TUMBLE] = { 379, true }; + m_Animation[STATEANIM::TUMBLE2] = { 380, true };// 원래 true 였음 + m_Animation[STATEANIM::PETRIFICUSED_START] = { 383, false }; + + m_Animation[STATEANIM::LAND] = { 376, false }; + m_Animation[STATEANIM::HIT_LEVIOSO] = { 381, false }; + + m_Animation[STATEANIM::DEAD_BWD] = { 317, false }; + m_Animation[STATEANIM::DEAD_BWD2] = { 318, false }; + m_Animation[STATEANIM::DEAD_FWD] = { 319, false }; + m_Animation[STATEANIM::DEAD_FWD2] = { 320, false }; + m_Animation[STATEANIM::DEAD_L] = { 321, false }; + m_Animation[STATEANIM::DEAD_L2] = { 322, false }; + m_Animation[STATEANIM::DEAD_R] = { 323, false }; + m_Animation[STATEANIM::DEAD_R2] = { 324, false }; + + //Tp 426 + // Tp Start 428 + // 76 공격끝 + + + + + + + + + // 걷기 시작 57 + // 걷기 루프 50 + // 뛰기 시작 157 + // 뛰기 루프 45 + // 나이프 던지기 85 + // 도끼 공격 444 + // 도끼 공격 후 76 + // 도끼 찍기 439 + // + + // 텀블링 히트 380 + // 디센도 찍기전 띄우기 371 + // 디센도 찍기 372 + + // 레비오소 피격 381 + // 착지 376 + // + + // Shuffle1 211 + // Shuffle2 215 + // Shuffle3 219 + // Shuffle4 223 + + //Jog 112도 L 148 + //Jog 112도 R 152 + // Jog 90 L 151 + // Jog 90 R 155 + - m_Animation[STATEANIM::JOG_FWD] = { 46,true }; - m_Animation[STATEANIM::JOG_BWD] = { 154,false }; - m_Animation[STATEANIM::SKILL] = { 70,false }; // 도끼 스윙 - m_Animation[STATEANIM::SKILL2] = { 85,false }; // 나이프 던지기 } diff --git a/Jusin154_Team3D/Editor/Private/InfoInstance.cpp b/Jusin154_Team3D/Editor/Private/InfoInstance.cpp index 34ba525ca..430367b9f 100644 --- a/Jusin154_Team3D/Editor/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Editor/Private/InfoInstance.cpp @@ -4,6 +4,7 @@ #include "MapInfo.h" #include "MonsterInfo.h" #include "PlayerInfo.h" +#include "Skill_Data.h" IMPLEMENT_SINGLETON(CInfoInstance) @@ -16,14 +17,17 @@ void CInfoInstance::Update(_float fTimeDelta) { m_pPlayerInfo->Update(fTimeDelta); m_pMonsterInfo->Update(fTimeDelta); - //m_pMapInfo->Update(fTimeDelta); + m_pMapInfo->Update(fTimeDelta); + m_pSkillInfo->Update(fTimeDelta); + } void CInfoInstance::Change_Level() { m_pPlayerInfo->Change_Level(); m_pMonsterInfo->Change_Level(); - //m_pMapInfo->Change_Level(); + m_pMapInfo->Change_Level(); + m_pSkillInfo->Change_Level(); } void CInfoInstance::Update_CameraCoordinateSystem(_float3& vLook, _float3& vRight) @@ -44,7 +48,7 @@ HRESULT CInfoInstance::Regist_PlayerAlly(CUnit* pUnit) HRESULT CInfoInstance::Deregist_PlayerAlly(CUnit* pUnit) { - if (nullptr == m_pMonsterInfo) { + if (nullptr == s_pInstance || nullptr == m_pMonsterInfo) { return S_OK; // 게임 종료 된 상태 } return m_pMonsterInfo->Deregist_PlayerAlly(pUnit); @@ -57,7 +61,7 @@ HRESULT CInfoInstance::Regist_ActiveMonster(CMonster* pUnit) HRESULT CInfoInstance::Deregist_ActiveMonster(CMonster* pUnit) { - if (nullptr == m_pMonsterInfo) { + if (nullptr == s_pInstance || nullptr == m_pMonsterInfo) { return S_OK; // 게임 종료 된 상태 } return m_pMonsterInfo->Deregist_ActiveMonster(pUnit); @@ -67,7 +71,7 @@ CUnit* CInfoInstance::Get_LockOnUnit() { CUnit* pUnit = { nullptr }; pUnit = m_pMonsterInfo->Get_LockOnUnit(); - // pUnit = m_pInfo->Get_LockOnUnit(); + // pUnit = m_pInfo->Get_LockOnInfo(); return pUnit; } @@ -77,14 +81,33 @@ pair CInfoInstance::Get_NearestPlayerAlly(_fvector vPos) } #pragma endregion #pragma region MAP_INFO -//HRESULT CInfoInstance::Load_MapObjects(const _char* pFilePath) -//{ -// return m_pMapInfo->Load_MapObjects(pFilePath); -//} -//HRESULT CInfoInstance::Load_LightElements(const _char* pFilePath) -//{ -// return m_pMapInfo->Load_LightElements(pFilePath); -//} + +#pragma endregion + +#pragma region SPELL_INFO +HRESULT CInfoInstance::Load_SpellInfo(const _char* pFilePath) +{ + return m_pSkillInfo->Load_SpellInfo(pFilePath); +} +SPELL_INFO CInfoInstance::Get_Spell_Info(_int Spell_Info) +{ + return m_pSkillInfo->Get_Info(Spell_Info); +} + +_int CInfoInstance::Update_Spell(_int SpellIndex) +{ + return m_pSkillInfo->Update_Spell(SpellIndex); +} + +_float CInfoInstance::Get_CoolTime(_int SpellID) +{ + return m_pSkillInfo->Get_CoolTime(SpellID); +} +void CInfoInstance::Change_Canvas() +{ + +} + #pragma endregion LEVEL CInfoInstance::Get_RestartLevel() { @@ -100,11 +123,10 @@ HRESULT CInfoInstance::Initialize_Information(ID3D11Device* pDevice, ID3D11Devic SAFE_ADDREF(m_pDevice); SAFE_ADDREF(m_pContext); - //m_pMapInfo = CMapInfo::Create(pDevice, pContext); - //if (nullptr == m_pMapInfo) { - // return E_FAIL; - //} - + m_pMapInfo = CMapInfo::Create(pDevice, pContext); + if (nullptr == m_pMapInfo) { + return E_FAIL; + } m_pPlayerInfo = CPlayerInfo::Create(pDevice, pContext); if (nullptr == m_pPlayerInfo) { return E_FAIL; @@ -113,6 +135,10 @@ HRESULT CInfoInstance::Initialize_Information(ID3D11Device* pDevice, ID3D11Devic if (nullptr == m_pMonsterInfo) { return E_FAIL; } + m_pSkillInfo = CSkill_Data::Create(pDevice, pContext); + if (nullptr == m_pSkillInfo) { + return E_FAIL; + } return S_OK; @@ -122,8 +148,11 @@ void CInfoInstance::Release_Information() { DestroyInstance(); + + SAFE_RELEASE(m_pMapInfo); SAFE_RELEASE(m_pPlayerInfo); SAFE_RELEASE(m_pMonsterInfo); + SAFE_RELEASE(m_pSkillInfo); SAFE_RELEASE(m_pDevice); SAFE_RELEASE(m_pContext); SAFE_RELEASE(m_pGameInstance); diff --git a/Jusin154_Team3D/Editor/Private/Levioso.cpp b/Jusin154_Team3D/Editor/Private/Levioso.cpp index 0a7a72f9c..69b451ff5 100644 --- a/Jusin154_Team3D/Editor/Private/Levioso.cpp +++ b/Jusin154_Team3D/Editor/Private/Levioso.cpp @@ -6,6 +6,7 @@ #include "Player.h" #include "TrailObject.h" #include "Wand.h" +#include "InfoInstance.h" CLevioso::CLevioso(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) @@ -14,7 +15,8 @@ CLevioso::CLevioso(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) } CLevioso::CLevioso(const CLevioso& rhs) - : CEffect_Container(rhs) + : CEffect_Container(rhs), + m_pInfoInstance(CInfoInstance::GetInstance()) { } @@ -74,11 +76,10 @@ void CLevioso::Update(_float fTimeDelta) Update_Event(fTimeDelta); - m_pLeviosoPJ_0->Get_Component()->Translation(m_vOwnerLook * 0.25f); + m_pLeviosoPJ_0->Get_Component()->Translation(XMLoadFloat3(&m_vCameraLook) * m_fLinearSpeed); + m_pTrail_PT_0->Get_Component()->Translation(XMLoadFloat3(&m_vCameraLook) * m_fLinearSpeed); - m_pTrail_PT_0->Get_Component()->Translation(m_vOwnerLook * 0.25f); - if (true == m_pGameInstance->SphereCast(0.0f, XMLoadFloat4(&m_vStartPos), m_vOwnerLook, XMVectorGetX(XMVector3Length(m_vOwnerLook * 1.f)) , PSX::PxHitFlag::ePOSITION | PSX::PxHitFlag::eNORMAL, PSX::PxQueryFlag::eSTATIC, m_Hitbuffer)) { @@ -126,28 +127,55 @@ HRESULT CLevioso::Pre_Setting(CGameObject* pObject, void* pArg) _vector WandPos = pPlayer->Get_WandPos().r[3]; CEditEffect* pWandSmoke = Get_PartObject("Levioso_Wand0"); - CEditEffect* pWandLight= Get_PartObject("Levioso_Wand_Light"); - - - m_pLeviosoPJ_0->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); - m_pTrail_PT_0->Get_Component()->Set_WorldMatrix(m_pOwner->Get_Component()->Get_XMWorldMatrix()); - + CEditEffect* pWandLight = Get_PartObject("Levioso_Wand_Light"); m_pLeviosoPJ_0->Get_Component()->Set_State(STATE::POSITION, WandPos); m_pTrail_PT_0->Get_Component()->Set_State(STATE::POSITION, WandPos); + pWandSmoke->Get_Component()->Set_State(STATE::POSITION, pPlayer->Get_PartObject()->Get_WorldPostion()); pWandLight->Get_Component()->Set_State(STATE::POSITION, pPlayer->Get_PartObject()->Get_WorldPostion()); m_pLeviosoPJ_0->Set_Visible(true); m_pTrail_PT_0->Set_Visible(true); + pWandSmoke->Set_Visible(true); pWandLight->Set_Visible(true); - m_pLeviosoTrail->Set_Visible(true); - m_pLeviosoTrail->Get_Component()->Reset_Trail(); m_vOwnerLook = XMVector3Normalize(m_pOwner->Get_Component()->Get_State(STATE::LOOK)); + _vector vDirection = m_pOwner->Get_Component()->Get_State(STATE::LOOK); + XMStoreFloat3(&m_vCameraLook, vDirection); + + _vector vStartPos = WandPos; + XMStoreFloat4(&m_vStartPos, vStartPos); + + { /* 대상 위치 지정 */ + + CUnit* pTargetUnit = m_pInfoInstance->Get_LockOnUnit(); + if (nullptr != pTargetUnit) { + + XMStoreFloat4(&m_vTargetPos, pTargetUnit->Get_LockOnPos()); + + XMStoreFloat3(&m_vCameraLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos))); + } + else { + // 타겟이 없다면 현재위치 -> 카메라 룩벡터 * duration간 예상 이동거리 를 대상으로 지정 + XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_fLinearSpeed * 0.5f); + } + + } + + _vector vDir = XMVector3Normalize(XMLoadFloat3(&m_vCameraLook)); + + _vector vRight = XMVector3Normalize(XMVector3Cross(XMVectorSet(0.f, 1.f, 0.f, 0.f), vDir)); + + _vector vUp = XMVector3Normalize(XMVector3Cross(vRight, vDir)); + + _matrix ProjMat = _matrix(vRight, vUp, vDir, vStartPos); + + m_pLeviosoPJ_0->Get_Component()->Set_WorldMatrix(ProjMat); + return S_OK; } diff --git a/Jusin154_Team3D/Editor/Private/Loader.cpp b/Jusin154_Team3D/Editor/Private/Loader.cpp index 3fe43dad3..687b123be 100644 --- a/Jusin154_Team3D/Editor/Private/Loader.cpp +++ b/Jusin154_Team3D/Editor/Private/Loader.cpp @@ -146,10 +146,14 @@ #include "TrollSwing.h" #include "Troll_Nomal_Smoke.h" #include "Troll_Rush_Hit.h" +#include "Goblin_Protego.h" #include "Troll.h" #include "Troll_Rock.h" #include "Troll_Weapon.h" +#include "Goblin_Dagger.h" +#include "Goblin_BattleAxe.h" +#include "Goblin_Spector.h" #pragma endregion #pragma region PHYSX_HEADER @@ -1302,6 +1306,18 @@ HRESULT CLoader::Loading_For_Effect() CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixRotationX(XMConvertToRadians(-90.f)) * XMMatrixIdentity())))) 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::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; + + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Spector_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/GoblinSpector/GoblinSpector.bin", XMMatrixRotationY(XMConvertToRadians(180.f)) * XMMatrixIdentity())))) + return E_FAIL; + vector*>> futures = {}; futures.emplace_back(Deferred_ModelLoad( @@ -1342,7 +1358,7 @@ HRESULT CLoader::Loading_For_Effect() } 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"), @@ -1482,6 +1498,22 @@ HRESULT CLoader::Loading_For_Effect() if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CTroll_Rush_Hit::Create(m_pDevice, m_pContext)))) { return E_FAIL; } + if (FAILED(m_pGameInstance->Add_Prototype(NEXT_LEVEL, CGoblin_Protego::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Dagger::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_BattleAxe::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + + if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CGoblin_Spector::Create(m_pDevice, m_pContext)))) { + return E_FAIL; + } + /* For.Prototype_GameObject_Wand */ if (FAILED(m_pGameInstance->Add_Prototype(g_iStaticLevel, CWand::Create(m_pDevice, m_pContext)))) @@ -2030,8 +2062,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_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())))) { + if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_VFX_SM_Rock_01_Model"), + CModel::Create(m_pDevice, m_pContext, MODEL::ANIM_LOCAL, "C:/MeshTable\\Game\\VFX\\Meshes\\Static\\VFX_SM_Rock_01.fbx", XMMatrixIdentity())))) { return E_FAIL; } diff --git a/Jusin154_Team3D/Editor/Private/Monster.cpp b/Jusin154_Team3D/Editor/Private/Monster.cpp index 5132f867a..09374aea0 100644 --- a/Jusin154_Team3D/Editor/Private/Monster.cpp +++ b/Jusin154_Team3D/Editor/Private/Monster.cpp @@ -126,7 +126,7 @@ _bool CMonster::Get_Damage(_float fDamage) _float2 CMonster::Get_Hp() { - return { m_pStat->Get_Stat(ENUM_CLASS(STAT::HP)), m_pStat->Get_Stat(ENUM_CLASS(STAT::MAXHP)) }; + return { m_pStat->Get_Stat().fCurrentHp, m_pStat->Get_Stat().fMaxHp}; } HRESULT CMonster::Ready_Components(void* pArg) diff --git a/Jusin154_Team3D/Editor/Private/Skill_Data.cpp b/Jusin154_Team3D/Editor/Private/Skill_Data.cpp new file mode 100644 index 000000000..aca6a9e42 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/Skill_Data.cpp @@ -0,0 +1,153 @@ +#include "pch.h" +#include "Skill_Data.h" +#include "GameObject.h" +#include "UIObject.h" +#include "tinyxml2.h" +#include "InfoInstance.h" + +CSkill_Data::CSkill_Data() + :m_pInfoInstance(CInfoInstance::GetInstance()) +{ +} + +HRESULT CSkill_Data::Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex) +{ + return S_OK; +} + +const SPELL_INFO& CSkill_Data::Get_Info(_uint SpellID) const +{ + return SpellInfo[SpellID]; +} + +_int CSkill_Data::Update_Spell(_int SpellID) +{ + if (SpellID < 0 || SpellID > m_iSpell_Count) + return ENUM_CLASS(SKILL_TYPE::END); + + if (SpellInfo[SpellID].bUse_Skill == false) + return -1; + + if (m_bNoCool == false) + { + SpellInfo[SpellID].bUse_Skill = false; + m_iSpell_CoolTime[SpellID] = 0.f; + } + + return SpellInfo[SpellID].iSkill_Type; +} + +void CSkill_Data::Update(_float fTimeDelta) +{ + for (_int i = 0; i < m_iSpell_Count; ++i) + { + if (SpellInfo[i].bUse_Skill == false) + { + if (m_iSpell_CoolTime[i] <= 1.f) + { + m_iSpell_CoolTime[i] += fTimeDelta * (1.f / SpellInfo[i].fSpell_CoolTime); + } + else + { + SpellInfo[i].bUse_Skill = true; + } + + } + } + + if (m_bNoCool == true) + { + for (_int i = 0; i < 34; ++i) + { + m_iSpell_CoolTime[i] = 1.f; + } + } + +} + +void CSkill_Data::Change_Level() +{ +} + +_float CSkill_Data::Get_CoolTime(_int SpellID) +{ + if (SpellID < 0 || SpellID > m_iSpell_Count) + return 0.f; + + return m_iSpell_CoolTime[SpellID]; +} + +HRESULT CSkill_Data::Load_SpellInfo(const _char* pFilePath) +{ + tinyxml2::XMLDocument doc; + tinyxml2::XMLError Error = doc.LoadFile(pFilePath); + if (Error != tinyxml2::XML_SUCCESS) + return E_FAIL; + + tinyxml2::XMLElement* pSpellInfo = doc.FirstChildElement("SpellInfo"); + if (!pSpellInfo) + return E_FAIL; + + tinyxml2::XMLElement* pSpell = pSpellInfo->FirstChildElement("Spell"); + while (pSpell) + { + int id = 0; + pSpell->QueryIntAttribute("Spell_ID", &id); + + if (id >= 0 && id <= 34) + { + SpellInfo[id].iSpell_ID = id; + SpellInfo[id].pSpell_Name = CMyTools::ToWstring(pSpell->Attribute("Spell_Name")); + SpellInfo[id].pImage_Name = CMyTools::ToWstring(pSpell->Attribute("Image_Name")); + pSpell->QueryIntAttribute("Spell_Type", &SpellInfo[id].iSpell_Type); + SpellInfo[id].pType_Name = CMyTools::ToWstring(pSpell->Attribute("Type_Name")); + pSpell->QueryIntAttribute("Skill_Type", &SpellInfo[id].iSkill_Type); + pSpell->QueryFloatAttribute("Spell_Damage", &SpellInfo[id].fSpell_Damage); + pSpell->QueryFloatAttribute("Spell_Cooltime", &SpellInfo[id].fSpell_CoolTime); + pSpell->QueryFloatAttribute("Duration", &SpellInfo[id].fDuration); + pSpell->QueryIntAttribute("AnimNum", &SpellInfo[id].iAnimNum); + SpellInfo[id].pSpellInfo = CMyTools::ToWstring(pSpell->Attribute("SpellInfo")); + _int lock = 0, equip = 0, use = 0; + pSpell->QueryIntAttribute("Spell_Lock", &lock); + pSpell->QueryIntAttribute("Equip_Spell", &equip); + pSpell->QueryIntAttribute("Use_Skill", &use); + SpellInfo[id].bSpell_Lock = lock != 0; + SpellInfo[id].bEquip_Spell = equip != 0; + SpellInfo[id].bUse_Skill = use != 0; + pSpell->QueryFloatAttribute("Preview", &SpellInfo[id].fPreview); + pSpell->QueryFloatAttribute("Vidio", &SpellInfo[id].fVidio); + + m_iSpell_Count++; + m_iSpell_CoolTime[id] = 1.2f; + } + + // 항상 다음 Spell로 이동 + pSpell = pSpell->NextSiblingElement("Spell"); + } + + return S_OK; +} + +void CSkill_Data::NoCool(_bool bNoCool) +{ + m_bNoCool = bNoCool; +} + +CSkill_Data* CSkill_Data::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) +{ + CSkill_Data* pInstance = new CSkill_Data(); + + if (FAILED(pInstance->Initialize(pDevice, pContext))) + { + MSG_BOX("Failed to Created : CSkill_Data"); + SAFE_RELEASE(pInstance); + } + + return pInstance; +} + +void CSkill_Data::Free() +{ + __super::Free(); +} + diff --git a/Jusin154_Team3D/Editor/Private/State_Blink.cpp b/Jusin154_Team3D/Editor/Private/State_Blink.cpp new file mode 100644 index 000000000..a0e5e4522 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/State_Blink.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_Blink.h" +#include "Unit.h" + + +CState_Blink::CState_Blink() + :CState_Root() +{ +} + +void CState_Blink::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Blink::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_Blink::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Blink::Initialize(STATE_BLINK_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_Blink* CState_Blink::Create(STATE_BLINK_DESC* pDesc) +{ + CState_Blink* pInstance = new CState_Blink; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Blink::Free() +{ + __super::Free(); +} + +void CState_Blink::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/State_Dead.cpp b/Jusin154_Team3D/Editor/Private/State_Dead.cpp new file mode 100644 index 000000000..ef3f575f7 --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/State_Dead.cpp @@ -0,0 +1,67 @@ +#include "pch.h" +#include "State_Dead.h" +#include "Unit.h" + + +CState_Dead::CState_Dead() + :CState_Root() +{ +} + +void CState_Dead::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Dead::Update(_float fTimeDelta) +{ + HRESULT hr = (__super::Update(fTimeDelta)); + switch (hr) + { + case E_PENDING: + m_vDeadTimer.x += fTimeDelta; + break; + default: + break; + } + m_funcLateUpdate(m_vDeadTimer.x / m_vDeadTimer.y); + if (m_vDeadTimer.x >= m_vDeadTimer.y) { + return E_FAIL; + } + return S_OK; +} + +void CState_Dead::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Dead::Initialize(STATE_DEAD_DESC* pDesc) +{ + if (FAILED(__super::Initialize(pDesc))) { + return E_FAIL; + } + m_pModel = m_pOwner->Get_Component(); + m_pFSM = m_pOwner->Get_Component(); + m_vDeadTimer = pDesc->vDeadTimer; + m_funcLateUpdate = pDesc->funcLateUpdate; + return S_OK; +} + +CState_Dead* CState_Dead::Create(STATE_DEAD_DESC* pDesc) +{ + CState_Dead* pInstance = new CState_Dead; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Dead::Free() +{ + __super::Free(); +} + +void CState_Dead::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/State_Shuffle.cpp b/Jusin154_Team3D/Editor/Private/State_Shuffle.cpp new file mode 100644 index 000000000..d569201bd --- /dev/null +++ b/Jusin154_Team3D/Editor/Private/State_Shuffle.cpp @@ -0,0 +1,64 @@ +#include "pch.h" +#include "State_Shuffle.h" +#include "GameInstance.h" +#include "Unit.h" + +CState_Shuffle::CState_Shuffle() + :CState_Root() +{ +} + +void CState_Shuffle::Enter() +{ + __super::Enter(); +} + +HRESULT CState_Shuffle::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_Shuffle::Exit() +{ + __super::Exit(); +} + +HRESULT CState_Shuffle::Initialize(STATE_SHUFFLE_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_Shuffle* CState_Shuffle::Create(STATE_SHUFFLE_DESC* pDesc) +{ + CState_Shuffle* pInstance = new CState_Shuffle; + if (FAILED(pInstance->Initialize(pDesc))) { + SAFE_RELEASE(pInstance); + } + return pInstance; +} + +void CState_Shuffle::Free() +{ + __super::Free(); +} + +void CState_Shuffle::Describe_Entity() +{ +} diff --git a/Jusin154_Team3D/Editor/Private/TrailObject.cpp b/Jusin154_Team3D/Editor/Private/TrailObject.cpp index ece375502..2b8fcf7b7 100644 --- a/Jusin154_Team3D/Editor/Private/TrailObject.cpp +++ b/Jusin154_Team3D/Editor/Private/TrailObject.cpp @@ -109,6 +109,9 @@ void CTrailObject::Set_Target(CTransform* pTargetTransform) void CTrailObject::Trail_Update(_fmatrix WorldMat, _float fTimeDelta) { + if (m_bVisible == false) + return; + m_pTrailCom->Trail_Update(fTimeDelta, WorldMat); } diff --git a/Jusin154_Team3D/Editor/Private/Troll.cpp b/Jusin154_Team3D/Editor/Private/Troll.cpp index 34ad753b6..bd86d3a2f 100644 --- a/Jusin154_Team3D/Editor/Private/Troll.cpp +++ b/Jusin154_Team3D/Editor/Private/Troll.cpp @@ -70,6 +70,7 @@ HRESULT CTroll::Initialize(void* pArg) m_pLeftHand_BoneMat = m_pModelCom->Get_BoneMatrixPtr("LeftHand"); m_pRightHand_BoneMat = m_pModelCom->Get_BoneMatrixPtr("RightHand"); + m_pWeapon_BoneMat = Get_PartObject()->Get_Component()->Get_BoneMatrixPtr("Bone"); return S_OK; } @@ -122,18 +123,24 @@ void CTroll::Update(_float fTimeDelta) _matrix LeftHandMatrix = {}; _matrix RightHandMatrix = {}; + _matrix WeaponMatrix = {}; LeftHandMatrix = XMLoadFloat4x4(m_pLeftHand_BoneMat); RightHandMatrix = XMLoadFloat4x4(m_pRightHand_BoneMat); + WeaponMatrix = XMLoadFloat4x4(m_pWeapon_BoneMat); + for (int i = 0; i < 3; ++i) { LeftHandMatrix.r[i] = XMVector3Normalize(LeftHandMatrix.r[i]); RightHandMatrix.r[i] = XMVector3Normalize(RightHandMatrix.r[i]); + WeaponMatrix.r[i] = XMVector3Normalize(WeaponMatrix.r[i]); } + _matrix WeaponSoket = WeaponMatrix * Get_PartObject()->Get_Component()->Get_XMWorldMatrix(); m_pLeftTrail->Trail_Update(LeftHandMatrix * WorldMat, fTimeDelta); m_pRightTrail->Trail_Update(RightHandMatrix * WorldMat, fTimeDelta); + m_pWeaponTrail->Trail_Update(WeaponSoket, fTimeDelta); #pragma endregion @@ -389,13 +396,23 @@ HRESULT CTroll::Ready_Parts() ; m_pLeftTrail->Load_Trail("../Bin/Resources/Data/Effect/Troll/TrollSide/Troll_Trail", static_cast(NEXT_LEVEL)); + m_pLeftTrail->Set_Visible(false); if (FAILED(Add_PartObject("Right_Trail", NEXT_LEVEL, &m_pRightTrail, &PartsDesc))) { return E_FAIL; } m_pRightTrail->Load_Trail("../Bin/Resources/Data/Effect/Troll/TrollSide/Troll_Trail", static_cast(NEXT_LEVEL)); + m_pRightTrail->Set_Visible(false); + if (FAILED(Add_PartObject("Weapon_Trail", NEXT_LEVEL, &m_pWeaponTrail, &PartsDesc))) { + return E_FAIL; + } + + m_pWeaponTrail->Load_Trail("../Bin/Resources/Data/Effect/Troll/TrollSide/Troll_Swing_Trail", static_cast(NEXT_LEVEL)); + m_pWeaponTrail->Set_Visible(false); + + #pragma endregion return S_OK; } @@ -418,6 +435,12 @@ HRESULT CTroll::Bind_ShaderResources() return S_OK; } +void CTroll::Troll_Trail_Visible(_bool isTrailVisible) +{ + m_pLeftTrail->Set_Visible(isTrailVisible); + m_pRightTrail->Set_Visible(isTrailVisible); +} + CTroll* CTroll::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CTroll* pInstance = new CTroll(pDevice, pContext); @@ -465,12 +488,22 @@ void CTroll::Free() SAFE_RELEASE(m_pEffectPool); SAFE_RELEASE(m_pLeftTrail); SAFE_RELEASE(m_pRightTrail); + SAFE_RELEASE(m_pWeaponTrail); } #ifdef _DEBUG void CTroll::Describe_Entity() { __super::Describe_Entity(); + + _float4x4 socketMat = *m_pModelCom->Get_BoneMatrixPtr("HeadEnd"); + + _string strSocket = "Socket " + to_string(socketMat._41) + to_string(socketMat._42) + to_string(socketMat._43); + + GUI::Text(strSocket.c_str()); + + + m_pTransformCom->Describe_Entity(); } #endif // _DEBUG diff --git a/Jusin154_Team3D/Editor/Private/Troll_States.cpp b/Jusin154_Team3D/Editor/Private/Troll_States.cpp index da5d6af2a..44d802525 100644 --- a/Jusin154_Team3D/Editor/Private/Troll_States.cpp +++ b/Jusin154_Team3D/Editor/Private/Troll_States.cpp @@ -5,6 +5,7 @@ #include "Player.h" #include "Troll_Rock.h" #include "EffectPool.h" +#include "TrailObject.h" #pragma region STATE #include "State_Idle.h" @@ -356,8 +357,14 @@ HRESULT CTroll::Behavior_ThrowExitCheck(_float fTimeDelta) [this]() {Get_PartObject()->Set_Attach(false); }, 0.25f); + Add_Event(pairAnimInfo.first, + [this]() {Troll_Trail_Visible(false);}, + 0.6f); + Add_Event(pairAnimInfo.first, [this]() { + Troll_Trail_Visible(true); + _matrix HandMat = XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("SKT_LeftHand")) * m_pTransformCom->Get_XMWorldMatrix(); _float4 vPosition = {}; @@ -397,6 +404,17 @@ void CTroll::Behavior_SwingEnter() Add_Event(pairAnimInfo.first, [this]() {m_bLookAt = false; }, 0.2f); + + + Troll_Trail_Visible(true); + m_pWeaponTrail->Set_Visible(true); + + Add_Event(pairAnimInfo.first, + [this]() { + Troll_Trail_Visible(false); + m_pWeaponTrail->Set_Visible(false); + }, + 0.6f); } HRESULT CTroll::Behavior_SwingExitCheck(_float fTimeDelta) @@ -430,6 +448,18 @@ void CTroll::Behavior_SlamEnter() m_fSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)] = m_fMaxSkillCoolTime[ENUM_CLASS(TROLL_SKILL::SLAM)]; + + Troll_Trail_Visible(true); + m_pWeaponTrail->Set_Visible(true); + + Add_Event(pairAnimInfo.first, + [this]() { + Troll_Trail_Visible(false); + m_pWeaponTrail->Set_Visible(false); + }, + 0.7f); + + Add_Event(m_Animation[STATEANIM::SLAM].first, [this]() { m_bLookAt = false; }, 0.2f); @@ -437,6 +467,7 @@ void CTroll::Behavior_SlamEnter() Add_Event(m_Animation[STATEANIM::SLAM].first, [this]() { m_pEffectPool->Use_Skill(SKILL_TYPE::TROLL_ATTACK, this); } , 0.3f); + } HRESULT CTroll::Behavior_SlamExitCheck(_float fTimeDelta) @@ -469,6 +500,16 @@ void CTroll::Behavior_BackHandSwingEnter() Add_Event(m_Animation[STATEANIM::BACKHAND_SWING_JOG].first, [this]() { m_bLookAt = false; }, 0.2f); + + Troll_Trail_Visible(true); + m_pWeaponTrail->Set_Visible(true); + + Add_Event(pairAnimInfo.first, + [this]() { + Troll_Trail_Visible(false); + m_pWeaponTrail->Set_Visible(false); + }, + 0.9f); } HRESULT CTroll::Behavior_BackHandSwingExitCheck(_float fTimeDelta) diff --git a/Jusin154_Team3D/Editor/Private/Troll_Weapon.cpp b/Jusin154_Team3D/Editor/Private/Troll_Weapon.cpp index 3fb7c3958..30dc35588 100644 --- a/Jusin154_Team3D/Editor/Private/Troll_Weapon.cpp +++ b/Jusin154_Team3D/Editor/Private/Troll_Weapon.cpp @@ -40,6 +40,7 @@ HRESULT CTroll_Weapon::Initialize(void* pArg) void CTroll_Weapon::Priority_Update(_float fTimeDelta) { m_pModelCom->Combined_BoneMatrix(); + _matrix socketMatrix = {}; socketMatrix = XMLoadFloat4x4(m_pSocketMatrices); diff --git a/Jusin154_Team3D/Editor/Public/Editor_Define.h b/Jusin154_Team3D/Editor/Public/Editor_Define.h index e21106f48..374a99796 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Define.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Define.h @@ -18,7 +18,7 @@ namespace Editor enum class MAPOBJECT_TYPE { CONTAINER, ELEMENT_STATIC, ELEMENT_INTERACT, ELEMENT_LIGHT }; enum class MAPOBJECT_RENDER_TYPE { NORMAL, DECAL, GLASS }; - enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, HAIR, EYELASH, OUTLINE_WRITE, OUTLINE_READ, END }; + enum class SHADER_PASS_ANIM { DEFAULT, SHADOW, CAPTURE, BLUR, HAIR, EYELASH, OUTLINE_WRITE, OUTLINE_READ, SPECTOR, END }; enum class SHADER_PASS_MESH { DEFAULT, SHADOW, SKYBOX, ALPHABLEND, EFFECT_ALPHABLEND, EFFECT_BLEND, EFFECT_ALPHABLEND_CULL, EFFECT_BLEND_CULL, CAPTURE, BLUR, EFFECT_ALPHABLEND_UVMOVE, MAPTOOL, GLASS, OUTLINE_WRITE, OUTLINE_READ, BLOOM, LAKE, END }; enum class SHADER_PASS_NORTEX { DEFAULT, TERRAIN, ENV_TERRAIN_ANISO, SHADOW, END }; enum class SHADER_PASS_PARTICLE { EXPLOSION, END }; diff --git a/Jusin154_Team3D/Editor/Public/Editor_Struct.h b/Jusin154_Team3D/Editor/Public/Editor_Struct.h index a852a7670..5631ed104 100644 --- a/Jusin154_Team3D/Editor/Public/Editor_Struct.h +++ b/Jusin154_Team3D/Editor/Public/Editor_Struct.h @@ -40,5 +40,23 @@ typedef struct tagFolderLoad { vector LoadedRigidBody; }FOLDER_LOAD; - +typedef struct tagSpellInfo +{ + _int iSpell_ID{}; + _wstring pSpell_Name; + _wstring pImage_Name; + _int iSpell_Type{}; + _wstring pType_Name; + _int iSkill_Type{}; + _float fSpell_Damage{}; + _float fSpell_CoolTime{}; + _float fDuration{}; + _int iAnimNum{}; + _wstring pSpellInfo; + _bool bSpell_Lock = false; + _bool bEquip_Spell = false; + _bool bUse_Skill = false; + _float fPreview{}; + _float fVidio{}; +}SPELL_INFO; NS_END diff --git a/Jusin154_Team3D/Editor/Public/Goblin.h b/Jusin154_Team3D/Editor/Public/Goblin.h index 82b101400..a2a62ce75 100644 --- a/Jusin154_Team3D/Editor/Public/Goblin.h +++ b/Jusin154_Team3D/Editor/Public/Goblin.h @@ -9,18 +9,28 @@ NS_BEGIN(Editor) class CGoblin final : public CMonster { + enum class GOBLIN_SKILL + { + SWING, + THROW, + TP, + END + }; private: CGoblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CGoblin(const CGoblin& Prototype); virtual ~CGoblin() = 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; + virtual HRESULT Render_Shadow() 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; + _bool Get_Swing() { return m_bSwing; } private: CCallBack_Monster_Behavior* m_pCallBack_Behavior = { nullptr }; @@ -28,39 +38,82 @@ class CGoblin final : public CMonster CCharacter_Controller* m_pCharacter_Controller = { nullptr }; CRigidBody_Dynamic* m_pRigidBody = { nullptr }; + _float2 m_vStunTimer = { 0.f, 4.f }; + _uint iIndex; - class CEditEffect* m_pRight_Smoke = { nullptr }; - class CEditEffect* m_pLeft_Smoke = { nullptr }; - class CEditEffect* m_pTroll_Particle = { nullptr }; - class CEditEffect* m_pTroll_Particle2 = { nullptr }; + + class CEditEffect* m_pSmoke = { nullptr }; + class CEditEffect* m_pGoblin_Particle = { nullptr }; + class CEditEffect* m_pGoblin_Particle2 = { nullptr }; private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; HRESULT Ready_Components(); - HRESULT Bind_ShaderResources(); HRESULT Ready_Parts(); + HRESULT Bind_ShaderResources(); + public: static CGoblin* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; virtual void Free() override; +#ifdef _DEBUG virtual void Describe_Entity() override; +#endif // _DEBUG + private: virtual void Add_FSM(); virtual void Set_Anim(); + _float m_fSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::END)] = {}; + _float m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_SKILL::END)] = { 6.f,2.f,15.f }; + + _bool m_bStep = { false }; + _float m_fTpTime = {}; + _float m_fAirTime = {}; + _vector m_vOriginPos = {}; + _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(); - HRESULT Behavior_CombatExitCheck(); + HRESULT Behavior_CombatExitCheck(_float fTimeDelta); void Behavior_CombatExit(); + + void Behavior_SwingEnter(); + HRESULT Behavior_SwingExitCheck(_float fTimeDelta); + void Behavior_SwingExit(); + + void Behavior_ThrowEnter(); + HRESULT Behavior_ThrowExitCheck(_float fTimeDelta); + void Behavior_ThrowExit(); + + void Behavior_BlinkEnter(); + HRESULT Behavior_BlinkExitCheck(_float fTimeDelta); + void Behavior_BlinkExit(); + + void Behavior_ShuffleEnter(); + HRESULT Behavior_ShuffleExitCheck(_float fTimeDelta); + void Behavior_ShuffleExit(); + + void Behavior_HitEnter(); + HRESULT Behavior_HitExitCheck(_float fTimeDelta); + void Behavior_HitExit(); + + void Behavior_DeadEnter(); + HRESULT Behavior_DeadExitCheck(_float fTimeDelta); + void Behavior_DeadExit(); }; NS_END diff --git a/Jusin154_Team3D/Editor/Public/Goblin_BattleAxe.h b/Jusin154_Team3D/Editor/Public/Goblin_BattleAxe.h new file mode 100644 index 000000000..d1c66d755 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Goblin_BattleAxe.h @@ -0,0 +1,48 @@ +#pragma once + +#include "Editor_Define.h" +#include "PartObject.h" + +NS_BEGIN(Editor) + +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/Editor/Public/Goblin_Dagger.h b/Jusin154_Team3D/Editor/Public/Goblin_Dagger.h new file mode 100644 index 000000000..9200d6cc1 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Goblin_Dagger.h @@ -0,0 +1,50 @@ +#pragma once + +#include "Editor_Define.h" +#include "PartObject.h" + +NS_BEGIN(Editor) + +class CGoblin_Dagger final : public CPartObject +{ +public: + typedef struct tagDagger : public CPartObject::PARTOBJECT_DESC + { + const _float4x4* pSocketMatrices = { }; + }GOBLINDAGGER_DESC; +private: + CGoblin_Dagger(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + CGoblin_Dagger(const CGoblin_Dagger& Prototype); + virtual ~CGoblin_Dagger() = 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; + void Set_Attach(_bool Attach) { m_bAttach = Attach; } +public: + +private: + const _float4x4* m_pSocketMatrices = { }; + CShader* m_pShaderCom = { nullptr }; + CModel* m_pModelCom = { nullptr }; + _bool m_bAttach = { true }; + +private: + HRESULT Ready_Components(); + HRESULT Bind_ShaderResources(); + +public: + static CGoblin_Dagger* 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/Editor/Public/Goblin_Spector.h b/Jusin154_Team3D/Editor/Public/Goblin_Spector.h new file mode 100644 index 000000000..9a9d4ee80 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Goblin_Spector.h @@ -0,0 +1,74 @@ +#pragma once + +#include "Editor_Define.h" +#include "Monster.h" +#include "CallBack_Monster_Behavior.h" +#include "CallBack_Monster_HitReport.h" + +NS_BEGIN(Engine) +class CTransform; +NS_END + +NS_BEGIN(Editor) + +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); + virtual ~CGoblin_Spector() = default; + +public: + virtual void Priority_Update(_float fTimeDelta) override; + virtual void Update(_float fTimeDelta) override; + virtual void Late_Update(_float fTimeDelta) override; + virtual HRESULT Render() override; + virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr)override; + virtual void OnHit(CGameObject* pOther, CGameObject* pCaller = nullptr)override; + + +private: + 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 CEditEffect* m_pSmoke = { nullptr }; + class CEditEffect* m_pGoblin_Particle = { nullptr }; + class CEditEffect* m_pGoblin_Particle2 = { nullptr }; + +private: + virtual HRESULT Initialize_Prototype() override; + virtual HRESULT Initialize(void* pArg) override; + HRESULT Ready_Components(); + HRESULT Ready_Parts(); + HRESULT Bind_ShaderResources(); + +public: + static CGoblin_Spector* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; + virtual void Free() override; +#ifdef _DEBUG + virtual void Describe_Entity() override; + +#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/Editor/Public/InfoInstance.h b/Jusin154_Team3D/Editor/Public/InfoInstance.h index 3c24a8b6a..70d36c189 100644 --- a/Jusin154_Team3D/Editor/Public/InfoInstance.h +++ b/Jusin154_Team3D/Editor/Public/InfoInstance.h @@ -39,22 +39,25 @@ class CInfoInstance final : public CBase pair Get_NearestPlayerAlly(_fvector vPos); #pragma endregion #pragma region MAP_INFO - //HRESULT Load_MapObjects(const _char* pFilePath); - //HRESULT Load_LightElements(const _char* pFilePath); #pragma endregion #pragma region Spell_INFO HRESULT Load_SpellInfo(const _char* pFilePath); + SPELL_INFO Get_Spell_Info(_int Spell_Info); + _int Update_Spell(_int SpellIndex); + _float Get_CoolTime(_int SpellID); + void Change_Canvas(); + #pragma endregion - - private: - CGameInstance* m_pGameInstance = { nullptr }; - ID3D11Device* m_pDevice = { nullptr }; - ID3D11DeviceContext* m_pContext = { nullptr }; + CGameInstance* m_pGameInstance = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; + ID3D11DeviceContext* m_pContext = { nullptr }; - class CPlayerInfo* m_pPlayerInfo = { nullptr }; - class CMonsterInfo* m_pMonsterInfo = { nullptr }; - class CMapInfo* m_pMapInfo = { nullptr }; + class CPlayerInfo* m_pPlayerInfo = { nullptr }; + class CMonsterInfo* m_pMonsterInfo = { nullptr }; + class CMapInfo* m_pMapInfo = { nullptr }; + class CSkill_Data* m_pSkillInfo = { nullptr }; + _int m_eSpell = ENUM_CLASS(SKILL_TYPE::END); #ifdef _DEBUG _string m_strLog = {}; diff --git a/Jusin154_Team3D/Editor/Public/Levioso.h b/Jusin154_Team3D/Editor/Public/Levioso.h index 6577efc8b..8f841cc38 100644 --- a/Jusin154_Team3D/Editor/Public/Levioso.h +++ b/Jusin154_Team3D/Editor/Public/Levioso.h @@ -23,6 +23,8 @@ class CLevioso final : public CEffect_Container public: virtual HRESULT Pre_Setting(CGameObject* pObject, void* pArg = nullptr) override; +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; private: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; @@ -42,6 +44,11 @@ class CLevioso final : public CEffect_Container _float m_fAccRotateTime = {}; _float m_fTurnSpeed = {}; _float m_fRange = {}; + + _float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f }; // 현재 발사 된 위치 + _float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f }; // 현재 타게팅 된 위치 + _float m_fLinearSpeed = 0.25f; + _float3 m_vCameraLook = {}; public: static CLevioso* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual void Free() override; diff --git a/Jusin154_Team3D/Editor/Public/Monster.h b/Jusin154_Team3D/Editor/Public/Monster.h index bb03f7c3a..120de267e 100644 --- a/Jusin154_Team3D/Editor/Public/Monster.h +++ b/Jusin154_Team3D/Editor/Public/Monster.h @@ -31,7 +31,7 @@ class CMonster abstract : public CUnit _float m_fTargetDistance = { FLT_MAX }; _bool m_bDrawOutLine = { false }; _bool m_bLookAt = { true }; - + _float m_fDeadRatio = { 0.f }; protected: virtual HRESULT Initialize_Prototype() override; virtual HRESULT Initialize(void* pArg) override; diff --git a/Jusin154_Team3D/Editor/Public/Skill_Data.h b/Jusin154_Team3D/Editor/Public/Skill_Data.h new file mode 100644 index 000000000..d4bd1e0d8 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/Skill_Data.h @@ -0,0 +1,53 @@ +#pragma once + +#include "Editor_Define.h" +#include "Base.h" + +NS_BEGIN(Engine) +class CGameInstance; +class CUIObject; +NS_END + +NS_BEGIN(Editor) + +class CSkill_Data final : public CBase +{ +public: + +private: + CSkill_Data(); + ~CSkill_Data() = default; + +public: + void Update(_float fTimeDelta); + void Change_Level(); + _float Get_CoolTime(_int SpellID); + +public: + HRESULT Load_SpellInfo(const _char* pFilePath); + + void NoCool(_bool bNoCool); + +public: + const SPELL_INFO& Get_Info(_uint SpellID) const; + _int Update_Spell(_int SpellID); + +private: + class CInfoInstance* m_pInfoInstance = { nullptr }; + + _int m_iSpell_Count{}; + SPELL_INFO SpellInfo[34] = {}; + _float m_iSpell_CoolTime[34] = {}; + + _bool m_bNoCool = { false }; + +private: + HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); + + +public: + static CSkill_Data* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); + virtual void Free() override; +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/State_Blink.h b/Jusin154_Team3D/Editor/Public/State_Blink.h new file mode 100644 index 000000000..0abc313ba --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/State_Blink.h @@ -0,0 +1,36 @@ +#pragma once +#include "Editor_Define.h" +#include "State_Root.h" + +NS_BEGIN(Editor) + +class CState_Blink final : public CState_Root +{ +public: + typedef struct tagBlink : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_BLINK_DESC; +private: + CState_Blink(); + virtual ~CState_Blink() = 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_BLINK_DESC* pDesc); + +public: + static CState_Blink* Create(STATE_BLINK_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/State_Dead.h b/Jusin154_Team3D/Editor/Public/State_Dead.h new file mode 100644 index 000000000..9a05ac180 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/State_Dead.h @@ -0,0 +1,33 @@ +#pragma once +#include "Editor_Define.h" +#include "State_Root.h" + +NS_BEGIN(Editor) + +class CState_Dead final : public CState_Root +{ +public: + typedef struct tagLand : public CState_Root::STATE_ROOT_DESC { + _float2 vDeadTimer = { 0.f, 2.f }; + function funcLateUpdate = { nullptr }; + }STATE_DEAD_DESC; +private: + CState_Dead(); + virtual ~CState_Dead() = default; + +public: + virtual void Enter(); + virtual HRESULT Update(_float fTimeDelta); + virtual void Exit(); + +private: + HRESULT Initialize(STATE_DEAD_DESC* pDesc); + _float2 m_vDeadTimer = { 0.f, 2.f }; + function m_funcLateUpdate = { nullptr }; +public: + static CState_Dead* Create(STATE_DEAD_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/State_Shuffle.h b/Jusin154_Team3D/Editor/Public/State_Shuffle.h new file mode 100644 index 000000000..fa0ef12e4 --- /dev/null +++ b/Jusin154_Team3D/Editor/Public/State_Shuffle.h @@ -0,0 +1,36 @@ +#pragma once +#include "Editor_Define.h" +#include "State_Root.h" + +NS_BEGIN(Editor) + +class CState_Shuffle final : public CState_Root +{ +public: + typedef struct tagShuffle : public CState_Root::STATE_ROOT_DESC { + function funcPriorityUpdate = { nullptr }; + function funcLateUpdate = { nullptr }; + }STATE_SHUFFLE_DESC; +public: + CState_Shuffle(); + virtual ~CState_Shuffle() = 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_SHUFFLE_DESC* pDesc); + +public: + static CState_Shuffle* Create(STATE_SHUFFLE_DESC* pDesc); + virtual void Free() override; + virtual void Describe_Entity(); +}; + +NS_END diff --git a/Jusin154_Team3D/Editor/Public/Troll.h b/Jusin154_Team3D/Editor/Public/Troll.h index 0796a7e4b..ceaa47aa8 100644 --- a/Jusin154_Team3D/Editor/Public/Troll.h +++ b/Jusin154_Team3D/Editor/Public/Troll.h @@ -48,11 +48,13 @@ class CTroll final : public CMonster class CEditEffect* m_pTroll_Particle = { nullptr }; class CEditEffect* m_pTroll_Particle2 = { nullptr }; - class CTrailObject* m_pLeftTrail = {}; - class CTrailObject* m_pRightTrail = {}; + class CTrailObject* m_pLeftTrail = { nullptr }; + class CTrailObject* m_pRightTrail = { nullptr }; + class CTrailObject* m_pWeaponTrail = { nullptr }; const _float4x4* m_pLeftHand_BoneMat = { nullptr }; const _float4x4* m_pRightHand_BoneMat = { nullptr }; + const _float4x4* m_pWeapon_BoneMat = { nullptr }; private: virtual HRESULT Initialize_Prototype() override; @@ -61,6 +63,9 @@ class CTroll final : public CMonster HRESULT Ready_Parts(); HRESULT Bind_ShaderResources(); +private: + void Troll_Trail_Visible(_bool isTrailVisible); + public: static CTroll* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override; diff --git a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl index bd75f7635..e141e7c12 100644 --- a/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl +++ b/Jusin154_Team3D/Engine/Bin/Resources/ShaderFiles/Shader_Particle_Compute.hlsl @@ -105,7 +105,6 @@ void CS_MAIN( Particle particle = g_ParticleBufferInput[iIndex]; - ParticleValue particleValue = g_ParticleValueBufferInput[iIndex]; @@ -190,7 +189,7 @@ void CS_MAIN( particle.vTranslation.y -= 0.5f * particle.vLifeTime.x * fGravity; fOnlyDropY = particle.vTranslation.y; } - + if (isMoveForward) { @@ -304,7 +303,7 @@ void CS_MAIN( float fOldViewZ = vDepthDesc.y * fFar; - if (vProjPos.w >= fOldViewZ && particle.vLifeTime.x >= 0.2f) + if (vProjPos.w >= fOldViewZ && particle.vLifeTime.x >= 0.3f) { if (particleValue.isCompareStop == false) { diff --git a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp index c30a60077..62deb845e 100644 --- a/Jusin154_Team3D/Engine/Private/ComputeShader.cpp +++ b/Jusin154_Team3D/Engine/Private/ComputeShader.cpp @@ -45,12 +45,7 @@ vector CComputeShader::Dispatch(_uint iSRVIndex, _uint for (_uint i = 0; i < m_iNumInputBuffer; i++) { - D3D11_MAPPED_SUBRESOURCE PreSubResource = {}; - - m_pContext->CopyResource(m_pInputStagingBuffer[i], ppBuffers[i]); - - m_pContext->CopyResource(m_pInputBuffer[i], m_pInputStagingBuffer[i]); - + m_pContext->CopyResource(m_pInputBuffer[i], ppBuffers[i]); } @@ -76,18 +71,7 @@ vector CComputeShader::Dispatch(_uint iSRVIndex, _uint for (_uint i = 0; i < m_iNumOutputBuffer; i++) { - m_pContext->CopyResource(m_pOutputStagingBuffer[i], m_pOutputBuffer[i]); - - //스테이징 버퍼를 열어서 카피함 - D3D11_MAPPED_SUBRESOURCE StagingSubResource = {}; - - if (SUCCEEDED(m_pContext->Map(m_pOutputStagingBuffer[i], 0, D3D11_MAP_READ, 0, &StagingSubResource))) - { - StagingSubResources.push_back(StagingSubResource); - - m_pContext->Unmap(m_pOutputStagingBuffer[i], 0); - } - + m_pContext->CopyResource(ppBuffers[i], m_pOutputBuffer[i]); } Reset(); @@ -128,32 +112,6 @@ ID3D11UnorderedAccessView* CComputeShader::GetOutputUAV(_uint iIndex) const return m_pOutputUAV[iIndex]; } -vector CComputeShader::ReadBackOutputs() -{ - std::vector StagingSubResources; - StagingSubResources.reserve(m_iNumOutputBuffer); - - for (_uint i = 0; i < m_iNumOutputBuffer; ++i) - { - if (m_pOutputStagingBuffer[i] == nullptr || m_pOutputBuffer[i] == nullptr) - continue; - - m_pContext->CopyResource(m_pOutputStagingBuffer[i], m_pOutputBuffer[i]); - - D3D11_MAPPED_SUBRESOURCE mapped = {}; - if (SUCCEEDED(m_pContext->Map(m_pOutputStagingBuffer[i], 0, - D3D11_MAP_READ, 0, &mapped))) - { - StagingSubResources.push_back(mapped); - - m_pContext->Unmap(m_pOutputStagingBuffer[i], 0); - } - } - - return StagingSubResources; - -} - void CComputeShader::Reset() @@ -200,22 +158,6 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iInputStructStride return E_FAIL; m_pInputBuffer.push_back(pInputBuffer); - - //스테이징 버퍼 이름 - D3D11_BUFFER_DESC StagingBufferDesc = {}; - StagingBufferDesc.Usage = D3D11_USAGE_STAGING; // 스테이징 버퍼 - StagingBufferDesc.ByteWidth = iInputStructStride[i] * iNumElement; - StagingBufferDesc.StructureByteStride = iInputStructStride[i]; - StagingBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; - - ID3D11Buffer* pStagingBuffer = nullptr; - - if (FAILED(m_pDevice->CreateBuffer(&StagingBufferDesc, nullptr, &pStagingBuffer))) - return E_FAIL; - - m_pInputStagingBuffer.push_back(pStagingBuffer); - - } for (_uint i = 0; i < m_iNumOutputBuffer; i++) @@ -239,20 +181,6 @@ HRESULT CComputeShader::CreateBuffer(_uint iNumElement, _uint iInputStructStride return E_FAIL; m_pOutputBuffer.push_back(pOutputBuffer); - - //아웃풋 스테이징 버퍼 - D3D11_BUFFER_DESC OutPutStagingBufferDesc = {}; - OutPutStagingBufferDesc.Usage = D3D11_USAGE_STAGING; // 스테이징 버퍼 - OutPutStagingBufferDesc.ByteWidth = iOuputStructStride[i] * iNumElement; - OutPutStagingBufferDesc.StructureByteStride = iOuputStructStride[i]; - OutPutStagingBufferDesc.CPUAccessFlags = D3D11_CPU_ACCESS_READ | D3D11_CPU_ACCESS_WRITE; - - ID3D11Buffer* pOutputStagingBuffer = nullptr; - - if (FAILED(m_pDevice->CreateBuffer(&OutPutStagingBufferDesc, nullptr, &pOutputStagingBuffer))) - return E_FAIL; - - m_pOutputStagingBuffer.push_back(pOutputStagingBuffer); } return S_OK; @@ -376,7 +304,6 @@ void CComputeShader::Free() { SAFE_RELEASE(m_pInputSRV[i]); SAFE_RELEASE(m_pInputBuffer[i]); - SAFE_RELEASE(m_pInputStagingBuffer[i]); } for (_uint i = 0; i < m_iNumOutputBuffer; i++) @@ -384,7 +311,6 @@ void CComputeShader::Free() SAFE_RELEASE(m_pOutputUAV[i]); SAFE_RELEASE(m_pOutputBuffer[i]); SAFE_RELEASE(m_pOutputSRV[i]); - SAFE_RELEASE(m_pOutputStagingBuffer[i]); } diff --git a/Jusin154_Team3D/Engine/Private/GameInstance.cpp b/Jusin154_Team3D/Engine/Private/GameInstance.cpp index d5450951b..48885d7f2 100644 --- a/Jusin154_Team3D/Engine/Private/GameInstance.cpp +++ b/Jusin154_Team3D/Engine/Private/GameInstance.cpp @@ -320,6 +320,9 @@ void CGameInstance::Compute_FrameCount() m_fTimer_LateUpdate = Get_TimeDelta(TEXT("Timer_LateUpdate")); m_fTimer_DrawCall = Get_TimeDelta(TEXT("Timer_DrawCall")); m_fTimer_Present = Get_TimeDelta(TEXT("Timer_Present")); + m_fTimer_Picking = Get_TimeDelta(TEXT("Timer_Picking")); + m_fTimer_PhysX = Get_TimeDelta(TEXT("Timer_PhysX")); + m_fTimer_Level = Get_TimeDelta(TEXT("Timer_Level")); m_fTimer_FrameCount = Get_TimeDelta(TEXT("Timer_FrameCount")); #endif // _DEBUG } @@ -331,7 +334,10 @@ void CGameInstance::Present_TimeCost() const + m_fTimer_Update + m_fTimer_LateUpdate + m_fTimer_DrawCall - + m_fTimer_Present; + + m_fTimer_Present + + m_fTimer_Picking + + m_fTimer_PhysX + + m_fTimer_Level; GUI::PushItemWidth(80); GUI::Begin("Previous_Frame_Timer"); @@ -352,6 +358,21 @@ void CGameInstance::Present_TimeCost() const GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); GUI::Text("Late_Update %d", int(m_fTimer_LateUpdate / fTotal * 100.f)); } + { + GUI::ProgressBar(m_fTimer_Picking / fTotal, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Picking %d", int(m_fTimer_Picking / fTotal * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_PhysX / fTotal, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("PhysX %d", int(m_fTimer_PhysX / fTotal * 100.f)); + } + { + GUI::ProgressBar(m_fTimer_Level / fTotal, ImVec2(200.f, 0.f)); + GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); + GUI::Text("Level %d", int(m_fTimer_Level / fTotal * 100.f)); + } { GUI::ProgressBar(m_fTimer_DrawCall / fTotal, ImVec2(200.f, 0.f)); GUI::SameLine(0.f, GUI::GetStyle().ItemInnerSpacing.x); diff --git a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp index 9103dc341..1c4732041 100644 --- a/Jusin154_Team3D/Engine/Private/Instance_Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Instance_Model.cpp @@ -63,7 +63,7 @@ HRESULT CInstance_Model::Initialize_Prototype(const _char* pModelFilePath, MODEL return E_FAIL; } - SaveAssimpModel(Temp , m_pAIScene); + SaveAssimpModel(Temp, m_pAIScene); return S_OK; } #pragma region Mesh @@ -171,7 +171,7 @@ HRESULT CInstance_Model::Ready_Meshes(MODEL eType, const aiScene* pAIScene, _fma #endif #ifdef EDITOR_PROJECT -_bool CInstance_Model::SaveAssimpModel(const _char* filename , const aiScene* pAIScene) +_bool CInstance_Model::SaveAssimpModel(const _char* filename, const aiScene* pAIScene) { if (!pAIScene) { return false; @@ -416,7 +416,7 @@ HRESULT CInstance_Model::Change_NumInstance() HRESULT CInstance_Model::Create_Instance_Buffer() { - + m_iNumInstance = m_InstanceDesc.iNumInstance; @@ -517,7 +517,7 @@ HRESULT CInstance_Model::Initialize(void* pArg) //시작 시에 인스턴트 버퍼를 구성 해줌 Instane_Buffer_ReStruct(); - if(FAILED(Create_CS())) + if (FAILED(Create_CS())) return E_FAIL; return S_OK; @@ -551,7 +551,7 @@ void CInstance_Model::Drop(_float fTimeDelta) pDesc->ProjMatrix = *m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ); pDesc->fFar = *m_pGameInstance->Get_CurrentCameraFar(); pDesc->vScreenSize = m_pGameInstance->Get_ViewPortSize(); - + m_pContext->Unmap(m_pConstantBuffer, 0); @@ -575,27 +575,6 @@ void CInstance_Model::Drop(_float fTimeDelta) OutSubResources = m_pComputeShader->Dispatch(0, 0, _float3((_float)iGroupCountX, 1.f, 1.f), CSBuffers, m_pConstantBuffer); - if (SUCCEEDED(m_pContext->Map(m_pVBInstance, 0, D3D11_MAP_WRITE_DISCARD, 0, &VBInstanceResource))) - { - - memcpy(VBInstanceResource.pData, OutSubResources[0].pData, m_iInstanceStride * m_InstanceDesc.iNumInstance); // 아웃풋 버퍼에 들어온 값들을 전부 복사한다. - - m_pContext->Unmap(m_pVBInstance, 0); - } - - D3D11_MAPPED_SUBRESOURCE ParticleValueResource = {}; - - if (SUCCEEDED(m_pContext->Map(m_pParticleValueBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &ParticleValueResource))) - { - CS_PARTICLE_VALUE_DESC* pValueDesc = static_cast(OutSubResources[1].pData); - - memcpy(ParticleValueResource.pData, OutSubResources[1].pData, sizeof(CS_PARTICLE_VALUE_DESC) * m_InstanceDesc.iNumInstance); // 아웃풋 버퍼에 들어온 값들을 전부 복사한다. - - - m_pContext->Unmap(m_pParticleValueBuffer, 0); - } - - } @@ -704,7 +683,7 @@ void CInstance_Model::Instane_Buffer_ReStruct() m_pGameInstance->Random_Float(m_InstanceDesc.vVelocityMin.x, m_InstanceDesc.vVelocityMax.x), m_pGameInstance->Random_Float(m_InstanceDesc.vVelocityMin.y, m_InstanceDesc.vVelocityMax.y), m_pGameInstance->Random_Float(m_InstanceDesc.vVelocityMin.z, m_InstanceDesc.vVelocityMax.z) - ); + ); pParticleValues[i].vVelocity = vVelocity; @@ -734,10 +713,9 @@ void CInstance_Model::Instane_Buffer_ReStruct() pParticleValues[i].fSizeDrag = m_pGameInstance->Random_Float(m_InstanceDesc.vSizeDrag.x, m_InstanceDesc.vSizeDrag.y); pParticleValues[i].vDelay = _float2(0.0f, m_pGameInstance->Random_Float(m_InstanceDesc.vDelay.x, m_InstanceDesc.vDelay.y)); pParticleValues[i].fDropAttenuation = m_pGameInstance->Random_Float(m_InstanceDesc.vDropAttenuation.x, m_InstanceDesc.vDropAttenuation.y); - + pParticleValues[i].fCollisionTime = 0.f; pParticleValues[i].isCompareStop = false; - m_InstanceDesc.isDetphCompareStop = true; memcpy(&pParticleValues[i].vOriginRight, SRMatrix.m[0], sizeof(_float4)); memcpy(&pParticleValues[i].vOriginUp, SRMatrix.m[1], sizeof(_float4)); @@ -815,7 +793,7 @@ void CInstance_Model::Free() SAFE_RELEASE(m_pComputeShader); SAFE_RELEASE(m_pConstantBuffer); SAFE_RELEASE(m_pParticleValueBuffer); -; + ; } #ifdef _DEBUG @@ -847,7 +825,7 @@ void CInstance_Model::Describe_Entity() { Instane_Buffer_ReStruct(); } - + if (GUI::Checkbox("Sin Wave", &m_InstanceDesc.isSinWave)) { Instane_Buffer_ReStruct(); @@ -1061,7 +1039,7 @@ void CInstance_Model::Describe_Entity() Instane_Buffer_ReStruct(); } - + ImGui::PopItemWidth(); ImGui::TreePop(); diff --git a/Jusin154_Team3D/Engine/Private/Level_Manager.cpp b/Jusin154_Team3D/Engine/Private/Level_Manager.cpp index 04c3f35c5..dc68d6d3a 100644 --- a/Jusin154_Team3D/Engine/Private/Level_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/Level_Manager.cpp @@ -1,4 +1,4 @@ -#include "pch.h" +#include "pch.h" #include "Level_Manager.h" #include "GameInstance.h" @@ -52,11 +52,18 @@ _uint CLevel_Manager::Get_NextLevelID() void CLevel_Manager::Update(_float fTimeDelta) { +#ifdef _DEBUG + m_pGameInstance->Compute_TimeDelta(TEXT("Timer_Level")); +#endif // _DEBUG if (nullptr == m_pCurrentLevel){ return; } m_pCurrentLevel->Update(fTimeDelta); + +#ifdef _DEBUG + m_pGameInstance->Compute_TimeDelta(TEXT("Timer_Level")); +#endif // _DEBUG } HRESULT CLevel_Manager::Render() diff --git a/Jusin154_Team3D/Engine/Private/Model.cpp b/Jusin154_Team3D/Engine/Private/Model.cpp index 55b1fedff..dbcadff39 100644 --- a/Jusin154_Team3D/Engine/Private/Model.cpp +++ b/Jusin154_Team3D/Engine/Private/Model.cpp @@ -1238,28 +1238,7 @@ HRESULT CModel::Assimp_Model_Load(const _char* pModelFilePath, MODEL eType, _fma #endif // EDITOR_PROJECT -HRESULT CModel::Create_CS() -{ - _uint CS1_InputStrides[] = { - sizeof(KEYFRAME_DESC), - sizeof(CHANNEL_DESC), - }; - _uint CS1_OutputStrides[] = { - sizeof(LOCALPOS_DESC), - sizeof(LOCALPOS_DESC), - }; - - - m_pComputeShader = CComputeShader::Create(m_pDevice, m_pContext, L"../Bin/Resources/ShaderFiles/Shader_Mesh_Compute.hlsl", - "CS_LocalSRT", (_uint)m_Bones.size(), 0, 2, nullptr, CS1_OutputStrides - ); - - if (!m_pComputeShader) - return E_FAIL; - - return S_OK; -} void CModel::Create_Temp() { @@ -1288,85 +1267,7 @@ void CModel::Create_LocalPosVB() } -void CModel::Create_Con() -{ - D3D11_BUFFER_DESC cbDesc = {}; - cbDesc.Usage = D3D11_USAGE_DYNAMIC; - cbDesc.BindFlags = D3D11_BIND_CONSTANT_BUFFER; - cbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; - cbDesc.ByteWidth = sizeof(ANIMSTATE_DESC); - if (FAILED(m_pDevice->CreateBuffer(&cbDesc, nullptr, &m_pConstantBuffer))) - return; -} - - -void CModel::UpdateAnimationCS(_uint AnimIndex) -{ - D3D11_MAPPED_SUBRESOURCE sub{}; - if (SUCCEEDED(m_pContext->Map(m_pConstantBuffer, 0, D3D11_MAP_WRITE_DISCARD, 0, &sub))) - { - ANIMSTATE_DESC* pDesc = (ANIMSTATE_DESC*)sub.pData; - - CAnimation* pAnim = m_Animations[AnimIndex]; - pDesc->CurrentTime = pAnim->Get_CurrentTrackPosition(); - pDesc->Duration = pAnim->Get_Duration(); - pDesc->Speed = pAnim->Get_AnimSpeed(); - pDesc->BoneCount = (_uint)m_Bones.size(); - pDesc->PreTransformMatrix = m_PreTransformMatrix; - m_pContext->Unmap(m_pConstantBuffer, 0); - } -} - -void CModel::ComputeAnimation(_uint AnimIndex) -{ - UpdateAnimationCS(AnimIndex); - - _uint iGroupCountX = ((_uint)m_Bones.size() + 255) / 256; - - CAnimation* pAnim = m_Animations[AnimIndex]; - ID3D11ShaderResourceView* srvs[2] = { - pAnim->Get_KeyFrameSrv(), - pAnim->Get_ChannelSrv(), - }; - - m_pContext->CSSetShader(m_pComputeShader->Get_Compute(), nullptr, 0); - m_pContext->CSSetConstantBuffers(0, 1, &m_pConstantBuffer); - m_pContext->CSSetShaderResources(0, 2, srvs); - - ID3D11UnorderedAccessView* uavs[1] = { m_pComputeShader->GetOutputUAV(0) }; - m_pContext->CSSetUnorderedAccessViews(0, 1, uavs, nullptr); - - m_pContext->Dispatch(iGroupCountX, 1, 1); - - auto outSubs = m_pComputeShader->ReadBackOutputs(); - m_pLocalPos[0] = static_cast(outSubs[0].pData); -} - -void CModel::ComputeAnimation_Second(_uint AnimIndex) -{ - UpdateAnimationCS(AnimIndex); - - _uint iGroupCountX = ((_uint)m_Bones.size() + 255) / 256; - - CAnimation* pAnim = m_Animations[AnimIndex]; - ID3D11ShaderResourceView* srvs[2] = { - pAnim->Get_KeyFrameSrv(), - pAnim->Get_ChannelSrv(), - }; - - m_pContext->CSSetShader(m_pComputeShader->Get_Compute(), nullptr, 0); - m_pContext->CSSetConstantBuffers(0, 1, &m_pConstantBuffer); - m_pContext->CSSetShaderResources(0, 2, srvs); - - ID3D11UnorderedAccessView* uavs[1] = { m_pComputeShader->GetOutputUAV(1) }; - m_pContext->CSSetUnorderedAccessViews(0, 1, uavs, nullptr); - - m_pContext->Dispatch(iGroupCountX, 1, 1); - - auto outSubs = m_pComputeShader->ReadBackOutputs(); - m_pLocalPos[1] = static_cast(outSubs[1].pData); -} void CModel::InItialize_BoneIndex() { diff --git a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp index 51e382f81..e857dd557 100644 --- a/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp +++ b/Jusin154_Team3D/Engine/Private/PhysX_Manager.cpp @@ -389,6 +389,9 @@ void CPhysX_Manager::Update_Kinematic() void CPhysX_Manager::Update(_float fTimeDelta) { +#ifdef _DEBUG + m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PhysX")); +#endif // _DEBUG if (nullptr == m_pScene) { return; } @@ -403,6 +406,9 @@ void CPhysX_Manager::Update(_float fTimeDelta) Update_Dynamic_ActiveActors(); //Update_Dynamic_AllActors(); } +#ifdef _DEBUG + m_pGameInstance->Compute_TimeDelta(TEXT("Timer_PhysX")); +#endif // _DEBUG } void CPhysX_Manager::Update_Dynamic_ActiveActors() { diff --git a/Jusin154_Team3D/Engine/Private/Picking.cpp b/Jusin154_Team3D/Engine/Private/Picking.cpp index da93f6632..ae3bcda98 100644 --- a/Jusin154_Team3D/Engine/Private/Picking.cpp +++ b/Jusin154_Team3D/Engine/Private/Picking.cpp @@ -45,7 +45,13 @@ HRESULT CPicking::Initialize(HWND hWnd, _uint iSizeX, _uint iSizeY) void CPicking::Update() { +#ifdef _DEBUG + m_pGameInstance->Compute_TimeDelta(TEXT("Timer_Picking")); +#endif // _DEBUG m_pGameInstance->Copy_RenderTarget(TEXT("Target_Depth"), m_pTexture2D); +#ifdef _DEBUG + m_pGameInstance->Compute_TimeDelta(TEXT("Timer_Picking")); +#endif // _DEBUG } _bool CPicking::isPicking(_float3* pOut) { diff --git a/Jusin154_Team3D/Engine/Private/Stat.cpp b/Jusin154_Team3D/Engine/Private/Stat.cpp index 08272df08..6a1054abe 100644 --- a/Jusin154_Team3D/Engine/Private/Stat.cpp +++ b/Jusin154_Team3D/Engine/Private/Stat.cpp @@ -3,73 +3,71 @@ #include "StatEvent.h" CStat::CStat(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) - : CComponent{ pDevice, pContext } + : CComponent{ pDevice, pContext } + , m_UnitInfo{} { - ZeroMemory(m_StatArr, sizeof(m_StatArr)); } CStat::CStat(const CStat& rhs) - : CComponent(rhs) + : CComponent(rhs) + , m_UnitInfo(rhs.m_UnitInfo) { - ZeroMemory(m_StatArr, sizeof(m_StatArr)); - - memcpy_s(m_StatArr, sizeof(m_StatArr), rhs.m_StatArr, sizeof(m_StatArr)); - memcpy_s(m_ConditionArr, sizeof(m_ConditionArr), rhs.m_ConditionArr, sizeof(m_ConditionArr)); } HRESULT CStat::Initialize_Prototype(tinyxml2::XMLNode* pChild) { - auto pElement = pChild->ToElement(); - pElement->QueryFloatAttribute("HP", &m_StatArr[ENUM_CLASS(STAT::HP)]); - pElement->QueryFloatAttribute("MAXHP", &m_StatArr[ENUM_CLASS(STAT::MAXHP)]); - pElement->QueryFloatAttribute("MELEE", &m_StatArr[ENUM_CLASS(STAT::MELEE)]); - pElement->QueryFloatAttribute("MAGIC", &m_StatArr[ENUM_CLASS(STAT::MAGIC)]); - pElement->QueryFloatAttribute("DEFENSE", &m_StatArr[ENUM_CLASS(STAT::DEFENSE)]); - pElement->QueryFloatAttribute("SPEED", &m_StatArr[ENUM_CLASS(STAT::SPEED)]); - pElement->QueryFloatAttribute("AGILITY", &m_StatArr[ENUM_CLASS(STAT::AGILITY)]); - pElement->QueryFloatAttribute("LEVEL", &m_StatArr[ENUM_CLASS(STAT::LEVEL)]); - pElement->QueryFloatAttribute("EXPERIENCE", &m_StatArr[ENUM_CLASS(STAT::EXPERIENCE)]); - pElement->QueryFloatAttribute("MAX_EXPERIENCE", &m_StatArr[ENUM_CLASS(STAT::MAX_EXPERIENCE)]); - pElement->QueryFloatAttribute("GOLD", &m_StatArr[ENUM_CLASS(STAT::GOLD)]); - memset(m_ConditionArr, 0, sizeof(m_ConditionArr)); + auto pElement = pChild->ToElement(); + m_UnitInfo.pUnit_Name = CMyTools::ToWstring(pElement->Attribute("Name")); + pElement->QueryFloatAttribute("HP", &m_UnitInfo.fCurrentHp); + pElement->QueryFloatAttribute("MAXHP", &m_UnitInfo.fMaxHp); + pElement->QueryFloatAttribute("TARGETHP", &m_UnitInfo.fTargetHp); + pElement->QueryFloatAttribute("MELEE", &m_UnitInfo.fMelee); + pElement->QueryFloatAttribute("MAGIC", &m_UnitInfo.fMagic); + pElement->QueryFloatAttribute("DEFENSE", &m_UnitInfo.fDefense); + pElement->QueryFloatAttribute("SPEED", &m_UnitInfo.fSpeed); + pElement->QueryFloatAttribute("AGILITY", &m_UnitInfo.fAgility); + pElement->QueryIntAttribute("LEVEL", &m_UnitInfo.iLevel); + pElement->QueryFloatAttribute("EXPERIENCE", &m_UnitInfo.fExprince); + pElement->QueryFloatAttribute("MAX_EXPERIENCE", &m_UnitInfo.fMaxExprience); + pElement->QueryIntAttribute("GOLD", &m_UnitInfo.iGold); - return S_OK; + return S_OK; } HRESULT CStat::Initialize(void* pArg) { - return S_OK; + return S_OK; } CStat* CStat::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, tinyxml2::XMLNode* pChild) { - CStat* pInstance = new CStat(pDevice, pContext); + CStat* pInstance = new CStat(pDevice, pContext); - if (FAILED(pInstance->Initialize_Prototype(pChild))) - { - MSG_BOX("Failed to Created : CStat"); - Safe_Release(pInstance); - } + if (FAILED(pInstance->Initialize_Prototype(pChild))) + { + MSG_BOX("Failed to Created : CStat"); + Safe_Release(pInstance); + } - return pInstance; + return pInstance; } CComponent* CStat::Clone(void* pArg, class CGameObject* pOwner) { - CStat* pInstance = new CStat(*this); - pInstance->m_pOwner = pOwner; - if (FAILED(pInstance->Initialize(pArg))) - { - MSG_BOX("Failed to Cloned : CStat"); - Safe_Release(pInstance); - } + CStat* pInstance = new CStat(*this); + pInstance->m_pOwner = pOwner; + if (FAILED(pInstance->Initialize(pArg))) + { + MSG_BOX("Failed to Cloned : CStat"); + Safe_Release(pInstance); + } - return pInstance; + return pInstance; } void CStat::Free() { - __super::Free(); + __super::Free(); } #ifdef _DEBUG @@ -80,49 +78,124 @@ void CStat::Describe_Entity() #endif // _DEBUG -_float CStat::Get_Stat(_int _iStatIndex) +CStat::UNITINFO CStat::Get_Stat() { - return m_StatArr[_iStatIndex]; + return m_UnitInfo; } void CStat::Set_Stat(_int _iStatIndex, _float _iAmount) { - m_StatArr[_iStatIndex] = _iAmount; + + switch (_iStatIndex) + { + case 1: + m_UnitInfo.fCurrentHp = _iAmount; + break; + case 2: + m_UnitInfo.fMaxHp = _iAmount; + break; + case 3: + m_UnitInfo.fTargetHp = _iAmount; + break; + case 4: + m_UnitInfo.fMelee = _iAmount; + break; + case 5: + m_UnitInfo.fMagic = _iAmount; + break; + case 6: + m_UnitInfo.fDefense = _iAmount; + break; + case 7: + m_UnitInfo.fSpeed = _iAmount; + break; + case 8: + m_UnitInfo.fAgility = _iAmount; + break; + case 9: + m_UnitInfo.iLevel = static_cast<_int>(_iAmount); + break; + case 10: + m_UnitInfo.fExprince = _iAmount; + break; + case 11: + m_UnitInfo.fMaxExprience = _iAmount; + break; + case 12: + m_UnitInfo.iGold = static_cast<_int>(_iAmount); + break; + default: + return; + break; + } } void CStat::Add_Stat(_int _iStatIndex, _float _iAmount) { - m_StatArr[_iStatIndex] += _iAmount; -} - -_bool CStat::Get_Condition(_uint _iConditionIndex) const -{ - return m_ConditionArr[_iConditionIndex]; -} - -void CStat::Set_Condition(_uint _iConditionIndex, _bool _Condition) -{ - m_ConditionArr[_iConditionIndex] = _Condition; + switch (_iStatIndex) + { + case 1: + m_UnitInfo.fCurrentHp = _iAmount; + break; + case 2: + m_UnitInfo.fMaxHp = _iAmount; + break; + case 3: + m_UnitInfo.fTargetHp = _iAmount; + break; + case 4: + m_UnitInfo.fMelee = _iAmount; + break; + case 5: + m_UnitInfo.fMagic = _iAmount; + break; + case 6: + m_UnitInfo.fDefense = _iAmount; + break; + case 7: + m_UnitInfo.fSpeed = _iAmount; + break; + case 8: + m_UnitInfo.fAgility = _iAmount; + break; + case 9: + m_UnitInfo.iLevel = static_cast<_int>(_iAmount); + break; + case 10: + m_UnitInfo.fExprince = _iAmount; + break; + case 11: + m_UnitInfo.fMaxExprience = _iAmount; + break; + case 12: + m_UnitInfo.iGold = static_cast<_int>(_iAmount); + break; + default: + return; + break; + } } void CStat::Add_Hp(_float iAmount) { - _float fMaxHp = Get_Stat(ENUM_CLASS(STAT::MAXHP)); - _float fCurHp = Get_Stat(ENUM_CLASS(STAT::HP)); - if (fCurHp < fMaxHp) { - _float iNewHP = fCurHp + iAmount; - if (iNewHP > fMaxHp) { - iAmount = fMaxHp - fCurHp; - } - Add_Stat(ENUM_CLASS(STAT::HP), iAmount); - } + _float fMaxHp = m_UnitInfo.fMaxHp; + _float fCurHp = m_UnitInfo.fTargetHp; + if (fCurHp < fMaxHp) { + _float iNewHP = fCurHp + iAmount; + if (iNewHP > fMaxHp) { + iAmount = fMaxHp - fCurHp; + } + Add_Stat(ENUM_CLASS(STAT::CURRENTHP), iAmount); + } } _bool CStat::Get_Damage(_float fDamage) { - _bool bResultDead = { false }; - _float fCurHp = Get_Stat(ENUM_CLASS(STAT::HP)) - fDamage; - if (fCurHp <= 0) { fCurHp = 0; bResultDead = true; } - Set_Stat(ENUM_CLASS(STAT::HP), fCurHp); - return bResultDead; + _bool bResultDead = { false }; + _float fCurHp = Get_Stat().fCurrentHp - fDamage; + Set_Stat(ENUM_CLASS(STAT::TARGETHP), fDamage); + if (fCurHp <= 0) { fCurHp = 0; bResultDead = true; } + Set_Stat(ENUM_CLASS(STAT::CURRENTHP), fCurHp); + return bResultDead; + return false; } diff --git a/Jusin154_Team3D/Engine/Private/UIObject.cpp b/Jusin154_Team3D/Engine/Private/UIObject.cpp index 867890a64..347b6dacf 100644 --- a/Jusin154_Team3D/Engine/Private/UIObject.cpp +++ b/Jusin154_Team3D/Engine/Private/UIObject.cpp @@ -96,7 +96,7 @@ void CUIObject::Update(_float fTimeDelta) //m_vScale = _float3(m_fSizeX, m_fSizeY, 1.f); //m_pTransformCom->Set_Scale(m_vScale); - //m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(m_fX - m_fWinSizeX * 0.5f, -m_fY + m_fWinSizeY * 0.5f, 0.f, 1.f)); + m_pTransformCom->Set_State(STATE::POSITION, XMVectorSet(m_fX - m_fWinSizeX * 0.5f, -m_fY + m_fWinSizeY * 0.5f, m_fSortZ, 1.f)); //m_fCurrent_Position = XMVectorSet(m_fX, m_fY, m_fSortZ, 1.f); diff --git a/Jusin154_Team3D/Engine/Public/ComputeShader.h b/Jusin154_Team3D/Engine/Public/ComputeShader.h index a410e7b45..859e4a7c5 100644 --- a/Jusin154_Team3D/Engine/Public/ComputeShader.h +++ b/Jusin154_Team3D/Engine/Public/ComputeShader.h @@ -19,7 +19,6 @@ class ENGINE_DLL CComputeShader final : public CBase void Bind_OutPut_SRV_VS(_uint iIndex, _uint iBufferIndex); ID3D11ComputeShader* Get_Compute() { return m_pComputeShader; } ID3D11UnorderedAccessView* GetOutputUAV(_uint iIndex) const; - vector ReadBackOutputs(); private: void Bind_SRV(_uint iIndex); void Bind_UAV(_uint iIndex); @@ -30,7 +29,7 @@ class ENGINE_DLL CComputeShader final : public CBase HRESULT CreateComputeShader(const _tchar* pShaderFilePath, const _char* pStartFunctionName); private: - ID3D11Device* m_pDevice = { nullptr }; + ID3D11Device* m_pDevice = { nullptr }; ID3D11DeviceContext* m_pContext = { nullptr }; class CGameInstance* m_pGameInstance = { nullptr }; @@ -42,11 +41,9 @@ class ENGINE_DLL CComputeShader final : public CBase vector m_pInputBuffer = {}; vector m_pOutputBuffer = {}; - vector m_pInputStagingBuffer = {}; - vector m_pOutputStagingBuffer = {}; ID3D11ComputeShader* m_pComputeShader = nullptr; - + private: diff --git a/Jusin154_Team3D/Engine/Public/Engine_Enum.h b/Jusin154_Team3D/Engine/Public/Engine_Enum.h index 85239b307..385579324 100644 --- a/Jusin154_Team3D/Engine/Public/Engine_Enum.h +++ b/Jusin154_Team3D/Engine/Public/Engine_Enum.h @@ -9,8 +9,8 @@ enum class RENDER {PRIORITY, SHADOW, NONBLEND, DECAL, BLUR, NONLIGHT, EFFECT ,BL enum class RAY { LOCAL, WORLD, END }; enum class ACTOR { BOX, CAPSULE, SPHERE, PLANE, TRIANGLEMESH, HEIGHTFIELD, END }; enum class BLEND_BONE{SPINE,SHOULDER_L,SHOULDER_R,NECK,SHOULDER_NECK_L, SHOULDER_NECK_R,END}; -enum class STAT { HP, MAXHP, MELEE, MAGIC, DEFENSE, SPEED, AGILITY, LEVEL, EXPERIENCE, MAX_EXPERIENCE, GOLD, END }; -enum class CONDITION { POISON, HPREGENERATION, PANIC, GRAP, END }; +enum class STAT { NAME, CURRENTHP, MAXHP, TARGETHP, MELEE, MAGIC, DEFENSE, SPEED, AGILITY, LEVEL, EXPERIENCE, MAX_EXPERIENCE, GOLD, END }; +//enum class CONDITION { POISON, HPREGENERATION, PANIC, GRAP, END }; enum class TEXTURE_LOAD_TYPE { diff --git a/Jusin154_Team3D/Engine/Public/FSM.h b/Jusin154_Team3D/Engine/Public/FSM.h index 2b1bcd0f3..6a2552a8d 100644 --- a/Jusin154_Team3D/Engine/Public/FSM.h +++ b/Jusin154_Team3D/Engine/Public/FSM.h @@ -35,6 +35,7 @@ enum ESTATE : _u64Flag BLINK = 1ULL << 28, SHUFFLE = 1ULL << 29, DEAD = 1ULL << 30, + STUN = 1ULL << 31, END }; NS_END diff --git a/Jusin154_Team3D/Engine/Public/GameInstance.h b/Jusin154_Team3D/Engine/Public/GameInstance.h index 98e1af12f..80fd89696 100644 --- a/Jusin154_Team3D/Engine/Public/GameInstance.h +++ b/Jusin154_Team3D/Engine/Public/GameInstance.h @@ -305,6 +305,9 @@ class ENGINE_DLL CGameInstance final : public CBase _float m_fTimer_LateUpdate = { 0.f }; _float m_fTimer_DrawCall = { 0.f }; _float m_fTimer_Present = { 0.f }; + _float m_fTimer_Picking = { 0.f }; + _float m_fTimer_PhysX = { 0.f }; + _float m_fTimer_Level = { 0.f }; _float m_fTimer_FrameCount = { 0.f }; _float2 m_vViewPortSize = {}; diff --git a/Jusin154_Team3D/Engine/Public/Instance_Model.h b/Jusin154_Team3D/Engine/Public/Instance_Model.h index 0e8d404c4..cbce89ec7 100644 --- a/Jusin154_Team3D/Engine/Public/Instance_Model.h +++ b/Jusin154_Team3D/Engine/Public/Instance_Model.h @@ -243,10 +243,11 @@ class ENGINE_DLL CInstance_Model final : public CComponent HRESULT Render(_uint iMeshIndx); void Instane_Buffer_ReStruct(); _uint Get_NumMeshes() const { return m_iNumMeshes; } - HRESULT Bind_CS_Output(_uint Index, _uint iBufferIndex); + //HRESULT Bind_Value_Buffer(class CShader* pShader, const _char* pConstantName); HRESULT Bind_OutPut_SRV_VS(_uint Index, _uint iBufferIndex); INSTANCE_DESC Get_EffectValue() { return m_InstanceDesc; } HRESULT Load_InstanceModel(HANDLE hFile); + HRESULT Bind_CS_Output(_uint Index, _uint iBufferIndex); private: bool LoadData(const _char* filename); @@ -264,6 +265,7 @@ class ENGINE_DLL CInstance_Model final : public CComponent HRESULT Create_SubResource_Buffer(); HRESULT Create_CS(); + private: #ifdef EDITOR_PROJECT const aiScene* m_pAIScene = { nullptr }; @@ -293,6 +295,8 @@ class ENGINE_DLL CInstance_Model final : public CComponent ID3D11Buffer* m_pConstantBuffer = { nullptr }; // 컴퓨트 쉐이드 전용 상수버퍼 ID3D11Buffer* m_pParticleValueBuffer = { nullptr }; // 컴퓨트 쉐이드 두번째 버퍼 (스피드, 로테이션) + ID3D11ShaderResourceView* m_pVBInstance_Srv = { nullptr }; + ID3D11ShaderResourceView* m_pParticleValue_Srv = { nullptr }; public: //인스턴싱으로 바꾸기 static CInstance_Model* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pModelFilePath, MODEL eType, _fmatrix& PreTransformMatrix, _uint iRootBoneIndex); diff --git a/Jusin154_Team3D/Engine/Public/Model.h b/Jusin154_Team3D/Engine/Public/Model.h index 9e0d8694c..7aa2ece70 100644 --- a/Jusin154_Team3D/Engine/Public/Model.h +++ b/Jusin154_Team3D/Engine/Public/Model.h @@ -182,11 +182,8 @@ class ENGINE_DLL CModel final : public CComponent private: HRESULT Create_ParentVB(); - HRESULT Create_CS(); void Create_Temp(); void Create_LocalPosVB(); - void Create_Con(); - void UpdateAnimationCS(_uint AnimIndex); _uint m_iNumBuffer = {}; diff --git a/Jusin154_Team3D/Engine/Public/Stat.h b/Jusin154_Team3D/Engine/Public/Stat.h index 51dd4934e..98a0c82b1 100644 --- a/Jusin154_Team3D/Engine/Public/Stat.h +++ b/Jusin154_Team3D/Engine/Public/Stat.h @@ -6,6 +6,22 @@ NS_BEGIN(Engine) class ENGINE_DLL CStat final : public CComponent { + typedef struct tagUnitInfo + { + _wstring pUnit_Name; + _float fCurrentHp{}; + _float fMaxHp{}; + _float fTargetHp{}; + _float fMelee{}; + _float fMagic{}; + _float fDefense{}; + _float fSpeed{}; + _float fAgility{}; + _int iLevel{}; + _float fExprince{}; + _float fMaxExprience{}; + _int iGold{}; + }UNITINFO; private: CStat(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); CStat(const CStat& rhs); @@ -24,18 +40,18 @@ class ENGINE_DLL CStat final : public CComponent #endif // _DEBUG public: - _float Get_Stat(_int _iStatIndex); + UNITINFO Get_Stat(); void Set_Stat(_int _iStatIndex, _float _iAmount); void Add_Stat(_int _iStatIndex, _float _iAmount); - _bool Get_Condition(_uint _iConditionIndex) const; - void Set_Condition(_uint _iConditionIndex, _bool _Condition); void Add_Hp(_float iAmount); _bool Get_Damage(_float fDamage); private: - _float m_StatArr[ENUM_CLASS(STAT::END)]; - _bool m_ConditionArr[ENUM_CLASS(CONDITION::END)] = { false }; + UNITINFO m_UnitInfo; + //_wstring m_pName; + //_float m_StatArr[ENUM_CLASS(STAT::END)]; + //_bool m_ConditionArr[ENUM_CLASS(CONDITION::END)] = { false }; }; NS_END