Exemplo n.º 1
0
    public override bool KeepBehaviorCheck(AiShip leader, AiShip subject)
    {
        try
        {
            // Optimize -- Make sure the target is the same as the leaders.
            if (leader.GetTarget() == null)
                return false;

            if (leader.GetTarget().gameObject.name != subject.GetTarget().gameObject.name)
                return false;

            Attributes subjectStats = subject.getAttributes();
            // Get Percent / 100% using cross multiply
            double health = GetCurrentHealthPercentage();
            // comparison of factions may not work, check later.
            if (health >= 25 && leader.GetTarget() != null)
                return true;
        }
        catch
        {
            if (!subject)
                return false;

            if (subject.GetMyFleet().fleetLeader is PlayerShip)
                return false;

            if (!leader)
                leader = (AiShip)subject.GetMyFleet().fleetLeader;
        }

        return false;
    }
Exemplo n.º 2
0
    public override bool KeepBehaviorCheck(AiShip leader, AiShip subject)
    {
        // Optimize -- Make sure there is a target first.
        if (subject.GetTarget() == null)
            return false;

        Attributes subjectStats = subject.getAttributes();
        // Get Percent / 100% using cross multiply
        double health = GetCurrentHealthPercentage();
        AiShip targetShip = subject.GetTarget().gameObject.GetComponent("AiShip") as AiShip;
        string targetFaction = targetShip.getFaction();

        // comparison of factions may not work, check later.
        if (health >= 25 &&  subject.getFaction() == targetFaction)
            return true;

        return false;
    }
Exemplo n.º 3
0
    public override bool KeepBehaviorCheck(AiShip leader, AiShip subject)
    {
        //Check if the behavior of the leader is the same as the subject.
        if (leader.GetBehavior().Equals(subject.GetBehavior()) && leader.ID != subject.ID)
            return true;

        AiShip enemyShip = leader.GetTarget().gameObject.GetComponent("AiShip") as AiShip;
        // For Leaders eyes Only
        if (leader.GetMyFleet().threat < (enemyShip.GetMyFleet().threat * 10))
            return true;

        return false;
    }
Exemplo n.º 4
0
    public override bool KeepBehaviorCheck(AiShip leader, AiShip subject)
    {
        // Optimize -- Make sure there is a target first.
        if (subject.GetTarget() == null)
            return false;

        Attributes subjectStats = subject.getAttributes();
        // Get Percent / 100% using cross multiply
        double health = GetCurrentHealthPercentage();

        //Debug.Log("MAYBE TRUE");
        // comparison of factions may not work, check later.
        if (health >= 15)
            return true;

        Debug.Log("SOLO FALSE");
        return false;
    }
Exemplo n.º 5
0
    public override bool KeepBehaviorCheck(AiShip leader, AiShip subject)
    {
        if (ship.Aggressors.Count > 0 )
        {
            //Debug.Log("Search has aggressors :: " + ship.name);
            return false;
        }

        if (ship.target != beacon.transform && ship.target != null)
        {
        //			if (ship.target != beacon.transform)
        //				//Debug.Log("Search has target other than beacon");
        //			else
        //				//Debug.Log("Search has target is null");
            return false;
        }

        Attributes subjectStats = subject.getAttributes();
        // Get Percent / 100% using cross multiply
        double health = GetCurrentHealthPercentage();

        // If ship is not damaged and has no target, search. (For Fleet leaders and Solo Ships only).
        if (health >= 75 &&  subject.GetTarget() == beacon.transform)
            return true;

        //Debug.Log("Behavior Not Kept");
        return false;
    }