This commit is contained in:
GiJungSUk
2025-12-26 09:49:46 +09:00
parent e1f1c7d06b
commit c4ab156f3e
14 changed files with 358 additions and 11 deletions
@@ -166,6 +166,7 @@ call Update_Resources.bat
<ClInclude Include="..\Public\CallBack_NonPlayable_Behavior.h" />
<ClInclude Include="..\Public\CallBack_NonPlayable_HitReport.h" />
<ClInclude Include="..\Public\CallBack_Ranrok_HitReport.h" />
<ClInclude Include="..\Public\Ranrok_FireBall.h" />
<ClInclude Include="..\Public\State_Fall.h" />
<ClInclude Include="..\Public\State_FireBall.h" />
<ClInclude Include="..\Public\TransformationSide.h" />
@@ -400,6 +401,7 @@ call Update_Resources.bat
<ClCompile Include="..\Private\CallBack_NonPlayable_Behavior.cpp" />
<ClCompile Include="..\Private\CallBack_NonPlayable_HitReport.cpp" />
<ClCompile Include="..\Private\CallBack_Ranrok_HitReport.cpp" />
<ClCompile Include="..\Private\Ranrok_FireBall.cpp" />
<ClCompile Include="..\Private\State_Fall.cpp" />
<ClCompile Include="..\Private\TransformationSide.cpp" />
<ClCompile Include="..\Private\Transformation.cpp" />
@@ -722,6 +722,9 @@
<ClInclude Include="..\Public\State_FireBall.h">
<Filter>04.Mechanic\State\State_Combat\State_FireBall</Filter>
</ClInclude>
<ClInclude Include="..\Public\Ranrok_FireBall.h">
<Filter>02.GameObjects\Effect\MonsterEffect\Ranrok</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Image Include="Client.ico">
@@ -1503,6 +1506,9 @@
<Filter Include="02.GameObjects\PhysX\CallBack\HitReport\Monster\Ranrok">
<UniqueIdentifier>{93545681-c4c5-4a6a-9496-7b2e7b8a9302}</UniqueIdentifier>
</Filter>
<Filter Include="02.GameObjects\Effect\MonsterEffect\Ranrok">
<UniqueIdentifier>{087ad9ea-445d-4bf7-8ec4-0f29a0c2dd53}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="Client.cpp">
@@ -2172,6 +2178,9 @@
<ClCompile Include="..\Private\CallBack_Ranrok_HitReport.cpp">
<Filter>02.GameObjects\PhysX\CallBack\HitReport\Monster\Ranrok</Filter>
</ClCompile>
<ClCompile Include="..\Private\Ranrok_FireBall.cpp">
<Filter>02.GameObjects\Effect\MonsterEffect\Ranrok</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\Private\Goblin_States.cpp">
+12 -1
View File
@@ -42,7 +42,7 @@
#include "Blink.h"
#include "Transformation.h"
#include "Avadakedavra.h"
#include "Ranrok_FireBall.h"
CEffectPool::CEffectPool(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CGameObject(pDevice, pContext)
@@ -560,6 +560,17 @@ HRESULT CEffectPool::Ready_MonsterEffect()
))) return E_FAIL;
if (FAILED(Create_Effect(SKILL_TYPE::RANROK_FIREBALL, 5, g_iStaticLevel, g_iStaticLevel, [&](_uint iPrototypeLevel, _uint iCloneLevel) -> CEffect_Container* {
CRanrok_FireBall* pEffect = nullptr;
pEffect = m_pGameInstance->Clone_Prototype<CRanrok_FireBall>(iPrototypeLevel, nullptr);
return pEffect; }
))) return E_FAIL;
return S_OK;
}
@@ -176,6 +176,7 @@
#include "Mage_Down_Attack.h"
#include "Mage_Nomal_Attack.h"
#include "MageSide.h"
#include "Ranrok_FireBall.h"
#include "StunEffect.h"
#include "Box_Splesh.h"
@@ -2079,6 +2080,10 @@ HRESULT CLoader::Loading_For_GamePlay()
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Prototype<CRanrok_FireBall>(g_iStaticLevel, CRanrok_FireBall::Create(m_pDevice, m_pContext)))) {
return E_FAIL;
}
if (FAILED(m_pGameInstance->Add_Prototype<CGoblin_Teleport>(g_iStaticLevel, CGoblin_Teleport::Create(m_pDevice, m_pContext)))) {
@@ -21,8 +21,6 @@ CMage_Nomal_Attack::CMage_Nomal_Attack(const CMage_Nomal_Attack& rhs)
HRESULT CMage_Nomal_Attack::Initialize_Prototype()
{
if (FAILED(Load_Package("../Bin/Resources/Data/Effect/MonsterPackage/GoblinMage/NomalAttack")))
return E_FAIL;
+3 -3
View File
@@ -62,8 +62,8 @@ HRESULT CRanrok::Initialize(void* pArg)
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody);
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody,&m_bCollisionPlayer);
//m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object<CEffectPool>();
//SAFE_ADDREF(m_pEffectPool);
m_pEffectPool = m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_EffectPool"))->Get_Object<CEffectPool>();
SAFE_ADDREF(m_pEffectPool);
if (NEXT_LEVEL == ENUM_CLASS(LEVEL::FIELD))
{
@@ -648,7 +648,7 @@ void CRanrok::Free()
SAFE_RELEASE(m_pCharacter_Controller);
SAFE_RELEASE(m_pRigidBody);
//SAFE_RELEASE(m_pEffectPool);
SAFE_RELEASE(m_pEffectPool);
Safe_Delete(m_pCallBack_Behavior);
Safe_Delete(m_pCallBack_HitReport);
}
@@ -0,0 +1,249 @@
#include "pch.h"
#include "Ranrok_FireBall.h"
#include "GameInstance.h"
#include "EffectParts.h"
#include "Wand.h"
#include "Player.h"
#include "InfoInstance.h"
CRanrok_FireBall::CRanrok_FireBall(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
: CEffect_Container{ pDevice, pContext }
{
}
CRanrok_FireBall::CRanrok_FireBall(const CRanrok_FireBall& rhs)
: CEffect_Container(rhs),
m_pInfoInstance(CInfoInstance::GetInstance())
{
SAFE_ADDREF(m_pInfoInstance);
}
HRESULT CRanrok_FireBall::Initialize_Prototype()
{
if (FAILED(Load_Package("../Bin/Resources/Data/Effect/MonsterPackage/Ranrok/RanrokFireBall")))
return E_FAIL;
return S_OK;
}
HRESULT CRanrok_FireBall::Initialize(void* pArg)
{
if (FAILED(__super::Initialize(pArg)))
return E_FAIL;
if (FAILED(Ready_Components(pArg)))
return E_FAIL;
if (FAILED(Create_Effect()))
return E_FAIL;
m_wstrEffectName = L"RanrokFireBall";
m_pFireBall = Get_PartObject<CEffectParts>("FireBall");
m_pFireBall_PT = Get_PartObject<CEffectParts>("FireBall_PT");
m_pFireBall_Surface = Get_PartObject<CEffectParts>("FireBall_Surface");
m_pFireBall_Tail = Get_PartObject<CEffectParts>("FireBall_Tail");
SAFE_ADDREF(m_pFireBall);
SAFE_ADDREF(m_pFireBall_PT);
SAFE_ADDREF(m_pFireBall_Surface);
SAFE_ADDREF(m_pFireBall_Tail);
m_fDuration = 3.2f;
return S_OK;
}
void CRanrok_FireBall::Priority_Update(_float fTimeDelta)
{
__super::Priority_Update(fTimeDelta);
XMStoreFloat4(&m_vStartPos, m_pFireBall->Get_WorldPostion());
}
void CRanrok_FireBall::Update(_float fTimeDelta)
{
if (m_bVisible == false)
return;
__super::Update(fTimeDelta);
Update_Event(fTimeDelta);
m_pFireBall->Get_Component<CTransform>()->Translation(XMLoadFloat3(&m_vLook) * m_fLinearSpeed);
m_pFireBall_PT->Get_Component<CTransform>()->Translation(XMLoadFloat3(&m_vLook) * m_fLinearSpeed);
m_pFireBall_Surface->Get_Component<CTransform>()->Translation(XMLoadFloat3(&m_vLook) * m_fLinearSpeed);
m_pFireBall_Tail->Get_Component<CTransform>()->Translation(XMLoadFloat3(&m_vLook) * m_fLinearSpeed);
if (false == m_bHit) {
_vector vStartPos = XMLoadFloat4(&m_vStartPos);
_vector vEndPos = m_pFireBall->Get_WorldPostion();
ON_COLLISION_INFO CollisionInfo = MonsterSweepTarget(vStartPos, vEndPos, 0.2f , true);
OnCollision(this, &CollisionInfo);
}
}
void CRanrok_FireBall::Late_Update(_float fTimeDelta)
{
if (m_bVisible == false)
return;
__super::Late_Update(fTimeDelta);
}
HRESULT CRanrok_FireBall::Pre_Setting(CGameObject* pObject, void* pArg)
{
if (FAILED(__super::Pre_Setting(pObject, nullptr)))
return E_FAIL;
/* 초기 객체 비지블*/
m_pFireBall->Set_Visible(true);
m_pFireBall_PT->Set_Visible(true);
m_pFireBall_Surface->Set_Visible(true);
m_pFireBall_Tail->Set_Visible(true);
/* 초기 객체 위치 초기화*/
_matrix BoneMat = XMLoadFloat4x4(m_pOwner->Get_Component<CModel>()->Get_BoneMatrixPtr("tongue_01_end"));
for (int i = 0; i < 3; ++i) {
BoneMat.r[i] = XMVector3Normalize(BoneMat.r[i]);
}
_matrix WorldMat = m_pOwner->Get_Component<CTransform>()->Get_XMWorldMatrix();
_matrix CombinedMat = BoneMat * WorldMat;
_vector vStartPos = CombinedMat.r[3];
XMStoreFloat4(&m_vStartPos, vStartPos);
m_pFireBall->Get_Component<CTransform>()->Set_State(STATE::POSITION, vStartPos);
m_pFireBall_PT->Get_Component<CTransform>()->Set_State(STATE::POSITION, vStartPos);
m_pFireBall_Surface->Get_Component<CTransform>()->Set_State(STATE::POSITION, vStartPos);
m_pFireBall_Tail->Get_Component<CTransform>()->Set_State(STATE::POSITION, vStartPos);
/* 플레이어 위치 받기 */
CUnit* pPlayer = m_pInfoInstance->Get_NearestPlayerAlly(m_pOwner->Get_WorldPostion()).first;
if (pPlayer == nullptr)
return E_FAIL;
/* 초기 방향 */
XMStoreFloat4(&m_vTargetPos, pPlayer->Get_Component<CCharacter_Controller>()->Get_Position());
XMStoreFloat3(&m_vLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos)));
return S_OK;
}
HRESULT CRanrok_FireBall::Ready_Components(void* pArg)
{
if (FAILED(__super::Ready_Components(pArg))) {
return E_FAIL;
}
return S_OK;
}
HRESULT CRanrok_FireBall::Ready_Child()
{
return S_OK;
}
CRanrok_FireBall* CRanrok_FireBall::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
{
CRanrok_FireBall* pInstance = new CRanrok_FireBall(pDevice, pContext);
if (FAILED(pInstance->Initialize_Prototype()))
{
MSG_BOX("Failed to Created : CRanrok_FireBall");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
CGameObject* CRanrok_FireBall::Clone(void* pArg, CGameObject* pOwner)
{
CRanrok_FireBall* pInstance = new CRanrok_FireBall(*this);
pInstance->m_pOwner = pOwner;
if (FAILED(pInstance->Initialize(pArg)))
{
MSG_BOX("Failed to Cloned : CRanrok_FireBall");
SAFE_RELEASE(pInstance);
}
return pInstance;
}
void CRanrok_FireBall::OnCollision(CGameObject* pOther, void* pDesc)
{
if (m_bHit == false)
return;
ON_COLLISION_INFO CollisionDesc = *static_cast<ON_COLLISION_INFO*>(pDesc);
_vector vPos = XMLoadFloat4(&CollisionDesc.vWorldPos);
for (auto& pPair : m_PartObjects)
{
pPair.second->Set_Visible(true);
pPair.second->Get_Component<CTransform>()->Set_State(STATE::POSITION, vPos);
}
m_pFireBall->Set_Visible(false);
m_pFireBall_Surface->Set_Visible(false);
m_pFireBall_Tail->Get_Component<CTransform>()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f));
m_pFireBall_PT->Get_Component<CTransform>()->Set_State(STATE::POSITION, XMVectorSet(0.f, -500.f, 0.f, 1.f));
CPlayer* pPlayer = static_cast<CPlayer*>(m_pInfoInstance->Get_NearestPlayerAlly(m_pOwner->Get_WorldPostion()).first);
if (pPlayer == nullptr)
return;
pPlayer->Start_CameraShake(0.3f, 2.f);
}
void CRanrok_FireBall::Free()
{
__super::Free();
SAFE_RELEASE(m_pInfoInstance);
SAFE_RELEASE(m_pFireBall);
SAFE_RELEASE(m_pFireBall_PT);
SAFE_RELEASE(m_pFireBall_Surface);
SAFE_RELEASE(m_pFireBall_Tail);
}
#ifdef _DEBUG
void CRanrok_FireBall::Describe_Entity()
{
}
#endif
HRESULT CRanrok_FireBall::Bind_ShaderResources()
{
return S_OK;
}
@@ -404,6 +404,12 @@ void CRanrok::Behavior_FireBallEnter()
pairAnimInfo = m_Animation[STATEANIM::FIREBALL2_A];
break;
}
Add_Event(pairAnimInfo.first,
[this]() {
m_pEffectPool->Use_Skill(SKILL_TYPE::RANROK_FIREBALL, this);
}, 0.1f);
}
else if (m_ePhase == ENUM_CLASS(RANROK_PHASE::PHASE_GROUND))
{
@@ -67,6 +67,11 @@ namespace Client
/*고블린 메이지*/
GOBLIN_MAGE_ATTACK , GOBLIN_MAGE_DOWN , GOBLIN_MAGE_SIDE,
/*란록*/
RANROK_FIREBALL,
END
};
@@ -0,0 +1,59 @@
#pragma once
#include "Client_Define.h"
#include "Effect_Container.h"
NS_BEGIN(Engine)
NS_END
NS_BEGIN(Client)
class CRanrok_FireBall final : public CEffect_Container
{
private:
CRanrok_FireBall(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
CRanrok_FireBall(const CRanrok_FireBall& rhs);
virtual ~CRanrok_FireBall() = 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_pFireBall = { nullptr };
class CEffectParts* m_pFireBall_PT = { nullptr };
class CEffectParts* m_pFireBall_Surface = { nullptr };
class CEffectParts* m_pFireBall_Tail = { nullptr };
_float3 m_vLook = {};
_float m_fLinearSpeed = 0.3f;
_float4 m_vStartPos = { 0.f, 0.f, 0.f, 1.f };
_float4 m_vTargetPos = { 0.f, 0.f, 10.f, 1.f };
private:
class CInfoInstance* m_pInfoInstance = { nullptr };
public:
static CRanrok_FireBall* 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