Advertisement
Guest User

Lecture map

a guest
Feb 14th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.30 KB | None | 0 0
  1. // Methods
  2. internal void Init(BigEndianReader Reader, int MapVersion)
  3. {
  4. this.Floor = (Reader.ReadByte() * 10);
  5. if (this.Floor == -1280)
  6. return;
  7.  
  8. if (MapVersion >= 9)
  9. {
  10. tmpbytesv9 = Reader.ReadInt16();
  11.  
  12. Mov = (tmpbytesv9 & 1) == 0;
  13. NonWalkableDuringFight = (tmpbytesv9 & 2) != 0;
  14. NonWalkableDuringRP = (tmpbytesv9 & 4) != 0;
  15. Los = (tmpbytesv9 & 8) == 0;
  16. Blue = (tmpbytesv9 & 16) != 0;
  17. Red = (tmpbytesv9 & 32) != 0;
  18. Visible = (tmpbytesv9 & 64) != 0;
  19. FarmCell = (tmpbytesv9 & 128) != 0;
  20.  
  21. if (MapVersion >= 10)
  22. {
  23. HavenbagCell = (tmpbytesv9 & 256) != 0;
  24. TopArrow = (tmpbytesv9 & 512) != 0;
  25. BottomArrow = (tmpbytesv9 & 1024) != 0;
  26. RightArrow = (tmpbytesv9 & 2048) != 0;
  27. LeftArrow = (tmpbytesv9 & 4096) != 0;
  28. }
  29. else
  30. {
  31. TopArrow = (tmpbytesv9 & 256) != 0;
  32. BottomArrow = (tmpbytesv9 & 512) != 0;
  33. RightArrow = (tmpbytesv9 & 1024) != 0;
  34. LeftArrow = (tmpbytesv9 & 2048) != 0;
  35. }
  36. }
  37. else
  38. {
  39. LosMov = Reader.ReadSByte();
  40.  
  41. this.Los = (LosMov & 2) >> 1 == 1;
  42. this.Mov = (LosMov & 1) == 1;
  43. this.Visible = (LosMov & 64) >> 6 == 1;
  44. this.FarmCell = ((LosMov & 32) >> 5) == 1;
  45. this.Blue = (LosMov & 16) >> 4 == 1;
  46. this.Red = (LosMov & 8) >> 3 == 1;
  47. this.NonWalkableDuringRP = (LosMov & 128) >> 7 == 1;
  48. this.NonWalkableDuringFight = (LosMov & 4) >> 2 == 1;
  49. }
  50. this.Speed = Reader.ReadByte();
  51. this.MapChangeData = Reader.ReadByte();
  52. if (MapVersion > 5)
  53. {
  54. this.MoveZone = Reader.ReadByte();
  55. }
  56. if (MapVersion == 8)
  57. {
  58. tmp = Reader.ReadByte();
  59. Arrow = 15 & tmp;
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement