private void ProcessSpecialTileProps(int x, int y, byte tileId, SCTileDef tileDef) { var poi = new SCPointOfInterest { Coords = new SCCoords(x, y), TileDef = tileDef, TileId = tileId }; if ((tileDef.OWBitFlags & SCBitFlags.Enter) > 0) { var overworldTeleport = (OverworldTeleportIndex)(tileDef.TileProp.Byte2 & 0x3F); var teleDef = enter[(int)overworldTeleport]; var t = new SCTeleport { Coords = poi.Coords, Type = SCPointOfInterestType.OwEntrance, TargetMap = teleDef.Map, TargetCoords = new SCCoords { X = teleDef.X, Y = teleDef.Y }, OverworldTeleport = overworldTeleport }; Exits.Add(t); poi.Type = SCPointOfInterestType.Tele; poi.Teleport = t; PointsOfInterest.Add(poi); } else if ((tileDef.OWBitFlags & SCBitFlags.Caravan) > 0) { poi.Type = SCPointOfInterestType.Shop; poi.ShopId = 69; PointsOfInterest.Add(poi); } }
public SCTileSet(FF1Rom _rom, int i) { rom = _rom; Index = i; TileSet = new TileSet(rom, (byte)i); TileSet.LoadData(); for (int j = 0; j < 128; j++) Tiles[j] = new SCTileDef(TileSet.TileProperties[j]); }
private void ProcessSpecialTileProps(int x, int y, byte tileId, SCTileDef tileDef) { var poi = new SCPointOfInterest { Coords = new SCCoords(x, y), TileDef = tileDef, TileId = tileId }; if (tileDef.TileProp.TilePropFunc == (TilePropFunc.TP_NOMOVE | TilePropFunc.TP_SPEC_DOOR) && tileDef.TileProp.ShopId > 0) { poi.Type = SCPointOfInterestType.Shop; poi.ShopId = tileDef.TileProp.ShopId; PointsOfInterest.Add(poi); } else if (tileDef.SpBitFlags == SCBitFlags.Warp) { if ((CFlags & SCMapCheckFlags.NoWarp) > 0) { return; } var t = new SCTeleport { Coords = poi.Coords, Type = SCPointOfInterestType.Warp }; Exits.Add(t); poi.Type = SCPointOfInterestType.Warp; poi.Teleport = t; PointsOfInterest.Add(poi); } else if (tileDef.SpBitFlags == SCBitFlags.Teleport) { var teleDef = tele[tileDef.TileProp.Byte2]; var t = new SCTeleport { Coords = poi.Coords, Type = SCPointOfInterestType.Tele, TargetMap = teleDef.Map, TargetCoords = new SCCoords { X = teleDef.X, Y = teleDef.Y }.SmClamp }; Exits.Add(t); poi.Type = SCPointOfInterestType.Tele; poi.Teleport = t; PointsOfInterest.Add(poi); } else if ((tileDef.SpBitFlags & SCBitFlags.Exit) == SCBitFlags.Exit) { var teleDef = exit[tileDef.TileProp.Byte2]; var t = new SCTeleport { Coords = poi.Coords, Type = SCPointOfInterestType.Exit, TargetMap = teleDef.Map, TargetCoords = new SCCoords { X = teleDef.X, Y = teleDef.Y } }; Exits.Add(t); poi.Type = SCPointOfInterestType.Exit; poi.Teleport = t; PointsOfInterest.Add(poi); } else if (tileDef.SpBitFlags == SCBitFlags.Treasure) { poi.Type = SCPointOfInterestType.Treasure; poi.TreasureId = tileDef.TileProp.Byte2; PointsOfInterest.Add(poi); Tiles[x, y].Tile |= SCBitFlags.Blocked; } else if (tileDef.SpBitFlags == SCBitFlags.EarthOrb) { poi.Type = SCPointOfInterestType.Orb; poi.ItemId = Item.EarthOrb; PointsOfInterest.Add(poi); } else if (tileDef.SpBitFlags == SCBitFlags.FireOrb) { poi.Type = SCPointOfInterestType.Orb; poi.ItemId = Item.FireOrb; PointsOfInterest.Add(poi); } else if (tileDef.SpBitFlags == SCBitFlags.WaterOrb) { poi.Type = SCPointOfInterestType.Orb; poi.ItemId = Item.WaterOrb; PointsOfInterest.Add(poi); } else if (tileDef.SpBitFlags == SCBitFlags.AirOrb) { poi.Type = SCPointOfInterestType.Orb; poi.ItemId = Item.AirOrb; PointsOfInterest.Add(poi); } }