public override bool runAction(BossGOAP boss) { LevelManager.Instance.bossWave = true; boss.anim.SetTrigger("CallBackup"); boss.StartCoroutine("CallBackUpAction"); return(true); }
public override bool runAction(BossGOAP boss) { boss.anim.SetFloat("speed", 0); boss.anim.SetTrigger("Shoot"); boss.gun.SetActive(true); boss.StartCoroutine("ShootPlayer"); return(true); }
public override bool runAction(BossGOAP boss) { boss.anim.SetFloat("speed", 0); boss.anim.SetTrigger("Teleport"); boss.StartCoroutine(boss.Teleport(boss.healPosition.position, 1f)); return(true); }
public override bool runAction(BossGOAP boss) { if (Time.time - boss.lastTimeFired <= 0) { if (boss.check == false) { if (boss.useAStar) { boss.StartCoroutine("GetPlayerDirection"); } } boss.anim.SetFloat("speed", 1); if (Vector3.Distance(boss.transform.position, boss.allWalkLocations[boss.selectedPath][boss.selectedLocation].position) <= 2) { if (boss.selectedLocation == boss.allWalkLocations[boss.selectedPath].Count - 1) { boss.selectedLocation = 0; } else { boss.selectedLocation++; } } if (boss.useAStar) { if (boss.waypoints != null && boss.waypoints.Count != 0) { transform.position = Vector3.MoveTowards(boss.transform.position, boss.waypoints[0], boss.speed * Time.deltaTime); transform.LookAt(new Vector3(boss.waypoints[0].x, transform.position.y, boss.waypoints[0].z)); if (this.transform.position == boss.waypoints[0]) { boss.waypoints.RemoveAt(0); } } } else { boss.agent.destination = boss.allWalkLocations[boss.selectedPath][boss.selectedLocation].position; } return(false); } else { return(true); } }
public override bool runAction(BossGOAP boss) { boss.anim.SetFloat("speed", 0); boss.anim.SetTrigger("Teleport"); if (boss.selectedPath == boss.allWalkLocations.Count - 1) { boss.selectedPath = 0; } else { boss.selectedPath++; } boss.StartCoroutine(boss.Teleport(boss.allWalkLocations[boss.selectedPath][boss.selectedPath].position, 1f)); boss.worldState.states.Clear(); boss.worldState.states.Add("canMove"); return(true); }
void Waves() { if (!isThisBoss) { if (Time.time >= lastWaveEndTime) { currentWave.StartWave(spawnLocations); } } else if (bossWave == true && isThisBoss) { currentWave.StartWave(spawnLocations); } if (currentWave.end == true) { if (!isThisBoss && wavePoint <= waves.Length) { if (wavePoint < waves.Length) { currentWave = waves[wavePoint]; wavePoint++; } else { levelStart = false; levelEnd = true; } } else if (boss != null) { int o = Random.Range(0, waves.Length); currentWave = waves[o]; currentWave.end = false; bossCode.StartCoroutine("CallBackup"); bossWave = false; } lastWaveEndTime = Time.time + waveRate; } }
public override bool runAction(BossGOAP boss) { if (boss.currentHealth >= boss.maxHealth || boss.damageTaken >= 100) { Debug.Log("damaged"); if (boss.currentHealth >= boss.maxHealth) { boss.currentHealth = boss.maxHealth; } boss.StartCoroutine(boss.Teleport(boss.allWalkLocations[boss.selectedPath][boss.selectedPath].position, 1f)); boss.worldState.states.Clear(); boss.worldState.states.Add("canMove"); return(true); } else { Debug.Log(boss.damageTaken); Debug.Log("Healing"); boss.Damage(-50f * Time.deltaTime); return(false); } }