public InstantKill Clone()
        {
            InstantKill instantKill = new InstantKill();

            instantKill.chance      = chance;
            instantKill.HPThreshold = HPThreshold;
            return(instantKill);
        }
		//public string despGeneral="";
		
		public UnitStat(){
			stun=new Stun();
			crit=new Critical();
			slow=new Slow();
			dot=new Dot();
			instantKill=new InstantKill();
			buff=new Buff();
		}
        //public string despGeneral="";

        public UnitStat()
        {
            stun        = new Stun();
            crit        = new Critical();
            slow        = new Slow();
            dot         = new Dot();
            instantKill = new InstantKill();
            buff        = new Buff();
        }
Exemplo n.º 4
0
        public static InstantKill GetTowerInstantKillMultiplier(int prefabID)
        {
            if (instance == null)
            {
                return(new InstantKill(0, 0));
            }
            InstantKill killG = instance.globalTowerModifier.stats.instantKill;
            InstantKill killT = GetTowerModifier(prefabID).stats.instantKill;

            return(new InstantKill(killG.chance + killT.chance, killG.HPThreshold + killT.HPThreshold));
        }
Exemplo n.º 5
0
        public static InstantKill ModifyInstantKillWithPerkBonus(InstantKill instKill, int prefabID, int type = 0)
        {
            InstantKill ikMod = new InstantKill();

            if (type == 0)
            {
                ikMod = GetTowerInstantKillMultiplier(prefabID);
            }
            else if (type == 1)
            {
                ikMod = GetFPSWeaponInstantKillMultiplier(prefabID);
            }
            instKill.chance      *= (1 + ikMod.chance);
            instKill.HPThreshold *= (1 + ikMod.HPThreshold);
            return(instKill);
        }
Exemplo n.º 6
0
		public static InstantKill ModifyInstantKillWithPerkBonus(InstantKill instKill, int prefabID, int type=0){
			InstantKill ikMod=new InstantKill();
			if(type==0) ikMod=GetTowerInstantKillMultiplier(prefabID);
			else if(type==1) ikMod=GetFPSWeaponInstantKillMultiplier(prefabID);
			instKill.chance*=(1+ikMod.chance);
			instKill.HPThreshold*=(1+ikMod.HPThreshold);
			return instKill;
		}
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
 private InstantKill ModifyInstantKillWithPerkBonus(InstantKill instKill)
 {
     return IsTower() ? PerkManager.ModifyInstantKillWithPerkBonus(instKill.Clone(), unitT.prefabID) : instKill;
 }
Exemplo n.º 9
0
 private InstantKill ModifyInstantKillWithPerkBonus(InstantKill instKill)
 {
     return(IsTower() ? PerkManager.ModifyInstantKillWithPerkBonus(instKill.Clone(), prefabID) : instKill);
 }
		public InstantKill Clone(){
			InstantKill instantKill=new InstantKill();
			instantKill.chance=chance;
			instantKill.HPThreshold=HPThreshold;
			return instantKill;
		}