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