You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

structures.py 3.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. from enum import Enum
  2. from typing import List, Dict, Tuple
  3. class GameState(Enum):
  4. NullGameState = 0
  5. GameStart = 1
  6. GameRunning = 2
  7. GameEnd = 3
  8. class PlaceType(Enum):
  9. NullPlaceType = 0
  10. Land = 1
  11. Wall = 2
  12. Grass = 3
  13. ClassRoom = 4
  14. Gate = 5
  15. HiddenGate = 6
  16. Window = 7
  17. Door3 = 8
  18. Door5 = 9
  19. Door6 = 10
  20. Chest = 11
  21. class ShapeType(Enum):
  22. NullShapeType = 0
  23. Square = 1
  24. Circle = 2
  25. class PlayerType(Enum):
  26. NullPlayerType = 0
  27. StudentPlayer = 1
  28. TrickerPlayer = 2
  29. class PropType(Enum):
  30. NullPropType = 0
  31. Key3 = 1
  32. Key5 = 2
  33. Key6 = 3
  34. AddSpeed = 4
  35. AddLifeOrAp = 5
  36. AddHpOrAp = 6
  37. ShieldOrSpear = 7
  38. RecoveryFromDizziness = 8
  39. class BulletType(Enum):
  40. NullBulletType = 0
  41. FlyingKnife = 1
  42. CommonAttackOfTricker = 2
  43. BombBomb = 3
  44. JumpyDumpty = 4
  45. AtomBomb = 5
  46. class StudentType(Enum):
  47. NullStudentType = 0
  48. Athlete = 1
  49. Teacher = 2
  50. StraightAStudent = 3
  51. class TrickerType(Enum):
  52. NullTrickerType = 0
  53. Assassin = 1
  54. Klee = 2
  55. ANoisyPerson = 3
  56. class StudentBuffType(Enum):
  57. NullStudentBuffType = 0
  58. AddSpeed = 1
  59. AddLife = 2
  60. Shield = 3
  61. Invisible = 4
  62. class TrickerBuffType(Enum):
  63. NullTrickerBuffType = 0
  64. AddSpeed = 1
  65. Spear = 2
  66. AddAp = 3
  67. Clairaudience = 4
  68. Invisible = 5
  69. class PlayerState(Enum):
  70. NullState = 0
  71. Idle = 1
  72. Learning = 2
  73. Addicted = 3
  74. Quit = 4
  75. Graduated = 5
  76. Treated = 6
  77. Rescued = 7
  78. Stunned = 8
  79. Treating = 9
  80. Rescuing = 10
  81. Swinging = 11
  82. Attacking = 12
  83. Locking = 13
  84. Rummaging = 14
  85. Climbing = 15
  86. OpeningAChest = 16
  87. UsingSpecialSkill = 17
  88. OpeningAGate = 18
  89. class MessageOfObj(Enum):
  90. NullMessageOfObj = 0
  91. StudentMessage = 1
  92. TrickerMessage = 2
  93. PropMessage = 3
  94. BulletMessage = 4
  95. BombedBulletMessage = 5
  96. ClassroomMessage = 6
  97. GateMessage = 7
  98. ChestMessage = 8
  99. DoorMessage = 9
  100. MapMessage = 10
  101. NewsMessage = 11
  102. HiddenGateMessage = 12
  103. class HiddenGateState(Enum):
  104. Null = 0
  105. Refreshed = 1
  106. Opened = 2
  107. class Player:
  108. x: int
  109. y: int
  110. speed: int
  111. viewRange: int
  112. playerID: int
  113. guid: int
  114. radius: int
  115. score: int
  116. facingDirection: float
  117. timeUntilSkillAvailable: List[float] = []
  118. playerType: PlayerType
  119. prop: List[PropType] = []
  120. place: PlaceType
  121. bulletType: BulletType
  122. playerState: PlayerState
  123. class Student(Player):
  124. studentType: StudentType
  125. determination: int
  126. addiction: int
  127. treatProgress: int
  128. rescueProgress: int
  129. learningSpeed: int
  130. treatSpeed: int
  131. dangerAlert: float
  132. buff: List[StudentBuffType] = []
  133. class Tricker(Player):
  134. trickerType: TrickerType
  135. trickDesire: float
  136. classVolume: float
  137. buff: List[TrickerBuffType] = []
  138. class Prop:
  139. x: int
  140. y: int
  141. guid: int
  142. type: PropType
  143. place: PlaceType
  144. facingDirection: float
  145. class Bullet:
  146. bulletType: BulletType
  147. x: int
  148. y: int
  149. facingDirection: float
  150. guid: int
  151. team: PlayerType
  152. place: PlaceType
  153. bombRange: float
  154. speed: int
  155. class BombedBullet:
  156. bulletType: BulletType
  157. x: int
  158. y: int
  159. facingDirection: float
  160. mappingID: int
  161. bombRange: float
  162. class GameMap:
  163. classroomState: Dict[tuple[int, int], int] = {}
  164. gateState: Dict[tuple[int, int], int] = {}
  165. chestState: Dict[tuple[int, int], int] = {}
  166. doorState: Dict[tuple[int, int], bool] = {}
  167. doorProgress: Dict[tuple[int, int], int] = {}
  168. hiddenGateState: Dict[tuple[int, int], HiddenGateState] = {}
  169. class GameInfo:
  170. gameTime: int
  171. subjectFinished: int
  172. studentGraduated: int
  173. studentQuited: int
  174. studentScore: int
  175. trickerScore: int