Skip to content

Commit 4f23a71

Browse files
committed
feat: Player 키 크기 조절 추가.
1 parent b2ae0b7 commit 4f23a71

13 files changed

+185
-112
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
#include "pch.h"
22
#include "AreaAttackComponent.h"
3+
4+
AreaAttackComponent::AreaAttackComponent()
5+
{
6+
}

VisionpredatorProcess/AreaAttackComponent.h

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
#include "Component.h"
33
struct AreaAttackComponent : public Component
44
{
5+
AreaAttackComponent();
6+
57
VP_JSONBODY(AreaAttackComponent, Damage);
68
float Damage{};
79
};

VisionpredatorProcess/AreaAttackSystem.cpp

+12-13
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,26 @@ AreaAttackSystem::AreaAttackSystem(std::shared_ptr<SceneManager> sceneManager) :
55
{
66
}
77

8+
void AreaAttackSystem::TriggerAttack(AreaAttackComponent& area, EnemyComponent& enemy)
9+
{
10+
enemy.HP -= area.Damage;
11+
}
812

913
void AreaAttackSystem::EnterTrigger(std::pair<uint32_t, uint32_t> entitypair)
1014
{
1115
auto entity_first = GetSceneManager()->GetEntity(entitypair.first);
1216
auto entity_second = GetSceneManager()->GetEntity(entitypair.second);
1317

14-
//if (entity_first-> HasComponent<AreaAttackSystem>)
15-
//{
16-
//}
17-
//if (true)
18-
//{
19-
20-
21-
22-
23-
//}
24-
25-
26-
18+
if (entity_first->HasComponent<AreaAttackComponent>()&& entity_second->HasComponent<EnemyComponent>())
19+
TriggerAttack(*entity_first->GetComponent<AreaAttackComponent>(), *entity_second->GetComponent<EnemyComponent>());
20+
else if (entity_first->HasComponent<EnemyComponent>() && entity_second->HasComponent<AreaAttackComponent>())
21+
TriggerAttack(*entity_second->GetComponent<AreaAttackComponent>(), *entity_first->GetComponent<EnemyComponent>());
2722
}
2823

24+
2925
void AreaAttackSystem::ExitTrigger(std::pair<uint32_t, uint32_t> entitypair)
3026
{
27+
3128
}
29+
30+

VisionpredatorProcess/AreaAttackSystem.h

+2
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,7 @@ public :
1212
// ITriggerableÀ»(¸¦) ÅëÇØ »ó¼ÓµÊ
1313
void EnterTrigger(std::pair<uint32_t, uint32_t> entitypair) override;
1414
void ExitTrigger(std::pair<uint32_t, uint32_t> entitypair) override;
15+
void TriggerAttack(AreaAttackComponent& area ,EnemyComponent& enemy);
16+
1517
};
1618

VisionpredatorProcess/DataRegister_Vispred.cpp

+11-6
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,18 @@ void VispredRegister::Register_Components()
2525
, PlayerComponent::GravityPower
2626
, PlayerComponent::StaticFriction
2727
, PlayerComponent::DynamicFriction
28-
, PlayerComponent::WalkSoundKey1, PlayerComponent::WalkSoundKey2, PlayerComponent::Volume_Walk
29-
, PlayerComponent::RunSoundKey1, PlayerComponent::RunSoundKey2, PlayerComponent::Volume_Run
30-
, PlayerComponent::JumpSoundkey, PlayerComponent::Volume_Jump
31-
, PlayerComponent::SlideSoundkey, PlayerComponent::Volume_Slide
32-
, PlayerComponent::SitSoundKey, PlayerComponent::Volume_Sit
33-
, PlayerComponent::HurtSoundKey, PlayerComponent::Volume_Hurt
28+
3429
);
30+
META_ADD_COMP(PlayerSoundComponent, PlayerSoundComponent::WalkSoundKey1, PlayerSoundComponent::WalkSoundKey2, PlayerSoundComponent::Volume_Walk
31+
, PlayerSoundComponent::RunSoundKey1, PlayerSoundComponent::RunSoundKey2, PlayerSoundComponent::Volume_Run
32+
, PlayerSoundComponent::JumpSoundkey, PlayerSoundComponent::Volume_Jump
33+
, PlayerSoundComponent::SlideSoundkey, PlayerSoundComponent::Volume_Slide
34+
, PlayerSoundComponent::SitSoundKey, PlayerSoundComponent::Volume_Sit
35+
, PlayerSoundComponent::HurtSoundKey, PlayerSoundComponent::Volume_Hurt
36+
)
37+
38+
39+
3540
META_ADD_COMP(EnemyComponent, EnemyComponent::HP, EnemyComponent::CurrentFSM, EnemyComponent::HorizontalFOV, EnemyComponent::VerticalFOV, EnemyComponent::NearZ, EnemyComponent::FarZ, EnemyComponent::IsModelFlipped);
3641
META_ADD_COMP(GunComponent, GunComponent::Type,GunComponent::ThrowDamage, GunComponent::BulletPrefab,GunComponent::GunSoundPrefab, GunComponent::CoolTime, GunComponent::CurrentBullet, GunComponent::Bullets,GunComponent::RecoilPos, GunComponent::RecoilMaxXY, GunComponent::RecoilTime, GunComponent::RecoilPercent);
3742
}

VisionpredatorProcess/PlayerComponent.h

