コード例 #1
0
        static InputFormRef Init(Form self, uint assignClass)
        {
            uint classDataCount = ClassForm.DataCount();

            InputFormRef ifr = new InputFormRef(self
                                                , ""
                                                , assignClass
                                                , 1
                                                , (int i, uint addr) =>
            {     //読込最大値検索
                if (i >= classDataCount)
                { //既存のクラスの最大値を超えたらダメ
                    return(false);
                }
                if (i >= 0xFE)
                {
                    if (Program.ROM.u8(addr) == 0xFF)
                    {    //終端コードが出てきたらそこで強制終了
                        return(false);
                    }
                }

                return(true);
            }
                                                , (int i, uint addr) =>
            {
                return(U.ToHexString(i) + " " + ClassForm.GetClassName((uint)i));
            }
                                                );

            return(ifr);
        }
コード例 #2
0
        static InputFormRef Init(Form self)
        {
            return(new InputFormRef(self
                                    , ""
                                    , Program.ROM.RomInfo.summons_demon_king_pointer
                                    , 20
                                    , (int i, uint addr) =>
            {
                uint max = Program.ROM.u8(Program.ROM.RomInfo.summons_demon_king_count_address);
                return i <= max;
            }
                                    , (int i, uint addr) =>
            {
                uint unit_id = Program.ROM.u8(addr);
                if (unit_id == 0)
                {
                    return "-EMPTY-";
                }
                uint class_id = Program.ROM.u8(addr + 1);
                uint unitgrow = Program.ROM.u16(addr + 3);
                if (class_id == 0)
                {    //クラスIDが0だったらユーザIDで補完する
                    class_id = UnitForm.GetClassID(unit_id);
                }

                String unit_name = UnitForm.GetUnitName(unit_id);
                String class_name = ClassForm.GetClassName(class_id);
                uint level = U.ParseUnitGrowLV(unitgrow);

                return unit_name + "(" + class_name + ")" + "  " + "Lv:" + level.ToString();
            }
                                    ));
        }
コード例 #3
0
        static InputFormRef Init(EventUnitFE7Form self)
        {
            return(new InputFormRef(self
                                    , ""
                                    , 0
                                    , Program.ROM.RomInfo.eventunit_data_size
                                    , (int i, uint addr) =>
            {    //読込最大値検索
                //00まで検索
                return Program.ROM.u8(addr) != 0;
            }
                                    , (int i, uint addr) =>
            {
                uint unit_id = Program.ROM.u8(addr);
                if (unit_id == 0)
                {
                    return null;
                }
                uint class_id = Program.ROM.u8(addr + 1);
                uint unitgrow = Program.ROM.u16(addr + 3);
                if (class_id == 0)
                {    //クラスIDが0だったらユーザIDで補完する
                    class_id = UnitForm.GetClassID(unit_id);
                }

                String unit_name = UnitForm.GetUnitName(unit_id);
                String class_name = ClassForm.GetClassName(class_id);
                uint level = U.ParseUnitGrowLV(unitgrow);

                return unit_name + "(" + class_name + ")" + "  " + "Lv:" + level.ToString();
            }
                                    ));
        }
コード例 #4
0
        static InputFormRef Init(Form self)
        {
            uint typeID = 0;

            return(new InputFormRef(self
                                    , ""
                                    , 0
                                    , 1
                                    , (int i, uint addr) =>
            {
                if (i == 0)
                {
                    return true;
                }
                return Program.ROM.u8(addr) != 0x00;
            }
                                    , (int i, uint addr) =>
            {
                uint id = Program.ROM.u8(addr + 0);
                if (i == 0)
                {
                    typeID = id;
                    return TypeIDToString(id);
                }
                if (typeID <= 1)
                {
                    return U.ToHexString(id) + " " + UnitForm.GetUnitName(id);
                }
                else
                {
                    return U.ToHexString(id) + " " + ClassForm.GetClassName(id);
                }
            }
                                    ));
        }
コード例 #5
0
 static InputFormRef N_Init(Form self, int class_data_count)
 {
     return(new InputFormRef(self
                             , "N_"
                             , Program.ROM.RomInfo.class_alphaname_pointer
                             , 20
                             , (int i, uint addr) =>
     {    //読込最大値検索
         return i < class_data_count;
     }
                             , (int i, uint addr) =>
     {
         return U.ToHexString(i) + " " + ClassForm.GetClassName((uint)i) + ":" + Program.ROM.getString(addr);
     }
                             ));
 }
