public override void StartBehaviour(Agent _agent) { agent = _agent; dog = agent.GetComponent <DogTree>(); RandomBehaviours[Random.Range(0, RandomBehaviours.Length)].StartBehaviour(agent); }
public override void StartBehaviour(Agent _agent) { agent = _agent; dog = agent.GetComponent <DogTree>(); RunAway.StartBehaviour(agent); }
public override void StartBehaviour(Agent _agent) { agent = _agent; dog = agent.GetComponent <DogTree>(); Debug.Log("sleepy doggo"); agent.Succeed(); }
public override void StartBehaviour(Agent _agent) { agent = _agent; dog = agent.GetComponent <DogTree>(); //behaviour //Debug.Log("dog does damage"); StartCoroutine(DoDamage()); }
public override void StartBehaviour(Agent _agent) { agent = _agent; dog = agent.GetComponent <DogTree>(); AStarUnit = agent.GetComponent <Unit>(); //behaviour Debug.Log("pee on tree, gain speed"); dog.speedBoostActive = true; dog.seenTree = null; initSpeed = AStarUnit.speed; AStarUnit.speed += AStarUnit.speed; StartCoroutine(DecreaseSpeed()); Succeed(); }
public override void StartBehaviour(Agent _agent) { agent = _agent; dog = agent.GetComponent <DogTree>(); //behaviour newDamage = dog.dogDamage * damageIncreasePercent; Debug.Log("dog damage increase with " + (newDamage - dog.dogDamage) + " so the current damage is now: " + newDamage); if (newDamage >= damageCap) { newDamage = damageCap; } dog.dogDamage = newDamage; Succeed(); }
public override void StartBehaviour(Agent _agent) { agent = _agent; dog = agent.GetComponent <DogTree>(); AStarUnit = agent.GetComponent <Unit>(); //behaviour AStarUnit.target = spawn; AStarUnit.enabled = true; if (AStarUnit.routeFinished) { SlowlyHeal(); } else { Continue(); } }
public override void StartBehaviour(Agent _agent) { agent = _agent; dog = agent.GetComponent <DogTree>(); AStarUnit = agent.GetComponent <Unit>(); if (dog.seenCat == null) { Failed(); return; } if (Vector3.Distance(transform.position, dog.seenCat.transform.position) >= 5) { AStarUnit.target = dog.seenCat.transform; AStarUnit.enabled = true; Continue(); } else { transform.LookAt(dog.seenCat.transform); AStarUnit.enabled = false; AStarUnit.target = null; //Debug.Log("Cat fights"); DoDamage.StartBehaviour(agent); } if (dog.seenCat.tag == "Player") { DoDamage.StartBehaviour(agent); } else { if (dog.seenCat.GetComponent <CatSeeDog>().currentLeaf == dog.seenCat.GetComponent <CatRunAway>()) { //Debug.Log("Cat runs away"); GainDamageBonus.StartBehaviour(agent); } } }
public override void StartBehaviour(Agent _agent) { agent = _agent; dog = agent.GetComponent <DogTree>(); AStarUnit = agent.GetComponent <Unit>(); //behaviour //Debug.Log(Vector3.Distance(transform.position, dog.seenTree.transform.position)); if (Vector3.Distance(transform.position, dog.seenTree.transform.position) >= 5) { Debug.Log("going to tree"); AStarUnit.target = dog.seenTree.transform; AStarUnit.enabled = true; Continue(); } else { AStarUnit.enabled = false; PeeOnTree.StartBehaviour(agent); } }