Example #1
0
    /// <summary>
    /// Show infor about the tower when hovering the button
    /// </summary>
    /// <param name="type"></param>
    public void ShowInfo(string type)
    {
        string tooltip = string.Empty;

        switch (type) //Uses the towerprefab, to get the stats for the tooltip on each tower
        {
        case "Fire":
            FireTower fire = towerPrefab.GetComponentInChildren <FireTower>();
            tooltip = string.Format("<color=#ffa500ff><size=20><b>Fire</b></size></color>\nDamage: {0} \nProc: {1}%\nDebuff duration: {2}sec \nTick time: {3} sec \nTick damage: {4}\nCan apply a DOT to the target", fire.Damage, fire.Proc, fire.DebuffDuration, fire.TickTime, fire.TickDamage);
            break;

        case "Frost":
            FrostTower frost = towerPrefab.GetComponentInChildren <FrostTower>();
            tooltip = string.Format("<color=#00ffffff><size=20><b>Frost</b></size></color>\nDamage: {0} \nProc: {1}%\nDebuff duration: {2}sec\nSlowing factor: {3}%\nHas a chance to slow down the target", frost.Damage, frost.Proc, frost.DebuffDuration, frost.SlowingFactor);
            break;

        case "Poison":
            PoisonTower poison = towerPrefab.GetComponentInChildren <PoisonTower>();
            tooltip = string.Format("<color=#00ff00ff><size=20><b>Poison</b></size></color>\nDamage: {0} \nProc: {1}%\nDebuff duration: {2}sec \nTick time: {3} sec \nSplash damage: {4}\nCan apply dripping poison", poison.Damage, poison.Proc, poison.DebuffDuration, poison.TickTime, poison.SplashDamage);
            break;

        case "Storm":
            StormTower storm = towerPrefab.GetComponentInChildren <StormTower>();
            tooltip = string.Format("<color=#add8e6ff><size=20><b>Storm</b></size></color>\nDamage: {0} \nProc: {1}%\nDebuff duration: {2}sec\n Has a chance to stunn the target", storm.Damage, storm.Proc, storm.DebuffDuration);
            break;
        }

        //Shows the tooltip and shows the stats
        GameManager.Instance.SetTooltipText(tooltip);
        GameManager.Instance.ShowStats();
    }
Example #2
0
 /// <summary>
 /// Makes the argument objectToMakeUnused marked as unused.  This method is generated to be used
 /// by generated code.  Use Destroy instead when writing custom code so that your code will behave
 /// the same whether your Entity is pooled or not.
 /// </summary>
 public static void MakeUnused(FrostTower objectToMakeUnused, bool callDestroy)
 {
     if (callDestroy)
     {
         objectToMakeUnused.Destroy();
     }
 }
Example #3
0
        public static FrostTower CreateNew(Layer layer, float x = 0, float y = 0)
        {
            FrostTower instance = null;

            instance = new FrostTower(mContentManagerName ?? FlatRedBall.Screens.ScreenManager.CurrentScreen.ContentManagerName, false);
            instance.AddToManagers(layer);
            instance.X = x;
            instance.Y = y;
            foreach (var list in ListsToAddTo)
            {
                if (SortAxis == FlatRedBall.Math.Axis.X && list is PositionedObjectList <FrostTower> )
                {
                    var index = (list as PositionedObjectList <FrostTower>).GetFirstAfter(x, Axis.X, 0, list.Count);
                    list.Insert(index, instance);
                }
                else if (SortAxis == FlatRedBall.Math.Axis.Y && list is PositionedObjectList <FrostTower> )
                {
                    var index = (list as PositionedObjectList <FrostTower>).GetFirstAfter(y, Axis.Y, 0, list.Count);
                    list.Insert(index, instance);
                }
                else
                {
                    // Sort Z not supported
                    list.Add(instance);
                }
            }
            if (EntitySpawned != null)
            {
                EntitySpawned(instance);
            }
            return(instance);
        }
Example #4
0
        private static void FactoryInitialize()
        {
            const int numberToPreAllocate = 20;

            for (int i = 0; i < numberToPreAllocate; i++)
            {
                FrostTower instance = new FrostTower(mContentManagerName, false);
                mPool.AddToPool(instance);
            }
        }
Example #5
0
 /// <summary>
 /// Makes the argument objectToMakeUnused marked as unused.  This method is generated to be used
 /// by generated code.  Use Destroy instead when writing custom code so that your code will behave
 /// the same whether your Entity is pooled or not.
 /// </summary>
 public static void MakeUnused(FrostTower objectToMakeUnused)
 {
     MakeUnused(objectToMakeUnused, true);
 }