Advertisement
Guest User

Untitled

a guest
Feb 23rd, 2018
283
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.17 KB | None | 0 0
  1.         mBehaviour = bt::Builder()
  2.         .Parallel()
  3.             .Sequence("Heal")
  4.                 .Condition([this] { return NeedHealing(); })
  5.                 .Do([this] { return UseHealingPotion(); })
  6.             .End()
  7.  
  8.             .Selector("AttackOrRunAway")               
  9.                 .Sequence("Attack")
  10.                     .Condition([this] { return !NeedHealing(); })
  11.                     .Do([this] { return LookForTarget(); })                                
  12.                     .Do([this] { return SelectWeapon(); })
  13.                     .Selector()
  14.                         .Sequence()
  15.                             .Condition([this] { return IsTooCloseToEnemy(); })
  16.                             .Do([this] { return SetMoveDestinationFarEnoughFromEnemy(); })     
  17.                         .End()                 
  18.                         .Do([this] { return SetMoveDestinationEnemyPosition(); })                  
  19.                     .End()
  20.                        
  21.                     .Do([this] { return MoveToDestination(); })
  22.                     .Do([this] { return LookAtActor(); })
  23.                     .Do([this] { return AimAtLookPoint(); })
  24.                     .Do([this] { return UseWeapons(); })
  25.                 .End()
  26.                
  27.                 .Sequence("RunAway")
  28.                     .Do([this] { return SetMoveDestinationDefault(); })
  29.                     .Do([this] { return LookAtWaypoint(); })
  30.                     .Do([this] { return AimAtLookPoint(); })
  31.                     .Do([this] { return MoveToDestination(); })
  32.                 .End()
  33.             .End() 
  34.         .End()
  35.         .Build();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement