코스트 체크 완성

This commit is contained in:
2023-10-10 23:59:57 +09:00
parent 2a22ff140f
commit fe6d559697
4 changed files with 19 additions and 15 deletions

BIN
Content/Character/Lb/BP_Lb.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/Maps/DevMap.umap (Stored with Git LFS)

Binary file not shown.

View File

@@ -246,8 +246,8 @@ void ADefaultPlayerController::SetupInputComponent()
void ADefaultPlayerController::Skill1() void ADefaultPlayerController::Skill1()
{ {
//if (!(GetPlayerState<ADefaultPlayerState>()->Stats.Mana >= 100)) if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill1Cost]))
// return; return;
FVector Location = GetPawn()->GetActorLocation(); FVector Location = GetPawn()->GetActorLocation();
Location.Z = 0; Location.Z = 0;
@@ -265,6 +265,9 @@ void ADefaultPlayerController::Skill1()
void ADefaultPlayerController::Skill2() void ADefaultPlayerController::Skill2()
{ {
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill2Cost]))
return;
FVector Location = GetPawn()->GetActorLocation(); FVector Location = GetPawn()->GetActorLocation();
Location.Z = 0; Location.Z = 0;
@@ -281,6 +284,9 @@ void ADefaultPlayerController::Skill2()
void ADefaultPlayerController::Skill3() void ADefaultPlayerController::Skill3()
{ {
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill3Cost]))
return;
FVector Location = GetPawn()->GetActorLocation(); FVector Location = GetPawn()->GetActorLocation();
Location.Z = 0; Location.Z = 0;
@@ -297,6 +303,9 @@ void ADefaultPlayerController::Skill3()
void ADefaultPlayerController::Skill4Triggered() void ADefaultPlayerController::Skill4Triggered()
{ {
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill4Cost]))
return;
FVector Location = GetPawn()->GetActorLocation(); FVector Location = GetPawn()->GetActorLocation();
Location.Z = 0; Location.Z = 0;
@@ -313,15 +322,6 @@ void ADefaultPlayerController::Skill4Triggered()
void ADefaultPlayerController::Skill4Completed() void ADefaultPlayerController::Skill4Completed()
{ {
FVector Location = GetPawn()->GetActorLocation();
Location.Z = 0;
Server_StopMove();
Multicast_StopMove();
Multicast_SetRotation(GetMouseHitLocation());
Server_SetRotation(GetMouseHitLocation());
UE_LOG(LogTemp, Warning, TEXT("Skill4 Completed")); UE_LOG(LogTemp, Warning, TEXT("Skill4 Completed"));
GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Attack); GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Attack);
GetPlayerState<ADefaultPlayerState>()->SetAttackType(CooldownType::Skill4Comlpleted); GetPlayerState<ADefaultPlayerState>()->SetAttackType(CooldownType::Skill4Comlpleted);

View File

@@ -96,7 +96,7 @@ enum class EStats : uint8
{ {
Health, Health,
HPRegeneration, HPRegeneration,
HealAndShieldpower, HealAndShieldpower,
Armor, Armor,
MagicResistance, MagicResistance,
Tenacity, Tenacity,
@@ -127,5 +127,9 @@ enum class EStats : uint8
HealthRegenerationGrowth, HealthRegenerationGrowth,
ManaGrowth, ManaGrowth,
ManaRegenerationGrowth, ManaRegenerationGrowth,
Skill1Cost,
Skill2Cost,
Skill3Cost,
Skill4Cost,
SIZE SIZE
}; };