[Add] 고블린 암살자 무기 추가
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include "Layer.h"
|
||||
#include "Player.h"
|
||||
#include "Goblin_Sword.h"
|
||||
#include "Goblin_Spector.h"
|
||||
#include "Goblin_Assassin_Spector.h"
|
||||
#include "Effect_Container.h"
|
||||
#include "EffectPool.h"
|
||||
#include "MapElement_Interactable.h"
|
||||
@@ -497,6 +497,7 @@ HRESULT CGoblin_Assassin::Ready_Parts()
|
||||
|
||||
Goblin_SwordDesc.pParentTransform = m_pTransformCom;
|
||||
Goblin_SwordDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_LeftHand");
|
||||
Goblin_SwordDesc.iIndex = 0;
|
||||
|
||||
if (FAILED(Add_PartObject<CGoblin_Sword>("Goblin_Sword_L", g_iStaticLevel, nullptr, &Goblin_SwordDesc)))
|
||||
{
|
||||
@@ -509,6 +510,7 @@ HRESULT CGoblin_Assassin::Ready_Parts()
|
||||
|
||||
Goblin_SwordDesc.pParentTransform = m_pTransformCom;
|
||||
Goblin_SwordDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_RightHand");
|
||||
Goblin_SwordDesc.iIndex = 1;
|
||||
|
||||
if (FAILED(Add_PartObject<CGoblin_Sword>("Goblin_Sword_R", g_iStaticLevel, nullptr, &Goblin_SwordDesc)))
|
||||
{
|
||||
@@ -517,13 +519,13 @@ HRESULT CGoblin_Assassin::Ready_Parts()
|
||||
}
|
||||
|
||||
|
||||
//CGoblin_Spector::GOBLIN_SPECTOR_DESC Goblin_SpectorDesc{};
|
||||
CGoblin_Assassin_Spector::GOBLIN_SPECTOR_DESC Goblin_SpectorDesc{};
|
||||
|
||||
//Goblin_SpectorDesc.pParentTransform = m_pTransformCom;
|
||||
Goblin_SpectorDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin_Spector>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER, &Goblin_SpectorDesc, this, &m_pGoblinSpector))) {
|
||||
// return E_FAIL;
|
||||
//}
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin_Assassin_Spector>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER, &Goblin_SpectorDesc, this, &m_pGoblinSpector))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
#pragma region EFFECT
|
||||
/* EFFECT */
|
||||
|
||||
@@ -0,0 +1,367 @@
|
||||
#include "pch.h"
|
||||
#include "Goblin_Assassin_Spector.h"
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "InfoInstance.h"
|
||||
#include "Goblin_Assassin.h"
|
||||
#include "Effect_Container.h"
|
||||
#include "Goblin_Sword.h"
|
||||
|
||||
#include "EffectParts.h"
|
||||
#include "TrailObject.h"
|
||||
|
||||
|
||||
CGoblin_Assassin_Spector::CGoblin_Assassin_Spector(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CMonster(pDevice, pContext)
|
||||
{
|
||||
}
|
||||
|
||||
CGoblin_Assassin_Spector::CGoblin_Assassin_Spector(const CGoblin_Assassin_Spector& Prototype)
|
||||
: CMonster(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Assassin_Spector::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Assassin_Spector::Initialize(void* pArg)
|
||||
{
|
||||
GOBLIN_SPECTOR_DESC* pDesc = static_cast<GOBLIN_SPECTOR_DESC*> (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_pInfoInstance->Deregist_ActiveMonster(this);
|
||||
|
||||
m_pGoblin = dynamic_cast<CGoblin_Assassin*>(m_pOwner);
|
||||
SAFE_ADDREF(m_pGoblin);
|
||||
|
||||
m_vOriginScale = m_pTransformCom->Get_Scale();
|
||||
|
||||
m_pLeftHand_BoneMat = m_pModelCom->Get_BoneMatrixPtr("SKT_LeftHand");
|
||||
m_pRightHand_BoneMat = m_pModelCom->Get_BoneMatrixPtr("SKT_RightHand");
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(5);
|
||||
m_pModelCom->Play_Animation(0, m_pTransformCom);
|
||||
|
||||
|
||||
m_bVisible = false;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CGoblin_Assassin_Spector::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CGoblin_Assassin_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_bVisible)
|
||||
{
|
||||
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<CModel>()->Get_AnimIndex());
|
||||
m_pModelCom->Set_CurrentTrackPosition(m_pGoblin->Get_Component<CModel>()->Get_CurrentTrackPosition());
|
||||
Get_PartObject<CGoblin_Sword>("Goblin_Sword_L")->Set_Visible(true);
|
||||
Get_PartObject<CGoblin_Sword>("Goblin_Sword_R")->Set_Visible(true);
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
}
|
||||
else {
|
||||
Get_PartObject<CGoblin_Sword>("Goblin_Sword_L")->Set_Visible(false);
|
||||
Get_PartObject<CGoblin_Sword>("Goblin_Sword_R")->Set_Visible(false);
|
||||
m_vScale = { 1.f,1.f,1.f };
|
||||
m_pTransformCom->Set_Scale(m_vOriginScale);
|
||||
m_pModelCom->Set_AnimationIndex(5);
|
||||
}
|
||||
|
||||
if (m_bDisolve) {
|
||||
Get_PartObject<CGoblin_Sword>("Goblin_Sword_L")->Set_Disolve(true);
|
||||
Get_PartObject<CGoblin_Sword>("Goblin_Sword_R")->Set_Disolve(true);
|
||||
m_fDisolveTime += fTimeDelta;
|
||||
if (m_fDisolveTime >= 1.f)
|
||||
{
|
||||
m_fDisolveTime = 0.f;
|
||||
m_bDisolve = false;
|
||||
m_bVisible = false;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
Describe_Entity();
|
||||
#endif // _DEBUG
|
||||
|
||||
#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);
|
||||
|
||||
|
||||
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_Component<CTransform>()->Get_XMWorldMatrix();
|
||||
|
||||
m_pLeft_Trail->Trail_Update(LeftHandMatrix * WorldMat, fTimeDelta);
|
||||
m_pRight_Trail->Trail_Update(RightHandMatrix * WorldMat, fTimeDelta);
|
||||
|
||||
#pragma endregion
|
||||
|
||||
}
|
||||
|
||||
void CGoblin_Assassin_Spector::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Assassin_Spector::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::SPECTOR);
|
||||
|
||||
if (FAILED(Render_Disolve())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pShaderCom->Bind_Matrices(
|
||||
"g_OffsetMatrix",
|
||||
m_pModelCom->Get_OffsetMatrix(i).data(),
|
||||
(_int)m_pModelCom->Get_OffsetMatrix(i).size()
|
||||
)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(iShaderPass))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pModelCom->Bind_OutPut_SRV_VS(31, 0);
|
||||
m_pModelCom->Bind_OutPut_SRV_VS_Prev(32, 0);
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
_bool bDisolve = false;
|
||||
_float zero = 0.f;
|
||||
m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool));
|
||||
m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &zero, sizeof(_float));
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CGoblin_Assassin_Spector::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CGoblin_Assassin_Spector::OnHit(CGameObject* pOther, CGameObject* pCaller)
|
||||
{
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Assassin_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<CComponent**>(&m_pModelCom)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CGoblin_Assassin_Spector::Spector_Trail_Visible(_bool isTrailVisible)
|
||||
{
|
||||
m_pLeft_Trail->Set_Visible(isTrailVisible);
|
||||
m_pRight_Trail->Set_Visible(isTrailVisible);
|
||||
|
||||
m_pLeft_Trail->Get_Component<CTrail>()->Reset_Trail();
|
||||
m_pRight_Trail->Get_Component<CTrail>()->Reset_Trail();
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Assassin_Spector::Ready_Parts()
|
||||
{
|
||||
|
||||
{
|
||||
CGoblin_Sword::GOBLIN_SWORD_DESC Goblin_SwordDesc{};
|
||||
|
||||
Goblin_SwordDesc.pParentTransform = m_pTransformCom;
|
||||
Goblin_SwordDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_LeftHand");
|
||||
Goblin_SwordDesc.iIndex = 0;
|
||||
|
||||
if (FAILED(Add_PartObject<CGoblin_Sword>("Goblin_Sword_L", g_iStaticLevel, nullptr, &Goblin_SwordDesc)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
CGoblin_Sword::GOBLIN_SWORD_DESC Goblin_SwordDesc{};
|
||||
|
||||
Goblin_SwordDesc.pParentTransform = m_pTransformCom;
|
||||
Goblin_SwordDesc.pSocketMatrices = m_pModelCom->Get_BoneMatrixPtr("SKT_RightHand");
|
||||
Goblin_SwordDesc.iIndex = 1;
|
||||
|
||||
if (FAILED(Add_PartObject<CGoblin_Sword>("Goblin_Sword_R", g_iStaticLevel, nullptr, &Goblin_SwordDesc)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
CPartObject::PARTOBJECT_DESC PartsDesc{};
|
||||
|
||||
PartsDesc.pParentTransform = m_pTransformCom;
|
||||
|
||||
if (FAILED(Add_PartObject<CTrailObject>("Left_Trail", g_iStaticLevel, &m_pLeft_Trail, &PartsDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pLeft_Trail->Load_Trail("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Trail_R", static_cast<LEVEL>(g_iStaticLevel));
|
||||
m_pLeft_Trail->Set_Visible(false);
|
||||
|
||||
if (FAILED(Add_PartObject<CTrailObject>("Right_Trail", g_iStaticLevel, &m_pRight_Trail, &PartsDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_pRight_Trail->Load_Trail("../Bin/Resources/Data/Effect/Goblin/GoblinSide/Goblin_Trail_R", static_cast<LEVEL>(g_iStaticLevel));
|
||||
m_pRight_Trail->Set_Visible(false);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Assassin_Spector::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_PrevWorldMatrix", m_pTransformCom->Get_PrevWorldMatrixPtr()))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevViewMatrix", D3DTS::VIEW))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_PrevMatrix(m_pShaderCom, "g_PrevProjMatrix", D3DTS::PROJ))) {
|
||||
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_Assassin_Spector* CGoblin_Assassin_Spector::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CGoblin_Assassin_Spector* pInstance = new CGoblin_Assassin_Spector(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CGoblin_Assassin_Spector");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
CGameObject* CGoblin_Assassin_Spector::Clone(void* pArg, CGameObject* pOwner)
|
||||
{
|
||||
CGoblin_Assassin_Spector* pInstance = new CGoblin_Assassin_Spector(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CGoblin_Assassin_Spector");
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CGoblin_Assassin_Spector::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
|
||||
SAFE_RELEASE(m_pGoblin);
|
||||
SAFE_RELEASE(m_pLeft_Trail);
|
||||
SAFE_RELEASE(m_pRight_Trail);
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CGoblin_Assassin_Spector::Describe_Entity()
|
||||
{
|
||||
GUI::Begin("UNIT", 0, IMGUI_GLOBAL_BEGIN_FLAG);
|
||||
GUI::PushItemWidth(80);
|
||||
if (GUI::CollapsingHeader("GoblinSpector")) {
|
||||
_float3 vScale = m_pTransformCom->Get_Scale();
|
||||
GUI::DragFloat3("Scale", (_float*)&vScale);
|
||||
}
|
||||
GUI::End();
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
@@ -3,12 +3,11 @@
|
||||
#include "InfoInstance.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Player.h"
|
||||
#include "Goblin_Dagger.h"
|
||||
#include "Goblin_Spector.h"
|
||||
#include "Goblin_Assassin_Spector.h"
|
||||
#include "EffectParts.h"
|
||||
|
||||
#include "EffectPool.h"
|
||||
#include "Goblin_BattleAxe.h"
|
||||
#include "Goblin_Sword.h"
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Idle.h"
|
||||
@@ -252,8 +251,31 @@ void CGoblin_Assassin::Behavior_SlashEnter()
|
||||
m_pFSM->Enable_State(FSMSTATE::SLASH);
|
||||
|
||||
pairAnimInfo = m_Animation[STATEANIM::SLASH];
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second,1.5f);
|
||||
m_fSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::SLASH)] = m_fMaxSkillCoolTime[ENUM_CLASS(GOBLIN_ASSASSIN_SKILL::SLASH)];
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() {
|
||||
m_pGoblinSpector->Set_Visible(true);
|
||||
m_pGoblinSpector->Spector_Trail_Visible(true);
|
||||
|
||||
m_pEffectPool->Use_Skill(SKILL_TYPE::GOBLIN_ATTACK, m_pGoblinSpector->Get_PartObject<CGoblin_Sword>(), (void*)&m_pGoblinSpector->Get_PartObject<CGoblin_Sword>()->Get_SwordMatrix());
|
||||
},
|
||||
0.05f);
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() {
|
||||
m_pGoblinSpector->Set_Disolve(true); },
|
||||
0.28f);
|
||||
|
||||
Add_Event(pairAnimInfo.first,
|
||||
[this]() {
|
||||
m_bLookAt = false; },
|
||||
0.3f);
|
||||
|
||||
Set_Easing(pairAnimInfo.first, 0.01f, 0.15f, 0.8f);
|
||||
|
||||
Set_Easing(pairAnimInfo.first, 0.15f, 0.4f, 1.4f);
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Assassin::Behavior_SlashExitCheck(_float fTimeDelta)
|
||||
@@ -270,6 +292,7 @@ HRESULT CGoblin_Assassin::Behavior_SlashExitCheck(_float fTimeDelta)
|
||||
void CGoblin_Assassin::Behavior_SlashExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::SLASH);
|
||||
m_bLookAt = true;
|
||||
}
|
||||
|
||||
void CGoblin_Assassin::Behavior_DashEnter()
|
||||
|
||||
@@ -66,12 +66,8 @@ void CGoblin_Attack::Update(_float fTimeDelta)
|
||||
Update_Event(fTimeDelta);
|
||||
|
||||
|
||||
CGoblin_BattleAxe* pAxe = static_cast<CGoblin_BattleAxe*>(m_pOwner);
|
||||
|
||||
_float4x4 AxeMat = pAxe->Get_AxeMatrix();
|
||||
|
||||
m_pPT1->Get_Component<CTransform>()->Set_WorldMatrix(XMLoadFloat4x4(&AxeMat));
|
||||
m_pPT2->Get_Component<CTransform>()->Set_WorldMatrix(XMLoadFloat4x4(&AxeMat));
|
||||
m_pPT1->Get_Component<CTransform>()->Set_WorldMatrix(XMLoadFloat4x4(&m_vMat));
|
||||
m_pPT2->Get_Component<CTransform>()->Set_WorldMatrix(XMLoadFloat4x4(&m_vMat));
|
||||
|
||||
|
||||
}
|
||||
@@ -90,13 +86,18 @@ HRESULT CGoblin_Attack::Pre_Setting(CGameObject* pObject, void* pArg)
|
||||
{
|
||||
if (FAILED(__super::Pre_Setting(pObject, nullptr)))
|
||||
return E_FAIL;
|
||||
|
||||
CGoblin_BattleAxe* pAxe = static_cast<CGoblin_BattleAxe*>(m_pOwner);
|
||||
|
||||
_float4x4 AxeMat = pAxe->Get_AxeMatrix();
|
||||
//
|
||||
//CGoblin_BattleAxe* pAxe = static_cast<CGoblin_BattleAxe*>(m_pOwner);
|
||||
//
|
||||
//_float4x4 AxeMat = pAxe->Get_AxeMatrix();
|
||||
|
||||
m_pPT1->Get_Component<CTransform>()->Set_WorldMatrix(XMLoadFloat4x4(&AxeMat));
|
||||
m_pPT2->Get_Component<CTransform>()->Set_WorldMatrix(XMLoadFloat4x4(&AxeMat));
|
||||
m_vMat = *static_cast<_float4x4*>(pArg);
|
||||
|
||||
//m_pPT1->Get_Component<CTransform>()->Set_WorldMatrix(XMLoadFloat4x4(&AxeMat));
|
||||
//m_pPT2->Get_Component<CTransform>()->Set_WorldMatrix(XMLoadFloat4x4(&AxeMat));
|
||||
|
||||
m_pPT1->Get_Component<CTransform>()->Set_WorldMatrix(XMLoadFloat4x4(&m_vMat));
|
||||
m_pPT2->Get_Component<CTransform>()->Set_WorldMatrix(XMLoadFloat4x4(&m_vMat));
|
||||
|
||||
m_pPT1->Set_Visible(true);
|
||||
m_pPT2->Set_Visible(true);
|
||||
|
||||
@@ -265,7 +265,7 @@ void CGoblin::Behavior_SwingEnter()
|
||||
m_pGoblinSpector->Set_Visible(true);
|
||||
m_pGoblinSpector->Spector_Trail_Visible(true);
|
||||
|
||||
m_pEffectPool->Use_Skill(SKILL_TYPE::GOBLIN_ATTACK, m_pGoblinSpector->Get_PartObject<CGoblin_BattleAxe>());
|
||||
m_pEffectPool->Use_Skill(SKILL_TYPE::GOBLIN_ATTACK, m_pGoblinSpector->Get_PartObject<CGoblin_BattleAxe>(), (void*)&m_pGoblinSpector->Get_PartObject<CGoblin_BattleAxe>()->Get_AxeMatrix());
|
||||
},
|
||||
0.05f);
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ HRESULT CGoblin_Sword::Initialize(void* pArg)
|
||||
{
|
||||
GOBLIN_SWORD_DESC* pDesc = static_cast<GOBLIN_SWORD_DESC*> (pArg);
|
||||
m_pSocketMatrices = pDesc->pSocketMatrices;
|
||||
m_iIndex = pDesc->iIndex;
|
||||
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
@@ -49,11 +50,19 @@ void CGoblin_Sword::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CGoblin_Sword::Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bDisolve) {
|
||||
m_fDisolveTime += fTimeDelta;
|
||||
if (m_fDisolveTime >= 1.f)
|
||||
{
|
||||
m_fDisolveTime = 0.f;
|
||||
m_bDisolve = false;
|
||||
m_bVisible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void CGoblin_Sword::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pModelCom->Combined_BoneMatrix();
|
||||
XMStoreFloat4(&m_vStartPos, m_pTransformCom->Get_State(STATE::POSITION));
|
||||
|
||||
_matrix socketMatrix = {};
|
||||
@@ -65,7 +74,14 @@ void CGoblin_Sword::Late_Update(_float fTimeDelta)
|
||||
}
|
||||
|
||||
m_pTransformCom->Set_WorldMatrix(socketMatrix * XMLoadFloat4x4(m_pParentTransformCom->Get_WorldMatrixPtr()));
|
||||
Sword_Hit();
|
||||
XMStoreFloat4x4(&m_vSwordMat, XMLoadFloat4x4(m_pModelCom->Get_BoneMatrixPtr("Bone")) * m_pTransformCom->Get_XMWorldMatrix());
|
||||
if (m_bCanTakeDamage)
|
||||
{
|
||||
Sword_Hit();
|
||||
}
|
||||
else {
|
||||
m_bHit = false;
|
||||
}
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::NONBLEND, this);
|
||||
}
|
||||
|
||||
@@ -81,6 +97,10 @@ HRESULT CGoblin_Sword::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Render_Disolve())) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
@@ -89,7 +109,7 @@ HRESULT CGoblin_Sword::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_MESH::SPECTOR_WEAPON)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -98,6 +118,43 @@ HRESULT CGoblin_Sword::Render()
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
_bool bDisolve = false;
|
||||
_float zero = 0.f;
|
||||
m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool));
|
||||
m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &zero, sizeof(_float));
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CGoblin_Sword::Render_Disolve()
|
||||
{
|
||||
if (FLT_EPSILON3 * 10 < m_fDisolveTime)
|
||||
{
|
||||
_bool bDisolve = true;
|
||||
_float fDisolveAmount = 0.1f;
|
||||
_float fDisolveEdgeWidth = 0.1f;
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_bDisolve", &bDisolve, sizeof(_bool)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveRatio", &m_fDisolveTime, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveAmount", &fDisolveAmount, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fDisolveEdgeWidth", &fDisolveEdgeWidth, sizeof(_float)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_GlobalSRV(m_pShaderCom, TEXT("GLOBAL_DISOLVE_NOISE_05"), "g_DeadDisolveTexture"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pGameInstance->Bind_GlobalSRV(m_pShaderCom, TEXT("GLOBAL_DISOLVE_BURN_VERTICAL"), "g_DisolveTexture"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -113,8 +170,16 @@ HRESULT CGoblin_Sword::Ready_Components()
|
||||
__super::Ready_Components(&Desc);
|
||||
|
||||
|
||||
if (m_iIndex == 0)
|
||||
{
|
||||
m_strModelPrototypeTag = TEXT("Prototype_Component_Goblin_Sword_L_Model");
|
||||
}
|
||||
else {
|
||||
m_strModelPrototypeTag = TEXT("Prototype_Component_Goblin_Sword_R_Model");
|
||||
}
|
||||
|
||||
/* Com_Model */
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Goblin_Sword_Model"),
|
||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
|
||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||
return E_FAIL;
|
||||
|
||||
@@ -203,6 +268,8 @@ void CGoblin_Sword::Sword_Hit()
|
||||
case Engine::PXOBJECT::PLAYER:
|
||||
{
|
||||
pUserData->pOwner->OnCollision(this, &tagCollInfo);
|
||||
m_bHit = true;
|
||||
m_bCanTakeDamage = false;
|
||||
}
|
||||
break;
|
||||
case Engine::PXOBJECT::ALLY_HITBOX:
|
||||
|
||||
@@ -762,6 +762,13 @@ HRESULT CLevel_GamePlay::Ready_Layer_Monster()
|
||||
}
|
||||
}
|
||||
|
||||
for (_uint i = 0; i < 1; ++i)
|
||||
{
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin_Assassin>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTroll>(g_iStaticLevel, NEXT_LEVEL, LAYER_MONSTER))) {
|
||||
return E_FAIL;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "Goblin_Mage.h"
|
||||
#include "Goblin_Assassin.h"
|
||||
#include "Goblin_Spector.h"
|
||||
#include "Goblin_Assassin_Spector.h"
|
||||
#include "Troll.h"
|
||||
#include "NPC_Ollivander.h"
|
||||
#include "NPC_EleazarFig.h"
|
||||
@@ -1923,8 +1924,12 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
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_Sword_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity()))))
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Sword_L_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword_L.bin", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Sword_R_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Goblin_Sword/SK_WPN_GOB_SmallSword_R.bin", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_BattleAxe_Model"),
|
||||
@@ -2818,6 +2823,10 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CGoblin_Spector>(g_iStaticLevel, CGoblin_Spector::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Goblin_Assassin_Spector */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CGoblin_Assassin_Spector>(g_iStaticLevel, CGoblin_Assassin_Spector::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_GameObject_Troll */
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CTroll>(g_iStaticLevel, CTroll::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
Reference in New Issue
Block a user