Example #1
0
        public static string GetNames(uint addr)
        {
            StringBuilder sb = new StringBuilder();

            addr = U.toOffset(addr);
            uint start  = addr;
            uint length = (uint)Program.ROM.Data.Length;

            for (; addr < length; addr += 1)
            {
                uint value = Program.ROM.u8(addr);
                if (value == 0x00)
                {
                    break;
                }
                if (sb.Length != 0)
                {
                    sb.Append(", ");
                }
                string text = MapTerrainNameForm.GetName(value);
                sb.Append(U.ToHexString(value));
                sb.Append('(');
                sb.Append(text);
                sb.Append(')');
            }

            return(sb.ToString());
        }
Example #2
0
        static void MakeCheckErrorOneMove(FELint.Type type
                                          , uint addr
                                          , uint cid
                                          , List <U.AddrResult> classList
                                          , List <FELint.ErrorSt> errors)
        {
            if (addr == 0)
            {
                return;
            }

            string seetname;

            if (type == FELint.Type.MOVECOST_NORMAL)
            {
                seetname = R._("移動コスト");
            }
            else if (type == FELint.Type.MOVECOST_RAIN)
            {
                seetname = R._("移動コスト(雨)");
            }
            else if (type == FELint.Type.MOVECOST_SHOW)
            {
                seetname = R._("移動コスト(雪)");
            }
            else
            {
                Debug.Assert(false);
                return;
            }

            if (!U.isSafetyOffset(addr))
            {
                errors.Add(new FELint.ErrorSt(FELint.Type.CLASS, classList[(int)cid].addr
                                              , R._("クラス({0})の{1}のポインタ({2})が危険です。"
                                                    , classList[(int)cid].name, seetname, U.To0xHexString(addr)), cid));
                return;
            }
            uint max = 64 + 1;

            if (Program.ROM.RomInfo.version() == 6)
            {
                max = 50 + 1;
            }

            for (uint i = 0; i < max; i++)
            {
                uint v = Program.ROM.u8(addr + i);
                if (v >= 31 || v <= 15)
                {
                    continue;
                }

                string tilename = MapTerrainNameForm.GetName(i);
                errors.Add(new FELint.ErrorSt(type, addr
                                              , R._("クラス({0})の({1})の({2})のタイルの移動コスト({3})が正しくありません。\r\n移動できないタイルは255に、移動できるタイルは0-15の範囲に設定しないといけません。"
                                                    , classList[(int)cid].name, seetname, tilename, v), cid));
            }
        }
Example #3
0
 void LoadNames()
 {
     J_0.Text  = MapTerrainNameForm.GetName(0);
     J_1.Text  = MapTerrainNameForm.GetName(1);
     J_2.Text  = MapTerrainNameForm.GetName(2);
     J_3.Text  = MapTerrainNameForm.GetName(3);
     J_4.Text  = MapTerrainNameForm.GetName(4);
     J_5.Text  = MapTerrainNameForm.GetName(5);
     J_6.Text  = MapTerrainNameForm.GetName(6);
     J_7.Text  = MapTerrainNameForm.GetName(7);
     J_8.Text  = MapTerrainNameForm.GetName(8);
     J_9.Text  = MapTerrainNameForm.GetName(9);
     J_10.Text = MapTerrainNameForm.GetName(10);
     J_11.Text = MapTerrainNameForm.GetName(11);
     J_12.Text = MapTerrainNameForm.GetName(12);
     J_13.Text = MapTerrainNameForm.GetName(13);
     J_14.Text = MapTerrainNameForm.GetName(14);
     J_15.Text = MapTerrainNameForm.GetName(15);
     J_16.Text = MapTerrainNameForm.GetName(16);
     J_17.Text = MapTerrainNameForm.GetName(17);
     J_18.Text = MapTerrainNameForm.GetName(18);
     J_19.Text = MapTerrainNameForm.GetName(19);
     J_20.Text = MapTerrainNameForm.GetName(20);
     J_21.Text = MapTerrainNameForm.GetName(21);
     J_22.Text = MapTerrainNameForm.GetName(22);
     J_23.Text = MapTerrainNameForm.GetName(23);
     J_24.Text = MapTerrainNameForm.GetName(24);
     J_25.Text = MapTerrainNameForm.GetName(25);
     J_26.Text = MapTerrainNameForm.GetName(26);
     J_27.Text = MapTerrainNameForm.GetName(27);
     J_28.Text = MapTerrainNameForm.GetName(28);
     J_29.Text = MapTerrainNameForm.GetName(29);
     J_30.Text = MapTerrainNameForm.GetName(30);
     J_31.Text = MapTerrainNameForm.GetName(31);
     J_32.Text = MapTerrainNameForm.GetName(32);
     J_33.Text = MapTerrainNameForm.GetName(33);
     J_34.Text = MapTerrainNameForm.GetName(34);
     J_35.Text = MapTerrainNameForm.GetName(35);
     J_36.Text = MapTerrainNameForm.GetName(36);
     J_37.Text = MapTerrainNameForm.GetName(37);
     J_38.Text = MapTerrainNameForm.GetName(38);
     J_39.Text = MapTerrainNameForm.GetName(39);
     J_40.Text = MapTerrainNameForm.GetName(40);
     J_41.Text = MapTerrainNameForm.GetName(41);
     J_42.Text = MapTerrainNameForm.GetName(42);
     J_43.Text = MapTerrainNameForm.GetName(43);
     J_44.Text = MapTerrainNameForm.GetName(44);
     J_45.Text = MapTerrainNameForm.GetName(45);
     J_46.Text = MapTerrainNameForm.GetName(46);
     J_47.Text = MapTerrainNameForm.GetName(47);
     J_48.Text = MapTerrainNameForm.GetName(48);
     J_49.Text = MapTerrainNameForm.GetName(49);
     J_50.Text = MapTerrainNameForm.GetName(50);
 }
