//他のクラスでこのデータを参照しているか? bool UpdateIndependencePanel() { if (this.CLASS_LISTBOX.SelectedIndex < 0) { return(false); } uint classid = (uint)U.atoh(this.CLASS_LISTBOX.Text); uint currentP = ClassForm.GetBattleAnimeAddrWhereID(classid); if (!U.isSafetyOffset(currentP)) { return(false); } uint class_count = (uint)this.CLASS_LISTBOX.Items.Count; for (uint i = 0; i < class_count; i++) { if (i == classid) {//自分自身 continue; } uint p = ClassForm.GetBattleAnimeAddrWhereID(i); if (p == currentP) { return(true); } } return(false); }
public void SetParam(uint lv, uint grow, uint unitid, uint classid) { if (classid == 0) { classid = UnitForm.GetUnitIDWhereSupportClass(unitid); } GrowSimulator sim = new GrowSimulator(); UnitForm.SetSimUnit(ref sim, unitid); ClassForm.SetSimClass(ref sim, classid); if (UnitForm.isHighClass(unitid) || ClassForm.isHighClass(classid)) { lv += 10; } GrowSimulator.GrowOptionEnum growOption = GrowSimulator.GrowOptionEnum.None; if (grow == 1) { growOption = GrowSimulator.GrowOptionEnum.ClassGrow; sim.SetUnitLv1(); } sim.Grow((int)lv, growOption); U.SelectedIndexSafety(X_SIM_HP, sim.sim_hp); U.SelectedIndexSafety(X_SIM_STR, sim.sim_str); U.SelectedIndexSafety(X_SIM_SKILL, sim.sim_skill); U.SelectedIndexSafety(X_SIM_SPD, sim.sim_spd); U.SelectedIndexSafety(X_SIM_DEF, sim.sim_def); U.SelectedIndexSafety(X_SIM_RES, sim.sim_res); U.SelectedIndexSafety(X_SIM_LUCK, sim.sim_luck); U.SelectedIndexSafety(X_SIM_MAGICEX_Value, sim.sim_ext_magic); }
static InputFormRef N_Init(Form self) { return(new InputFormRef(self , "N_" , 0 , 4 , (int i, uint addr) => { //終端まで if (Program.ROM.u8(addr) != 0) { //先頭は0でなければならない return false; } return Program.ROM.u32(addr) != 0; } , (int i, uint addr) => { uint class_type = Program.ROM.u16(addr + 2); U.AddrResult ar = new U.AddrResult(); ar.addr = addr; ar.name = U.ToHexString(class_type) + " " + ClassForm.GetClassType(class_type); return ar; } )); }
private void WriteButton_Click(object sender, EventArgs e) { if (!X_CC3Patch.Visible) { return; } //CC3分岐パッチが導入されている場合 uint class_id = (uint)this.AddressList.SelectedIndex; if (class_id >= this.InputFormRef.DataCount) { return; } uint classAddr = ClassForm.GetClassAddr(class_id); if (classAddr == U.NOT_FOUND) { return; } Undo.UndoData undodata = Program.Undo.NewUndoData(this); Program.ROM.write_u8(classAddr + 5, (uint)X_CC3.Value, undodata); Program.Undo.Push(undodata); }
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); }
private void AddressList_SelectedIndexChanged(object sender, EventArgs e) { int filter = this.FilterComboBox.SelectedIndex; if (filter == 6 || filter == 7) {//地形回復/地形ステータス異常回復 全クラス共通 IndependenceButton.Enabled = false; CLASS_LISTBOX.Items.Clear(); CLASS_LISTBOX.Items.Add(R._("全クラス共通")); return; } uint selectAddr = (uint)this.Address.Value; List <U.AddrResult> list = ClassForm.MakeClassList((uint addr) => { uint p = ClassForm.GetMoveCostAddrLow(addr, (uint)this.FilterComboBox.SelectedIndex); return(p == selectAddr); } ); U.ConvertListBox(list, ref this.CLASS_LISTBOX); //クラスが2つ以上あるなら分離ボタンを有効かする IndependenceButton.Enabled = (list.Count >= 2); }
static InputFormRef Init(MoveCostForm self) { return(new InputFormRef(self , "" , Program.ROM.RomInfo.class_pointer() , Program.ROM.RomInfo.class_datasize() , (int i, uint addr) => { //読込最大値検索 if (i == 0) { return true; } uint no = Program.ROM.u8(addr + 4); return (no != 0); } , (int i, uint addr) => { if (i == 0) { return new U.AddrResult(0, ""); } uint p = ClassForm.GetMoveCostAddrLow(addr, (uint)self.FilterComboBox.SelectedIndex); string name = U.ToHexString(i) + " " + ClassForm.GetClassNameLow(addr); return new U.AddrResult(p, name); } )); }
private void IndependenceButton_Click(object sender, EventArgs e) { if (this.AddressList.SelectedIndex < 0) { return; } uint classid = (uint)U.atoh(this.AddressList.Text); uint classaddr = ClassForm.GetClassAddr(classid); string name = U.ToHexString(classid) + " " + ClassForm.GetClassNameLow(classaddr); uint p = InputFormRef.SelectToAddr(this.AddressList); uint setting = ClassForm.GetMoveCostPointerAddrLow(classaddr, (uint)this.FilterComboBox.SelectedIndex); if (setting == U.NOT_FOUND) { return; } Undo.UndoData undodata = Program.Undo.NewUndoData(this, "MoveCost Independence"); PatchUtil.WriteIndependence(p, 68, setting, name, undodata); Program.Undo.Push(undodata); InputFormRef.ShowWriteNotifyAnimation(this, p); this.ReloadListButton.PerformClick(); this.InputFormRef.JumpTo(classid); }
public static Bitmap DrawClassTypeIcon(uint id) { if ((id & 0x01) == 0x01) { return(ClassForm.DrawWaitIcon(0x09, 0, true)); //アーマー系 } if ((id & 0x02) == 0x02) { return(ClassForm.DrawWaitIcon(0x05, 0, true)); //騎兵系 } if ((id & 0x04) == 0x04) { return(ClassForm.DrawWaitIcon(0x48, 0, true)); //飛行系 } if ((id & 0x08) == 0x08) { return(ClassForm.DrawWaitIcon(0x1f, 0, true)); //ドラゴン系 } if ((id & 0x10) == 0x10) { return(ClassForm.DrawWaitIcon(0x54, 0, true)); //モンスター系 } if ((id & 0x20) == 0x20) { return(ClassForm.DrawWaitIcon(0x13, 0, true)); //ソード系 } return(ImageUtil.BlankDummy()); }
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(); } )); }
private void IndependenceButton_Click(object sender, EventArgs e) { if (this.ItemListBox.SelectedIndex < 0) { return; } uint itemid = (uint)U.atoh(this.ItemListBox.Text); uint itemaddr = ItemForm.GetItemAddr(itemid); string name = U.ToHexString(itemid) + " " + ClassForm.GetClassNameLow(itemaddr); uint pointer; uint currentP = ItemForm.GetEFFECTIVENESSPointerWhereID(itemid, out pointer); if (!U.isSafetyOffset(currentP)) { return; } Undo.UndoData undodata = Program.Undo.NewUndoData(this, this.Name + " Independence"); uint dataSize = (InputFormRef.DataCount + 1) * InputFormRef.BlockSize; PatchUtil.WriteIndependence(currentP, dataSize, pointer, name, undodata); Program.Undo.Push(undodata); InputFormRef.ShowWriteNotifyAnimation(this, currentP); ReselectItem(itemid); }
private void SkillSystemsEffectivenessReworkClassTypeForm_Load(object sender, EventArgs e) { Bitmap a = ClassForm.DrawWaitIcon(0x09, 0, true); //アーマー系 U.MakeTransparent(a); IMAGE_1.Image = a; a = ClassForm.DrawWaitIcon(0x05, 0, true); //騎兵系 U.MakeTransparent(a); IMAGE_2.Image = a; a = ClassForm.DrawWaitIcon(0x48, 0, true); //飛行系 U.MakeTransparent(a); IMAGE_4.Image = a; a = ClassForm.DrawWaitIcon(0x1f, 0, true); //ドラゴン系 U.MakeTransparent(a); IMAGE_8.Image = a; a = ClassForm.DrawWaitIcon(0x54, 0, true); //モンスター系 U.MakeTransparent(a); IMAGE_10.Image = a; a = ClassForm.DrawWaitIcon(0x13, 0, true); //ソード系 U.MakeTransparent(a); IMAGE_20.Image = a; }
public static void GetWeaponType(uint cid , out bool out_melee , out bool out_magic ) { uint sword = 0; uint lance = 0; uint axe = 0; uint bow = 0; uint staff = 0; uint anima = 0; uint light = 0; uint dark = 0; ClassForm.GetWeaponLevel(cid , out sword , out lance , out axe , out bow , out staff , out anima , out light , out dark ); out_melee = sword > 0 || lance > 0 || axe > 0 || bow > 0; out_magic = staff > 0 || anima > 0 || light > 0 || dark > 0; }
private void SwitchListExpandsButton_Click(object sender, EventArgs e) { if (this.L_0_COMBO.Items.Count <= 0) { return; } uint defAddr = U.atoh(this.L_0_COMBO.Items[0].ToString()); uint newCount = ClassForm.DataCount(); Undo.UndoData undodata = Program.Undo.NewUndoData(this, "SoundFootStep SwitchExpands"); PatchUtil.Switch2Expands(Program.ROM.RomInfo.sound_foot_steps_pointer , Program.ROM.RomInfo.sound_foot_steps_switch2_address , newCount , defAddr , undodata); if (Program.ROM.RomInfo.version == 8) { if (Program.ROM.RomInfo.is_multibyte) {//Fix PlaySoundStepByClass(足音) HardCode Program.ROM.write_range(0x7B198, new byte[] { 0x1c, 0xe0 }, undodata); } else {//Fix PlaySoundStepByClass(足音) HardCode Program.ROM.write_range(0x78d84, new byte[] { 0x1c, 0xe0 }, undodata); } } Program.Undo.Push(undodata); ReInit(this.InputFormRef); }
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); } } )); }
void FixBattleAnimePointerOnAddressListExpandsEvent(object sender, EventArgs arg) { InputFormRef.ExpandsEventArgs eearg = (InputFormRef.ExpandsEventArgs)arg; uint addr = eearg.NewBaseAddress; int count = (int)eearg.NewDataCount; if (CLASS_LISTBOX.SelectedIndex < 0) { return; } uint cid = (uint)CLASS_LISTBOX.SelectedIndex; uint pointer; ClassForm.GetBattleAnimeAddrWhereID(cid, out pointer); if (!U.isSafetyOffset(pointer)) { return; } Undo.UndoData undodata = Program.Undo.NewUndoData(this, "FixBattleAnimeSetting"); //クラスの戦闘アニメポインタを更新する. Program.ROM.write_p32(pointer, addr, undodata); Program.Undo.Push(undodata); this.InputFormRef.ReInit(addr, (uint)count); }
public GrowSimulator BuildSim() { GrowSimulator sim = new GrowSimulator(); sim.SetUnitBase((int)B11.Value //LV , (int)b12.Value //hp , (int)b13.Value //str , (int)b14.Value //skill , (int)b15.Value //spd , (int)b16.Value //def , (int)b17.Value //res , (int)b18.Value //luck , 0 ); sim.SetUnitGrow( (int)B28.Value //hp , (int)B29.Value //str , (int)B30.Value //skill , (int)B31.Value //spd , (int)B32.Value //def , (int)B33.Value //res , (int)B34.Value //luck , 0 ); ClassForm.GetSim(ref sim , (uint)B5.Value //支援クラス ); return(sim); }
public static MapPictureBox.StaticItem DrawAfterPosUnit(uint class_id, uint unitgrow, int before_x, int before_y, int after_x, int after_y) { MapPictureBox.StaticItem st; int palette_type = (int)U.ParseUnitGrowAssign(unitgrow); Bitmap icon = ClassForm.DrawWaitIcon(class_id, palette_type); //アイコンの背丈の補正 中央に出すための補正値を取得 int draw_x_add; int draw_y_add; EventUnitForm.GetDrawAddXY(icon, out draw_x_add, out draw_y_add); uint assign = U.ParseUnitGrowAssign(unitgrow); st = new MapPictureBox.StaticItem(); st.bitmap = icon; st.x = before_x; st.y = before_y; st.draw_x_add = draw_x_add; st.draw_y_add = draw_y_add; if (before_x == after_x && before_y == after_y) { return(st); } st = new MapPictureBox.StaticItem(); st.bitmap = icon; st.x = after_x; st.y = after_y; st.draw_x_add = draw_x_add; st.draw_y_add = draw_y_add; return(st); }
//全データの取得 public static void MakeAllDataLength(List <Address> list) { int datcount = (int)ClassForm.DataCount(); InputFormRef InputFormRef = N_Init(null, datcount); FEBuilderGBA.Address.AddAddress(list, InputFormRef, "CCClassAlphaName", new uint[] { }); }
void UpdateItemDropLabel() { uint unit_id = (uint)this.B0.Value; uint class_id = (uint)this.B1.Value; if (unit_id > 0) { unit_id--; } uint unit_addr = UnitForm.GetUnitAddr(unit_id); uint class_addr = ClassForm.GetClassAddr(class_id); bool isItemDrop = IsItemDropFlag(unit_addr) || IsItemDropFlag(class_addr); if (isItemDrop) {//アイテムドロップ X_ITEMDROP.Text = R._("アイテムドロップ: ドロップする"); X_ITEMDROP.ForeColor = OptionForm.Color_ControlComment_ForeColor(); } else { X_ITEMDROP.Text = R._("アイテムドロップ: ドロップしない"); X_ITEMDROP.ForeColor = OptionForm.Color_Control_ForeColor(); } }
public static uint GetHighClassFE7(uint uid) { if (uid == 0) { return(0); } //FE7までは分岐がないので、クラスのCCクラスを参照する. uint shien_classs_id = UnitForm.GetClassID(uid); if (shien_classs_id <= 0) { return(0); } if (ClassForm.isHighClass(shien_classs_id)) {//上位クラスなので、もう CCではない return(shien_classs_id); } uint change_class = ClassForm.GetChangeClassID(shien_classs_id); if (change_class <= 0) {//上位のクラスが取れないので下位クラスを返す return(shien_classs_id); } if (ClassForm.isHighClass(change_class)) {//上位クラスなので、もう CCではない return(change_class); } //上位のクラスが取れないので下位クラスを返す return(shien_classs_id); }
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(); } )); }
private void IndependenceButton_Click(object sender, EventArgs e) { if (this.CLASS_LISTBOX.SelectedIndex < 0) { return; } uint classid = (uint)U.atoh(this.CLASS_LISTBOX.Text); uint classaddr = ClassForm.GetClassAddr(classid); string name = U.ToHexString(classid) + " " + ClassForm.GetClassNameLow(classaddr); uint pointer; uint currentP = ClassForm.GetBattleAnimeAddrWhereID(classid, out pointer); if (!U.isSafetyOffset(currentP)) { return; } Undo.UndoData undodata = Program.Undo.NewUndoData(this, this.Name + " Independence"); uint dataSize = (InputFormRef.DataCount + 1) * InputFormRef.BlockSize; PatchUtil.WriteIndependence(currentP, dataSize, pointer, name, undodata); Program.Undo.Push(undodata); InputFormRef.ShowWriteNotifyAnimation(this, currentP); U.ReSelectList(this.CLASS_LISTBOX); }
public OPClassAlphaNameForm() { InitializeComponent(); this.N_AddressList.OwnerDraw(ListBoxEx.DrawClassAndText, DrawMode.OwnerDrawFixed); int class_data_count = (int)ClassForm.DataCount(); this.N_InputFormRef = N_Init(this, class_data_count); this.N_InputFormRef.MakeGeneralAddressListContextMenu(true); }
private void X_JUMP_WAITICON_Click(object sender, EventArgs e) { if (this.AddressList.SelectedIndex < 0) { return; } uint cid = (uint)this.AddressList.SelectedIndex + 1; uint icon = ClassForm.GetClassWaitIcon(cid); InputFormRef.JumpTo(null, icon , "WAITICON", new string[] { }); }
public static int ClassMaxLevel(uint classs_id) { int max_level = (int)PatchUtil.GetLevelMaxCaps(); if (ClassForm.isHighClass(classs_id)) {//上級職は、最大LV+10として計算します. return(max_level + 10); } return(max_level); }
//移動コスト等の取得. public static uint GetMoveCost(uint cid, uint terrain_data, uint costtype) { uint addr = ClassForm.GetMoveCostAddr(cid, costtype); if (!U.isSafetyOffset(addr)) { return(U.NOT_FOUND); } return(Program.ROM.u8(addr + terrain_data)); }
public void DrawUnits(uint topaddr, int max) { const uint RAMUnitSizeOf = 72; //構造体のサイズ bool isFE6 = (Program.ROM.RomInfo.version == 6); uint addr = topaddr; for (int i = 0; i < max; i++, addr += RAMUnitSizeOf) { uint unitPointer = Program.RAM.u32(addr + 0); uint classPointer = Program.RAM.u32(addr + 4); if (unitPointer == 0) { continue; } if (!U.isSafetyPointer(unitPointer)) { continue; } if (!U.isSafetyPointer(classPointer)) { continue; } uint classid = Program.ROM.u8(U.toOffset(classPointer) + 4); uint unit_number = Program.RAM.u8(addr + 11); int palette_type = GetShowPartyClassPaletteType(unit_number); Bitmap bitmap = ClassForm.DrawWaitIcon(classid, palette_type); U.MakeTransparent(bitmap); uint x, y; if (isFE6) { x = Program.RAM.u8(addr + 14); y = Program.RAM.u8(addr + 15); } else { x = Program.RAM.u8(addr + 16); y = Program.RAM.u8(addr + 17); } MapPictureBox.StaticItem st = new MapPictureBox.StaticItem(); st.bitmap = bitmap; st.x = (int)x; st.y = (int)y; st.draw_x_add = 0; st.draw_y_add = 0; MapPictureBox.SetStaticItem(U.To0xHexString(addr), st.x, st.y, st.bitmap, st.draw_x_add, st.draw_y_add); } }
public void InitExportFilter(uint filter) { List <UseValsID> list = new List <UseValsID>(); if (filter == 1) {//ユニット関係のみ UnitForm.MakeVarsIDArray(list); } else if (filter == 2) {//クラス関係のみ ClassForm.MakeVarsIDArray(list); } else if (filter == 3) {//アイテム関係のみ ItemForm.MakeVarsIDArray(list); } else if (filter == 4) {//サウンドルーム関係のみ if (Program.ROM.RomInfo.version == 6) { SoundRoomFE6Form.MakeVarsIDArray(list); } else { SoundRoomForm.MakeVarsIDArray(list); } } else if (filter == 5) {//支援会話関係 SupportTalkForm.MakeVarsIDArray(list); } else if (filter == 6) {//スキル関係 if (Program.ROM.RomInfo.is_multibyte) { SkillConfigFE8NSkillForm.MakeVarsIDArray(list); SkillConfigFE8NVer2SkillForm.MakeVarsIDArray(list); } else { SkillConfigSkillSystemForm.MakeVarsIDArray(list); } } else {//all ExportFilterArray = null; return; } ExportFilterArray = new Dictionary <int, bool>(); foreach (UseValsID val in list) { ExportFilterArray[(int)val.ID] = true; } }
//エラーチェック public static void MakeCheckError(List <FELint.ErrorSt> errors) { InputFormRef N_InputFormRef = N_Init(null); bool isFE6 = (Program.ROM.RomInfo.version == 6); if (!isFE6) {//FE6の場合、パラディンなどが手斧モーションを持っていない. //そのため、FE7,FE8だけチェックします. InputFormRef InputFormRef = Init(null); List <U.AddrResult> handAxsItems = ItemForm.MakeItemListByHandAxs(); List <U.AddrResult> classList = ClassForm.MakeClassList(); for (uint cid = 1; cid < classList.Count; cid++) { uint pointer; uint class_addr = classList[(int)cid].addr; uint addr = ClassForm.GetBattleAnimeAddrWhereAddr(class_addr, out pointer); if (addr == 0) { continue; } if (!U.isSafetyOffset(addr)) { errors.Add(new FELint.ErrorSt(FELint.Type.CLASS, class_addr , R._("クラス({0})の{1}のポインタ({2})が危険です。" , classList[(int)cid].name, R._("戦闘アニメ"), U.To0xHexString(addr)), cid)); continue; } InputFormRef.ReInit(addr); MakeCheckErrorAxs(InputFormRef, N_InputFormRef , handAxsItems, classList, cid, errors); } } { if (N_InputFormRef.DataCount < 10) { errors.Add(new FELint.ErrorSt(FELint.Type.BATTLE_ANIME, U.NOT_FOUND , R._("戦闘アニメが極端に少ないです。破損している可能性があります。"))); } List <uint> seatNumberList = new List <uint>(256); uint p = N_InputFormRef.BaseAddress; for (int i = 0; i < N_InputFormRef.DataCount; i++, p += N_InputFormRef.BlockSize) { if (isFE6 && i == 0x6c) { continue; } ImageUtilOAM.MakeCheckError(errors, p, (uint)(i), seatNumberList); } } }