[박치영] Gruntling Enemy 추가 작업중
parent
87eba72318
commit
5b55cfbd79
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -40,12 +40,9 @@ void US_UpdateBehavior::UpdateBehavior()
|
||||||
{
|
{
|
||||||
if(!IsValid(ControlledMasterAI) || !IsValid(OwnerController))
|
if(!IsValid(ControlledMasterAI) || !IsValid(OwnerController))
|
||||||
return;
|
return;
|
||||||
UStateManagerComponent* StateManagerComponent = ControlledMasterAI->GetComponentByClass<UStateManagerComponent>();
|
if(ControlledMasterAI->IsDead())
|
||||||
if(!StateManagerComponent)
|
|
||||||
return;
|
|
||||||
if(StateManagerComponent->GetCurrentState() == FCombatGameplayTags::Get().Character_State_Dead)
|
|
||||||
{
|
{
|
||||||
SetBehavior(EAIBehavior::Nothing);
|
SetBehavior(EAIBehavior::Death);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
|
|
||||||
#include "AI/MasterAI.h"
|
#include "AI/MasterAI.h"
|
||||||
|
|
||||||
|
#include "AIController.h"
|
||||||
|
#include "CombatPlayerController.h"
|
||||||
#include "Components/CapsuleComponent.h"
|
#include "Components/CapsuleComponent.h"
|
||||||
#include "Components/InputComponent.h"
|
#include "Components/InputComponent.h"
|
||||||
#include "GameFramework/CharacterMovementComponent.h"
|
#include "GameFramework/CharacterMovementComponent.h"
|
||||||
|
|
@ -12,6 +15,7 @@
|
||||||
#include "Definitions/CombatGameplayTags.h"
|
#include "Definitions/CombatGameplayTags.h"
|
||||||
#include "Engine/DamageEvents.h"
|
#include "Engine/DamageEvents.h"
|
||||||
#include "NiagaraFunctionLibrary.h"
|
#include "NiagaraFunctionLibrary.h"
|
||||||
|
#include "BehaviorTree/BlackboardComponent.h"
|
||||||
#include "Components/CollisionComponent.h"
|
#include "Components/CollisionComponent.h"
|
||||||
#include "Components/TimelineComponent.h"
|
#include "Components/TimelineComponent.h"
|
||||||
#include "Components/WidgetComponent.h"
|
#include "Components/WidgetComponent.h"
|
||||||
|
|
@ -484,6 +488,10 @@ void AMasterAI::RotateToTargetUpdate(float Value)
|
||||||
|
|
||||||
void AMasterAI::PerformDeath()
|
void AMasterAI::PerformDeath()
|
||||||
{
|
{
|
||||||
|
if(IsDead())
|
||||||
|
return;
|
||||||
|
SetDead(true);
|
||||||
|
|
||||||
if(!DeathAnimations.IsEmpty())
|
if(!DeathAnimations.IsEmpty())
|
||||||
{
|
{
|
||||||
const int randomIdx = FMath::RandRange(0, DeathAnimations.Num() - 1);
|
const int randomIdx = FMath::RandRange(0, DeathAnimations.Num() - 1);
|
||||||
|
|
@ -496,6 +504,8 @@ void AMasterAI::PerformDeath()
|
||||||
ApplyHitReactionPhysicsVelocity(2000.f);
|
ApplyHitReactionPhysicsVelocity(2000.f);
|
||||||
else
|
else
|
||||||
ApplyHitReactionPhysicsVelocity(-2000.f);
|
ApplyHitReactionPhysicsVelocity(-2000.f);
|
||||||
|
|
||||||
|
GetCapsuleComponent()->SetCollisionResponseToChannel(ECC_Pawn, ECR_Overlap);
|
||||||
|
|
||||||
FTimerHandle deathTimer;
|
FTimerHandle deathTimer;
|
||||||
GetWorld()->GetTimerManager().SetTimer(deathTimer, FTimerDelegate::CreateLambda([&]()
|
GetWorld()->GetTimerManager().SetTimer(deathTimer, FTimerDelegate::CreateLambda([&]()
|
||||||
|
|
@ -592,6 +602,8 @@ bool AMasterAI::CanReceiveHitReaction()
|
||||||
inputContainer.AddTag(FCombatGameplayTags::Get().Character_State_Dead);
|
inputContainer.AddTag(FCombatGameplayTags::Get().Character_State_Dead);
|
||||||
|
|
||||||
ReturnValue &= !StateManagerComponent->IsCurrentStateEqualToAny(inputContainer);
|
ReturnValue &= !StateManagerComponent->IsCurrentStateEqualToAny(inputContainer);
|
||||||
|
ReturnValue &= !IsDead();
|
||||||
|
|
||||||
return ReturnValue;
|
return ReturnValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -630,3 +642,23 @@ TArray<UAnimMontage*> AMasterAI::GetActionMontage(FGameplayTag characterAction)
|
||||||
|
|
||||||
return outputArr;
|
return outputArr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AMasterAI::SetDead(bool Condition)
|
||||||
|
{
|
||||||
|
if(bIsDead == Condition)
|
||||||
|
return;
|
||||||
|
|
||||||
|
bIsDead = Condition;
|
||||||
|
AAIController* aiController = Cast<AAIController>(GetController());
|
||||||
|
if(aiController)
|
||||||
|
{
|
||||||
|
UBlackboardComponent* BlackboardComponent = aiController->GetBlackboardComponent();
|
||||||
|
if(BlackboardComponent)
|
||||||
|
BlackboardComponent->SetValueAsBool(TEXT("bIsDead"), bIsDead);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool AMasterAI::IsDead()
|
||||||
|
{
|
||||||
|
return bIsDead;
|
||||||
|
}
|
||||||
|
|
@ -97,6 +97,7 @@ private:
|
||||||
void SprintStaminaCost();
|
void SprintStaminaCost();
|
||||||
void ApplyHitReaction(EDamageType InDamageType);
|
void ApplyHitReaction(EDamageType InDamageType);
|
||||||
void ApplyImpactEffect(EDamageType InDamageType);
|
void ApplyImpactEffect(EDamageType InDamageType);
|
||||||
|
|
||||||
|
|
||||||
//Timeline
|
//Timeline
|
||||||
void RotateToTarget();
|
void RotateToTarget();
|
||||||
|
|
@ -117,10 +118,12 @@ protected: //Check Func
|
||||||
bool CanPerformSprint();
|
bool CanPerformSprint();
|
||||||
FGameplayTag GetDesiredAttackType();
|
FGameplayTag GetDesiredAttackType();
|
||||||
TArray<UAnimMontage*> GetActionMontage(FGameplayTag characterAction);
|
TArray<UAnimMontage*> GetActionMontage(FGameplayTag characterAction);
|
||||||
|
|
||||||
public: //Getter
|
public: //Getter, Setter
|
||||||
FORCEINLINE class UBehaviorTree* GetBeHaviorTree() {return BehaviorTree;}
|
FORCEINLINE class UBehaviorTree* GetBeHaviorTree() {return BehaviorTree;}
|
||||||
FORCEINLINE const TArray<ATargetPoint*>& GetPatrolPoints() { return PatrolPoints; }
|
FORCEINLINE const TArray<ATargetPoint*>& GetPatrolPoints() { return PatrolPoints; }
|
||||||
|
void SetDead(bool Condition);
|
||||||
|
bool IsDead();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Initialization", meta=(AllowPrivateAccess="true"))
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Initialization", meta=(AllowPrivateAccess="true"))
|
||||||
|
|
@ -183,6 +186,7 @@ private:
|
||||||
bool bCanMove = true;
|
bool bCanMove = true;
|
||||||
bool bHitFront;
|
bool bHitFront;
|
||||||
bool bEnableIFrame;
|
bool bEnableIFrame;
|
||||||
|
bool bIsDead;
|
||||||
FHitResult LastHitInfo;
|
FHitResult LastHitInfo;
|
||||||
|
|
||||||
UPROPERTY()
|
UPROPERTY()
|
||||||
|
|
|
||||||
|
|
@ -623,7 +623,9 @@ void ACombatPlayerCharacter::AttackEvent()
|
||||||
|
|
||||||
void ACombatPlayerCharacter::ChargeAttackEvent()
|
void ACombatPlayerCharacter::ChargeAttackEvent()
|
||||||
{
|
{
|
||||||
if (CanPerformAttack())
|
if (!CanPerformAttack())
|
||||||
|
return;
|
||||||
|
if(CombatComponent->GetCombatEnabled())
|
||||||
{
|
{
|
||||||
PerformAttack(FCombatGameplayTags::Get().Character_Action_Attack_ChargedAttack, CombatComponent->GetAttackCount());
|
PerformAttack(FCombatGameplayTags::Get().Character_Action_Attack_ChargedAttack, CombatComponent->GetAttackCount());
|
||||||
ABaseWeapon* pBaseWeapon = CombatComponent->GetMainWeapon();
|
ABaseWeapon* pBaseWeapon = CombatComponent->GetMainWeapon();
|
||||||
|
|
|
||||||
|
|
@ -45,6 +45,7 @@ enum class EAIBehavior : uint8
|
||||||
Chase UMETA(DisplayName = "Chase"),
|
Chase UMETA(DisplayName = "Chase"),
|
||||||
Patrol UMETA(DisplayName = "Patrol"),
|
Patrol UMETA(DisplayName = "Patrol"),
|
||||||
Hit UMETA(DisplayName = "Hit"),
|
Hit UMETA(DisplayName = "Hit"),
|
||||||
|
Death UMETA(DisplayName = "Death"),
|
||||||
};
|
};
|
||||||
|
|
||||||
UENUM(BlueprintType)
|
UENUM(BlueprintType)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue