Example #1
0
 public override ushort GuardianSubAttackBehaviorAI(TerraGuardian Owner, CombatTactic tactic, Vector2 TargetPosition, Vector2 TargetVelocity, int TargetWidth, int TargetHeight, ref bool Approach, ref bool Retreat, ref bool Jump, ref bool Couch, out bool DefaultBehavior)
 {
     DefaultBehavior = false;
     if (Math.Abs(TargetPosition.X + TargetWidth * 0.5f - Owner.Position.X) < 100)
     {
         Retreat = true;
     }
     if (Math.Abs(TargetPosition.X + TargetWidth * 0.5f - Owner.Position.X) > 600)
     {
         Approach = true;
     }
     if (Owner.CanUseSubAttack(1) && Math.Abs(TargetPosition.X + TargetWidth * 0.5f - Owner.Position.X) < 120 * Owner.Scale + TargetWidth * 0.5f &&
         Math.Abs(TargetPosition.Y + TargetHeight * 0.5f - Owner.CenterY) < 120 * Owner.Scale + TargetHeight * 0.5f)
     {
         return(2);
     }
     return(0);
     //return base.GuardianSubAttackBehaviorAI(Owner, tactic, TargetPosition, TargetVelocity, TargetWidth, TargetHeight, ref Approach, ref Retreat, ref Jump, ref Couch, out DefaultBehavior);
 }