Kernel_bin.Battle_Items.cs 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. using System.IO;
  2. namespace FF8
  3. {
  4. public partial class Kernel_bin
  5. {
  6. /// <summary>
  7. /// Renzokuken Finishers Data
  8. /// </summary>
  9. /// <see cref="https://github.com/alexfilth/doomtrain/wiki/Renzokuken-finishers"/>
  10. public class Battle_Items_Data
  11. {
  12. public const int id = 7;
  13. public const int count = 33;
  14. public override string ToString() => Name;
  15. public FF8String Name { get; private set; }
  16. //0x0000 2 bytes Offset to item name
  17. public FF8String Description { get; private set; }
  18. //0x0002 2 bytes Offset to item description
  19. public Magic_ID MagicID;
  20. //0x0004 2 bytes Magic ID
  21. public Attack_Type Attack_Type;
  22. //0x0006 1 byte Attack type
  23. public byte Attack_Power;
  24. //0x0007 1 byte Attack power
  25. public byte Unknown0;
  26. //0x0008 1 byte Unknown
  27. public Target Target;
  28. //0x0009 1 byte Target info
  29. public byte Unknown1;
  30. //0x000A 1 byte Unknown
  31. public Attack_Flags Attack_Flags;
  32. //0x000B 1 byte Attack flags
  33. public byte Unknown2;
  34. //0x000C 1 bytes Unknown
  35. public byte Status_Attack;
  36. //0x000D 1 byte Status Attack Enabler
  37. public Statuses0 Statuses0;
  38. //0x000E 2 bytes status_0; //statuses 0-7
  39. public Statuses1 Statuses1;
  40. //0x0010 4 bytes status_1; //statuses 8-39
  41. public byte Attack_Param;
  42. //0x0014 1 byte Attack Param
  43. public byte Unknown3;
  44. //0x0015 1 byte Unknown
  45. public byte Hit_Count;
  46. //0x0016 1 bytes Hit Count
  47. public Element Element;
  48. //0x0017 1 bytes Element
  49. public void Read(BinaryReader br, int i)
  50. {
  51. br.BaseStream.Seek(4, SeekOrigin.Current);
  52. Name = Memory.Strings.Read(Strings.FileID.KERNEL, id, i * 2);
  53. //0x0000 2 bytes Offset to item name
  54. Description = Memory.Strings.Read(Strings.FileID.KERNEL, id, i * 2 + 1);
  55. //0x0002 2 bytes Offset to item description
  56. MagicID = (Magic_ID)br.ReadUInt16();
  57. //0x0004 2 bytes Magic ID
  58. Attack_Type = (Attack_Type)br.ReadByte();
  59. //0x0006 1 byte Attack type
  60. Attack_Power = br.ReadByte();
  61. //0x0007 1 byte Attack power
  62. Unknown0 = br.ReadByte();
  63. //0x0008 1 byte Unknown
  64. Target = (Target)br.ReadByte();
  65. //0x0009 1 byte Target info
  66. Unknown1 = br.ReadByte();
  67. //0x000A 1 byte Unknown
  68. Attack_Flags = (Attack_Flags)br.ReadByte();
  69. //0x000B 1 byte Attack flags
  70. Unknown2 = br.ReadByte();
  71. //0x000C 1 bytes Unknown
  72. Status_Attack = br.ReadByte();
  73. //0x000D 1 byte Status Attack Enabler
  74. Statuses0 = (Statuses0)br.ReadUInt16();
  75. //0x000E 2 bytes status_0; //statuses 0-7
  76. Statuses1 = (Statuses1)br.ReadUInt32();
  77. //0x0010 4 bytes status_1; //statuses 8-39
  78. Attack_Param = br.ReadByte();
  79. //0x0014 1 byte Attack Param
  80. Unknown3 = br.ReadByte();
  81. //0x0015 1 byte Unknown
  82. Hit_Count = br.ReadByte();
  83. //0x0016 1 bytes Hit Count
  84. Element = (Element)br.ReadByte();
  85. //0x0017 1 bytes Element
  86. }
  87. public static Battle_Items_Data[] Read(BinaryReader br)
  88. {
  89. Battle_Items_Data[] ret = new Battle_Items_Data[count];
  90. for (int i = 0; i < count; i++)
  91. {
  92. Battle_Items_Data tmp = new Battle_Items_Data();
  93. tmp.Read(br, i);
  94. ret[i] = tmp;
  95. }
  96. return ret;
  97. }
  98. }
  99. }
  100. }