From 598a21efc3f984ba4839d0bde40fdb141510437d Mon Sep 17 00:00:00 2001 From: HappyTanuki Date: Tue, 14 Nov 2023 02:44:53 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A8=B8=EC=A7=80=20=EC=99=84=EB=A3=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BP_DefaultPlayerCharacter.uasset | 4 ++-- .../Bp_DefaultplayerController.uasset | 4 ++-- Content/Character/Allium/BP_Allium.uasset | 4 ++-- Content/Maps/DevMap.umap | 4 ++-- Source/Promether/GameModeBase/Deathmatch.cpp | 2 +- .../PlayerGeneric/DefaultPlayerController.cpp | 20 +++++++++++++++++++ .../PlayerGeneric/DefaultPlayerState.cpp | 7 ++++++- .../PlayerGeneric/DefaultPlayerState.h | 4 ++-- 8 files changed, 37 insertions(+), 12 deletions(-) diff --git a/Content/Blueprints/BP_DefaultPlayerCharacter.uasset b/Content/Blueprints/BP_DefaultPlayerCharacter.uasset index e7677fc..a847e66 100644 --- a/Content/Blueprints/BP_DefaultPlayerCharacter.uasset +++ b/Content/Blueprints/BP_DefaultPlayerCharacter.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e168c1d918f01109b4e696f17435306d9a92ae422a4b0fa14d5df7306e874e51 -size 150369 +oid sha256:cce6c60de9ed8b0afe5cfd96c6979cdc831d6b927749d8604a420182b6294e6b +size 130551 diff --git a/Content/Blueprints/Bp_DefaultplayerController.uasset b/Content/Blueprints/Bp_DefaultplayerController.uasset index 0836b9f..84b9745 100644 --- a/Content/Blueprints/Bp_DefaultplayerController.uasset +++ b/Content/Blueprints/Bp_DefaultplayerController.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d0d423051a6f4d915aac51bc5d985a8dc9d8348989d42cec8599d4cdf75adc47 -size 40051 +oid sha256:897a0c705f9b56cbc201d681425ed2c0263b75e2065521ddfef22b30fb90a103 +size 12911 diff --git a/Content/Character/Allium/BP_Allium.uasset b/Content/Character/Allium/BP_Allium.uasset index 77208a8..229e923 100644 --- a/Content/Character/Allium/BP_Allium.uasset +++ b/Content/Character/Allium/BP_Allium.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4abe4c8244b4d339d5cf5a7780f3624cc0a93b7dea664bf28b9dd54149091ad1 -size 434066 +oid sha256:13b8bc13f2eff588f2154f6cb45317252630e53d747cfcc7cb2db3a19ce1c066 +size 430892 diff --git a/Content/Maps/DevMap.umap b/Content/Maps/DevMap.umap index 39f40e9..4cd2ef5 100644 --- a/Content/Maps/DevMap.umap +++ b/Content/Maps/DevMap.umap @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d8a696cffdab3713ea5315fd998d9af0f77db28dab143062a68cd5fab62adc81 -size 179601 +oid sha256:e95243a3a6c324bb03e9fcb3728b9d435f958c21ef4e5df5ebbdc02173d41e4f +size 179688 diff --git a/Source/Promether/GameModeBase/Deathmatch.cpp b/Source/Promether/GameModeBase/Deathmatch.cpp index db8175f..8c6ea7e 100644 --- a/Source/Promether/GameModeBase/Deathmatch.cpp +++ b/Source/Promether/GameModeBase/Deathmatch.cpp @@ -133,7 +133,7 @@ FString ADeathmatch::InitNewPlayer(APlayerController* NewPlayerController, const //DebugPerpose if (Type == CharacterType::Lukriel) { - Type = CharacterType::Lb; + Type = CharacterType::Allium; } if (Team == TeamType::Null) { diff --git a/Source/Promether/PlayerGeneric/DefaultPlayerController.cpp b/Source/Promether/PlayerGeneric/DefaultPlayerController.cpp index ff46d6a..a2df5b5 100644 --- a/Source/Promether/PlayerGeneric/DefaultPlayerController.cpp +++ b/Source/Promether/PlayerGeneric/DefaultPlayerController.cpp @@ -248,6 +248,11 @@ void ADefaultPlayerController::SetupInputComponent() void ADefaultPlayerController::Skill1() { + if (!GetWorld()) + return; + if (GetWorld()->GetUnpausedTimeSeconds() - GetPlayerState()->CooldownDuration[(uint8)CooldownType::Skill1] + <= GetPlayerState()->MaxCooldownDuration[(uint8)CooldownType::Skill1]) + return; if (GetPlayerState()->Stats[(uint8)EStats::Skillusable] == 1) return; if (!(GetPlayerState()->Stats[(uint8)EStats::Mana] >= GetPlayerState()->Stats[(uint8)EStats::Skill1Cost])) @@ -277,6 +282,11 @@ void ADefaultPlayerController::Skill1() void ADefaultPlayerController::Skill2() { + if (!GetWorld()) + return; + if (GetWorld()->GetUnpausedTimeSeconds() - GetPlayerState()->CooldownDuration[(uint8)CooldownType::Skill2] + <= GetPlayerState()->MaxCooldownDuration[(uint8)CooldownType::Skill2]) + return; if (GetPlayerState()->Stats[(uint8)EStats::Skillusable] == 1) return; if (!(GetPlayerState()->Stats[(uint8)EStats::Mana] >= GetPlayerState()->Stats[(uint8)EStats::Skill2Cost])) @@ -304,6 +314,11 @@ void ADefaultPlayerController::Skill2() void ADefaultPlayerController::Skill3() { + if (!GetWorld()) + return; + if (GetWorld()->GetUnpausedTimeSeconds() - GetPlayerState()->CooldownDuration[(uint8)CooldownType::Skill3] + <= GetPlayerState()->MaxCooldownDuration[(uint8)CooldownType::Skill3]) + return; if (GetPlayerState()->Stats[(uint8)EStats::Skillusable] == 1) return; if (!(GetPlayerState()->Stats[(uint8)EStats::Mana] >= GetPlayerState()->Stats[(uint8)EStats::Skill3Cost])) @@ -334,6 +349,11 @@ void ADefaultPlayerController::Skill4Triggered() if (!GetPlayerState()->Stats[(uint8)EStats::charging] == 0)//������ true�� �ƴ� �� { + if (!GetWorld()) + return; + if (GetWorld()->GetUnpausedTimeSeconds() - GetPlayerState()->CooldownDuration[(uint8)CooldownType::Skill4Triggered] + <= GetPlayerState()->MaxCooldownDuration[(uint8)CooldownType::Skill4Triggered]) + return; if (!GetPlayerState()->Stats[(uint8)EStats::Skillusable] == 0) { GetPlayerState()->SetState(ECharacterState::Idle); return; diff --git a/Source/Promether/PlayerGeneric/DefaultPlayerState.cpp b/Source/Promether/PlayerGeneric/DefaultPlayerState.cpp index 5e96ac2..ee8237f 100644 --- a/Source/Promether/PlayerGeneric/DefaultPlayerState.cpp +++ b/Source/Promether/PlayerGeneric/DefaultPlayerState.cpp @@ -18,6 +18,7 @@ void ADefaultPlayerState::GetLifetimeReplicatedProps(TArray& DOREPLIFETIME(ADefaultPlayerState, Team); DOREPLIFETIME(ADefaultPlayerState, CooldownDuration); + DOREPLIFETIME(ADefaultPlayerState, MaxCooldownDuration); DOREPLIFETIME(ADefaultPlayerState, Stats); DOREPLIFETIME(ADefaultPlayerState, MaxStats); @@ -35,7 +36,11 @@ void ADefaultPlayerState::InitPlayerStats_Implementation(const TArray& St MaxStats.Append(StatsValue); Stats.Append(StatsValue); CooldownDuration.Append(CooldownDurationValue); - MaxCooldownDuration.Append(CooldownDurationValue); + + for (float Value : CooldownDurationValue) + { + MaxCooldownDuration.Add(0.0f); + } for (float Value : StatsValue) { diff --git a/Source/Promether/PlayerGeneric/DefaultPlayerState.h b/Source/Promether/PlayerGeneric/DefaultPlayerState.h index a37ea68..7d8fd29 100644 --- a/Source/Promether/PlayerGeneric/DefaultPlayerState.h +++ b/Source/Promether/PlayerGeneric/DefaultPlayerState.h @@ -85,9 +85,9 @@ public: UPROPERTY(Replicated, Transient, EditAnywhere, BlueprintReadWrite) TArray MaxStats; - UPROPERTY(Replicated, Transient, BlueprintReadWrite) + UPROPERTY(Replicated, Transient, EditAnywhere, BlueprintReadWrite) TArray CooldownDuration; - UPROPERTY(Replicated, Transient, BlueprintReadWrite) + UPROPERTY(Replicated, Transient, EditAnywhere, BlueprintReadWrite) TArray MaxCooldownDuration;