// Use this for initialization void Awake() { initialHp = base.hp; //print("Starting boss"); hpCanvas = Instantiate(bossHPPrefab); hpCanvas.SetActive(false); hpCanvas.GetComponent <Canvas>().worldCamera = Camera.main; hpBar = hpCanvas.GetComponentInChildren <BossHP>(); }
/* * Set all the Label.Text variables to its assosiated element. * Param Nothing. * Returns Nothing. */ private void InitializeStats() { Character.Text = dungeon.user.Character; CharacterName.Text = dungeon.user.Username; CharacterHealth.Text = CharacterHP.ToString(); CharacterMana.Text = CharacterMP.ToString(); Boss.Text = dungeon.CurrentBoss; BossName.Text = dungeon.CurrentName; BossHealth.Text = BossHP.ToString(); }
// Use this for initialization void Start() { StartCoroutine(Pattern00()); _Player = GameManager.Instance.LocalPlayer; SpriteSize = GetComponent <SpriteRenderer>().size; Pattern = Pattern01(); PrevTime = Time.time; FX = GameManager.Instance.SoundManager; HPBAR = BossHP.Instance; HPBAR.BOSS = this; HPBAR.transform.GetChild(0).gameObject.SetActive(true); HPBAR.transform.GetChild(1).gameObject.SetActive(true); }
public void OnTriggerEnter(Collider other) { BossHP HP = other.gameObject.GetComponent <BossHP>(); if (other.CompareTag("Boss")) { HP.HealthPoints -= ThisDmg; Instantiate(Boom, transform.position, transform.rotation); GetComponent <AudioSource>().Play(); Trail.SetActive(false); Bomb.SetActive(false); Fire.SetActive(false); Destroy(gameObject, GetComponent <AudioSource>().clip.length); } }
public void OnTriggerEnter(Collider other) { BossHP HP = other.gameObject.GetComponent <BossHP>(); if (other.CompareTag("Boss")) { HP.HealthPoints -= ThisDmg; Instantiate(Explode, transform.position, transform.rotation); Boom.Play(); GetComponent <CapsuleCollider>().enabled = false; thisRocket.SetActive(false); Fire.SetActive(false); Destroy(gameObject, Boom.clip.length); } }
void OnTriggerStay2D(Collider2D other) { if (other.gameObject.layer == LayerMask.NameToLayer("basicEnemy")) { myPC.removeForce(); Instantiate(explosionEffect, transform.position, transform.rotation); Destroy(gameObject); if (other.tag == "Enemy") { enemyHP hurtEnemy = other.gameObject.GetComponent <enemyHP>(); hurtEnemy.takeDamage(fireDamage); } else if (other.tag == "Boss") { BossHP hurtBoss = other.gameObject.GetComponent <BossHP>(); hurtBoss.takeDamageBoss(fireDamage); } } }
public void OnTriggerEnter(Collider Col) { BossHP HP = Col.gameObject.GetComponent <BossHP>(); if (HP == null) { return; } if (DeathParticlesPrefab != null) { Instantiate(DeathParticlesPrefab, ThisTransform.position, ThisTransform.rotation); } Sprite.SetActive(false); GetComponent <AudioSource>().Play(); GetComponent <CapsuleCollider>().enabled = false; HP.HealthPoints -= Damage; Destroy(gameObject, GetComponent <AudioSource>().clip.length); }
private GameObject explosionPrefab; //보스 사망시 이펙트 프리팹(파티클시스템으로 한거) private void Awake() { movement = GetComponent <Movement>(); bossAttack = GetComponent <BossAttack>(); bossHP = GetComponent <BossHP>(); }
void Start() { boss = GameObject.Find("BossHP").GetComponent <BossHP>(); }
public override void Start() { base.Start(); bar = transform.FindChild("Canvas").GetComponentInChildren<BossHP>(); }
// Use this for initialization new void Start () { bar = transform.FindChild("Canvas").GetComponentInChildren<BossHP>(); base.Start(); // DeathRay.sortingLayerName = "Bullets"; // DeathRay.enabled = false; }
// Use this for initialization private void Start() { Instance = this; }
// Use this for initialization void Start() { Instance = this; Pic = GetComponent <Image>(); }
void Fight(object sender, EventArgs e) { int dmgHero = 0, dmgBoss = 0; int missChance = 0; dmgBoss = BossDmg * r.Next(40, 45) / 100; int buttonClicked = 0; for (int i = 0; i <= 2; i++) { if (Attack[i] == sender) { buttonClicked = i; break; } } if (buttonClicked == 0) { dmgHero = Form1.damage * r.Next(40, 45) / 100; missChance = 0; } else if (buttonClicked == 1) { dmgHero = Form1.damage * r.Next(60, 65) / 100; missChance = 20; } else if (buttonClicked == 2) { dmgHero = Form1.damage * r.Next(85, 90) / 100; missChance = 50; } if (r.Next(0, 101) <= missChance) { dmgHero = 0; } this.Refresh(); label3.Visible = true; if (dmgHero == 0) { label3.Text = "Miss"; } else { label3.Text = dmgHero.ToString(); } Pictures[buttonClicked].Visible = true; Attack[buttonClicked].Enabled = false; this.Refresh(); System.Threading.Thread.Sleep(1500); this.Refresh(); BossHP -= dmgHero; label2.Text = BossHP.ToString(); label3.Visible = false; Pictures[buttonClicked].Visible = false; if (BossHP <= 0) { int moneyz = r.Next(5, 10) * (choose + 1); Form1.money += moneyz; MessageBox.Show("You win! You loot " + moneyz.ToString() + " money!"); // Form1.MakeVisible(); this.Visible = false; ff.Visible = true; } else { this.Refresh(); System.Threading.Thread.Sleep(1500); /////////// boss attack this.Refresh(); label4.Visible = true; label4.Text = dmgBoss.ToString(); pictureBox4.Visible = true; this.Refresh(); System.Threading.Thread.Sleep(1500); this.Refresh(); HeroHP -= dmgBoss; if (HeroHP <= 0) { MessageBox.Show("You lose!"); // Form1.MakeVisible(); //this.Close(); this.Visible = false; ff.Visible = true; } label4.Visible = false; label1.Text = HeroHP.ToString(); pictureBox4.Visible = false; Attack[buttonClicked].Enabled = true; } }