Battle_Script_Pro.Form1.TryGetSuperCommand C# (CSharp) Method

TryGetSuperCommand() private method

private TryGetSuperCommand ( int offset, byte rom, string &name, int &newOffset ) : bool
offset int
rom byte
name string
newOffset int
return bool
        private bool TryGetSuperCommand(int offset, byte[] rom, out string name, out int newOffset)
        {
            byte theValue = rom[offset];
            if (theValue == 4 && rom[offset + 1] == 5 && rom[offset + 2] == 6 && rom[offset + 3] == 7)
            {
                name = "calculatedamage";
                newOffset = offset + 4;
                return true;
            }
            else if (theValue == 0x2E && rom[offset + 6] == 0x13 && rom[offset + 11] == 0x12 && rom[offset + 1] == 0x87 && rom[offset + 2] == 0x3E && rom[offset + 3] == 2 && rom[offset + 4] == 2)
            {
                name = "printmessage 0x" + DecompileWordParameter((DecompileWordParameter(((offset + 7) + (rom[offset + 5] * 4)), rom) - 0x08000000), rom).ToString("X") + " 0x" + DecompileHalfWordParameter(offset + 12, rom).ToString("X");
                newOffset = offset + 14;
                return true;
            }
            else if (theValue == 0x2E && rom[offset + 1] == 0xD2 && rom[offset + 2] == 0x3F && rom[offset + 3] == 0x2 && rom[offset + 4] == 0x2 && rom[offset + 5] == 0x2 && rom[offset + 6] == 0x2E && rom[offset + 7] == 0xFB && rom[offset + 8] == 0x3F && rom[offset + 9] == 0x2 && rom[offset + 10] == 0x2)
            {
                name = "forcetype 0x" + (DecompileByteParameter(offset + 11, rom) - 0x80);
                newOffset = offset + 12;
                return true;
            }
            else
            {
                name = null;
                newOffset = offset;
                return false;
            }
        }
Form1