//todo -- maybe this should be DestroyEntities to be more generic
 public AIGoal_DestroyShips(AIGoalDescriptor descriptor, string[] shipNames)
     : base(descriptor)
 {
     this.aiState = AIStates.Attack;
     this.shipNames = shipNames;
     this.remainingShipNames = new List<string>(shipNames);
 }
Exemple #2
0
 public AIGoal_GoTo(AIGoalDescriptor descriptor, Vector3 destination, float arrivalDistance, bool arrive = false)
     : base(descriptor)
 {
     this.destination = destination;
     this.arrivalDistance = arrivalDistance;
     this.arrive = arrive;
     this.aiState = "GoTo"; //todo replace with constant
 }
Exemple #3
0
 //   public AIGoalPrioritizer prioritizer;       //might be a string lookup
 //   public AIGoalTargetSelector targetSelector; //might be a string lookup
 //todo introduce AIGoalStatus.Valid|Invalid.
 //use case would be target list but some have not entered battle yet
 public AIGoal(AIGoalDescriptor descriptor)
 {
     this.status = descriptor.status;
     this.type = descriptor.type;
     this.priority = descriptor.priority;
     this.tenacityMultiplier = descriptor.tenacityMultiplier;
     if (this.status == AIGoalStatus.Pending) {
         OnActivate();
     }
 }
Exemple #4
0
    //todo -- probably takes a descriptor to read pilot stats out of
    public void Start()
    {
        this.entity = GetComponent<Entity>();
        this.engines = GetComponentInChildren<EngineSystem>();
        this.controls = engines.FlightControls;
        this.sensorSystem = entity.sensorSystem;
        this.weaponSystem = entity.weaponSystem;
        this.commSystem = entity.commSystem;
        this.navSystem = entity.navSystem;
        Assert.IsNotNull(this.entity, "AIPilot needs an entity " + transform.name);
        Assert.IsNotNull(this.engines, "AIPilot needs an engine system");
        Assert.IsNotNull(this.sensorSystem, "AIPilot needs a sensor system");
        goals = new List<AIGoal>(5);
        AddGoal(new AIGoal_Idle());

        AIGoalDescriptor desc = new AIGoalDescriptor(0.5f);
        AddGoal(new AIGoal_GoTo(desc, new Vector3(0, 0, 42f), 5f));

        aiStates = CreateAIStates(this);

        SetAIState();
    }