//over write the die function public override void Die() { //change the condition in all condtion object AllConditions.ChangeCondition("Bring peace back to grave yard"); //instatiate big gems from item database on the ground //set up the positions next to boss //ingnore the colliders on them GameObject gem = Instantiate(itemDB.items[1].itemPrefab); gem.transform.position = this.transform.position; Physics.IgnoreCollision(gem.GetComponent <Collider>(), GetComponent <Collider>()); GameObject gem2 = Instantiate(itemDB.items[3].itemPrefab); gem2.transform.position = this.transform.position + new Vector3(2, 0, 2); Physics.IgnoreCollision(gem2.GetComponent <Collider>(), GetComponent <Collider>()); base.Die(); }
/* * Function: Use * * Description: get reference to player and playerstats then * call heal function to heal for amount of healthGain */ public override void Use() { // Heal the player //player = PlayerManager.instance.player; if (this.itemID == 40) { Player.instance.playerStats.currentHealth += healthGain; Player.instance.playerStats.currentHealth = Mathf.Clamp(Player.instance.playerStats.currentHealth, Player.instance.playerStats.currentHealth, Player.instance.playerStats.maxHealth); } else if (this.itemID == 52) { AllConditions.ChangeCondition("Drink The Potion"); } //stats = player.GetComponent<PlayerStats>(); //stats.Heal(healthGain); //RemoveFromInventory(); // Remove the item after use }