Merge branch 'Develope' into Effect
This commit is contained in:
@@ -23,9 +23,11 @@ float g_fOwnerAlpha;
|
||||
float g_fCanvasAlpha;
|
||||
float g_fAngle;
|
||||
float g_fCoolTime;
|
||||
float g_fHp;
|
||||
|
||||
float2 g_fOrigin_Size;
|
||||
float2 g_fCurrent_Size;
|
||||
float2 g_fHpBG;
|
||||
|
||||
float4 g_fNine_Slice;
|
||||
|
||||
@@ -461,7 +463,7 @@ PS_OUT PS_SpellAnim(PS_IN In)
|
||||
}
|
||||
}
|
||||
|
||||
if (uv.y <= CoolTime)
|
||||
if (uv.y <= CoolTime)
|
||||
{
|
||||
color.a = 0.f;
|
||||
}
|
||||
@@ -472,6 +474,79 @@ PS_OUT PS_SpellAnim(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
PS_OUT PS_HpBar(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
float Alpha = g_fAlpha * g_fOwnerAlpha * g_fCanvasAlpha;
|
||||
float4 Color = float4(1.f, 1.f, 1.f, 1.f);
|
||||
float2 uv = In.vTexcoord;
|
||||
float2 CurrentPixelPosition = uv * g_fCurrent_Size;
|
||||
float OriginLeft = g_fNine_Slice.x;
|
||||
float OriginRight = g_fNine_Slice.y;
|
||||
float OriginTop = g_fNine_Slice.z;
|
||||
float OriginBottom = g_fNine_Slice.w;
|
||||
|
||||
float CurrentLeft = OriginLeft;
|
||||
float CurrentRight = g_fCurrent_Size.x - (g_fOrigin_Size.x - OriginRight);
|
||||
float CurrentTop = OriginTop;
|
||||
float CurrentBottom = g_fCurrent_Size.y - (g_fOrigin_Size.y - OriginBottom);
|
||||
|
||||
float2 Finaluv = In.vTexcoord;
|
||||
|
||||
if (CurrentPixelPosition.x < CurrentLeft)
|
||||
{
|
||||
Finaluv.x = CurrentPixelPosition.x / g_fOrigin_Size.x;
|
||||
}
|
||||
else if (CurrentPixelPosition.x > CurrentRight)
|
||||
{
|
||||
float dist = CurrentPixelPosition.x - CurrentRight;
|
||||
Finaluv.x = (OriginRight + dist) / g_fOrigin_Size.x;
|
||||
}
|
||||
else
|
||||
{
|
||||
float scale = (CurrentPixelPosition.x - CurrentLeft) / (CurrentRight - CurrentLeft);
|
||||
Finaluv.x = (OriginLeft / g_fOrigin_Size.x) + scale * ((OriginRight - OriginLeft) / g_fOrigin_Size.x);
|
||||
}
|
||||
|
||||
if (CurrentPixelPosition.y < CurrentTop)
|
||||
{
|
||||
Finaluv.y = CurrentPixelPosition.y / g_fOrigin_Size.y;
|
||||
}
|
||||
else if (CurrentPixelPosition.y > CurrentBottom)
|
||||
{
|
||||
float dist = CurrentPixelPosition.y - CurrentBottom;
|
||||
Finaluv.y = (OriginBottom + dist) / g_fOrigin_Size.y;
|
||||
}
|
||||
else
|
||||
{
|
||||
float scale = (CurrentPixelPosition.y - CurrentTop) / (CurrentBottom - CurrentTop);
|
||||
Finaluv.y = (OriginTop / g_fOrigin_Size.y) + scale * ((OriginBottom - OriginTop) / g_fOrigin_Size.y);
|
||||
}
|
||||
|
||||
float4 tex1 = g_Texture.Sample(ClampSampler, Finaluv);
|
||||
Color = tex1;
|
||||
|
||||
float2 reversuv = In.vTexcoord;
|
||||
|
||||
reversuv.x = 1.0f - Finaluv;
|
||||
|
||||
float4 tex2 = g_Texture1.Sample(ClampSampler, Finaluv);
|
||||
|
||||
if (reversuv.x >= g_fHp)
|
||||
{
|
||||
tex2.rgb = float3(0.f, 0.f, 0.f);
|
||||
}
|
||||
|
||||
tex2.rgb *= float3(112.f, 241.f, 31.f) / 255.f;
|
||||
|
||||
if (all(Color.rgb >= float3(70.f / 255.f, 70.f / 255.f, 70.f / 255.f)))
|
||||
Color = tex2;
|
||||
|
||||
Color.a *= Alpha;
|
||||
Out.vColor = Color;
|
||||
return Out;
|
||||
}
|
||||
|
||||
technique11 PosTexTechnique11
|
||||
{
|
||||
pass Default
|
||||
@@ -603,4 +678,13 @@ technique11 PosTexTechnique11
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_SpellAnim();
|
||||
}
|
||||
pass HpBar
|
||||
{
|
||||
SetRasterizerState(RS_Default);
|
||||
SetDepthStencilState(DSS_Default, 0);
|
||||
SetBlendState(BS_AlphaBlend, float4(0.f, 0.f, 0.f, 0.f), 0xffffffff);
|
||||
VertexShader = compile vs_5_0 VS_MAIN();
|
||||
GeometryShader = NULL;
|
||||
PixelShader = compile ps_5_0 PS_HpBar();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ HWND g_hWnd;
|
||||
WCHAR szTitle[MAX_LOADSTRING];
|
||||
WCHAR szWindowClass[MAX_LOADSTRING];
|
||||
|
||||
// 이 코드 모듈에 포함된 함수의 선언을 전달합니다:
|
||||
|
||||
ATOM MyRegisterClass(HINSTANCE hInstance);
|
||||
BOOL InitInstance(HINSTANCE, int);
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
|
||||
@@ -172,10 +172,6 @@
|
||||
<ClInclude Include="..\Public\Client_Define.h" />
|
||||
<ClInclude Include="..\Public\Client_Enum.h" />
|
||||
<ClInclude Include="..\Public\Client_Macro.h" />
|
||||
<ClInclude Include="..\Public\Client_Struct.h">
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
|
||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Dummy_PhysXPlayable.h" />
|
||||
<ClInclude Include="..\Public\Dummy_PhysXWall.h" />
|
||||
<ClInclude Include="..\Public\SkyBox.h" />
|
||||
@@ -192,21 +188,13 @@
|
||||
<ClInclude Include="..\Public\MonsterInfo.h" />
|
||||
<ClInclude Include="..\Public\Player.h" />
|
||||
<ClInclude Include="..\Public\PlayerInfo.h" />
|
||||
<ClInclude Include="..\Public\State_Cast.h" />
|
||||
<ClInclude Include="..\Public\State_Combat.h" />
|
||||
<ClInclude Include="..\Public\State_Dodge.h" />
|
||||
<ClInclude Include="..\Public\State_Idle.h" />
|
||||
<ClInclude Include="..\Public\State_Idle_Turn.h" />
|
||||
<ClInclude Include="..\Public\State_Jog.h" />
|
||||
<ClInclude Include="..\Public\State_Jump.h" />
|
||||
<ClInclude Include="..\Public\State_Land.h" />
|
||||
<ClInclude Include="..\Public\State_LightAttack.h" />
|
||||
<ClInclude Include="..\Public\State_Move.h" />
|
||||
<ClInclude Include="..\Public\State_Root.h" />
|
||||
<ClInclude Include="..\Public\State_Skill.h" />
|
||||
<ClInclude Include="..\Public\State_Skill2.h" />
|
||||
<ClInclude Include="..\Public\State_Sprint.h" />
|
||||
<ClInclude Include="..\Public\State_Walk.h" />
|
||||
<ClInclude Include="..\Public\Wand.h" />
|
||||
<ClInclude Include="Client.h" />
|
||||
<ClInclude Include="framework.h" />
|
||||
@@ -246,21 +234,13 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Player.cpp" />
|
||||
<ClCompile Include="..\Private\PlayerInfo.cpp" />
|
||||
<ClCompile Include="..\Private\State_Cast.cpp" />
|
||||
<ClCompile Include="..\Private\State_Combat.cpp" />
|
||||
<ClCompile Include="..\Private\State_Dodge.cpp" />
|
||||
<ClCompile Include="..\Private\State_Idle.cpp" />
|
||||
<ClCompile Include="..\Private\State_Idle_Turn.cpp" />
|
||||
<ClCompile Include="..\Private\State_Jog.cpp" />
|
||||
<ClCompile Include="..\Private\State_Jump.cpp" />
|
||||
<ClCompile Include="..\Private\State_Land.cpp" />
|
||||
<ClCompile Include="..\Private\State_LightAttack.cpp" />
|
||||
<ClCompile Include="..\Private\State_Move.cpp" />
|
||||
<ClCompile Include="..\Private\State_Root.cpp" />
|
||||
<ClCompile Include="..\Private\State_Skill.cpp" />
|
||||
<ClCompile Include="..\Private\State_Skill2.cpp" />
|
||||
<ClCompile Include="..\Private\State_Sprint.cpp" />
|
||||
<ClCompile Include="..\Private\State_Walk.cpp" />
|
||||
<ClCompile Include="..\Private\Wand.cpp" />
|
||||
<ClCompile Include="Client.cpp" />
|
||||
</ItemGroup>
|
||||
|
||||
@@ -37,9 +37,6 @@
|
||||
<ClInclude Include="..\Public\Level_GamePlay.h">
|
||||
<Filter>01.Levels\02.GamePlay</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Client_Struct.h">
|
||||
<Filter>99.Define</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\InfoInstance.h">
|
||||
<Filter>03.InfoInstance</Filter>
|
||||
</ClInclude>
|
||||
@@ -64,66 +61,12 @@
|
||||
<ClInclude Include="..\Public\MapInfo.h">
|
||||
<Filter>03.InfoInstance\02.MapInfo</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\LoadingWidget.h">
|
||||
<Filter>02.GameObjects\UI\GamePlay_Canvas\Loding_Panel\LoadingWidget</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\GamePlay_Canvas.h">
|
||||
<Filter>02.GameObjects\UI\GamePlay_Canvas</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\Loading_Panel.h">
|
||||
<Filter>02.GameObjects\UI\GamePlay_Canvas\Loding_Panel</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Player.h">
|
||||
<ClInclude Include="..\Public\Player.h">
|
||||
<Filter>02.GameObjects\Player</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Wand.h">
|
||||
<Filter>02.GameObjects\Item\Wand</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Root.h">
|
||||
<Filter>80.State</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Combat.h">
|
||||
<Filter>80.State\State_Combat</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Cast.h">
|
||||
<Filter>80.State\State_Combat\State_Cast</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_LightAttack.h">
|
||||
<Filter>80.State\State_Combat\State_LightAttack</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Skill.h">
|
||||
<Filter>80.State\State_Combat\State_Skill</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Skill2.h">
|
||||
<Filter>80.State\State_Combat\State_Skill2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Move.h">
|
||||
<Filter>80.State\State_Move</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Idle.h">
|
||||
<Filter>80.State\State_Move\State_Idle</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Jog.h">
|
||||
<Filter>80.State\State_Move\State_Jog</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Walk.h">
|
||||
<Filter>80.State\State_Move\State_Walk</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Sprint.h">
|
||||
<Filter>80.State\State_Move\State_Sprint</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Dodge.h">
|
||||
<Filter>80.State\State_Move\State_Dodge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Idle_Turn.h">
|
||||
<Filter>80.State\State_Move\State_Idle_Turn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Jump.h">
|
||||
<Filter>80.State\State_Jump</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Land.h">
|
||||
<Filter>80.State\State_Land</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\CamPosition_Player.h">
|
||||
<Filter>02.GameObjects\Cameras\CameraPosition\Player</Filter>
|
||||
</ClInclude>
|
||||
@@ -166,6 +109,27 @@
|
||||
<ClInclude Include="..\Public\CallBack_Monster_HitReport.h">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Root.h">
|
||||
<Filter>04.Mechanic\State</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Combat.h">
|
||||
<Filter>04.Mechanic\State\State_Combat</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Dodge.h">
|
||||
<Filter>04.Mechanic\State\Focus\Dodge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Jump.h">
|
||||
<Filter>04.Mechanic\State\Focus\Jump</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Land.h">
|
||||
<Filter>04.Mechanic\State\Focus\Land</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Idle.h">
|
||||
<Filter>04.Mechanic\State\Movement\Idle</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Move.h">
|
||||
<Filter>04.Mechanic\State\Movement\Move</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Client.ico">
|
||||
@@ -233,12 +197,6 @@
|
||||
<Filter Include="04.Mechanic\State">
|
||||
<UniqueIdentifier>{1bfec6dc-f008-4d18-87d6-be38824b1272}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\NPC">
|
||||
<UniqueIdentifier>{3eb21e8e-e01c-47fe-828e-800212456eb5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\PLAYER">
|
||||
<UniqueIdentifier>{9f952e5a-835c-4de9-b7b5-9a731912774d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\Skill">
|
||||
<UniqueIdentifier>{c5b61cb3-bc5f-4429-8715-b309dcf054b2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -316,51 +274,6 @@
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\UI\GamePlay_Canvas\Loding_Panel\LoadingWidget_Flame">
|
||||
<UniqueIdentifier>{f7f22fc0-0e66-4e6e-a60a-0c612d58d802}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State">
|
||||
<UniqueIdentifier>{be963729-ed65-4506-82f2-24213f5ecf5a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat">
|
||||
<UniqueIdentifier>{fb0a8b8b-5376-4606-8e6e-b020abf2d476}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_Cast">
|
||||
<UniqueIdentifier>{5e4bd8c2-9ace-4617-880b-9c7fa826dfd4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_LightAttack">
|
||||
<UniqueIdentifier>{28b2cdcb-e307-4da5-a222-24a77480605c}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_Skill">
|
||||
<UniqueIdentifier>{8f9ce518-cd40-4a0c-ac4f-f77459a13cfd}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_Skill2">
|
||||
<UniqueIdentifier>{68ec69bb-6697-42aa-abf4-cd6d148a1648}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move">
|
||||
<UniqueIdentifier>{99f16910-04c8-44e2-84ff-17321d94d1f0}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move\State_Idle">
|
||||
<UniqueIdentifier>{e2599ab3-3d02-420c-b29c-0f87b4263429}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move\State_Jog">
|
||||
<UniqueIdentifier>{3110d3d0-422e-42eb-a045-c8c784528165}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move\State_Walk">
|
||||
<UniqueIdentifier>{cd90a5f0-2428-4537-801f-a65b7273c3be}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move\State_Sprint">
|
||||
<UniqueIdentifier>{5f5abe29-f43a-4de7-8955-b21ca1c6fb94}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move\State_Dodge">
|
||||
<UniqueIdentifier>{03cf23a9-5c0f-4cb1-a32b-5807a612c039}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move\State_Idle_Turn">
|
||||
<UniqueIdentifier>{b3fdd366-2689-49c9-b1c1-6843772e9661}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Jump">
|
||||
<UniqueIdentifier>{309d0593-507f-484c-92aa-7c8fc483941b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Land">
|
||||
<UniqueIdentifier>{a3ab0237-10b3-4699-a39d-63c625024f67}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Cameras\CameraPosition\Arm">
|
||||
<UniqueIdentifier>{f0da95a0-107f-42ff-9e77-3503bb48aa12}</UniqueIdentifier>
|
||||
@@ -389,6 +302,30 @@
|
||||
<Filter Include="02.GameObjects\PhysX\CallBack\HitReport">
|
||||
<UniqueIdentifier>{dc05dfc9-22e5-4a2a-b016-c55b215c0c68}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\Focus">
|
||||
<UniqueIdentifier>{0834c76d-83d8-4ef5-9d19-7277686d28c5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\State_Combat">
|
||||
<UniqueIdentifier>{017fc692-bac0-4635-843c-02fb59009f5b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\Movement">
|
||||
<UniqueIdentifier>{349939a0-8b9a-4a1a-8f0a-ca5014cd4e18}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\Focus\Dodge">
|
||||
<UniqueIdentifier>{5fa1e5a9-acd8-499d-90ee-9cf17441b3a5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\Focus\Jump">
|
||||
<UniqueIdentifier>{41d2e34e-5280-4b3c-961e-064484f1449d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\Focus\Land">
|
||||
<UniqueIdentifier>{1034dd61-dd17-456a-990b-628c45f74b51}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\Movement\Idle">
|
||||
<UniqueIdentifier>{2999d0c5-81e4-44d6-99b3-4801e6f84dd7}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="04.Mechanic\State\Movement\Move">
|
||||
<UniqueIdentifier>{0a3f9629-27d1-411c-806e-b550af8f1ca1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Client.cpp">
|
||||
@@ -436,66 +373,12 @@
|
||||
<ClCompile Include="..\Private\MapInfo.cpp">
|
||||
<Filter>03.InfoInstance\02.MapInfo</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\LoadingWidget.cpp">
|
||||
<Filter>02.GameObjects\UI\GamePlay_Canvas\Loding_Panel\LoadingWidget</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\GamePlay_Canvas.cpp">
|
||||
<Filter>02.GameObjects\UI\GamePlay_Canvas</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\Loading_Panel.cpp">
|
||||
<Filter>02.GameObjects\UI\GamePlay_Canvas\Loding_Panel</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Player.cpp">
|
||||
<Filter>02.GameObjects\Player</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Wand.cpp">
|
||||
<Filter>02.GameObjects\Item\Wand</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Root.cpp">
|
||||
<Filter>80.State</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Combat.cpp">
|
||||
<Filter>80.State\State_Combat</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Cast.cpp">
|
||||
<Filter>80.State\State_Combat\State_Cast</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_LightAttack.cpp">
|
||||
<Filter>80.State\State_Combat\State_LightAttack</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Skill.cpp">
|
||||
<Filter>80.State\State_Combat\State_Skill</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Skill2.cpp">
|
||||
<Filter>80.State\State_Combat\State_Skill2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Move.cpp">
|
||||
<Filter>80.State\State_Move</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Idle.cpp">
|
||||
<Filter>80.State\State_Move\State_Idle</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Jog.cpp">
|
||||
<Filter>80.State\State_Move\State_Jog</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Walk.cpp">
|
||||
<Filter>80.State\State_Move\State_Walk</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Sprint.cpp">
|
||||
<Filter>80.State\State_Move\State_Sprint</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Dodge.cpp">
|
||||
<Filter>80.State\State_Move\State_Dodge</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Idle_Turn.cpp">
|
||||
<Filter>80.State\State_Move\State_Idle_Turn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Jump.cpp">
|
||||
<Filter>80.State\State_Jump</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Land.cpp">
|
||||
<Filter>80.State\State_Land</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\CamPosition_Player.cpp">
|
||||
<Filter>02.GameObjects\Cameras\CameraPosition\Player</Filter>
|
||||
</ClCompile>
|
||||
@@ -538,6 +421,27 @@
|
||||
<ClCompile Include="..\Private\CallBack_Playable_HitReport.cpp">
|
||||
<Filter>02.GameObjects\PhysX\CallBack\HitReport</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Root.cpp">
|
||||
<Filter>04.Mechanic\State</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Combat.cpp">
|
||||
<Filter>04.Mechanic\State\State_Combat</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Dodge.cpp">
|
||||
<Filter>04.Mechanic\State\Focus\Dodge</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Jump.cpp">
|
||||
<Filter>04.Mechanic\State\Focus\Jump</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Land.cpp">
|
||||
<Filter>04.Mechanic\State\Focus\Land</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Idle.cpp">
|
||||
<Filter>04.Mechanic\State\Movement\Idle</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Move.cpp">
|
||||
<Filter>04.Mechanic\State\Movement\Move</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ResourceCompile Include="Client.rc">
|
||||
|
||||
@@ -38,9 +38,19 @@ void CBroom::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CBroom::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
m_pModelCom->ComputeAnimation();
|
||||
|
||||
m_pModelCom->ComputeSkinning();
|
||||
static _uint m_iIndex = 0;
|
||||
|
||||
if (m_pGameInstance->Key_Down(DIK_1))
|
||||
m_iIndex++;
|
||||
if (m_pGameInstance->Key_Down(DIK_2))
|
||||
m_iIndex--;
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(m_iIndex);
|
||||
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
}
|
||||
|
||||
void CBroom::Late_Update(_float fTimeDelta)
|
||||
@@ -61,6 +71,9 @@ HRESULT CBroom::Render()
|
||||
|
||||
for (_uint i = 0; i < iNumMeshes; i++)
|
||||
{
|
||||
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom))) {
|
||||
return E_FAIL;
|
||||
@@ -69,9 +82,6 @@ HRESULT CBroom::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_CS_Output(5, i)))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
|
||||
@@ -140,8 +140,8 @@ HRESULT CLevel_GamePlay::Ready_Layer_Player(const _wstring& strLayerTag)
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;
|
||||
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;*/
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -4,6 +4,10 @@
|
||||
#include "Level_Loading.h"
|
||||
#include "InfoInstance.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
NS_END
|
||||
|
||||
|
||||
#ifdef _DEBUG
|
||||
_float g_fTimeMult = 1.f;
|
||||
|
||||
@@ -12,22 +12,13 @@
|
||||
#include "Character_Controller.h"
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Root.h"
|
||||
|
||||
#include "State_Idle.h"
|
||||
#include "State_Walk.h"
|
||||
#include "State_Jog.h"
|
||||
#include "State_Sprint.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Skill.h"
|
||||
#include "State_Skill2.h"
|
||||
#include "State_LightAttack.h"
|
||||
#include "State_Land.h"
|
||||
#include "State_Cast.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#include "State_Idle_Turn.h"
|
||||
#pragma endregion
|
||||
|
||||
CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
@@ -61,13 +52,16 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
|
||||
Add_FSM();
|
||||
|
||||
Set_FSM();
|
||||
|
||||
Set_Anim();
|
||||
|
||||
Setup_InputConditions();
|
||||
{
|
||||
CFSM::FSM_DESC FSMDesc{};
|
||||
FSMDesc.pStates = &m_States;
|
||||
FSMDesc.pStateMask = &m_iStateMask;
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::ROOT);
|
||||
m_pFSM->Bind_States(FSMDesc);
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller, m_pRigidBody);
|
||||
@@ -77,20 +71,25 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
void CPlayer::Priority_Update(_float fTimeDelta)
|
||||
{
|
||||
m_pTransformCom->RewindMomentum();
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
|
||||
|
||||
__super::Priority_Update(fTimeDelta);
|
||||
}
|
||||
|
||||
void CPlayer::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pModelCom->ComputeSkinning();
|
||||
m_pModelCom->ComputeAnimation();
|
||||
|
||||
Key_Input(fTimeDelta);
|
||||
|
||||
m_pFSM->Update(fTimeDelta);
|
||||
IsSprint();
|
||||
IsWalk();
|
||||
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
|
||||
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
Describe_Entity();
|
||||
m_pCharacter_Controller->Move(fTimeDelta);
|
||||
@@ -98,6 +97,9 @@ void CPlayer::Update(_float fTimeDelta)
|
||||
|
||||
void CPlayer::Late_Update(_float fTimeDelta)
|
||||
{
|
||||
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pCharacter_Controller->Get_Position());
|
||||
|
||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||
|
||||
__super::Late_Update(fTimeDelta);
|
||||
@@ -124,9 +126,6 @@ HRESULT CPlayer::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_CS_Output(5, i)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
@@ -148,7 +147,9 @@ HRESULT CPlayer::Ready_Components()
|
||||
Desc.fRotationPerSec = XMConvertToRadians(180.0f);
|
||||
Desc.fRadius = 10.f;
|
||||
|
||||
__super::Ready_Components(&Desc);
|
||||
if (FAILED(__super::Ready_Components(&Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strModelPrototypeTag = TEXT("Prototype_Component_Npc_Model");
|
||||
|
||||
@@ -267,108 +268,386 @@ HRESULT CPlayer::Bind_ShaderResources()
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Setup_InputConditions()
|
||||
HRESULT CPlayer::InputSystem()
|
||||
{
|
||||
m_InputConditions =
|
||||
if (m_pGameInstance->Key_Down(DIK_1)
|
||||
|| m_pGameInstance->Key_Down(DIK_2)
|
||||
|| m_pGameInstance->Key_Down(DIK_3)
|
||||
|| m_pGameInstance->Key_Down(DIK_4)
|
||||
|| m_pGameInstance->Key_Down(DIK_5)
|
||||
|| m_pGameInstance->Key_Down(DIK_6))
|
||||
{
|
||||
{ FSMSTATE::IDLE_TURN, [&]() { return m_pGameInstance->Key_Down(DIK_LEFT) || m_pGameInstance->Key_Down(DIK_RIGHT) || m_pGameInstance->Key_Down(DIK_DOWN); }},
|
||||
{ FSMSTATE::MOVE, [&]() { return Check(FSMSTATE::WALK) || Check(FSMSTATE::SPRINT) || Check(FSMSTATE::JOG) ||
|
||||
Check(FSMSTATE::DODGE) || Check(FSMSTATE::IDLE_TURN); }},
|
||||
|
||||
|
||||
|
||||
{ FSMSTATE::JOG, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP)
|
||||
/*|| m_pGameInstance->Key_Pressing(DIK_DOWN)*/; }},
|
||||
{ FSMSTATE::FWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP); }},
|
||||
{ FSMSTATE::BWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_DOWN); }},
|
||||
|
||||
{ FSMSTATE::WALK, [&]() { return m_bWalkToggle && m_pGameInstance->Key_Pressing(DIK_UP); }},
|
||||
|
||||
{ FSMSTATE::SPRINT, [&]() { return m_bSprintToggle
|
||||
&& m_pGameInstance->Key_Pressing(DIK_UP); }},
|
||||
{ FSMSTATE::DODGE, [&]() { return m_pGameInstance->Key_Down(DIK_LCONTROL); }},
|
||||
|
||||
{ FSMSTATE::COMBAT, [&]() { return Check(FSMSTATE::SKILL) || Check(FSMSTATE::LIGHT_ATTACK) || Check(FSMSTATE::CAST) || Check(FSMSTATE::SKILL2); }},
|
||||
{ FSMSTATE::SKILL, [&]() { return m_pGameInstance->Key_Down(DIK_R); }},
|
||||
{ FSMSTATE::SKILL2, [&]() { return m_pGameInstance->Key_Down(DIK_Q); }},
|
||||
{ FSMSTATE::LIGHT_ATTACK,[&]() { return m_pGameInstance->Mouse_Up(DIM_LBUTTON); }},
|
||||
{ FSMSTATE::CAST, [&]() { return m_pGameInstance->Key_Down(DIK_1); }},
|
||||
|
||||
{ FSMSTATE::JUMP, [&]() { return m_pGameInstance->Key_Down(DIK_SPACE); } }
|
||||
};
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Key_Input(_float fTimeDelta)
|
||||
HRESULT CPlayer::InputSkill()
|
||||
{
|
||||
if (m_pFSM->Get_CurrState() == FSMSTATE::WALK ||
|
||||
m_pFSM->Get_CurrState() == FSMSTATE::SPRINT||
|
||||
m_pFSM->Get_CurrState() == FSMSTATE::DODGE||
|
||||
m_pFSM->Get_CurrState() == FSMSTATE::JOG)
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_SPACE)
|
||||
|| m_pGameInstance->Key_Down(DIK_LCONTROL)
|
||||
|| m_pGameInstance->Key_Down(DIK_E)
|
||||
|| m_pGameInstance->Key_Down(DIK_R)
|
||||
|| m_pGameInstance->Key_Down(DIK_Q)
|
||||
|| m_pGameInstance->Mouse_Up(DIM_LBUTTON)
|
||||
|| m_pGameInstance->Key_Down(DIK_1)
|
||||
//|| m_pGameInstance->Key_Down(DIK_C)
|
||||
//|| m_pGameInstance->Key_Down(DIK_V)
|
||||
//|| m_pGameInstance->Key_Down(DIK_T)
|
||||
//|| m_pGameInstance->Key_Down(DIK_G)
|
||||
//|| m_pGameInstance->Key_Down(DIK_B)
|
||||
)
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_LEFT))
|
||||
m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pGameInstance->Key_Pressing(DIK_RIGHT))
|
||||
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
|
||||
HRESULT CPlayer::InputMove()
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_A)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_S)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_D))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleEnter() {
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG | FSMSTATE::WALK)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
// pairAnimInfo = m_Animation[STATEANIM::spr]
|
||||
}
|
||||
}
|
||||
|
||||
IsSprint();
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
IsWalk();
|
||||
HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
{
|
||||
// S_OK -> 현 상태 유지
|
||||
// E_FAIL -> 현 상태 탈출
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
return S_OK;
|
||||
}
|
||||
if (SUCCEEDED(InputSkill())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_E)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::AAA);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_1)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
_bool bFoward = m_pGameInstance->Key_Pressing(DIK_W);
|
||||
_bool bLeft = m_pGameInstance->Key_Pressing(DIK_A);
|
||||
_bool bRight = m_pGameInstance->Key_Pressing(DIK_D);
|
||||
_bool bBackward = m_pGameInstance->Key_Pressing(DIK_S);
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::DODGE | FSMSTATE::LAND | FSMSTATE::COMBAT)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
// Idle -> Move
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
else {
|
||||
// ?
|
||||
}
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::DODGE | FSMSTATE::LAND)) {
|
||||
// OtherMove -> AnotherMove
|
||||
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::COMBAT)) {
|
||||
// Combat -> Move
|
||||
|
||||
}
|
||||
}
|
||||
else { // While Moving
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
//else if (true == bLeft){
|
||||
// pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
//}
|
||||
//else if (true == bRight){
|
||||
// pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
return S_OK;
|
||||
}
|
||||
if (SUCCEEDED(InputSkill())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_E)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::AAA);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_1)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)){
|
||||
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_A)){
|
||||
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_S)){
|
||||
|
||||
}
|
||||
if (m_pGameInstance->Key_Pressing(DIK_D)){
|
||||
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::MOVE | FSMSTATE::SPRINT | FSMSTATE::JOG | FSMSTATE::WALK);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT];
|
||||
m_pFSM->Enable_State(FSMSTATE::JUMP);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::JOG | FSMSTATE::WALK)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
// Idle -> Jump
|
||||
// pairAnimInfo = Get_AnimInfo(STATEANIM::Jump_IDLE);
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JUMP_JOG];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Drop?
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_JumpExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
return S_OK;
|
||||
}
|
||||
if (IsCurrentKeyFrame("Jump")) {
|
||||
m_pFSM->Change_State(FSMSTATE::LAND);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::JUMP);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::LAND);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_LandExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
//return S_OK;
|
||||
}
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
} // 혹시 Land to (Jog, Sprint, Dodge) 같은 애니메이션 있으면 여기에 분기 조건 넣으면 됨
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::LAND);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeEnter()
|
||||
{
|
||||
// 혹시 @@ to Dodge 있으면 여기에
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::DODGE);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_DodgeExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
//return S_OK;
|
||||
}
|
||||
if (m_pModelCom->IsFinishedAnim()) {
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::DODGE);
|
||||
}
|
||||
|
||||
void CPlayer::Add_FSM()
|
||||
{
|
||||
#pragma region MOVE
|
||||
m_pFSM->Add_State(FSMSTATE::MOVE, new CState_Move());
|
||||
m_pFSM->Add_State(FSMSTATE::IDLE, new CState_Idle());
|
||||
m_pFSM->Add_State(FSMSTATE::IDLE_TURN, new CState_Idle_Turn());
|
||||
m_pFSM->Add_State(FSMSTATE::WALK, new CState_Walk());
|
||||
m_pFSM->Add_State(FSMSTATE::JOG, new CState_Jog());
|
||||
m_pFSM->Add_State(FSMSTATE::SPRINT, new CState_Sprint());
|
||||
m_pFSM->Add_State(FSMSTATE::DODGE, new CState_Dodge());
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
{
|
||||
CState_Idle::STATE_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region COMBAT
|
||||
m_pFSM->Add_State(FSMSTATE::COMBAT, new CState_Combat());
|
||||
m_pFSM->Add_State(FSMSTATE::SKILL, new CState_Skill());
|
||||
m_pFSM->Add_State(FSMSTATE::SKILL2, new CState_Skill2());
|
||||
m_pFSM->Add_State(FSMSTATE::LIGHT_ATTACK, new CState_LightAttack());
|
||||
m_pFSM->Add_State(FSMSTATE::CAST, new CState_Cast());
|
||||
#pragma region Behavior_Movement_Focus
|
||||
{
|
||||
CState_Jump::STATE_JUMP_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_JumpEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_JumpExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_JumpExit(); };
|
||||
m_States.emplace(FSMSTATE::JUMP, CState_Jump::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Land::STATE_LAND_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_LandExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_LandExit(); };
|
||||
m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Dodge::STATE_DODGE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_NotFocus
|
||||
|
||||
m_pFSM->Add_State(FSMSTATE::JUMP, new CState_Jump());
|
||||
m_pFSM->Add_State(FSMSTATE::LAND, new CState_Land());
|
||||
|
||||
m_pFSM->Add_State(FSMSTATE::ROOT, new CState_Root());
|
||||
|
||||
}
|
||||
|
||||
void CPlayer::Set_FSM()
|
||||
{
|
||||
#pragma region ROOT
|
||||
m_pFSM->Set_Parent(FSMSTATE::MOVE, FSMSTATE::ROOT);
|
||||
m_pFSM->Set_Parent(FSMSTATE::COMBAT, FSMSTATE::ROOT);
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_Focus
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region MOVE
|
||||
m_pFSM->Set_Parent(FSMSTATE::IDLE, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::IDLE_TURN, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::WALK, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::BWD, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::FWD, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::JOG, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::SPRINT, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::DODGE, FSMSTATE::MOVE);
|
||||
#pragma endregion
|
||||
|
||||
#pragma region COMBAT
|
||||
m_pFSM->Set_Parent(FSMSTATE::SKILL, FSMSTATE::COMBAT);
|
||||
m_pFSM->Set_Parent(FSMSTATE::SKILL2, FSMSTATE::COMBAT);
|
||||
m_pFSM->Set_Parent(FSMSTATE::LIGHT_ATTACK, FSMSTATE::COMBAT);
|
||||
m_pFSM->Set_Parent(FSMSTATE::CAST, FSMSTATE::COMBAT);
|
||||
#pragma endregion
|
||||
}
|
||||
|
||||
void CPlayer::Set_Anim()
|
||||
@@ -475,16 +754,6 @@ void CPlayer::Describe_Entity()
|
||||
|
||||
}
|
||||
|
||||
_bool CPlayer::Check(FSMSTATE::ESTATE state)
|
||||
{
|
||||
for (auto& cond : m_InputConditions)
|
||||
{
|
||||
if (cond.state == state)
|
||||
return cond.checker();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
_bool CPlayer::IsSprint()
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_LSHIFT))
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Cast.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Cast::CState_Cast()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Cast::Enter()
|
||||
{
|
||||
if (m_pFSM->Get_PrevState() == FSMSTATE::CAST)
|
||||
return;
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::CAST);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Cast::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Cast::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Cast::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::CAST))
|
||||
{
|
||||
_uint combo = m_pOwner->Next_LightCombo();
|
||||
m_pOwner->Set_LightCombo(combo);
|
||||
if (combo >= 3)
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
return true;
|
||||
}
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::CAST);
|
||||
m_pModel->Set_AnimationIndex(anim.first + combo, anim.second);
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL2))
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Cast::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Cast::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -4,51 +4,48 @@
|
||||
|
||||
|
||||
CState_Combat::CState_Combat()
|
||||
:CState()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Combat::Enter()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK))
|
||||
m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::CAST))
|
||||
m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL2))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
void CState_Combat::Update(_float fTimeDelta)
|
||||
HRESULT CState_Combat::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Combat::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
_bool CState_Combat::CheckExitState()
|
||||
HRESULT CState_Combat::Initialize(STATE_COMBAT_DESC* pDesc)
|
||||
{
|
||||
if (m_pOwner->IsCurrentKeyFrame("Jump"))
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return true;
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pOwner = pDesc->pOwner;
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return false;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Combat* CState_Combat::Create(STATE_COMBAT_DESC* pDesc)
|
||||
{
|
||||
CState_Combat* pInstance = new CState_Combat;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Combat::Free()
|
||||
{
|
||||
|
||||
@@ -4,43 +4,54 @@
|
||||
|
||||
|
||||
CState_Dodge::CState_Dodge()
|
||||
:CState()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Dodge::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::DODGE);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
void CState_Dodge::Update(_float fTimeDelta)
|
||||
HRESULT CState_Dodge::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
if (nullptr != m_funcPriorityUpdate) {
|
||||
m_funcPriorityUpdate(fTimeDelta);
|
||||
}
|
||||
if (FAILED(__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (nullptr != m_funcLateUpdate) {
|
||||
m_funcLateUpdate(fTimeDelta);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Dodge::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
_bool CState_Dodge::CheckExitState()
|
||||
HRESULT CState_Dodge::Initialize(STATE_DODGE_DESC* pDesc)
|
||||
{
|
||||
if (m_pModel->IsFinishedAnim())
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
|
||||
m_funcLateUpdate = pDesc->funcLateUpdate;
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT) && m_pOwner->IsCurrentKeyFrame("Dodge"))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK) && m_pOwner->IsCurrentKeyFrame("Dodge"))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JOG) && m_pOwner->IsCurrentKeyFrame("Dodge"))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
|
||||
|
||||
return false;
|
||||
CState_Dodge* CState_Dodge::Create(STATE_DODGE_DESC* pDesc)
|
||||
{
|
||||
CState_Dodge* pInstance = new CState_Dodge;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Dodge::Free()
|
||||
|
||||
@@ -1,64 +1,57 @@
|
||||
#include "pch.h"
|
||||
#include "State_Idle.h"
|
||||
#include "GameInstance.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Idle::CState_Idle()
|
||||
:CState()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Idle::Enter()
|
||||
{
|
||||
if (m_pFSM->Get_PrevState() == FSMSTATE::JOG)
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_STOP);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
return;
|
||||
}
|
||||
if (m_pFSM->Get_PrevState() == FSMSTATE::WALK)
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_STOP);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
void CState_Idle::Update(_float fTimeDelta)
|
||||
HRESULT CState_Idle::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
if (nullptr != m_funcPriorityUpdate) {
|
||||
m_funcPriorityUpdate(fTimeDelta);
|
||||
}
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (nullptr != m_funcLateUpdate) {
|
||||
m_funcLateUpdate(fTimeDelta);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Idle::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
_bool CState_Idle::CheckExitState()
|
||||
HRESULT CState_Idle::Initialize(STATE_IDLE_DESC* pDesc)
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::JOG))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
|
||||
m_funcLateUpdate = pDesc->funcLateUpdate;
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::IDLE_TURN))
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE_TURN);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
|
||||
return false;
|
||||
CState_Idle* CState_Idle::Create(STATE_IDLE_DESC* pDesc)
|
||||
{
|
||||
CState_Idle* pInstance = new CState_Idle;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Idle::Free()
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Idle_Turn.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Idle_Turn::CState_Idle_Turn()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Enter()
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_LEFT))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_L);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_RIGHT))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_R);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_DOWN))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_BWD);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Idle_Turn::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::MOVE))
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::COMBAT))
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL2))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK))
|
||||
m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::CAST))
|
||||
m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
}
|
||||
|
||||
if (m_pModel->IsFinishedAnim())
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Jog.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Jog::CState_Jog()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Jog::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_FWD);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
|
||||
m_pOwner->Reset_Sprint();
|
||||
m_pOwner->Reset_Walk();
|
||||
}
|
||||
|
||||
void CState_Jog::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Jog::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Jog::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
else if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
else if (!m_pOwner->Check(FSMSTATE::JOG))
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Jog::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Jog::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -4,50 +4,51 @@
|
||||
|
||||
|
||||
CState_Jump::CState_Jump()
|
||||
:CState()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Jump::Enter()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_SPRINT);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
return;
|
||||
}
|
||||
if (m_pOwner->Check(FSMSTATE::JOG))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_JOG);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
return;
|
||||
}
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
void CState_Jump::Update(_float fTimeDelta)
|
||||
HRESULT CState_Jump::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Jump::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
_bool CState_Jump::CheckExitState()
|
||||
HRESULT CState_Jump::Initialize(STATE_JUMP_DESC* pDesc)
|
||||
{
|
||||
if (m_pOwner->IsCurrentKeyFrame("Jump"))
|
||||
m_pFSM->Change_State(FSMSTATE::LAND);
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return false;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Jump* CState_Jump::Create(STATE_JUMP_DESC* pDesc)
|
||||
{
|
||||
CState_Jump* pInstance = new CState_Jump;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Jump::Free()
|
||||
{
|
||||
__super::Free();
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Jump::Describe_Entity()
|
||||
|
||||
@@ -4,44 +4,51 @@
|
||||
|
||||
|
||||
CState_Land::CState_Land()
|
||||
:CState()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Land::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LAND);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
void CState_Land::Update(_float fTimeDelta)
|
||||
HRESULT CState_Land::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Land::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
_bool CState_Land::CheckExitState()
|
||||
HRESULT CState_Land::Initialize(STATE_LAND_DESC* pDesc)
|
||||
{
|
||||
if (m_pModel->IsFinishedAnim())
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JOG))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
return false;
|
||||
CState_Land* CState_Land::Create(STATE_LAND_DESC* pDesc)
|
||||
{
|
||||
CState_Land* pInstance = new CState_Land;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Land::Free()
|
||||
{
|
||||
__super::Free();
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Land::Describe_Entity()
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_LightAttack.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_LightAttack::CState_LightAttack()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_LightAttack::Enter()
|
||||
{
|
||||
if (m_pFSM->Get_PrevState() == FSMSTATE::LIGHT_ATTACK)
|
||||
return;
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LIGHT_ATTACK);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_LightAttack::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_LightAttack::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_LightAttack::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK))
|
||||
{
|
||||
_uint combo = m_pOwner->Next_LightCombo();
|
||||
m_pOwner->Set_LightCombo(combo);
|
||||
if (combo >= 4)
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
return true;
|
||||
}
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LIGHT_ATTACK);
|
||||
m_pModel->Set_AnimationIndex(anim.first + combo, anim.second);
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL2))
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void CState_LightAttack::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_LightAttack::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -4,46 +4,56 @@
|
||||
|
||||
|
||||
CState_Move::CState_Move()
|
||||
:CState()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Move::Enter()
|
||||
{
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JOG))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::IDLE_TURN))
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE_TURN);
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
void CState_Move::Update(_float fTimeDelta)
|
||||
HRESULT CState_Move::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
if (nullptr != m_funcPriorityUpdate) {
|
||||
m_funcPriorityUpdate(fTimeDelta);
|
||||
}
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (nullptr != m_funcLateUpdate) {
|
||||
m_funcLateUpdate(fTimeDelta);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Move::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
_bool CState_Move::CheckExitState()
|
||||
HRESULT CState_Move::Initialize(STATE_MOVE_DESC* pDesc)
|
||||
{
|
||||
return false;
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
|
||||
m_funcLateUpdate = pDesc->funcLateUpdate;
|
||||
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Move* CState_Move::Create(STATE_MOVE_DESC* pDesc)
|
||||
{
|
||||
CState_Move* pInstance = new CState_Move;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Move::Free()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include "State_Root.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Root::CState_Root()
|
||||
:CState()
|
||||
{
|
||||
@@ -10,48 +9,38 @@ CState_Root::CState_Root()
|
||||
|
||||
void CState_Root::Enter()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::COMBAT))
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
|
||||
else
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
if (nullptr != m_funcEnterEvent) {
|
||||
m_funcEnterEvent();
|
||||
}
|
||||
}
|
||||
|
||||
void CState_Root::Update(_float fTimeDelta)
|
||||
HRESULT CState_Root::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
HRESULT hr = { S_OK };
|
||||
if (nullptr != m_funcExitCheck) {
|
||||
hr = m_funcExitCheck(fTimeDelta);
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
void CState_Root::Exit()
|
||||
{
|
||||
if (nullptr != m_funcExitEvent) {
|
||||
m_funcExitEvent();
|
||||
}
|
||||
}
|
||||
|
||||
_bool CState_Root::CheckExitState()
|
||||
HRESULT CState_Root::Initialize(STATE_ROOT_DESC* pArg)
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::COMBAT))
|
||||
{
|
||||
if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::COMBAT)
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_pFSM->Get_Current()->Get_Parent()->Get_State() == FSMSTATE::COMBAT)
|
||||
return false;
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::MOVE))
|
||||
{
|
||||
if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::MOVE)
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_funcExitCheck = pArg->funcExitCheck;
|
||||
m_funcEnterEvent = pArg->funcEnterEvent;
|
||||
m_funcExitEvent = pArg->funcExitEvent;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
void CState_Root::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Skill.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Skill::CState_Skill()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Skill::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SKILL);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Skill::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Skill::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Skill::CheckExitState()
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Skill::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Skill::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Skill2.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Skill2::CState_Skill2()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Skill2::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SKILL2);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Skill2::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Skill2::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Skill2::CheckExitState()
|
||||
{
|
||||
if (m_pModel->IsFinishedAnim())
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Skill2::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Skill2::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Sprint.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Sprint::CState_Sprint()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Sprint::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SPRINT);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Sprint::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
void CState_Sprint::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Sprint::CheckExitState()
|
||||
{
|
||||
if (!m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
else if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Sprint::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Sprint::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Walk.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Walk::CState_Walk()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Walk::Enter()
|
||||
{
|
||||
if(m_pOwner->Check(FSMSTATE::FWD))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_FWD);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::BWD))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_BWD);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
}
|
||||
|
||||
void CState_Walk::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Walk::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Walk::CheckExitState()
|
||||
{
|
||||
if (!m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
else if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Walk::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Walk::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -3,11 +3,6 @@
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CModel;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CBroom final : public CGameObject
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CCallBack_EffectHitBox_Behavior final : public PSX::PxControllerBehaviorCallback
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CCallBack_EffectHitBox_HitReport final : public PSX::PxUserControllerHitReport
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CCallBack_Monster_Behavior final : public PSX::PxControllerBehaviorCallback
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CCallBack_Monster_HitReport final : public PSX::PxUserControllerHitReport
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CCallBack_Playable_Behavior final : public PSX::PxControllerBehaviorCallback
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CCallBack_Playable_HitReport final : public PSX::PxUserControllerHitReport
|
||||
|
||||
@@ -1,9 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CTransform;
|
||||
NS_END
|
||||
NS_BEGIN(Client)
|
||||
|
||||
|
||||
NS_END
|
||||
@@ -5,12 +5,6 @@
|
||||
#include "CallBack_Playable_Behavior.h"
|
||||
#include "CallBack_Playable_HitReport.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CShader;
|
||||
class CRigidBody;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CDummy_PhysXPlayable final : public CGameObject
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CShader;
|
||||
class CRigidBody;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CDummy_PhysXWall final : public CGameObject
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
class CGameObject;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Level.h"
|
||||
NS_BEGIN(Engine)
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CLevel_Field final : public CLevel
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Level.h"
|
||||
NS_BEGIN(Engine)
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CLevel_GamePlay final : public CLevel
|
||||
|
||||
@@ -2,8 +2,7 @@
|
||||
|
||||
#include "Client_Define.h"
|
||||
#include "Level.h"
|
||||
NS_BEGIN(Engine)
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
|
||||
|
||||
@@ -3,10 +3,6 @@
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CLight;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CLight_Main final : public CGameObject
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
class CGameObject;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
class CGameObject;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
@@ -29,9 +29,14 @@ class CPlayer final : public CUnit
|
||||
_bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; }
|
||||
|
||||
private:
|
||||
unordered_map<size_t, CState*> m_States = { };
|
||||
size_t m_iStateMask = { 0 };
|
||||
_float m_fDirectionRadian = 0.f;
|
||||
|
||||
vector<InputCondition> m_InputConditions;
|
||||
_bool m_bSprintToggle = { false };
|
||||
_bool m_bWalkToggle = { false };
|
||||
|
||||
class CCamPosition_Player* m_pCamPosition_TopDown_LookPart = { nullptr };
|
||||
class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr };
|
||||
|
||||
@@ -43,8 +48,6 @@ class CPlayer final : public CUnit
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Ready_Parts();
|
||||
HRESULT Bind_ShaderResources();
|
||||
void Setup_InputConditions();
|
||||
void Key_Input(_float fTimeDelta);
|
||||
|
||||
public:
|
||||
static CPlayer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
@@ -55,11 +58,35 @@ class CPlayer final : public CUnit
|
||||
#pragma region STATE
|
||||
private:
|
||||
virtual void Add_FSM();
|
||||
virtual void Set_FSM();
|
||||
virtual void Set_Anim();
|
||||
_bool Check(FSMSTATE::ESTATE state);
|
||||
_bool IsSprint();
|
||||
_bool IsWalk();
|
||||
|
||||
HRESULT InputSystem();
|
||||
HRESULT InputSkill();
|
||||
HRESULT InputMove();
|
||||
|
||||
void Behavior_IdleEnter();
|
||||
HRESULT Behavior_IdleExitCheck();
|
||||
void Behavior_IdleExit();
|
||||
|
||||
void Behavior_MoveEnter();
|
||||
HRESULT Behavior_MoveExitCheck();
|
||||
void Behavior_MoveExit();
|
||||
|
||||
void Behavior_JumpEnter();
|
||||
HRESULT Behavior_JumpExitCheck();
|
||||
void Behavior_JumpExit();
|
||||
|
||||
void Behavior_LandEnter();
|
||||
HRESULT Behavior_LandExitCheck();
|
||||
void Behavior_LandExit();
|
||||
|
||||
void Behavior_DodgeEnter();
|
||||
HRESULT Behavior_DodgeExitCheck();
|
||||
void Behavior_DodgeExit();
|
||||
|
||||
|
||||
public:
|
||||
virtual void Reset_Sprint() { m_bSprintToggle = false; }
|
||||
virtual void Reset_Walk() { m_bWalkToggle = false; }
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CGameInstance;
|
||||
class CGameObject;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
@@ -3,11 +3,6 @@
|
||||
#include "Client_Define.h"
|
||||
#include "GameObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CModel;
|
||||
class CShader;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CSkyBox final : public CGameObject
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Cast final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Cast();
|
||||
virtual ~CState_Cast() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,19 +1,31 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
#include "State_Root.h"
|
||||
|
||||
class CState_Combat final : public CState
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CState_Combat final : public CState_Root
|
||||
{
|
||||
public:
|
||||
typedef struct tagCombat : public CState_Root::STATE_ROOT_DESC {
|
||||
|
||||
}STATE_COMBAT_DESC;
|
||||
private:
|
||||
CState_Combat();
|
||||
virtual ~CState_Combat() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_COMBAT_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Combat* Create(STATE_COMBAT_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -1,19 +1,36 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
#include "State_Root.h"
|
||||
|
||||
class CState_Dodge final : public CState
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CState_Dodge final : public CState_Root
|
||||
{
|
||||
public:
|
||||
typedef struct tagDodge : public CState_Root::STATE_ROOT_DESC {
|
||||
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
|
||||
}STATE_DODGE_DESC;
|
||||
public:
|
||||
CState_Dodge();
|
||||
virtual ~CState_Dodge() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
private:
|
||||
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_DODGE_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Dodge* Create(STATE_DODGE_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -1,21 +1,36 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
#include "State_Root.h"
|
||||
|
||||
class CState_Idle final : public CState
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CState_Idle final : public CState_Root
|
||||
{
|
||||
public:
|
||||
typedef struct tagIdle : public CState_Root::STATE_ROOT_DESC {
|
||||
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
|
||||
}STATE_IDLE_DESC;
|
||||
public:
|
||||
CState_Idle();
|
||||
virtual ~CState_Idle() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
private:
|
||||
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_IDLE_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Idle* Create(STATE_IDLE_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Idle_Turn final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Idle_Turn();
|
||||
virtual ~CState_Idle_Turn() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
|
||||
class CState_Jog final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Jog();
|
||||
virtual ~CState_Jog() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,20 +1,31 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
#include "State_Root.h"
|
||||
|
||||
class CState_Jump final : public CState
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CState_Jump final : public CState_Root
|
||||
{
|
||||
public:
|
||||
typedef struct tagJump : public CState_Root::STATE_ROOT_DESC {
|
||||
|
||||
}STATE_JUMP_DESC;
|
||||
private:
|
||||
CState_Jump();
|
||||
virtual ~CState_Jump() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_JUMP_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Jump* Create(STATE_JUMP_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -1,20 +1,31 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
#include "State_Root.h"
|
||||
|
||||
class CState_Land final : public CState
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CState_Land final : public CState_Root
|
||||
{
|
||||
public:
|
||||
typedef struct tagLand : public CState_Root::STATE_ROOT_DESC {
|
||||
|
||||
}STATE_LAND_DESC;
|
||||
private:
|
||||
CState_Land();
|
||||
virtual ~CState_Land() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_LAND_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Land* Create(STATE_LAND_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_LightAttack final : public CState
|
||||
{
|
||||
public:
|
||||
CState_LightAttack();
|
||||
virtual ~CState_LightAttack() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,19 +1,36 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
#include "State_Root.h"
|
||||
|
||||
class CState_Move final : public CState
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CState_Move final : public CState_Root
|
||||
{
|
||||
public:
|
||||
typedef struct tagMove : public CState_Root::STATE_ROOT_DESC {
|
||||
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
|
||||
}STATE_MOVE_DESC;
|
||||
private:
|
||||
CState_Move();
|
||||
virtual ~CState_Move() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
private:
|
||||
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_MOVE_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Move* Create(STATE_MOVE_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -2,18 +2,37 @@
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Root final : public CState
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CState_Root abstract : public CState
|
||||
{
|
||||
public:
|
||||
protected:
|
||||
typedef struct tagStateRoot : public CState::STATEDESC {
|
||||
function<HRESULT(_float fTimedelta)> funcExitCheck = { nullptr };
|
||||
function<void()> funcEnterEvent = { nullptr };
|
||||
function<void()> funcExitEvent = { nullptr };
|
||||
}STATE_ROOT_DESC;
|
||||
|
||||
protected:
|
||||
CState_Root();
|
||||
virtual ~CState_Root() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
protected:
|
||||
virtual void Enter() override;
|
||||
virtual HRESULT Update(_float fTimeDelta) override;
|
||||
virtual void Exit() override;
|
||||
|
||||
protected:
|
||||
function<HRESULT(_float fTimedelta)> m_funcExitCheck = { nullptr };
|
||||
function<void()> m_funcEnterEvent = { nullptr };
|
||||
function<void()> m_funcExitEvent = { nullptr };
|
||||
|
||||
protected:
|
||||
HRESULT Initialize(STATE_ROOT_DESC* pArg);
|
||||
|
||||
protected:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Skill final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Skill();
|
||||
virtual ~CState_Skill() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Skill2 final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Skill2();
|
||||
virtual ~CState_Skill2() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
|
||||
class CState_Sprint final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Sprint();
|
||||
virtual ~CState_Sprint() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
#include "Client_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
|
||||
class CState_Walk final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Walk();
|
||||
virtual ~CState_Walk() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -3,11 +3,6 @@
|
||||
#include "Client_Define.h"
|
||||
#include "PartObject.h"
|
||||
|
||||
NS_BEGIN(Engine)
|
||||
class CShader;
|
||||
class CModel;
|
||||
NS_END
|
||||
|
||||
NS_BEGIN(Client)
|
||||
|
||||
class CWand final : public CPartObject
|
||||
|
||||
@@ -153,7 +153,7 @@ PS_OUT_LIGHT PS_MAIN_DIRECTIONAL(PS_IN In)
|
||||
return Out;
|
||||
}
|
||||
|
||||
float fDiffuseAOStrength = lerp(0.3f, 1.f, fOcclusion);
|
||||
float fDiffuseAOStrength = lerp(1.3f, 2.f, fOcclusion);
|
||||
|
||||
PBR_LIGHT_OUT PBR_Out = PBR_Lighting(vNormal, vToView, vToLight, vAlbedo, fMetallic, fRoughness, g_vLightDiffuse.rgb, fAttenuation, vF0);
|
||||
|
||||
|
||||
@@ -1,64 +1,151 @@
|
||||
float PI = 3.141592;
|
||||
|
||||
struct Mesh
|
||||
struct KeyFrame
|
||||
{
|
||||
float3 vPosition;
|
||||
float3 vNormal;
|
||||
float3 vTangent;
|
||||
float3 vBinormal;
|
||||
float2 vTexcoord;
|
||||
|
||||
uint4 vBlendIndex;
|
||||
float4 vBlendWeight;
|
||||
float3 vScale;
|
||||
float4 vRotation;
|
||||
float3 vTranslation;
|
||||
float fTrackPosition;
|
||||
};
|
||||
|
||||
struct SkinngMesh
|
||||
struct Channel
|
||||
{
|
||||
float3 vPosition;
|
||||
float3 vNormal;
|
||||
float3 vTangent;
|
||||
float3 vBinormal;
|
||||
float2 vTexcoord;
|
||||
|
||||
uint StartIndex;
|
||||
uint KeyCount;
|
||||
uint BoneIndex;
|
||||
};
|
||||
|
||||
StructuredBuffer<Mesh> g_MeshBufferInput : register(t0);
|
||||
RWStructuredBuffer<SkinngMesh> gSkinngMeshOutput : register(u0);
|
||||
|
||||
cbuffer g_ConstantBuffer : register(b0)
|
||||
struct LocalPos
|
||||
{
|
||||
row_major float4x4 BoneMatrix[512];
|
||||
float3 Scale;
|
||||
float pad0;
|
||||
|
||||
float4 Rotation;
|
||||
|
||||
float3 Translation;
|
||||
float pad1;
|
||||
};
|
||||
|
||||
//[numthreads(256, 1, 1)]
|
||||
[numthreads(256, 1, 1)]
|
||||
void CS_MAIN(uint3 DispatchThreadID : SV_DispatchThreadID)
|
||||
|
||||
StructuredBuffer<KeyFrame> g_KeyFrameBuffer : register(t0);
|
||||
StructuredBuffer<Channel> g_ChannelBuffer : register(t1);
|
||||
|
||||
RWStructuredBuffer<LocalPos> g_LocalPosOutput : register(u0);
|
||||
|
||||
|
||||
cbuffer AnimCB : register(b0)
|
||||
{
|
||||
uint iIndex = DispatchThreadID.x;
|
||||
float CurrentTime;
|
||||
float Duration;
|
||||
float Speed;
|
||||
int BoneCount;
|
||||
|
||||
row_major float4x4 PreTransformMatrix;
|
||||
};
|
||||
|
||||
Mesh mesh = g_MeshBufferInput[iIndex];
|
||||
float4 quatSlerp(float4 q1, float4 q2, float t)
|
||||
{
|
||||
float cosTheta = dot(q1, q2);
|
||||
|
||||
float fWeightW = 1.f -
|
||||
(mesh.vBlendWeight.x + mesh.vBlendWeight.y + mesh.vBlendWeight.z);
|
||||
if (cosTheta < 0.0f)
|
||||
{
|
||||
q2 = -q2;
|
||||
cosTheta = -cosTheta;
|
||||
}
|
||||
|
||||
matrix SkinMatrix =
|
||||
BoneMatrix[mesh.vBlendIndex.x] * mesh.vBlendWeight.x +
|
||||
BoneMatrix[mesh.vBlendIndex.y] * mesh.vBlendWeight.y +
|
||||
BoneMatrix[mesh.vBlendIndex.z] * mesh.vBlendWeight.z +
|
||||
BoneMatrix[mesh.vBlendIndex.w] * fWeightW;
|
||||
if (cosTheta > 0.9995f)
|
||||
return normalize(lerp(q1, q2, t));
|
||||
|
||||
float4 vPosition = mul(float4(mesh.vPosition, 1), SkinMatrix);
|
||||
float4 vNormal = mul(float4(mesh.vNormal, 0), SkinMatrix);
|
||||
float4 vBinormal = mul(float4(mesh.vBinormal, 0), SkinMatrix);
|
||||
float4 vTangent = mul(float4(mesh.vTangent, 0), SkinMatrix);
|
||||
float theta = acos(cosTheta);
|
||||
float sinTheta = sin(theta);
|
||||
|
||||
float w1 = sin((1.0f - t) * theta) / sinTheta;
|
||||
float w2 = sin(t * theta) / sinTheta;
|
||||
|
||||
SkinngMesh outv;
|
||||
outv.vPosition = vPosition.xyz;
|
||||
outv.vNormal = vNormal.xyz;
|
||||
outv.vTangent = vTangent.xyz;
|
||||
outv.vBinormal = vBinormal.xyz;
|
||||
outv.vTexcoord = mesh.vTexcoord;
|
||||
|
||||
gSkinngMeshOutput[iIndex] = outv;
|
||||
return q1 * w1 + q2 * w2;
|
||||
}
|
||||
|
||||
|
||||
[numthreads(256, 1, 1)]
|
||||
void CS_LocalSRT(uint3 DTID : SV_DispatchThreadID)
|
||||
{
|
||||
uint boneIndex = DTID.x;
|
||||
if (boneIndex >= (uint) BoneCount)
|
||||
return;
|
||||
|
||||
float time = CurrentTime;
|
||||
if (Duration > 0)
|
||||
time = min(time, Duration);
|
||||
|
||||
Channel channel = g_ChannelBuffer[boneIndex];
|
||||
|
||||
LocalPos result;
|
||||
|
||||
if (channel.KeyCount == 0)
|
||||
{
|
||||
result.Scale = float3(1, 1, 1);
|
||||
result.Rotation = float4(0, 0, 0, 1);
|
||||
result.Translation = float3(0, 0, 0);
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
return;
|
||||
}
|
||||
|
||||
uint firstIndex = channel.StartIndex;
|
||||
uint lastIndex = channel.StartIndex + channel.KeyCount - 1;
|
||||
|
||||
KeyFrame keyframe1 = g_KeyFrameBuffer[firstIndex];
|
||||
KeyFrame keyframe2 = g_KeyFrameBuffer[lastIndex];
|
||||
|
||||
if (time <= keyframe1.fTrackPosition)
|
||||
{
|
||||
result.Scale = keyframe1.vScale;
|
||||
result.Rotation = keyframe1.vRotation;
|
||||
result.Translation = keyframe1.vTranslation;
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
return;
|
||||
}
|
||||
|
||||
if (time >= keyframe2.fTrackPosition)
|
||||
{
|
||||
result.Scale = keyframe2.vScale;
|
||||
result.Rotation = keyframe2.vRotation;
|
||||
result.Translation = keyframe2.vTranslation;
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
return;
|
||||
}
|
||||
|
||||
for (uint i = 0; i < channel.KeyCount - 1; ++i)
|
||||
{
|
||||
uint A = channel.StartIndex + i;
|
||||
uint B = channel.StartIndex + i + 1;
|
||||
|
||||
KeyFrame ka = g_KeyFrameBuffer[A];
|
||||
KeyFrame kb = g_KeyFrameBuffer[B];
|
||||
|
||||
if (time >= ka.fTrackPosition && time <= kb.fTrackPosition)
|
||||
{
|
||||
float t = (time - ka.fTrackPosition) / (kb.fTrackPosition - ka.fTrackPosition);
|
||||
|
||||
result.Scale = lerp(ka.vScale, kb.vScale, t);
|
||||
result.Rotation = quatSlerp(ka.vRotation, kb.vRotation, t);
|
||||
result.Translation = lerp(ka.vTranslation, kb.vTranslation, t);
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
result.Scale = keyframe2.vScale;
|
||||
result.Rotation = keyframe2.vRotation;
|
||||
result.Translation = keyframe2.vTranslation;
|
||||
result.pad0 = result.pad1 = 0.0f;
|
||||
|
||||
g_LocalPosOutput[boneIndex] = result;
|
||||
}
|
||||
|
||||
@@ -23,9 +23,11 @@ float g_fOwnerAlpha;
|
||||
float g_fCanvasAlpha;
|
||||
float g_fAngle;
|
||||
float g_fCoolTime;
|
||||
float g_fHp;
|
||||
|
||||
float2 g_fOrigin_Size;
|
||||
float2 g_fCurrent_Size;
|
||||
float2 g_fHpBG;
|
||||
|
||||
float4 g_fNine_Slice;
|
||||
|
||||
@@ -522,14 +524,22 @@ PS_OUT PS_HpBar(PS_IN In)
|
||||
}
|
||||
|
||||
float4 tex1 = g_Texture.Sample(ClampSampler, Finaluv);
|
||||
Color = tex1;
|
||||
|
||||
float2 reversuv = In.vTexcoord;
|
||||
|
||||
reversuv.x = 1.0f - Finaluv;
|
||||
|
||||
float4 tex2 = g_Texture1.Sample(ClampSampler, Finaluv);
|
||||
|
||||
|
||||
Color = tex1;
|
||||
|
||||
if (reversuv.x >= g_fHp)
|
||||
{
|
||||
tex2.rgb = float3(0.f, 0.f, 0.f);
|
||||
}
|
||||
|
||||
tex2.rgb *= float3(112.f, 241.f, 31.f) / 255.f;
|
||||
|
||||
if(Color.r >= 0.01f)
|
||||
if (all(Color.rgb >= float3(70.f / 255.f, 70.f / 255.f, 70.f / 255.f)))
|
||||
Color = tex2;
|
||||
|
||||
Color.a *= Alpha;
|
||||
|
||||
@@ -1,16 +1,5 @@
|
||||
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
|
||||
struct SkinngMesh
|
||||
{
|
||||
float3 vPosition;
|
||||
float3 vNormal;
|
||||
float3 vTangent;
|
||||
float3 vBinormal;
|
||||
float2 vTexcoord;
|
||||
};
|
||||
|
||||
|
||||
#include "Engine_Shader_Defines.hlsli"
|
||||
|
||||
matrix g_WorldMatrix, g_ViewMatrix, g_ProjMatrix;
|
||||
|
||||
@@ -25,13 +14,12 @@ float3 g_vRimColor;
|
||||
float4 g_TestColor;
|
||||
vector g_vCamPosition;
|
||||
|
||||
Texture2D g_DiffuseTexture : register(t0);
|
||||
Texture2D g_NormalTexture : register(t1);
|
||||
Texture2D g_DAOTexture : register(t2);
|
||||
Texture2D g_THVTexture : register(t3);
|
||||
Texture2D g_SurfaceParamsTexture : register(t4);
|
||||
Texture2D g_DiffuseTexture;
|
||||
Texture2D g_NormalTexture;
|
||||
Texture2D g_DAOTexture;
|
||||
Texture2D g_THVTexture;
|
||||
Texture2D g_SurfaceParamsTexture;
|
||||
|
||||
StructuredBuffer<SkinngMesh> g_SkinngMesh : register(t5);
|
||||
|
||||
float3 g_RootColor;
|
||||
float3 g_TipColor;
|
||||
@@ -67,31 +55,26 @@ struct VS_OUT
|
||||
float4 vWorldPos : TEXCOORD1;
|
||||
float4 vProjPos : TEXCOORD2;
|
||||
};
|
||||
VS_OUT VS_MAIN(VS_IN In, uint vertexID : SV_VertexID)
|
||||
|
||||
VS_OUT VS_MAIN(VS_IN In)
|
||||
{
|
||||
VS_OUT Out;
|
||||
|
||||
//float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z);
|
||||
float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z);
|
||||
|
||||
//matrix BoneMatrix =
|
||||
// mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) +
|
||||
// mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) +
|
||||
// mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) +
|
||||
// mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW);
|
||||
matrix BoneMatrix =
|
||||
mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) +
|
||||
mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) +
|
||||
mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) +
|
||||
mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW);
|
||||
|
||||
//vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix);
|
||||
//vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix);
|
||||
//vector vBinormal = mul(vector(In.vBinormal, 0.f), BoneMatrix);
|
||||
//vector vTangent = mul(vector(In.vTangent, 0.f), BoneMatrix);
|
||||
vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix);
|
||||
vector vNormal = mul(vector(In.vNormal, 0.f), BoneMatrix);
|
||||
vector vBinormal = mul(vector(In.vBinormal, 0.f), BoneMatrix);
|
||||
vector vTangent = mul(vector(In.vTangent, 0.f), BoneMatrix);
|
||||
|
||||
matrix matWV, matWVP;
|
||||
|
||||
vector vPosition = float4(g_SkinngMesh[vertexID].vPosition, 1.f);
|
||||
|
||||
vector vNormal = float4(g_SkinngMesh[vertexID].vNormal, 0.f);
|
||||
vector vBinormal = float4(g_SkinngMesh[vertexID].vBinormal, 0.f);
|
||||
vector vTangent = float4(g_SkinngMesh[vertexID].vTangent, 0.f);
|
||||
|
||||
matrix matWV, matWVP;
|
||||
matWV = mul(g_WorldMatrix, g_ViewMatrix);
|
||||
matWVP = mul(matWV, g_ProjMatrix);
|
||||
|
||||
@@ -99,8 +82,7 @@ VS_OUT VS_MAIN(VS_IN In, uint vertexID : SV_VertexID)
|
||||
Out.vNormal = normalize(mul(vNormal, g_WorldMatrix)).xyz;
|
||||
Out.vBinormal = normalize(mul(vBinormal, g_WorldMatrix)).xyz;
|
||||
Out.vTangent = normalize(mul(vTangent, g_WorldMatrix)).xyz;
|
||||
Out.vTexcoord = g_SkinngMesh[vertexID].vTexcoord;
|
||||
//In.vTexcoord;
|
||||
Out.vTexcoord = In.vTexcoord;
|
||||
Out.vWorldPos = mul(vPosition, g_WorldMatrix);
|
||||
Out.vProjPos = Out.vPosition;
|
||||
return Out;
|
||||
@@ -124,10 +106,10 @@ VS_OUT_CAPTUREDMODEL VS_CAPTUREDMODEL(VS_IN In)
|
||||
|
||||
float fWeightW = 1.f - (In.vBlendWeight.x + In.vBlendWeight.y + In.vBlendWeight.z);
|
||||
|
||||
matrix BoneMatrix =
|
||||
mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x ) +
|
||||
mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y ) +
|
||||
mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z ) +
|
||||
matrix BoneMatrix =
|
||||
mul(g_BoneMatrices[In.vBlendIndex.x], In.vBlendWeight.x) +
|
||||
mul(g_BoneMatrices[In.vBlendIndex.y], In.vBlendWeight.y) +
|
||||
mul(g_BoneMatrices[In.vBlendIndex.z], In.vBlendWeight.z) +
|
||||
mul(g_BoneMatrices[In.vBlendIndex.w], fWeightW);
|
||||
|
||||
vector vPosition = mul(vector(In.vPosition, 1.f), BoneMatrix);
|
||||
@@ -219,10 +201,13 @@ struct PS_OUT
|
||||
PS_OUT PS_MAIN(PS_IN In)
|
||||
{
|
||||
PS_OUT Out;
|
||||
|
||||
|
||||
vector vMtrlDiffuse = g_DiffuseTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
vector vSurface = g_SurfaceParamsTexture.Sample(DefaultSampler, In.vTexcoord);
|
||||
if (vMtrlDiffuse.a < 0.2f) { discard; }
|
||||
if (vMtrlDiffuse.a < 0.2f)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
float3 vNormalDecoded = DecodeNormalFromRG(g_NormalTexture, DefaultSampler, In.vTexcoord);
|
||||
float3x3 WorldMatrix = float3x3(In.vTangent, In.vBinormal * -1.f, In.vNormal);
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 16 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 17 KiB |
@@ -238,21 +238,13 @@
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Player.h" />
|
||||
<ClInclude Include="..\public\Slot_Number.h" />
|
||||
<ClInclude Include="..\Public\State_Cast.h" />
|
||||
<ClInclude Include="..\Public\State_Combat.h" />
|
||||
<ClInclude Include="..\Public\State_Dodge.h" />
|
||||
<ClInclude Include="..\Public\State_Idle.h" />
|
||||
<ClInclude Include="..\Public\State_Idle_Turn.h" />
|
||||
<ClInclude Include="..\Public\State_Jog.h" />
|
||||
<ClInclude Include="..\Public\State_Jump.h" />
|
||||
<ClInclude Include="..\Public\State_Land.h" />
|
||||
<ClInclude Include="..\Public\State_LightAttack.h" />
|
||||
<ClInclude Include="..\Public\State_Move.h" />
|
||||
<ClInclude Include="..\Public\State_Root.h" />
|
||||
<ClInclude Include="..\Public\State_Skill.h" />
|
||||
<ClInclude Include="..\Public\State_Skill2.h" />
|
||||
<ClInclude Include="..\Public\State_Sprint.h" />
|
||||
<ClInclude Include="..\Public\State_Walk.h" />
|
||||
<ClInclude Include="..\public\Spell_Image.h" />
|
||||
<ClInclude Include="..\public\Spell_Overlay.h" />
|
||||
<ClInclude Include="..\public\Spell_Slot.h" />
|
||||
@@ -372,21 +364,13 @@
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Player.cpp" />
|
||||
<ClCompile Include="..\private\Slot_Number.cpp" />
|
||||
<ClCompile Include="..\Private\State_Cast.cpp" />
|
||||
<ClCompile Include="..\Private\State_Combat.cpp" />
|
||||
<ClCompile Include="..\Private\State_Dodge.cpp" />
|
||||
<ClCompile Include="..\Private\State_Idle.cpp" />
|
||||
<ClCompile Include="..\Private\State_Idle_Turn.cpp" />
|
||||
<ClCompile Include="..\Private\State_Jog.cpp" />
|
||||
<ClCompile Include="..\Private\State_Jump.cpp" />
|
||||
<ClCompile Include="..\Private\State_Land.cpp" />
|
||||
<ClCompile Include="..\Private\State_LightAttack.cpp" />
|
||||
<ClCompile Include="..\Private\State_Move.cpp" />
|
||||
<ClCompile Include="..\Private\State_Root.cpp" />
|
||||
<ClCompile Include="..\Private\State_Skill.cpp" />
|
||||
<ClCompile Include="..\Private\State_Skill2.cpp" />
|
||||
<ClCompile Include="..\Private\State_Sprint.cpp" />
|
||||
<ClCompile Include="..\Private\State_Walk.cpp" />
|
||||
<ClCompile Include="..\private\Spell_Image.cpp" />
|
||||
<ClCompile Include="..\private\Spell_Overlay.cpp" />
|
||||
<ClCompile Include="..\private\Spell_Slot.cpp" />
|
||||
|
||||
@@ -223,12 +223,6 @@
|
||||
<Filter Include="80.State">
|
||||
<UniqueIdentifier>{9c21aba5-00c1-4b4c-8a82-dac7a156fd9b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Idle">
|
||||
<UniqueIdentifier>{d5681f71-af29-4418-bf3a-a1486c6ba171}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Jump">
|
||||
<UniqueIdentifier>{904a7ae5-33fe-49a1-9f31-27443acc9e1a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Player">
|
||||
<UniqueIdentifier>{680910fd-aee2-4f69-b644-12b36b0f635b}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -274,36 +268,9 @@
|
||||
<Filter Include="02.GameObjects\Dummys\DummyGlobe">
|
||||
<UniqueIdentifier>{04d044a9-3cab-4425-9adf-8eea436e71d4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Land">
|
||||
<UniqueIdentifier>{0b8cac41-419f-48ce-87bc-805b8962b4df}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Monster\Goblin">
|
||||
<UniqueIdentifier>{26e2dcaa-d94a-4c3d-ba39-2916f2a27bac}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move">
|
||||
<UniqueIdentifier>{dac78c4e-b898-45dc-8740-794899de0c69}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move\State_Sprint">
|
||||
<UniqueIdentifier>{1cac1aa6-ea12-429e-8a84-ca2bf44c2be4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move\State_Walk">
|
||||
<UniqueIdentifier>{43bc0f97-0b7d-406b-900c-0fae023023ec}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat">
|
||||
<UniqueIdentifier>{a56502cb-b0b8-4ea7-bc5e-5482b416fef9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_Cast">
|
||||
<UniqueIdentifier>{5f6e884b-3ab2-4354-b378-44e8221a4720}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_LightAttack">
|
||||
<UniqueIdentifier>{0aa8e406-d786-4e40-b825-54d5e3f691e2}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_Skill">
|
||||
<UniqueIdentifier>{eb7d24ee-d60e-4062-b974-264409436d81}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_Dodge">
|
||||
<UniqueIdentifier>{b017e167-f48d-4417-a924-765ab802cff5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Layer_Effect\Effect\03.TrailObject">
|
||||
<UniqueIdentifier>{f5cd19e8-186b-418f-b7fa-af73046a80d1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -313,15 +280,6 @@
|
||||
<Filter Include="02.GameObjects\Layer_Effect\Effect\05.NomalJap">
|
||||
<UniqueIdentifier>{8882358e-c8eb-4222-a87e-01d902533b8f}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat\State_Skill2">
|
||||
<UniqueIdentifier>{3614836d-9988-4ec0-95a8-f8ebc25a9a13}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Idle\State_Idle_Turn">
|
||||
<UniqueIdentifier>{98f012a4-2f13-456f-85ba-6929b1535de6}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Move\State_Jog">
|
||||
<UniqueIdentifier>{3ad2f4c4-95e6-47fa-9f4c-b9fcdbd77277}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="02.GameObjects\Broom">
|
||||
<UniqueIdentifier>{a9862861-6eaa-4e04-b7f6-217a32db7db4}</UniqueIdentifier>
|
||||
</Filter>
|
||||
@@ -361,6 +319,33 @@
|
||||
<Filter Include="02.GameObjects\Layer_Effect\Effect\06.Bombard">
|
||||
<UniqueIdentifier>{c81350c7-0edb-4e51-babf-09bf627414f1}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\State_Combat">
|
||||
<UniqueIdentifier>{a56502cb-b0b8-4ea7-bc5e-5482b416fef9}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Movement">
|
||||
<UniqueIdentifier>{8a70232d-f917-4ff6-b617-302e325996ae}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Movement\State_Move">
|
||||
<UniqueIdentifier>{dac78c4e-b898-45dc-8740-794899de0c69}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Movement\State_Idle">
|
||||
<UniqueIdentifier>{d5681f71-af29-4418-bf3a-a1486c6ba171}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Focus">
|
||||
<UniqueIdentifier>{029a22c4-ab06-4db0-9527-4e3cfa1a2e0d}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Focus\State_Dodge">
|
||||
<UniqueIdentifier>{b017e167-f48d-4417-a924-765ab802cff5}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Focus\State_Jump">
|
||||
<UniqueIdentifier>{904a7ae5-33fe-49a1-9f31-27443acc9e1a}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="80.State\Focus\State_Land">
|
||||
<UniqueIdentifier>{0b8cac41-419f-48ce-87bc-805b8962b4df}</UniqueIdentifier>
|
||||
</Filter>
|
||||
<Filter Include="50.UI\GamePlay_Canvas\Action_Panel\HpBarBG">
|
||||
<UniqueIdentifier>{7e8b7123-11fb-4946-99fe-3265932d0536}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Editor.h">
|
||||
@@ -571,19 +556,13 @@
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXWall</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Dodge.h">
|
||||
<Filter>80.State\State_Combat\State_Dodge</Filter>
|
||||
<Filter>80.State\Focus\State_Dodge</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Idle.h">
|
||||
<Filter>80.State\State_Idle</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Walk.h">
|
||||
<Filter>80.State\State_Move\State_Walk</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Sprint.h">
|
||||
<Filter>80.State\State_Move\State_Sprint</Filter>
|
||||
<Filter>80.State\Movement\State_Idle</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Jump.h">
|
||||
<Filter>80.State\State_Jump</Filter>
|
||||
<Filter>80.State\Focus\State_Jump</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Player.h">
|
||||
<Filter>02.GameObjects\Player</Filter>
|
||||
@@ -633,23 +612,14 @@
|
||||
<ClInclude Include="..\Public\Dummy_Globe.h">
|
||||
<Filter>02.GameObjects\Dummys\DummyGlobe</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Skill.h">
|
||||
<Filter>80.State\State_Combat\State_Skill</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_LightAttack.h">
|
||||
<Filter>80.State\State_Combat\State_LightAttack</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Land.h">
|
||||
<Filter>80.State\State_Land</Filter>
|
||||
<Filter>80.State\Focus\State_Land</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Goblin.h">
|
||||
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Cast.h">
|
||||
<Filter>80.State\State_Combat\State_Cast</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Move.h">
|
||||
<Filter>80.State\State_Move</Filter>
|
||||
<Filter>80.State\Movement\State_Move</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Combat.h">
|
||||
<Filter>80.State\State_Combat</Filter>
|
||||
@@ -663,15 +633,6 @@
|
||||
<ClInclude Include="..\Public\NomalJap.h">
|
||||
<Filter>02.GameObjects\Layer_Effect\Effect\05.NomalJap</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Skill2.h">
|
||||
<Filter>80.State\State_Combat\State_Skill2</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Idle_Turn.h">
|
||||
<Filter>80.State\State_Idle\State_Idle_Turn</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Jog.h">
|
||||
<Filter>80.State\State_Move\State_Jog</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Broom.h">
|
||||
<Filter>02.GameObjects\Broom</Filter>
|
||||
</ClInclude>
|
||||
@@ -691,7 +652,7 @@
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel\Slot_Number</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\public\HpBarBG.h">
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel\HPBarBG</Filter>
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel\HpBarBG</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Camera_Gaze.h">
|
||||
<Filter>02.GameObjects\Camera\Camera_Gaze</Filter>
|
||||
@@ -705,15 +666,15 @@
|
||||
<ClInclude Include="..\Public\CamPosition_Arm.h">
|
||||
<Filter>02.GameObjects\Camera</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Root.h">
|
||||
<Filter>80.State</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Wand.h">
|
||||
<Filter>02.GameObjects\Wand</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\Bombard.h">
|
||||
<Filter>02.GameObjects\Layer_Effect\Effect\06.Bombard</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\Public\State_Root.h">
|
||||
<Filter>80.State</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Image Include="Editor.ico">
|
||||
@@ -929,22 +890,13 @@
|
||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXDoorFrame</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Dodge.cpp">
|
||||
<Filter>80.State\State_Combat\State_Dodge</Filter>
|
||||
<Filter>80.State\Focus\State_Dodge</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Idle.cpp">
|
||||
<Filter>80.State\State_Idle</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Walk.cpp">
|
||||
<Filter>80.State\State_Move\State_Walk</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Sprint.cpp">
|
||||
<Filter>80.State\State_Move\State_Sprint</Filter>
|
||||
<Filter>80.State\Movement\State_Idle</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Jump.cpp">
|
||||
<Filter>80.State\State_Jump</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Player.cpp">
|
||||
<Filter>02.GameObjects\Player</Filter>
|
||||
<Filter>80.State\Focus\State_Jump</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\Land.cpp">
|
||||
<Filter>02.GameObjects\Env\04.Land</Filter>
|
||||
@@ -982,23 +934,14 @@
|
||||
<ClCompile Include="..\Private\Dummy_Globe.cpp">
|
||||
<Filter>02.GameObjects\Dummys\DummyGlobe</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Skill.cpp">
|
||||
<Filter>80.State\State_Combat\State_Skill</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_LightAttack.cpp">
|
||||
<Filter>80.State\State_Combat\State_LightAttack</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Land.cpp">
|
||||
<Filter>80.State\State_Land</Filter>
|
||||
<Filter>80.State\Focus\State_Land</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Goblin.cpp">
|
||||
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Cast.cpp">
|
||||
<Filter>80.State\State_Combat\State_Cast</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Move.cpp">
|
||||
<Filter>80.State\State_Move</Filter>
|
||||
<Filter>80.State\Movement\State_Move</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Combat.cpp">
|
||||
<Filter>80.State\State_Combat</Filter>
|
||||
@@ -1012,15 +955,6 @@
|
||||
<ClCompile Include="..\Private\NomalJap.cpp">
|
||||
<Filter>02.GameObjects\Layer_Effect\Effect\05.NomalJap</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Skill2.cpp">
|
||||
<Filter>80.State\State_Combat\State_Skill2</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Idle_Turn.cpp">
|
||||
<Filter>80.State\State_Idle\State_Idle_Turn</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Jog.cpp">
|
||||
<Filter>80.State\State_Move\State_Jog</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Broom.cpp">
|
||||
<Filter>02.GameObjects\Broom</Filter>
|
||||
</ClCompile>
|
||||
@@ -1040,7 +974,7 @@
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel\Slot_Number</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\private\HpBarBG.cpp">
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel\HPBarBG</Filter>
|
||||
<Filter>50.UI\GamePlay_Canvas\Action_Panel\HpBarBG</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Camera_Gaze.cpp">
|
||||
<Filter>02.GameObjects\Camera\Camera_Gaze</Filter>
|
||||
@@ -1054,11 +988,14 @@
|
||||
<ClCompile Include="..\Private\CamPosition_Arm.cpp">
|
||||
<Filter>02.GameObjects\Camera</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Wand.cpp">
|
||||
<Filter>02.GameObjects\Wand</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\State_Root.cpp">
|
||||
<Filter>80.State</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Wand.cpp">
|
||||
<Filter>02.GameObjects\Wand</Filter>
|
||||
<ClCompile Include="..\Private\Player.cpp">
|
||||
<Filter>02.GameObjects\Player</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\Private\Bombard.cpp">
|
||||
<Filter>02.GameObjects\Layer_Effect\Effect\06.Bombard</Filter>
|
||||
|
||||
@@ -66,9 +66,6 @@ HRESULT CBroom::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_CS_Output(5, i)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -3,12 +3,6 @@
|
||||
|
||||
#include "GameInstance.h"
|
||||
#include "DebugCamera.h"
|
||||
#include "State_Idle.h"
|
||||
#include "State_Walk.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Sprint.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Skill.h"
|
||||
|
||||
CDummyObject::CDummyObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
: CUnit(pDevice, pContext)
|
||||
@@ -50,7 +44,7 @@ void CDummyObject::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CDummyObject::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pModelCom->ComputeSkinning();
|
||||
m_pModelCom->ComputeAnimation();
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta,m_pTransformCom);
|
||||
|
||||
@@ -83,9 +77,6 @@ HRESULT CDummyObject::Render()
|
||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_CS_Output(5, i)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
|
||||
@@ -42,12 +42,7 @@ void CDummySkyBox::Update(_float fTimeDelta)
|
||||
{
|
||||
#ifdef gimch
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_CAMERA)->Get_Object<CDebugCamera>()->Get_WorldPostion());
|
||||
|
||||
#else
|
||||
m_pTransformCom->Set_State(STATE::POSITION, m_pGameInstance->Get_Layer(NEXT_LEVEL, LAYER_CAMERA)->Get_Object<CCamera_Gaze>()->Get_WorldPostion());
|
||||
|
||||
#endif // 기무리
|
||||
|
||||
#endif // !기무리
|
||||
}
|
||||
|
||||
void CDummySkyBox::Late_Update(_float fTimeDelta)
|
||||
|
||||
@@ -41,7 +41,7 @@ void CGoblin::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
|
||||
m_pModelCom->ComputeSkinning();
|
||||
m_pModelCom->ComputeAnimation();
|
||||
}
|
||||
|
||||
void CGoblin::Late_Update(_float fTimeDelta)
|
||||
@@ -71,9 +71,6 @@ HRESULT CGoblin::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_CS_Output(5, 0)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -21,10 +21,10 @@ HRESULT CHpBarBG::Initialize(void* pArg)
|
||||
{
|
||||
CUIObject::UIOBJECT_DESC Desc{};
|
||||
|
||||
Desc.fX = 0.f;
|
||||
Desc.fY = 0.f;
|
||||
Desc.fSizeX = 194.f;
|
||||
Desc.fSizeY = 32.f;
|
||||
Desc.fX = 220.f;
|
||||
Desc.fY = 180.f;
|
||||
Desc.fSizeX = 144.f;
|
||||
Desc.fSizeY = 24.f;
|
||||
|
||||
m_pRect = { long(Desc.fX - Desc.fSizeX * 0.5f), long(Desc.fY - Desc.fSizeY * 0.5f), long(Desc.fX + Desc.fSizeX * 0.5f), long(Desc.fY + Desc.fSizeY * 0.5f) };
|
||||
|
||||
@@ -40,7 +40,11 @@ HRESULT CHpBarBG::Initialize(void* pArg)
|
||||
m_fTimeMult = 3.f;
|
||||
m_fAlpha = 1.f;
|
||||
m_fAlphaTime = 1.f;
|
||||
m_vNine_Slice = _float4(27.f, 165.f, m_fSizeY * 0.5f, m_fSizeY * 0.5f);
|
||||
m_vNine_Slice = _float4(27.f, 125.f, m_fSizeY * 0.5f, m_fSizeY * 0.5f);
|
||||
m_fMaxHp = 20.f;
|
||||
m_fCurrentHp = m_fMaxHp;
|
||||
m_fMoveSpeed = 5.f;
|
||||
m_fHpBG = _float2(0, m_fSizeX);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -82,9 +86,27 @@ void CHpBarBG::Update(_float fTimeDelta)
|
||||
m_bFadeOut = false;
|
||||
m_fAlpha = 0.f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (m_pGameInstance->Key_Down(DIK_2))
|
||||
Lerp_PosX(10.f);
|
||||
if (m_pGameInstance->Key_Down(DIK_3))
|
||||
Lerp_PosX(-10.f);
|
||||
|
||||
if (m_fCurrentHp < 0.f)
|
||||
m_fCurrentHp = 0.f;
|
||||
if (m_fDamage <= 0.f)
|
||||
m_fDamage = 0.f;
|
||||
TargetHp = m_fMaxHp - m_fDamage;
|
||||
|
||||
if (TargetHp > m_fCurrentHp)
|
||||
Heal(fTimeDelta);
|
||||
else if(TargetHp < m_fCurrentHp)
|
||||
Hit(fTimeDelta);
|
||||
m_fHpBar = m_fCurrentHp / m_fMaxHp;
|
||||
|
||||
m_fTime += fTimeDelta * m_fTimeMult;
|
||||
|
||||
__super::Update(fTimeDelta);
|
||||
}
|
||||
|
||||
@@ -123,6 +145,27 @@ _vector CHpBarBG::Get_WorldPostion()
|
||||
return m_pTransformCom->Get_State(STATE::POSITION);
|
||||
}
|
||||
|
||||
void CHpBarBG::Lerp_PosX(_float X)
|
||||
{
|
||||
m_fDamage += X;
|
||||
}
|
||||
|
||||
void CHpBarBG::Heal(_float fTimeDelta)
|
||||
{
|
||||
m_fCurrentHp = CMyTools::Lerp_f1D(TargetHp, m_fCurrentHp, fTimeDelta * m_fMoveSpeed);
|
||||
}
|
||||
|
||||
void CHpBarBG::Hit(_float fTimeDelta)
|
||||
{
|
||||
m_fCurrentHp = CMyTools::Lerp_f1D(m_fCurrentHp, TargetHp, fTimeDelta * m_fMoveSpeed);
|
||||
}
|
||||
|
||||
void CHpBarBG::SizeUpX(_float fSizeX)
|
||||
{
|
||||
m_fSizeX = fSizeX;
|
||||
m_fX -= (fSizeX - m_vScale.x) * 0.5f;
|
||||
}
|
||||
|
||||
HRESULT CHpBarBG::Bind_ShaderResources()
|
||||
{
|
||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix")))
|
||||
@@ -172,11 +215,19 @@ HRESULT CHpBarBG::Bind_ShaderResources()
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fOrigin_Size", &m_fOrigin_Size, sizeof(_float2))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fCurrent_Size", &m_vScale, sizeof(_float2))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fHp", &m_fHpBar, sizeof(_float))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fHpBG", &m_fHpBG, sizeof(_float2))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -186,7 +237,7 @@ HRESULT CHpBarBG::Ready_Components(void* pArg)
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_UI_T_HealthMeter_Middle_4K"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
if (FAILED(Add_Asset_Component(ENUM_CLASS(LEVEL::UI), TEXT("Prototype_Texture_HpBarBG"), reinterpret_cast<CComponent**>(&m_pDiffuse_TextureCom), nullptr)))
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -30,10 +30,10 @@ HRESULT CLevel_ObjectViewer::Initialize()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/*if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera"))))
|
||||
if (FAILED(Ready_Layer_Camera(TEXT("Layer_Camera"))))
|
||||
{
|
||||
return E_FAIL;
|
||||
}*/
|
||||
}
|
||||
|
||||
if (FAILED(Ready_Layer_Dummy(TEXT("Layer_Dummy"))))
|
||||
{
|
||||
@@ -58,7 +58,7 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta)
|
||||
|
||||
Find_Anim();
|
||||
|
||||
m_Test->Describe_Entity();
|
||||
//m_Test->Describe_Entity();
|
||||
}
|
||||
|
||||
HRESULT CLevel_ObjectViewer::Render()
|
||||
@@ -702,8 +702,8 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag)
|
||||
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;
|
||||
//if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
// return E_FAIL;
|
||||
|
||||
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CBroom>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||
return E_FAIL;*/
|
||||
|
||||
@@ -1216,124 +1216,157 @@ future<void> CLoader::Deferred_FolderLoad(const _char* pDirectoryPath, const _ch
|
||||
return m_pGameInstance->EnqueueJob(&Deferred_FolderLoad_Main, m_pDevice, m_pContext, pDirectoryPath, pFileExt, bUseTag, OutContents);
|
||||
}
|
||||
|
||||
pair<_wstring, CModel*>* APIENTRY Deferred_ModelLoad_Main(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, MODEL eType, const _char* pDirectoryPath, const _tchar* pPrototypeTag, _fmatrix PreTransform)
|
||||
{
|
||||
if (FAILED(CoInitializeEx(nullptr, 0))) {
|
||||
assert(false);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CModel* pModel = CModel::Create(pDevice, pContext, eType, pDirectoryPath, PreTransform);
|
||||
|
||||
CoUninitialize();
|
||||
pair<_wstring, CModel*>* Out = new pair<_wstring, CModel*>(pPrototypeTag, pModel);
|
||||
return Out;
|
||||
}
|
||||
|
||||
future<pair<_wstring, CModel*>*> CLoader::Deferred_ModelLoad(MODEL eType, const _char* pDirectoryPath, _fmatrix PreTransform, const _tchar* pPrototypeTag) {
|
||||
return m_pGameInstance->EnqueueJob(&Deferred_ModelLoad_Main, m_pDevice, m_pContext, eType, pDirectoryPath, pPrototypeTag, PreTransform);
|
||||
}
|
||||
|
||||
HRESULT CLoader::Loading_For_ObjectViewer()
|
||||
{
|
||||
m_strMessage = TEXT("Texture Loading..");
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("TerrainTest"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.dds"), 0)))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
m_strMessage = TEXT("Model Loading..");
|
||||
|
||||
vector<future<pair<_wstring, CModel*>*>> futures = {};
|
||||
|
||||
#pragma region BODY
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_DADA_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DADA/M_DADA.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_DarkWizardSoldier_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DarkWizardSoldier/M_DarkWizardSoldier.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_DarkWizardGrunt_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DarkWizardGrunt/M_DarkWizardGrunt.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_DarkWizardTank_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DarkWizardTank/M_DarkWizardTank.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_F_DarkWizardMage_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/FeMale/F_DarkWizardMage/F_DarkWizardMage.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_F_DarkWizardSniper_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Body/FeMale/F_DarkWizardSniper/F_DarkWizardSniper.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DADA/M_DADA.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_M_DADA_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DarkWizardSoldier/M_DarkWizardSoldier.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_M_DarkWizardSoldier_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DarkWizardGrunt/M_DarkWizardGrunt.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_M_DarkWizardGrunt_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Body/Male/M_DarkWizardTank/M_DarkWizardTank.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_M_DarkWizardTank_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Body/FeMale/F_DarkWizardMage/F_DarkWizardMage.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_F_DarkWizardMage_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Body/FeMale/F_DarkWizardSniper/F_DarkWizardSniper.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_F_DarkWizardSniper_Model")
|
||||
));
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region HEAD
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Young_M_Head_Ivory_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Male/Young_M_Head_Ivory.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_T_NPC_F_Head_Eye_Honey_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/FeMale/T_NPC_F_Head_Eye_Honey.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_F_Head_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/FeMale/F_Head.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_Head_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Male/M_Head.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Male/Young_M_Head_Ivory.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_Young_M_Head_Ivory_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Head/FeMale/T_NPC_F_Head_Eye_Honey.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_T_NPC_F_Head_Eye_Honey_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Head/FeMale/F_Head.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_F_Head_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Head/Male/M_Head.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_M_Head_Model")
|
||||
));
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region HAIR
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_Hair1_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair1/M_Hair1.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair1/M_Hair1.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_M_Hair1_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair2/M_Hair2.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_M_Hair2_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair3/M_Hair3.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_M_Hair3_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/FeMale/F_Hair1/F_Hair1.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_F_Hair1_Model")
|
||||
));
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_Hair2_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair2/M_Hair2.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_M_Hair3_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/Male/M_Hair3/M_Hair3.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_F_Hair1_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Hair/FeMale/F_Hair1/F_Hair1.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
#pragma endregion
|
||||
|
||||
#pragma region MONSTER
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/TombProtector/TombProtector.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Troll_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Troll/Troll.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Dragon_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Dragon/Dragon.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_Goblin_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Monster/TombProtector/TombProtector.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_TombProtector_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Monster/Troll/Troll.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_Troll_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Monster/Dragon/Dragon.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_Dragon_Model")
|
||||
));
|
||||
|
||||
#pragma endregion
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Npc_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin",XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_Npc_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::NONANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_Wand_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_Broom_Model")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity(),
|
||||
TEXT("Prototype_Component_SkyboxModel")
|
||||
));
|
||||
futures.emplace_back(Deferred_ModelLoad(
|
||||
MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixIdentity(),
|
||||
TEXT("Desc_Box")
|
||||
));
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Wand_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Object/Wand/Wand.bin", XMMatrixScaling(0.01f, 0.01f, 0.01f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Broom_Model"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Object/Broom/Broom.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
/* For.Prototype_Component_SkyboxModel */
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("Prototype_Component_SkyboxModel"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/SkyBox/SkyBox.fbx", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Desc_Box"),
|
||||
CModel::Create(m_pDevice, m_pContext, MODEL::NONANIM, "../Bin/Resources/Models/Box/Box.bin", XMMatrixIdentity()))))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, TEXT("TerrainTest"),
|
||||
CTexture::Create(m_pDevice, m_pContext, TEXTURE_LOAD_TYPE::SINGLE, TEXT("../Bin/Resources/Textures/Cursor/UI_T_CursorRings.dds"), 0)))) {
|
||||
return E_FAIL;
|
||||
for (auto& job : futures) {
|
||||
pair<_wstring, CModel*>* pResult = job.get();
|
||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(g_iStaticLevel, pResult->first, pResult->second))) {
|
||||
assert(false);
|
||||
return E_FAIL;
|
||||
}
|
||||
Safe_Delete(pResult);
|
||||
}
|
||||
|
||||
m_strMessage = TEXT("Shader Loading..");
|
||||
|
||||
@@ -8,22 +8,13 @@
|
||||
#include "Wand.h"
|
||||
|
||||
#pragma region STATE
|
||||
#include "State_Root.h"
|
||||
|
||||
#include "State_Idle.h"
|
||||
#include "State_Walk.h"
|
||||
#include "State_Jog.h"
|
||||
#include "State_Sprint.h"
|
||||
#include "State_Dodge.h"
|
||||
#include "State_Jump.h"
|
||||
#include "State_Skill.h"
|
||||
#include "State_Skill2.h"
|
||||
#include "State_LightAttack.h"
|
||||
#include "State_Land.h"
|
||||
#include "State_Cast.h"
|
||||
#include "State_Move.h"
|
||||
#include "State_Combat.h"
|
||||
#include "State_Idle_Turn.h"
|
||||
#pragma endregion
|
||||
|
||||
CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||
@@ -57,13 +48,16 @@ HRESULT CPlayer::Initialize(void* pArg)
|
||||
|
||||
Add_FSM();
|
||||
|
||||
Set_FSM();
|
||||
|
||||
Set_Anim();
|
||||
|
||||
Setup_InputConditions();
|
||||
{
|
||||
CFSM::FSM_DESC FSMDesc{};
|
||||
FSMDesc.pStates = &m_States;
|
||||
FSMDesc.pStateMask = &m_iStateMask;
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::ROOT);
|
||||
m_pFSM->Bind_States(FSMDesc);
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -75,11 +69,9 @@ void CPlayer::Priority_Update(_float fTimeDelta)
|
||||
|
||||
void CPlayer::Update(_float fTimeDelta)
|
||||
{
|
||||
m_pModelCom->ComputeSkinning();
|
||||
m_pModelCom->ComputeAnimation();
|
||||
|
||||
Key_Input(fTimeDelta);
|
||||
|
||||
m_pFSM->Update(fTimeDelta);
|
||||
m_pFSM->Update_State(fTimeDelta);
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
|
||||
@@ -114,8 +106,6 @@ HRESULT CPlayer::Render()
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (FAILED(m_pModelCom->Bind_CS_Output(5, i)))
|
||||
return E_FAIL;
|
||||
|
||||
if (FAILED(m_pModelCom->Render(i))) {
|
||||
return E_FAIL;
|
||||
@@ -133,7 +123,10 @@ HRESULT CPlayer::Ready_Components()
|
||||
Desc.fRotationPerSec = XMConvertToRadians(180.0f);
|
||||
Desc.fRadius = 10.f;
|
||||
|
||||
__super::Ready_Components(&Desc);
|
||||
if (FAILED(__super::Ready_Components(&Desc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
|
||||
m_strModelPrototypeTag = TEXT("Prototype_Component_Npc_Model");
|
||||
|
||||
@@ -217,115 +210,379 @@ HRESULT CPlayer::Bind_ShaderResources()
|
||||
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;
|
||||
}
|
||||
|
||||
void CPlayer::Setup_InputConditions()
|
||||
HRESULT CPlayer::InputSystem()
|
||||
{
|
||||
m_InputConditions =
|
||||
if (m_pGameInstance->Key_Down(DIK_1)
|
||||
|| m_pGameInstance->Key_Down(DIK_2)
|
||||
|| m_pGameInstance->Key_Down(DIK_3)
|
||||
|| m_pGameInstance->Key_Down(DIK_4)
|
||||
|| m_pGameInstance->Key_Down(DIK_5)
|
||||
|| m_pGameInstance->Key_Down(DIK_6))
|
||||
{
|
||||
{ FSMSTATE::IDLE_TURN, [&]() { return m_pGameInstance->Key_Down(DIK_LEFT) || m_pGameInstance->Key_Down(DIK_RIGHT) || m_pGameInstance->Key_Down(DIK_DOWN); }},
|
||||
{ FSMSTATE::MOVE, [&]() { return Check(FSMSTATE::WALK) || Check(FSMSTATE::SPRINT) || Check(FSMSTATE::JOG) ||
|
||||
Check(FSMSTATE::DODGE) || Check(FSMSTATE::IDLE_TURN); }},
|
||||
|
||||
|
||||
|
||||
{ FSMSTATE::JOG, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP)
|
||||
/*|| m_pGameInstance->Key_Pressing(DIK_DOWN)*/; }},
|
||||
{ FSMSTATE::FWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP); }},
|
||||
{ FSMSTATE::BWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_DOWN); }},
|
||||
|
||||
{ FSMSTATE::WALK, [&]() { return m_bWalkToggle && m_pGameInstance->Key_Pressing(DIK_UP); }},
|
||||
|
||||
{ FSMSTATE::SPRINT, [&]() { return m_bSprintToggle
|
||||
&& m_pGameInstance->Key_Pressing(DIK_UP); }},
|
||||
{ FSMSTATE::DODGE, [&]() { return m_pGameInstance->Key_Down(DIK_LCONTROL); }},
|
||||
|
||||
{ FSMSTATE::COMBAT, [&]() { return Check(FSMSTATE::SKILL) || Check(FSMSTATE::LIGHT_ATTACK) || Check(FSMSTATE::CAST) || Check(FSMSTATE::SKILL2); }},
|
||||
{ FSMSTATE::SKILL, [&]() { return m_pGameInstance->Key_Down(DIK_R); }},
|
||||
{ FSMSTATE::SKILL2, [&]() { return m_pGameInstance->Key_Down(DIK_Q); }},
|
||||
{ FSMSTATE::LIGHT_ATTACK,[&]() { return m_pGameInstance->Mouse_Up(DIM_LBUTTON); }},
|
||||
{ FSMSTATE::CAST, [&]() { return m_pGameInstance->Key_Down(DIK_1); }},
|
||||
|
||||
{ FSMSTATE::JUMP, [&]() { return m_pGameInstance->Key_Down(DIK_SPACE); } }
|
||||
};
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Key_Input(_float fTimeDelta)
|
||||
HRESULT CPlayer::InputSkill()
|
||||
{
|
||||
if (m_pFSM->Get_CurrState() == FSMSTATE::WALK ||
|
||||
m_pFSM->Get_CurrState() == FSMSTATE::SPRINT||
|
||||
m_pFSM->Get_CurrState() == FSMSTATE::DODGE||
|
||||
m_pFSM->Get_CurrState() == FSMSTATE::JOG)
|
||||
if (
|
||||
m_pGameInstance->Key_Down(DIK_SPACE)
|
||||
|| m_pGameInstance->Key_Down(DIK_LCONTROL)
|
||||
|| m_pGameInstance->Key_Down(DIK_E)
|
||||
|| m_pGameInstance->Key_Down(DIK_R)
|
||||
|| m_pGameInstance->Key_Down(DIK_Q)
|
||||
|| m_pGameInstance->Mouse_Up(DIM_LBUTTON)
|
||||
|| m_pGameInstance->Key_Down(DIK_1)
|
||||
//|| m_pGameInstance->Key_Down(DIK_C)
|
||||
//|| m_pGameInstance->Key_Down(DIK_V)
|
||||
//|| m_pGameInstance->Key_Down(DIK_T)
|
||||
//|| m_pGameInstance->Key_Down(DIK_G)
|
||||
//|| m_pGameInstance->Key_Down(DIK_B)
|
||||
)
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_LEFT))
|
||||
m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if (m_pGameInstance->Key_Pressing(DIK_RIGHT))
|
||||
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
|
||||
HRESULT CPlayer::InputMove()
|
||||
{
|
||||
if (m_pGameInstance->Key_Pressing(DIK_W)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_A)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_S)
|
||||
|| m_pGameInstance->Key_Pressing(DIK_D))
|
||||
{
|
||||
return S_OK;
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleEnter() {
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::IDLE];
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG|FSMSTATE::WALK)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JOG_STOP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::SPRINT)) {
|
||||
// pairAnimInfo = m_Animation[STATEANIM::spr]
|
||||
}
|
||||
}
|
||||
|
||||
IsSprint();
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
IsWalk();
|
||||
HRESULT CPlayer::Behavior_IdleExitCheck()
|
||||
{
|
||||
// S_OK -> 현 상태 유지
|
||||
// E_FAIL -> 현 상태 탈출
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
return S_OK;
|
||||
}
|
||||
if (SUCCEEDED(InputSkill())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_E)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::AAA);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_1)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_IdleExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::IDLE);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
_bool bFoward = m_pGameInstance->Key_Pressing(DIK_W);
|
||||
_bool bLeft = m_pGameInstance->Key_Pressing(DIK_A);
|
||||
_bool bRight = m_pGameInstance->Key_Pressing(DIK_D);
|
||||
_bool bBackward = m_pGameInstance->Key_Pressing(DIK_S);
|
||||
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE | FSMSTATE::DODGE | FSMSTATE::LAND | FSMSTATE::COMBAT)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
// Idle -> Move
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
}
|
||||
else {
|
||||
// ?
|
||||
}
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::DODGE | FSMSTATE::LAND)) {
|
||||
// OtherMove -> AnotherMove
|
||||
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::COMBAT)) {
|
||||
// Combat -> Move
|
||||
|
||||
}
|
||||
}
|
||||
else { // While Moving
|
||||
if (true == m_bSprintToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::SPRINT);
|
||||
pairAnimInfo = m_Animation[STATEANIM::SPRINT];
|
||||
|
||||
}
|
||||
else if (true == m_bWalkToggle) {
|
||||
m_pFSM->Enable_State(FSMSTATE::WALK);
|
||||
if (true == bFoward) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_FWD];
|
||||
}
|
||||
else if (true == bBackward){
|
||||
pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
}
|
||||
//else if (true == bLeft){
|
||||
// pairAnimInfo = m_Animation[STATEANIM::WALK_STOP];
|
||||
//}
|
||||
//else if (true == bRight){
|
||||
// pairAnimInfo = m_Animation[STATEANIM::WALK_BWD];
|
||||
//}
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_MoveExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
return S_OK;
|
||||
}
|
||||
if (SUCCEEDED(InputSkill())) {
|
||||
if (m_pGameInstance->Key_Down(DIK_SPACE)) {
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_LCONTROL)) {
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_E)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::AAA);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_R)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_Q)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
}
|
||||
else if (m_pGameInstance->Mouse_Up(DIM_LBUTTON)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
}
|
||||
else if (m_pGameInstance->Key_Down(DIK_1)) {
|
||||
//m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
}
|
||||
return E_FAIL;
|
||||
}
|
||||
if (SUCCEEDED(InputMove())) {
|
||||
return S_OK;
|
||||
}
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_MoveExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::MOVE|FSMSTATE::SPRINT|FSMSTATE::JOG|FSMSTATE::WALK);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = m_Animation[STATEANIM::JUMP_SPRINT];
|
||||
m_pFSM->Enable_State(FSMSTATE::JUMP);
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE|FSMSTATE::JOG|FSMSTATE::WALK)) {
|
||||
if (m_pFSM->IsEnable_Previous(FSMSTATE::IDLE)) {
|
||||
// Idle -> Jump
|
||||
// pairAnimInfo = Get_AnimInfo(STATEANIM::Jump_IDLE);
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::JOG)) {
|
||||
pairAnimInfo = m_Animation[STATEANIM::JUMP_JOG];
|
||||
}
|
||||
else if (m_pFSM->IsEnable_Previous(FSMSTATE::WALK)) {
|
||||
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Drop?
|
||||
}
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_JumpExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
return S_OK;
|
||||
}
|
||||
if (IsCurrentKeyFrame("Jump")) {
|
||||
m_pFSM->Change_State(FSMSTATE::LAND);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_JumpExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::JUMP);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandEnter()
|
||||
{
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::LAND);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_LandExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
//return S_OK;
|
||||
}
|
||||
if (m_pModelCom->IsFinishedAnim()){
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
} // 혹시 Land to (Jog, Sprint, Dodge) 같은 애니메이션 있으면 여기에 분기 조건 넣으면 됨
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_LandExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::LAND);
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeEnter()
|
||||
{
|
||||
// 혹시 @@ to Dodge 있으면 여기에
|
||||
pair<_uint, _bool> pairAnimInfo = Get_AnimInfo(STATEANIM::DODGE);
|
||||
m_pModelCom->Set_AnimationIndex(pairAnimInfo.first, pairAnimInfo.second);
|
||||
}
|
||||
|
||||
HRESULT CPlayer::Behavior_DodgeExitCheck()
|
||||
{
|
||||
if (SUCCEEDED(InputSystem())) {
|
||||
//Event
|
||||
//return S_OK;
|
||||
}
|
||||
if (m_pModelCom->IsFinishedAnim()){
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CPlayer::Behavior_DodgeExit()
|
||||
{
|
||||
m_pFSM->Disable_State(FSMSTATE::DODGE);
|
||||
}
|
||||
|
||||
void CPlayer::Add_FSM()
|
||||
{
|
||||
#pragma region MOVE
|
||||
m_pFSM->Add_State(FSMSTATE::MOVE, new CState_Move());
|
||||
m_pFSM->Add_State(FSMSTATE::IDLE, new CState_Idle());
|
||||
m_pFSM->Add_State(FSMSTATE::IDLE_TURN, new CState_Idle_Turn());
|
||||
m_pFSM->Add_State(FSMSTATE::WALK, new CState_Walk());
|
||||
m_pFSM->Add_State(FSMSTATE::JOG, new CState_Jog());
|
||||
m_pFSM->Add_State(FSMSTATE::SPRINT, new CState_Sprint());
|
||||
m_pFSM->Add_State(FSMSTATE::DODGE, new CState_Dodge());
|
||||
#pragma region Behavior_Movement_NotFocus
|
||||
{
|
||||
CState_Idle::STATE_IDLE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_IdleEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_IdleExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_IdleExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::IDLE, CState_Idle::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Move::STATE_MOVE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_MoveEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimedelta) { return Behavior_MoveExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_MoveExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::MOVE, CState_Move::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
|
||||
#pragma region COMBAT
|
||||
m_pFSM->Add_State(FSMSTATE::COMBAT, new CState_Combat());
|
||||
m_pFSM->Add_State(FSMSTATE::SKILL, new CState_Skill());
|
||||
m_pFSM->Add_State(FSMSTATE::SKILL2, new CState_Skill2());
|
||||
m_pFSM->Add_State(FSMSTATE::LIGHT_ATTACK, new CState_LightAttack());
|
||||
m_pFSM->Add_State(FSMSTATE::CAST, new CState_Cast());
|
||||
#pragma region Behavior_Movement_Focus
|
||||
{
|
||||
CState_Jump::STATE_JUMP_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_JumpEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_JumpExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_JumpExit(); };
|
||||
m_States.emplace(FSMSTATE::JUMP, CState_Jump::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Land::STATE_LAND_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_LandEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_LandExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_LandExit(); };
|
||||
m_States.emplace(FSMSTATE::LAND, CState_Land::Create(&Desc));
|
||||
}
|
||||
{
|
||||
CState_Dodge::STATE_DODGE_DESC Desc{};
|
||||
Desc.pOwner = this;
|
||||
Desc.funcEnterEvent = [this]() { Behavior_DodgeEnter(); };
|
||||
Desc.funcExitCheck = [this](_float fTimeDelta) { return Behavior_DodgeExitCheck(); };
|
||||
Desc.funcExitEvent = [this]() { Behavior_DodgeExit(); };
|
||||
Desc.funcPriorityUpdate = nullptr;
|
||||
Desc.funcLateUpdate = nullptr;
|
||||
m_States.emplace(FSMSTATE::DODGE, CState_Dodge::Create(&Desc));
|
||||
}
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_NotFocus
|
||||
|
||||
m_pFSM->Add_State(FSMSTATE::JUMP, new CState_Jump());
|
||||
m_pFSM->Add_State(FSMSTATE::LAND, new CState_Land());
|
||||
|
||||
m_pFSM->Add_State(FSMSTATE::ROOT, new CState_Root());
|
||||
|
||||
}
|
||||
|
||||
void CPlayer::Set_FSM()
|
||||
{
|
||||
#pragma region ROOT
|
||||
m_pFSM->Set_Parent(FSMSTATE::MOVE, FSMSTATE::ROOT);
|
||||
m_pFSM->Set_Parent(FSMSTATE::COMBAT, FSMSTATE::ROOT);
|
||||
#pragma endregion
|
||||
#pragma region Behavior_Combat_Focus
|
||||
|
||||
#pragma endregion
|
||||
|
||||
#pragma region MOVE
|
||||
m_pFSM->Set_Parent(FSMSTATE::IDLE, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::IDLE_TURN, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::WALK, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::BWD, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::FWD, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::JOG, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::SPRINT, FSMSTATE::MOVE);
|
||||
m_pFSM->Set_Parent(FSMSTATE::DODGE, FSMSTATE::MOVE);
|
||||
#pragma endregion
|
||||
|
||||
#pragma region COMBAT
|
||||
m_pFSM->Set_Parent(FSMSTATE::SKILL, FSMSTATE::COMBAT);
|
||||
m_pFSM->Set_Parent(FSMSTATE::SKILL2, FSMSTATE::COMBAT);
|
||||
m_pFSM->Set_Parent(FSMSTATE::LIGHT_ATTACK, FSMSTATE::COMBAT);
|
||||
m_pFSM->Set_Parent(FSMSTATE::CAST, FSMSTATE::COMBAT);
|
||||
#pragma endregion
|
||||
}
|
||||
|
||||
void CPlayer::Set_Anim()
|
||||
@@ -418,16 +675,6 @@ void CPlayer::Describe_Entity()
|
||||
|
||||
}
|
||||
|
||||
_bool CPlayer::Check(FSMSTATE::ESTATE state)
|
||||
{
|
||||
for (auto& cond : m_InputConditions)
|
||||
{
|
||||
if (cond.state == state)
|
||||
return cond.checker();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
_bool CPlayer::IsSprint()
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_LSHIFT))
|
||||
@@ -445,3 +692,4 @@ _bool CPlayer::IsWalk()
|
||||
}
|
||||
return false;
|
||||
}
|
||||
////////////////////
|
||||
|
||||
@@ -71,6 +71,7 @@ void CRootModelPart::Update_Anim(_float fTimeDelta)
|
||||
{
|
||||
pModel->Set_PlayAnim(m_pMainModel->Get_PlayAnim());
|
||||
pModel->Set_AnimSpeed(m_pMainModel->Get_AnimSpeed());
|
||||
pModel->ComputeAnimation();
|
||||
pModel->Play_Animation(fTimeDelta,m_pTransformCom);
|
||||
}
|
||||
}
|
||||
@@ -98,7 +99,8 @@ void CRootModelPart::Change_Model(_uint iIndex)
|
||||
CModel* pModel = m_ModelParts[iIndex]->Get_Component<CModel>();
|
||||
|
||||
pModel->Set_AnimationIndex(m_iAnimIndex);
|
||||
pModel->Set_CurrentTrackPosition(m_fTrackPosition);
|
||||
pModel->Set_CurrentTrackPosition(m_fTrackPosition);
|
||||
pModel->ComputeAnimation();
|
||||
pModel->Play_Animation(0.f, m_pTransformCom);
|
||||
|
||||
if (iIndex == ENUM_CLASS(PARTSTYPE::BODY))
|
||||
@@ -112,6 +114,7 @@ void CRootModelPart::Set_Animation(_uint iAnimIndex)
|
||||
{
|
||||
m_pMainModel->Set_AnimationIndex(iAnimIndex);
|
||||
m_pMainModel->Set_CurrentTrackPosition(0.f);
|
||||
m_pMainModel->ComputeAnimation();
|
||||
m_pMainModel->Play_Animation(0.f, m_pTransformCom);
|
||||
for (auto& PartObject : m_ModelParts)
|
||||
{
|
||||
@@ -120,6 +123,7 @@ void CRootModelPart::Set_Animation(_uint iAnimIndex)
|
||||
{
|
||||
pModel->Set_AnimationIndex(m_pMainModel->Get_AnimIndex());
|
||||
pModel->Set_CurrentTrackPosition(m_pMainModel->Get_CurrentTrackPosition());
|
||||
pModel->ComputeAnimation();
|
||||
pModel->Play_Animation(0.f, m_pTransformCom);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Cast.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Cast::CState_Cast()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Cast::Enter()
|
||||
{
|
||||
if (m_pFSM->Get_PrevState() == FSMSTATE::CAST)
|
||||
return;
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::CAST);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Cast::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Cast::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Cast::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::CAST))
|
||||
{
|
||||
_uint combo = m_pOwner->Next_LightCombo();
|
||||
m_pOwner->Set_LightCombo(combo);
|
||||
if (combo >= 3)
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
return true;
|
||||
}
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::CAST);
|
||||
m_pModel->Set_AnimationIndex(anim.first + combo, anim.second);
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL2))
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Cast::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Cast::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -4,51 +4,48 @@
|
||||
|
||||
|
||||
CState_Combat::CState_Combat()
|
||||
:CState()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Combat::Enter()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK))
|
||||
m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::CAST))
|
||||
m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL2))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
void CState_Combat::Update(_float fTimeDelta)
|
||||
HRESULT CState_Combat::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Combat::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
_bool CState_Combat::CheckExitState()
|
||||
HRESULT CState_Combat::Initialize(STATE_COMBAT_DESC* pDesc)
|
||||
{
|
||||
if (m_pOwner->IsCurrentKeyFrame("Jump"))
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
return true;
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pOwner = pDesc->pOwner;
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return false;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Combat* CState_Combat::Create(STATE_COMBAT_DESC* pDesc)
|
||||
{
|
||||
CState_Combat* pInstance = new CState_Combat;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Combat::Free()
|
||||
{
|
||||
|
||||
@@ -4,43 +4,54 @@
|
||||
|
||||
|
||||
CState_Dodge::CState_Dodge()
|
||||
:CState()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Dodge::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::DODGE);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
void CState_Dodge::Update(_float fTimeDelta)
|
||||
HRESULT CState_Dodge::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
if (nullptr != m_funcPriorityUpdate) {
|
||||
m_funcPriorityUpdate(fTimeDelta);
|
||||
}
|
||||
if (FAILED(__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (nullptr != m_funcLateUpdate) {
|
||||
m_funcLateUpdate(fTimeDelta);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Dodge::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
_bool CState_Dodge::CheckExitState()
|
||||
HRESULT CState_Dodge::Initialize(STATE_DODGE_DESC* pDesc)
|
||||
{
|
||||
if (m_pModel->IsFinishedAnim())
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
|
||||
m_funcLateUpdate = pDesc->funcLateUpdate;
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT) && m_pOwner->IsCurrentKeyFrame("Dodge"))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK) && m_pOwner->IsCurrentKeyFrame("Dodge"))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JOG) && m_pOwner->IsCurrentKeyFrame("Dodge"))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
|
||||
|
||||
return false;
|
||||
CState_Dodge* CState_Dodge::Create(STATE_DODGE_DESC* pDesc)
|
||||
{
|
||||
CState_Dodge* pInstance = new CState_Dodge;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Dodge::Free()
|
||||
|
||||
@@ -3,62 +3,54 @@
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Idle::CState_Idle()
|
||||
:CState()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Idle::Enter()
|
||||
{
|
||||
if (m_pFSM->Get_PrevState() == FSMSTATE::JOG)
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_STOP);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
return;
|
||||
}
|
||||
if (m_pFSM->Get_PrevState() == FSMSTATE::WALK)
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_STOP);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
return;
|
||||
}
|
||||
else
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
void CState_Idle::Update(_float fTimeDelta)
|
||||
HRESULT CState_Idle::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
if (nullptr != m_funcPriorityUpdate) {
|
||||
m_funcPriorityUpdate(fTimeDelta);
|
||||
}
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (nullptr != m_funcLateUpdate) {
|
||||
m_funcLateUpdate(fTimeDelta);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Idle::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
_bool CState_Idle::CheckExitState()
|
||||
HRESULT CState_Idle::Initialize(STATE_IDLE_DESC* pDesc)
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::JOG))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
|
||||
m_funcLateUpdate = pDesc->funcLateUpdate;
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::IDLE_TURN))
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE_TURN);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
|
||||
return false;
|
||||
CState_Idle* CState_Idle::Create(STATE_IDLE_DESC* pDesc)
|
||||
{
|
||||
CState_Idle* pInstance = new CState_Idle;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Idle::Free()
|
||||
|
||||
@@ -1,88 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Idle_Turn.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Idle_Turn::CState_Idle_Turn()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Enter()
|
||||
{
|
||||
if (m_pGameInstance->Key_Down(DIK_LEFT))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_L);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_RIGHT))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_R);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
if (m_pGameInstance->Key_Down(DIK_DOWN))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::IDLE_TURN_BWD);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Idle_Turn::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::MOVE))
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::COMBAT))
|
||||
{
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL2))
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK))
|
||||
m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::CAST))
|
||||
m_pFSM->Change_State(FSMSTATE::CAST);
|
||||
}
|
||||
|
||||
if (m_pModel->IsFinishedAnim())
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Idle_Turn::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Jog.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Jog::CState_Jog()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Jog::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JOG_FWD);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
|
||||
m_pOwner->Reset_Sprint();
|
||||
m_pOwner->Reset_Walk();
|
||||
}
|
||||
|
||||
void CState_Jog::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Jog::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Jog::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
else if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
else if (!m_pOwner->Check(FSMSTATE::JOG))
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Jog::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Jog::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -4,50 +4,51 @@
|
||||
|
||||
|
||||
CState_Jump::CState_Jump()
|
||||
:CState()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Jump::Enter()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_SPRINT);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
return;
|
||||
}
|
||||
if (m_pOwner->Check(FSMSTATE::JOG))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP_JOG);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
return;
|
||||
}
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::JUMP);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
void CState_Jump::Update(_float fTimeDelta)
|
||||
HRESULT CState_Jump::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Jump::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
_bool CState_Jump::CheckExitState()
|
||||
HRESULT CState_Jump::Initialize(STATE_JUMP_DESC* pDesc)
|
||||
{
|
||||
if (m_pOwner->IsCurrentKeyFrame("Jump"))
|
||||
m_pFSM->Change_State(FSMSTATE::LAND);
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return false;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Jump* CState_Jump::Create(STATE_JUMP_DESC* pDesc)
|
||||
{
|
||||
CState_Jump* pInstance = new CState_Jump;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Jump::Free()
|
||||
{
|
||||
__super::Free();
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Jump::Describe_Entity()
|
||||
|
||||
@@ -4,44 +4,51 @@
|
||||
|
||||
|
||||
CState_Land::CState_Land()
|
||||
:CState()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Land::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LAND);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
void CState_Land::Update(_float fTimeDelta)
|
||||
HRESULT CState_Land::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Land::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
_bool CState_Land::CheckExitState()
|
||||
HRESULT CState_Land::Initialize(STATE_LAND_DESC* pDesc)
|
||||
{
|
||||
if (m_pModel->IsFinishedAnim())
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JOG))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
return false;
|
||||
CState_Land* CState_Land::Create(STATE_LAND_DESC* pDesc)
|
||||
{
|
||||
CState_Land* pInstance = new CState_Land;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Land::Free()
|
||||
{
|
||||
__super::Free();
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Land::Describe_Entity()
|
||||
|
||||
@@ -1,69 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_LightAttack.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_LightAttack::CState_LightAttack()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_LightAttack::Enter()
|
||||
{
|
||||
if (m_pFSM->Get_PrevState() == FSMSTATE::LIGHT_ATTACK)
|
||||
return;
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LIGHT_ATTACK);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_LightAttack::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_LightAttack::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_LightAttack::CheckExitState()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK))
|
||||
{
|
||||
_uint combo = m_pOwner->Next_LightCombo();
|
||||
m_pOwner->Set_LightCombo(combo);
|
||||
if (combo >= 4)
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
return true;
|
||||
}
|
||||
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::LIGHT_ATTACK);
|
||||
m_pModel->Set_AnimationIndex(anim.first + combo, anim.second);
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SKILL2))
|
||||
{
|
||||
m_pOwner->Reset_LightCombo();
|
||||
m_pFSM->Change_State(FSMSTATE::SKILL2);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void CState_LightAttack::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_LightAttack::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -4,46 +4,56 @@
|
||||
|
||||
|
||||
CState_Move::CState_Move()
|
||||
:CState()
|
||||
:CState_Root()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Move::Enter()
|
||||
{
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JOG))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::IDLE_TURN))
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE_TURN);
|
||||
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
__super::Enter();
|
||||
}
|
||||
|
||||
void CState_Move::Update(_float fTimeDelta)
|
||||
HRESULT CState_Move::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
if (nullptr != m_funcPriorityUpdate) {
|
||||
m_funcPriorityUpdate(fTimeDelta);
|
||||
}
|
||||
if (E_FAIL == (__super::Update(fTimeDelta))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
if (nullptr != m_funcLateUpdate) {
|
||||
m_funcLateUpdate(fTimeDelta);
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void CState_Move::Exit()
|
||||
{
|
||||
__super::Exit();
|
||||
}
|
||||
|
||||
_bool CState_Move::CheckExitState()
|
||||
HRESULT CState_Move::Initialize(STATE_MOVE_DESC* pDesc)
|
||||
{
|
||||
return false;
|
||||
if (FAILED(__super::Initialize(pDesc))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_funcPriorityUpdate = pDesc->funcPriorityUpdate;
|
||||
m_funcLateUpdate = pDesc->funcLateUpdate;
|
||||
|
||||
m_pModel = m_pOwner->Get_Component<CModel>();
|
||||
m_pFSM = m_pOwner->Get_Component<CFSM>();
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
CState_Move* CState_Move::Create(STATE_MOVE_DESC* pDesc)
|
||||
{
|
||||
CState_Move* pInstance = new CState_Move;
|
||||
if (FAILED(pInstance->Initialize(pDesc))) {
|
||||
SAFE_RELEASE(pInstance);
|
||||
}
|
||||
return pInstance;
|
||||
}
|
||||
|
||||
void CState_Move::Free()
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
#include "State_Root.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Root::CState_Root()
|
||||
:CState()
|
||||
{
|
||||
@@ -10,48 +9,38 @@ CState_Root::CState_Root()
|
||||
|
||||
void CState_Root::Enter()
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::COMBAT))
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
|
||||
else
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
if (nullptr != m_funcEnterEvent) {
|
||||
m_funcEnterEvent();
|
||||
}
|
||||
}
|
||||
|
||||
void CState_Root::Update(_float fTimeDelta)
|
||||
HRESULT CState_Root::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
HRESULT hr = { S_OK };
|
||||
if (nullptr != m_funcExitCheck) {
|
||||
hr = m_funcExitCheck(fTimeDelta);
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
void CState_Root::Exit()
|
||||
{
|
||||
if (nullptr != m_funcExitEvent) {
|
||||
m_funcExitEvent();
|
||||
}
|
||||
}
|
||||
|
||||
_bool CState_Root::CheckExitState()
|
||||
HRESULT CState_Root::Initialize(STATE_ROOT_DESC* pArg)
|
||||
{
|
||||
if (m_pOwner->Check(FSMSTATE::COMBAT))
|
||||
{
|
||||
if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::COMBAT)
|
||||
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
if (m_pFSM->Get_Current()->Get_Parent()->Get_State() == FSMSTATE::COMBAT)
|
||||
return false;
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::MOVE))
|
||||
{
|
||||
if (m_pFSM->Get_Current()->Get_Parent()->Get_State() != FSMSTATE::MOVE)
|
||||
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
if (FAILED(__super::Initialize(pArg))) {
|
||||
return E_FAIL;
|
||||
}
|
||||
m_funcExitCheck = pArg->funcExitCheck;
|
||||
m_funcEnterEvent = pArg->funcEnterEvent;
|
||||
m_funcExitEvent = pArg->funcExitEvent;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
void CState_Root::Free()
|
||||
{
|
||||
__super::Free();
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Skill.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Skill::CState_Skill()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Skill::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SKILL);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Skill::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Skill::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Skill::CheckExitState()
|
||||
{
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Skill::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Skill::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Skill2.h"
|
||||
#include "Unit.h"
|
||||
|
||||
|
||||
CState_Skill2::CState_Skill2()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Skill2::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SKILL2);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Skill2::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Skill2::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Skill2::CheckExitState()
|
||||
{
|
||||
if (m_pModel->IsFinishedAnim())
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Skill2::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Skill2::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,48 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Sprint.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Sprint::CState_Sprint()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Sprint::Enter()
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::SPRINT);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
void CState_Sprint::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
void CState_Sprint::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Sprint::CheckExitState()
|
||||
{
|
||||
if (!m_pOwner->Check(FSMSTATE::SPRINT))
|
||||
m_pFSM->Change_State(FSMSTATE::JOG);
|
||||
|
||||
else if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Sprint::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Sprint::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
#include "pch.h"
|
||||
#include "State_Walk.h"
|
||||
#include "Unit.h"
|
||||
|
||||
CState_Walk::CState_Walk()
|
||||
:CState()
|
||||
{
|
||||
}
|
||||
|
||||
void CState_Walk::Enter()
|
||||
{
|
||||
if(m_pOwner->Check(FSMSTATE::FWD))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_FWD);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
|
||||
if (m_pOwner->Check(FSMSTATE::BWD))
|
||||
{
|
||||
auto anim = m_pOwner->Get_AnimInfo(STATEANIM::WALK_BWD);
|
||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||
}
|
||||
}
|
||||
|
||||
void CState_Walk::Update(_float fTimeDelta)
|
||||
{
|
||||
if (CheckExitState())
|
||||
return;
|
||||
}
|
||||
|
||||
void CState_Walk::Exit()
|
||||
{
|
||||
}
|
||||
|
||||
_bool CState_Walk::CheckExitState()
|
||||
{
|
||||
if (!m_pOwner->Check(FSMSTATE::WALK))
|
||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||
|
||||
else if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
void CState_Walk::Free()
|
||||
{
|
||||
__super::Free();
|
||||
}
|
||||
|
||||
void CState_Walk::Describe_Entity()
|
||||
{
|
||||
}
|
||||
@@ -18,8 +18,12 @@ class CHpBarBG final : public CElementObject
|
||||
virtual void Late_Update(_float fTimeDelta);
|
||||
virtual HRESULT Render() override;
|
||||
virtual _vector Get_WorldPostion() override;
|
||||
virtual void Lerp_PosX(_float X) override;
|
||||
|
||||
|
||||
public:
|
||||
void Heal(_float fTimeDelta);
|
||||
void Hit(_float fTimeDelta);
|
||||
virtual void SizeUpX(_float SizeX) override;
|
||||
private:
|
||||
virtual HRESULT Bind_ShaderResources() override;
|
||||
virtual HRESULT Ready_Components(void* pArg) override;
|
||||
@@ -27,11 +31,17 @@ class CHpBarBG final : public CElementObject
|
||||
virtual HRESULT Initialize(void* pArg) override;
|
||||
|
||||
private:
|
||||
CTexture* m_pDiffuse_TextureCom = { nullptr };
|
||||
CTexture* m_pDiffuse_TextureCom1 = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
|
||||
CTexture* m_pDiffuse_TextureCom = { nullptr };
|
||||
CTexture* m_pDiffuse_TextureCom1 = { nullptr };
|
||||
CShader* m_pShaderCom = { nullptr };
|
||||
CVIBuffer_Rect* m_pVIBufferCom = { nullptr };
|
||||
|
||||
_float m_fMaxHp{};
|
||||
_float m_fCurrentHp{};
|
||||
_float m_fHpBar{};
|
||||
_float m_fDamage{};
|
||||
_float TargetHp{};
|
||||
_float2 m_fHpBG{};
|
||||
public:
|
||||
static CHpBarBG* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, class CGameObject* pOwner) override;
|
||||
|
||||
@@ -51,6 +51,7 @@ class CLoader final : public CBase
|
||||
HRESULT Asset_FileLoad(const _char* pDirectoryPath, const _tchar* pPreName, function<HRESULT(_wstring, const _char*)> AddPrototypeEvent);
|
||||
HRESULT MapFolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector<_wstring>& ModelPrototypeTags, vector<filesystem::path>& ModelPrototypePath);
|
||||
future<void> Deferred_FolderLoad(const _char* pDirectoryPath, const _char* pFileExt, _bool bUseTag, vector<FOLDER_LOAD*>** OutContents);
|
||||
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);
|
||||
|
||||
@@ -29,18 +29,20 @@ class CPlayer final : public CUnit
|
||||
_bool Set_Sprint(_bool bSprint) { m_bSprintToggle = bSprint; }
|
||||
|
||||
private:
|
||||
unordered_map<size_t, CState*> m_States = { };
|
||||
size_t m_iStateMask = { 0 };
|
||||
_float m_fDirectionRadian = 0.f;
|
||||
|
||||
vector<InputCondition> m_InputConditions;
|
||||
_bool m_bSprintToggle = { false };
|
||||
_bool m_bWalkToggle = { false };
|
||||
|
||||
class CCamPosition_Player* m_pCamPosition_TopDown_LookPart = { nullptr };
|
||||
class CCamPosition_Arm* m_pCamPosition_TopDown_FollowPart = { nullptr };
|
||||
private:
|
||||
HRESULT Ready_Components();
|
||||
HRESULT Ready_Parts();
|
||||
HRESULT Bind_ShaderResources();
|
||||
void Setup_InputConditions();
|
||||
void Key_Input(_float fTimeDelta);
|
||||
|
||||
public:
|
||||
static CPlayer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||
@@ -50,11 +52,35 @@ class CPlayer final : public CUnit
|
||||
#pragma region STATE
|
||||
private:
|
||||
virtual void Add_FSM();
|
||||
virtual void Set_FSM();
|
||||
virtual void Set_Anim();
|
||||
_bool Check(FSMSTATE::ESTATE state);
|
||||
_bool IsSprint();
|
||||
_bool IsWalk();
|
||||
|
||||
HRESULT InputSystem();
|
||||
HRESULT InputSkill();
|
||||
HRESULT InputMove();
|
||||
|
||||
void Behavior_IdleEnter();
|
||||
HRESULT Behavior_IdleExitCheck();
|
||||
void Behavior_IdleExit();
|
||||
|
||||
void Behavior_MoveEnter();
|
||||
HRESULT Behavior_MoveExitCheck();
|
||||
void Behavior_MoveExit();
|
||||
|
||||
void Behavior_JumpEnter();
|
||||
HRESULT Behavior_JumpExitCheck();
|
||||
void Behavior_JumpExit();
|
||||
|
||||
void Behavior_LandEnter();
|
||||
HRESULT Behavior_LandExitCheck();
|
||||
void Behavior_LandExit();
|
||||
|
||||
void Behavior_DodgeEnter();
|
||||
HRESULT Behavior_DodgeExitCheck();
|
||||
void Behavior_DodgeExit();
|
||||
|
||||
|
||||
public:
|
||||
virtual void Reset_Sprint() { m_bSprintToggle = false; }
|
||||
virtual void Reset_Walk() { m_bWalkToggle = false; }
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Cast final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Cast();
|
||||
virtual ~CState_Cast() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
@@ -1,19 +1,31 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
#include "State_Root.h"
|
||||
|
||||
class CState_Combat final : public CState
|
||||
NS_BEGIN(Editor)
|
||||
|
||||
class CState_Combat final : public CState_Root
|
||||
{
|
||||
public:
|
||||
typedef struct tagCombat : public CState_Root::STATE_ROOT_DESC {
|
||||
|
||||
}STATE_COMBAT_DESC;
|
||||
private:
|
||||
CState_Combat();
|
||||
virtual ~CState_Combat() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_COMBAT_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Combat* Create(STATE_COMBAT_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
NS_END
|
||||
|
||||
@@ -1,19 +1,32 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
#include "State_Root.h"
|
||||
|
||||
class CState_Dodge final : public CState
|
||||
class CState_Dodge final : public CState_Root
|
||||
{
|
||||
public:
|
||||
typedef struct tagDodge : public CState_Root::STATE_ROOT_DESC {
|
||||
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
|
||||
}STATE_DODGE_DESC;
|
||||
public:
|
||||
CState_Dodge();
|
||||
virtual ~CState_Dodge() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
private:
|
||||
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_DODGE_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Dodge* Create(STATE_DODGE_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
@@ -1,20 +1,32 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
#include "State_Root.h"
|
||||
|
||||
class CState_Idle final : public CState
|
||||
class CState_Idle final : public CState_Root
|
||||
{
|
||||
public:
|
||||
typedef struct tagIdle : public CState_Root::STATE_ROOT_DESC {
|
||||
function<void(_float fTimeDelta)> funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> funcLateUpdate = { nullptr };
|
||||
}STATE_IDLE_DESC;
|
||||
public:
|
||||
CState_Idle();
|
||||
virtual ~CState_Idle() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual HRESULT Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
private:
|
||||
function<void(_float fTimeDelta)> m_funcPriorityUpdate = { nullptr };
|
||||
function<void(_float fTimeDelta)> m_funcLateUpdate = { nullptr };
|
||||
|
||||
private:
|
||||
HRESULT Initialize(STATE_IDLE_DESC* pDesc);
|
||||
|
||||
public:
|
||||
static CState_Idle* Create(STATE_IDLE_DESC* pDesc);
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
class CState_Idle_Turn final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Idle_Turn();
|
||||
virtual ~CState_Idle_Turn() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#pragma once
|
||||
#include "Editor_Define.h"
|
||||
#include "State.h"
|
||||
|
||||
|
||||
class CState_Jog final : public CState
|
||||
{
|
||||
public:
|
||||
CState_Jog();
|
||||
virtual ~CState_Jog() = default;
|
||||
|
||||
public:
|
||||
virtual void Enter();
|
||||
virtual void Update(_float fTimeDelta);
|
||||
virtual void Exit();
|
||||
virtual _bool CheckExitState();
|
||||
|
||||
public:
|
||||
virtual void Free() override;
|
||||
virtual void Describe_Entity();
|
||||
};
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user