Example #4
0
 void LoadNames()
 {
     J_0.Text  = MapTerrainNameForm.GetName(0, true);
     J_1.Text  = MapTerrainNameForm.GetName(1, true);
     J_2.Text  = MapTerrainNameForm.GetName(2, true);
     J_3.Text  = MapTerrainNameForm.GetName(3, true);
     J_4.Text  = MapTerrainNameForm.GetName(4, true);
     J_5.Text  = MapTerrainNameForm.GetName(5, true);
     J_6.Text  = MapTerrainNameForm.GetName(6, true);
     J_7.Text  = MapTerrainNameForm.GetName(7, true);
     J_8.Text  = MapTerrainNameForm.GetName(8, true);
     J_9.Text  = MapTerrainNameForm.GetName(9, true);
     J_10.Text = MapTerrainNameForm.GetName(10, true);
     J_11.Text = MapTerrainNameForm.GetName(11, true);
     J_12.Text = MapTerrainNameForm.GetName(12, true);
     J_13.Text = MapTerrainNameForm.GetName(13, true);
     J_14.Text = MapTerrainNameForm.GetName(14, true);
     J_15.Text = MapTerrainNameForm.GetName(15, true);
     J_16.Text = MapTerrainNameForm.GetName(16, true);
     J_17.Text = MapTerrainNameForm.GetName(17, true);
     J_18.Text = MapTerrainNameForm.GetName(18, true);
     J_19.Text = MapTerrainNameForm.GetName(19, true);
     J_20.Text = MapTerrainNameForm.GetName(20, true);
     J_21.Text = MapTerrainNameForm.GetName(21, true);
     J_22.Text = MapTerrainNameForm.GetName(22, true);
     J_23.Text = MapTerrainNameForm.GetName(23, true);
     J_24.Text = MapTerrainNameForm.GetName(24, true);
     J_25.Text = MapTerrainNameForm.GetName(25, true);
     J_26.Text = MapTerrainNameForm.GetName(26, true);
     J_27.Text = MapTerrainNameForm.GetName(27, true);
     J_28.Text = MapTerrainNameForm.GetName(28, true);
     J_29.Text = MapTerrainNameForm.GetName(29, true);
     J_30.Text = MapTerrainNameForm.GetName(30, true);
     J_31.Text = MapTerrainNameForm.GetName(31, true);
     J_32.Text = MapTerrainNameForm.GetName(32, true);
     J_33.Text = MapTerrainNameForm.GetName(33, true);
     J_34.Text = MapTerrainNameForm.GetName(34, true);
     J_35.Text = MapTerrainNameForm.GetName(35, true);
     J_36.Text = MapTerrainNameForm.GetName(36, true);
     J_37.Text = MapTerrainNameForm.GetName(37, true);
     J_38.Text = MapTerrainNameForm.GetName(38, true);
     J_39.Text = MapTerrainNameForm.GetName(39, true);
     J_40.Text = MapTerrainNameForm.GetName(40, true);
     J_41.Text = MapTerrainNameForm.GetName(41, true);
     J_42.Text = MapTerrainNameForm.GetName(42, true);
     J_43.Text = MapTerrainNameForm.GetName(43, true);
     J_44.Text = MapTerrainNameForm.GetName(44, true);
     J_45.Text = MapTerrainNameForm.GetName(45, true);
     J_46.Text = MapTerrainNameForm.GetName(46, true);
     J_47.Text = MapTerrainNameForm.GetName(47, true);
     J_48.Text = MapTerrainNameForm.GetName(48, true);
     J_49.Text = MapTerrainNameForm.GetName(49, true);
     J_50.Text = MapTerrainNameForm.GetName(50, true);
 }
 static InputFormRef Init(Form self)
 {
     return(new InputFormRef(self
                             , ""
                             , 0
                             , 1
                             , (int i, uint addr) =>
     {    //読込最大値検索
         return i < Program.ROM.RomInfo.map_terrain_type_count();
     }
                             , (int i, uint addr) =>
     {    //リストボックスに乗せる項目
         string name = MapTerrainNameForm.GetName((uint)i);
         return U.ToHexString(i + 1) + " " + name;
     }
                             ));
 }
