From deb3b3a5455454fd830f6eb48789ecf6d86e0d3d Mon Sep 17 00:00:00 2001 From: qordlsgur <127704460+qordlsgur@users.noreply.github.com> Date: Tue, 6 Jan 2026 22:49:24 +0900 Subject: [PATCH] =?UTF-8?q?[Modify]=20npc=20=ED=8F=B0=ED=8A=B8=20=EC=88=98?= =?UTF-8?q?=EC=A0=95=20=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Client/Private/Dialogue_Data.cpp | 14 +- .../Client/Private/Dialogue_Font.cpp | 130 ++++++++++++++---- .../Client/Private/InfoInstance.cpp | 5 +- .../Client/Private/Level_Field.cpp | 11 ++ .../Client/Private/Level_GamePlay.cpp | 12 ++ Jusin154_Team3D/Client/Private/RandomNpc.cpp | 38 ++++- Jusin154_Team3D/Client/Private/Ride_Info.cpp | 1 + .../Client/Private/Ride_InfoBG.cpp | 1 + Jusin154_Team3D/Client/Private/UI_Manager.cpp | 47 +++++-- Jusin154_Team3D/Client/Public/Client_Enum.h | 4 +- Jusin154_Team3D/Client/Public/Client_Struct.h | 14 +- Jusin154_Team3D/Client/Public/Dialogue_Data.h | 4 +- Jusin154_Team3D/Client/Public/Dialogue_Font.h | 17 ++- Jusin154_Team3D/Client/Public/InfoInstance.h | 2 +- Jusin154_Team3D/Client/Public/Level_Field.h | 3 + .../Client/Public/Level_GamePlay.h | 4 + Jusin154_Team3D/Client/Public/RandomNpc.h | 9 ++ Jusin154_Team3D/Client/Public/UI_Manager.h | 3 + .../Bin/Resources/Data/Dialogue/Dialogue.xml | 50 ++++--- .../Bin/Resources/Data/Stat/NpcStat.xml | 2 +- 20 files changed, 295 insertions(+), 76 deletions(-) diff --git a/Jusin154_Team3D/Client/Private/Dialogue_Data.cpp b/Jusin154_Team3D/Client/Private/Dialogue_Data.cpp index f71bc98f4..429aa7acb 100644 --- a/Jusin154_Team3D/Client/Private/Dialogue_Data.cpp +++ b/Jusin154_Team3D/Client/Private/Dialogue_Data.cpp @@ -44,9 +44,7 @@ HRESULT CDialogue_Data::Load_SpellInfo(const _char* pFilePath) DialogueInfo line{}; pLine->QueryIntAttribute("ID", &line.iLineID); - int type = 0; - pLine->QueryIntAttribute("Type", &type); - line.bType = (type == 1); + pLine->QueryIntAttribute("Type", &line.iTextType); const char* text = pLine->Attribute("Text"); if (text) line.pText = CMyTools::ToWstring(text); @@ -81,7 +79,7 @@ HRESULT CDialogue_Data::Load_SpellInfo(const _char* pFilePath) return S_OK; } -const NPCDIALOGUEINFO& CDialogue_Data::Get_Info(_wstring NpcName) const +const CURRENTDIALOGUEINFO& CDialogue_Data::Get_Info(_wstring NpcName, _int iTextID) const { auto iter = m_DialogueInfo.find(NpcName); if (iter == m_DialogueInfo.end()) @@ -89,7 +87,13 @@ const NPCDIALOGUEINFO& CDialogue_Data::Get_Info(_wstring NpcName) const return Dummy; } - return iter->second; + auto Text = iter->second.Info.find(iTextID); + if (iter == m_DialogueInfo.end()) + { + return Dummy; + } + + return Text->second; } CDialogue_Data* CDialogue_Data::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) diff --git a/Jusin154_Team3D/Client/Private/Dialogue_Font.cpp b/Jusin154_Team3D/Client/Private/Dialogue_Font.cpp index 6ce9e85f9..e009ecd06 100644 --- a/Jusin154_Team3D/Client/Private/Dialogue_Font.cpp +++ b/Jusin154_Team3D/Client/Private/Dialogue_Font.cpp @@ -23,7 +23,6 @@ HRESULT CDialogue_Font::Initialize_Prototype() HRESULT CDialogue_Font::Initialize(void* pArg) { m_pInfoInstance->Add_Event(TEXT("Dialogue"), [this](void* p) {this->Add_Text(p); }); - m_pInfoInstance->Add_Event(TEXT("NpcInteract"), [this](void* p) {this->NpcInteract(*reinterpret_cast<_bool*>(p)); }); m_pInfoInstance->Add_Event(TEXT("NPCInteractionOn"), [this](void* p) {this->NpcInfo(p); }); @@ -46,35 +45,53 @@ void CDialogue_Font::Priority_Update(_float fTimeDelta) void CDialogue_Font::Update(_float fTimeDelta) { - if (!m_pCurrentDialogue.empty()) - { - for (auto it = m_pCurrentDialogue.begin(); it != m_pCurrentDialogue.end();) - { - if ((*it)->Get_Hover() == false) - { - (*it)->Visible(false); - m_DialoguInfo.push_back((*it)); - it = m_pCurrentDialogue.erase(it); - } - else - { - it++; - } - } - } - - if (m_bNpcInteract != m_bCurrentInteract) - { - m_bCurrentInteract = m_bNpcInteract; - m_pInfoInstance->Get_Dialogue(m_pNpcName); - } - if (m_bNpcInteract == false) { if (m_bCurrentInteract == true) m_bCurrentInteract = false; } + if (m_bNpcInteract != m_bCurrentInteract) + { + m_bCurrentInteract = m_bNpcInteract; + NpcDialogue(); + Npc_Dialogue(m_Info); + } + + if (m_bCurrentInteract == true) + { + if (m_pGameInstance->Key_Down(DIK_RETURN)) + { + switch (m_iType) + { + case 0: + NextText(); + break; + case 1: + CHoice(); + break; + default: + break; + } + } + + if (!m_pCurrentDialogue.empty()) + { + for (auto it = m_pCurrentDialogue.begin(); it != m_pCurrentDialogue.end();) + { + if ((*it)->Get_Hover() == false) + { + (*it)->Visible(false); + m_DialoguInfo.push_back((*it)); + it = m_pCurrentDialogue.erase(it); + } + else + { + it++; + } + } + } + } } void CDialogue_Font::Late_Update(_float fTimeDelta) @@ -140,6 +157,26 @@ void CDialogue_Font::Add_Text(void* pArg) m_pCurrentDialogue.push_front(Dialogue); } +void CDialogue_Font::Npc_Dialogue(DIALOGUEINFO Info) +{ + if (m_DialoguInfo.empty() == true) + return; + + CDialogue* Dialogue = m_DialoguInfo.back(); + m_DialoguInfo.pop_back(); + + for (auto& it : m_pCurrentDialogue) + { + it->Up(); + } + + Dialogue->SizeUpdate(Info.pName, Info.pText); + Dialogue->Visible(true); + Dialogue->Set_Time(Info.fTime); + + m_pCurrentDialogue.push_front(Dialogue); +} + void CDialogue_Font::NpcInfo(void* pArg) { NPCINTERACTIONINFO* Info = reinterpret_cast(pArg); @@ -152,6 +189,51 @@ void CDialogue_Font::NpcInteract(_bool bInteract) m_bNpcInteract = bInteract; } +void CDialogue_Font::NpcDialogue() +{ + auto Info = m_pInfoInstance->Get_Dialogue(m_pNpcName, m_iTextID); + m_Info.pName = m_pNpcName; + m_Info.pText = Info.pText; + m_Info.fTime = 99999.f; + m_iType = Info.iTextType; + m_iNextID = Info.NextTextID; +} + +void CDialogue_Font::CHoice() +{ + auto Info = m_pInfoInstance->Get_Dialogue(m_pNpcName, m_iTextID); +// Info.ChoiceInfo.size(); +} + +void CDialogue_Font::Shop() +{ +} + +void CDialogue_Font::SpellLearn() +{ +} + +void CDialogue_Font::NextText() +{ + if (m_iNextID == -1) + { + m_pCurrentDialogue[0]->Set_Hover(false); + _bool Interact = false; + m_pInfoInstance->Event_CallBack(TEXT("NpcInteract"), &Interact); + } + else + { + m_pCurrentDialogue[0]->Set_Hover(false); + m_iTextID = m_iNextID; + NpcDialogue(); + Npc_Dialogue(m_Info); + if (m_iNextID == -1) + { + m_bEndText = true; + } + } +} + CDialogue_Font* CDialogue_Font::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CDialogue_Font* pInstance = new CDialogue_Font(pDevice, pContext); diff --git a/Jusin154_Team3D/Client/Private/InfoInstance.cpp b/Jusin154_Team3D/Client/Private/InfoInstance.cpp index 5a9593be4..f449b9e6a 100644 --- a/Jusin154_Team3D/Client/Private/InfoInstance.cpp +++ b/Jusin154_Team3D/Client/Private/InfoInstance.cpp @@ -36,7 +36,6 @@ void CInfoInstance::Change_Level() m_pMapInfo->Change_Level(); m_pSkillInfo->Change_Level(); m_pInteractiveInfo->Change_Level(); - UI_Event.clear(); } CStat* CInfoInstance::Get_PlayerStatPtr() @@ -344,9 +343,9 @@ _int CInfoInstance::Get_SpellLearnIndex() // m_pDialogue_Font->Add_Text(pArg); //} -const NPCDIALOGUEINFO& CInfoInstance::Get_Dialogue(_wstring NpcName) const +const CURRENTDIALOGUEINFO& CInfoInstance::Get_Dialogue(_wstring NpcName, _int iTextID) const { - return m_pDialogue_Data->Get_Info(NpcName); + return m_pDialogue_Data->Get_Info(NpcName, iTextID); } HRESULT CInfoInstance::Regist_ActiveInteractive(CMapElement_Interactable* pInteractive) diff --git a/Jusin154_Team3D/Client/Private/Level_Field.cpp b/Jusin154_Team3D/Client/Private/Level_Field.cpp index fcb69dc65..ec0c9ee54 100644 --- a/Jusin154_Team3D/Client/Private/Level_Field.cpp +++ b/Jusin154_Team3D/Client/Private/Level_Field.cpp @@ -85,6 +85,17 @@ void CLevel_Field::Update(_float fTimeDelta) return; } } + + //m_bLevel = true; + + //if (m_bLevel != m_bCurrentLevel) + //{ + // m_bCurrentLevel = m_bLevel; + // UI_STATE eState = UI_STATE::LEVELCHANGE; + // m_pInfoInstance->Event_CallBack(TEXT("Canvas_Change"), &eState); + //} + + } HRESULT CLevel_Field::Render() diff --git a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp index dfcf41450..196f1bd41 100644 --- a/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp +++ b/Jusin154_Team3D/Client/Private/Level_GamePlay.cpp @@ -119,6 +119,13 @@ HRESULT CLevel_GamePlay::Initialize(void* pArg) if(FAILED(m_pInfoInstance->Late_Initialize())) return E_FAIL; + m_bLevel = true; + if (m_bCurrentLevel != m_bLevel) + { + m_bCurrentLevel = m_bLevel; + m_pInfoInstance->Event_CallBack(TEXT("UIManagerFadeIn")); + } + return S_OK; } @@ -130,6 +137,7 @@ HRESULT CLevel_GamePlay::Initialize() void CLevel_GamePlay::Update(_float fTimeDelta) { + if (m_pGameInstance->Key_Pressing(DIK_0)) { if (m_pGameInstance->Key_Up(DIK_1)) { @@ -141,6 +149,10 @@ void CLevel_GamePlay::Update(_float fTimeDelta) if (true == m_pGameInstance->Check_LevelShouldChange()) { m_pInfoInstance->Change_Level(); + + UI_STATE eState = UI_STATE::LEVELCHANGE; + m_pInfoInstance->Event_CallBack(TEXT("Canvas_Change"),&eState); + if (FAILED(m_pGameInstance->Change_Level(CLevel_Loading::Create(m_pDevice, m_pContext, LEVEL::LOADING, LEVEL::FIELD)))) { return; } diff --git a/Jusin154_Team3D/Client/Private/RandomNpc.cpp b/Jusin154_Team3D/Client/Private/RandomNpc.cpp index 3e8acb8fa..778e873dd 100644 --- a/Jusin154_Team3D/Client/Private/RandomNpc.cpp +++ b/Jusin154_Team3D/Client/Private/RandomNpc.cpp @@ -57,7 +57,7 @@ void CRandomNpc::Priority_Update(_float fTimeDelta) m_iEntered = 0; } __super::Priority_Update(fTimeDelta); -} +} void CRandomNpc::Update(_float fTimeDelta) { @@ -76,6 +76,21 @@ void CRandomNpc::Update(_float fTimeDelta) m_pRigidBody->Set_Position(m_pTransformCom->Get_State(STATE::POSITION), true); m_pInfoInstance->Set_PlayerPos(m_pTransformCom->Get_State(STATE::POSITION)); + + _vector vCurrentPos = Get_WorldPostion(); + pair pairTarget = m_pInfoInstance->Get_NearestPlayerAlly(vCurrentPos); + if (nullptr != pairTarget.first) { + Set_Target(*pairTarget.first, *pairTarget.second); + } + if (nullptr != m_pTarget && m_pTarget->isDead()) { + SAFE_RELEASE(m_pTarget); + m_fTargetDistance = { FLT_MAX }; + } + + if (m_fTargetDistance <= 5.f) + { + _int a = 10; + } } void CRandomNpc::Late_Update(_float fTimeDelta) @@ -86,6 +101,7 @@ void CRandomNpc::Late_Update(_float fTimeDelta) Set_Shadow(m_pGameInstance->IsIn_ShadowViewFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())); + __super::Late_Update(fTimeDelta); } @@ -183,6 +199,25 @@ _wstring CRandomNpc::Get_Name() return m_pNpcStat->Get_Stat().pNpc_Name; } +_wstring CRandomNpc::Get_NpcName() +{ + return m_pNpcStat->Get_Stat().pName; +} + +void CRandomNpc::Set_Target(CUnit& pTarget, CTransform& pTransform) +{ + SAFE_RELEASE(m_pTarget); + m_pTarget = &pTarget; + SAFE_ADDREF(m_pTarget); + + _vector vTargetPos = pTransform.Get_State(STATE::POSITION); + _vector vToTargetDir = vTargetPos - Get_WorldPostion(); + XMStoreFloat4(&m_vTargetPos, vTargetPos); + XMStoreFloat3(&m_vToTargetDir, XMVector3Normalize(vToTargetDir)); + m_fTargetDistance = XMVectorGetX(XMVector3Length(vToTargetDir)); +} + + HRESULT CRandomNpc::Bind_ShaderResources() { if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) { @@ -408,6 +443,7 @@ void CRandomNpc::Free() SAFE_RELEASE(m_pCharacter_Controller); SAFE_RELEASE(m_pNpcStat); SAFE_RELEASE(m_pRigidBody); + SAFE_RELEASE(m_pTarget); if (nullptr != m_pInfoInstance) { CInfoInstance* pInfo = m_pInfoInstance; m_pInfoInstance = nullptr; diff --git a/Jusin154_Team3D/Client/Private/Ride_Info.cpp b/Jusin154_Team3D/Client/Private/Ride_Info.cpp index 3a960bd86..149771879 100644 --- a/Jusin154_Team3D/Client/Private/Ride_Info.cpp +++ b/Jusin154_Team3D/Client/Private/Ride_Info.cpp @@ -64,6 +64,7 @@ void CRide_Info::Set_Hover(_bool bVisible) m_bHover = true; m_fTime = 0.f; m_fAlpha = 1.f; + m_bFadeOut = false; } void CRide_Info::Priority_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Private/Ride_InfoBG.cpp b/Jusin154_Team3D/Client/Private/Ride_InfoBG.cpp index 18569970b..4c9b7bfc9 100644 --- a/Jusin154_Team3D/Client/Private/Ride_InfoBG.cpp +++ b/Jusin154_Team3D/Client/Private/Ride_InfoBG.cpp @@ -49,6 +49,7 @@ void CRide_InfoBG::Set_Hover(_bool bVisible) m_bHover = true; m_fTime = 0.f; m_fAlpha = 1.f; + m_bFadeOut = false; } void CRide_InfoBG::Priority_Update(_float fTimeDelta) diff --git a/Jusin154_Team3D/Client/Private/UI_Manager.cpp b/Jusin154_Team3D/Client/Private/UI_Manager.cpp index 4d45f7164..5b689b58c 100644 --- a/Jusin154_Team3D/Client/Private/UI_Manager.cpp +++ b/Jusin154_Team3D/Client/Private/UI_Manager.cpp @@ -59,6 +59,7 @@ HRESULT CUI_Manager::Initialize(void* pArg) m_pInfoInstance->Set_UISTATE(m_eType); m_pInfoInstance->Add_Event(TEXT("Canvas_Change"), [this](void* p) {this->Canvas_Change(*reinterpret_cast(p)); }); m_pInfoInstance->Add_Event(TEXT("NpcInteract"), [this](void* p) {this->NpcInteract(*reinterpret_cast<_bool*>(p)); }); + m_pInfoInstance->Add_Event(TEXT("UIManagerFadeIn"), [this](void* p) {this->Set_Fade(); }); return S_OK; } @@ -77,8 +78,6 @@ void CUI_Manager::Canvas_Change(UI_STATE eType) static_cast(m_pSpellLearn_Canvas)->Visible(false); static_cast(m_pInteraction_Key)->Set_Visible(true); static_cast(m_pNPCInteraction)->Set_Visible(true); - static_cast(m_pBroom_TargetGate)->Set_Visible(true); - static_cast(m_pDamage_Font)->Set_Visible(true); break; case UI_STATE::SPELL: @@ -118,6 +117,19 @@ void CUI_Manager::Canvas_Change(UI_STATE eType) static_cast(m_pDamage_Font)->Set_Visible(false); break; + case UI_STATE::LEVELCHANGE: + m_pMouse_Cursor->Set_Visible(false); + m_pCamera_LockOn->Set_Visible(false); + static_cast(m_pGamePlay_Canves)->Visible(false); + static_cast(m_pSpell_Canvas)->Visible(false); + static_cast(m_pQuest_Canvas)->Visible(false); + static_cast(m_pSpellLearn_Canvas)->Visible(false); + static_cast(m_pInteraction_Key)->Set_Visible(false); + static_cast(m_pNPCInteraction)->Set_Visible(false); + static_cast(m_pBroom_TargetGate)->Set_Visible(false); + static_cast(m_pDamage_Font)->Set_Visible(false); + break; + default: return; } @@ -206,21 +218,26 @@ void CUI_Manager::Update(_float fTimeDelta) if (m_eType == UI_STATE::GAMEPLAYER && m_bNPCInteract == true) { + if (m_bCurrentNPCInteract != m_bNPCInteract) + m_bCurrentNPCInteract = m_bNPCInteract; + if (m_eType == UI_STATE::GAMEPLAYER) { Canvas_Change(UI_STATE::NPC_INTERACT); } + } - else + if (m_bCurrentNPCInteract == true && m_bNPCInteract == false) + { + m_bCurrentNPCInteract = m_bNPCInteract; + + if (m_bActive == false) { - if (m_bActive == false) + m_bActive = true; + m_bAlphaZero = true; + if (m_eType == UI_STATE::NPC_INTERACT) { - m_bActive = true; - m_bAlphaZero = true; - if (m_eType == UI_STATE::GAMEPLAYER) - { - m_eType = UI_STATE::NPC_INTERACT; - } + m_eType = UI_STATE::GAMEPLAYER; } } } @@ -400,7 +417,7 @@ HRESULT CUI_Manager::Ready_Components(void* pArg) } Add_Canvas(TEXT("NPCInteraction"), m_pNPCInteraction); - if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, g_iStaticLevel, LAYER_UI, nullptr, this, reinterpret_cast (&m_pBroom_TargetGate)))) + if (FAILED(m_pGameInstance->Add_GameObject_ToLayer(g_iStaticLevel, NEXT_LEVEL, LAYER_UI, nullptr, this, reinterpret_cast (&m_pBroom_TargetGate)))) { return E_FAIL; } @@ -441,6 +458,14 @@ void CUI_Manager::NpcInteract(_bool bInteract) m_bNPCInteract = bInteract; } +void CUI_Manager::Set_Fade() +{ + m_fAlpha = 1.5f; + m_bActive = true; + m_bHover = true; + m_bCgangede = true; +} + CUI_Manager* CUI_Manager::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext) { CUI_Manager* pInstance = new CUI_Manager(pDevice, pContext); diff --git a/Jusin154_Team3D/Client/Public/Client_Enum.h b/Jusin154_Team3D/Client/Public/Client_Enum.h index 49bb289da..a0eddd06f 100644 --- a/Jusin154_Team3D/Client/Public/Client_Enum.h +++ b/Jusin154_Team3D/Client/Public/Client_Enum.h @@ -36,10 +36,12 @@ namespace Client PLAYER_HAIR_DAOTHV_ToSRO, PLAYER_Suit_DSRON_ToSRO, PLAYER_EyeLash_DAOTHV_ToSRO, PLAYER_Eye_ToSRO, PLAYER_Robe_ToMRO, SHADOW, SHADOW_LEGACY , END }; - enum class UI_STATE { GAMEPLAYER, SPELL, QUEST, INVENTORY, SPELLLNEARN, NPC_INTERACT, END }; + enum class UI_STATE { GAMEPLAYER, SPELL, QUEST, INVENTORY, SPELLLNEARN, + NPC_INTERACT, LEVELCHANGE, END }; enum class QUESTTYPE { MAIN, SUB, END }; enum class QUESTSTATE {NONE, ACCEPTED, CLEARED, END }; + enum class NPCTEXTTYPE {NEXTTEXT, CHOICETEXT, SHOPTEXT, QUESTTEXT, SPELLLEAN, END}; enum class EFFECT_TYPE { EFFECT, TRAIL, END }; diff --git a/Jusin154_Team3D/Client/Public/Client_Struct.h b/Jusin154_Team3D/Client/Public/Client_Struct.h index f397d777f..7fb940cb9 100644 --- a/Jusin154_Team3D/Client/Public/Client_Struct.h +++ b/Jusin154_Team3D/Client/Public/Client_Struct.h @@ -1,8 +1,8 @@ #pragma once NS_BEGIN(Engine) - class CModel; - class CRigidBody_Static; - class CUnit; +class CModel; +class CRigidBody_Static; +class CUnit; NS_END namespace Client @@ -39,7 +39,7 @@ namespace Client typedef struct DialogueChoice { - _int eType = {false}; + _int eType = { false }; _wstring pText; _int NextTypeID{}; }DIALOGUECHOICEINFO; @@ -47,7 +47,7 @@ namespace Client typedef struct DialogueInfo { _int iLineID{}; - _bool bType = {false}; + _int iTextType{}; _wstring pText; _int NextTextID{}; vector ChoiceInfo; @@ -68,7 +68,7 @@ namespace Client typedef struct tegNPCInteractionInfo { - CGameObject* pOwner = { nullptr }; + CGameObject* pOwner = { nullptr }; _wstring pNPCName; _wstring pName; _float4 fNPCPosition{}; @@ -285,7 +285,7 @@ namespace Client _float4 vPadding5 = {}; _float4 vPadding6 = {}; }EFFECT_INFO; - + typedef struct tagTrailInfo { EFFECT_TYPE eEffectType = { EFFECT_TYPE::TRAIL }; diff --git a/Jusin154_Team3D/Client/Public/Dialogue_Data.h b/Jusin154_Team3D/Client/Public/Dialogue_Data.h index 0e33c3d1e..55e6eeb8b 100644 --- a/Jusin154_Team3D/Client/Public/Dialogue_Data.h +++ b/Jusin154_Team3D/Client/Public/Dialogue_Data.h @@ -25,14 +25,14 @@ class CDialogue_Data final : public CBase HRESULT Load_SpellInfo(const _char* pFilePath); public: - const NPCDIALOGUEINFO& Get_Info(_wstring NpcName) const; + const CURRENTDIALOGUEINFO& Get_Info(_wstring NpcName, _int iTextID) const; private: CInfoInstance* m_pInfoInstance = { nullptr }; _int m_iDialogue_Count{}; map<_wstring, NPCDIALOGUEINFO> m_DialogueInfo; - NPCDIALOGUEINFO Dummy{}; + CURRENTDIALOGUEINFO Dummy{}; private: HRESULT Initialize(ID3D11Device* pDevice, ID3D11DeviceContext* pContex); diff --git a/Jusin154_Team3D/Client/Public/Dialogue_Font.h b/Jusin154_Team3D/Client/Public/Dialogue_Font.h index 0f36f010b..ec3edb0c9 100644 --- a/Jusin154_Team3D/Client/Public/Dialogue_Font.h +++ b/Jusin154_Team3D/Client/Public/Dialogue_Font.h @@ -40,23 +40,38 @@ class CDialogue_Font final : public CGameObject public: void Add_Text(void* pArg); - + void Npc_Dialogue(DIALOGUEINFO Info); private: void NpcInfo(void* pArg); void NpcInteract(_bool bInteract); + void NpcDialogue(); + + void CHoice(); + + void Shop(); + void SpellLearn(); + void NextText(); private: CInfoInstance* m_pInfoInstance = { nullptr }; class CDialogue* m_pDialogue = { nullptr }; + DIALOGUEINFO m_Info; + vector m_DialoguInfo; deque m_pCurrentDialogue; _bool m_bNpcInteract = { false }; _bool m_bCurrentInteract = { false }; + _bool m_bEndText = { false }; + _bool m_bNextText = { false }; + _wstring m_pNpcName; _int m_iTextID{}; + _int m_iNextID{}; + _int m_iType{}; + public: static CDialogue_Font* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext); diff --git a/Jusin154_Team3D/Client/Public/InfoInstance.h b/Jusin154_Team3D/Client/Public/InfoInstance.h index 4384d841c..0359aff0d 100644 --- a/Jusin154_Team3D/Client/Public/InfoInstance.h +++ b/Jusin154_Team3D/Client/Public/InfoInstance.h @@ -88,7 +88,7 @@ DECLARE_SINGLETON(CInfoInstance) #pragma endregion #pragma region Dialogue_Font //void Set_Font(void* pArg); - const NPCDIALOGUEINFO& Get_Dialogue(_wstring NpcName) const; + const CURRENTDIALOGUEINFO& Get_Dialogue(_wstring NpcName, _int iTextID) const; #pragma endregion HRESULT Regist_ActiveInteractive(class CMapElement_Interactable* pInteractive); HRESULT Deregist_ActiveInteractive(class CMapElement_Interactable* pInteractive); diff --git a/Jusin154_Team3D/Client/Public/Level_Field.h b/Jusin154_Team3D/Client/Public/Level_Field.h index 978ec5d8b..df9d3463f 100644 --- a/Jusin154_Team3D/Client/Public/Level_Field.h +++ b/Jusin154_Team3D/Client/Public/Level_Field.h @@ -19,6 +19,9 @@ class CLevel_Field final : public CLevel private: class CInfoInstance* m_pInfoInstance = { nullptr }; + _bool m_bLevel = { false }; + _bool m_bCurrentLevel = { false }; + private: virtual HRESULT Initialize() override; HRESULT Initialize(void* pArg); diff --git a/Jusin154_Team3D/Client/Public/Level_GamePlay.h b/Jusin154_Team3D/Client/Public/Level_GamePlay.h index c000598e7..18c4f67c7 100644 --- a/Jusin154_Team3D/Client/Public/Level_GamePlay.h +++ b/Jusin154_Team3D/Client/Public/Level_GamePlay.h @@ -21,6 +21,10 @@ class CLevel_GamePlay final : public CLevel class CBroomRaceManager* m_pBroomRaceManager = { nullptr }; _bool m_isDay = { true }; + + _bool m_bLevel = { false }; + _bool m_bCurrentLevel = { false }; + private: virtual HRESULT Initialize() override; HRESULT Initialize(void* pArg); diff --git a/Jusin154_Team3D/Client/Public/RandomNpc.h b/Jusin154_Team3D/Client/Public/RandomNpc.h index c3ebef544..b341a049f 100644 --- a/Jusin154_Team3D/Client/Public/RandomNpc.h +++ b/Jusin154_Team3D/Client/Public/RandomNpc.h @@ -27,6 +27,9 @@ class CRandomNpc final : public CUnit virtual void OnRayCollision(CGameObject* pCaster, _uint iCastedOrder, _float fDistance, _float3 vCastedWorldPos)override; virtual _wstring Get_Name() override; + virtual _wstring Get_NpcName() override; + + void Set_Target(CUnit& pTarget, CTransform& pTransform); protected: CInfoInstance* m_pInfoInstance = { nullptr }; CCharacter_Controller* m_pCharacter_Controller = { nullptr }; @@ -37,6 +40,12 @@ class CRandomNpc final : public CUnit CRandomNpc* m_pNPC_Ollivander = { nullptr }; /*class CNPCInteraction* m_pNPCInteraction = { nullptr };*/ + CUnit* m_pTarget = { nullptr }; + _float4 m_vTargetPos = { }; + _float3 m_vToTargetDir = { }; + _float m_fTargetDistance = { FLT_MAX }; + _float m_fDegree = {}; + _float m_fCross = {}; CNPCStat* m_pNpcStat = { nullptr }; _int m_iEntered = { 0 }; diff --git a/Jusin154_Team3D/Client/Public/UI_Manager.h b/Jusin154_Team3D/Client/Public/UI_Manager.h index 3f7fb53a7..f4e386529 100644 --- a/Jusin154_Team3D/Client/Public/UI_Manager.h +++ b/Jusin154_Team3D/Client/Public/UI_Manager.h @@ -47,6 +47,8 @@ class CUI_Manager final : public CUIObject void NpcInteract(_bool bInteract); + void Set_Fade(); + private: CInfoInstance* m_pInfoInstance = { nullptr }; CVIBuffer_Rect* m_pVIBufferCom = { nullptr }; @@ -79,6 +81,7 @@ class CUI_Manager final : public CUIObject _bool m_bSpellLearn = { false }; _bool m_bNPCInteract = { false }; + _bool m_bCurrentNPCInteract = { false }; _bool m_bAlphaZero = { false }; diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Dialogue/Dialogue.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Dialogue/Dialogue.xml index bf2fec570..f267a4f2c 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Dialogue/Dialogue.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Dialogue/Dialogue.xml @@ -1,8 +1,8 @@  - - - + + + @@ -10,19 +10,18 @@ - + - - - - + + + - - + + @@ -31,13 +30,7 @@ - - - - - - - + @@ -49,11 +42,30 @@ - + - + + + + + + + + + + + + + + + + + + + + diff --git a/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/NpcStat.xml b/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/NpcStat.xml index 0d078b45f..51f3f40ac 100644 --- a/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/NpcStat.xml +++ b/Jusin154_Team3D/Editor/Bin/Resources/Data/Stat/NpcStat.xml @@ -13,4 +13,4 @@ - \ No newline at end of file +