Ejemplo n.º 1
0
        private void CalculateFOV()
        {
            if (CurrentMap == null || MapHelper.FogMap == null)
            {
                return;                                                 // failsafe, should not occur
            }
            foreach (var cell in CurrentMap.FOV.CurrentFOV)
            {
                MapHelper.FogMap.SetCell(cell.X, cell.Y, 1);
            }

            CurrentMap.CalculateFOV(MapPosition.ToCoord(), 30);
            MapHelper.PlayerFOV = CurrentMap.FOV.CurrentFOV.ToList();

            foreach (var cell in CurrentMap.FOV.CurrentFOV)
            {
                MapHelper.FogMap.SetCell(cell.X, cell.Y, -1);
            }
        }
Ejemplo n.º 2
0
 private void OnPlayerMove(object sender, ItemMovedEventArgs <IGameObject> e)
 {
     // Engine.E.Map.CalculateFOV(Position, Awareness);
     CurrentMap.CalculateFOV(Position, Stats[StatTypes.AWARENESS]);
 }