public static void SetMonsterParameter(SB2_MON_PARM pParm, ref ENEMY_TYPE pType) { pType.radius = pParm.Radius; pType.category = pParm.Category; pType.level = pParm.Level; pType.blue_magic_no = pParm.Blue; pType.max.hp = pParm.MaxHP; pType.max.mp = (Int16)pParm.MaxMP; pType.bonus.gil = pParm.WinGil; pType.bonus.exp = pParm.WinExp; pType.bonus.card = (UInt32)pParm.Card; pType.bonus.item = pParm.WinItems; for (Int16 num = 0; num < 6; num = (Int16)(num + 1)) { pType.mot[(Int32)num] = FF9BattleDB.Animation[(Int32)pParm.Mot[(Int32)num]]; } for (Int16 num = 0; num < 3; num = (Int16)(num + 1)) { pType.cam_bone[(Int32)num] = pParm.Bone[(Int32)num]; } pType.die_snd_no = pParm.DieSfx; pType.p_atk_no = pParm.Konran; for (Int16 num = 0; num < 6; num = (Int16)(num + 1)) { pType.icon_bone[(Int32)num] = pParm.IconBone[(Int32)num]; pType.icon_y[(Int32)num] = pParm.IconY[(Int32)num]; pType.icon_z[(Int32)num] = pParm.IconZ[(Int32)num]; } }
public static void SetMonsterData(SB2_MON_PARM pParm, BTL_DATA pBtl, Int16 pNo) { pBtl.stat.invalid = pParm.Status[0]; pBtl.stat.permanent = pParm.Status[1]; pBtl.stat.cur = pParm.Status[2]; pBtl.cur.hp = pParm.MaxHP; pBtl.cur.mp = (Int16)pParm.MaxMP; pBtl.defence.PhisicalDefence = pParm.P_DP; pBtl.defence.PhisicalEvade = pParm.P_AV; pBtl.defence.MagicalDefence = pParm.M_DP; pBtl.defence.MagicalEvade = pParm.M_AV; pBtl.elem.dex = pParm.Element.dex; pBtl.elem.str = pParm.Element.str; pBtl.elem.mgc = pParm.Element.mgc; pBtl.elem.wpr = pParm.Element.wpr; pBtl.def_attr.invalid = pParm.Attr[0]; pBtl.def_attr.absorb = pParm.Attr[1]; pBtl.def_attr.half = pParm.Attr[2]; pBtl.def_attr.weak = pParm.Attr[3]; pBtl.mesh_current = pParm.Mesh[0]; pBtl.mesh_banish = pParm.Mesh[1]; pBtl.tar_bone = pParm.Bone[3]; ENEMY enemy = FF9StateSystem.Battle.FF9Battle.enemy[(Int32)pBtl.bi.slot_no]; for (Int32 i = 0; i < (Int32)pParm.StealItems.Length; i++) { enemy.steal_item[i] = pParm.StealItems[i]; } enemy.info.die_atk = (Byte)(((pParm.Flags & 1) == 0) ? 0 : 1); enemy.info.die_dmg = (Byte)(((pParm.Flags & 2) == 0) ? 0 : 1); btl_util.SetShadow(pBtl, pParm.ShadowX, (UInt32)pParm.ShadowZ); pBtl.shadow_bone[0] = pParm.ShadowBone; pBtl.shadow_bone[1] = pParm.ShadowBone2; }
public Int32 GetHashCode(KeyValuePair <Dictionary <String, String>, SB2_MON_PARM> obj) { Int64 hashCode = obj.Key["US"].GetHashCode(); SB2_MON_PARM enemy = obj.Value; hashCode = (hashCode * 397) ^ (UInt32)enemy.Status[0]; hashCode = (hashCode * 397) ^ (UInt32)enemy.Status[1]; hashCode = (hashCode * 397) ^ (UInt32)enemy.Status[2]; hashCode = (hashCode * 397) ^ enemy.MaxHP; hashCode = (hashCode * 397) ^ enemy.MaxMP; hashCode = (hashCode * 397) ^ enemy.WinGil; hashCode = (hashCode * 397) ^ enemy.WinExp; GetHashCode(ref hashCode, enemy.WinItems); GetHashCode(ref hashCode, enemy.WinItems); GetHashCode(ref hashCode, enemy.StealItems); hashCode = (hashCode * 397) ^ enemy.Radius; hashCode = (hashCode * 397) ^ enemy.Geo; GetHashCode(ref hashCode, enemy.Mot); GetHashCode(ref hashCode, enemy.Mesh); hashCode = (hashCode * 397) ^ enemy.Flags; hashCode = (hashCode * 397) ^ enemy.AP; hashCode = (hashCode * 397) ^ enemy.Element.dex; hashCode = (hashCode * 397) ^ enemy.Element.str; hashCode = (hashCode * 397) ^ enemy.Element.mgc; hashCode = (hashCode * 397) ^ enemy.Element.wpr; hashCode = (hashCode * 397) ^ enemy.Element.pad; hashCode = (hashCode * 397) ^ enemy.Element.trans; hashCode = (hashCode * 397) ^ enemy.Element.cur_capa; hashCode = (hashCode * 397) ^ enemy.Element.max_capa; GetHashCode(ref hashCode, enemy.Attr); hashCode = (hashCode * 397) ^ enemy.Level; hashCode = (hashCode * 397) ^ enemy.Category; hashCode = (hashCode * 397) ^ enemy.HitRate; hashCode = (hashCode * 397) ^ enemy.P_DP; hashCode = (hashCode * 397) ^ enemy.P_AV; hashCode = (hashCode * 397) ^ enemy.M_DP; hashCode = (hashCode * 397) ^ enemy.M_AV; hashCode = (hashCode * 397) ^ enemy.Blue; GetHashCode(ref hashCode, enemy.Bone); hashCode = (hashCode * 397) ^ enemy.DieSfx; hashCode = (hashCode * 397) ^ enemy.Konran; hashCode = (hashCode * 397) ^ enemy.MesCnt; GetHashCode(ref hashCode, enemy.IconBone); GetHashCode(ref hashCode, enemy.IconY); GetHashCode(ref hashCode, enemy.IconZ); hashCode = (hashCode * 397) ^ enemy.StartSfx; hashCode = (hashCode * 397) ^ enemy.ShadowX; hashCode = (hashCode * 397) ^ enemy.ShadowZ; hashCode = (hashCode * 397) ^ enemy.ShadowBone; hashCode = (hashCode * 397) ^ enemy.Card; hashCode = (hashCode * 397) ^ enemy.ShadowOfsX; hashCode = (hashCode * 397) ^ enemy.ShadowOfsZ; hashCode = (hashCode * 397) ^ enemy.ShadowBone2; hashCode = (hashCode * 397) ^ enemy.Pad0; hashCode = (hashCode * 397) ^ enemy.Pad1; hashCode = (hashCode * 397) ^ enemy.Pad2; return(unchecked ((Int32)hashCode)); }
public static Int32 CalcDiff(KeyValuePair <Dictionary <String, String>, SB2_MON_PARM> item, IEnumerable <KeyValuePair <Dictionary <String, String>, SB2_MON_PARM> > other) { Int32 total = 0; SB2_MON_PARM baseValue = item.Value; foreach (KeyValuePair <Dictionary <String, String>, SB2_MON_PARM> data in other) { SB2_MON_PARM enemy = data.Value; if (baseValue == enemy) { continue; } if (baseValue.Status[0] != enemy.Status[0]) { total++; } if (baseValue.Status[1] != enemy.Status[1]) { total++; } if (baseValue.Status[2] != enemy.Status[2]) { total++; } if (baseValue.MaxHP != enemy.MaxHP) { total++; } if (baseValue.MaxMP != enemy.MaxMP) { total++; } if (baseValue.WinGil != enemy.WinGil) { total++; } if (baseValue.WinExp != enemy.WinExp) { total++; } if (!baseValue.WinItems.SequenceEqual(enemy.WinItems)) { total++; } if (!baseValue.StealItems.SequenceEqual(enemy.StealItems)) { total++; } if (baseValue.Radius != enemy.Radius) { total++; } if (baseValue.Geo != enemy.Geo) { total++; } if (!baseValue.Mot.SequenceEqual(enemy.Mot)) { total++; } if (!baseValue.Mesh.SequenceEqual(enemy.Mesh)) { total++; } if (baseValue.Flags != enemy.Flags) { total++; } if (baseValue.AP != enemy.AP) { total++; } if (baseValue.Element.dex != enemy.Element.dex) { total++; } if (baseValue.Element.str != enemy.Element.str) { total++; } if (baseValue.Element.mgc != enemy.Element.mgc) { total++; } if (baseValue.Element.wpr != enemy.Element.wpr) { total++; } if (baseValue.Element.pad != enemy.Element.pad) { total++; } if (baseValue.Element.trans != enemy.Element.trans) { total++; } if (baseValue.Element.cur_capa != enemy.Element.cur_capa) { total++; } if (baseValue.Element.max_capa != enemy.Element.max_capa) { total++; } if (!baseValue.Attr.SequenceEqual(enemy.Attr)) { total++; } if (baseValue.Level != enemy.Level) { total++; } if (baseValue.Category != enemy.Category) { total++; } if (baseValue.HitRate != enemy.HitRate) { total++; } if (baseValue.P_DP != enemy.P_DP) { total++; } if (baseValue.P_AV != enemy.P_AV) { total++; } if (baseValue.M_DP != enemy.M_DP) { total++; } if (baseValue.M_AV != enemy.M_AV) { total++; } if (baseValue.Blue != enemy.Blue) { total++; } if (!baseValue.Bone.SequenceEqual(enemy.Bone)) { total++; } if (baseValue.DieSfx != enemy.DieSfx) { total++; } if (baseValue.Konran != enemy.Konran) { total++; } if (baseValue.MesCnt != enemy.MesCnt) { total++; } if (!baseValue.IconBone.SequenceEqual(enemy.IconBone)) { total++; } if (!baseValue.IconY.SequenceEqual(enemy.IconY)) { total++; } if (!baseValue.IconZ.SequenceEqual(enemy.IconZ)) { total++; } if (baseValue.StartSfx != enemy.StartSfx) { total++; } if (baseValue.ShadowX != enemy.ShadowX) { total++; } if (baseValue.ShadowZ != enemy.ShadowZ) { total++; } if (baseValue.ShadowBone != enemy.ShadowBone) { total++; } if (baseValue.Card != enemy.Card) { total++; } if (baseValue.ShadowOfsX != enemy.ShadowOfsX) { total++; } if (baseValue.ShadowOfsZ != enemy.ShadowOfsZ) { total++; } if (baseValue.ShadowBone2 != enemy.ShadowBone2) { total++; } if (baseValue.Pad0 != enemy.Pad0) { total++; } if (baseValue.Pad1 != enemy.Pad1) { total++; } if (baseValue.Pad2 != enemy.Pad2) { total++; } } return(total); }
private void CreateBattleData(FF9StateGlobal FF9) { BTL_DATA[] btlDataArray = btlseq.btl_list = FF9StateSystem.Battle.FF9Battle.btl_data; Int32 index1 = 0; for (Int32 index2 = index1; index2 < 4; ++index2) { btlDataArray[index2] = new BTL_DATA(); if (FF9.party.member[index2] != null) { Byte num = FF9.party.member[index2].info.serial_no; BattlePlayerCharacter.CreatePlayer(btlDataArray[index1], (BattlePlayerCharacter.PlayerSerialNumber)num); Int32 length = 0; IEnumerator enumerator = btlDataArray[index1].gameObject.transform.GetEnumerator(); try { while (enumerator.MoveNext()) { if ((enumerator.Current as UnityEngine.Object)?.name.Contains("mesh") == true) { ++length; } } } finally { IDisposable disposable = enumerator as IDisposable; disposable?.Dispose(); } btlDataArray[index1].meshIsRendering = new Boolean[length]; for (Int32 index3 = 0; index3 < length; ++index3) { btlDataArray[index1].meshIsRendering[index3] = true; } btlDataArray[index1].meshCount = length; btlDataArray[index1].animation = btlDataArray[index1].gameObject.GetComponent <Animation>(); ++index1; } btlDataArray[index2].typeNo = 5; btlDataArray[index2].idleAnimationName = this.animationName[index2]; } for (Int32 index2 = 4; index2 < 4 + (Int32)this.btlScene.PatAddr[FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum].MonCount; ++index2) { SB2_PATTERN sb2Pattern = this.btlScene.PatAddr[FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum]; Byte num = sb2Pattern.Put[index2 - 4].TypeNo; SB2_MON_PARM sb2MonParm = this.btlScene.MonAddr[num]; String path = FF9BattleDB.GEO.GetValue(sb2MonParm.Geo); //var vector3 = new Vector3(sb2Pattern.Put[index2 - 4].Xpos, sb2Pattern.Put[index2 - 4].Ypos * -1, sb2Pattern.Put[index2 - 4].Zpos); btlDataArray[index2] = new BTL_DATA { gameObject = ModelFactory.CreateModel(path, true) }; if (ModelFactory.IsUseAsEnemyCharacter(path)) { if (path.Contains("GEO_MON_B3_168")) { btlDataArray[index2].gameObject.transform.FindChild("mesh5").gameObject.SetActive(false); } btlDataArray[index2].weapon_geo = ModelFactory.CreateDefaultWeaponForCharacterWhenUseAsEnemy(path); MeshRenderer[] componentsInChildren = btlDataArray[index2].weapon_geo.GetComponentsInChildren <MeshRenderer>(); btlDataArray[index2].weaponMeshCount = componentsInChildren.Length; btlDataArray[index2].weaponRenderer = new Renderer[btlDataArray[index2].weaponMeshCount]; for (Int32 index3 = 0; index3 < btlDataArray[index2].weaponMeshCount; ++index3) { btlDataArray[index2].weaponRenderer[index3] = componentsInChildren[index3].GetComponent <Renderer>(); } geo.geoAttach(btlDataArray[index2].weapon_geo, btlDataArray[index2].gameObject, ModelFactory.GetDefaultWeaponBoneIdForCharacterWhenUseAsEnemy(path)); } Int32 length = 0; IEnumerator enumerator = btlDataArray[index2].gameObject.transform.GetEnumerator(); try { while (enumerator.MoveNext()) { if ((enumerator.Current as UnityEngine.Object)?.name.Contains("mesh") == true) { ++length; } } } finally { IDisposable disposable = enumerator as IDisposable; disposable?.Dispose(); } btlDataArray[index2].meshIsRendering = new Boolean[length]; for (Int32 index3 = 0; index3 < length; ++index3) { btlDataArray[index2].meshIsRendering[index3] = true; } btlDataArray[index2].meshCount = length; btlDataArray[index2].animation = btlDataArray[index2].gameObject.GetComponent <Animation>(); btlDataArray[index2].animation = btlDataArray[index2].gameObject.GetComponent <Animation>(); btlDataArray[index2].typeNo = num; btlDataArray[index2].idleAnimationName = this.animationName[index2]; } }
private void CreateBattleData(FF9StateGlobal FF9) { BTL_DATA[] array = btlseq.btl_list = FF9StateSystem.Battle.FF9Battle.btl_data; int num = 0; checked { for (int i = num; i < 4; i++) { array[i] = new BTL_DATA(); if (FF9.party.member[i] != null) { byte serial_no = FF9.party.member[i].info.serial_no; BattlePlayerCharacter.CreatePlayer(array[num], (BattlePlayerCharacter.PlayerSerialNumber)serial_no); int num2 = 0; using (IEnumerator enumerator = array[num].gameObject.transform.GetEnumerator()) { while (enumerator.MoveNext()) { if (((Transform)enumerator.Current).name.Contains("mesh")) { num2++; } } } array[num].meshIsRendering = new bool[num2]; for (int j = 0; j < num2; j++) { array[num].meshIsRendering[j] = true; } array[num].meshCount = num2; array[num].animation = array[num].gameObject.GetComponent <Animation> (); num++; } array[i].typeNo = 5; array[i].idleAnimationName = this.animationName[i]; } for (int k = 4; k < (int)(4 + this.btlScene.PatAddr[(int)FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum].MonCount); k++) { SB2_PATTERN sb2_PATTERN = this.btlScene.PatAddr[(int)FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum]; byte typeNo = sb2_PATTERN.Put[k - 4].TypeNo; SB2_MON_PARM sb2_MON_PARM = this.btlScene.MonAddr[(int)typeNo]; string text = FF9BattleDB.GEO[(int)sb2_MON_PARM.Geo]; new Vector3((float)sb2_PATTERN.Put[k - 4].Xpos, (float)(sb2_PATTERN.Put[k - 4].Ypos * -1), (float)sb2_PATTERN.Put[k - 4].Zpos); array[k] = new BTL_DATA(); array[k].gameObject = ModelFactory.CreateModel(text, true); if (ModelFactory.IsUseAsEnemyCharacter(text)) { if (text.Contains("GEO_MON_B3_168")) { array[k].gameObject.transform.FindChild("mesh5").gameObject.SetActive(false); } array[k].weapon_geo = ModelFactory.CreateDefaultWeaponForCharacterWhenUseAsEnemy(text); MeshRenderer[] componentsInChildren = array[k].weapon_geo.GetComponentsInChildren <MeshRenderer> (); array[k].weaponMeshCount = componentsInChildren.Length; array[k].weaponRenderer = new Renderer[array[k].weaponMeshCount]; for (int l = 0; l < array[k].weaponMeshCount; l++) { array[k].weaponRenderer[l] = componentsInChildren[l].GetComponent <Renderer> (); } geo.geoAttach(array[k].weapon_geo, array[k].gameObject, ModelFactory.GetDefaultWeaponBoneIdForCharacterWhenUseAsEnemy(text)); } int num3 = 0; using (IEnumerator enumerator = array[k].gameObject.transform.GetEnumerator()) { while (enumerator.MoveNext()) { if (((Transform)enumerator.Current).name.Contains("mesh")) { num3++; } } } array[k].meshIsRendering = new bool[num3]; for (int m = 0; m < num3; m++) { array[k].meshIsRendering[m] = true; } array[k].meshCount = num3; array[k].animation = array[k].gameObject.GetComponent <Animation> (); array[k].animation = array[k].gameObject.GetComponent <Animation> (); array[k].typeNo = typeNo; array[k].idleAnimationName = this.animationName[k]; } } }
public static void InitEnemyData(FF9StateBattleSystem btlsys) { BTL_DATA btl_DATA = (BTL_DATA)null; ObjList objList = new ObjList(); if (!FF9StateSystem.Battle.isDebug) { objList = PersistenSingleton <EventEngine> .Instance.GetActiveObjList().next; } Int32 monCount = (Int32)FF9StateSystem.Battle.FF9Battle.btl_scene.PatAddr[(Int32)FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum].MonCount; Int32 i = 0; Int32 j = 4; while (i < monCount) { ENEMY enemy = btlsys.enemy[i]; BTL_DATA btl_DATA2 = btlsys.btl_data[j]; enemy.info.die_fade_rate = 32; if ((btl_DATA2.dms_geo_id = BTL_SCENE.GetMonGeoID(i)) < 0) { enemy.info.slave = 1; } else { btl_init.SetBattleModel(btl_DATA2); enemy.info.slave = 0; if (!FF9StateSystem.Battle.isDebug) { objList = objList.next; } } btl_DATA2.btl_id = (UInt16)(16 << i); btl_DATA2.bi.player = 0; btl_DATA2.bi.slot_no = (Byte)i; btl_DATA2.bi.line_no = (Byte)(4 + i); btl_DATA2.bi.t_gauge = 0; btl_DATA2.bi.slave = enemy.info.slave; BTL_SCENE btl_scene = FF9StateSystem.Battle.FF9Battle.btl_scene; SB2_PATTERN sb2_PATTERN = btl_scene.PatAddr[(Int32)FF9StateSystem.Battle.FF9Battle.btl_scene.PatNum]; SB2_MON_PARM sb2_MON_PARM = btl_scene.MonAddr[(Int32)sb2_PATTERN.Put[i].TypeNo]; UInt16 geoID = sb2_MON_PARM.Geo; btl_DATA2.height = 0; btl_DATA2.radius = 0; FF9Char ff9char = new FF9Char(); btl_init.InitBattleData(btl_DATA2, ff9char); btl_DATA2.bi.def_idle = 0; btl_DATA2.base_pos = enemy.base_pos; String path = (btl_DATA2.dms_geo_id == -1) ? String.Empty : FF9BattleDB.GEO.GetValue((Int32)btl_DATA2.dms_geo_id); if (!ModelFactory.IsUseAsEnemyCharacter(path)) { btl_DATA2.weapon_geo = (GameObject)null; } btl_DATA2.sa = btl_init.enemy_dummy_sa; FF9BattleDBHeightAndRadius.TryFindHeightAndRadius(geoID, ref btl_DATA2.height, ref btl_DATA2.radius); if (btl_DATA != null) { btl_DATA.next = btl_DATA2; } btl_DATA = btl_DATA2; i++; j++; } while (j < 8) { btlsys.btl_data[j].btl_id = 0; j++; } btl_DATA.next = (BTL_DATA)null; btlsys.btl_list.next = btlsys.btl_data[4]; btlsys.btl_load_status = (Byte)(btlsys.btl_load_status | 8); btl_init.SetupBattleEnemy(); btlseq.InitSequencer(); }
public void ReadBattleScene(String name) { name = "EVT_BATTLE_" + name; this.header = new SB2_HEAD(); TextAsset textAsset = AssetManager.Load <TextAsset>("BattleMap/BattleScene/" + name + "/dbfile0000.raw16", false); Byte[] bytes = textAsset.bytes; using (BinaryReader binaryReader = new BinaryReader(new MemoryStream(bytes))) { this.header.Ver = binaryReader.ReadByte(); this.header.PatCount = binaryReader.ReadByte(); this.header.TypCount = binaryReader.ReadByte(); this.header.AtkCount = binaryReader.ReadByte(); this.header.Flags = binaryReader.ReadUInt16(); this.PatAddr = new SB2_PATTERN[(Int32)this.header.PatCount]; this.MonAddr = new SB2_MON_PARM[(Int32)this.header.TypCount]; this.atk = new AA_DATA[(Int32)this.header.AtkCount]; binaryReader.BaseStream.Seek(8L, SeekOrigin.Begin); for (Int32 i = 0; i < (Int32)this.header.PatCount; i++) { SB2_PATTERN sb2_PATTERN = this.PatAddr[i] = new SB2_PATTERN(); sb2_PATTERN.Rate = binaryReader.ReadByte(); sb2_PATTERN.MonCount = binaryReader.ReadByte(); sb2_PATTERN.Camera = binaryReader.ReadByte(); sb2_PATTERN.Pad0 = binaryReader.ReadByte(); sb2_PATTERN.AP = binaryReader.ReadUInt32(); for (Int32 j = 0; j < 4; j++) { SB2_PUT sb2_PUT = sb2_PATTERN.Put[j] = new SB2_PUT(); sb2_PUT.TypeNo = binaryReader.ReadByte(); sb2_PUT.Flags = binaryReader.ReadByte(); sb2_PUT.Pease = binaryReader.ReadByte(); sb2_PUT.Pad = binaryReader.ReadByte(); sb2_PUT.Xpos = binaryReader.ReadInt16(); sb2_PUT.Ypos = binaryReader.ReadInt16(); sb2_PUT.Zpos = binaryReader.ReadInt16(); sb2_PUT.Rot = binaryReader.ReadInt16(); } } binaryReader.BaseStream.Seek((Int64)(8 + 56 * this.header.PatCount), SeekOrigin.Begin); for (Int32 k = 0; k < (Int32)this.header.TypCount; k++) { SB2_MON_PARM sb2_MON_PARM = this.MonAddr[k] = new SB2_MON_PARM(); for (Int32 l = 0; l < 3; l++) { sb2_MON_PARM.Status[l] = (BattleStatus)binaryReader.ReadUInt32(); } sb2_MON_PARM.MaxHP = binaryReader.ReadUInt16(); sb2_MON_PARM.MaxMP = binaryReader.ReadUInt16(); sb2_MON_PARM.WinGil = binaryReader.ReadUInt16(); sb2_MON_PARM.WinExp = binaryReader.ReadUInt16(); for (Int32 m = 0; m < 4; m++) { sb2_MON_PARM.WinItems[m] = binaryReader.ReadByte(); } for (Int32 n = 0; n < 4; n++) { sb2_MON_PARM.StealItems[n] = binaryReader.ReadByte(); } sb2_MON_PARM.Radius = binaryReader.ReadUInt16(); sb2_MON_PARM.Geo = binaryReader.ReadUInt16(); for (Int32 num = 0; num < 6; num++) { sb2_MON_PARM.Mot[num] = binaryReader.ReadUInt16(); } for (Int32 num2 = 0; num2 < 2; num2++) { sb2_MON_PARM.Mesh[num2] = binaryReader.ReadUInt16(); } sb2_MON_PARM.Flags = binaryReader.ReadUInt16(); sb2_MON_PARM.AP = binaryReader.ReadUInt16(); SB2_ELEMENT sb2_ELEMENT = sb2_MON_PARM.Element = new SB2_ELEMENT(); sb2_ELEMENT.dex = binaryReader.ReadByte(); sb2_ELEMENT.str = binaryReader.ReadByte(); sb2_ELEMENT.mgc = binaryReader.ReadByte(); sb2_ELEMENT.wpr = binaryReader.ReadByte(); sb2_ELEMENT.pad = binaryReader.ReadByte(); sb2_ELEMENT.trans = binaryReader.ReadByte(); sb2_ELEMENT.cur_capa = binaryReader.ReadByte(); sb2_ELEMENT.max_capa = binaryReader.ReadByte(); for (Int32 num3 = 0; num3 < 4; num3++) { sb2_MON_PARM.Attr[num3] = binaryReader.ReadByte(); } sb2_MON_PARM.Level = binaryReader.ReadByte(); sb2_MON_PARM.Category = binaryReader.ReadByte(); sb2_MON_PARM.HitRate = binaryReader.ReadByte(); sb2_MON_PARM.P_DP = binaryReader.ReadByte(); sb2_MON_PARM.P_AV = binaryReader.ReadByte(); sb2_MON_PARM.M_DP = binaryReader.ReadByte(); sb2_MON_PARM.M_AV = binaryReader.ReadByte(); sb2_MON_PARM.Blue = binaryReader.ReadByte(); for (Int32 num4 = 0; num4 < 4; num4++) { sb2_MON_PARM.Bone[num4] = binaryReader.ReadByte(); } sb2_MON_PARM.DieSfx = binaryReader.ReadUInt16(); sb2_MON_PARM.Konran = binaryReader.ReadByte(); sb2_MON_PARM.MesCnt = binaryReader.ReadByte(); for (Int32 num5 = 0; num5 < 6; num5++) { sb2_MON_PARM.IconBone[num5] = binaryReader.ReadByte(); } for (Int32 num6 = 0; num6 < 6; num6++) { sb2_MON_PARM.IconY[num6] = binaryReader.ReadSByte(); } for (Int32 num7 = 0; num7 < 6; num7++) { sb2_MON_PARM.IconZ[num7] = binaryReader.ReadSByte(); } sb2_MON_PARM.StartSfx = binaryReader.ReadUInt16(); sb2_MON_PARM.ShadowX = binaryReader.ReadUInt16(); sb2_MON_PARM.ShadowZ = binaryReader.ReadUInt16(); sb2_MON_PARM.ShadowBone = binaryReader.ReadByte(); sb2_MON_PARM.Card = binaryReader.ReadByte(); sb2_MON_PARM.ShadowOfsX = binaryReader.ReadInt16(); sb2_MON_PARM.ShadowOfsZ = binaryReader.ReadInt16(); sb2_MON_PARM.ShadowBone2 = binaryReader.ReadByte(); sb2_MON_PARM.Pad0 = binaryReader.ReadByte(); sb2_MON_PARM.Pad1 = binaryReader.ReadUInt16(); sb2_MON_PARM.Pad2 = binaryReader.ReadUInt16(); } binaryReader.BaseStream.Seek((Int64)(8 + 56 * this.header.PatCount + 116 * this.header.TypCount), SeekOrigin.Begin); for (Int32 num8 = 0; num8 < (Int32)this.header.AtkCount; num8++) { AA_DATA aa_DATA = this.atk[num8] = new AA_DATA(); BattleCommandInfo cmd_INFO = aa_DATA.Info = new BattleCommandInfo(); UInt32 input = binaryReader.ReadUInt32(); Byte b = 0; cmd_INFO.Target = (TargetType)BitUtil.ReadBits(input, ref b, 4); cmd_INFO.DefaultAlly = BitUtil.ReadBits(input, ref b, 1) != 0; cmd_INFO.DisplayStats = (TargetDisplay)BitUtil.ReadBits(input, ref b, 3); cmd_INFO.VfxIndex = (Int16)BitUtil.ReadBits(input, ref b, 9); /*cmd_INFO.sfx_no = (Int16)*/ BitUtil.ReadBits(input, ref b, 12); cmd_INFO.ForDead = BitUtil.ReadBits(input, ref b, 1) != 0; cmd_INFO.DefaultCamera = BitUtil.ReadBits(input, ref b, 1) != 0; cmd_INFO.DefaultOnDead = BitUtil.ReadBits(input, ref b, 1) != 0; BTL_REF btl_REF = aa_DATA.Ref = new BTL_REF(); btl_REF.ScriptId = binaryReader.ReadByte(); btl_REF.Power = binaryReader.ReadByte(); btl_REF.Elements = binaryReader.ReadByte(); btl_REF.Rate = binaryReader.ReadByte(); aa_DATA.Category = binaryReader.ReadByte(); aa_DATA.AddNo = binaryReader.ReadByte(); aa_DATA.MP = binaryReader.ReadByte(); aa_DATA.Type = binaryReader.ReadByte(); aa_DATA.Vfx2 = binaryReader.ReadUInt16(); aa_DATA.Name = binaryReader.ReadUInt16().ToString(); } } }