public override AttackInfo Defend(CreepUnit Target) { double AtkAmp = 1; double CritAmp = 1; double Attack; bool isCritical = false; int AtkPower = Strength + Intellect + (Level * 1); if (Target.Weakness == DmgType) { AtkAmp += 0.25; } if (Target.Resist == DmgType) { AtkAmp -= 0.25; } Random Rand = new Random(); int Crit = Rand.Next(30 + (Level * 2) + Luck); if (Crit < Luck) { isCritical = true; CritAmp += Rand.NextDouble(); if (CritAmp > 1.4) { CritAmp = 1.4; } else if (CritAmp < 1.25) { CritAmp = 1.25; } } AtkPower += (AtkPower / 2) + Rand.Next(AtkPower / 2); Attack = (double)AtkPower * AtkAmp * CritAmp; Target.Health -= (int)Attack; AttackInfo info = new AttackInfo((int)Attack, DmgType, isCritical, Class); info.X = Target.Position.X; info.Y = Target.Position.Y; return info; }
public void ChangeUnit(CreepUnit Unit) { this.Unit = Unit; }
public CreepInfoBox() : base("CreepInfoBox") { Width = 185; Height = 50; Unit = new CreepUnit("None", 0, 0); Background = new BackgroundItem(Color.LemonChiffon); Background.Width = Width; Background.Height = Height; }
public AttackInfo StealGold(CreepUnit Target) { double Miss = 1; double StealAmp = 1; double CritAmp = 1; bool isCritical = false; int StealPower = Luck / 3; if (Target.Weakness == DmgType) { StealAmp += 0.35; } if (Target.Resist == DmgType) { StealAmp -= 0.35; } Random Rand = new Random(); int Crit = Rand.Next(30 + (Level * 2) + Luck); if (Crit < Luck) { isCritical = true; CritAmp += Rand.NextDouble(); if (CritAmp > 1.3) { CritAmp = 1.3; } else if (CritAmp < 1.15) { CritAmp = 1.15; } } int MissRand = Rand.Next(Luck); if (MissRand > Luck / 2) { Miss = 0; } double StealAmount = (double)StealPower * StealAmp * CritAmp * Miss; AttackInfo info = new AttackInfo(0, DmgType, isCritical, (int)StealAmount); info.X = Target.Position.X; info.Y = Target.Position.Y; return info; }
public override Projectile ThrowProjectile(CreepUnit Target) { double AtkAmp = 1; double CritAmp = 1; double Attack; bool isCritical = false; int AtkPower = Strength + Intellect + (Level * 1); if (Target.Weakness == DmgType) { AtkAmp += 0.25; } if (Target.Resist == DmgType) { AtkAmp -= 0.25; } Random Rand = new Random(); int Crit = Rand.Next(30 + (Level * 2) + Luck); if (Crit < Luck) { isCritical = true; CritAmp += Rand.NextDouble(); if (CritAmp > 1.4) { CritAmp = 1.4; } else if (CritAmp < 1.25) { CritAmp = 1.25; } } AtkPower += (AtkPower / 2) + Rand.Next(AtkPower / 2); Attack = (double)AtkPower * AtkAmp * CritAmp; Projectile pro = new Projectile(Position, Target, 3, (int)Attack, this, isCritical); return pro; }
public void RemoveCreep(CreepUnit Unit) { Sprites.Remove(Unit); }
public virtual Projectile ThrowProjectile(CreepUnit Target) { return new Projectile(); }
public virtual AttackInfo Defend(CreepUnit Target) { return new AttackInfo(); }