diff --git a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Attacks/Gruntling_Sword_Attack_Swing.uasset b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Attacks/Gruntling_Sword_Attack_Swing.uasset index 2e155403..155e467d 100644 Binary files a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Attacks/Gruntling_Sword_Attack_Swing.uasset and b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Attacks/Gruntling_Sword_Attack_Swing.uasset differ diff --git a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Attacks/Gruntling_Sword_Attack_Swing_Montage.uasset b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Attacks/Gruntling_Sword_Attack_Swing_Montage.uasset index c754710b..a5258300 100644 Binary files a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Attacks/Gruntling_Sword_Attack_Swing_Montage.uasset and b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Attacks/Gruntling_Sword_Attack_Swing_Montage.uasset differ diff --git a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Death/ExoGame_Gruntling_Death_Montage.uasset b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Death/ExoGame_Gruntling_Death_Montage.uasset index 71eb0751..efe5b908 100644 Binary files a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Death/ExoGame_Gruntling_Death_Montage.uasset and b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Death/ExoGame_Gruntling_Death_Montage.uasset differ diff --git a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Death/ExoGame_Gruntling_Death_Small_Alt_Montage.uasset b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Death/ExoGame_Gruntling_Death_Small_Alt_Montage.uasset index 7b2123ac..16662c37 100644 Binary files a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Death/ExoGame_Gruntling_Death_Small_Alt_Montage.uasset and b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Death/ExoGame_Gruntling_Death_Small_Alt_Montage.uasset differ diff --git a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Death/ExoGame_Gruntling_Death_Small_Montage.uasset b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Death/ExoGame_Gruntling_Death_Small_Montage.uasset index a52d346a..f59631a5 100644 Binary files a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Death/ExoGame_Gruntling_Death_Small_Montage.uasset and b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Death/ExoGame_Gruntling_Death_Small_Montage.uasset differ diff --git a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Intro/ExoGame_Gruntling_Intro_ClimbingUp.uasset b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Intro/ExoGame_Gruntling_Intro_ClimbingUp.uasset new file mode 100644 index 00000000..16f9b3d8 Binary files /dev/null and b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Intro/ExoGame_Gruntling_Intro_ClimbingUp.uasset differ diff --git a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Intro/ExoGame_Gruntling_Intro_ClimbingUp_Montage.uasset b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Intro/ExoGame_Gruntling_Intro_ClimbingUp_Montage.uasset new file mode 100644 index 00000000..caff3bb4 Binary files /dev/null and b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Intro/ExoGame_Gruntling_Intro_ClimbingUp_Montage.uasset differ diff --git a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Intro/ExoGame_Gruntling_Intro_Summon.uasset b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Intro/ExoGame_Gruntling_Intro_Summon.uasset new file mode 100644 index 00000000..0b3b67f7 Binary files /dev/null and b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Intro/ExoGame_Gruntling_Intro_Summon.uasset differ diff --git a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Intro/ExoGame_Gruntling_Intro_Summon_Montage.uasset b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Intro/ExoGame_Gruntling_Intro_Summon_Montage.uasset new file mode 100644 index 00000000..f73cf9ab Binary files /dev/null and b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/Animations/Intro/ExoGame_Gruntling_Intro_Summon_Montage.uasset differ diff --git a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/BP_GruntlingEnemy.uasset b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/BP_GruntlingEnemy.uasset index b666de46..b3ba1173 100644 Binary files a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/BP_GruntlingEnemy.uasset and b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/BP_GruntlingEnemy.uasset differ diff --git a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/BT_GruntlingEnemy.uasset b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/BT_GruntlingEnemy.uasset index 06df8a12..bcdcbd16 100644 Binary files a/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/BT_GruntlingEnemy.uasset and b/Content/CombatSystem/Blueprints/AI/GruntlingEnemy/BT_GruntlingEnemy.uasset differ diff --git a/Content/CombatSystem/Blueprints/Animnotifies/PauseAnims_AN.uasset b/Content/CombatSystem/Blueprints/Animnotifies/PauseAnims_AN.uasset new file mode 100644 index 00000000..34146c6b Binary files /dev/null and b/Content/CombatSystem/Blueprints/Animnotifies/PauseAnims_AN.uasset differ diff --git a/Content/InfinityBladeAdversaries/Enemy/Enemy_Gruntling_Guardian/Enemy_Gruntling_Guardian_Animation/ExoGame_Gruntling_Intro_ClimbingUp.uasset b/Content/InfinityBladeAdversaries/Enemy/Enemy_Gruntling_Guardian/Enemy_Gruntling_Guardian_Animation/ExoGame_Gruntling_Intro_ClimbingUp.uasset index 313f0c0b..aea33716 100644 Binary files a/Content/InfinityBladeAdversaries/Enemy/Enemy_Gruntling_Guardian/Enemy_Gruntling_Guardian_Animation/ExoGame_Gruntling_Intro_ClimbingUp.uasset and b/Content/InfinityBladeAdversaries/Enemy/Enemy_Gruntling_Guardian/Enemy_Gruntling_Guardian_Animation/ExoGame_Gruntling_Intro_ClimbingUp.uasset differ diff --git a/Content/InfinityBladeAdversaries/Enemy/Enemy_Gruntling_Guardian/Enemy_Gruntling_Guardian_Animation/ExoGame_Gruntling_Intro_Summon.uasset b/Content/InfinityBladeAdversaries/Enemy/Enemy_Gruntling_Guardian/Enemy_Gruntling_Guardian_Animation/ExoGame_Gruntling_Intro_Summon.uasset index 93bf6b44..681d0282 100644 Binary files a/Content/InfinityBladeAdversaries/Enemy/Enemy_Gruntling_Guardian/Enemy_Gruntling_Guardian_Animation/ExoGame_Gruntling_Intro_Summon.uasset and b/Content/InfinityBladeAdversaries/Enemy/Enemy_Gruntling_Guardian/Enemy_Gruntling_Guardian_Animation/ExoGame_Gruntling_Intro_Summon.uasset differ diff --git a/Content/Maps/IceLandMap.umap b/Content/Maps/IceLandMap.umap index 4e45b1db..1d1b768b 100644 Binary files a/Content/Maps/IceLandMap.umap and b/Content/Maps/IceLandMap.umap differ diff --git a/Source/D1/AI/BehaviorTreeNodes/T_FindRepositionLocation.cpp b/Source/D1/AI/BehaviorTreeNodes/T_FindRepositionLocation.cpp new file mode 100644 index 00000000..dc59259c --- /dev/null +++ b/Source/D1/AI/BehaviorTreeNodes/T_FindRepositionLocation.cpp @@ -0,0 +1,36 @@ +// Fill out your copyright notice in the Description page of Project Settings. + + +#include "AI/BehaviorTreeNodes/T_FindRepositionLocation.h" + +#include "BehaviorTree/BlackboardComponent.h" +#include "NavigationSystem.h" + +EBTNodeResult::Type UT_FindRepositionLocation::ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) +{ + EBTNodeResult::Type result = Super::ExecuteTask(OwnerComp, NodeMemory); + if(result == EBTNodeResult::Failed) + return EBTNodeResult::Failed; + + BlackboardComponent = OwnerComp.GetBlackboardComponent(); + if(BlackboardComponent == nullptr) + return EBTNodeResult::Failed; + + UObject* pObj = BlackboardComponent->GetValueAsObject(BlackboardKey_TargetToFollow.SelectedKeyName); + if(pObj) + { + AActor* OwnedActor = Cast(pObj); + if(OwnedActor) + { + UNavigationSystemV1* navSystem = UNavigationSystemV1::GetNavigationSystem(GetWorld()); + if(navSystem) + { + FNavLocation outLavLocation; + navSystem->GetRandomReachablePointInRadius(OwnedActor->GetActorLocation(), RadiusRange, outLavLocation); + BlackboardComponent->SetValueAsVector(BlackboardKey_MoveToLocation.SelectedKeyName, outLavLocation.Location); + return EBTNodeResult::Succeeded; + } + } + } + return EBTNodeResult::Failed; +} diff --git a/Source/D1/AI/BehaviorTreeNodes/T_FindRepositionLocation.h b/Source/D1/AI/BehaviorTreeNodes/T_FindRepositionLocation.h new file mode 100644 index 00000000..2f40e44e --- /dev/null +++ b/Source/D1/AI/BehaviorTreeNodes/T_FindRepositionLocation.h @@ -0,0 +1,28 @@ +// Fill out your copyright notice in the Description page of Project Settings. + +#pragma once + +#include "CoreMinimal.h" +#include "BehaviorTree/BTTaskNode.h" +#include "T_FindRepositionLocation.generated.h" + +/** + * + */ +UCLASS() +class D1_API UT_FindRepositionLocation : public UBTTaskNode +{ + GENERATED_BODY() +protected: + virtual EBTNodeResult::Type ExecuteTask(UBehaviorTreeComponent& OwnerComp, uint8* NodeMemory) override; + +private: + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="BlackBoard", meta=(AllowPrivateAccess="true")) + FBlackboardKeySelector BlackboardKey_TargetToFollow; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="BlackBoard", meta=(AllowPrivateAccess="true")) + FBlackboardKeySelector BlackboardKey_MoveToLocation; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="BlackBoard", meta=(AllowPrivateAccess="true")) + float RadiusRange; +private: + TObjectPtr BlackboardComponent; +}; diff --git a/Source/D1/AI/GruntlingEnemy.cpp b/Source/D1/AI/GruntlingEnemy.cpp index 31e973aa..0e1113f6 100644 --- a/Source/D1/AI/GruntlingEnemy.cpp +++ b/Source/D1/AI/GruntlingEnemy.cpp @@ -54,15 +54,15 @@ void AGruntlingEnemy::BeginPlay() MainWeaponCollisionComponent->SetCollisionMeshComponent(WeaponMeshComponent); MainWeaponCollisionComponent->AddActorToIgnore(this); - if(APlayerController* playerController = UGameplayStatics::GetPlayerController(GetWorld(), 0)) + UUI_HealthBar* HealthBarRef = Cast(HealthBarComponent->GetWidget()); + if (HealthBarRef) //ExposeOnSpawn 대용으로 사용 { - UUI_HealthBar* HealthBarRef = Cast(HealthBarComponent->GetWidget()); - if(HealthBarRef) //ExposeOnSpawn 대용으로 사용 - { - HealthBarRef->InitializeHealthBar(this->StatsComponent, EStats::Health); - HealthBarComponent->SetWidget(HealthBarRef); - } + HealthBarRef->InitializeHealthBar(this->StatsComponent, EStats::Health); + HealthBarComponent->SetWidget(HealthBarRef); } + + if(IsValid(IntroAnimMontage)) + PlayAnimMontage(IntroAnimMontage); } void AGruntlingEnemy::OnTargeted(bool bIsTargeted) diff --git a/Source/D1/AI/GruntlingEnemy.h b/Source/D1/AI/GruntlingEnemy.h index 33a40513..13c55aea 100644 --- a/Source/D1/AI/GruntlingEnemy.h +++ b/Source/D1/AI/GruntlingEnemy.h @@ -44,4 +44,6 @@ private: FName AttachSocketName; UPROPERTY(EditAnywhere, Blueprintable, Category="Initialization", meta=(AllowPrivateAccess="true")) FName WeaponHandSocketName; + UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Montage|Intro", meta = (AllowPrivateAccess = "true")) + TObjectPtr IntroAnimMontage; }; diff --git a/Source/D1/AI/MasterAI.cpp b/Source/D1/AI/MasterAI.cpp index 4d4e2102..a930564f 100644 --- a/Source/D1/AI/MasterAI.cpp +++ b/Source/D1/AI/MasterAI.cpp @@ -4,7 +4,6 @@ #include "AI/MasterAI.h" #include "AIController.h" -#include "CombatPlayerController.h" #include "Components/CapsuleComponent.h" #include "Components/InputComponent.h" #include "GameFramework/CharacterMovementComponent.h" @@ -274,6 +273,7 @@ float AMasterAI::PerformAttack(FGameplayTag AttackType, int32 AttackIndex, bool } else { + RotateToTarget(); StateManagerComponent->SetCurrentState(FCombatGameplayTags::Get().Character_State_Attacking); StateManagerComponent->SetCurrentAction(AttackType); @@ -333,9 +333,7 @@ void AMasterAI::CharacterStateBegin(FGameplayTag CharState) if (FGameplayTag::EmptyTag == CharState) {/*None*/} else if (FCombatGameplayTags::Get().Character_State_Attacking == CharState) - { - RotateToTarget(); - } + {/*None*/} else if (FCombatGameplayTags::Get().Character_State_Dodging == CharState) {/*None*/} else if (FCombatGameplayTags::Get().Character_State_GeneralActionState == CharState) @@ -470,7 +468,6 @@ void AMasterAI::RotateToTargetUpdate(float Value) if(!IsValid(TargetActor)) return; - const FRotator CurrentRotator = GetActorRotation(); FVector StartVector = GetActorLocation(); FVector TargetVector = TargetActor->GetActorLocation(); @@ -479,7 +476,6 @@ void AMasterAI::RotateToTargetUpdate(float Value) UWorld* WorldPointer = GetWorld(); if(!WorldPointer) return; - double deltaTime = UGameplayStatics::GetWorldDeltaSeconds(WorldPointer); FRotator NewRotator = FMath::Lerp(CurrentRotator, TargetRotator, Value); NewRotator.Roll = CurrentRotator.Roll; NewRotator.Pitch = CurrentRotator.Pitch;