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
@@ -6,6 +6,13 @@ const battle_interface_1 = require("../battle.interface");
6
6
  const BattleUtils_1 = require("../util/BattleUtils");
7
7
  const BVec2_1 = require("../util/BVec2");
8
8
  const TargetSelection_1 = require("./TargetSelection");
9
+ /**
10
+ * 多目标查询的候选缓存:并行数组分别存目标与距离平方,下标即候选的原有先后顺序。
11
+ * 每次查询为每个候选建 {target, dis} 对象再整体排序,会在高频目标查询里制造大量短命对象,
12
+ * 这里复用数组,取 k 个最近用"逐槽选最小"完成,不需要排序。
13
+ */
14
+ const candTargets = [];
15
+ const candDises = [];
9
16
  class CloseDownTargetSelection {
10
17
  static select(owner, targetTypes, x, y, ignoreList, searchRange, forceSkillId) {
11
18
  let realx = owner.x;
@@ -34,25 +41,65 @@ class CloseDownTargetSelection {
34
41
  if (isAim) {
35
42
  return BattleUtils_1.BattleUtils.getAimAnglePos(owner, minDis, maxDis, angle);
36
43
  }
37
- let targetNum = targetTypes[1] || 1;
44
+ const targetNum = targetTypes[1] || 1;
38
45
  if (targetNum >= 1) {
39
- const waitList = [];
40
- for (let i = 0; i < fighters.length; i++) {
41
- const value = fighters[i];
42
- if (!(0, TargetSelection_1.isEnemyTarget)(owner, value, skillId, maxDis, minDis, ignoreList) || owner.attackTarget === value.ID)
43
- continue;
44
- if (isAim && !BattleUtils_1.BattleUtils.isInAtkAimAngle(owner, value, angle))
45
- continue;
46
- if (value.y >= owner.y)
47
- continue;
48
- waitList.push({ target: value, dis: BVec2_1.BVecHelper.distanceSqr(value, TargetSelection_1.tempTargetVec) });
46
+ if (targetNum === 1) {
47
+ // 只要最近 1 个:单次线性扫描取最小距离,等价于"稳定升序排序后取首元素"
48
+ // (距离并列时取候选顺序靠前者),且全程零中间对象。
49
+ let best = null;
50
+ let bestDis = Number.MAX_VALUE;
51
+ for (let i = 0; i < fighters.length; i++) {
52
+ const value = fighters[i];
53
+ if (!(0, TargetSelection_1.isEnemyTarget)(owner, value, skillId, maxDis, minDis, ignoreList) || owner.attackTarget === value.ID)
54
+ continue;
55
+ if (isAim && !BattleUtils_1.BattleUtils.isInAtkAimAngle(owner, value, angle))
56
+ continue;
57
+ if (value.y >= owner.y)
58
+ continue;
59
+ const dis = BVec2_1.BVecHelper.distanceSqr(value, TargetSelection_1.tempTargetVec);
60
+ if (dis < bestDis) {
61
+ bestDis = dis;
62
+ best = value;
63
+ }
64
+ }
65
+ if (best)
66
+ targets.push(best);
49
67
  }
50
- if (waitList.length > 0)
51
- BattleUtils_1.BattleUtils.bubbleSort(waitList, (a, b) => a.dis > b.dis);
52
- for (let i = 0; i < targetNum; i++) {
53
- const target = waitList[i] && waitList[i].target || targets[0];
54
- if (target)
55
- targets.push(target);
68
+ else {
69
+ candTargets.length = 0;
70
+ candDises.length = 0;
71
+ for (let i = 0; i < fighters.length; i++) {
72
+ const value = fighters[i];
73
+ if (!(0, TargetSelection_1.isEnemyTarget)(owner, value, skillId, maxDis, minDis, ignoreList) || owner.attackTarget === value.ID)
74
+ continue;
75
+ if (isAim && !BattleUtils_1.BattleUtils.isInAtkAimAngle(owner, value, angle))
76
+ continue;
77
+ if (value.y >= owner.y)
78
+ continue;
79
+ candTargets.push(value);
80
+ candDises.push(BVec2_1.BVecHelper.distanceSqr(value, TargetSelection_1.tempTargetVec));
81
+ }
82
+ // 逐槽选最小,等价于稳定升序排序后取前 k 个(并列取候选顺序靠前者)
83
+ const k = Math.min(targetNum, candTargets.length);
84
+ for (let slot = 0; slot < k; slot++) {
85
+ let pick = -1;
86
+ let pickDis = Number.MAX_VALUE;
87
+ for (let i = 0; i < candTargets.length; i++) {
88
+ if (candDises[i] < pickDis) {
89
+ pickDis = candDises[i];
90
+ pick = i;
91
+ }
92
+ }
93
+ targets.push(candTargets[pick]);
94
+ // 选中槽位置为无效距离,避免被重复选中
95
+ candDises[pick] = Number.MAX_VALUE;
96
+ }
97
+ // 候选不足 targetNum 时用最近目标补齐:旧实现如此,行为保持不变
98
+ while (targets.length > 0 && targets.length < targetNum) {
99
+ targets.push(targets[0]);
100
+ }
101
+ candTargets.length = 0;
102
+ candDises.length = 0;
56
103
  }
57
104
  }
58
105
  // if (isAim && targets.length <= 0) return BattleUtils.getAimAnglePos(owner, minDis, maxDis, angle);
@@ -40,19 +40,36 @@ class CloseTargetSelection {
40
40
  targets.push(entity);
41
41
  }
42
42
  if (targetTypes[1] && targetTypes[1] > 1) {
43
- const waitList = [];
43
+ const maxCandidates = Math.ceil(targetTypes[1]);
44
+ const waitTargets = [];
45
+ const waitDistances = [];
44
46
  for (let i = 0; i < fighters.length; i++) {
45
47
  const value = fighters[i];
46
48
  if (!(0, TargetSelection_1.isEnemyTarget)(owner, value, skillId, maxDis, minDis, ignoreList) || owner.attackTarget === value.ID)
47
49
  continue;
48
50
  if (isAim && !BattleUtils_1.BattleUtils.isInAtkAimAngle(owner, value, angle))
49
51
  continue;
50
- waitList.push({ target: value, dis: BVec2_1.BVecHelper.distanceSqr(value, TargetSelection_1.tempTargetVec) });
52
+ const distance = BVec2_1.BVecHelper.distanceSqr(value, TargetSelection_1.tempTargetVec);
53
+ // Keep a stable, bounded nearest-first list; equal distances stay in input order.
54
+ const candidateCount = waitDistances.length;
55
+ let insertIndex = candidateCount;
56
+ while (insertIndex > 0 && waitDistances[insertIndex - 1] > distance)
57
+ insertIndex--;
58
+ if (insertIndex >= maxCandidates)
59
+ continue;
60
+ const lastIndex = Math.min(candidateCount, maxCandidates - 1);
61
+ for (let j = lastIndex; j > insertIndex; j--) {
62
+ waitTargets[j] = waitTargets[j - 1];
63
+ waitDistances[j] = waitDistances[j - 1];
64
+ }
65
+ waitTargets[insertIndex] = value;
66
+ waitDistances[insertIndex] = distance;
67
+ const nextCount = Math.min(candidateCount + 1, maxCandidates);
68
+ waitTargets.length = nextCount;
69
+ waitDistances.length = nextCount;
51
70
  }
52
- if (waitList.length > 0)
53
- BattleUtils_1.BattleUtils.bubbleSort(waitList, (a, b) => a.dis > b.dis);
54
71
  for (let i = 1; i < targetTypes[1]; i++) {
55
- const target = waitList[i] && waitList[i].target || targets[0];
72
+ const target = waitTargets[i] || targets[0];
56
73
  if (target)
57
74
  targets.push(target);
58
75
  }
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RandomRangeTargetSelection = void 0;
4
4
  const battle_interface_1 = require("../battle.interface");
5
- const BattleUtils_1 = require("../util/BattleUtils");
6
5
  const TargetSelection_1 = require("./TargetSelection");
7
6
  class RandomRangeTargetSelection {
8
7
  static select(owner, targetTypes, x, y, ignoreList, searchRange, forceSkillId) {
@@ -17,7 +16,7 @@ class RandomRangeTargetSelection {
17
16
  return [];
18
17
  const center = targets[0];
19
18
  const radiusSqr = rangeRadius * rangeRadius;
20
- const gridRadius = Math.ceil(rangeRadius / minInterval);
19
+ const gridRadius = Math.ceil(2 * rangeRadius / minInterval);
21
20
  const result = [];
22
21
  for (let gridY = -gridRadius; gridY <= gridRadius; gridY++) {
23
22
  const offsetY = gridY * minInterval;
@@ -25,16 +24,17 @@ class RandomRangeTargetSelection {
25
24
  const offsetX = gridX * minInterval;
26
25
  if (offsetX * offsetX + offsetY * offsetY > radiusSqr)
27
26
  continue;
28
- const param = { ID: -1, x: center.x + offsetX, y: center.y + offsetY, anchorX: 0.5, anchorY: 0, game: owner.game, scaleX: 1, scaleY: 1, disSqrt: 0 };
29
- param.disSqrt = (param.x - owner.x) ** 2 + (param.y - owner.y) ** 2;
27
+ const param = { ID: -1, x: center.x + offsetX, y: center.y + offsetY, anchorX: 0.5, anchorY: 0, game: owner.game, scaleX: 1, scaleY: 1 /* disSqrt: 0 */ };
28
+ // param.disSqrt = (param.x - owner.x) ** 2 + (param.y - owner.y) ** 2;
30
29
  result.push(param);
31
30
  }
32
31
  }
33
32
  game.getRandomSDiffInArray(result, pointCount);
34
- BattleUtils_1.BattleUtils.bubbleSort(result, (a, b) => {
35
- //@ts-ignore
36
- return a.disSqrt < b.disSqrt;
37
- });
33
+ //直接随机选点
34
+ // BattleUtils.bubbleSort(result, (a, b) => {
35
+ // //@ts-ignore
36
+ // return a.disSqrt < b.disSqrt;
37
+ // });
38
38
  return result;
39
39
  }
40
40
  }
@@ -27,6 +27,8 @@ class SelfRandomTargetSelection {
27
27
  continue;
28
28
  if (notincludeSelf && value.ID === owner.ID)
29
29
  continue;
30
+ if (value.cfg.type === battle_interface_1.SubEntityType.PET)
31
+ continue;
30
32
  if (ignoreList && ignoreList.indexOf(value.ID) !== -1)
31
33
  continue;
32
34
  if (value.campType !== owner.campType || value.NoSelect(forceSkillId) || !value.shape || !value.shape.isActive)
@@ -6,7 +6,6 @@ const TargetSelection_1 = require("./TargetSelection");
6
6
  class SelfRandomTowerTargetSelection {
7
7
  static select(owner, targetTypes, x, y, ignoreList, searchRange, forceSkillId) {
8
8
  const game = owner.game;
9
- const fighters = owner.game.gameContext.fighters;
10
9
  const targets = [];
11
10
  const entityLogic = game.getEntityLogic(game.roles[owner.playerId]);
12
11
  const isContainSelf = targetTypes[1] || 0;
@@ -0,0 +1,85 @@
1
+ import { GameInput, IFighterInfo } from "../battle.interface";
2
+ import FighterData from "../entity/FighterData";
3
+ import Game from "../Game";
4
+ import { TurnPhaseSystem } from "../system/TurnPhaseSystem";
5
+ import { TurnSchedulerSystem } from "../system/TurnSchedulerSystem";
6
+ import type { HitData } from "../util/HitDataPool";
7
+ import { CampType } from './../battle.interface';
8
+ import { TurnBattleConfig, TurnBattleOptions, TurnBattleState, TurnPhase } from "./TurnBattleTypes";
9
+ /**
10
+ * 回合制战斗主类。
11
+ * 逻辑与表现共用同一套实时系统:回合调度器只决定“当前哪个单位可以行动”,
12
+ * 移动、攻击、技能、子弹、碰撞、伤害都由原有实时管线逐帧结算,前后端跑同一份模拟。
13
+ */
14
+ export default class TurnBattleGame extends Game {
15
+ /** 维修技能表现时长(秒):回合末触发维修后,等表现播完再进入下一回合 */
16
+ private static readonly REPAIR_ACTION_DELAY;
17
+ turnState: TurnBattleState;
18
+ phaseSystem: TurnPhaseSystem;
19
+ turnScheduler: TurnSchedulerSystem;
20
+ mainRoleId: number;
21
+ enemyMainRoleId: number;
22
+ /** 回合制:当前允许行动的单位 ID;<0 表示非回合制(实时战斗),0 表示无单位可行动 */
23
+ turnActiveFighterId: number;
24
+ /** 双方主角本回合实际损失的生命值,由 ArenaBattleModule.onHurt 统计,回合末维修结算后清零 */
25
+ myMainHurtHp: number;
26
+ enemyMainHurtHp: number;
27
+ getTurnHurtHp(campType: CampType): number;
28
+ /** 回合末等待延迟(秒):大于 0 时停在 ROUND_END,不进入下一回合 */
29
+ private _roundEndDelay;
30
+ config: TurnBattleConfig;
31
+ constructor(options: TurnBattleOptions);
32
+ private initTurnSystems;
33
+ /** 回合制开战入口:只做初始化,之后由 fixUpdate 逐帧推进(前端)/ runToEnd(后端) */
34
+ initPVPFight(challenger: IFighterInfo[], defender: IFighterInfo[]): void;
35
+ fixUpdate(dt: number): void;
36
+ setReady(): void;
37
+ getCurrentPhase(): TurnPhase;
38
+ getRound(): number;
39
+ /** 将 hp 已归零但还没进入死亡状态的单位补一次死亡状态,交给死亡动画结束后统一结算 */
40
+ collectDeaths(): void;
41
+ /** 死亡动画结束后由 DeadState 调用;只做回合制侧的身份移除与胜负判定 */
42
+ notifyFighterDead(fighter: FighterData): void;
43
+ /** 回合末:buff/时间由实时系统自行推进,这里只处理死亡兜底、回合上限与下一回合 */
44
+ endRound(): void;
45
+ /**
46
+ * 追加回合末等待时间(秒)。维修等需要表现播完后,由回合末逻辑调用。
47
+ * 多段逻辑可以累加,统一在 tickRoundEndDelay 中倒计时。
48
+ */
49
+ addRoundEndDelay(delay: number): void;
50
+ /**
51
+ * 调度器每帧推进回合末延迟。
52
+ * 返回 true 表示仍在等待,本帧不要开始任何行动;返回 false 表示已可继续(必要时已进入下一回合)。
53
+ */
54
+ tickRoundEndDelay(dt: number): boolean;
55
+ private enterNextRound;
56
+ setGameWin(lastDeadFight?: FighterData): void;
57
+ setGameFail(isCross?: boolean): void;
58
+ /** 回合制全自动,不复用实时输入 */
59
+ applyInput(input: GameInput): void;
60
+ /**
61
+ * 回合制受击回调:受击方配置了反击技能且当前没有在行动时,插入一次反击行动。
62
+ * 插入行动期间不会再次插入,避免反击互相触发形成死循环。
63
+ */
64
+ tryCounterAttack(attacker: FighterData, defender: FighterData): void;
65
+ tryDizzinessAttack(attacker: FighterData, defender: FighterData): void;
66
+ /**
67
+ * 回合末维修:只处理双方主角。
68
+ */
69
+ private processRepair;
70
+ /** @returns 是否触发了维修 */
71
+ private repairMainRole;
72
+ destroy(): void;
73
+ syncState(): void;
74
+ private handleFighter;
75
+ private checkFinish;
76
+ private pickMainRole;
77
+ private finishTurnBattle;
78
+ calNormalHurt(hurtData: HitData, attacker: FighterData, defender: FighterData): number;
79
+ calComboCount(attacker: FighterData, defender: FighterData): void;
80
+ isTriggerCrit(attacker: FighterData, defender: FighterData): boolean;
81
+ isTriggerMiss(attacker: FighterData, defender: FighterData): boolean;
82
+ isTriggerStun(attacker: FighterData, defender: FighterData): boolean;
83
+ isTriggerCounter(attacker: FighterData, defender: FighterData): boolean;
84
+ isTriggerRepair(attacker: FighterData, defender: FighterData): boolean;
85
+ }