captainbattle 1.0.6 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (314) hide show
  1. package/dist/core/CallID.d.ts +121 -105
  2. package/dist/core/CallID.js +128 -105
  3. package/dist/core/ListenID.d.ts +503 -443
  4. package/dist/core/ListenID.js +513 -443
  5. package/dist/core/config/AccessoriesDrawCfg.d.ts +9 -0
  6. package/dist/core/config/AccessoriesDrawCfg.js +8 -0
  7. package/dist/core/config/BadgeCfg.d.ts +76 -19
  8. package/dist/core/config/BadgeCfg.js +76 -19
  9. package/dist/core/config/BountyTaskCfg.d.ts +1 -1
  10. package/dist/core/config/BuffCfg.d.ts +3 -0
  11. package/dist/core/config/BuffCfg.js +3 -0
  12. package/dist/core/config/Cfg.d.ts +224 -120
  13. package/dist/core/config/Cfg.js +251 -121
  14. package/dist/core/config/ChatChannelCfg.d.ts +8 -2
  15. package/dist/core/config/ChatChannelCfg.js +7 -1
  16. package/dist/core/config/ChatEmojiCfg.d.ts +0 -2
  17. package/dist/core/config/Const.d.ts +3 -1
  18. package/dist/core/config/Const.js +2 -0
  19. package/dist/core/config/DailyTrialMapCfg.d.ts +1 -2
  20. package/dist/core/config/EmailCfg.d.ts +13 -1
  21. package/dist/core/config/EmailCfg.js +13 -1
  22. package/dist/core/config/FirstRechargeCfg.d.ts +1 -0
  23. package/dist/core/config/FuncDescCfg.d.ts +33 -3
  24. package/dist/core/config/FuncDescCfg.js +33 -3
  25. package/dist/core/config/FusionLevelCfg.d.ts +10 -0
  26. package/dist/core/config/FusionLevelCfg.js +8 -0
  27. package/dist/core/config/GuildBonusLogCfg.d.ts +8 -0
  28. package/dist/core/config/GuildBonusLogCfg.js +8 -0
  29. package/dist/core/config/GuildBossRankRewardCfg.d.ts +2 -1
  30. package/dist/core/config/GuildConfigCfg.d.ts +1 -1
  31. package/dist/core/config/GuildConfigCfg.js +1 -1
  32. package/dist/core/config/GuildDonateCfg.d.ts +4 -2
  33. package/dist/core/config/GuildIslandBuildCfg.d.ts +16 -0
  34. package/dist/core/config/GuildIslandBuildCfg.js +8 -0
  35. package/dist/core/config/GuildIslandBuildItemCfg.d.ts +11 -0
  36. package/dist/core/config/GuildIslandBuildItemCfg.js +8 -0
  37. package/dist/core/config/GuildIslandConfigCfg.d.ts +19 -0
  38. package/dist/core/config/GuildIslandConfigCfg.js +16 -0
  39. package/dist/core/config/GuildIslandIslandCfg.d.ts +9 -0
  40. package/dist/core/config/GuildIslandIslandCfg.js +8 -0
  41. package/dist/core/config/GuildIslandRankCfg.d.ts +11 -0
  42. package/dist/core/config/GuildIslandRankCfg.js +8 -0
  43. package/dist/core/config/GuildIslandZoneCfg.d.ts +11 -0
  44. package/dist/core/config/GuildIslandZoneCfg.js +8 -0
  45. package/dist/core/config/GuildLogCfg.d.ts +1 -0
  46. package/dist/core/config/GuildLvCfg.d.ts +1 -1
  47. package/dist/core/config/InviteConfigCfg.d.ts +14 -0
  48. package/dist/core/config/InviteConfigCfg.js +11 -0
  49. package/dist/core/config/InviteRewardCfg.d.ts +9 -0
  50. package/dist/core/config/InviteRewardCfg.js +8 -0
  51. package/dist/core/config/ItemsCfg.d.ts +5 -1
  52. package/dist/core/config/ItemsCfg.js +4 -0
  53. package/dist/core/config/MarqueeContentCfg.d.ts +7 -0
  54. package/dist/core/config/MarqueeContentCfg.js +7 -1
  55. package/dist/core/config/ModAffixLvCfg.d.ts +12 -0
  56. package/dist/core/config/ModAffixLvCfg.js +8 -0
  57. package/dist/core/config/PetCfg.d.ts +0 -2
  58. package/dist/core/config/PetConfigCfg.d.ts +19 -0
  59. package/dist/core/config/PetConfigCfg.js +16 -0
  60. package/dist/core/config/PetDrawCfg.d.ts +9 -0
  61. package/dist/core/config/PetDrawCfg.js +8 -0
  62. package/dist/core/config/PetSkillCfg.d.ts +2 -1
  63. package/dist/core/config/PrivilegeCfg.d.ts +2 -0
  64. package/dist/core/config/PrivilegeCfg.js +2 -0
  65. package/dist/core/config/ProDefineCfg.d.ts +2 -0
  66. package/dist/core/config/QualityCfg.d.ts +1 -0
  67. package/dist/core/config/RelicDungeonConfigCfg.d.ts +14 -4
  68. package/dist/core/config/RelicDungeonConfigCfg.js +14 -4
  69. package/dist/core/config/RelicDungeonGrowCfg.d.ts +7 -0
  70. package/dist/core/config/RelicDungeonGrowCfg.js +8 -0
  71. package/dist/core/config/RelicDungeonLevelCfg.d.ts +4 -10
  72. package/dist/core/config/RelicDungeonRankRewardCfg.d.ts +9 -0
  73. package/dist/core/config/RelicDungeonRankRewardCfg.js +8 -0
  74. package/dist/core/config/RelicDungeonScoreCfg.d.ts +11 -0
  75. package/dist/core/config/RelicDungeonScoreCfg.js +8 -0
  76. package/dist/core/config/RelicDungeonScoreRewardCfg.d.ts +9 -0
  77. package/dist/core/config/RelicDungeonScoreRewardCfg.js +8 -0
  78. package/dist/core/config/RelicTiesCfg.d.ts +1 -0
  79. package/dist/core/config/RobotConfigCfg.d.ts +17 -0
  80. package/dist/core/config/RobotConfigCfg.js +8 -0
  81. package/dist/core/config/RoleCfg.d.ts +1 -0
  82. package/dist/core/config/RuleDescCfg.d.ts +12 -2
  83. package/dist/core/config/RuleDescCfg.js +12 -2
  84. package/dist/core/config/SeaArenaConfigCfg.d.ts +22 -0
  85. package/dist/core/config/SeaArenaConfigCfg.js +19 -0
  86. package/dist/core/config/SeaArenaRankRewardCfg.d.ts +10 -0
  87. package/dist/core/config/SeaArenaRankRewardCfg.js +8 -0
  88. package/dist/core/config/SeaArenaRobotCfg.d.ts +8 -0
  89. package/dist/core/config/SeaArenaRobotCfg.js +8 -0
  90. package/dist/core/config/SeaArenaTierCfg.d.ts +13 -0
  91. package/dist/core/config/SeaArenaTierCfg.js +8 -0
  92. package/dist/core/config/ShopCfg.d.ts +1 -0
  93. package/dist/core/config/SkillLvCfg.d.ts +10 -0
  94. package/dist/core/config/SkillLvCfg.js +8 -0
  95. package/dist/core/config/SkinSkillCfg.d.ts +2 -1
  96. package/dist/core/config/SprintActivityConfigCfg.d.ts +18 -3
  97. package/dist/core/config/SprintActivityConfigCfg.js +18 -3
  98. package/dist/core/config/StageCfg.d.ts +2 -0
  99. package/dist/core/config/TConfig.d.ts +1 -1
  100. package/dist/core/config/TConfig.js +6 -4
  101. package/dist/core/config/TalentTreeLvCfg.d.ts +1 -1
  102. package/dist/core/config/TurretFusionLevelCfg.d.ts +10 -0
  103. package/dist/core/config/TurretFusionLevelCfg.js +8 -0
  104. package/dist/core/config/TurretModAffixLvCfg.d.ts +12 -0
  105. package/dist/core/config/TurretModAffixLvCfg.js +8 -0
  106. package/dist/core/config/TurretModCfg.d.ts +20 -0
  107. package/dist/core/config/TurretModCfg.js +8 -0
  108. package/dist/core/config/TurretModConfigCfg.d.ts +20 -0
  109. package/dist/core/config/TurretModConfigCfg.js +17 -0
  110. package/dist/core/config/TurretModQualityCfg.d.ts +12 -0
  111. package/dist/core/config/TurretModQualityCfg.js +8 -0
  112. package/dist/core/config/TurretSkillLvCfg.d.ts +10 -0
  113. package/dist/core/config/TurretSkillLvCfg.js +8 -0
  114. package/dist/core/config/VehicleWashAffixCfg.d.ts +14 -0
  115. package/dist/core/config/VehicleWashAffixCfg.js +8 -0
  116. package/dist/core/config/VehicleWashLevelCfg.d.ts +6 -2
  117. package/dist/core/framework/Pool.d.ts +4 -1
  118. package/dist/core/framework/Pool.js +19 -21
  119. package/dist/core/framework/Time.js +13 -3
  120. package/dist/core/framework/Watcher.js +0 -1
  121. package/dist/core/framework/collections/MinSortList.d.ts +0 -2
  122. package/dist/core/framework/collections/MinSortList.js +9 -33
  123. package/dist/core/framework/collections/ObjectPool.js +6 -3
  124. package/dist/core/framework/notify/Notifier.d.ts +1 -1
  125. package/dist/core/framework/notify/Notifier.js +5 -4
  126. package/dist/core/framework/notify/NotifyID.d.ts +2 -1
  127. package/dist/core/framework/notify/NotifyID.js +1 -0
  128. package/dist/core/framework/notify/NotifyListener.js +35 -9
  129. package/dist/core/module/arena/ArenaBattleModule.d.ts +7 -0
  130. package/dist/core/module/arena/ArenaBattleModule.js +32 -0
  131. package/dist/core/module/arena/index.d.ts +1 -0
  132. package/dist/core/module/arena/index.js +13 -0
  133. package/dist/core/module/battle/Game.d.ts +104 -13
  134. package/dist/core/module/battle/Game.js +218 -45
  135. package/dist/core/module/battle/IGameModule.d.ts +6 -0
  136. package/dist/core/module/battle/IGameModule.js +19 -6
  137. package/dist/core/module/battle/battle.interface.d.ts +31 -7
  138. package/dist/core/module/battle/battle.interface.js +5 -1
  139. package/dist/core/module/battle/buff/BuffMgr.d.ts +25 -0
  140. package/dist/core/module/battle/buff/BuffMgr.js +43 -0
  141. package/dist/core/module/battle/buff/BuffTrigger.js +9 -1
  142. package/dist/core/module/battle/buff/buffitem/AddPhysicDamBuff.js +2 -2
  143. package/dist/core/module/battle/buff/buffitem/ChangeSetpAddDamageBuff.js +3 -2
  144. package/dist/core/module/battle/buff/buffitem/DeltaUseSkillBuff.js +3 -2
  145. package/dist/core/module/battle/buff/buffitem/DiceAddCritBuff.d.ts +8 -0
  146. package/dist/core/module/battle/buff/buffitem/DiceAddCritBuff.js +35 -0
  147. package/dist/core/module/battle/buff/buffitem/FireHurtLayerBuff.d.ts +7 -0
  148. package/dist/core/module/battle/buff/buffitem/FireHurtLayerBuff.js +28 -0
  149. package/dist/core/module/battle/buff/buffitem/ForceTargetBuff.js +2 -1
  150. package/dist/core/module/battle/buff/buffitem/HitBoundAddDamageBuff.js +1 -1
  151. package/dist/core/module/battle/buff/buffitem/HitBoundAddScaleBuff.d.ts +11 -0
  152. package/dist/core/module/battle/buff/buffitem/HitBoundAddScaleBuff.js +79 -0
  153. package/dist/core/module/battle/buff/buffitem/LinkCurseBuff.js +3 -2
  154. package/dist/core/module/battle/buff/buffitem/MonitorBuff.js +10 -12
  155. package/dist/core/module/battle/buff/buffitem/PosionBanCureBuff.d.ts +3 -0
  156. package/dist/core/module/battle/buff/buffitem/PosionBanCureBuff.js +18 -0
  157. package/dist/core/module/battle/buff/buffitem/PosionBuff.d.ts +1 -0
  158. package/dist/core/module/battle/buff/buffitem/PosionBuff.js +15 -4
  159. package/dist/core/module/battle/buff/buffitem/ProjectileOrbLinkBuff.js +1 -1
  160. package/dist/core/module/battle/buff/buffitem/ProjectileScaleUpBuff.js +4 -2
  161. package/dist/core/module/battle/buff/buffitem/SameHitAddDamageBuff.js +8 -0
  162. package/dist/core/module/battle/buff/buffitem/SlayBuff.js +1 -1
  163. package/dist/core/module/battle/buff/buffitem/TimeAddDamageBuff.d.ts +1 -1
  164. package/dist/core/module/battle/buff/buffitem/TimeAddDamageBuff.js +36 -27
  165. package/dist/core/module/battle/buff/buffitem/index.d.ts +4 -0
  166. package/dist/core/module/battle/buff/buffitem/index.js +5 -1
  167. package/dist/core/module/battle/entity/BaseEntityData.d.ts +15 -1
  168. package/dist/core/module/battle/entity/BaseEntityData.js +27 -0
  169. package/dist/core/module/battle/entity/DragonBodyData.d.ts +19 -1
  170. package/dist/core/module/battle/entity/DragonBodyData.js +34 -0
  171. package/dist/core/module/battle/entity/DragonData.d.ts +18 -1
  172. package/dist/core/module/battle/entity/DragonData.js +32 -0
  173. package/dist/core/module/battle/entity/EntityPool.d.ts +1 -2
  174. package/dist/core/module/battle/entity/EntityPool.js +9 -18
  175. package/dist/core/module/battle/entity/FighterData.d.ts +114 -3
  176. package/dist/core/module/battle/entity/FighterData.js +350 -6
  177. package/dist/core/module/battle/entity/ProjectileData.d.ts +2 -0
  178. package/dist/core/module/battle/entity/ProjectileData.js +25 -0
  179. package/dist/core/module/battle/entity/RoleData.d.ts +12 -1
  180. package/dist/core/module/battle/entity/RoleData.js +19 -0
  181. package/dist/core/module/battle/entity/TurnUnit.d.ts +36 -0
  182. package/dist/core/module/battle/entity/TurnUnit.js +74 -0
  183. package/dist/core/module/battle/entity/index.d.ts +1 -1
  184. package/dist/core/module/battle/entity/index.js +1 -1
  185. package/dist/core/module/battle/event/EntityEvent.d.ts +13 -0
  186. package/dist/core/module/battle/event/EntityEvent.js +14 -0
  187. package/dist/core/module/battle/event/EntityEventBus.d.ts +10 -0
  188. package/dist/core/module/battle/event/EntityEventBus.js +35 -0
  189. package/dist/core/module/battle/event/EventListener.d.ts +6 -1
  190. package/dist/core/module/battle/event/EventListener.js +140 -7
  191. package/dist/core/module/battle/event/GameEvent.d.ts +8 -0
  192. package/dist/core/module/battle/event/GameEvent.js +9 -0
  193. package/dist/core/module/battle/factory/FighterFactory.js +26 -10
  194. package/dist/core/module/battle/fsm-state/AnyFighterStateTransitions.js +24 -12
  195. package/dist/core/module/battle/fsm-state/AnyFighterStates.js +9 -5
  196. package/dist/core/module/battle/fsm-state/Boss18110CallState.d.ts +1 -1
  197. package/dist/core/module/battle/fsm-state/Boss18110State.d.ts +1 -1
  198. package/dist/core/module/battle/fsm-state/FighterStateMachine.d.ts +2 -0
  199. package/dist/core/module/battle/fsm-state/FighterStateMachine.js +6 -0
  200. package/dist/core/module/battle/fsm-state/FighterStateProfiles.d.ts +8 -1
  201. package/dist/core/module/battle/fsm-state/FighterStateProfiles.js +31 -0
  202. package/dist/core/module/battle/fsm-state/FighterStateRegistry.d.ts +3 -0
  203. package/dist/core/module/battle/fsm-state/FighterStateRegistry.js +27 -8
  204. package/dist/core/module/battle/fsm-state/FighterStateShared.js +2 -2
  205. package/dist/core/module/battle/fsm-state/FighterStateType.d.ts +2 -1
  206. package/dist/core/module/battle/fsm-state/FighterStateType.js +2 -1
  207. package/dist/core/module/battle/fsm-state/TurnState.d.ts +29 -0
  208. package/dist/core/module/battle/fsm-state/TurnState.js +208 -0
  209. package/dist/core/module/battle/fsm-state/TurnTransitions.d.ts +36 -0
  210. package/dist/core/module/battle/fsm-state/TurnTransitions.js +90 -0
  211. package/dist/core/module/battle/fsm-state/index.d.ts +2 -0
  212. package/dist/core/module/battle/fsm-state/index.js +3 -1
  213. package/dist/core/module/battle/manager/EntityManager.d.ts +1 -0
  214. package/dist/core/module/battle/manager/EntityManager.js +138 -20
  215. package/dist/core/module/battle/skill/SkillData.d.ts +27 -0
  216. package/dist/core/module/battle/skill/SkillData.js +43 -0
  217. package/dist/core/module/battle/skill/emitter/SkillEmitter.js +4 -1
  218. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter1.d.ts +3 -0
  219. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter1.js +30 -2
  220. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter10.js +2 -2
  221. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter13.d.ts +1 -0
  222. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter13.js +25 -2
  223. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter15.js +1 -1
  224. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter2.js +1 -1
  225. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter23.d.ts +9 -0
  226. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter23.js +75 -11
  227. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter24.js +1 -1
  228. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter26.js +4 -0
  229. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter28.js +1 -1
  230. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter3.d.ts +14 -8
  231. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter3.js +127 -31
  232. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter30.d.ts +36 -0
  233. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter30.js +235 -0
  234. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter31.d.ts +13 -0
  235. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter31.js +47 -0
  236. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter4.d.ts +1 -0
  237. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter4.js +25 -2
  238. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter6.js +10 -6
  239. package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter8.js +2 -2
  240. package/dist/core/module/battle/skill/emitter/projectiles/index.d.ts +2 -0
  241. package/dist/core/module/battle/skill/emitter/projectiles/index.js +3 -1
  242. package/dist/core/module/battle/skill/impacts/Impact1.js +2 -0
  243. package/dist/core/module/battle/skill/impacts/Impact10.js +1 -1
  244. package/dist/core/module/battle/skill/impacts/Impact100.d.ts +13 -0
  245. package/dist/core/module/battle/skill/impacts/Impact100.js +61 -0
  246. package/dist/core/module/battle/skill/impacts/Impact101.d.ts +13 -0
  247. package/dist/core/module/battle/skill/impacts/Impact101.js +49 -0
  248. package/dist/core/module/battle/skill/impacts/Impact17.d.ts +1 -1
  249. package/dist/core/module/battle/skill/impacts/Impact18.d.ts +1 -1
  250. package/dist/core/module/battle/skill/impacts/Impact19.d.ts +13 -0
  251. package/dist/core/module/battle/skill/impacts/Impact19.js +31 -0
  252. package/dist/core/module/battle/skill/impacts/Impact2.js +1 -1
  253. package/dist/core/module/battle/skill/impacts/Impact3.js +6 -5
  254. package/dist/core/module/battle/skill/impacts/index.d.ts +3 -0
  255. package/dist/core/module/battle/skill/impacts/index.js +4 -1
  256. package/dist/core/module/battle/skill/pool/SkillEmitterPool.js +11 -6
  257. package/dist/core/module/battle/system/BornSystem.js +2 -2
  258. package/dist/core/module/battle/system/BuffSystem.d.ts +8 -5
  259. package/dist/core/module/battle/system/BuffSystem.js +47 -22
  260. package/dist/core/module/battle/system/CollisionSystem.d.ts +4 -0
  261. package/dist/core/module/battle/system/CollisionSystem.js +31 -22
  262. package/dist/core/module/battle/system/DestroySystem.d.ts +6 -0
  263. package/dist/core/module/battle/system/DestroySystem.js +61 -20
  264. package/dist/core/module/battle/system/InputSystem.d.ts +3 -1
  265. package/dist/core/module/battle/system/InputSystem.js +15 -4
  266. package/dist/core/module/battle/system/ProjectileSystem.d.ts +1 -0
  267. package/dist/core/module/battle/system/ProjectileSystem.js +49 -29
  268. package/dist/core/module/battle/system/SkillSystem.d.ts +3 -1
  269. package/dist/core/module/battle/system/SkillSystem.js +55 -25
  270. package/dist/core/module/battle/system/TurnPhaseSystem.d.ts +52 -0
  271. package/dist/core/module/battle/system/TurnPhaseSystem.js +189 -0
  272. package/dist/core/module/battle/system/TurnSchedulerSystem.d.ts +51 -0
  273. package/dist/core/module/battle/system/TurnSchedulerSystem.js +363 -0
  274. package/dist/core/module/battle/target/CloseAngleTargetSelection.js +30 -10
  275. package/dist/core/module/battle/target/CloseDownTargetSelection.js +64 -17
  276. package/dist/core/module/battle/target/CloseTargetSelection.js +22 -5
  277. package/dist/core/module/battle/target/RandomRangeTargetSelection.js +8 -8
  278. package/dist/core/module/battle/target/SelfRandomTargetSelection.js +2 -0
  279. package/dist/core/module/battle/target/SelfRandomTowerTargetSelection.js +0 -1
  280. package/dist/core/module/battle/turn/TurnBattleGame.d.ts +85 -0
  281. package/dist/core/module/battle/turn/TurnBattleGame.js +453 -0
  282. package/dist/core/module/battle/turn/TurnBattleModule.d.ts +14 -0
  283. package/dist/core/module/battle/turn/TurnBattleModule.js +65 -0
  284. package/dist/core/module/battle/turn/TurnBattleTypes.d.ts +25 -0
  285. package/dist/core/module/battle/turn/TurnBattleTypes.js +15 -0
  286. package/dist/core/module/battle/util/BattleInputCodec.d.ts +2 -3
  287. package/dist/core/module/battle/util/BattleInputCodec.js +14 -3
  288. package/dist/core/module/battle/util/BattleUtils.d.ts +21 -1
  289. package/dist/core/module/battle/util/BattleUtils.js +217 -41
  290. package/dist/core/module/battle/util/EllipseArc.d.ts +2 -0
  291. package/dist/core/module/battle/util/EllipseArc.js +43 -0
  292. package/dist/core/module/battle/util/HitDataPool.js +3 -1
  293. package/dist/core/module/battle/util/Random.js +13 -4
  294. package/dist/core/module/dailyTrial/DailyTrialBattleModule.d.ts +11 -0
  295. package/dist/core/module/dailyTrial/DailyTrialBattleModule.js +103 -0
  296. package/dist/core/module/dailyTrial/index.d.ts +1 -0
  297. package/dist/core/module/dailyTrial/index.js +13 -0
  298. package/dist/core/module/guild/view/boss/GuildBossBattleModule.d.ts +2 -1
  299. package/dist/core/module/guild/view/boss/GuildBossBattleModule.js +12 -2
  300. package/dist/core/module/module.interface.d.ts +1 -0
  301. package/dist/core/module/property/Property.d.ts +22 -3
  302. package/dist/core/module/property/Property.js +43 -5
  303. package/dist/core/module/property/PropertyUtil.d.ts +17 -2
  304. package/dist/core/module/property/PropertyUtil.js +67 -7
  305. package/dist/core/module/relicDungeon/RelicBattleModule.d.ts +5 -0
  306. package/dist/core/module/relicDungeon/RelicBattleModule.js +26 -2
  307. package/dist/core/module/stage/StageBattleModule.js +1 -0
  308. package/dist/core/proto/CommonProto.d.ts +24671 -14643
  309. package/dist/core/proto/Proto.d.ts +289 -77
  310. package/dist/index.d.ts +39 -3
  311. package/dist/index.js +220 -13
  312. package/dist/register-all.d.ts +2 -0
  313. package/dist/register-all.js +2 -0
  314. package/package.json +1 -1
