// Start is called before the first frame update void Awake() { rb = GetComponent <Rigidbody2D>(); bossAi = GameObject.FindGameObjectWithTag("Boss").GetComponent <BossAI>(); time = Time.time; originalPos = transform.position; }
// Use this for initialization void Start() { inventory = GameObject.FindGameObjectWithTag("PlayerInventory"); aInventory = inventory.GetComponent <PlayerInventory>(); boss = GameObject.FindGameObjectWithTag("Boss"); aBoss = boss.GetComponent <BossAI>(); }
private IEnumerator DelayStart() { yield return(new WaitForSeconds(5)); SceneManager.LoadScene(0); BossAI.setHealth(15); }
private IEnumerator RespawnBoss(float time) { yield return(new WaitForSeconds(time)); int index = Random.Range(0, freeBossRespawnPoints.Count); BossRespawnPoint point = freeBossRespawnPoints[index]; BossAI bossAI = Instantiate(bossPrefab, enemyRespawnPointsTransform, false).GetComponent <BossAI>(); bossAI.transform.localPosition = point.positionInWorld; GameObject bossOnRadar = Instantiate(enemyOnRadarPrefab, radarTransform, false); bossOnRadar.transform.localPosition = point.positionOnRadar; HealthBar bossHealthBar = Instantiate(healthBarPrefab, hudTransform, false).GetComponent <HealthBar>(); bossHealthBar.transform.localPosition = point.positionOnHUD; ProgressBar bossProgressBar = Instantiate(progressBarPrefab, hudTransform, false).GetComponent <ProgressBar>(); bossProgressBar.transform.localPosition = point.positionOnHUD - progressBarOffset; bosses.Add(bossAI); bossAI.Init(bossOnRadar, bossHealthBar, bossProgressBar, point); freeBossRespawnPoints.Remove(point); takenBossRespawnPoints.Add(point); isBossRespawning = false; isBossRespawned = true; }
// Update is called once per frame void Update() { time += Time.deltaTime; if (BossAI.canAttckLeft == true || RightAttack.IamDeadCanYouHelp) { BossAI health = GetComponent <BossAI>(); if (health.bossHealth > 0) { if (time > 5f) { time = 0; RightAttack.IamDeadCanYouHelp = false; StartCoroutine(BossAttackCombo()); } } else { IamDeadCanYouHelp = true; } } if (MoveUpwards.FloorNum >= bossAI.shoot.lastFloor - 1) { LockOnTarget(); } }
public void Init(BossAI owner, Transform placeForRope) { this.owner = owner; this.placeForRope = placeForRope; ship = Ship.Instance; }
// Use this for initialization void Start() { pos = transform.position.x; capsule.enabled = false; enemy = GetComponent <BossAI> (); enemyT = GetComponent <Transform> (); //enemyR = GetComponent<Rigidbody> (); isStun = false; seesPlayer = false; isMoving = false; isIdle = false; timeForCool1 = GetComponent <CoolDown>(); timeForCool2 = GetComponent <CoolDown>(); proCoolDown = GetComponent <CoolDown>(); if (PlayerPrefs.GetString("hasWand") == "true") { wandBonus = 1; } else { wandBonus = 0; } if (PlayerPrefs.GetString("hasSword") == "true") { swordBonus = 1; } else { swordBonus = 0; } }
public void OnStateEnter() { if (Owner == OwnerType.Player) { PlayerController _P_Con = GameObject.Find("Player").GetComponent <PlayerController>(); } else if (Owner == OwnerType.Player_Skill) { PlayerController _P_Con = GameObject.Find("Player").GetComponent <PlayerController>(); if (TwoEffect) { _P_Con.NumberSkillUse = 3; } _P_Con.TakeDamage(); } else if (Owner == OwnerType.G_Warrior) { NaveMeshEnemy _E_Sta = GameObject.Find("G_Warrior").GetComponent <NaveMeshEnemy>(); _E_Sta.Atk(); } else if (Owner == OwnerType.G_Warrior_Boss) { BossAI _E_Sta = GameObject.Find("G_Warrior_Boss").GetComponent <BossAI>(); _E_Sta.Atk(); } else if (Owner == OwnerType.G_Warrior_Boss_Skill) { BossAI _E_Sta = GameObject.Find("G_Warrior_Boss").GetComponent <BossAI>(); _E_Sta.TakeDamage(); } else if (Owner == OwnerType.G_Templar) { NaveMeshEnemy _E_Sta = GameObject.Find("G_Templar").GetComponent <NaveMeshEnemy>(); _E_Sta.Atk(); } else if (Owner == OwnerType.G_Templar_Boss) { BossAI _E_Sta = GameObject.Find("G_Templar_Boss").GetComponent <BossAI>(); _E_Sta.Atk(); } else if (Owner == OwnerType.G_Templar_Boss_Skill) { BossAI _E_Sta = GameObject.Find("G_Templar_Boss").GetComponent <BossAI>(); _E_Sta.TakeDamage(); } else if (Owner == OwnerType.G_King) { BossAI _E_Sta = GameObject.Find("King_Goblin").GetComponent <BossAI>(); _E_Sta.Atk(); } else if (Owner == OwnerType.G_King_Skill) { BossAI _E_Sta = GameObject.Find("King_Goblin").GetComponent <BossAI>(); if (TwoEffect) { _E_Sta.NumberSkillUse = 2; } _E_Sta.TakeDamage(); } }
// Update is called once per frame void Update() { if (BossAI.getHealth() <= 0 && hasEnded == false) { //winOrLose.text = "You Win!"; print("you win!"); result = won; timeOfEvent = timerText.getTime(); AudioSource.PlayClipAtPoint(victory, Camera.main.transform.position); hasEnded = true; } else if (Health.getHealth() <= 0 && hasEnded == false) { //winOrLose.text = "You Lose!"; timeOfEvent = timerText.getTime(); AudioSource.PlayClipAtPoint(loss, Camera.main.transform.position); result = lost; hasEnded = true; } else if (hasEnded == false) { winOrLose.text = " "; } if (hasEnded == true) { winOrLose.text = result; StartCoroutine("DelayStart"); print("loading menu"); } }
// Start is called before the first frame update void Start() { randX = Random.Range(-1f, 1f); randY = Random.Range(-1f, 1f); timeOut = Time.time + 0.7f; bossAi = GameObject.FindGameObjectWithTag("Boss").GetComponent <BossAI>(); }
// Use this for initialization void Start() { if (Boss == null) { Boss = GetComponentInParent <BossAI>(); } Damage = Boss.m_EnemyStat.Dmg; }
private void Start() { anim = GetComponent <BossAnimations>(); transform.position = new Vector2(minX, yPos); bossAi = GetComponent <BossAI>(); bossRend = FindObjectOfType <BossRend>(); transform.eulerAngles = new Vector3(transform.rotation.x, 0f, transform.rotation.z); }
// Use this for initialization void Start() { npcScript = GameObject.Find("Boss").GetComponent <WorldButtonInteraction>(); stage = 0; aBoss = GameObject.Find("Boss").GetComponent <BossAI>(); messageLength *= (Screen.width / 100f); messageHeight *= (Screen.height / 100f); }
// Start is called before the first frame update void Start() { playshooting = GetComponent <BossAI>(); Koreographer.Instance.RegisterForEvents(eventID[0], PlayerCanShoot); Koreographer.Instance.RegisterForEvents(eventID[1], SpeicalAmmo); Koreographer.Instance.RegisterForEvents(eventID[2], SpeicalAmmo2); Koreographer.Instance.RegisterForEvents(eventID[3], SpeicalAmmo3); }
private void Start() { m_scribbler = GetComponent <Scribbler>(); m_bossAI = GetComponent <BossAI>(); m_bossAudio = GetComponent <AudioCharacterBoss>(); m_enemyAudio = GetComponent <AudioCharacterEnemy>(); }
protected override void Start() { base.Start(); // Initialize AI behaviour (this will launch the AI) this.behaviour = BossAI.Initialize(this); this.bossBehaviour = this.behaviour as BossAI; }
private void OnEnable() { health = maxHealth; bossAI = GetComponent <BossAI>(); flash = GetComponent <FlashEff>(); healthBar = GetComponent <BossHealthBar>(); healthBar.SetHealth(health, maxHealth); }
private void SpawnBoss(Bytes.Data data) { EventManager.Dispatch("playSound", new PlaySoundData("boss_spawn")); EventManager.Dispatch("musicBossAppear", null); KillAllCreatures(); print("Spawn boss!"); currentBoss = CreateBoss(bossSpawn); }
public void BossStartGo() { if (bossAgain == true) { BossStart = Instantiate(BossPraf, Boss_inComingPos.position, BossPraf.transform.rotation).GetComponent <BossAI>();//实例化BOSS StopAllCoroutines(); bossAgain = false; } }
public void OnUpdate(BossAI boss) { boss.MoveToward(); if (boss.transform.position.y <= 3.11) { //把状态交出去 boss.AI.SetState(new AttackState()); } }
private void Start() { _bossAI = Boss.GetComponent <BossAI>(); _bossAI.enabled = false; _bossHealth = Boss.GetComponent <Health>(); _bossHealth.disable = true; _myCollider = GetComponent <BoxCollider>(); }
void Start() { isDead = false; currentHealth = MaxHealth; bossAI = GetComponent <BossAI>(); healthBar.maxValue = MaxHealth; healthBar.value = currentHealth; sound = FindObjectOfType <Sounds>(); takoyaki = Instantiate(TakoyakiPrefab); // Spawn a takoyaki. animator = GetComponent <Animator>(); }
// Use this for initialization void Start() { if (Proj == ProjectileType.SinProjectile) { Pos = transform.position; Axis = transform.up; } Boss = FindObjectOfType <BossAI>(); // finds instance of the BossAI Enemy = FindObjectOfType <EnemyAI>(); // finds instance of the EnemyAI Player = FindObjectOfType <Player>(); // finds instances of the player }
// Use this for initialization void Start() { sound = GetComponent <Sounds> (); sound.PlayBossTheme(); initiateDialog = GetComponent <InitiateDialog>(); initiateDialog.StartDialog(); //sound.PlayBossDialog(); StartCoroutine(BossDialogDelay(sound)); bossAI = FindObjectOfType <BossAI>(); bossAI.enabled = false; }
public void OnUpdate(BossAI boss) { boss.MoveSide(); if (boss.transform.position.x <= -3 || boss.transform.position.x >= 3) { boss.ChangeDirection(); boss.AI.SetState(new AttackState()); } if (boss.IsDangerous()) { boss.AI.SetState(new CrazyState()); } }
void Start() { hitCd = 1.5f; hitTimer = hitCd; bossAI = transform.parent.GetComponent <BossAI>(); stats.Init(); if (statusIndicator != null) { statusIndicator.SetHealth(stats.currentHealth, stats.maxHealth); } }
/** * Collider for laser prefab. * Upon contact with enemy, destroys itself with an explosion. */ private void OnTriggerEnter2D(Collider2D other) { if (other.tag == "Enemy") { EnemyAI enemy1 = other.GetComponent <EnemyAI>(); EnemyAI2 enemy2 = other.GetComponent <EnemyAI2>(); BossAI boss1 = other.GetComponent <BossAI>(); if (enemy1 != null || enemy2 != null || boss1 != null) { StartCoroutine(ExplosionRoutine()); } } }
void OnTriggerStay2D(Collider2D collider) { if (collider.gameObject.tag == "Enemy") { BossAI boss = collider.gameObject.GetComponent <BossAI>(); if (boss) { boss.takeDamage(1 + (playerStats.strengthPotion ? 1 : 0)); } else { Destroy(collider.gameObject); } } }
public void Explode() { if (!exploded) { Instantiate(explosionParticle, transform.position, transform.rotation); Collider2D collider = Physics2D.OverlapCircle(transform.position, radius); Enemy enemy = collider.GetComponent <Enemy>(); Patrol2 enemyMech = collider.GetComponent <Patrol2>(); MeleeScript enemyMelee = collider.GetComponent <MeleeScript>(); flyEnemy enemyfly = collider.GetComponent <flyEnemy>(); GroundMechScript groundMech = collider.GetComponent <GroundMechScript>(); BossAI boss = collider.GetComponent <BossAI>(); if (enemy != null) { enemy.TakeDamage(damage); } else if (enemyMech != null) { enemyMech.TakeDamage(damage); } else if (enemyMelee != null) { enemyMelee.TakeDamage(damage); } else if (enemyfly != null) { enemyfly.TakeDamage(damage); } else if (groundMech != null) { groundMech.TakeDamage(damage); } else if (boss != null) { boss.TakeDamage(damage); } //Destroy(gameObject); exploded = true; sound.clip = explodeSound; sound.Play(); grenadeCollider.enabled = false; spriteRenderer.enabled = false; player.GetComponent <Weapon>().activeGrenadeCount -= 1; } }
//this actually controls all the close-up player/enemy collisions because haha public void OnTriggerEnter(Collider col) { if (col.gameObject.tag == "Enemy" && drawn && ouchies > 0.1f && !pause) { EnemyAI enemyAI = col.gameObject.GetComponent <EnemyAI>(); BossAI bossAI = col.gameObject.GetComponent <BossAI>(); if (enemyAI != null) { enemyAI.adjustHealthBy(-damage); } else if (bossAI != null) { bossAI.adjustHealthBy(-damage); } ouchies = 0.0f; } }
// Use this for initialization void Start() { player = GameObject.FindGameObjectWithTag("Player"); enemy = gameObject.GetComponentInParent<BossAI>(); }