캐릭터 애니메이션 통제(특정 행동 도중 스킬/이동/공격 불가 설정), 평타 알고리즘 완성
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/DefaultPlayerState.h"
|
||||
|
||||
|
||||
void UAN_AnimEnd::Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* Animation, const FAnimNotifyEventReference& EventReference)
|
||||
{
|
||||
ADefaultPlayerCharacter* MyCharacter = MeshComp->GetOwner<ADefaultPlayerCharacter>();
|
||||
@@ -13,6 +14,6 @@ void UAN_AnimEnd::Notify(USkeletalMeshComponent* MeshComp, UAnimSequenceBase* An
|
||||
|
||||
ADefaultPlayerState* MyState = MyCharacter->GetPlayerState<ADefaultPlayerState>();
|
||||
if (!MyState) return;
|
||||
|
||||
MyState->SetState(ECharacterState::Idle);
|
||||
|
||||
}
|
||||
|
||||
@@ -14,6 +14,8 @@
|
||||
#include "DefaultPlayerState.h"
|
||||
#include "DefaultPlayerCamera.h"
|
||||
|
||||
|
||||
|
||||
void ADefaultPlayerController::BeginPlay()
|
||||
{
|
||||
Super::BeginPlay();
|
||||
@@ -246,8 +248,17 @@ void ADefaultPlayerController::SetupInputComponent()
|
||||
|
||||
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]))
|
||||
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;
|
||||
FVector Location = GetPawn()->GetActorLocation();
|
||||
@@ -266,9 +277,16 @@ void ADefaultPlayerController::Skill1()
|
||||
|
||||
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]))
|
||||
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;
|
||||
FVector Location = GetPawn()->GetActorLocation();
|
||||
Location.Z = 0;
|
||||
@@ -286,8 +304,15 @@ void ADefaultPlayerController::Skill2()
|
||||
|
||||
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]))
|
||||
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;
|
||||
FVector Location = GetPawn()->GetActorLocation();
|
||||
@@ -306,8 +331,27 @@ void ADefaultPlayerController::Skill3()
|
||||
|
||||
void ADefaultPlayerController::Skill4Triggered()
|
||||
{
|
||||
if (!(GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Mana] >= GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Skill4Cost]))
|
||||
return;
|
||||
if (GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::charging] == 1)//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1(false)<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];
|
||||
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;
|
||||
FVector Location = GetPawn()->GetActorLocation();
|
||||
@@ -378,6 +422,7 @@ void ADefaultPlayerController::ObjectSelect()
|
||||
|
||||
void ADefaultPlayerController::Move()
|
||||
{
|
||||
EndAttack();
|
||||
FHitResult HitResult;
|
||||
TArray<TEnumAsByte<EObjectTypeQuery>> ObjectTypes;
|
||||
ObjectTypes.Add(UEngineTypes::ConvertToObjectType(ECollisionChannel::ECC_WorldStatic));
|
||||
@@ -385,11 +430,14 @@ void ADefaultPlayerController::Move()
|
||||
|
||||
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>
|
||||
HitTarget = Cast<ACharacter>(HitResult.GetActor());
|
||||
|
||||
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 (!GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Attackable] == 0)
|
||||
return;
|
||||
if (!HitCharacter)
|
||||
{
|
||||
FVector Destination = GetMouseHitLocation();
|
||||
@@ -398,10 +446,12 @@ void ADefaultPlayerController::Move()
|
||||
this->MoveToLocation(Destination);
|
||||
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
|
||||
{
|
||||
if (!GetPlayerState<ADefaultPlayerState>()->Stats[(uint8)EStats::Movable] == 0)
|
||||
return;
|
||||
FVector Destination = GetMouseHitLocation();
|
||||
GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Moving);
|
||||
SimpleMoveToLocation(this, Destination);
|
||||
@@ -415,7 +465,14 @@ void ADefaultPlayerController::Multicast_SetRotation_Implementation(FVector Mous
|
||||
FVector Location = GetPawn()->GetActorLocation();
|
||||
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)
|
||||
@@ -572,24 +629,53 @@ void ADefaultPlayerController::OnMoveCompleted(FAIRequestID RequestID, const FPa
|
||||
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)
|
||||
{
|
||||
|
||||
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 ((GetPlayerState<ADefaultPlayerState>()->CooldownDuration[(uint8)CooldownType::Attack] != 0))
|
||||
return;
|
||||
|
||||
Destination = HitObject->GetActorLocation(); // HitObject<63><74> <20><>ġ<EFBFBD><C4A1> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
FVector Location = GetPawn()->GetActorLocation();
|
||||
Location.Z = 0;
|
||||
Location.X = 0;
|
||||
|
||||
Server_StopMove();
|
||||
Multicast_StopMove();
|
||||
|
||||
Multicast_SetRotation(GetMouseHitLocation());
|
||||
Server_SetRotation(GetMouseHitLocation());
|
||||
Multicast_SetRotation(Destination);
|
||||
Server_SetRotation(Destination);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
UE_LOG(LogTemp, Warning, TEXT("Attack"));
|
||||
GetPlayerState<ADefaultPlayerState>()->SetState(ECharacterState::Attack);
|
||||
|
||||
@@ -64,13 +64,20 @@ public:
|
||||
|
||||
void OnMoveCompleted(FAIRequestID RequestID, const FPathFollowingResult &MovementResult);
|
||||
|
||||
void BeginAttack();
|
||||
void EndAttack();
|
||||
void RepeatedAttack();
|
||||
|
||||
|
||||
void Attack(ACharacter* HitObject);
|
||||
|
||||
void Attack(ACharacter* HitCharacter);
|
||||
|
||||
UPROPERTY(BlueprintReadWrite)
|
||||
float MouseClickInterval;
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = "My Actor")
|
||||
ACharacter * HitTarget;
|
||||
|
||||
private:
|
||||
UPROPERTY(EditAnywhere, Category = "Input")
|
||||
TSoftObjectPtr<UInputMappingContext> PlayerInputMapping;
|
||||
|
||||
@@ -27,6 +27,9 @@ public:
|
||||
void SetCharacterBPRef(UClass* Value) { CharacterBPRef = Value; }
|
||||
UClass* GetCharacterBPRef() const { return CharacterBPRef; }
|
||||
|
||||
|
||||
|
||||
|
||||
UFUNCTION(BlueprintCallable)
|
||||
void SetTeam(TeamType Value) { Team = Value; }
|
||||
UFUNCTION(BlueprintCallable)
|
||||
|
||||
@@ -47,6 +47,8 @@ enum class CooldownType : uint8
|
||||
SIZE
|
||||
};
|
||||
|
||||
|
||||
|
||||
enum class CCType : uint32
|
||||
{
|
||||
None = 0x00000000,
|
||||
@@ -126,9 +128,13 @@ enum class EStats : uint8
|
||||
HealthRegenerationGrowth,
|
||||
ManaGrowth,
|
||||
ManaRegenerationGrowth,
|
||||
Movable,
|
||||
Skillusable,
|
||||
Attackable,
|
||||
charging,
|
||||
Skill1Cost,
|
||||
Skill2Cost,
|
||||
Skill3Cost,
|
||||
Skill4Cost,
|
||||
SIZE
|
||||
SIZE,
|
||||
};
|
||||
Reference in New Issue
Block a user