Compare commits
No commits in common. "9436d168751a9fd28de97a2683571c3aea8091e2" and "e07abfbcfcab3cd3655157ed34737dea284adefa" have entirely different histories.
9436d16875
...
e07abfbcfc
|
@ -78,14 +78,6 @@ void APickup::OnOuterBeginOverlap(UPrimitiveComponent* OverlappedComponent, AAct
|
||||||
{
|
{
|
||||||
PickupLocation = GetActorLocation();
|
PickupLocation = GetActorLocation();
|
||||||
PlayTimeLine();
|
PlayTimeLine();
|
||||||
|
|
||||||
double dist = FVector::Distance(GetActorLocation(), PlayerCharacter->GetActorLocation());
|
|
||||||
|
|
||||||
if (dist < OuterSphereComponent->GetScaledSphereRadius())
|
|
||||||
{
|
|
||||||
double ratio = FMath::Abs((dist / OuterSphereComponent->GetScaledSphereRadius()) - 1.0f);
|
|
||||||
TimelineComponent->SetNewTime(ratio);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,9 +36,11 @@ void AVampireAIController::Tick(float DeltaTime)
|
||||||
{
|
{
|
||||||
Super::Tick(DeltaTime);
|
Super::Tick(DeltaTime);
|
||||||
|
|
||||||
if (PlayerCharacter)
|
if (AVampireCharacter* Player = Cast<AVampireCharacter>(UGameplayStatics::GetPlayerCharacter(GetWorld(), 0)))
|
||||||
{
|
{
|
||||||
Blackboard->SetValueAsVector("PlayerLocation", PlayerCharacter->GetActorLocation());
|
Blackboard->SetValueAsObject("Player", Player);
|
||||||
|
auto location = Player->GetActorLocation();
|
||||||
|
Blackboard->SetValueAsVector("PlayerLocation", location);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,18 +54,11 @@ void AVampireAIController::OnPossess(APawn* InPawn)
|
||||||
EnemyCharacter->GetHealthComponent()->OnDamaged.AddDynamic(this, &AVampireAIController::OnDamaged);
|
EnemyCharacter->GetHealthComponent()->OnDamaged.AddDynamic(this, &AVampireAIController::OnDamaged);
|
||||||
EnemyCharacter->GetHealthComponent()->OnDeath.AddDynamic(this, &AVampireAIController::OnDeath);
|
EnemyCharacter->GetHealthComponent()->OnDeath.AddDynamic(this, &AVampireAIController::OnDeath);
|
||||||
|
|
||||||
PlayerCharacter = UGameplayStatics::GetPlayerCharacter(GetWorld(), 0);
|
|
||||||
|
|
||||||
if (UBehaviorTree* bt = EnemyCharacter->GetBehaviorTree())
|
if (UBehaviorTree* bt = EnemyCharacter->GetBehaviorTree())
|
||||||
{
|
{
|
||||||
Blackboard->InitializeBlackboard(*bt->BlackboardAsset);
|
Blackboard->InitializeBlackboard(*bt->BlackboardAsset);
|
||||||
BehaviorTree->StartTree(*bt);
|
BehaviorTree->StartTree(*bt);
|
||||||
Blackboard->SetValueAsObject("SelfActor", EnemyCharacter);
|
Blackboard->SetValueAsObject("SelfActor", EnemyCharacter);
|
||||||
|
|
||||||
if (PlayerCharacter)
|
|
||||||
{
|
|
||||||
Blackboard->SetValueAsObject("Player", PlayerCharacter);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,7 +22,7 @@ class VAMPIRES_API AVampireAIController : public AAIController
|
||||||
|
|
||||||
UBehaviorTreeComponent* BehaviorTree;
|
UBehaviorTreeComponent* BehaviorTree;
|
||||||
|
|
||||||
ACharacter* PlayerCharacter;
|
APlayerCharacter* PlayerCharacter;
|
||||||
|
|
||||||
AEnemyCharacter* EnemyCharacter;
|
AEnemyCharacter* EnemyCharacter;
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,6 @@ class VAMPIRES_API AGarlicWeapon : public AWeapon
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadOnly, meta = (AllowPrivateAccess = "true"))
|
|
||||||
USphereComponent* SphereComponent;
|
USphereComponent* SphereComponent;
|
||||||
|
|
||||||
TArray<FOverlappedEnemy> OverlappedEnemies;
|
TArray<FOverlappedEnemy> OverlappedEnemies;
|
||||||
|
|
Loading…
Reference in New Issue