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.9 kB

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