Example #6
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 tileid = Program.ROM.u8(addr + 0);
         return U.ToHexString(tileid) + " " + MapTerrainNameForm.GetName(tileid);
     }
                             ));
 }
Example #7
0
        void DrawMapChipInfo(int chipset_id, int x, int y, PaintEventArgs e)
        {
            PointF pt = new PointF();

            pt.X = x;
            pt.Y = y;

            //このチップセットの名前を問い合わせる.
            uint terrain_data = ImageUtilMap.GetChipsetID(chipset_id, this.configUZ);

            if (terrain_data == U.NOT_FOUND)
            {
                return;
            }
            const uint test_class = 1; //主人公クラス

            string terrain_name    = MapTerrainNameForm.GetName(terrain_data);
            string terrain_kaihi   = R._("地形回避") + ":" + MoveCostForm.GetMoveCost(test_class, terrain_data, 3).ToString(); //地形回避
            string terrain_kaifuku = R._("地形回復") + ":" + MoveCostForm.GetMoveCost(test_class, terrain_data, 6).ToString(); //地形回復

            string terrain_tuukou = R._("地形コスト") + ":";
            uint   cost           = MoveCostForm.GetMoveCost(test_class, terrain_data, 0);

            terrain_tuukou += cost.ToString();
            if (cost >= 255)
            {
                cost = MoveCostForm.GetMoveCost(ClassForm.GetFlyClass(), terrain_data, 0);
                if (cost < 255)
                {
                    terrain_tuukou += R._("(飛行のみ)");
                }
                else
                {
                    terrain_tuukou += R._("(全員不可)");
                }
            }


            Rectangle windowrc = new Rectangle();

            windowrc.X      = (int)pt.X + 48 + 1;
            windowrc.Y      = (int)pt.Y;
            windowrc.Width  = (int)0;
            windowrc.Height = (int)this.Font.Height * 4;

            //枠を描画する幅を特定します.
            SizeF textSize = e.Graphics.MeasureString(terrain_name, this.Font, 1000);

            if (windowrc.Width < textSize.Width)
            {
                windowrc.Width = (int)textSize.Width;
            }
            textSize = e.Graphics.MeasureString(terrain_kaihi, this.Font, 1000);
            if (windowrc.Width < textSize.Width)
            {
                windowrc.Width = (int)textSize.Width;
            }
            textSize = e.Graphics.MeasureString(terrain_kaifuku, this.Font, 1000);
            if (windowrc.Width < textSize.Width)
            {
                windowrc.Width = (int)textSize.Width;
            }
            textSize = e.Graphics.MeasureString(terrain_tuukou, this.Font, 1000);
            if (windowrc.Width < textSize.Width)
            {
                windowrc.Width = (int)textSize.Width;
            }

            if (windowrc.X + windowrc.Width > e.ClipRectangle.Right)
            {//画面右端の場合、左側に押し出す.
                windowrc.X = windowrc.X - windowrc.Width - 32;
                windowrc.Y = windowrc.Y + 16 + 32;
            }
            if (windowrc.Y + windowrc.Height > e.ClipRectangle.Bottom)
            {//画面下端の場合、上側に押し出す.
                windowrc.X = windowrc.X - 16 - 32;
                windowrc.Y = windowrc.Y - windowrc.Height - 32;
            }
            if (windowrc.X < 0)
            {
                windowrc.X = 0;
                while (true)
                {
                    if (pt.X < windowrc.Width && pt.Y >= windowrc.Y && pt.Y <= windowrc.Y + windowrc.Height)
                    {
                        windowrc.Y += 16;
                        continue;
                    }
                    break;
                }
            }
            pt.X = windowrc.X;
            pt.Y = windowrc.Y;

            e.Graphics.FillRectangle(this.BackBrush, windowrc);

            e.Graphics.DrawString(terrain_name, this.Font, this.ForeBrush, pt);

            pt.Y = pt.Y + this.Font.Height;
            e.Graphics.DrawString(terrain_kaihi, this.Font, this.ForeBrush, pt);

            pt.Y = pt.Y + this.Font.Height;
            e.Graphics.DrawString(terrain_kaifuku, this.Font, this.ForeBrush, pt);

            pt.Y = pt.Y + this.Font.Height;
            e.Graphics.DrawString(terrain_tuukou, this.Font, this.ForeBrush, pt);
        }