[add] StatSystem
This commit is contained in:
@@ -158,10 +158,10 @@
|
||||
<Filter>02.GameObjects\Cameras\Camera_Gaze</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Goblin.h">
|
||||
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Monster.h">
|
||||
<Filter>02.GameObjects\Monster</Filter>
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\MapContainer.h">
|
||||
<Filter>02.GameObjects\Environment\00.MapContainer</Filter>
|
||||
@@ -269,7 +269,7 @@
|
||||
<Filter>02.GameObjects\Effect\Effects\Lumos</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Troll.h">
|
||||
<Filter>02.GameObjects\Monster\Troll</Filter>
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Troll</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Troll_Weapon.h">
|
||||
<Filter>02.GameObjects\Item\Troll_Weapon</Filter>
|
||||
@@ -467,9 +467,6 @@
|
||||
<Filter Include="02.GameObjects\Environment\Plane">
|
||||
<UniqueIdentifier>{603938cc-e4fe-44d8-890b-784174a86161}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\NPC\Hostile\Monster">
|
||||
<UniqueIdentifier>{b72a9bb0-1b21-416b-bd0c-ba943cd7cc9d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\Prop">
|
||||
<UniqueIdentifier>{2814c935-13d9-4b9a-94ba-c9e470219a18}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -611,12 +608,6 @@
|
||||
<Filter Include="02.GameObjects\Item\Wand">
|
||||
<UniqueIdentifier>{b719d948-fce3-4144-9d2c-edcab4cfceaf}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Monster">
|
||||
<UniqueIdentifier>{d371e373-e343-4e0b-9a0c-34eae167c1cd}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Monster\Goblin">
|
||||
<UniqueIdentifier>{1ff3d6f1-f31d-47b7-84b7-d23efe98d7d2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Environment\00.MapContainer">
|
||||
<UniqueIdentifier>{e2d84a8f-46c9-4689-bd91-cc45343d2b10}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -704,9 +695,6 @@
|
||||
<Filter Include="02.GameObjects\Environment\03.MapElement\Light">
|
||||
<UniqueIdentifier>{71f6a568-488d-4ec1-be79-8fcce6677e27}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Monster\Troll">
|
||||
<UniqueIdentifier>{a1b1f17d-ed4f-4b20-aa8e-c52e693683d4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Item\Troll_Weapon">
|
||||
<UniqueIdentifier>{1d6c078d-dddd-493d-a6f0-f2cac2e4107e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -821,6 +809,15 @@
|
||||
<Filter Include="01.Levels\02.GamePlay">
|
||||
<UniqueIdentifier>{7e641382-9dfa-4da7-a8c8-a3ee06360e7a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\NPC\Hostile\Monster">
|
||||
<UniqueIdentifier>{d371e373-e343-4e0b-9a0c-34eae167c1cd}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\NPC\Hostile\Monster\Goblin">
|
||||
<UniqueIdentifier>{1ff3d6f1-f31d-47b7-84b7-d23efe98d7d2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\NPC\Hostile\Monster\Troll">
|
||||
<UniqueIdentifier>{a1b1f17d-ed4f-4b20-aa8e-c52e693683d4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Client.cpp">
|
||||
@@ -968,13 +965,13 @@
|
||||
<Filter>02.GameObjects\Cameras\Camera_Gaze</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Goblin.cpp">
|
||||
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Goblin_States.cpp">
|
||||
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Goblin</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Monster.cpp">
|
||||
<Filter>02.GameObjects\Monster</Filter>
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\BuildingContainer.cpp">
|
||||
<Filter>02.GameObjects\Environment\00.MapContainer\BuildingContainer</Filter>
|
||||
@@ -1085,10 +1082,10 @@
|
||||
<Filter>02.GameObjects\Environment\03.MapElement\Light</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Troll.cpp">
|
||||
<Filter>02.GameObjects\Monster\Troll</Filter>
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Troll</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Troll_States.cpp">
|
||||
<Filter>02.GameObjects\Monster\Troll</Filter>
|
||||
<Filter>02.GameObjects\NPC\Hostile\Monster\Troll</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Troll_Weapon.cpp">
|
||||
<Filter>02.GameObjects\Item\Troll_Weapon</Filter>
|
||||
|
||||
@@ -111,10 +111,10 @@ void CCallBack_Monster_HitReport::onControllerHit(const PSX::PxControllersHit& h
|
||||
void CCallBack_Monster_HitReport::onObstacleHit(const PSX::PxControllerObstacleHit& hit)
|
||||
{
|
||||
PSX::PxController* pController = hit.controller;
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
PSX::PxExtendedVec3 vWorldPos = hit.worldPos; // 접촉지점
|
||||
PSX::PxVec3 vWorldNormal = hit.worldNormal; // 접촉노말
|
||||
PSX::PxVec3 vDir = hit.dir; // 시도한 move 방향
|
||||
_float fLength = hit.length; // 시도한 move 길이
|
||||
|
||||
const void* pOtherController = hit.userData; // 장애물
|
||||
|
||||
|
||||
@@ -185,6 +185,9 @@ _vector CGoblin::Get_LockOnPos()
|
||||
|
||||
void CGoblin::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
{
|
||||
if (true == m_bDead) {
|
||||
return;
|
||||
}
|
||||
ON_COLLISION_INFO* CollisionDesc = static_cast<ON_COLLISION_INFO*>(pDesc);
|
||||
_vector vWorldPos = {}; // 접촉지점
|
||||
_vector vWorldNomal = {}; // 접촉노말
|
||||
@@ -207,6 +210,9 @@ void CGoblin::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
break;
|
||||
case ENUM_CLASS(SKILL_TYPE::JAP):
|
||||
m_eHitSpell = STATEANIM::HIT_LEVIOSO;
|
||||
if (true == Get_Damage(60.f)) {
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case ENUM_CLASS(SKILL_TYPE::LEVIOSO):
|
||||
m_eHitSpell = STATEANIM::HIT_LEVIOSO;
|
||||
@@ -215,8 +221,9 @@ void CGoblin::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
m_eHitSpell = STATEANIM::KNOCKDOWN_FWD;
|
||||
break;
|
||||
}
|
||||
if (!m_pFSM->IsEnable(FSMSTATE::BLINK))
|
||||
if (!m_pFSM->IsEnable(FSMSTATE::BLINK)){
|
||||
m_pFSM->Change_State(FSMSTATE::HIT);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -272,6 +279,9 @@ HRESULT CGoblin::Ready_Components()
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ HRESULT CInfoInstance::Regist_PlayerAlly(CUnit* pUnit)
|
||||
|
||||
HRESULT CInfoInstance::Deregist_PlayerAlly(CUnit* pUnit)
|
||||
{
|
||||
if (nullptr == m_pMonsterInfo) {
|
||||
if (nullptr == s_pInstance) {
|
||||
return S_OK; // 게임 종료 된 상태
|
||||
}
|
||||
return m_pMonsterInfo->Deregist_PlayerAlly(pUnit);
|
||||
@@ -60,7 +60,7 @@ HRESULT CInfoInstance::Regist_ActiveMonster(CMonster* pUnit)
|
||||
|
||||
HRESULT CInfoInstance::Deregist_ActiveMonster(CMonster* pUnit)
|
||||
{
|
||||
if (nullptr == m_pMonsterInfo) {
|
||||
if (nullptr == s_pInstance) {
|
||||
return S_OK; // 게임 종료 된 상태
|
||||
}
|
||||
return m_pMonsterInfo->Deregist_ActiveMonster(pUnit);
|
||||
|
||||
@@ -1704,6 +1704,11 @@ HRESULT CLoader::Loading_For_GamePlay()
|
||||
if (FAILED(m_pGameInstance->Add_Prototype<CTroll>(g_iStaticLevel, CTroll::Create(m_pDevice, m_pContext))))
|
||||
return E_FAIL;
|
||||
|
||||
#pragma endregion
|
||||
#pragma region STAT PROTOTYPE
|
||||
if (FAILED(Stat_FileLoad("../Bin/Resources/Data/Stat/Stat.xml"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
|
||||
@@ -1866,6 +1871,34 @@ HRESULT CLoader::Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreN
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CLoader::Stat_FileLoad(const _char* pDirectoryPath)
|
||||
{
|
||||
filesystem::path pathStatFile = pDirectoryPath;
|
||||
|
||||
tinyxml2::XMLDocument doc;
|
||||
tinyxml2::XMLError Error = doc.LoadFile(pathStatFile.string().c_str());
|
||||
if (Error != tinyxml2::XML_SUCCESS) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
tinyxml2::XMLElement* pStatInfo = doc.FirstChildElement("StatInfo");
|
||||
if (!pStatInfo) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
_uint iNumChild = pStatInfo->ChildElementCount();
|
||||
tinyxml2::XMLNode* pChild = pStatInfo->FirstChildElement();
|
||||
for (_uint i = 0; i < iNumChild; ++i) {
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, CMyTools::ToWstring(pChild->Value()),
|
||||
CStat::Create(m_pDevice, m_pContext, pChild)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
pChild = pChild->NextSiblingElement();
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
vector<FOLDER_LOAD*>* APIENTRY Deferred_FolderLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag)
|
||||
{
|
||||
if (FAILED(CoInitializeEx(nullptr, 0))) {
|
||||
|
||||
@@ -119,6 +119,15 @@ void CMonster::Set_DrawOutLine()
|
||||
m_bDrawOutLine = true;
|
||||
}
|
||||
|
||||
_bool CMonster::Get_Damage(_float fDamage)
|
||||
{
|
||||
_bool bDead = m_pStat->Get_Damage(fDamage);
|
||||
if (true == bDead) {
|
||||
m_bDead = true;
|
||||
}
|
||||
return m_bDead;
|
||||
}
|
||||
|
||||
HRESULT CMonster::Ready_Components(void*pArg)
|
||||
{
|
||||
__super::Ready_Components(pArg);
|
||||
@@ -149,6 +158,7 @@ void CMonster::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
SAFE_RELEASE(m_pStat);
|
||||
SAFE_RELEASE(m_pTarget);
|
||||
if (nullptr != m_pInfoInstance){
|
||||
CInfoInstance* pInfo = m_pInfoInstance;
|
||||
|
||||
@@ -119,14 +119,21 @@ void CNomalJap::Update(_float fTimeDelta)
|
||||
|
||||
void CNomalJap::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
if (m_bVisible == false) {
|
||||
if (false == m_bVisible) {
|
||||
return;
|
||||
}
|
||||
if (false == m_bHit) {
|
||||
SweepTarget();
|
||||
}
|
||||
Get_PartObject<CTrailObject>()->Trail_Update(m_pProjectile->Get_Component<CTransform>()->Get_XMWorldMatrix(), fTimeDelta);
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CNomalJap::SweepTarget()
|
||||
{
|
||||
_vector vStartPos = m_pProjectile->Get_WorldPostion();
|
||||
|
||||
_vector vEndPos = XMLoadFloat4(&m_vTargetPos);
|
||||
|
||||
_vector vDir = { vEndPos - vStartPos };
|
||||
|
||||
_float fDistance = XMVectorGetX(XMVector3Length(vEndPos - vStartPos));
|
||||
@@ -154,11 +161,13 @@ void CNomalJap::Late_Update(_float fTimeDelta)
|
||||
case PXOBJECT::GOBLIN_WARRIOR:
|
||||
{
|
||||
pUserData->pOwner->OnCollision(this);
|
||||
m_bHit = true;
|
||||
}
|
||||
break;
|
||||
break;
|
||||
case PXOBJECT::TROLL:
|
||||
{
|
||||
pUserData->pOwner->OnCollision(this);
|
||||
m_bHit = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -166,11 +175,6 @@ void CNomalJap::Late_Update(_float fTimeDelta)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Get_PartObject<CTrailObject>()->Trail_Update(m_pProjectile->Get_Component<CTransform>()->Get_XMWorldMatrix(), fTimeDelta);
|
||||
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
HRESULT CNomalJap::Pre_Setting(CGameObject* pObject, void* pArg)
|
||||
@@ -186,7 +190,6 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject, void* pArg)
|
||||
XMStoreFloat4(&m_vStartPos, vStartPos);
|
||||
|
||||
/* 초기 객체 위치 초기화 */
|
||||
|
||||
m_pProjectile->Get_Component<CTransform>()->Set_State(STATE::POSITION, vStartPos);
|
||||
m_pProjectile_Side->Get_Component<CTransform>()->Set_State(STATE::POSITION, vStartPos);
|
||||
|
||||
@@ -213,7 +216,7 @@ 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());
|
||||
@@ -222,8 +225,6 @@ HRESULT CNomalJap::Pre_Setting(CGameObject* pObject, void* pArg)
|
||||
XMStoreFloat4(&m_vTargetPos, vStartPos + vDirection * m_fLinearSpeed * 0.5f);
|
||||
}
|
||||
XMStoreFloat3(&m_vCameraLook, XMVector3Normalize(XMLoadFloat4(&m_vTargetPos) - XMLoadFloat4(&m_vStartPos)));
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
// 타겟이 없다면 현재위치 -> 카메라 룩벡터 * duration간 예상 이동거리 를 대상으로 지정
|
||||
@@ -314,11 +315,13 @@ void CNomalJap::OnCollision(CGameObject* pOther, void* pDesc)
|
||||
{
|
||||
int iIndex = CollisionCheck();
|
||||
|
||||
if (iIndex < 0)
|
||||
if (iIndex < 0){
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_isCollisionEnter == true)
|
||||
if (m_isCollisionEnter == true){
|
||||
return;
|
||||
}
|
||||
|
||||
m_isCollisionEnter = true;
|
||||
|
||||
|
||||
@@ -150,8 +150,13 @@ void CPlayer::Late_Update(_float fTimeDelta)
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
|
||||
if (nullptr != m_pLockOnMonster && false == m_pLockOnMonster->isDead()) {
|
||||
static_cast<CMonster*>(m_pLockOnMonster)->Set_DrawOutLine();
|
||||
if (nullptr != m_pLockOnMonster) {
|
||||
if (false == m_pLockOnMonster->isDead()) {
|
||||
static_cast<CMonster*>(m_pLockOnMonster)->Set_DrawOutLine();
|
||||
}
|
||||
else {
|
||||
m_pLockOnMonster = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -321,6 +326,10 @@ HRESULT CPlayer::Ready_Components()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_PLAYER"), (CComponent**)&m_pStat))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
{ // CCT
|
||||
CCharacter_Controller::Character_Controller_DESC Desc{};
|
||||
|
||||
@@ -275,6 +275,9 @@ HRESULT CTroll::Ready_Components()
|
||||
m_pGameInstance->Detach_Actor(*m_pRigidBody->Get_Actor());
|
||||
}
|
||||
|
||||
if (FAILED(Add_Asset_Component(g_iStaticLevel, TEXT("STAT_TROLL"), (CComponent**)&m_pStat))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,8 +40,10 @@ class CLoader final : public CBase
|
||||
|
||||
private:
|
||||
HRESULT Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function<HRESULT(_wstring, const _char*)> AddPrototypeEvent);
|
||||
HRESULT Stat_FileLoad(const _char* pDirectoryPath);
|
||||
future<vector<FOLDER_LOAD*>*> Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag);
|
||||
future<pair<_wstring, CModel*>*> Deferred_ModelLoad(MODEL eType, const _char* pDirectoryPath, _fmatrix PreTransform, const _tchar* pPrototypeTag);
|
||||
|
||||
public:
|
||||
static CLoader* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eNextLevelID);
|
||||
virtual void Free() override;
|
||||
|
||||
@@ -19,10 +19,12 @@ class CMonster abstract : public CUnit
|
||||
virtual HRESULT Render_OutLine() override;
|
||||
virtual void Set_DrawOutLine();
|
||||
_float4 Get_TargetPos() { return m_vTargetPos; }
|
||||
virtual _bool Get_Damage(_float fDamage);
|
||||
|
||||
protected:
|
||||
CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
CUnit* m_pTarget = { nullptr };
|
||||
CStat* m_pStat = { nullptr };
|
||||
_float4 m_vTargetPos = { };
|
||||
_float3 m_vToTargetDir = { };
|
||||
_float m_fTargetDistance = { FLT_MAX };
|
||||
|
||||
@@ -20,7 +20,6 @@ class CNomalJap final : public CEffect_Container
|
||||
virtual void Update(_float fTimeDelta) override;
|
||||
virtual void Late_Update(_float fTimeDelta) override;
|
||||
|
||||
|
||||
public:
|
||||
virtual HRESULT Pre_Setting(CGameObject* pObject , void* pArg = nullptr) override;
|
||||
|
||||
@@ -31,6 +30,7 @@ class CNomalJap final : public CEffect_Container
|
||||
HRESULT Ready_Child();
|
||||
HRESULT Bind_ShaderResources() override;
|
||||
virtual void OnCollision(CGameObject* pOther = nullptr, void* pDesc = nullptr) override;
|
||||
void SweepTarget();
|
||||
private:
|
||||
class CInfoInstance* m_pInfoInstance = { nullptr };
|
||||
_wstring m_wstrEffectName = {};
|
||||
@@ -57,6 +57,7 @@ class CNomalJap final : public CEffect_Container
|
||||
_float m_fAngularSpeed = {};
|
||||
_float m_fLinearSpeed = 35.f;
|
||||
_float m_fTimeRate = {};
|
||||
_bool m_bHit = { false };
|
||||
|
||||
/*좌우 무빙 관련 변수들*/
|
||||
_float3 m_vRotateRight = {};
|
||||
|
||||
@@ -52,6 +52,7 @@ class CPlayer final : public CUnit
|
||||
class CModel* m_pBroomModel = { nullptr };
|
||||
class CTransform* m_pBroomTransform = { nullptr };
|
||||
class CBroom* m_pBroom = { nullptr };
|
||||
CStat* m_pStat = { nullptr };
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype() override;
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<StatInfo>
|
||||
<STAT_PLAYER HP="100" MAXHP="100" MELEE="10" MAGIC="10" DEFENSE="10" SPEED="10" AGILITY="10" LEVEL="1" EXPERIENCE="10" MAX_EXPERIENCE="100" GOLD="4000"/>
|
||||
<STAT_GOBLIN HP="100" MAXHP="100" MELEE="10" MAGIC="10" DEFENSE="10" SPEED="10" AGILITY="10" LEVEL="1" EXPERIENCE="10" MAX_EXPERIENCE="100" GOLD="4000"/>
|
||||
<STAT_TROLL HP="100" MAXHP="100" MELEE="10" MAGIC="10" DEFENSE="10" SPEED="10" AGILITY="10" LEVEL="1" EXPERIENCE="10" MAX_EXPERIENCE="100" GOLD="4000"/>
|
||||
</StatInfo>
|
||||
@@ -234,16 +234,16 @@ PS_OUT PS_MAIN(PS_IN In)
|
||||
|
||||
float4 vMtrlDiffuse = g_DiffuseTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
float4 vSurface = g_SurfaceParamsTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_TRANSMISSION], true))
|
||||
{
|
||||
float4 vTransmission = g_TransmissionTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
vMtrlDiffuse *= vTransmission;
|
||||
}
|
||||
if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_EMISSIVE], true))
|
||||
{
|
||||
float4 vEmissive = g_EmissiveTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
vMtrlDiffuse += vEmissive;
|
||||
}
|
||||
//if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_TRANSMISSION], true))
|
||||
//{
|
||||
// float4 vTransmission = g_TransmissionTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
// vMtrlDiffuse *= vTransmission;
|
||||
//}
|
||||
//if (AlmostEqual7(g_bBinded_Texture[AI_TEXTURE_TYPE_EMISSIVE], true))
|
||||
//{
|
||||
// float4 vEmissive = g_EmissiveTexture.Sample(AnisoTropy_BLUR_Sampler, In.vTexcoord);
|
||||
// vMtrlDiffuse += vEmissive;
|
||||
//}
|
||||
if (vMtrlDiffuse.a < 0.2f)
|
||||
{
|
||||
discard;
|
||||
|
||||
@@ -300,7 +300,9 @@ call Update_Lib.bat
|
||||
<ClCompile Include="..\Private\Shader.cpp" />
|
||||
<ClCompile Include="..\Private\Shadow.cpp" />
|
||||
<ClCompile Include="..\Private\SoundSrc.cpp" />
|
||||
<ClCompile Include="..\Private\Stat.cpp" />
|
||||
<ClCompile Include="..\Private\State.cpp" />
|
||||
<ClCompile Include="..\Private\StatEvent.cpp" />
|
||||
<ClCompile Include="..\Private\Texture.cpp" />
|
||||
<ClCompile Include="..\Private\ThreadHolder.cpp" />
|
||||
<ClCompile Include="..\Private\Timer.cpp" />
|
||||
@@ -550,7 +552,9 @@ call Update_Lib.bat
|
||||
<ClInclude Include="..\Public\Shader.h" />
|
||||
<ClInclude Include="..\Public\Shadow.h" />
|
||||
<ClInclude Include="..\Public\SoundSrc.h" />
|
||||
<ClInclude Include="..\Public\Stat.h" />
|
||||
<ClInclude Include="..\Public\State.h" />
|
||||
<ClInclude Include="..\Public\StatEvent.h" />
|
||||
<ClInclude Include="..\Public\stb_image.h" />
|
||||
<ClInclude Include="..\Public\Texture.h" />
|
||||
<ClInclude Include="..\Public\ThreadHolder.h" />
|
||||
|
||||
@@ -295,6 +295,12 @@
|
||||
<Filter Include="02.Element\02.Component\09.Light">
|
||||
<UniqueIdentifier>{7c82051e-19af-4284-8156-16f504db30b6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\12.Stat">
|
||||
<UniqueIdentifier>{ea9648d8-6a9a-41d2-8b8f-ea6937017372}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.Element\02.Component\12.Stat\Event">
|
||||
<UniqueIdentifier>{b31a93a4-8bba-4e94-8008-bbb9b458a55e}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\Private\Base.cpp">
|
||||
@@ -564,6 +570,12 @@
|
||||
<ClCompile Include="..\private\Resource_Manager.cpp">
|
||||
<Filter>03.Management\02.Resource_Manager</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Stat.cpp">
|
||||
<Filter>02.Element\02.Component\12.Stat</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\StatEvent.cpp">
|
||||
<Filter>02.Element\02.Component\12.Stat\Event</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\Public\Base.h">
|
||||
@@ -1199,6 +1211,12 @@
|
||||
<ClInclude Include="..\public\Resource_Manager.h">
|
||||
<Filter>03.Management\02.Resource_Manager</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Stat.h">
|
||||
<Filter>02.Element\02.Component\12.Stat</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\StatEvent.h">
|
||||
<Filter>02.Element\02.Component\12.Stat\Event</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\Public\Assimp\color4.inl">
|
||||
|
||||
@@ -98,7 +98,6 @@ HRESULT CPrototype_Manager::Ready_StaticComponents()
|
||||
if (FAILED(Add_Prototype(g_iStaticLevel, CLight::Create(m_pDevice, m_pContext)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,128 @@
|
||||
#include "pch.h"
|
||||
#include "Stat.h"
|
||||
#include "StatEvent.h"
|
||||
|
||||
CStat::CStat(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CComponent{ pDevice, pContext }
|
||||
{
|
||||
ZeroMemory(m_StatArr, sizeof(m_StatArr));
|
||||
}
|
||||
|
||||
CStat::CStat(const CStat& rhs)
|
||||
: CComponent(rhs)
|
||||
{
|
||||
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));
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStat::Initialize(void* pArg)
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CStat* CStat::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, tinyxml2::XMLNode* pChild)
|
||||
{
|
||||
CStat* pInstance = new CStat(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype(pChild)))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CStat");
|
||||
Safe_Release(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);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CStat::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CStat::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
|
||||
_float CStat::Get_Stat(_int _iStatIndex)
|
||||
{
|
||||
return m_StatArr[_iStatIndex];
|
||||
}
|
||||
|
||||
void CStat::Set_Stat(_int _iStatIndex, _float _iAmount)
|
||||
{
|
||||
m_StatArr[_iStatIndex] = _iAmount;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
_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;
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
#include "pch.h"
|
||||
#include "StatEvent.h"
|
||||
|
||||
CStatEvent::CStatEvent(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CComponent{ pDevice, pContext }
|
||||
{
|
||||
}
|
||||
|
||||
CStatEvent::CStatEvent(const CStatEvent& Prototype)
|
||||
: CComponent(Prototype)
|
||||
{
|
||||
}
|
||||
|
||||
void CStatEvent::AddEvent(const function<void()> _Equipfunc, const function<void()> _UnEquipfunc)
|
||||
{
|
||||
if (m_EquipEventVector.size() > 6)
|
||||
return;
|
||||
|
||||
m_EquipEventVector.push_back(_Equipfunc);
|
||||
m_UnEquipEventVector.push_back(_UnEquipfunc);
|
||||
|
||||
}
|
||||
|
||||
// 팝된 속성이 어떤 속성인지 리턴함
|
||||
_uint CStatEvent::PopEvent(_uint iIndex)
|
||||
{
|
||||
vector<function<void()>> EquipEventVector = {};
|
||||
vector<function<void()>> UnEquipEventVector = {};
|
||||
vector<_uint> ActiveAbillityIDVec = {};
|
||||
|
||||
_uint iReturnStat(0);
|
||||
|
||||
EquipEventVector = move(m_EquipEventVector);
|
||||
UnEquipEventVector = move(m_UnEquipEventVector);
|
||||
ActiveAbillityIDVec = move(m_ActiveAbillityIDVec);
|
||||
|
||||
for (size_t i = 0; i < EquipEventVector.size(); i++)
|
||||
{
|
||||
if (i == iIndex)
|
||||
{
|
||||
iReturnStat = ActiveAbillityIDVec[i];
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
m_EquipEventVector.push_back(EquipEventVector[i]);
|
||||
m_UnEquipEventVector.push_back(UnEquipEventVector[i]);
|
||||
m_ActiveAbillityIDVec.push_back(ActiveAbillityIDVec[i]);
|
||||
}
|
||||
|
||||
return iReturnStat;
|
||||
}
|
||||
|
||||
HRESULT CStatEvent::Initialize_Prototype()
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT CStatEvent::Initialize(void* pArg)
|
||||
{
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CStatEvent* CStatEvent::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
{
|
||||
CStatEvent* pInstance = new CStatEvent(pDevice, pContext);
|
||||
|
||||
if (FAILED(pInstance->Initialize_Prototype()))
|
||||
{
|
||||
MSG_BOX("Failed to Created : CStatEvent");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CStatEvent::Equip()
|
||||
{
|
||||
for (auto& func : m_EquipEventVector)
|
||||
{
|
||||
func();
|
||||
}
|
||||
}
|
||||
|
||||
void CStatEvent::UnEquip()
|
||||
{
|
||||
for (auto& func : m_UnEquipEventVector)
|
||||
{
|
||||
func();
|
||||
}
|
||||
}
|
||||
|
||||
void CStatEvent::Clear()
|
||||
{
|
||||
m_EquipEventVector.clear();
|
||||
m_UnEquipEventVector.clear();
|
||||
m_ActiveAbillityIDVec.clear();
|
||||
}
|
||||
|
||||
void CStatEvent::Push_Order(_uint _iId)
|
||||
{
|
||||
m_ActiveAbillityIDVec.push_back(_iId);
|
||||
}
|
||||
|
||||
CComponent* CStatEvent::Clone(void* pArg, class CGameObject* pOwner)
|
||||
{
|
||||
CStatEvent* pInstance = new CStatEvent(*this);
|
||||
pInstance->m_pOwner = pOwner;
|
||||
if (FAILED(pInstance->Initialize(pArg)))
|
||||
{
|
||||
MSG_BOX("Failed to Cloned : CStatEvent");
|
||||
Safe_Release(pInstance);
|
||||
}
|
||||
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CStatEvent::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
#ifdef _DEBUG
|
||||
|
||||
void CStatEvent::Describe_Entity()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
@@ -9,6 +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 TEXTURE_LOAD_TYPE {
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "Cell.h"
|
||||
#include "Model.h"
|
||||
#include "Instance_Model.h"
|
||||
#include "Stat.h"
|
||||
#include "StatEvent.h"
|
||||
#include "Character_Controller.h"
|
||||
#include "Light.h"
|
||||
#include "FSM.h"
|
||||
|
||||
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include "Component.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
|
||||
class ENGINE_DLL CStat final : public CComponent
|
||||
{
|
||||
private:
|
||||
CStat(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CStat(const CStat& rhs);
|
||||
virtual ~CStat() = default;
|
||||
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype(tinyxml2::XMLNode* pChild);
|
||||
virtual HRESULT Initialize(void* pArg);
|
||||
|
||||
public:
|
||||
static CStat* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, tinyxml2::XMLNode* pChild);
|
||||
virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
public:
|
||||
_float Get_Stat(_int _iStatIndex);
|
||||
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 };
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -0,0 +1,45 @@
|
||||
#pragma once
|
||||
|
||||
#include "Component.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
|
||||
class ENGINE_DLL CStatEvent final : public CComponent
|
||||
{
|
||||
private:
|
||||
CStatEvent(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
CStatEvent(const CStatEvent& Prototype);
|
||||
virtual ~CStatEvent() = default;
|
||||
private:
|
||||
virtual HRESULT Initialize_Prototype();
|
||||
virtual HRESULT Initialize(void* pArg);
|
||||
|
||||
public:
|
||||
void AddEvent(const function<void()> _Equipfunc, const function<void()> _UnEquipfunc);
|
||||
_uint PopEvent(_uint iIndex);
|
||||
|
||||
|
||||
void Equip();
|
||||
void UnEquip();
|
||||
void Clear();
|
||||
|
||||
void Push_Order(_uint _iId);
|
||||
|
||||
public:
|
||||
static CStatEvent* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CComponent* Clone(void* pArg, class CGameObject* pOwner = nullptr) override;
|
||||
virtual void Free() override;
|
||||
#ifdef _DEBUG
|
||||
void Describe_Entity() override;
|
||||
#endif // _DEBUG
|
||||
|
||||
|
||||
|
||||
private:
|
||||
vector<function<void()>> m_EquipEventVector = {};
|
||||
vector<function<void()>> m_UnEquipEventVector = {};
|
||||
vector<_uint> m_ActiveAbillityIDVec = {};
|
||||
|
||||
};
|
||||
|
||||
NS_END
|
||||
@@ -50,6 +50,7 @@ class ENGINE_DLL CUnit abstract : public CContainerObject
|
||||
_float Get_KeyFrame(_string FrameName);
|
||||
_bool IsCurrentKeyFrame(_string FrameName);
|
||||
virtual _vector Get_LockOnPos() { return Get_WorldPostion(); }
|
||||
virtual _bool Get_Damage(_float fDamage) { return false; }
|
||||
|
||||
virtual void Reset_Sprint() {};
|
||||
virtual void Reset_Walk() {};
|
||||
@@ -60,7 +61,6 @@ class ENGINE_DLL CUnit abstract : public CContainerObject
|
||||
CModel* m_pModelCom = { nullptr };
|
||||
CFSM* m_pFSM = { nullptr };
|
||||
_wstring m_strModelPrototypeTag;
|
||||
_float2 m_vHP = { 230.f, 350.f };
|
||||
_bool m_bRimLight = { true };
|
||||
_float m_fRimLightPower = { 3.2f };
|
||||
_float m_fRimLightStrength = { 3.04f };
|
||||
|
||||
Reference in New Issue
Block a user