//gets the tower type public void ShowInfo(string type) { string tooltip = string.Empty; switch (type) { case "Fire": FireTower fire = towerPrefab.GetComponentInChildren <FireTower>(); tooltip = string.Format("<color=#ffa500ff><size=20><b>Fire</b></size></color>\n" + "Damage: {0} \n" + "Range: {5} \n" + "Proc: {1}%\n" + "Debuff duration: {2}sec \n" + "Tick time: {3} sec \n" + "Tick damage: {4}\n" + "Can apply a DOT to the target", fire.Damage, fire.Proc, fire.DebuffDuration, fire.TickTime, fire.TickDamage, fire.Range); break; case "Water": WaterTower water = towerPrefab.GetComponentInChildren <WaterTower>(); tooltip = string.Format("<color=#00ffffff><size=20><b>Water</b></size></color>\n" + "Damage: {0}\n" + "Proc: {1}% \n" + "Debuff duration: {2}sec \n" + "Slowing factor: {3} \n" + "Has a chance to slow down the target", water.Damage, water.Proc, water.DebuffDuration, water.SlowingFactor); break; case "Poison": PoisonTower poison = towerPrefab.GetComponentInChildren <PoisonTower>(); tooltip = string.Format("<color=#00ff00ff><size=20><b>Poison</b></size></color>\n" + "Damage: {0} \n" + "Proc: {1}%\n" + "Debuff duration: {2}sec \n" + "Tick time: {3} sec \n" + "Splash damage: {4}\n" + "Can apply dripping poison", poison.Damage, poison.Proc, poison.DebuffDuration, poison.TickTime, poison.SplashDamage); break; case "Earth": EarthTower earth = towerPrefab.GetComponentInChildren <EarthTower>(); tooltip = string.Format("<color=#8b4513ff><size=20><b>Earth</b></size></color>\n" + "Damage: {0} \n" + "Proc: {1}%\n" + "Debuff duration: {2}sec\n" + "Has a chance to stun the target", earth.Damage, earth.Proc, earth.DebuffDuration); break; } GameManager.Instance.SetToolTipText(tooltip); GameManager.Instance.ShowStats(); }
public WaterTower AddWaterTower(int size) { var element = new WaterTower(Guid.NewGuid(), size); this.waterConsumer.Link(element.WaterProducer); element.Start(); this.AddElement(element); return(element); }