public void WriteEntry(CsvWriter sw) { sw.String(Comment); sw.Int32(Id); BattleCommandInfo cmdInfo = ActionData.Info; BTL_REF btlRef = ActionData.Ref; sw.EnumValue(cmdInfo.DisplayStats); sw.EnumValue(cmdInfo.Target); // target sw.Boolean(cmdInfo.DefaultAlly); sw.Boolean(cmdInfo.ForDead); sw.Boolean(cmdInfo.DefaultOnDead); sw.Boolean(cmdInfo.DefaultCamera); sw.Int16(cmdInfo.VfxIndex); sw.UInt16(ActionData.Vfx2); sw.Byte(btlRef.ScriptId); // scriptId sw.Byte(btlRef.Power); sw.Byte(btlRef.Elements); sw.ByteOrMinusOne(btlRef.Rate); sw.Byte(ActionData.Category); sw.Byte(ActionData.AddNo); sw.Byte(ActionData.MP); sw.Byte(ActionData.Type); }
public void ParseEntry(String[] raw) { Comment = CsvParser.String(raw[0]); Id = CsvParser.Int32(raw[1]); TargetDisplay menuWindow = CsvParser.EnumValue <TargetDisplay>(raw[2]); TargetType targets = CsvParser.EnumValue <TargetType>(raw[3]); Boolean defaultAlly = CsvParser.Boolean(raw[4]); Boolean forDead = CsvParser.Boolean(raw[5]); Boolean defaultOnDead = CsvParser.Boolean(raw[6]); Boolean defaultCamera = CsvParser.Boolean(raw[7]); Int16 animation1 = CsvParser.Int16(raw[8]); UInt16 animation2 = CsvParser.UInt16(raw[9]); Byte scriptId = CsvParser.Byte(raw[10]); Byte power = CsvParser.Byte(raw[11]); Byte elements = CsvParser.Byte(raw[12]); Byte rate = CsvParser.ByteOrMinusOne(raw[13]); Byte category = CsvParser.Byte(raw[14]); Byte statusIndex = CsvParser.Byte(raw[15]); Byte mp = CsvParser.Byte(raw[16]); Byte type = CsvParser.Byte(raw[17]); BattleCommandInfo cmd = new BattleCommandInfo(targets, defaultAlly, menuWindow, animation1, forDead, defaultCamera, defaultOnDead); BTL_REF btl = new BTL_REF(scriptId, power, elements, rate); ActionData = new AA_DATA(cmd, btl, category, statusIndex, mp, type, animation2); }
public AA_DATA(BattleCommandInfo info, BTL_REF @ref, Byte category, Byte statusSetIndex, Byte mp, Byte type, UInt16 vfx2) { Info = info; Ref = @ref; Category = category; AddNo = statusSetIndex; MP = mp; Type = type; Vfx2 = vfx2; }
public ItemActionData(AA_DATA aa) { Info = aa.Info; Ref = aa.Ref; Category = aa.Category; AddNo = aa.AddNo; MP = aa.MP; Type = aa.Type; Vfx2 = aa.Vfx2; Name = aa.Name; }
public void WriteEntry(CsvWriter sw) { sw.String(Comment); sw.Int32(Id); sw.Byte(Category); sw.Byte(StatusIndex); sw.String(ModelName); BTL_REF btl = Ref; sw.Byte(btl.ScriptId); sw.Byte(btl.Power); sw.Byte(btl.Elements); sw.Byte(btl.Rate); sw.Int16(Offset1); sw.Int16(Offset2); }
public void LoadAbility() { AA_DATA original = FF9StateSystem.Battle.FF9Battle.aa_data[Data.sub_no]; CMD_INFO originalInfo = original.Info; CMD_INFO newInfo = new CMD_INFO { cursor = originalInfo.cursor, def_cur = originalInfo.def_cur, sub_win = originalInfo.sub_win, vfx_no = originalInfo.vfx_no, sfx_no = originalInfo.sfx_no, dead = originalInfo.dead, def_cam = originalInfo.def_cam, def_dead = originalInfo.def_dead }; BTL_REF originalRef = original.Ref; BTL_REF newRef = new BTL_REF { prog_no = originalRef.prog_no, power = originalRef.power, attr = originalRef.attr, rate = originalRef.rate }; AA_DATA newData = new AA_DATA { Info = newInfo, Ref = newRef, Category = original.Category, AddNo = original.AddNo, MP = original.MP, Type = original.Type, Vfx2 = original.Vfx2, Name = original.Name }; Data.aa = newData; }
public void LoadAbility() { AA_DATA original = FF9StateSystem.Battle.FF9Battle.aa_data[Data.sub_no]; BattleCommandInfo originalInfo = original.Info; BattleCommandInfo newInfo = new BattleCommandInfo { Target = originalInfo.Target, DefaultAlly = originalInfo.DefaultAlly, DisplayStats = originalInfo.DisplayStats, VfxIndex = originalInfo.VfxIndex, ForDead = originalInfo.ForDead, DefaultCamera = originalInfo.DefaultCamera, DefaultOnDead = originalInfo.DefaultOnDead }; BTL_REF originalRef = original.Ref; BTL_REF newRef = new BTL_REF { ScriptId = originalRef.ScriptId, Power = originalRef.Power, Elements = originalRef.Elements, Rate = originalRef.Rate }; AA_DATA newData = new AA_DATA { Info = newInfo, Ref = newRef, Category = original.Category, AddNo = original.AddNo, MP = original.MP, Type = original.Type, Vfx2 = original.Vfx2, Name = original.Name }; Data.aa = newData; }
public void ParseEntry(String[] raw) { Comment = CsvParser.String(raw[0]); Id = CsvParser.Int32(raw[1]); Category = CsvParser.Byte(raw[2]); StatusIndex = CsvParser.Byte(raw[3]); ModelName = CsvParser.String(raw[4]); if (!String.IsNullOrEmpty(ModelName)) { ModelId = (UInt16)FF9BattleDB.GEO.GetKey(ModelName); } Byte scriptId = CsvParser.Byte(raw[5]); Byte power = CsvParser.Byte(raw[6]); Byte elements = CsvParser.Byte(raw[7]); Byte rate = CsvParser.Byte(raw[8]); Ref = new BTL_REF(scriptId, power, elements, rate); Offset1 = Int16.Parse(raw[9]); Offset2 = Int16.Parse(raw[10]); }
public ItemActionData(ITEM_DATA item) { Info = item.info; Ref = item.Ref; Status = item.status; }
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(); } } }
public ITEM_DATA(BattleCommandInfo info, BTL_REF Ref, UInt32 status) { this.info = info; this.Ref = Ref; this.status = status; }