コード例 #1
0
        public override bool BushFlag()
        {
            MapData data = MapComponent.Instance.GetMapInstance().GetMapData();

            if (data == null)
            {
                return(false);
            }
            for (int i = 0; i < 3; i++)
            {
                float x = _mapPlayer.GetPlayerPacket().RealX;
                float y = _mapPlayer.GetPlayerPacket().RealY;
                if ((x % 32) / 32f < 0.5)
                {
                    x = (int)Math.Floor(x / 32);
                }
                else
                {
                    x = (int)Math.Ceiling(x / 32);
                }

                if ((y % 32) / 32f < 0.3)
                {
                    y = (int)Math.Floor(y / 32);
                }
                else
                {
                    y = (int)Math.Ceiling(y / 32);
                }

                Tuple <int, int> tileInfo = data.GetTile(i, (int)x, (int)y);
                if (tileInfo == null)
                {
                    continue;
                }
                TilesetData.Tileset tileset = TilesetData.GetTileset(tileInfo.Item2);
                if (tileset != null)
                {
                    if (tileset.GetBushFlag(tileInfo.Item1))
                    {
                        return(true);
                    }
                }
            }

            return(base.BushFlag());
        }
コード例 #2
0
        public override bool BushFlag()
        {
            if (_mapEvent.Priority == RenderPriority.OnTop)
            {
                return(false);
            }
            MapData data = MapComponent.Instance.GetMapInstance().GetMapData();

            for (int i = 0; i < 3; i++)
            {
                float x = _mapEvent.RealX;
                float y = _mapEvent.RealY;
                if ((x % 32) / 32f < 0.5)
                {
                    x = (int)Math.Floor(x / 32);
                }
                else
                {
                    x = (int)Math.Ceiling(x / 32);
                }

                if ((y % 32) / 32f < 0.3)
                {
                    y = (int)Math.Floor(y / 32);
                }
                else
                {
                    y = (int)Math.Ceiling(y / 32);
                }

                Tuple <int, int> tileInfo = data.GetTile(i, (int)x, (int)y);
                if (tileInfo != null)
                {
                    TilesetData.Tileset tileset = TilesetData.GetTileset(tileInfo.Item2);
                    if (tileset != null)
                    {
                        if (tileset.GetBushFlag(tileInfo.Item1))
                        {
                            return(true);
                        }
                    }
                }
            }

            return(base.BushFlag());
        }