Example #1
0
        private static FlowTileSet PlayerNectarTiles(FlowMap f)
        {
            // tiles containing player nectar are targets too
            var allTiles    = Refs.m.TileList();
            var nectarTiles = new MapTileSet();

            foreach (MapTile t in allTiles)
            {
                if (t.nectarLevel[0] > 0)                 // 0 for player
                {
                    nectarTiles.Add(t);
                }
            }
            return(ConvertTiles.FlowSquaresFromTileSet(nectarTiles, f));
        }
Example #2
0
        private static FlowTileSet SetUpInitialRing(int distance, FlowMap f)
        {
            // we'll try to flow to a set distance from the player by
            //    making a ring of target squares and working from there
            var allTiles = Refs.m.TileList();
            var ring     = new MapTileSet();

            foreach (MapTile t in allTiles)
            {
                double c = Loc.Distance(Refs.p.loc, t.loc);
                if (c > distance - 1 && c < distance + 1)
                {
                    ring.Add(t);
                }
            }

            return(ConvertTiles.FlowSquaresFromTileSet(ring, f));
        }