머지 완료, 데미지 관련 간단 구현

This commit is contained in:
2023-10-10 23:35:41 +09:00
parent 39e95c5cf8
commit 3615e7be0a
8 changed files with 49 additions and 19 deletions

BIN
Content/Character/Allium/BP_Allium.uasset (Stored with Git LFS)

Binary file not shown.

BIN
Content/Character/BP_Folder/BP_DefaultPlayerCharacter.uasset (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

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

Binary file not shown.

View File

@@ -252,9 +252,10 @@ void ADefaultPlayerController::Skill1()
FVector Location = GetPawn()->GetActorLocation(); FVector Location = GetPawn()->GetActorLocation();
Location.Z = 0; Location.Z = 0;
SimpleMoveToLocation(this, Location); Server_StopMove();
this->MoveToLocation(Location); Multicast_StopMove();
Multicast_SetRotation(GetMouseHitLocation());
Server_SetRotation(GetMouseHitLocation()); Server_SetRotation(GetMouseHitLocation());
UE_LOG(LogTemp, Warning, TEXT("Skill1")); UE_LOG(LogTemp, Warning, TEXT("Skill1"));
@@ -267,9 +268,10 @@ void ADefaultPlayerController::Skill2()
FVector Location = GetPawn()->GetActorLocation(); FVector Location = GetPawn()->GetActorLocation();
Location.Z = 0; Location.Z = 0;
SimpleMoveToLocation(this, Location); Server_StopMove();
this->MoveToLocation(Location); Multicast_StopMove();
Multicast_SetRotation(GetMouseHitLocation());
Server_SetRotation(GetMouseHitLocation()); Server_SetRotation(GetMouseHitLocation());
UE_LOG(LogTemp, Warning, TEXT("Skill2")); UE_LOG(LogTemp, Warning, TEXT("Skill2"));
@@ -282,9 +284,10 @@ void ADefaultPlayerController::Skill3()
FVector Location = GetPawn()->GetActorLocation(); FVector Location = GetPawn()->GetActorLocation();
Location.Z = 0; Location.Z = 0;
SimpleMoveToLocation(this, Location); Server_StopMove();
this->MoveToLocation(Location); Multicast_StopMove();
Multicast_SetRotation(GetMouseHitLocation());
Server_SetRotation(GetMouseHitLocation()); Server_SetRotation(GetMouseHitLocation());
UE_LOG(LogTemp, Warning, TEXT("Skill3")); UE_LOG(LogTemp, Warning, TEXT("Skill3"));
@@ -297,9 +300,10 @@ void ADefaultPlayerController::Skill4Triggered()
FVector Location = GetPawn()->GetActorLocation(); FVector Location = GetPawn()->GetActorLocation();
Location.Z = 0; Location.Z = 0;
SimpleMoveToLocation(this, Location); Server_StopMove();
this->MoveToLocation(Location); Multicast_StopMove();
Multicast_SetRotation(GetMouseHitLocation());
Server_SetRotation(GetMouseHitLocation()); Server_SetRotation(GetMouseHitLocation());
UE_LOG(LogTemp, Warning, TEXT("Skill4 Triggered")); UE_LOG(LogTemp, Warning, TEXT("Skill4 Triggered"));
@@ -312,9 +316,10 @@ void ADefaultPlayerController::Skill4Completed()
FVector Location = GetPawn()->GetActorLocation(); FVector Location = GetPawn()->GetActorLocation();
Location.Z = 0; Location.Z = 0;
SimpleMoveToLocation(this, Location); Server_StopMove();
this->MoveToLocation(Location); Multicast_StopMove();
Multicast_SetRotation(GetMouseHitLocation());
Server_SetRotation(GetMouseHitLocation()); Server_SetRotation(GetMouseHitLocation());
UE_LOG(LogTemp, Warning, TEXT("Skill4 Completed")); UE_LOG(LogTemp, Warning, TEXT("Skill4 Completed"));
@@ -388,6 +393,23 @@ void ADefaultPlayerController::Server_SetRotation_Implementation(FVector MouseHi
Multicast_SetRotation(MouseHitLocation); Multicast_SetRotation(MouseHitLocation);
} }
void ADefaultPlayerController::Server_StopMove_Implementation()
{
Multicast_StopMove();
}
void ADefaultPlayerController::Multicast_StopMove_Implementation()
{
UPathFollowingComponent* PFollowComp = this->FindComponentByClass<UPathFollowingComponent>();
if (!PFollowComp) return;
PFollowComp->OnRequestFinished.Clear();
PFollowComp->RequestMoveWithImmediateFinish(EPathFollowingResult::Success);
PFollowComp->OnRequestFinished.AddUObject(this, &ADefaultPlayerController::OnMoveCompleted);
}
FVector ADefaultPlayerController::GetMouseHitLocation() FVector ADefaultPlayerController::GetMouseHitLocation()
{ {
FHitResult HitResult; FHitResult HitResult;

View File

@@ -46,6 +46,11 @@ public:
UFUNCTION(Server, Reliable) UFUNCTION(Server, Reliable)
void MoveToLocation(FVector Location); void MoveToLocation(FVector Location);
UFUNCTION(Server, Reliable)
void Server_StopMove();
UFUNCTION(NetMulticast, Reliable)
void Multicast_StopMove();
UFUNCTION(NetMulticast, Reliable) UFUNCTION(NetMulticast, Reliable)
void Multicast_SetRotation(FVector MouseHitLocation); void Multicast_SetRotation(FVector MouseHitLocation);