Пример #1
0
        //リストが拡張されたとき
        void AddressListExpandsEvent(object sender, EventArgs arg)
        {
            InputFormRef.ExpandsEventArgs eearg = (InputFormRef.ExpandsEventArgs)arg;
            uint addr  = eearg.NewBaseAddress;
            int  count = (int)eearg.NewDataCount;

            //戦闘アニメーションを0クリアしておきます。トラブルを避けるため
            //クラスIDもちゃんと割り振ろう
            Undo.UndoData undodata = Program.Undo.NewUndoData(this, "ClearBattleAnimationPointer");
            addr = addr + (eearg.OldDataCount * eearg.BlockSize);
            for (int i = (int)eearg.OldDataCount; i < count; i++)
            {
                //クラスID
                Program.ROM.write_u8(addr + 4, (uint)i, undodata);

                //戦闘アニメクリア
                Program.ROM.write_u32(addr + 52, 0, undodata);

                addr += eearg.BlockSize;
            }

            if (Program.ROM.RomInfo.version() == 8)
            {
                CCBranchForm.ExpandsArea(this, eearg.OldDataCount, (uint)count, undodata);
            }
            if (Program.ROM.RomInfo.is_multibyte())
            {
                OPClassAlphaNameForm.ExpandsArea(this, eearg.OldDataCount, (uint)count, undodata);
            }
            //移動アイコンはクラスIDと連動しているので増設しないといけない.
            ImageUnitMoveIconFrom.ExpandsArea(this, eearg.OldDataCount, (uint)count, undodata);

            Program.Undo.Push(undodata);
        }
Пример #2
0
        public static int CalcMaxLevel(uint shien_classs_id)
        {
            int cc_count = CCBranchForm.GetCCCount(shien_classs_id);

            int level;

            //最大値LV
            int max_level = (int)Program.ROM.u8(Program.ROM.RomInfo.max_level_address);

            if (cc_count >= 2)
            {//見習いからのCC
                level = max_level * (cc_count + 1) - 10;
            }
            else
            {
                level = max_level * (cc_count + 1);
            }
            if (level <= 0)
            {
                level = 0;
            }
            else if (level >= 255)
            {
                level = 255;
            }
            return(level);
        }