Exemplo n.º 1
0
        public string GetDespStats()
        {
            //return "";

            if (stats[currentActiveStat].useCustomDesp)
            {
                return(stats[currentActiveStat].desp);
            }

            string text = "";

            if (type == _TowerType.Turret || type == _TowerType.AOE || type == _TowerType.Mine)
            {
                float currentDmgMin = GetDamageMin();
                float currentDmgMax = GetDamageMax();
                if (currentDmgMax > 0)
                {
                    if (currentDmgMin == currentDmgMax)
                    {
                        text += "Damage:		 "+ currentDmgMax.ToString("f0");
                    }
                    else
                    {
                        text += "Damage:		 "+ currentDmgMin.ToString("f0") + "-" + currentDmgMax.ToString("f0");
                    }
                }

                float currentAOE = GetAOERadius();
                if (currentAOE > 0)
                {
                    text += " (AOE)";
                }
                //if(currentAOE>0) text+="\nAOE Radius: "+currentAOE;

                if (type != _TowerType.Mine)
                {
                    float currentCD = GetCooldown();
                    if (currentCD > 0)
                    {
                        text += "\nCooldown:	 "+ currentCD.ToString("f1") + "s";
                    }
                }

                //~ float critChance=GetCritChance();
                //~ if(critChance>0) text+="\nCritical:		 "+(critChance*100).ToString("f0")+"%";



                if (text != "")
                {
                    text += "\n";
                }

                if (GetCritChance() > 0)
                {
                    text += "\n" + (GetCritChance() * 100).ToString("f0") + "% Chance to score critical hit";
                }

                Stun stun = GetStun();
                if (stun.IsValid())
                {
                    text += "\n" + (stun.chance * 100).ToString("f0") + "% Chance to stuns target";
                }

                Slow slow = GetSlow();
                if (slow.IsValid())
                {
                    text += "\nSlows target for " + slow.duration.ToString("f1") + " seconds";
                }

                Dot   dot    = GetDot();
                float dotDmg = dot.GetTotalDamage();
                if (dotDmg > 0)
                {
                    text += "\nDamage target by " + dotDmg.ToString("f0") + " over " + dot.duration.ToString("f0") + "s";
                }

                if (DamageShieldOnly())
                {
                    text += "\nDamage target's shield only";
                }
                if (GetShieldBreak() > 0)
                {
                    text += "\n" + (GetShieldBreak() * 100).ToString("f0") + "% Chance to break shield";
                }
                if (GetShieldPierce() > 0)
                {
                    text += "\n" + (GetShieldPierce() * 100).ToString("f0") + "% Chance to pierce shield";
                }

                InstantKill instKill = GetInstantKill();
                if (instKill.IsValid())
                {
                    text += "\n" + (instKill.chance * 100).ToString("f0") + "% Chance to kill target instantly";
                }
            }
            else if (type == _TowerType.Support)
            {
                Buff buff = GetBuff();

                if (buff.damageBuff > 0)
                {
                    text += "Damage Buff: " + ((buff.damageBuff) * 100).ToString("f0") + "%";
                }
                if (buff.cooldownBuff > 0)
                {
                    text += "\nCooldown Buff: " + ((buff.cooldownBuff) * 100).ToString("f0") + "%";
                }
                if (buff.rangeBuff > 0)
                {
                    text += "\nRange Buff: " + ((buff.rangeBuff) * 100).ToString("f0") + "%";
                }
                if (buff.criticalBuff > 0)
                {
                    text += "\nRange Buff: " + ((buff.criticalBuff) * 100).ToString("f0") + "%";
                }
                if (buff.hitBuff > 0)
                {
                    text += "\nHit Buff: " + ((buff.hitBuff) * 100).ToString("f0") + "%";
                }
                if (buff.dodgeBuff > 0)
                {
                    text += "\nDodge Buff: " + ((buff.dodgeBuff) * 100).ToString("f0") + "%";
                }

                if (text != "")
                {
                    text += "\n";
                }

                if (buff.regenHP > 0)
                {
                    float regenValue    = buff.regenHP;
                    float regenDuration = 1;
                    if (buff.regenHP < 1)
                    {
                        regenValue    = 1;
                        regenDuration = 1 / buff.regenHP;
                    }
                    text += "\nRegen " + regenValue.ToString("f0") + "HP every " + regenDuration.ToString("f0") + "s";
                }
            }
            else if (type == _TowerType.Resource)
            {
                text += "Regenerate resource overtime";
            }

            return(text);
        }