Beispiel #1
0
        protected virtual LSAgent DoScan()
        {
            Func <LSAgent, bool> agentConditional = null;

            if (this._damage >= 0)
            {
                agentConditional = (other) =>
                {
                    Health health = other.GetAbility <Health>();
                    return(Agent.GlobalID != other.GlobalID && health != null && health.CanLose && CachedAgentValid(other));
                };
            }
            else
            {
                agentConditional = (other) =>
                {
                    Health health = other.GetAbility <Health>();
                    return(Agent.GlobalID != other.GlobalID && health != null && health.CanGain && CachedAgentValid(other));
                };
            }
            LSAgent agent = InfluenceManager.Scan(
                this.cachedBody.Position,
                this.Sight,
                agentConditional,
                (bite) =>
            {
                return((this.Agent.Controller.GetAllegiance(bite) & this.TargetAllegiance) != 0);
            }
                );

            return(agent);
        }
Beispiel #2
0
 private LSAgent DoScan()
 {
     return(InfluenceManager.Scan(
                this.cachedBody.Position,
                this.Sight,
                (other) => other.GetAbility <Health>().IsNotNull(),
                (bite) => ((this.Agent.Controller.GetAllegiance(bite) & this.TargetAllegiance) != 0)
                ));
 }
Beispiel #3
0
 private LSAgent DoScan()
 {
     return(InfluenceManager.Scan(
                this.cachedBody.Position,
                this.rangeDeltaCount,
                (other) => other.Healther.IsNotNull(),
                (bite) => ((this.Agent.Controller.GetAllegiance(bite) & this.TargetAllegiance) != 0)
                ));
 }
Beispiel #4
0
 public LSAgent Scan(int deltaCount,
                     AllegianceType targetAllegiance = AllAllegiance,
                     PlatformType targetPlatform     = AllPlatforms)
 {
     InfluenceManager.Source           = Agent;
     InfluenceManager.TargetAllegiance = targetAllegiance;
     InfluenceManager.TargetPlatform   = targetPlatform;
     return(InfluenceManager.Scan(LocatedNode.ScanX, LocatedNode.ScanY, deltaCount,
                                  this.Agent, targetAllegiance));
 }
Beispiel #5
0
 public LSAgent Scan(int deltaCount,
                     AllegianceType targetAllegiance = AllegianceType.Any,
                     PlatformType targetPlatform     = PlatformType.Any)
 {
     InfluenceManager.Source           = Agent;
     InfluenceManager.TargetAllegiance = targetAllegiance;
     InfluenceManager.TargetPlatform   = targetPlatform;
     return(InfluenceManager.Scan(LocatedNode.ScanX, LocatedNode.ScanY, deltaCount,
                                  InfluenceManager.ScanConditionalSourceWithHealthAction,
                                  Agent.Body.Position.x,
                                  Agent.Body.Position.y));
 }
Beispiel #6
0
        protected virtual LSAgent DoScan()
        {
            Func <LSAgent, bool> agentConditional = AgentConditional;
            LSAgent agent = InfluenceManager.Scan(
                this.cachedBody.Position,
                this.Sight,
                agentConditional,
                (bite) =>
            {
                return((this.Agent.Controller.GetAllegiance(bite) & this.TargetAllegiance) != 0);
            }
                );

            return(agent);
        }