public static HalfPotion Factory(string hero) { HalfPotion halfPotion = HalfPotion.Factory(); GameManager.instance.findHero(hero).heroInventory.AddItem(halfPotion); return(halfPotion); }
public static HalfPotion Factory() { GameObject halfPotionGO = PhotonNetwork.Instantiate("Prefabs/Tokens/PotionHalf", Vector3.zero, Quaternion.identity, 0); HalfPotion halfPotion = halfPotionGO.GetComponent <HalfPotion>(); halfPotion.Cell = null; return(halfPotion); }
private void UsePotion() { if (lastRoll != -1) { potion.interactable = false; helm.interactable = false; lastRoll = lastRoll * 2; fight.getHeroesScore(); if (potionToken is HalfPotion) { hero.heroInventory.RemoveSmallToken(potionToken); } else { HalfPotion hp = HalfPotion.Factory(); hero.heroInventory.ReplaceSmallToken(potionToken, hp, true); } } }