Kernel_bin.GF_abilities.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Collections.Generic;
  2. using System.IO;
  3. namespace FF8
  4. {
  5. public partial class Kernel_bin
  6. {
  7. /// <summary>
  8. /// GF Abilities Data
  9. /// </summary>
  10. /// <see cref="https://github.com/alexfilth/doomtrain/wiki/GF-abilities"/>
  11. public class GF_abilities : Equipable_Ability
  12. {
  13. public new const int count = 9;
  14. public new const int id = 16;
  15. public byte Boost { get; private set; }
  16. public Stat Stat { get; private set; }
  17. public byte Value { get; private set; }
  18. public override void Read(BinaryReader br, int i)
  19. {
  20. Icon = Icons.ID.Ability_GF;
  21. Name = Memory.Strings.Read(Strings.FileID.KERNEL, id, i * 2);
  22. //0x0000 2 bytes Offset to name
  23. Description = Memory.Strings.Read(Strings.FileID.KERNEL, id, i * 2 + 1);
  24. //0x0002 2 bytes Offset to description
  25. br.BaseStream.Seek(4, SeekOrigin.Current);
  26. AP = br.ReadByte();
  27. //0x0004 1 byte AP needed to learn the ability
  28. Boost = br.ReadByte();
  29. //0x0005 Enable Boost
  30. Stat = (Stat)br.ReadByte();
  31. //0x0006 1 byte Stat to increase
  32. Value = br.ReadByte();
  33. //0x0007 1 byte Increase value
  34. }
  35. public static Dictionary<Abilities, GF_abilities> Read(BinaryReader br)
  36. {
  37. Dictionary<Abilities, GF_abilities> ret = new Dictionary<Abilities, GF_abilities>(count);
  38. for (int i = 0; i < count; i++)
  39. {
  40. var tmp = new GF_abilities();
  41. tmp.Read(br, i);
  42. ret[(Abilities)(i+(int)Abilities.SumMag_10)] = tmp;
  43. }
  44. return ret;
  45. }
  46. }
  47. }
  48. }