Esempio n. 1
0
        public override int Calculate(Sprite obj, Sprite target, MonsterDamageType type)
        {
            if (obj is Monster || obj is Mundane)
            {
                var mod  = 0.0;
                var diff = 0;

                if (target is Aisling aisling)
                {
                    diff = obj.Level + 1 - aisling.ExpLevel;
                }

                if (target is Monster monster)
                {
                    diff = obj.Level + 1 - monster.Template.Level;
                }

                if (diff <= 0)
                {
                    mod = obj.Level * (type == MonsterDamageType.Physical ? 0.1 : 2) * ServerContext.Config.BaseDamageMod;
                }
                else
                {
                    mod = obj.Level * (type == MonsterDamageType.Physical ? 0.1 : 2) * (ServerContext.Config.BaseDamageMod * diff);
                }

                var dmg = Math.Abs((int)(mod + 1));

                if (dmg <= 0)
                {
                    dmg = 1;
                }

                return(dmg);
            }

            return(1);
        }
Esempio n. 2
0
 public Damage(Sprite obj, Sprite target, MonsterDamageType type)
 {
     _obj    = obj;
     _target = target;
 }
 public abstract int Calculate(Sprite obj, Sprite target, MonsterDamageType type);