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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. AddLifeOrClairaudience = 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. Robot = 4
  52. TechOtaku = 5
  53. class TrickerType(Enum):
  54. NullTrickerType = 0
  55. Assassin = 1
  56. Klee = 2
  57. ANoisyPerson = 3
  58. class StudentBuffType(Enum):
  59. NullStudentBuffType = 0
  60. AddSpeed = 1
  61. AddLife = 2
  62. Shield = 3
  63. Invisible = 4
  64. class TrickerBuffType(Enum):
  65. NullTrickerBuffType = 0
  66. AddSpeed = 1
  67. Spear = 2
  68. AddAp = 3
  69. Clairaudience = 4
  70. Invisible = 5
  71. class PlayerState(Enum):
  72. NullState = 0
  73. Idle = 1
  74. Learning = 2
  75. Addicted = 3
  76. Quit = 4
  77. Graduated = 5
  78. Treated = 6
  79. Rescued = 7
  80. Stunned = 8
  81. Treating = 9
  82. Rescuing = 10
  83. Swinging = 11
  84. Attacking = 12
  85. Locking = 13
  86. Rummaging = 14
  87. Climbing = 15
  88. OpeningAChest = 16
  89. UsingSpecialSkill = 17
  90. OpeningAGate = 18
  91. class MessageOfObj(Enum):
  92. NullMessageOfObj = 0
  93. StudentMessage = 1
  94. TrickerMessage = 2
  95. PropMessage = 3
  96. BulletMessage = 4
  97. BombedBulletMessage = 5
  98. ClassroomMessage = 6
  99. GateMessage = 7
  100. ChestMessage = 8
  101. DoorMessage = 9
  102. MapMessage = 10
  103. NewsMessage = 11
  104. HiddenGateMessage = 12
  105. class HiddenGateState(Enum):
  106. Null = 0
  107. Refreshed = 1
  108. Opened = 2
  109. class Player:
  110. x: int
  111. y: int
  112. speed: int
  113. viewRange: int
  114. playerID: int
  115. guid: int
  116. radius: int
  117. score: int
  118. facingDirection: float
  119. timeUntilSkillAvailable: List[float] = []
  120. playerType: PlayerType
  121. prop: List[PropType] = []
  122. place: PlaceType
  123. bulletType: BulletType
  124. playerState: PlayerState
  125. class Student(Player):
  126. studentType: StudentType
  127. determination: int
  128. addiction: int
  129. treatProgress: int
  130. rescueProgress: int
  131. learningSpeed: int
  132. treatSpeed: int
  133. dangerAlert: float
  134. buff: List[StudentBuffType] = []
  135. class Tricker(Player):
  136. trickerType: TrickerType
  137. trickDesire: float
  138. classVolume: float
  139. buff: List[TrickerBuffType] = []
  140. class Prop:
  141. x: int
  142. y: int
  143. guid: int
  144. type: PropType
  145. place: PlaceType
  146. facingDirection: float
  147. class Bullet:
  148. bulletType: BulletType
  149. x: int
  150. y: int
  151. facingDirection: float
  152. guid: int
  153. team: PlayerType
  154. place: PlaceType
  155. bombRange: float
  156. speed: int
  157. class BombedBullet:
  158. bulletType: BulletType
  159. x: int
  160. y: int
  161. facingDirection: float
  162. mappingID: int
  163. bombRange: float
  164. class GameMap:
  165. classroomState: Dict[tuple[int, int], int] = {}
  166. gateState: Dict[tuple[int, int], int] = {}
  167. chestState: Dict[tuple[int, int], int] = {}
  168. doorState: Dict[tuple[int, int], bool] = {}
  169. doorProgress: Dict[tuple[int, int], int] = {}
  170. hiddenGateState: Dict[tuple[int, int], HiddenGateState] = {}
  171. class GameInfo:
  172. gameTime: int
  173. subjectFinished: int
  174. studentGraduated: int
  175. studentQuited: int
  176. studentScore: int
  177. trickerScore: int