@@ -22,13 +22,27 @@ export declare class BattleUtils {
22
22
  * @param seed
23
23
  */
24
24
  static getBornInfoByWavesId(lvModeId: number, type: number, seed: number): any[];
25
- static parseBattleInfoById(roleId: number, oid: number, playerData: PlayerProto.IBattlePlayer): IFighterInfo;
25
+ /**
26
+ * 解析战斗单位
27
+ * @param roleId 角色id
28
+ * @param playerData 战斗数据
29
+ */
30
+ static parseBattleInfoById(roleId: number, playerData: PlayerProto.IBattlePlayer): IFighterInfo;
31
+ /**
32
+ * 解析PVP战斗单位信息
33
+ * @param roleId 角色id
34
+ * @param playerData 战斗数据
35
+ */
36
+ static parsePVPBattleInfoById(roleId: number, playerData: PlayerProto.IBattlePlayer): IFighterInfo;
26
37
  private static handleGemSkill;
27
38
  private static handleRelicSkill;
28
39
  private static handleSkinSkill;
29
40
  private static handleSkinId;
41
+ private static handleVehicleId;
30
42
  private static handleEquipSkill;
31
43
  private static handleWeaponSkinId;
44
+ private static handleVehicleSkill;
45
+ private static handlePetSkill;
32
46
  static clampf(value: number, min: number, max: number): number;
33
47
  /**
34
48
  * 冒泡排序
@@ -36,6 +50,12 @@ export declare class BattleUtils {
36
50
  */
37
51
  static bubbleSort<T>(arr: T[], compare: (a: T, b: T) => boolean, needForAll?: boolean): boolean;
38
52
  static GetAngleByDir(x: any, y: any): number;
53
+ /**
54
+ * 保序移除 [index, index + count) 区间的元素,返回被移除的第一个元素。
55
+ * 语义与 list.splice(index, count) 逐项一致(负下标从尾部数、越界按 splice 规则裁剪),
56
+ * 但它不会为"被移除的元素"新建一个返回数组 —— 热路径(每帧/每次命中)删数组元素一律走这里。
57
+ */
58
+ static removeAt<T>(list: T[], index: number, count?: number): T;
39
59
  static isBackHitByDot(entityCenter: BVec2Like, entityForward: BVec2Like, projectileCenter: BVec2Like, threshold?: number): boolean;
40
60
  static limitAtkDir(entity: FighterData, attackAngle: number): void;
41
61
  static isInAtkAimAngle(entity: FighterData, target: FighterData, angle: number): boolean;
@@ -12,6 +12,7 @@ const Const_1 = require("../../../config/Const");
12
12
  const Notifier_1 = require("../../../framework/notify/Notifier");
13
13
  const BattlePlayerUtil_1 = __importDefault(require("../../../util/BattlePlayerUtil"));
14
14
  const PropertyUtil_1 = __importDefault(require("../../property/PropertyUtil"));
15
+ const battle_interface_1 = require("../battle.interface");
15
16
  const BVec2_1 = require("./BVec2");
16
17
  const JMath_1 = __importDefault(require("./JMath"));
17
18
  const Random_1 = __importDefault(require("./Random"));
@@ -94,15 +95,16 @@ class BattleUtils {
94
95
  }
95
96
  return bronInfo;
96
97
  }