コード例 #6
0
 static InputFormRef Init(Form self, int datcount)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.ccbranch_pointer
                             , 2
                             , (int i, uint addr) =>
     {    //読込最大値検索
         return (i < datcount);
     }
                             , (int i, uint addr) =>
     {
         return U.ToHexString(i) + " " + ClassForm.GetClassName((uint)i);
     }
                             ));
 }
コード例 #7
0
 static InputFormRef N2_Init(Form self)
 {//魔物所持アイテム アイテム確率
     return(new InputFormRef(self
                             , "N2_"
                             , Program.ROM.RomInfo.monster_item_table_pointer()
                             , 32
                             , (int i, uint addr) =>
     {    //読込最大値検索
         return Program.ROM.u8(addr) != 0xFF;
     }
                             , (int i, uint addr) =>
     {
         uint class_id = Program.ROM.u8(addr);
         return U.ToHexString(i) + U.SA(ClassForm.GetClassName(class_id)) + InputFormRef.GetCommentSA(addr);
     }
                             ));
 }
コード例 #8
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , 0
                             , 1
                             , (int i, uint addr) =>
     {
         return Program.ROM.u8(addr) != 0x00;
     }
                             , (int i, uint addr) =>
     {
         uint class_id = Program.ROM.u8(addr);
         return U.ToHexString(class_id) + " " + ClassForm.GetClassName(class_id);
     }
                             ));
 }
コード例 #9
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.arena_class_near_weapon_pointer()
                             , 1
                             , (int i, uint addr) =>
     {
         return Program.ROM.u8(addr) != 0x00;
     }
                             , (int i, uint addr) =>
     {
         uint classid = Program.ROM.u8(addr + 0);
         return U.ToHexString(classid) + " " + ClassForm.GetClassName(classid);
     }
                             ));
 }
コード例 #10
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , 0
                             , 4
                             , (int i, uint addr) =>
     {
         return U.isPointer(Program.ROM.u32(addr));
     }
                             , (int i, uint addr) =>
     {
         uint id = Program.ROM.u8(Program.ROM.RomInfo.sound_foot_steps_switch2_address) + (uint)i;
         return U.ToHexString(id) + ClassForm.GetClassName(id);
     }
                             ));
 }
コード例 #11
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.op_class_demo_pointer
                             , 28
                             , (int i, uint addr) =>
     {
         return Program.ROM.u8(addr + 0xF) <= 4;
     }
                             , (int i, uint addr) =>
     {
         uint id = Program.ROM.u8(addr + 14);
         return U.ToHexString(id) + " " + ClassForm.GetClassName(id);
     }
                             ));
 }
コード例 #12
0
        private void AddressList_SelectedIndexChanged(object sender, EventArgs e)
        {
            List <U.AddrResult> list = this.InputFormRef.MakeList();
            uint class_id            = (uint)this.AddressList.SelectedIndex;

            if (class_id >= this.InputFormRef.DataCount)
            {
                return;
            }

            //選択しているクラス名.
            X_SELECT_CLASS.Text = ClassForm.GetClassName(class_id);

            //このクラスにCCできるクラスを探す.
            CLASS_LISTBOX.BeginUpdate();
            CLASS_LISTBOX.Items.Clear();
            if (class_id >= 1)
            {
                for (int i = 0; i < list.Count; i++)
                {
                    uint cc_class1 = Program.ROM.u8(list[i].addr + 0);
                    uint cc_class2 = Program.ROM.u8(list[i].addr + 1);

                    if (cc_class1 == class_id || cc_class2 == class_id)
                    {
                        string name = U.ToHexString(i) + " " + ClassForm.GetClassName((uint)i);
                        CLASS_LISTBOX.Items.Add(name);
                    }
                }
            }
            CLASS_LISTBOX.EndUpdate();

            if (X_CC3Patch.Visible)
            {//CC3分岐パッチが導入されている場合
                uint classAddr = ClassForm.GetClassAddr(class_id);
                if (classAddr == U.NOT_FOUND)
                {
                    U.ForceUpdate(X_CC3, 0);
                }
                else
                {
                    uint cc_class3 = Program.ROM.u8(classAddr + 5);
                    U.ForceUpdate(X_CC3, (int)cc_class3);
                }
            }
        }
コード例 #13
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , Program.ROM.RomInfo.op_class_demo_pointer()
                             , 20
                             , (int i, uint addr) =>
     {
         return Program.ROM.u32(addr) <= 0xffff;
     }
                             , (int i, uint addr) =>
     {
         uint cid = Program.ROM.u8(addr + 5);
         return U.ToHexString(cid) + " " + ClassForm.GetClassName(cid);
     }
                             ));
 }