+7-30
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,9 @@ struct PlayerComponent :
55
public Component
66
{
77
PlayerComponent();
8-
VP_JSONBODY(PlayerComponent,
9-
RecoilMode
8+
VP_JSONBODY(PlayerComponent,RecoilMode
109
,HandName, CameraPosName, CameraName, FirePosName, LongswordName
11-
, MaxHP, HP, Sencitive, WalkSpeed, RunSpeed, SlideDuration, StaticFriction, DynamicFriction, JumpForce, AirControlPercent, GravityPower, WalkSoundKey1, WalkSoundKey2, Volume_Walk, RunSoundKey1, RunSoundKey2, Volume_Run, JumpSoundkey, Volume_Jump, SlideSoundkey, Volume_Slide, SitSoundKey, Volume_Sit, HurtSoundKey, Volume_Hurt, RecoilProgress, RecoilReturnTime)
10+
, MaxHP, HP, Sencitive, WalkSpeed, RunSpeed, SlideDuration, StaticFriction, DynamicFriction, JumpForce, AirControlPercent, GravityPower, RecoilProgress, RecoilReturnTime)
1211

1312
VisPred::Game::GunRecoilMode RecoilMode{};
1413
std::string HandName{};
@@ -38,9 +37,14 @@ struct PlayerComponent :
3837
/// <summary>
3938
/// °ÔÀÓ·ÎÁ÷À» À§ÇÑ º¯¼öµé
4039
/// </summary>
40+
VPMath::Vector3 DownCameraPos{};
4141
VPMath::Vector3 SitCameraPos{};
42+
VPMath::Vector3 SlideCameraPos{};
4243
float SitHeight{};
4344
float SitHeightDiff{};
45+
float SlideHeight{};
46+
float SlideHeightDiff{};
47+
4448
float CamTransDuration = 0.07f;
4549
float CamTransProgress = 0.f;
4650
VPMath::Vector3 DefalutCameraPos{};
@@ -52,37 +56,10 @@ struct PlayerComponent :
5256
uint32_t PreSearchedItemID{};
5357
uint32_t GunEntityID{};
5458
uint32_t ThrowingGunEntityID{};
55-
//std::weak_ptr<Entity> SearchedEntity;
56-
//std::weak_ptr<Entity> PreSearchedEntity;
57-
//std::weak_ptr<Entity> GunEntity;
58-
//std::weak_ptr<Entity>ThrowingGunEntity{};
59-
60-
6159
VisPred::Game::GunType ShootType{};
6260
bool HasGun=false;
6361
float GunprogressTime{};
6462
bool ReadyToShoot{};
65-
66-
float Volume_Walk { 0.1f };
67-
float Volume_Run { 0.1f };
68-
float Volume_Jump { 0.1f };
69-
float Volume_Slide { 0.1f };
70-
float Volume_Sit { 0.1f };
71-
float Volume_Hurt { 0.1f };
72-
std::string WalkSoundKey1 = "Player_Walk1";
73-
std::string WalkSoundKey2 = "Player_Walk2";
74-
std::string RunSoundKey1 = "Player_Run1";
75-
std::string RunSoundKey2 = "Player_Run2";
76-
std::string JumpSoundkey = "Player_Jump";
77-
std::string SlideSoundkey = "Player_Slide";
78-
std::string SitSoundKey = "Player_Sit";
79-
std::string HurtSoundKey = "Player_Hurt";
80-
bool Played_Walk1{};
81-
bool Played_Jump{};
82-
bool Played_Slide{};
83-
bool Played_Sit{};
84-
bool Played_Run1{};
85-
8663
bool IsRotated=false;
8764
bool PlayerCamereShake{};
8865
bool IsGunRecoiling{};
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "pch.h"
2+
#include "PlayerSoundComponent.h"
3+
4+
PlayerSoundComponent::PlayerSoundComponent()
5+
{
6+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#pragma once
2+
#include <Component.h>
3+
struct PlayerSoundComponent:
4+
public Component
5+
{
6+
PlayerSoundComponent();
7+
VP_JSONBODY(PlayerSoundComponent, Volume_Walk, Volume_Run, Volume_Jump, Volume_Slide, Volume_Sit, Volume_Hurt, WalkSoundKey1, WalkSoundKey2, RunSoundKey1, RunSoundKey2, JumpSoundkey, SlideSoundkey, SitSoundKey, HurtSoundKey);
8+
float Volume_Walk{ 0.05000000074505806f };
9+
float Volume_Run{ 0.02500000037252903f };
10+
float Volume_Jump{ 0.03999999910593033f };
11+
float Volume_Slide{ 0.20000000298023224f };
12+
float Volume_Sit{ 0.4000000059604645f };
13+
float Volume_Hurt{ 0.1f };
14+
std::string WalkSoundKey1 = "Player_Walk1";
15+
std::string WalkSoundKey2 = "Player_Walk2";
16+
std::string RunSoundKey1 = "Player_Run1";
17+
std::string RunSoundKey2 = "Player_Run2";
18+
std::string JumpSoundkey = "Player_Jump";
19+
std::string SlideSoundkey = "Player_Slide";
20+
std::string SitSoundKey = "Player_Sit";
21+
std::string HurtSoundKey = "Player_Hurt";
22+
bool Played_Walk1{};
23+
bool Played_Jump{};
24+
bool Played_Slide{};
25+
bool Played_Sit{};
26+
bool Played_Run1{};
27+
28+
29+
};
30+

0 commit comments

Comments
 (0)