Example #1
0
        public override void Execute(MonsterFighter fighter)
        {
            Fighter lower = fighter.GetOposedTeam().LowerFighter();

            if (lower == null)
            {
                return;
            }
            var spells = fighter.Template.Spells.ConvertAll <SpellRecord>(x => SpellRecord.GetSpell(x));


            foreach (var spell in spells.FindAll(x => x.Category == SpellCategoryEnum.Damages))
            {
                TryCast(fighter, spell.Id, lower);
            }
            foreach (var spell in spells.FindAll(x => x.Category == SpellCategoryEnum.Agress))
            {
                TryCast(fighter, spell.Id, lower);
            }
            foreach (var spell in spells.FindAll(x => x.Category == SpellCategoryEnum.Undefined))
            {
                TryCast(fighter, spell.Id, lower);
            }
        }
        public override void Execute(MonsterFighter fighter)
        {
            if (fighter.FighterStats.Stats.MovementPoints <= 0)
            {
                return;
            }

            Fighter lower = fighter.GetOposedTeam().LowerFighter();
            var     path  = new Pathfinder(fighter.Fight.Map, fighter.CellId);

            path.PutEntities(fighter.Fight.GetAllFighters());
            var cells = path.FindPath(lower.CellId);

            if (cells == null || cells.Count() <= 1)
            {
                return;
            }
            cells.Remove(cells.Last());
            cells.Insert(0, fighter.CellId);
            cells = cells.Take(fighter.FighterStats.Stats.MovementPoints + 1).ToList();
            sbyte direction = PathParser.GetDirection(cells.Last());

            fighter.Move(cells, cells.Last(), direction);
        }