示例#1
0
文件: ASM.cs 项目: fa8ntomas/blck
 private void ExportExit4(StreamWriter file, MapSet mapset)
 {
     ExportMapsBytes(file, mapset.Maps.Count, "MapExit4X", (int i) => mapset.Maps[i].Exit4X);
     ExportMapsBytes(file, mapset.Maps.Count, "MapExit4Y", (int i) => mapset.Maps[i].Exit4Y);
     ExportMapsBytes(file, mapset.Maps.Count, "MapExits4", (int i) => mapset.GetMapIndex(mapset.Maps[i].Exit4MapID));
 }
示例#2
0
文件: ASM.cs 项目: fa8ntomas/blck
        private void ExportRoutines(StreamWriter file, MapSet mapset)
        {
            ExportMapsHighLowComponents(file, mapset.Maps.Count, false, "MapInitsLo", (int i) => $"(Map{i}Init-1)");
            ExportMapsHighLowComponents(file, mapset.Maps.Count, true, "MapInitsHi", (int i) => $"(Map{i}Init-1)");

            ExportMapsHighLowComponents(file, mapset.Maps.Count, false, "MapExecsLo", (int i) => $"(Map{i}Exec-1)");
            ExportMapsHighLowComponents(file, mapset.Maps.Count, true, "MapExecsHi", (int i) => $"(Map{i}Exec-1)");

            ExportMapsHighLowComponents(file, mapset.Maps.Count, false, "MapTileCollisionLo", (int i) => $"(Map{i}TileCollision-1)");
            ExportMapsHighLowComponents(file, mapset.Maps.Count, true, "MapTileCollisionHi", (int i) => $"(Map{i}TileCollision-1)");

            for (int i = 0; i < mapset.Maps.Count; i++)
            {
                AddLabel(file, $"Map{i}Init");

                file.WriteLine($"{BOL}.local LocalMap{i}Init");


                if (String.IsNullOrWhiteSpace(mapset.Maps[i].InitRoutinePath))
                {
                    file.WriteLine("\trts");
                }
                else
                {
                    file.WriteLine($"{BOL}.use LocalMap{i}TileCollision");
                    file.WriteLine($"{BOL}.use LocalMap{i}Exec");

                    ExportLabels(file, mapset, i);

                    AddIcl(file, mapset.Maps[i].InitRoutinePath);
                }

                file.WriteLine("\t.endl");

                AddLabel(file, $"Map{i}Exec");

                file.WriteLine($"{BOL}.local LocalMap{i}Exec");

                if (String.IsNullOrWhiteSpace(mapset.Maps[i].ExecRoutinePath))
                {
                    file.WriteLine("\trts");
                }
                else
                {
                    file.WriteLine($"{BOL}.use LocalMap{i}TileCollision");
                    file.WriteLine($"{BOL}.use LocalMap{i}Init");

                    ExportLabels(file, mapset, i);

                    AddIcl(file, mapset.Maps[i].ExecRoutinePath);
                }

                file.WriteLine("\t.endl");

                AddLabel(file, $"Map{i}TileCollision");

                file.WriteLine($"{BOL}.local LocalMap{i}TileCollision");

                if (String.IsNullOrWhiteSpace(mapset.Maps[i].TileCollisionRoutinePath))
                {
                    file.WriteLine("\trts");
                }
                else
                {
                    file.WriteLine($"{BOL}.use LocalMap{i}Exec");
                    file.WriteLine($"{BOL}.use LocalMap{i}Init");

                    ExportLabels(file, mapset, i);

                    AddIcl(file, mapset.Maps[i].TileCollisionRoutinePath);
                }

                file.WriteLine("\t.endl");
            }
        }
示例#3
0
文件: ASM.cs 项目: fa8ntomas/blck
 private void ExportFOE(StreamWriter file, MapSet mapset)
 {
     ExportMapsBytes(file, mapset.Maps.Count, "MapFoeFlags", (int i) => (byte)(mapset.Maps[i].Foe ? 0x00 : 0xFF));
 }
示例#4
0
        public FormGameData(MapSet mapSet)
        {
            InitializeComponent();

            SpritesSetComboBox.SelectedIndex = (int)mapSet.SpriteSet;
        }
示例#5
0
文件: Map.cs 项目: fa8ntomas/blck
 public IncludeTreeNode(MapSet mapSet, String path) : base(PathHelper.RelativizePath(mapSet.Path, path))
 {
     this.Path = path;
     Tag       = pbx1.TypeNode.IncludeFile;
 }
示例#6
0
文件: Map.cs 项目: fa8ntomas/blck
 public FontTreeNode(MapSet mapSet, CharacterSet CharacterSet) : base(PathHelper.RelativizePath(mapSet.Path, CharacterSet.Path))
 {
     this.CharacterSet = CharacterSet;
     Tag = pbx1.TypeNode.FontFile;
 }
