//restore mana, increase by a factor, and increase the mana by a certain factor public void buyMana() { /*if (WeaponWand.Mana < 30) * { * bar.setMaxMana(amountOfManaThatIsIncreased); * bar.setCurrentMana(amountOfManaThatIsIncreased); * localScale = HeathManaBar.manaBar.transform.localScale; * localScale.x += .1f; * HeathManaBar.manaBar.transform.localScale = localScale; * localScale = HeathManaBar.manaBarBackRoundImage.transform.localScale; * //localScale.x += .01f; * //HeathManaBar.manaBarBackRoundImage.transform.localScale = localScale; * * }*/ WeaponWand.Mana = HeathManaBar.getMana(); bar.addManaRechargeRate(manaIncreaseRate); skillPoint = 0; /* if (WeaponWand.Mana >= 30) { * localScale = HeathManaBar.manaBar.transform.localScale; * localScale.x += .1f; * HeathManaBar.manaBar.transform.localScale = localScale; * * * }*/ hasBoughItem = true; //manaToolTipText.enabled = false; //healthToolTipText.enabled = false; }
// Start is called before the first frame update void Start() { player = GameObject.Find("MonkE").GetComponent <PlayerController>(); bar = GameObject.Find("Canvas").GetComponent <HeathManaBar>(); healthToolTipText.enabled = false; manaToolTipText.enabled = false; }
//restore health and increase it a factor public void buyHealth() { bar.setMaxHealth(amountOfHealthThatIsIncreased); player.health = bar.getMaxHealth(); HeathManaBar.restoreLife(bar.getMaxHealth()); //Debug.Log("player hp is " + player.health + "current life is " + HeathManaBar.currentLife + "max health is " + HeathManaBar.maxHeath); skillPoint = 0; hasBoughItem = true; // healthToolTipText.enabled = false; //manaToolTipText.enabled = false; //hasAlreadyBoughtItem = true; }
public void TakeDamage(float amount) { if (canTakeDamage) { health -= amount; HeathManaBar.Damage(amount);//update the heath bar canTakeDamage = false; } //healthText.text = "Current HP is at :"+ health.ToString(); if (health <= 0) { Debug.Log("You are dead"); } }
public void shootSpells() { if (timeBTWShots <= 0) { if (Input.GetMouseButtonDown(0) && HeathManaBar.currentMana > 1 && !SpawnLogic.inBetweenRounds) { Instantiate(projectile, shotPoint.position, transform.rotation); //Mana -= 2; HeathManaBar.reduceMana(1); timeBTWShots = startTimeBTWShots; isShoot = true; StartCoroutine(WaitForAttackAnimation()); spellShoot.Play(); } } else { timeBTWShots -= Time.deltaTime; } //Mana = HeathManaBar.currentMana; }
public void WindSpell() { if (timeBTWShots <= 0) { if (Input.GetMouseButtonDown(0) && HeathManaBar.currentMana > 3 && !SpawnLogic.inBetweenRounds) { currentWind = Instantiate(Wind, shotPoint.position, transform.rotation); //currentWind.AddForce(Vector2.up * 5000, ForceMode2D.Impulse); currentWind.velocity = dif * speed; // speed variable // Mana -= 3; HeathManaBar.reduceMana(3); timeBTWShots = startTimeBTWShots; isShoot = true; StartCoroutine(WaitForAttackAnimation()); spellShoot.Play(); } } else { timeBTWShots -= Time.deltaTime; } //Mana = HeathManaBar.currentMana; }