97
- // 解析战斗单位
98
- // @param roleId 角色id
99
- // @param oid 单位id
100
- // @param playerData 战斗数据
101
- static parseBattleInfoById(roleId, oid, playerData) {
102
- let property = playerData ? PropertyUtil_1.default.getFightPropertyByBattlePlayer(roleId, playerData) : Notifier_1.Notifier.call(CallID_1.CallID.Property_Get, roleId);
98
+ /**
99
+ * 解析战斗单位
100
+ * @param roleId 角色id
101
+ * @param playerData 战斗数据
102
+ */
103
+ static parseBattleInfoById(roleId, playerData) {
104
+ let property = PropertyUtil_1.default.getFightPropertyByBattlePlayer(roleId, playerData);
103
105
  let roleCfg = Cfg_1.Cfg.Role.get(roleId);
104
106
  let data = {
105
- oid,
107
+ oid: 0,
106
108
  id: roleId,
107
109
  property,
108
110
  skills: [],
@@ -115,6 +117,7 @@ class BattleUtils {
115
117
  y: 0,
116
118
  fashionId: 0,
117
119
  weaponFashionId: 0,
120
+ vehicleId: 0,
118
121
  };
119
122
  if (roleCfg.normalSkillId) {
120
123
  data.skills.push(...roleCfg.normalSkillId);
@@ -127,19 +130,75 @@ class BattleUtils {
127
130
  this.handleSkinSkill(data, playerData);
128
131
  //处理皮肤id
129
132
  this.handleSkinId(data, playerData);
130
- if (roleCfg.type === 1) {
133
+ //处理宠物技能
134
+ this.handlePetSkill(data, playerData);
135
+ if (roleCfg.type === battle_interface_1.SubEntityType.ROLE) {
131
136
  //装备技能
132
137
  this.handleEquipSkill(data, playerData);
133
138
  //武器皮肤
134
139
  this.handleWeaponSkinId(data, playerData);
140
+ //载具技能
141
+ this.handleVehicleSkill(data, playerData);
135
142
  }
136
- else if (roleCfg.type === 2) {
143
+ else if (roleCfg.type === battle_interface_1.SubEntityType.TOWER) {
137
144
  //炮塔技能
138
145
  let info = playerData ? playerData.turretMap[roleId] : Notifier_1.Notifier.call(CallID_1.CallID.Turret_GetInfoById, roleId);
139
146
  if (info) {
140
147
  data.level = info.lv;
141
148
  }
142
149
  }
150
+ else if (roleCfg.type === battle_interface_1.SubEntityType.PET) {
151
+ }
152
+ return data;
153
+ }
154
+ /**
155
+ * 解析PVP战斗单位信息
156
+ * @param roleId 角色id
157
+ * @param playerData 战斗数据
158
+ */
159
+ static parsePVPBattleInfoById(roleId, playerData) {
160
+ let property = PropertyUtil_1.default.getFightPropertyByBattlePlayer(roleId, playerData, null, true, true);
161
+ let roleCfg = Cfg_1.Cfg.Role.get(roleId);
162
+ let data = {
163
+ oid: 0,
164
+ id: roleId,
165
+ property,
166
+ skills: [],
167
+ waitCallSkills: [],
168
+ waitToBorn: [],
169
+ waitToLearn: [],
170
+ scale: roleCfg.scale || 1,
171
+ level: 1,
172
+ x: 0,
173
+ y: 0,
174
+ fashionId: 0,
175
+ weaponFashionId: 0,
176
+ comboSkillId: 0,
177
+ counterSkillId: 0,
178
+ vehicleId: 0,
179
+ };
180
+ //处理宠物技能
181
+ this.handlePetSkill(data, playerData, true);
182
+ if (roleCfg.type === battle_interface_1.SubEntityType.ROLE) {
183
+ //普攻技能
184
+ data.skills.push(10020000);
185
+ data.skills.push(10020031); //通用被动
186
+ data.collision = [0, 100, 60];
187
+ //装备技能,连击反击
188
+ this.handleEquipSkill(data, playerData, true);
189
+ //处理皮肤id
190
+ this.handleSkinId(data, playerData);
191
+ //处理皮肤技能
192
+ this.handleSkinSkill(data, playerData);
193
+ //武器皮肤
194
+ this.handleWeaponSkinId(data, playerData);
195
+ //处理载体id
196
+ this.handleVehicleId(data, playerData);
197
+ //载具技能
198
+ this.handleVehicleSkill(data, playerData, true);
199
+ }
200
+ else if (roleCfg.type === battle_interface_1.SubEntityType.PET) {
201
+ }
143
202
  return data;
144
203
  }
145
204
  static handleGemSkill(data, playerData) {
@@ -168,15 +227,14 @@ class BattleUtils {
168
227
  }
169
228
  }
170
229
  }
171
- else {
172
- let gemIds = Notifier_1.Notifier.call(CallID_1.CallID.Gem_GetEquippedGems);
173
- if (!gemIds || !gemIds.length)
174
- return;
230
+ /* else {
231
+ let gemIds = Notifier.call(CallID.Gem_GetEquippedGems);
232
+ if (!gemIds || !gemIds.length) return;
175
233
  for (let i = 0; i < gemIds.length; i++) {
176
234
  let gemId = gemIds[i];
177
- let gemCfg = Cfg_1.Cfg.Gem.get(gemId);
235
+ let gemCfg = Cfg.Gem.get(gemId);
178
236
  if (gemCfg && gemCfg.coreSkill) {
179
- let skillCfg = Cfg_1.Cfg.Skill.get(gemCfg.coreSkill);
237
+ let skillCfg = Cfg.Skill.get(gemCfg.coreSkill);
180
238
  if (skillCfg?.belong === roleId) {
181
239
  let type = skillCfg.impactType[0];
182
240
  if (type !== 1 || skillCfg.impactType.indexOf(roleId, 1) >= 1) {
@@ -189,7 +247,7 @@ class BattleUtils {
189
247
  }
190
248
  }
191
249
  }
192
- }
250
+ }*/
193
251
  }
194
252
  static handleRelicSkill(data, playerData) {
195
253
  let roleId = data.id;
@@ -222,27 +280,25 @@ class BattleUtils {
222
280
  }
223
281
  }
224
282
  }
225
- else {
226
- let relic = Notifier_1.Notifier.call(CallID_1.CallID.Relic_GetEquipMap);
283
+ /* else {
284
+ let relic = Notifier.call(CallID.Relic_GetEquipMap) as RelicProto.IRelic[];
227
285
  if (relic && relic.length) {
228
286
  for (let i = 0; i < relic.length; i++) {
229
287
  let entrys = relic[i].randomEntryList;
230
288
  if (entrys && entrys.length) {
231
289
  for (let j = 0; j < entrys.length; j++) {
232
290
  const entryInfo = entrys[j];
233
- const entryCfg = Cfg_1.Cfg.RelicEntry.get(entryInfo.id);
291
+ const entryCfg = Cfg.RelicEntry.get(entryInfo.id);
234
292
  if (entryCfg.skillId) {
235
- let skillCfg = Cfg_1.Cfg.Skill.get(entryCfg.skillId);
293
+ let skillCfg = Cfg.Skill.get(entryCfg.skillId);
236
294
  if (skillCfg.belong === roleId) {
237
295
  data.skills.push(entryCfg.skillId);
238
- }
239
- else if (!skillCfg.belong) {
296
+ } else if (!skillCfg.belong) {
240
297
  let impactTypes = skillCfg.impactType || [];
241
298
  let impactType = impactTypes[0] || 0;
242
299
  if (impactType === 1 && impactTypes.indexOf(roleId, 1) >= 1) {
243
300
  data.skills.push(entryCfg.skillId);
244
- }
245
- else if (impactType == 4) {
301
+ } else if (impactType == 4) {
246
302
  data.skills.push(entryCfg.skillId);
247
303
  }
248
304
  }
@@ -251,7 +307,7 @@ class BattleUtils {
251
307
  }
252
308
  }
253
309
  }
254
- }
310
+ }*/
255
311
  }
256
312
  static handleSkinSkill(data, playerData) {
257
313
  let roleId = data.id;
@@ -261,10 +317,10 @@ class BattleUtils {
261
317
  skinMap = BattlePlayerUtil_1.default.getAllSkinMap(playerData.skinMap);
262
318
  slotInfo = playerData.skinSlotMap;
263
319
  }
264
- else {
265
- skinMap = Notifier_1.Notifier.call(CallID_1.CallID.Skin_GetAllSkinMap);
266
- slotInfo = Notifier_1.Notifier.call(CallID_1.CallID.Skin_GetAllSlotInfo);
267
- }
320
+ /* else {
321
+ skinMap = Notifier.call(CallID.Skin_GetAllSkinMap) as { [key: number]: { id: number, star: number } };
322
+ slotInfo = Notifier.call(CallID.Skin_GetAllSlotInfo) as { [key: number]: SkinProto.ISlotInfo };
323
+ }*/
268
324
  if (!slotInfo)
269
325
  return;
270
326
  for (let key in slotInfo) {
@@ -288,7 +344,7 @@ class BattleUtils {
288
344
  for (let j = skillList.length - 1; j >= 0; j--) {
289
345
  let skinCfg = skillList[j];
290
346
  if (skinCfg.level <= star) {
291
- skills.push(...skinCfg.skill);
347
+ skills.push(...skinCfg.skillPve);
292
348
  break;
293
349
  }
294
350
  }
@@ -319,9 +375,9 @@ class BattleUtils {
319
375
  let skinId = playerData.equipSkinMap[roleId];
320
376
  hasSkin = Cfg_1.Cfg.Skin.get(skinId);
321
377
  }
322
- else {
323
- hasSkin = Notifier_1.Notifier.call(CallID_1.CallID.Skin_GetEquipSkin, roleId);
324
- }
378
+ /* else {
379
+ hasSkin = Notifier.call(CallID.Skin_GetEquipSkin, roleId) as SkinCfg;
380
+ }*/
325
381
  if (hasSkin) {
326
382
  let isMax = false;
327
383
  if (playerData) {
@@ -337,9 +393,27 @@ class BattleUtils {
337
393
  data.fashionId = hasSkin.id * 10 + (isMax ? 1 : 0);
338
394
  }
339
395
  }
340
- static handleEquipSkill(data, playerData) {
396
+ static handleVehicleId(data, playerData) {
397
+ if (playerData) {
398
+ let roleId = Const_1.Const.vehicleRoleId;
399
+ if (playerData && playerData.equipSkinMap[roleId]) {
400
+ let skinId = playerData.equipSkinMap[roleId];
401
+ const hasSkin = Cfg_1.Cfg.Skin.get(skinId);
402
+ let isMax = false;
403
+ let star = playerData.skinMap[hasSkin.id];
404
+ let lvCfg = Cfg_1.Cfg.SkinLv.filter({ skinId: hasSkin.id });
405
+ if (lvCfg && lvCfg.length) {
406
+ isMax = lvCfg[lvCfg.length - 1].level == star;
407
+ }
408
+ data.vehicleId = hasSkin.id * 10 + (isMax ? 1 : 0);
409
+ }
410
+ }
411
+ }
412
+ static handleEquipSkill(data, playerData, isPvp = false) {
413
+ if (!playerData)
414
+ return;
341
415
  //装备技能
342
- let equiPart = playerData ? playerData.equipPartMap : Notifier_1.Notifier.call(CallID_1.CallID.Equip_GetParts);
416
+ let equiPart = playerData.equipPartMap;
343
417
  data.equipList = [];
344
418
  for (let key in equiPart) {
345
419
  const part = equiPart[key];
@@ -348,11 +422,35 @@ class BattleUtils {
348
422
  data.equipList[part.partId - 1] = 810000;
349
423
  }
350
424
  let equipCfg = Cfg_1.Cfg.Equip.get(data.equipList[part.partId - 1]);
351
- if (equipCfg && equipCfg.wSkill) {
352
- data.skills.push(...equipCfg.wSkill);
425
+ if (isPvp) {
426
+ if (equipCfg && equipCfg.part === 1) {
427
+ if (equipCfg.type === 101) {
428
+ data.comboSkillId = 10020001;
429
+ data.counterSkillId = 10020004;
430
+ }
431
+ else if (equipCfg.type === 102) {
432
+ data.comboSkillId = 10020002;
433
+ data.counterSkillId = 10020005;
434
+ }
435
+ else if (equipCfg.type === 103) {
436
+ data.comboSkillId = 10020003;
437
+ data.counterSkillId = 10020006;
438
+ }
439
+ if (data.comboSkillId) {
440
+ data.skills.push(data.comboSkillId);
441
+ }
442
+ if (data.counterSkillId) {
443
+ data.skills.push(data.counterSkillId);
444
+ }
445
+ }
353
446
  }
354
- if (equipCfg && equipCfg.qSkill) {
355
- data.skills.push(...equipCfg.qSkill);
447
+ else {
448
+ if (equipCfg && equipCfg.wSkill) {
449
+ data.skills.push(...equipCfg.wSkill);
450
+ }
451
+ if (equipCfg && equipCfg.qSkill) {
452
+ data.skills.push(...equipCfg.qSkill);
453
+ }
356
454
  }
357
455
  }
358
456
  }
@@ -368,7 +466,8 @@ class BattleUtils {
368
466
  hasSkin = Cfg_1.Cfg.Skin.get(skinId);
369
467
  }
370
468
  else {
371
- hasSkin = Notifier_1.Notifier.call(CallID_1.CallID.Skin_GetEquipSkin, weaponType);
469
+ return;
470
+ //hasSkin = Notifier.call(CallID.Skin_GetEquipSkin, weaponType) as SkinCfg;
372
471
  }
373
472
  if (hasSkin) {
374
473
  let isMax = false;
@@ -385,6 +484,62 @@ class BattleUtils {
385
484
  data.weaponFashionId = hasSkin.id * 10 + (isMax ? 1 : 0);
386
485
  }
387
486
  }
487
+ static handleVehicleSkill(data, playerData, isPvp = false) {
488
+ if (!playerData)
489
+ return;
490
+ const vehicleSkillLevel = playerData.purifySkillLevel || 0;
491
+ let washLevelCfg = Cfg_1.Cfg.VehicleWashLevel.get(vehicleSkillLevel);
492
+ if (isPvp) {
493
+ if (washLevelCfg && washLevelCfg.skillPvp) {
494
+ data.skills.push(...washLevelCfg.skillPvp);
495
+ }
496
+ }
497
+ else {
498
+ if (washLevelCfg && washLevelCfg.skillPve) {
499
+ data.skills.push(...washLevelCfg.skillPve);
500
+ }
501
+ }
502
+ }
503
+ static handlePetSkill(data, playerData, isPvp = false) {
504
+ if (!playerData)
505
+ return;
506
+ const roleId = data.id;
507
+ if (playerData.petSlots) {
508
+ for (let key in playerData.petSlots) {
509
+ let slot = playerData.petSlots[key];
510
+ if (slot) {
511
+ const petId = slot.petId;
512
+ const star = playerData.pets[petId]?.star || 1;
513
+ let petSkills = Cfg_1.Cfg.PetSkill.filter({ pet: petId, star });
514
+ if (petSkills && petSkills.length) {
515
+ for (let j = 0; j < petSkills.length; j++) {
516
+ let skills = isPvp ? petSkills[j].skillPvp : petSkills[j].skillPve;
517
+ if (!skills || skills.length === 0)
518
+ continue;
519
+ for (let i = 0; i < skills.length; i++) {
520
+ let skillCfg = Cfg_1.Cfg.Skill.get(skills[i]);
521
+ if (skillCfg) {
522
+ if (skillCfg.belong === roleId) {
523
+ data.skills.push(skillCfg.id);
524
+ }
525
+ else if (!skillCfg.belong) {
526
+ let impactTypes = skillCfg.impactType || [];
527
+ let impactType = impactTypes[0] || 0;
528
+ if (impactType === 1 && impactTypes.indexOf(roleId, 1) >= 1) {
529
+ data.skills.push(skillCfg.id);
530
+ }
531
+ else if (impactType == 4) {
532
+ data.skills.push(skillCfg.id);
533
+ }
534
+ }
535
+ }
536
+ }
537
+ }
538
+ }
539
+ }
540
+ }
541
+ }
542
+ }
388
543
  static clampf(value, min, max) {
389
544
  return Math.max(min, Math.min(max, value));
390
545
  }
@@ -398,7 +553,9 @@ class BattleUtils {
398
553
  let flag = false; // 防止数组已经有序而继续排序
399
554
  for (let j = 0; j < len - i; j++) {
400
555
  if (compare(arr[j], arr[j + 1])) { // 交换两个
401
- [arr[j], arr[j + 1]] = [arr[j + 1], arr[j]];
556
+ const tmp = arr[j];
557
+ arr[j] = arr[j + 1];
558
+ arr[j + 1] = tmp;
402
559
  flag = true;
403
560
  ischange = true;
404
561
  }
@@ -412,6 +569,25 @@ class BattleUtils {
412
569
  static GetAngleByDir(x, y) {
413
570
  return Math.round(JMath_1.default.atan2(y, x) * (180 / Math.PI) + 360) % 360;
414
571
  }
572
+ /**
573
+ * 保序移除 [index, index + count) 区间的元素,返回被移除的第一个元素。
574
+ * 语义与 list.splice(index, count) 逐项一致(负下标从尾部数、越界按 splice 规则裁剪),
575
+ * 但它不会为"被移除的元素"新建一个返回数组 —— 热路径(每帧/每次命中)删数组元素一律走这里。
576
+ */
577
+ static removeAt(list, index, count = 1) {
578
+ const len = list.length;
579
+ const start = index < 0 ? Math.max(len + index, 0) : Math.min(index, len);
580
+ const deleteCount = count > 0 ? Math.min(count, len - start) : 0;
581
+ if (deleteCount <= 0) {
582
+ return undefined;
583
+ }
584
+ const removed = list[start];
585
+ for (let i = start; i + deleteCount < len; i++) {
586
+ list[i] = list[i + deleteCount];
587
+ }
588
+ list.length = len - deleteCount;
589
+ return removed;
590
+ }
415
591
  static isBackHitByDot(entityCenter, entityForward, projectileCenter, threshold = -0.7) {
416
592
  const t = BVec2_1.BVecHelper.pop();
417
593
  BVec2_1.BVecHelper.sub(t, projectileCenter, entityCenter);
@@ -1,3 +1,5 @@
1
1
  export declare function getEllipsePerimeter(semiMajor: number, semiMinor: number): number;
2
+ /** 由参数角求沿椭圆一周的弧长进度,与 getEllipseAngleAtArcProgress 互逆。 */
3
+ export declare function getEllipseArcProgressAtAngle(semiMajor: number, semiMinor: number, angle: number): number;
2
4
  /** Converts travelled perimeter progress to angle for x = b * sin(angle), y = -a * cos(angle). */
3
5
  export declare function getEllipseAngleAtArcProgress(semiMajor: number, semiMinor: number, progress: number): number;
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.getEllipsePerimeter = getEllipsePerimeter;
7
+ exports.getEllipseArcProgressAtAngle = getEllipseArcProgressAtAngle;
7
8
  exports.getEllipseAngleAtArcProgress = getEllipseAngleAtArcProgress;
8
9
  const JMath_1 = __importDefault(require("./JMath"));
9
10
  const EPSILON = 1e-8;
@@ -71,6 +72,48 @@ function getEllipsePerimeter(semiMajor, semiMinor) {
71
72
  return 0;
72
73
  return getArcProfile(semiMajor, semiMinor).quarterArcLength * semiMajor * 4;
73
74
  }
75
+ /** 取第一象限内 [0, π/2] 的弧长(线性插值查表),是 getQuarterAngle 的正向对应。 */
76
+ function getQuarterArcDistance(profile, angle) {
77
+ if (angle <= 0)
78
+ return 0;
79
+ if (angle >= QUARTER_TURN)
80
+ return profile.quarterArcLength;
81
+ const scaled = angle / QUARTER_TURN * ARC_TABLE_SEGMENTS;
82
+ const index = Math.floor(scaled);
83
+ const lengths = profile.cumulativeArcLengths;
84
+ const startLength = lengths[index];
85
+ return startLength + (lengths[index + 1] - startLength) * (scaled - index);
86
+ }
87
+ /** 由参数角求沿椭圆一周的弧长进度,与 getEllipseAngleAtArcProgress 互逆。 */
88
+ function getEllipseArcProgressAtAngle(semiMajor, semiMinor, angle) {
89
+ if (semiMajor <= EPSILON)
90
+ return 0;
91
+ const profile = getArcProfile(semiMajor, semiMinor);
92
+ const quarterArcLength = profile.quarterArcLength;
93
+ const perimeter = quarterArcLength * 4;
94
+ if (perimeter <= EPSILON)
95
+ return 0;
96
+ let normalizedAngle = angle % FULL_TURN;
97
+ if (normalizedAngle < 0)
98
+ normalizedAngle += FULL_TURN;
99
+ const quadrant = Math.floor(normalizedAngle / QUARTER_TURN);
100
+ const localAngle = normalizedAngle - quadrant * QUARTER_TURN;
101
+ // 椭圆各象限弧长相等,用短轴/长轴镜像折算回第一象限
102
+ let arcDistance;
103
+ if (quadrant === 0) {
104
+ arcDistance = getQuarterArcDistance(profile, localAngle);
105
+ }
106
+ else if (quadrant === 1) {
107
+ arcDistance = quarterArcLength * 2 - getQuarterArcDistance(profile, QUARTER_TURN - localAngle);
108
+ }
109
+ else if (quadrant === 2) {
110
+ arcDistance = quarterArcLength * 2 + getQuarterArcDistance(profile, localAngle);
111
+ }
112
+ else {
113
+ arcDistance = perimeter - getQuarterArcDistance(profile, QUARTER_TURN - localAngle);
114
+ }
115
+ return arcDistance / perimeter;
116
+ }
74
117
  /** Converts travelled perimeter progress to angle for x = b * sin(angle), y = -a * cos(angle). */
75
118
  function getEllipseAngleAtArcProgress(semiMajor, semiMinor, progress) {
76
119
  if (progress <= 0)
@@ -74,7 +74,9 @@ class _HitDataPool {
74
74
  this._pool = Pool_1.PoolManager.create(this._poolType, this);
75
75
  }
76
76
  compCreateDelegate(id, spawner) {
77
- return new HitData();
77
+ const hitData = new HitData();
78
+ hitData.spawner = spawner;
79
+ return hitData;
78
80
  }
79
81
  despawn(item) {
80
82
  if (this._pool == null) {
@@ -37,7 +37,10 @@ class Random {
37
37
  return array;
38
38
  for (let i = 0; i < n; i++) {
39
39
  let t = Random.randomIntBySeed(i, len - 1, data);
40
- [array[i], array[t]] = [array[t], array[i]];
40
+ // 解构交换每次都会分配一个 2 元数组,改用临时变量
41
+ const tmp = array[i];
42
+ array[i] = array[t];
43
+ array[t] = tmp;
41
44
  }
42
45
  array.length = n;
43
46
  return array;
@@ -81,7 +84,9 @@ class Random {
81
84
  return array;
82
85
  for (let i = 0; i < n; i++) {
83
86
  let t = this.randomInt(i, len - 1);
84
- [array[i], array[t]] = [array[t], array[i]];
87
+ const tmp = array[i];
88
+ array[i] = array[t];
89
+ array[t] = tmp;
85
90
  }
86
91
  array.length = n;
87
92
  }
@@ -93,7 +98,9 @@ class Random {
93
98
  // 洗牌算法(Fisher-Yates),用种子随机保证跨端一致
94
99
  for (let i = candidates.length - 1; i > 0; i--) {
95
100
  const j = Random.randomIntBySeed(0, i, data);
96
- [candidates[i], candidates[j]] = [candidates[j], candidates[i]];
101
+ const tmp = candidates[i];
102
+ candidates[i] = candidates[j];
103
+ candidates[j] = tmp;
97
104
  }
98
105
  return candidates.slice(0, count);
99
106
  }
@@ -105,7 +112,9 @@ class Random {
105
112
  }
106
113
  for (let i = candidates.length - 1; i > 0; i--) {
107
114
  const j = this.randomInt(0, i);
108
- [candidates[i], candidates[j]] = [candidates[j], candidates[i]];
115
+ const tmp = candidates[i];
116
+ candidates[i] = candidates[j];
117
+ candidates[j] = tmp;
109
118
  }
110
119
  return candidates.slice(0, count);
111
120
  }
@@ -0,0 +1,11 @@
1
+ import { GameModule } from "../battle/IGameModule";
2
+ export default class DailyTrialBattleModule extends GameModule {
3
+ buffs: number[];
4
+ init(): void;
5
+ getMode(): number;
6
+ gameWin(): void;
7
+ gameFail(isCross?: boolean): void;
8
+ gameFinish(isWin: boolean, isCross?: boolean): void;
9
+ onUpdateWaveInfo(curWave: number, allWave: number): void;
10
+ reportStageInfo(): void;
11
+ }