Exemple #1
0
        public void Attack(ServerSideObject target, int amount)
        {
            if (target.IsDead())
            {
                return;
            }

            if (this.GetFaction() != target.GetFaction())
            {
                target.Damaged(this, amount);

                if (target.IsDead())
                {
                    int exp  = target.CalcExp(this.Level());
                    int gold = target.CalcGold(this.Level());

                    GetExp(exp);
                    GetGold(gold);
                }

                //RefreshVision
                if ((this.GetFaction() == (byte)Faction.Blue && target.GetFaction() == (byte)Faction.Red) ||
                    (this.GetFaction() == (byte)Faction.Red && target.GetFaction() == (byte)Faction.Blue))
                {
                    this.RefreshAttackVision();
                    target.RefreshAttackedVision();
                }
            }
        }
Exemple #2
0
 public virtual void Damaged(ServerSideObject attacker, int amount)
 {
 }