캐릭터 애니메이션 통제(특정 행동 도중 스킬/이동/공격 불가 설정), 평타 알고리즘 완성
This commit is contained in:
BIN
Content/Blueprints/BP_DefaultPlayerCharacter.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/BP_DefaultPlayerCharacter.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Blueprints/Notify/StopActing.uasset
(Stored with Git LFS)
BIN
Content/Blueprints/Notify/StopActing.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Allium/Animation/Skill1_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Allium/Animation/Skill1_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Allium/Animation/Skill2_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Allium/Animation/Skill2_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Allium/Animation/Skill3_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Allium/Animation/Skill3_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Allium/Animation/Skill4_2_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Allium/Animation/Skill4_2_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Lb/Animation/E_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Lb/Animation/E_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Lb/Animation/Q_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Lb/Animation/Q_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Lb/Animation/R2_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Lb/Animation/R2_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Lb/Animation/W_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Lb/Animation/W_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Lb/BP_Lb.uasset
(Stored with Git LFS)
BIN
Content/Character/Lb/BP_Lb.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Lb/EskillBuff.uasset
(Stored with Git LFS)
BIN
Content/Character/Lb/EskillBuff.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Lb/Skeleton/Lb.uasset
(Stored with Git LFS)
BIN
Content/Character/Lb/Skeleton/Lb.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Riana/Animation/Skill1_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Riana/Animation/Skill1_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Riana/Animation/Skill2_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Riana/Animation/Skill2_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Riana/Animation/Skill3_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Riana/Animation/Skill3_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Character/Riana/Animation/Skill4_3_Anim.uasset
(Stored with Git LFS)
BIN
Content/Character/Riana/Animation/Skill4_3_Anim.uasset
(Stored with Git LFS)
Binary file not shown.
BIN
Content/Maps/DevMap.umap
(Stored with Git LFS)
BIN
Content/Maps/DevMap.umap
(Stored with Git LFS)
Binary file not shown.
@@ -6,6 +6,7 @@
|
|||||||
#include "../PlayerGeneric/DefaultPlayerCharacter.h"
|
#include "../PlayerGeneric/DefaultPlayerCharacter.h"
|
||||||
#include "../PlayerGeneric/DefaultPlayerState.h"
|
#include "../PlayerGeneric/DefaultPlayerState.h"
|
||||||
|
|
||||||
|
|
||||||
void UAN_AnimEnd::Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference)
|
void UAN_AnimEnd::Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference)
|
||||||
{
|
{
|
||||||
ADefaultPlayerCharacter* MyCharacter = MeshComp->GetOwner<ADefaultPlayerCharacter>();
|
ADefaultPlayerCharacter* MyCharacter = MeshComp->GetOwner<ADefaultPlayerCharacter>();
|
||||||
@@ -13,6 +14,6 @@ void UAN_AnimEnd::Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* An
|
|||||||
|
|
||||||
ADefaultPlayerState* MyState = MyCharacter->GetPlayerState<ADefaultPlayerState>();
|
ADefaultPlayerState* MyState = MyCharacter->GetPlayerState<ADefaultPlayerState>();
|
||||||
if (!MyState) return;
|
if (!MyState) return;
|
||||||
|
|
||||||
MyState->SetState(ECharacterState::Idle);
|
MyState->SetState(ECharacterState::Idle);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
#include "DefaultPlayerState.h"
|
#include "DefaultPlayerState.h"
|
||||||
#include "DefaultPlayerCamera.h"
|
#include "DefaultPlayerCamera.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ADefaultPlayerController::BeginPlay()
|
void ADefaultPlayerController::BeginPlay()
|
||||||
{
|
{
|
||||||
Super::BeginPlay();
|
Super::BeginPlay();
|
||||||
@@ -246,8 +248,17 @@ void ADefaultPlayerController::SetupInputComponent()
|
|||||||
|
|
||||||
void ADefaultPlayerController::Skill1()
|
void ADefaultPlayerController::Skill1()
|
||||||
{
|
{
|
||||||
|
if (!GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skillusable] == 0)
|
||||||
|
return;
|
||||||
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill1Cost]))
|
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill1Cost]))
|
||||||
return;
|
return;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] -= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill1Cost];
|
||||||
|
EndAttack();
|
||||||
|
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Attackable] = 1;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skillusable] = 1;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Movable] = 1;
|
||||||
|
|
||||||
|
|
||||||
ACharacter* HitObject = nullptr;
|
ACharacter* HitObject = nullptr;
|
||||||
FVector Location = GetPawn()->GetActorLocation();
|
FVector Location = GetPawn()->GetActorLocation();
|
||||||
@@ -266,9 +277,16 @@ void ADefaultPlayerController::Skill1()
|
|||||||
|
|
||||||
void ADefaultPlayerController::Skill2()
|
void ADefaultPlayerController::Skill2()
|
||||||
{
|
{
|
||||||
|
if (!GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skillusable] == 0)
|
||||||
|
return;
|
||||||
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill2Cost]))
|
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill2Cost]))
|
||||||
return;
|
return;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] -= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill2Cost];
|
||||||
|
|
||||||
|
EndAttack();
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Attackable] = 1;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skillusable] = 1;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Movable] = 1;
|
||||||
ACharacter* HitObject = nullptr;
|
ACharacter* HitObject = nullptr;
|
||||||
FVector Location = GetPawn()->GetActorLocation();
|
FVector Location = GetPawn()->GetActorLocation();
|
||||||
Location.Z = 0;
|
Location.Z = 0;
|
||||||
@@ -286,8 +304,15 @@ void ADefaultPlayerController::Skill2()
|
|||||||
|
|
||||||
void ADefaultPlayerController::Skill3()
|
void ADefaultPlayerController::Skill3()
|
||||||
{
|
{
|
||||||
|
if (!GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skillusable] == 0)
|
||||||
|
return;
|
||||||
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill3Cost]))
|
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill3Cost]))
|
||||||
return;
|
return;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] -= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill3Cost];
|
||||||
|
EndAttack();
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Attackable] = 1;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skillusable] = 1;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Movable] = 1;
|
||||||
|
|
||||||
ACharacter* HitObject = nullptr;
|
ACharacter* HitObject = nullptr;
|
||||||
FVector Location = GetPawn()->GetActorLocation();
|
FVector Location = GetPawn()->GetActorLocation();
|
||||||
@@ -306,8 +331,27 @@ void ADefaultPlayerController::Skill3()
|
|||||||
|
|
||||||
void ADefaultPlayerController::Skill4Triggered()
|
void ADefaultPlayerController::Skill4Triggered()
|
||||||
{
|
{
|
||||||
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill4Cost]))
|
if (GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::charging] == 1)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1(false)<29><> <20><>
|
||||||
return;
|
{
|
||||||
|
if (!GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skillusable] == 0)
|
||||||
|
return;
|
||||||
|
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill4Cost]))
|
||||||
|
return;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] -= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill4Cost];
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::charging] = 0;// <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> charge<67><65> true(0)<29><> <20><><EFBFBD><EFBFBD>
|
||||||
|
}
|
||||||
|
else if (GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::charging] == 2) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2(never)<29><> <20><>
|
||||||
|
{
|
||||||
|
if (!GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skillusable] == 0)
|
||||||
|
return;
|
||||||
|
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill4Cost]))
|
||||||
|
return;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] -= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill4Cost]; // <20>׳<EFBFBD> <20><>ġ <20><><EFBFBD>길 <20><><EFBFBD><EFBFBD>
|
||||||
|
}
|
||||||
|
EndAttack();
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Attackable] = 1;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skillusable] = 1;
|
||||||
|
GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Movable] = 1;
|
||||||
|
|
||||||
ACharacter* HitObject = nullptr;
|
ACharacter* HitObject = nullptr;
|
||||||
FVector Location = GetPawn()->GetActorLocation();
|
FVector Location = GetPawn()->GetActorLocation();
|
||||||
@@ -378,6 +422,7 @@ void ADefaultPlayerController::ObjectSelect()
|
|||||||
|
|
||||||
void ADefaultPlayerController::Move()
|
void ADefaultPlayerController::Move()
|
||||||
{
|
{
|
||||||
|
EndAttack();
|
||||||
FHitResult HitResult;
|
FHitResult HitResult;
|
||||||
TArray<TEnumAsByte<EObjectTypeQuery>> ObjectTypes;
|
TArray<TEnumAsByte<EObjectTypeQuery>> ObjectTypes;
|
||||||
ObjectTypes.Add(UEngineTypes::ConvertToObjectType(ECollisionChannel::ECC_WorldStatic));
|
ObjectTypes.Add(UEngineTypes::ConvertToObjectType(ECollisionChannel::ECC_WorldStatic));
|
||||||
@@ -385,11 +430,14 @@ void ADefaultPlayerController::Move()
|
|||||||
|
|
||||||
GetHitResultUnderCursorForObjects(ObjectTypes, true, HitResult);
|
GetHitResultUnderCursorForObjects(ObjectTypes, true, HitResult);
|
||||||
ACharacter* HitCharacter = Cast<ACharacter>(HitResult.GetActor()); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HitCharactor<6F><72> <20><><EFBFBD><EFBFBD><<<3C><><EFBFBD><EFBFBD> <20><> ij<><C4B3><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><CFB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
ACharacter* HitCharacter = Cast<ACharacter>(HitResult.GetActor()); //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HitCharactor<6F><72> <20><><EFBFBD><EFBFBD><<<3C><><EFBFBD><EFBFBD> <20><> ij<><C4B3><EFBFBD><EFBFBD><EFBFBD>϶<EFBFBD><CFB6><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
||||||
|
HitTarget = Cast<ACharacter>(HitResult.GetActor());
|
||||||
|
|
||||||
UE_LOG(LogTemp, Warning, TEXT("%s"), *HitResult.GetActor()->GetName());
|
UE_LOG(LogTemp, Warning, TEXT("%s"), *HitResult.GetActor()->GetName());
|
||||||
|
|
||||||
if (HitResult.GetActor() != GetPawn<AActor>()) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HitObject<63><74> null<6C><6C> <20>ƴ<EFBFBD> <20><><EFBFBD><EFBFBD> Attack()<29><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>, HitObject<63><74> <20><> ij<><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
if (HitResult.GetActor() != GetPawn<AActor>()) //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> HitObject<63><74> null<6C><6C> <20>ƴ<EFBFBD> <20><><EFBFBD><EFBFBD> Attack()<29><> <20><><EFBFBD><EFBFBD><EFBFBD>ϴ<EFBFBD> <20>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD>, HitObject<63><74> <20><> ij<><C4B3><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ؾ<EFBFBD><D8BE><EFBFBD>
|
||||||
{
|
{
|
||||||
|
if (!GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Attackable] == 0)
|
||||||
|
return;
|
||||||
if (!HitCharacter)
|
if (!HitCharacter)
|
||||||
{
|
{
|
||||||
FVector Destination = GetMouseHitLocation();
|
FVector Destination = GetMouseHitLocation();
|
||||||
@@ -398,10 +446,12 @@ void ADefaultPlayerController::Move()
|
|||||||
this->MoveToLocation(Destination);
|
this->MoveToLocation(Destination);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Attack(HitCharacter); //HitObject<63><74> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Attack <20><><EFBFBD><EFBFBD>
|
BeginAttack(); //HitObject<63><74> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> BeginAttack <20><><EFBFBD><EFBFBD>
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
if (!GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Movable] == 0)
|
||||||
|
return;
|
||||||
FVector Destination = GetMouseHitLocation();
|
FVector Destination = GetMouseHitLocation();
|
||||||
GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Moving);
|
GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Moving);
|
||||||
SimpleMoveToLocation(this, Destination);
|
SimpleMoveToLocation(this, Destination);
|
||||||
@@ -415,7 +465,14 @@ void ADefaultPlayerController::Multicast_SetRotation_Implementation(FVector Mous
|
|||||||
FVector Location = GetPawn()->GetActorLocation();
|
FVector Location = GetPawn()->GetActorLocation();
|
||||||
Location.Z = 0;
|
Location.Z = 0;
|
||||||
|
|
||||||
GetPawn()->SetActorRotation((MouseHitLocation - Location).Rotation());
|
FRotator NewRotation = (MouseHitLocation - Location).Rotation();
|
||||||
|
|
||||||
|
// <20><><EFBFBD><EFBFBD> X<><58><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ϰ<EFBFBD> <20>ʹٸ<CDB4> <20>Ʒ<EFBFBD><C6B7><EFBFBD> <20><><EFBFBD><EFBFBD> <20>ش<EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>մϴ<D5B4>.
|
||||||
|
|
||||||
|
NewRotation.Pitch = 0;
|
||||||
|
|
||||||
|
GetPawn()->SetActorRotation(NewRotation);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ADefaultPlayerController::Server_SetRotation_Implementation(FVector MouseHitLocation)
|
void ADefaultPlayerController::Server_SetRotation_Implementation(FVector MouseHitLocation)
|
||||||
@@ -572,24 +629,53 @@ void ADefaultPlayerController::OnMoveCompleted(FAIRequestID RequestID, const FPa
|
|||||||
GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Idle);
|
GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Idle);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FTimerHandle TimerHandle;
|
||||||
|
|
||||||
|
void ADefaultPlayerController::BeginAttack()
|
||||||
|
{
|
||||||
|
GetWorldTimerManager().SetTimer(TimerHandle, this, &ADefaultPlayerController::RepeatedAttack, 0.1f, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ADefaultPlayerController::EndAttack()
|
||||||
|
{
|
||||||
|
|
||||||
|
GetWorldTimerManager().ClearTimer(TimerHandle);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ADefaultPlayerController::RepeatedAttack()
|
||||||
|
{
|
||||||
|
if (!GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Attackable] == 0)
|
||||||
|
return;
|
||||||
|
ACharacter* HitCharacter = HitTarget;
|
||||||
|
Attack(HitCharacter);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ADefaultPlayerController::Attack(ACharacter* HitObject)
|
void ADefaultPlayerController::Attack(ACharacter* HitObject)
|
||||||
{
|
{
|
||||||
|
|
||||||
float MinDistance = GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats:: AttackRange];
|
float MinDistance = GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats:: AttackRange];
|
||||||
FVector Destination = HitObject->GetActorLocation(); // HitObject<63><74> <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
FVector Destination = HitTarget->GetActorLocation(); // HitObject<63><74> <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
|
|
||||||
if (FVector::Dist(Destination, GetPawn()->GetActorLocation()) <= MinDistance)
|
if (FVector::Dist(Destination, GetPawn()->GetActorLocation()) <= MinDistance)
|
||||||
{
|
{
|
||||||
if ((GetPlayerState<ADefaultPlayerState>()->CooldownDuration[(uint8)CooldownType::Attack] != 0))
|
if ((GetPlayerState<ADefaultPlayerState>()->CooldownDuration[(uint8)CooldownType::Attack] != 0))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
Destination = HitObject->GetActorLocation(); // HitObject<63><74> <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||||
FVector Location = GetPawn()->GetActorLocation();
|
FVector Location = GetPawn()->GetActorLocation();
|
||||||
Location.Z = 0;
|
Location.X = 0;
|
||||||
|
|
||||||
Server_StopMove();
|
Server_StopMove();
|
||||||
Multicast_StopMove();
|
Multicast_StopMove();
|
||||||
|
|
||||||
Multicast_SetRotation(GetMouseHitLocation());
|
Multicast_SetRotation(Destination);
|
||||||
Server_SetRotation(GetMouseHitLocation());
|
Server_SetRotation(Destination);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UE_LOG(LogTemp, Warning, TEXT("Attack"));
|
UE_LOG(LogTemp, Warning, TEXT("Attack"));
|
||||||
GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Attack);
|
GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Attack);
|
||||||
|
|||||||
@@ -64,13 +64,20 @@ public:
|
|||||||
|
|
||||||
void OnMoveCompleted(FAIRequestID RequestID, const FPathFollowingResult &MovementResult);
|
void OnMoveCompleted(FAIRequestID RequestID, const FPathFollowingResult &MovementResult);
|
||||||
|
|
||||||
|
void BeginAttack();
|
||||||
|
void EndAttack();
|
||||||
|
void RepeatedAttack();
|
||||||
|
|
||||||
|
|
||||||
void Attack(ACharacter* HitObject);
|
|
||||||
|
void Attack(ACharacter* HitCharacter);
|
||||||
|
|
||||||
UPROPERTY(BlueprintReadWrite)
|
UPROPERTY(BlueprintReadWrite)
|
||||||
float MouseClickInterval;
|
float MouseClickInterval;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "My Actor")
|
||||||
|
ACharacter * HitTarget;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UPROPERTY(EditAnywhere, Category = "Input")
|
UPROPERTY(EditAnywhere, Category = "Input")
|
||||||
TSoftObjectPtr<UInputMappingContext> PlayerInputMapping;
|
TSoftObjectPtr<UInputMappingContext> PlayerInputMapping;
|
||||||
|
|||||||
@@ -27,6 +27,9 @@ public:
|
|||||||
void SetCharacterBPRef(UClass* Value) { CharacterBPRef = Value; }
|
void SetCharacterBPRef(UClass* Value) { CharacterBPRef = Value; }
|
||||||
UClass* GetCharacterBPRef() const { return CharacterBPRef; }
|
UClass* GetCharacterBPRef() const { return CharacterBPRef; }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
void SetTeam(TeamType Value) { Team = Value; }
|
void SetTeam(TeamType Value) { Team = Value; }
|
||||||
UFUNCTION(BlueprintCallable)
|
UFUNCTION(BlueprintCallable)
|
||||||
|
|||||||
@@ -47,6 +47,8 @@ enum class CooldownType : uint8
|
|||||||
SIZE
|
SIZE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enum class CCType : uint32
|
enum class CCType : uint32
|
||||||
{
|
{
|
||||||
None = 0x00000000,
|
None = 0x00000000,
|
||||||
@@ -126,9 +128,13 @@ enum class EStats : uint8
|
|||||||
HealthRegenerationGrowth,
|
HealthRegenerationGrowth,
|
||||||
ManaGrowth,
|
ManaGrowth,
|
||||||
ManaRegenerationGrowth,
|
ManaRegenerationGrowth,
|
||||||
|
Movable,
|
||||||
|
Skillusable,
|
||||||
|
Attackable,
|
||||||
|
charging,
|
||||||
Skill1Cost,
|
Skill1Cost,
|
||||||
Skill2Cost,
|
Skill2Cost,
|
||||||
Skill3Cost,
|
Skill3Cost,
|
||||||
Skill4Cost,
|
Skill4Cost,
|
||||||
SIZE
|
SIZE,
|
||||||
};
|
};
|
||||||
Reference in New Issue
Block a user