示例#7
0
        public static Map Load(MapSet mapSet, XElement mapElemept)
        {
            Map map = CreateNewMap(mapSet, mapSet.GetFont(GuidHelper.parse(mapElemept.Attribute("font")?.Value)), mapElemept.Attribute("uid")?.Value);

            map.Name    = mapElemept.Attribute("name").Value;
            map.Path    = PathHelper.GetExactPath(mapSet.Path, mapElemept.Attribute("path").Value);
            map.MapData = map.UseRleCompression() ? DecodeRLE(File.ReadAllBytes(map.Path)) : DecodeLZ4(map.Path);

            XElement   dlis    = mapElemept.Element("dlis");
            List <DLI> DLIList = new List <DLI>();

            foreach (XElement xdli in dlis.Elements("dli"))
            {
                DLI dli = DLI.Load(map, xdli);
                DLIList.Add(dli);
            }
            map.DLIS = DLIList.ToArray();

            ImportTextFile(mapElemept, "InitRoutinePath", mapSet.Path, (Path, Content) => { map.InitRoutinePath = Path; map.InitRoutine = Content; });
            ImportTextFile(mapElemept, "ExecRoutinePath", mapSet.Path, (Path, Content) => { map.ExecRoutinePath = Path; map.ExecRoutine = Content; });
            ImportTextFile(mapElemept, "TileCollisionRoutinePath", mapSet.Path, (Path, Content) => { map.TileCollisionRoutinePath = Path; map.TileCollisionRoutine = Content; });
            ImportBoolean(mapElemept, "foe", value => map.Foe = value);
            ImportByte(mapElemept, "YamoSpawnPosition", value => map.YamoSpawnPosition   = value);
            ImportByte(mapElemept, "NinjaSpawnPosition", value => map.NinjaSpawnPosition = value);
            ImportByte(mapElemept, "NinjaEnterCount1", value => map.NinjaEnterCount1     = value);
            ImportByte(mapElemept, "NinjaEnterCount2", value => map.NinjaEnterCount2     = value);
            ImportByte(mapElemept, "YamoEnterCount1", value => map.YamoEnterCount1       = value);
            ImportByte(mapElemept, "YamoEnterCount2", value => map.YamoEnterCount2       = value);
            ImportColorDetection(mapElemept, "Colpf0Dectection", ref map.Colpf0Detection, ref map.Colpf0DetectionRects, ref map.Colpf0DetectionFlags);
            ImportColorDetection(mapElemept, "Colpf2Dectection", ref map.Colpf2Detection, ref map.Colpf2DetectionRects, ref map.Colpf2DetectionFlags);
            ImportColorDetection(mapElemept, "Colpf3Dectection", ref map.Colpf3Detection, ref map.Colpf3DetectionRects, ref map.Colpf3DetectionFlags);

            if (mapElemept.Elements("brucestart").Any())
            {
                XElement brucestart = mapElemept.Element("brucestart");
                map.BruceStartX1 = Convert.ToByte(brucestart.Element("x1").Value);
                map.BruceStartY1 = Convert.ToByte(brucestart.Element("y1").Value);
                map.BruceStartX2 = Convert.ToByte(brucestart.Element("x2").Value);
                map.BruceStartY2 = Convert.ToByte(brucestart.Element("y2").Value);
            }

            if (mapElemept.Elements("exit1").Any())
            {
                XElement exit = mapElemept.Element("exit1");
                map.Exit1MapID = GuidHelper.parse(exit.Element("map").Value);
                map.Exit1X     = Convert.ToByte(exit.Element("x").Value);
                map.Exit1Y     = Convert.ToByte(exit.Element("y").Value);
            }

            if (mapElemept.Elements("exit2").Any())
            {
                XElement exit = mapElemept.Element("exit2");
                map.Exit2MapID = GuidHelper.parse(exit.Element("map").Value);
                map.Exit2X     = Convert.ToByte(exit.Element("x").Value);
                map.Exit2Y     = Convert.ToByte(exit.Element("y").Value);
            }

            if (mapElemept.Elements("exit3").Any())
            {
                XElement exit = mapElemept.Element("exit3");
                map.Exit3MapID = GuidHelper.parse(exit.Element("map").Value);
                map.Exit3X     = Convert.ToByte(exit.Element("x").Value);
                map.Exit3Y     = Convert.ToByte(exit.Element("y").Value);
            }

            if (mapElemept.Elements("exit4").Any())
            {
                XElement exit = mapElemept.Element("exit4");
                map.Exit4MapID = GuidHelper.parse(exit.Element("map").Value);
                map.Exit4X     = Convert.ToByte(exit.Element("x").Value);
                map.Exit4Y     = Convert.ToByte(exit.Element("y").Value);
            }

            map.SetLoaded();

            return(map);
        }
示例#8
0
 internal void PreLoad(MapSet mapSet, CharacterSet characterSet, DLI[] dLIS = null)
 {
     preloadCharacterSet = characterSet;
     this.dLIS           = dLIS;
     this.mapSet         = mapSet;
 }