コード例 #14
0
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , 0
                             , 2
                             , (int i, uint addr) =>
     {
         return Program.ROM.u16(addr) != 0x00;
     }
                             , (int i, uint addr) =>
     {
         uint id = Program.ROM.u8(addr + 0);
         uint id2 = Program.ROM.u8(addr + 1);
         return U.ToHexString(id) + " " + ClassForm.GetClassName(id) + "-> " + U.ToHexString(id2) + " " + ClassForm.GetClassName(id2);
     }
                             ));
 }
コード例 #15
0
 static InputFormRef N2_Init(Form self)
 {
     return(new InputFormRef(self
                             , "N2_"
                             , 0
                             , 1
                             , (int i, uint addr) =>
     {    //読込最大値検索
         uint a = Program.ROM.u8(addr);
         if (a == 0)
         {
             return false;
         }
         return true;
     }
                             , (int i, uint addr) =>
     {
         uint classid = Program.ROM.u8(addr);
         return U.ToHexString(classid) + " " + ClassForm.GetClassName(classid);
     }
                             ));
 }
コード例 #16
0
        private void B0_ValueChanged(object sender, EventArgs e)
        {
            uint id = (uint)this.B0.Value;

            if (AddressList.SelectedIndex <= 0)
            {
                X_LINK.Text       = TypeIDToString(id);
                X_LINK_ICON.Image = null;
                return;
            }
            uint typeID = GetTypeID();

            if (typeID <= 1)
            {
                X_LINK.Text       = UnitForm.GetUnitName(id);
                X_LINK_ICON.Image = UnitForm.DrawUnitMapFacePicture(id);
            }
            else
            {
                X_LINK.Text       = ClassForm.GetClassName(id);
                X_LINK_ICON.Image = ClassForm.DrawWaitIcon(id, 0);
            }
        }
コード例 #17
0
        static InputFormRef N_Init(Form self)
        {
            return(new InputFormRef(self
                                    , "N_"
                                    , 0
                                    , 1
                                    , (int i, uint addr) =>
            {    //12補正 16特効 がポインタ or nullであれば
                return Program.ROM.u8(addr) != 0;
            }
                                    , (int i, uint addr) =>
            {
                uint class_id = Program.ROM.u8(addr);

                U.AddrResult ar = new U.AddrResult();
                ar.addr = addr;

                ar.name = U.ToHexString(class_id) + " " + ClassForm.GetClassName(class_id);

                return ar;
            }
                                    ));
        }
コード例 #18
0
        public static string GetNames(uint addr)
        {
            addr = U.toOffset(addr);
            if (!U.isSafetyOffset(addr))
            {
                return("");
            }

            StringBuilder sb     = new StringBuilder();
            uint          start  = addr;
            uint          length = (uint)Program.ROM.Data.Length;

            uint typeID = Program.ROM.u8(addr);

            addr++;
            for (; addr < length; addr += 1)
            {
                uint id = Program.ROM.u8(addr);
                if (id == 0x00)
                {
                    break;
                }

                if (typeID <= 1)
                {
                    sb.Append(UnitForm.GetUnitName(id));
                }
                else
                {
                    sb.Append(ClassForm.GetClassName(id));
                }
                sb.Append(' ');
            }

            return(sb.ToString());
        }
