Saves.Worldmap.cs 5.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. using System;
  2. using System.IO;
  3. namespace OpenVIII
  4. {
  5. public static partial class Saves
  6. {
  7. /// <summary>
  8. /// Worldmap vars for savegame
  9. /// </summary>
  10. /// <see cref="https://github.com/myst6re/hyne/blob/master/SaveData.h"/>
  11. public class Worldmap
  12. {
  13. private short[] char_pos;// x z y ? ? rot(0->4095)
  14. private short[] uknown_pos1;
  15. private short[] ragnarok_pos;
  16. private short[] bgu_pos;
  17. private short[] car_pos;
  18. private short[] uknown_pos2;
  19. private short[] uknown_pos3;
  20. private short[] uknown_pos4;
  21. private ushort steps_related;
  22. private byte car_rent;// 0x00:forbidden|0xFF:none|0x51:balamb1|0x52:balamb2|0x57:esthar
  23. private byte[] u1;//u1[6] = deep sea?
  24. private ushort u2;// always 0xFFFF?
  25. private ushort u3;//u3(1] = deep sea?
  26. // Next bytes don't work with french PC version
  27. private byte disp_map_config;// 0:none|1:minisphere|2:minimap
  28. private byte u4;
  29. private ushort car_steps_related;
  30. private ushort car_steps_related2;
  31. private byte vehicles_instructions_worldmap;//voiture|Unused|BGU|Chocobo|Hydre|???|???|Unused
  32. private byte koyok_quest;//04 : Mandy Beach|Winhill|Trabia|Kashkabald Desert|UFO? Battu|80 : Koyo K Battu/Soigné/Mangé
  33. private byte[] obel_quest;
  34. /* [0] => having hummed twice | ??? | Unused | Unused | n ricochets | infinite ricochets | Seen ryo | Seen ryo² ("100x more ricochets than you!")
  35. * [1] => Ryo gave tablet | Unused | Shadow clues to find the idiot | Unused | Unused | Unused | Shadow clue for Eldbeak | Eldbeak found
  36. * [2] => Minde Island Treasure | Mordor's Plain Treasure | Unused | Unused | Unused | Unused | Unused | Unused
  37. * [3] => ??? | Pierre Balamb | Pierre Ryo | Pierre Timber | Pierre Galbadia | All stones | Shade index for Balamb | ???
  38. * [4] => ??? (mordor var?)
  39. * [5] => ??? | ??? | ??? | ??? | Block access Lunatic Pandora | ??? | Block access Lunatic Pandora | ???
  40. * [6] => having spoken in the shade | Accepting to look for the idiot | Having seen the idiot | ...
  41. * [7] => ??? (temp var)
  42. */
  43. private byte[] u6;
  44. public Worldmap()
  45. {
  46. }
  47. public Worldmap(BinaryReader br) => Read(br);
  48. public void Read(BinaryReader br)
  49. {
  50. char_pos = new short[6]; for (int i = 0; i < char_pos.Length; i++) char_pos[i] = br.ReadInt16();// x z y ? ? rot(0->4095)
  51. uknown_pos1 = new short[6]; for (int i = 0; i < uknown_pos1.Length; i++) uknown_pos1[i] = br.ReadInt16();
  52. ragnarok_pos = new short[6]; for (int i = 0; i < ragnarok_pos.Length; i++) ragnarok_pos[i] = br.ReadInt16();
  53. bgu_pos = new short[6]; for (int i = 0; i < bgu_pos.Length; i++) bgu_pos[i] = br.ReadInt16();
  54. car_pos = new short[6]; for (int i = 0; i < car_pos.Length; i++) car_pos[i] = br.ReadInt16();
  55. uknown_pos2 = new short[6]; for (int i = 0; i < uknown_pos2.Length; i++) uknown_pos2[i] = br.ReadInt16();
  56. uknown_pos3 = new short[6]; for (int i = 0; i < uknown_pos3.Length; i++) uknown_pos3[i] = br.ReadInt16();
  57. uknown_pos4 = new short[6]; for (int i = 0; i < uknown_pos4.Length; i++) uknown_pos4[i] = br.ReadInt16();
  58. steps_related = br.ReadUInt16();
  59. car_rent = br.ReadByte();// 0x00:forbidden|0xFF:none|0x51:balamb1|0x52:balamb2|0x57:esthar
  60. u1 = br.ReadBytes(7);//u1[6] = deep sea?
  61. u2 = br.ReadUInt16();// always 0xFFFF?
  62. u3 = br.ReadUInt16();//u3(1] = deep sea?
  63. // Next bytes don't work with french PC version
  64. disp_map_config = br.ReadByte();// 0:none|1:minisphere|2:minimap
  65. u4 = br.ReadByte();
  66. car_steps_related = br.ReadUInt16();
  67. car_steps_related2 = br.ReadUInt16();
  68. vehicles_instructions_worldmap = br.ReadByte();//voiture|Unused|BGU|Chocobo|Hydre|???|???|Unused
  69. koyok_quest = br.ReadByte();//04 : Mandy Beach|Winhill|Trabia|Kashkabald Desert|UFO? Battu|80 : Koyo K Battu/Soigné/Mangé
  70. obel_quest = br.ReadBytes(8);
  71. /* [0] => having hummed twice | ??? | Unused | Unused | n ricochets | infinite ricochets | Seen ryo | Seen ryo² ("100x more ricochets than you!")
  72. * [1] => Ryo gave tablet | Unused | Shadow clues to find the idiot | Unused | Unused | Unused | Shadow clue for Eldbeak | Eldbeak found
  73. * [2] => Minde Island Treasure | Mordor's Plain Treasure | Unused | Unused | Unused | Unused | Unused | Unused
  74. * [3] => ??? | Pierre Balamb | Pierre Ryo | Pierre Timber | Pierre Galbadia | All stones | Shade index for Balamb | ???
  75. * [4] => ??? (mordor var?)
  76. * [5] => ??? | ??? | ??? | ??? | Block access Lunatic Pandora | ??? | Block access Lunatic Pandora | ???
  77. * [6] => having spoken in the shade | Accepting to look for the idiot | Having seen the idiot | ...
  78. * [7] => ??? (temp var)
  79. */
  80. u6 = br.ReadBytes(2);
  81. }
  82. internal Worldmap Clone() => (Worldmap) MemberwiseClone();
  83. }
  84. }
  85. }