From d3025bfbfa671c820a10429944d91a4a1a1950ce Mon Sep 17 00:00:00 2001 From: SJW1024 Date: Sun, 15 Oct 2023 00:35:56 +0900 Subject: [PATCH] =?UTF-8?q?=EA=B8=B0=EB=B3=B8=20=EA=B3=B5=EA=B2=A9=20?= =?UTF-8?q?=EC=95=8C=EA=B3=A0=EB=A6=AC=EC=A6=98=20=EC=84=A4=EA=B3=84?= =?UTF-8?q?=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Lb/Animation/Treasure_Attack1_Anim.uasset | 4 +- Content/Character/Lb/BP_Lb.uasset | 4 +- .../InputActions/InputMappingContext.uasset | 2 +- Content/InputActions/ObjectSelect.uasset | 2 +- Content/Maps/DevMap.umap | 2 +- .../Architecture/Floor_400x400.uasset | 4 +- .../Blueprints/Blueprint_CeilingLight.uasset | 4 +- .../PlayerGeneric/DefaultPlayerController.cpp | 56 +++++++++++++++++-- 8 files changed, 63 insertions(+), 15 deletions(-) diff --git a/Content/Character/Lb/Animation/Treasure_Attack1_Anim.uasset b/Content/Character/Lb/Animation/Treasure_Attack1_Anim.uasset index 5499d72..8db8167 100644 --- a/Content/Character/Lb/Animation/Treasure_Attack1_Anim.uasset +++ b/Content/Character/Lb/Animation/Treasure_Attack1_Anim.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:2470baf2b6f18679fe64504da91f899cb59e252f14a1bee3fd81d96928c960a6 -size 140654 +oid sha256:20ed827aa687771ca741b63e5234e8853d4689ee0f85662dafca9f658bd0d057 +size 143142 diff --git a/Content/Character/Lb/BP_Lb.uasset b/Content/Character/Lb/BP_Lb.uasset index 1418d02..9dc7bd5 100644 --- a/Content/Character/Lb/BP_Lb.uasset +++ b/Content/Character/Lb/BP_Lb.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a1a85727e67bcf386aefe203a239fe15a2715da7498c43d19da5c02ed20ed9db -size 191159 +oid sha256:05afb776797fc130d45f19c0344c12ff41743d0454e5cbbe9f4564192c2e8744 +size 192437 diff --git a/Content/InputActions/InputMappingContext.uasset b/Content/InputActions/InputMappingContext.uasset index 2fd3946..0b5099e 100644 --- a/Content/InputActions/InputMappingContext.uasset +++ b/Content/InputActions/InputMappingContext.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:35d094b2b806fa5159b55f6d14f03017dfcfe13545af429d379432ec5f02f6f9 +oid sha256:211d2c26d7a5c53a14ae7319d4c76917bfbd6f94785c13468fb2e6857a6a1b19 size 10912 diff --git a/Content/InputActions/ObjectSelect.uasset b/Content/InputActions/ObjectSelect.uasset index 6230f41..bc8e2a1 100644 --- a/Content/InputActions/ObjectSelect.uasset +++ b/Content/InputActions/ObjectSelect.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:20963a7668875eb3c81a12a801f23d92900ce274714c38cf692094a1cc97fe27 +oid sha256:b5da50944fc17aa1359bcdfd5e1c254d978392c5b73edcb118e130271b6d484c size 1353 diff --git a/Content/Maps/DevMap.umap b/Content/Maps/DevMap.umap index ca710ed..fdfef24 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:e2f707b55fdf84bad9d63f0e665ec79a1bb0a76bffda43d7908d8db6b26ee688 +oid sha256:a39f01744e181c37a957d0135e6ca1682f3ee37c198524c096b26f66a57a37e7 size 115131 diff --git a/Content/StarterContent/Architecture/Floor_400x400.uasset b/Content/StarterContent/Architecture/Floor_400x400.uasset index c2a34af..5b5f5cf 100644 --- a/Content/StarterContent/Architecture/Floor_400x400.uasset +++ b/Content/StarterContent/Architecture/Floor_400x400.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:4c0ecf0ac0702cc2bd355ec050232a61c49e10f102448efbeb735a51824adef6 -size 14948 +oid sha256:7bba03e7a10feb5689290b2523db0b25c646e9d01607f07bac3ac8c898d9d3f8 +size 15287 diff --git a/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset b/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset index ebdbe1e..c5c3b84 100644 --- a/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset +++ b/Content/StarterContent/Blueprints/Blueprint_CeilingLight.uasset @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e5b331a2fb1da7f9b37c7eee2254836f1eec8e2e41e00838db4a765343755de9 -size 44941 +oid sha256:4a60a29ad596546d481e43dfb8698842a78cc07f4a4b1000fa397cfba4e72331 +size 158206 diff --git a/Source/Promether/PlayerGeneric/DefaultPlayerController.cpp b/Source/Promether/PlayerGeneric/DefaultPlayerController.cpp index 78a29f8..3f71e35 100644 --- a/Source/Promether/PlayerGeneric/DefaultPlayerController.cpp +++ b/Source/Promether/PlayerGeneric/DefaultPlayerController.cpp @@ -371,15 +371,63 @@ void ADefaultPlayerController::ObjectSelect() SetACharacterOutlineColor(HitObject, true); } + void ADefaultPlayerController::Move() { - FVector Destination = GetMouseHitLocation(); + FHitResult HitResult; + TArray> ObjectTypes; + ObjectTypes.Add(UEngineTypes::ConvertToObjectType(ECollisionChannel::ECC_WorldStatic)); + ObjectTypes.Add(UEngineTypes::ConvertToObjectType(ECollisionChannel::ECC_Pawn)); - GetPlayerState()->SetState(ECharacterState::Moving); - SimpleMoveToLocation(this, Destination); - this->MoveToLocation(Destination); + GetHitResultUnderCursorForObjects(ObjectTypes, true, HitResult); + ACharacter* HitObject = Cast(HitResult.GetActor()); + + if (HitObject != nullptr) + { + float MinDistance = 100000.0f; // ÃÖ¼Ò °Å¸® + + FVector Destination = HitObject->GetActorLocation(); // HitObjectÀÇ À§Ä¡¸¦ ¸ñÀûÁö·Î ¼³Á¤ + + if (FVector::Dist(Destination, GetPawn()->GetActorLocation()) <= MinDistance) + { + FVector Location = GetPawn()->GetActorLocation(); + Location.Z = 0; + + Server_StopMove(); + Multicast_StopMove(); + + Multicast_SetRotation(GetMouseHitLocation()); + Server_SetRotation(GetMouseHitLocation()); + + GetPlayerState()->SetState(ECharacterState::Attack); + GetPlayerState()->SetAttackType(CooldownType::Attack); + } + else + { + GetPlayerState()->SetState(ECharacterState::Moving); + SimpleMoveToLocation(this, Destination); + this->MoveToLocation(Destination); + } + + + + } + else + { + HitObject = nullptr; + FVector Destination = GetMouseHitLocation(); + GetPlayerState()->SetState(ECharacterState::Moving); + SimpleMoveToLocation(this, Destination); + this->MoveToLocation(Destination); + } + } + + + + + void ADefaultPlayerController::Multicast_SetRotation_Implementation(FVector MouseHitLocation) { FVector Location = GetPawn()->GetActorLocation();