コード例 #19
0
        void MakeClassList(uint selectindex)
        {
            if (Program.ROM.RomInfo.version() >= 8)
            {//FE8の場合キャラパレット指定が別途用意されている
                uint unit_palette_color_pointer = Program.ROM.p32(Program.ROM.RomInfo.unit_palette_color_pointer());
                uint unit_palette_class_pointer = Program.ROM.p32(Program.ROM.RomInfo.unit_palette_class_pointer());

                List <U.AddrResult> list = new List <U.AddrResult>();
                for (int i = 0; i < Program.ROM.RomInfo.unit_maxcount(); i++)
                {
                    for (uint n = 0; n < 7; n++)
                    {
                        uint paletteid = Program.ROM.u8(unit_palette_color_pointer + n);
                        if (paletteid <= 0)
                        {
                            continue;
                        }
                        if (paletteid - 1 != selectindex)
                        {
                            continue;
                        }
                        uint   uid  = (uint)i + 1;
                        uint   cid  = Program.ROM.u8(unit_palette_class_pointer + n);
                        string name = U.ToHexString(uid) + " " + UnitForm.GetUnitName(uid) + " -> " + U.ToHexString(cid) + " " + ClassForm.GetClassName(cid);

                        list.Add(new U.AddrResult(cid, name, uid));
                    }

                    unit_palette_color_pointer += 7;
                    unit_palette_class_pointer += 7;
                }
                U.ConvertListBox(list, ref UNITCLASS_LIST);
            }
            else
            {//FE7 , FE6 はユニットの部分に色指定がある
                List <U.AddrResult> list = new List <U.AddrResult>();
                for (int i = 0; i < Program.ROM.RomInfo.unit_maxcount(); i++)
                {
                    uint uid        = (uint)i;
                    uint paletteid1 = UnitForm.GetPaletteLowClass(uid);
                    uint paletteid2 = UnitForm.GetPaletteHighClass(uid);

                    if (paletteid1 > 0 && paletteid1 - 1 == selectindex)
                    {
                        uint   cid  = UnitForm.GetClassID(uid);
                        string name = U.ToHexString(uid) + " " + UnitForm.GetUnitName(uid) + " -> " + U.ToHexString(cid) + " " + ClassForm.GetClassName(cid);
                        list.Add(new U.AddrResult(cid, name, uid));
                    }
                    else if (paletteid2 > 0 && paletteid2 - 1 == selectindex)
                    {
                        uint   cid  = UnitForm.GetHighClass(uid);
                        string name = U.ToHexString(uid) + " " + UnitForm.GetUnitName(uid) + " -> " + U.ToHexString(cid) + " " + ClassForm.GetClassName(cid);
                        list.Add(new U.AddrResult(cid, name, uid));
                    }
                }
                U.ConvertListBox(list, ref UNITCLASS_LIST);
            }
        }
コード例 #20
0
        private string EventToTextOne(int number)
        {
            StringBuilder sb = new StringBuilder();

            EventScript.OneCode code = this.ProcsScript[number];
            for (int n = 0; n < code.ByteData.Length; n++)
            {
                sb.Append(U.ToHexString(code.ByteData[n]));
            }
            sb.Append("\t//");

            //スクリプト名.
            sb.Append(code.Script.Info[0]);

            for (int i = 1; i < code.Script.Info.Length; i += 2)
            {
                char symbol = ' ';
                if (code.Script.Info[i].Length > 2)
                {// [X みたいな文字列が入る. 2文字目のXが シンボル名.
                    symbol = code.Script.Info[i][1];
                }

                for (int n = 0; n < code.Script.Args.Length; n++)
                {
                    EventScript.Arg arg = code.Script.Args[n];
                    if (EventScript.IsFixedArg(arg))
                    {
                        continue;
                    }
                    if (symbol != arg.Symbol)
                    {
                        continue;
                    }

                    sb.Append("[");

                    uint   v;
                    string hexstring = EventScript.GetArg(code, n, out v);
                    sb.Append(arg.Name);
                    sb.Append(":");

                    sb.Append(hexstring);

                    if (arg.Type == EventScript.ArgType.TEXT ||
                        arg.Type == EventScript.ArgType.CONVERSATION_TEXT ||
                        arg.Type == EventScript.ArgType.SYSTEM_TEXT ||
                        arg.Type == EventScript.ArgType.ONELINE_TEXT ||
                        arg.Type == EventScript.ArgType.POINTER_TEXT
                        )
                    {
                        sb.Append(" ");
                        string text = TextForm.DirectAndStripAllCode((v));
                        if (text.Length > 30)
                        {//長いテキストは省略
                            sb.Append(U.escape_return(U.strimwidth(text, 0, 20)));
                        }
                        else
                        {//長くないテキストはすぐ横に表示
                            sb.Append(U.escape_return(text));
                        }
                    }
                    else if (arg.Type == EventScript.ArgType.UNIT)
                    {
                        sb.Append(" ");
                        sb.Append(UnitForm.GetUnitName(v));
                    }
                    else if (arg.Type == EventScript.ArgType.CLASS)
                    {
                        sb.Append(" ");
                        sb.Append(ClassForm.GetClassName(v));
                    }
                    else if (arg.Type == EventScript.ArgType.POINTER_PROCS)
                    {
                        sb.Append(" ");
                        string dummy;
                        sb.Append(Program.AsmMapFileAsmCache.GetASMName(v, true, out dummy));
                    }
                    else if (arg.Type == EventScript.ArgType.POINTER_ASM)
                    {
                        sb.Append(" ");
                        string dummy;
                        sb.Append(Program.AsmMapFileAsmCache.GetASMName(v, false, out dummy));
                    }
                    else if (arg.Type == EventScript.ArgType.FSEC)
                    {//FSEC
                        sb.Append(" ");
                        sb.Append(InputFormRef.GetFSEC(v));
                    }
                    sb.Append("]");
                    break;
                }
            }
            sb.AppendLine("");

            return(sb.ToString());
        }