Ejemplo n.º 1
0
    public ChaseTarget(AIControls ai, CarController car, Transform target)
        : base(ai, car)
    {
        this.target = target;

        ai.Follow(target);  // Chase the target
    }
Ejemplo n.º 2
0
    // Use this for initialization
    void Start()
    {
        character        = GetComponent <Character>();
        animator         = GetComponent <Animator>();
        AIcontrols       = GetComponentInParent <AIControls>();
        sharedProperties = GetComponentInParent <SharedProperties>();

        if (GetComponentInParent <Opponent>() != null)
        {
            player             = FindObjectOfType <Player>();
            playerCharacter    = player.GetComponentInChildren <Character>();
            opponentController = GetComponentInParent <Opponent>();
            animator.SetInteger("hadoukenOwner", 2);
        }
        else if (GetComponentInParent <Player>() != null)
        {
            opponent          = FindObjectOfType <Opponent>();
            opponentCharacter = opponent.GetComponentInChildren <Character>();
            playerController  = GetComponentInParent <Player>();
            animator.SetInteger("hadoukenOwner", 1);
        }

        decisionTimerInput = decisionTimer;
        antiAirTimerInput  = antiAirTimer;
        antiAirTimer       = 0f;
        decision           = Random.Range(0, 100);
        lastUsedNormal     = LastUsedNormal.none;
    }
Ejemplo n.º 3
0
    public AIState(AIControls ai, CarController car)
    {
        this.ai  = ai;
        this.car = car;

        Debug.Log(GetType().ToString());
    }
Ejemplo n.º 4
0
    // Use this for initialization
    void Start()
    {
        if (GetComponentInParent <Opponent>() != null)
        {
            player          = FindObjectOfType <Player>();
            playerCharacter = player.GetComponentInChildren <Character>();
        }
        else if (GetComponentInParent <Player>() != null)
        {
            opponent          = FindObjectOfType <Opponent>();
            opponentCharacter = opponent.GetComponentInChildren <Character>();
        }

        character        = GetComponent <Character>();
        animator         = GetComponent <Animator>();
        AIcontrols       = GetComponentInParent <AIControls>();
        chargeSystem     = GetComponentInParent <ChargeSystem>();
        sharedProperties = GetComponentInParent <SharedProperties>();

        regularFarRangeDecisions     = new List <string>();
        regularMidRangeDecisions     = new List <string>();
        regularCloseRangeDecisions   = new List <string>();
        airAttackDecisions           = new List <string>();
        otherFighterBlockedDecisions = new List <string>();
        otherFighterGotHitDecisions  = new List <string>();
        knockDownDecisions           = new List <string>();
        antiAirDecisions             = new List <string>();

        RegularFarRangeDecisionTrees();
        RegularMidRangeDecisionTrees();
        RegularCloseRangeDecisionTrees();
        AirAttackDecisionTrees();
        OtherFighterBlockedDecisionTrees();
        OtherFighterGotHitDecisionTrees();
        KnockDownDecisionTrees();
        AntiAirDecisionTrees();

        decision           = Random.Range(0, DECISION_MAX);
        decisionTimerInput = decisionTimer;
        antiAirTimerInput  = antiAirTimer;
        antiAirTimer       = 0f;
    }
Ejemplo n.º 5
0
    private void Awake()
    {
        agent          = GetComponent <NavMeshAgent>();
        timeLeftToWalk = walkTime;

        if (isFlying && flyingBody != null)
        {
            flyingHeight = flyingBody.transform.position.y;
        }
        if (isFlying)
        {
            heart.SetValue(50);
        }

        // Detect debug commands
        aiControls = new AIControls();
        aiControls.Debug.ToggleMovement.performed += _ => DebugToggleMove();

        heartToDrop = Instantiate(heart, transform.position, transform.rotation, transform);
        heartToDrop.gameObject.transform.parent = null;
    }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        if (GetComponentInParent <Opponent>() != null)
        {
            player          = FindObjectOfType <Player>();
            playerCharacter = player.GetComponentInChildren <Character>();
        }
        else if (GetComponentInParent <Player>() != null)
        {
            opponent          = FindObjectOfType <Opponent>();
            opponentCharacter = opponent.GetComponentInChildren <Character>();
        }

        character        = GetComponent <Character>();
        animator         = GetComponent <Animator>();
        AIcontrols       = GetComponentInParent <AIControls>();
        sharedProperties = GetComponentInParent <SharedProperties>();

        decisionTimerInput = decisionTimer;
        antiAirTimerInput  = antiAirTimer;
        antiAirTimer       = 0f;
        decision           = Random.Range(0, 100);
    }
Ejemplo n.º 7
0
 void Start()
 {
     AIControls = transform.parent.gameObject.GetComponent <AIControls>();
 }
Ejemplo n.º 8
0
 public HuntEnemy(AIControls ai, CarController car)
     : base(ai, car)
 {
     launcher = ai.GetComponent <RocketLauncher>();
 }
Ejemplo n.º 9
0
 public ClickToMove(AIControls ai, CarController car)
     : base(ai, car) /* Nothing */ }
Ejemplo n.º 10
0
 public FindPowerUp(AIControls ai, CarController car)
     : base(ai, car) /* Nothing */ }
Ejemplo n.º 11
0
 public EvasiveManoeuvres(AIControls ai, CarController car)
     : base(ai, car)
 {
     // TODO: listen for powerup spawn
 }