Beispiel #1
0
        private static void CMD_28(ref Level lvl, ref string desc, byte[] cmd, byte seg, uint off, byte?areaID)
        {
            ROM         rom  = ROM.Instance;
            WarpInstant warp = new WarpInstant();

            if (rom.isSegmentMIO0(seg, areaID))
            {
                warp.MakeReadOnly();
                warp.Address = "N/A";
            }
            else
            {
                warp.Address = "0x" + rom.decodeSegmentAddress(seg, off, areaID).ToString("X");
            }
            warp.TriggerID = cmd[2];
            warp.AreaID    = cmd[3];
            warp.TeleX     = (short)bytesToInt(cmd, 4, 2);
            warp.TeleY     = (short)bytesToInt(cmd, 6, 2);
            warp.TeleZ     = (short)bytesToInt(cmd, 8, 2);
            lvl.getCurrentArea().InstantWarps.Add(warp);
            desc = "Define Instant warp (";
            if (lvl.getCurrentArea().AreaID != warp.AreaID)
            {
                desc += "To area " + warp.AreaID + ",";
            }

            desc += "Teleport (" + warp.TeleX + "," + warp.TeleY + "," + warp.TeleZ +
                    "), Trigger = collision id 0x" + (warp.TriggerID + 0x1B).ToString("X2") + ")";
        }
Beispiel #2
0
        private static void CMD_28(ref Level lvl, byte[] cmd, ROM rom, byte seg, uint off)
        {
            WarpInstant warp = new WarpInstant();

            if (rom.isSegmentMIO0(seg))
            {
                warp.MakeReadOnly();
                warp.Address = "N/A";
            }
            else
            {
                warp.Address = "0x" + rom.decodeSegmentAddress(seg, off).ToString("X");
            }
            warp.TriggerID = cmd[2];
            warp.AreaID    = cmd[3];
            warp.TeleX     = (short)bytesToInt(cmd, 4, 2);
            warp.TeleY     = (short)bytesToInt(cmd, 6, 2);
            warp.TeleZ     = (short)bytesToInt(cmd, 8, 2);
            lvl.getCurrentArea().InstantWarps.Add(warp);
        }