Guest User

launchAtk

a guest
Jan 30th, 2017
96
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // @Maxpro 2017
  2.  
  3. #include "CodeTests.h"
  4. #include "SpiderAIController.h"
  5. #include "MasterEnemy.h"
  6. #include "BehaviorTree/BlackboardComponent.h"
  7. #include "Task_LaunchAttack.h"
  8.  
  9. EBTNodeResult::Type UTask_LaunchAttack::ExecuteTask(UBehaviorTreeComponent & OwnerComp, uint8 * NodeMemory)
  10. {
  11. Super::ExecuteTask(OwnerComp, NodeMemory);
  12.  
  13. NodeName = ThisNodeName;
  14.  
  15. ASpiderAIController* AICon = Cast<ASpiderAIController>(OwnerComp.GetAIOwner());
  16. AMasterEnemy* Enemy = Cast<AMasterEnemy>(AICon->GetPawn());
  17.  
  18. UBlackboardComponent* BlackboardComp = AICon->GetBlackboardComp();
  19.  
  20.  
  21. Enemy->LaunchAttack(this);
  22.  
  23. return OnAttackLaunched();
  24. }
  25.  
  26. EBTNodeResult::Type UTask_LaunchAttack::OnAttackLaunched()
  27. {
  28. return EBTNodeResult::Succeeded;
  29. }
RAW Paste Data