Пример #1
0
        public static bool CheckCellView(Map Map, Fight fight, double x, double y, bool boolean, Point p1, Point p2, double zDiff, double d)
        {
            var       CellId = GetCellNumber(Map, x, y);
            FightCell cell   = fight.GetCell(CellId);

            if (cell == null)
            {
                return(true);
            }
            double YZMaxDiff  = Math.Max(Math.Abs(p1.Y - y), Math.Abs(p1.X - x));
            var    Gradient   = YZMaxDiff / d * zDiff + p1.Z;
            var    CellHeight = GetCellHeight(Map, CellId);
            var    IsFull     = cell.HasUnWalkableFighter() || (YZMaxDiff == 0 || (boolean || p2.X == x && p2.Y == y)) ? (false) : (true);
            bool   ok         = cell.LineOfSight() && (CellHeight <= Gradient && !cell.HasUnWalkableFighter());

            if (!ok)
            {
                //fight.SendToFight(new FightShowCell(fight.Fighters[0].ActorId, CellId));
                return(boolean);
            }
            else
            {
                return(true);
            }
        }