public virtual AttackResult attack(AEntity target) { AttackResult AR = null; bool crit = false; if (target != null) { if (!IsDead || !target.IsDead) { Random rnd = new Random(); if (rnd.Next(0, 100) <= Critchance) { crit = true; AR = target.takeDamage(Atack + (int)((Atack / 100d) * Critdmg)); } else { AR = target.takeDamage(Atack); } } } else { } if (AR != null) { AR.crit = crit; AR.tar = target; AR.attaker = this; } return(AR); }
public void addToTeam2(AEntity target) { Team2.Add(target); }
public virtual void settarget(AEntity target) { Target = target; }