captainbattle 1.0.5 → 1.0.7

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 (315) 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 +230 -17
  312. package/dist/register-all.d.ts +2 -0
  313. package/dist/register-all.js +2 -0
  314. package/package.json +1 -1
  315. package/resources/config/GameJsonCfg.bin +0 -0
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const ObjectPool_1 = require("../../../framework/collections/ObjectPool");
4
4
  const battle_interface_1 = require("../battle.interface");
5
5
  const EntityPool_1 = require("../entity/EntityPool");
6
+ const BattleUtils_1 = require("../util/BattleUtils");
6
7
  const GameSystem_1 = require("./GameSystem");
7
8
  class DestroySystem extends GameSystem_1.GameSystem {
8
9
  name = "DestroySystem";
@@ -32,37 +33,77 @@ class DestroySystem extends GameSystem_1.GameSystem {
32
33
  onUpdate(dt) {
33
34
  const g = this.game;
34
35
  const list = g.gameContext.waitToDestroyList;
35
- if (list.length > 0) {
36
- for (let i = list.length - 1; i >= 0; i--) {
37
- let obj = list[i];
38
- if (this.removeEntity(obj)) {
39
- this.waitToDestroyPool.push(list.splice(i, 1)[0]);
40
- }
36
+ const len = list.length;
37
+ if (len <= 0) {
38
+ return;
39
+ }
40
+ // 仍按旧实现的倒序遍历处理,保证同一帧内多个实体的销毁顺序不变。
41
+ // 不调用 splice:它每次都会为"被移除的元素"新建一个返回数组,还要搬移尾部元素;
42
+ // 这里从尾部把存活项原地前移(dst 恒 >= i,只会覆盖已处理过的槽位),直接免掉分配。
43
+ let dst = len - 1;
44
+ for (let i = len - 1; i >= 0; i--) {
45
+ const obj = list[i];
46
+ if (this.removeEntity(obj)) {
47
+ this.waitToDestroyPool.push(obj);
48
+ }
49
+ else {
50
+ list[dst--] = obj;
51
+ }
52
+ }
53
+ const kept = len - 1 - dst;
54
+ if (kept > 0) {
55
+ // 存活项已按原顺序压在 [first, len) 段,整体前移到表头。
56
+ // 不用 copyWithin:小游戏运行时的内建版本不可控,这里只是一次短距离搬移,普通循环同样零分配。
57
+ const first = dst + 1;
58
+ for (let i = 0; i < kept; i++) {
59
+ list[i] = list[first + i];
41
60
  }
42
61
  }
62
+ const appended = list.length - len;
63
+ if (appended > 0) {
64
+ // 销毁回调里可能再次入表(追加在 len 之后),接到存活段尾部,不能丢
65
+ for (let i = 0; i < appended; i++) {
66
+ list[kept + i] = list[len + i];
67
+ }
68
+ }
69
+ list.length = kept + appended;
70
+ }
71
+ /**
72
+ * 在按 ID 升序排列的实体数组中二分定位,找不到返回 -1。
73
+ * fighters/projectiles 的 ID 来自同一个自增计数器且只做尾部追加,
74
+ * 与 Game.getEntityLogic 的二分查找依赖同一个有序前提。
75
+ */
76
+ indexOfEntityById(entities, entityId) {
77
+ let left = 0;
78
+ let right = entities.length - 1;
79
+ while (left <= right) {
80
+ const mid = (left + right) >> 1;
81
+ const id = entities[mid].ID;
82
+ if (id === entityId)
83
+ return mid;
84
+ id > entityId ? right = mid - 1 : left = mid + 1;
85
+ }
86
+ return -1;
43
87
  }
44
88
  removeEntity(obj) {
45
89
  obj.count--;
46
90
  if (obj.count <= 0) {
47
- let entityId = obj.entityId;
91
+ const entityId = obj.entityId;
92
+ const context = this.game.gameContext;
48
93
  let entity = null;
49
94
  if (obj.entityType === battle_interface_1.EntityType.PROJECTILE) {
50
- for (let i = 0; i < this.game.gameContext.projectiles.length; i++) {
51
- if (entityId === this.game.gameContext.projectiles[i].ID) {
52
- entity = this.game.gameContext.projectiles[i];
53
- this.game.gameContext.projectiles.splice(i, 1);
54
- break;
55
- }
95
+ const index = this.indexOfEntityById(context.projectiles, entityId);
96
+ if (index >= 0) {
97
+ entity = context.projectiles[index];
98
+ BattleUtils_1.BattleUtils.removeAt(context.projectiles, index);
56
99
  }
57
100
  }
58
101
  else if (obj.entityType === battle_interface_1.EntityType.FIGHTER) {
59
- for (let i = 0; i < this.game.gameContext.fighters.length; i++) {
60
- if (entityId === this.game.gameContext.fighters[i].ID) {
61
- if (this.game.gameContext.fighters[i].hasProjectileNum <= 0) {
62
- entity = this.game.gameContext.fighters[i];
63
- this.game.gameContext.fighters.splice(i, 1);
64
- }
65
- break;
102
+ const index = this.indexOfEntityById(context.fighters, entityId);
103
+ if (index >= 0) {
104
+ if (context.fighters[index].hasProjectileNum <= 0) {
105
+ entity = context.fighters[index];
106
+ BattleUtils_1.BattleUtils.removeAt(context.fighters, index);
66
107
  }
67
108
  }
68
109
  }
@@ -1,4 +1,4 @@
1
- import { GameAdjustAtkDir, GameInput, GameLearnSkills, IBattleFrameData } from "../battle.interface";
1
+ import { GameAdjustAtkDir, GameInput, GameLearnSkills, GameUseSkill, IBattleFrameData } from "../battle.interface";
2
2
  import { GameSystem } from "./GameSystem";
3
3
  export default class InputSystem extends GameSystem {
4
4
  readonly name: string;
@@ -17,5 +17,7 @@ export default class InputSystem extends GameSystem {
17
17
  private handerInput;
18
18
  adjustAtkDir(input: GameAdjustAtkDir): void;
19
19
  activeSkills(input: GameLearnSkills): void;
20
+ /** 使用技能:按实体唯一id释放指定技能,冷却 */
21
+ useSkill(input: GameUseSkill): void;
20
22
  private checkSkillLevel;
21
23
  }
@@ -56,6 +56,9 @@ class InputSystem extends GameSystem_1.GameSystem {
56
56
  else if (input.type === battle_interface_1.GameInputTypeEnum.Relive) {
57
57
  this.game.onRelive();
58
58
  }
59
+ else if (input.type === battle_interface_1.GameInputTypeEnum.UseSkill) {
60
+ this.useSkill(input);
61
+ }
59
62
  this._frameOffsetIndex++;
60
63
  }
61
64
  else {
@@ -101,10 +104,6 @@ class InputSystem extends GameSystem_1.GameSystem {
101
104
  for (let i = 0; i < skills.length; i++) {
102
105
  let skillId = skills[i];
103
106
  let skillCfg = Cfg_1.Cfg.Skill.get(skillId);
104
- if (!skillCfg) {
105
- console.log('skillId not found', skillId);
106
- continue;
107
- }
108
107
  activeskills.push([skillId, skillCfg.belong || 0, input.fromSelect ? 1 : input.fromSelect || 0]);
109
108
  for (let j = 0; j < checkrole.length; j++) {
110
109
  let role = checkrole[j];
@@ -140,6 +139,18 @@ class InputSystem extends GameSystem_1.GameSystem {
140
139
  }
141
140
  // this.checkSkillLevel();
142
141
  }
142
+ /** 使用技能:按实体唯一id释放指定技能,冷却 */
143
+ useSkill(input) {
144
+ let fighter = this.game.getEntityLogic(input.ownerId);
145
+ if (fighter) {
146
+ const code = this.game.call(GameEvent_1.GameEvent.SkillCheckSkillReady, fighter, input.skillId);
147
+ if (!code) {
148
+ // UseSkillResult 取值通道内部即调用 SkillSystem.useSkill,这里不能再直接调用一次,否则技能会重复释放
149
+ this.game.emit(GameEvent_1.GameEvent.UseSkillResult, fighter, input.skillId);
150
+ this.game.emit(GameEvent_1.GameEvent.SkillResetSkillCd, fighter, input.skillId);
151
+ }
152
+ }
153
+ }
143
154
  checkSkillLevel() {
144
155
  for (let key in this.game.gameContext.myFightData) {
145
156
  let data = this.game.gameContext.myFightData[key];
@@ -8,6 +8,7 @@ export default class ProjectileSystem extends GameSystem {
8
8
  init(): void;
9
9
  onDestroy(): void;
10
10
  onUpdate(dt: number): void;
11
+ private recycleProjectile;
11
12
  setProjectileCrossNum(projectile: ProjectileData, crossNum: number): void;
12
13
  private frameCandidatesMap;
13
14
  onCollisionEnter(otherCollider: FighterData, self: ProjectileData): void;
@@ -1,13 +1,20 @@
1
1
  "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
2
8
  var __importDefault = (this && this.__importDefault) || function (mod) {
3
9
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
10
  };
5
11
  Object.defineProperty(exports, "__esModule", { value: true });
6
12
  const battle_interface_1 = require("../battle.interface");
7
13
  const SkillImpactPool_1 = require("../skill/pool/SkillImpactPool");
8
- const BattleUtils_1 = require("../util/BattleUtils");
9
14
  const EntityEvent_1 = require("../event/EntityEvent");
15
+ const EventBind_1 = require("../event/EventBind");
10
16
  const GameEvent_1 = require("../event/GameEvent");
17
+ const BattleUtils_1 = require("../util/BattleUtils");
11
18
  const Random_1 = __importDefault(require("../util/Random"));
12
19
  const GameSystem_1 = require("./GameSystem");
13
20
  class ProjectileSystem extends GameSystem_1.GameSystem {
@@ -57,7 +64,7 @@ class ProjectileSystem extends GameSystem_1.GameSystem {
57
64
  let entity = projectile.game.getEntityLogic(projectile.hitDeltaMap[randomKey].entity);
58
65
  this.hit(projectile, entity);
59
66
  const role = projectile.game.getEntityLogic(projectile.owner);
60
- projectile.game.emit(role, EntityEvent_1.EntityEvent.ProjectileHitByTimes, projectile);
67
+ projectile.game.emit1(role, EntityEvent_1.EntityEvent.ProjectileHitByTimes, projectile);
61
68
  }
62
69
  else {
63
70
  this.setProjectileCrossNum(projectile, projectile.crossNum - 1);
@@ -75,29 +82,32 @@ class ProjectileSystem extends GameSystem_1.GameSystem {
75
82
  }
76
83
  }
77
84
  if (projectile.emitter) {
78
- let emitterCall = (0, BattleUtils_1.getClassByName)(projectile.emitter.emitterName);
85
+ let emitterCall = projectile.emitter.emitterClass;
79
86
  emitterCall.onUpdate(projectile, dt, projectile.target);
80
87
  }
81
88
  if (projectile.lifeTime > 0 && (projectile.timeType !== 1 || projectile.hitCount > 0)) {
82
89
  projectile.lifeTime -= dt;
83
90
  if (projectile.lifeTime <= 0) {
84
- if (projectile.emitter) {
85
- let emitterCall = (0, BattleUtils_1.getClassByName)(projectile.emitter.emitterName);
86
- emitterCall.onDead(projectile);
87
- }
88
- if (!projectile.notriggerDead) {
89
- projectile.game.emit(projectile, EntityEvent_1.EntityEvent.ProjectileDead, projectile);
90
- let owner = projectile.game.getEntityLogic(projectile.owner);
91
- projectile.game.emit(owner, EntityEvent_1.EntityEvent.ProjectileDead, projectile);
92
- }
93
- projectile.isDead = true;
94
- projectile.shape && (projectile.shape.isActive = false);
95
- projectile.game.pushToDestroyList(projectile);
91
+ this.recycleProjectile(projectile);
96
92
  }
97
93
  }
98
94
  }
99
95
  }
100
96
  }
97
+ recycleProjectile(projectile) {
98
+ if (projectile.emitter) {
99
+ let emitterCall = projectile.emitter.emitterClass;
100
+ emitterCall.onDead(projectile);
101
+ }
102
+ if (!projectile.notriggerDead) {
103
+ projectile.game.emit1(projectile, EntityEvent_1.EntityEvent.ProjectileDead, projectile);
104
+ let owner = projectile.game.getEntityLogic(projectile.owner);
105
+ projectile.game.emit1(owner, EntityEvent_1.EntityEvent.ProjectileDead, projectile);
106
+ }
107
+ projectile.isDead = true;
108
+ projectile.shape && (projectile.shape.isActive = false);
109
+ projectile.game.pushToDestroyList(projectile);
110
+ }
101
111
  setProjectileCrossNum(projectile, crossNum) {
102
112
  projectile.crossNum = crossNum;
103
113
  if (crossNum < 0)
@@ -147,7 +157,7 @@ class ProjectileSystem extends GameSystem_1.GameSystem {
147
157
  if (data && data.length) {
148
158
  let index = data.indexOf(otherCollider.ID);
149
159
  if (index != -1) {
150
- data.splice(index, 1);
160
+ BattleUtils_1.BattleUtils.removeAt(data, index);
151
161
  }
152
162
  if (!data.length && self.hurtDelta < 100) {
153
163
  delete self.hitDeltaMap[otherCollider.oid];
@@ -173,7 +183,7 @@ class ProjectileSystem extends GameSystem_1.GameSystem {
173
183
  for (let t = candidates.length - 1; t >= 0; t--) { //不处理无效的单位
174
184
  let fighter = candidates[t];
175
185
  if (fighter.isDead || !fighter.shape.isActive || fighter.NoSelect(projectile.skillId)) {
176
- candidates.splice(t, 1);
186
+ BattleUtils_1.BattleUtils.removeAt(candidates, t);
177
187
  }
178
188
  }
179
189
  if (candidates.length > projectile.singleHitMaxNum) {
@@ -182,7 +192,7 @@ class ProjectileSystem extends GameSystem_1.GameSystem {
182
192
  if (projectile.noTriggerTime <= 0) {
183
193
  // 执行命中
184
194
  if (candidates.length === 1 && projectile.crossNum >= 1) {
185
- projectile.game.emit(projectile.game.getEntityLogic(projectile.owner), EntityEvent_1.EntityEvent.ProjectileSingleHit, projectile);
195
+ projectile.game.emit1(projectile.game.getEntityLogic(projectile.owner), EntityEvent_1.EntityEvent.ProjectileSingleHit, projectile);
186
196
  }
187
197
  for (let j = 0; j < candidates.length; j++) {
188
198
  let fighter = candidates[j];
@@ -200,7 +210,7 @@ class ProjectileSystem extends GameSystem_1.GameSystem {
200
210
  return;
201
211
  if (projectile.emitterProxyHit > 0) {
202
212
  projectile.emitterProxyHit--;
203
- let t = (0, BattleUtils_1.getClassByName)(projectile.emitter.emitterName);
213
+ let t = projectile.emitter.emitterClass;
204
214
  t.hit(projectile, otherCollider);
205
215
  }
206
216
  else {
@@ -212,7 +222,7 @@ class ProjectileSystem extends GameSystem_1.GameSystem {
212
222
  if (projectile.impact) {
213
223
  let owner = projectile.game.getEntityLogic(projectile.owner);
214
224
  if (owner) {
215
- owner.game.emit(owner, EntityEvent_1.EntityEvent.ProjectileBeforeCross, projectile, otherCollider);
225
+ owner.game.emit2(owner, EntityEvent_1.EntityEvent.ProjectileBeforeCross, projectile, otherCollider);
216
226
  projectile.hitCount++;
217
227
  let impact = projectile.game.getSkillImpactByImpactPath(projectile.impact);
218
228
  this.executeImpact(projectile, otherCollider, owner, impact, projectile.impact);
@@ -224,13 +234,20 @@ class ProjectileSystem extends GameSystem_1.GameSystem {
224
234
  let impact = projectile.game.getSkillImpactByImpactPath(projectile.impact3);
225
235
  this.executeImpact(projectile, otherCollider, owner, impact, projectile.impact3);
226
236
  }
227
- owner.game.emit(owner, EntityEvent_1.EntityEvent.ProjectileCross, projectile, otherCollider);
237
+ owner.game.emit2(owner, EntityEvent_1.EntityEvent.ProjectileCross, projectile, otherCollider);
228
238
  if (projectile.hitCount === 1) {
229
- owner.game.emit(owner, EntityEvent_1.EntityEvent.ProjectileFirstHit, projectile, otherCollider);
239
+ owner.game.emit2(owner, EntityEvent_1.EntityEvent.ProjectileFirstHit, projectile, otherCollider);
230
240
  }
231
- owner.game.emit(owner, EntityEvent_1.EntityEvent.ProjectileSubImpactAll, otherCollider, projectile);
232
- if (owner.callEntityId) {
233
- owner.game.emit(owner.game.getEntityLogic(owner.callEntityId), EntityEvent_1.EntityEvent.CallProjectileSubImpactAll, otherCollider, projectile);
241
+ owner.game.emit2(owner, EntityEvent_1.EntityEvent.ProjectileSubImpactAll, otherCollider, projectile);
242
+ if (owner.callEntityId || owner.callTopEntityId) {
243
+ const entity = owner.game.getEntityLogic(owner.callEntityId);
244
+ if (entity) {
245
+ owner.game.emit2(entity, EntityEvent_1.EntityEvent.CallProjectileSubImpactAll, otherCollider, projectile);
246
+ }
247
+ const topEntity = owner.game.getEntityLogic(owner.callTopEntityId);
248
+ if (topEntity) {
249
+ owner.game.emit2(topEntity, EntityEvent_1.EntityEvent.CallProjectileSubImpactAll, otherCollider, projectile);
250
+ }
234
251
  }
235
252
  }
236
253
  }
@@ -240,7 +257,7 @@ class ProjectileSystem extends GameSystem_1.GameSystem {
240
257
  skillImpact.position.x = projectile.x;
241
258
  skillImpact.position.y = projectile.y;
242
259
  let target = impact.target;
243
- let fighters = [];
260
+ let fighters;
244
261
  if (target[0] == 3) { //当前碰撞区域
245
262
  let hitEntity = otherCollider;
246
263
  if (otherCollider.subType === battle_interface_1.SubEntityType.DRAGON_BODY) {
@@ -258,13 +275,13 @@ class ProjectileSystem extends GameSystem_1.GameSystem {
258
275
  let y = projectile.y;
259
276
  if (!projectile.notriggerSubImpact) {
260
277
  if (projectile.emitter) {
261
- let t = (0, BattleUtils_1.getClassByName)(projectile.emitter.emitterName);
278
+ let t = projectile.emitter.emitterClass;
262
279
  let pos = t.getHitPos(projectile, otherCollider);
263
280
  x = pos.x;
264
281
  y = pos.y;
265
282
  }
266
- owner.game.emit(owner, EntityEvent_1.EntityEvent.ProjectileSubImpact, projectile);
267
- owner.game.emit(projectile, EntityEvent_1.EntityEvent.ProjectileSubImpact, projectile);
283
+ owner.game.emit1(owner, EntityEvent_1.EntityEvent.ProjectileSubImpact, projectile);
284
+ owner.game.emit1(projectile, EntityEvent_1.EntityEvent.ProjectileSubImpact, projectile);
268
285
  }
269
286
  if (fighters && fighters.length) {
270
287
  if (owner) {
@@ -299,3 +316,6 @@ class ProjectileSystem extends GameSystem_1.GameSystem {
299
316
  }
300
317
  }
301
318
  exports.default = ProjectileSystem;
319
+ __decorate([
320
+ (0, EventBind_1.GameEventListener)(GameEvent_1.GameEvent.RecycleProjectile)
321
+ ], ProjectileSystem.prototype, "recycleProjectile", null);
@@ -39,6 +39,8 @@ export declare const SkillCodeToMsg: {
39
39
  };
40
40
  export interface ISkillEmitter {
41
41
  emitterName: string;
42
+ /** emitterName 对应的实现类:池对象创建时解析一次随实例带走,热路径不必每帧按名字查表 */
43
+ emitterClass?: any;
42
44
  curTime?: number;
43
45
  skillId?: number;
44
46
  atkDir?: {
@@ -82,11 +84,11 @@ export default class SkillSystem extends GameSystem {
82
84
  * @return {*}
83
85
  */
84
86
  useSkill(fighter: FighterData, skillId: number, customParam?: CustomUseSkillParam): number;
85
- /** 事件入口:EventListener 会把事件 id 追加在参数末尾,这里先丢弃再转发,避免顶掉 forceCd/forceNum */
86
87
  resetSkillCd(fighter: FighterData, skillId: number, forceCd?: number, forceNum?: number): void;
87
88
  resetSkillNumCd(fighter: FighterData, skillId: number): void;
88
89
  resetNeedReleaseCd(entity: FighterData): void;
89
90
  addSkillNum(entity: FighterData, skillId: number, num: number): void;
90
91
  onUpdate(dt: number): void;
91
92
  clearSkillData(fighter: FighterData): void;
93
+ updateSkillCd(dt: number): void;
92
94
  }
@@ -8,7 +8,10 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.SkillCodeToMsg = exports.SkillCode = exports.CostType = void 0;
10
10
  const Cfg_1 = require("../../../config/Cfg");
11
+ const Notifier_1 = require("../../../framework/notify/Notifier");
12
+ const ListenID_1 = require("../../../ListenID");
11
13
  const Property_1 = require("../../property/Property");
14
+ const battle_interface_1 = require("../battle.interface");
12
15
  const EntityEvent_1 = require("../event/EntityEvent");
13
16
  const EventBind_1 = require("../event/EventBind");
14
17
  const GameEvent_1 = require("../event/GameEvent");
@@ -72,6 +75,7 @@ class SkillSystem extends GameSystem_1.GameSystem {
72
75
  skillData.skillNum = Property_1.PropertyHelper.skillNum(skillData.cfg.magazine || 1, fighter.property);
73
76
  skillData.allSkillNum = skillData.skillNum;
74
77
  skillData.ignoreNum = 0;
78
+ skillData.maxCd = Property_1.PropertyHelper.skillCd(skillData.cfg.cd || 0, fighter.property);
75
79
  // 初始化技能影响数据
76
80
  for (let i = 0; i < skillData.cfg.skillImpacts.length; i++) {
77
81
  let impact = skillData.cfg.skillImpacts[i];
@@ -80,6 +84,12 @@ class SkillSystem extends GameSystem_1.GameSystem {
80
84
  impact.subImpact.index = -1;
81
85
  }
82
86
  }
87
+ if (skillData.cfg.skillType === 3) {
88
+ skillData.skillCurCd = skillData.maxCd;
89
+ if (fighter.campType === battle_interface_1.CampType.MY && fighter.playerId === fighter.game.selfPlayerId) {
90
+ Notifier_1.Notifier.send(ListenID_1.ListenID.Battle_SetSkillType3, fighter, skillData.cfg);
91
+ }
92
+ }
83
93
  }
84
94
  initSkill(fighter, skills, waitCallSkills) {
85
95
  fighter.normalSkillIds.length = 0;
@@ -154,6 +164,8 @@ class SkillSystem extends GameSystem_1.GameSystem {
154
164
  let skillData = fighter.skillDatas[skillId];
155
165
  if (!skillData)
156
166
  return SkillCode.NONE;
167
+ if (skillData.cfg.useType == 2)
168
+ return SkillCode.SUCCESS;
157
169
  // 检查cd
158
170
  if (skillData.skillCurCd > 0)
159
171
  return SkillCode.CD;
@@ -231,13 +243,12 @@ class SkillSystem extends GameSystem_1.GameSystem {
231
243
  emitterClass.execute(fighter, skillEmitter, skillData, emitter);
232
244
  return SkillCode.SUCCESS;
233
245
  }
234
- /** 事件入口:EventListener 会把事件 id 追加在参数末尾,这里先丢弃再转发,避免顶掉 forceCd/forceNum */
235
246
  resetSkillCd(fighter, skillId, forceCd, forceNum) {
236
247
  let skillData = fighter.skillDatas[skillId];
237
248
  if (!skillData)
238
249
  return;
239
250
  if (skillData.skillNum > 0) {
240
- skillData.skillNum -= forceNum || 1;
251
+ skillData.skillNum -= forceNum != null ? forceNum : 0;
241
252
  }
242
253
  if (forceCd) {
243
254
  skillData.skillCurCd = forceCd;
@@ -258,7 +269,9 @@ class SkillSystem extends GameSystem_1.GameSystem {
258
269
  if (!skillData)
259
270
  return;
260
271
  skillData.skillCurCd = Property_1.PropertyHelper.skillCd(skillData.cfg.cd || 0, fighter.property);
261
- fighter.curDoubleShootNum = 0;
272
+ if (!fighter.game.isPVP) {
273
+ fighter.curDoubleShootNum = 0;
274
+ }
262
275
  fighter.game.emit(fighter, EntityEvent_1.EntityEvent.SkillNumOver, skillId);
263
276
  skillData.needReleaseCd = skillData.cfg.releaseTime && skillData.cfg.releaseTime > 0;
264
277
  skillData.maxCd = skillData.skillCurCd;
@@ -279,6 +292,9 @@ class SkillSystem extends GameSystem_1.GameSystem {
279
292
  }
280
293
  }
281
294
  onUpdate(dt) {
295
+ if (!this.game.gameModule.moduleState.isTurn) {
296
+ this.updateSkillCd(dt);
297
+ }
282
298
  const entitys = this.game.gameContext.fighters;
283
299
  for (let e = 0; e < entitys.length; e++) {
284
300
  let entity = entitys[e];
@@ -295,10 +311,39 @@ class SkillSystem extends GameSystem_1.GameSystem {
295
311
  param = waitSkill.param;
296
312
  }
297
313
  this.useSkill(entity, waitSkill.skillId, param);
298
- waitUseSkill.splice(i, 1);
314
+ BattleUtils_1.BattleUtils.removeAt(waitUseSkill, i);
299
315
  }
300
316
  }
301
317
  }
318
+ this._waitRemoveEmitters.length = 0;
319
+ for (let i = 0; i < entity.skillEmitters.length; i++) {
320
+ let emitter = entity.skillEmitters[i];
321
+ if (!emitter.emitterClass.onUpdate(entity, emitter, entity.skillDatas[emitter.skillId], dt)) {
322
+ this._waitRemoveEmitters.push(i);
323
+ }
324
+ }
325
+ //移除过期发射器
326
+ for (let i = this._waitRemoveEmitters.length - 1; i >= 0; i--) {
327
+ let index = this._waitRemoveEmitters[i];
328
+ let emitter = entity.skillEmitters[index];
329
+ BattleUtils_1.BattleUtils.removeAt(entity.skillEmitters, index);
330
+ SkillEmitterPool_1.SkillEmitterPool.despawn(emitter);
331
+ }
332
+ }
333
+ }
334
+ clearSkillData(fighter) {
335
+ fighter.skillEmitters.forEach(emitter => {
336
+ SkillEmitterPool_1.SkillEmitterPool.despawn(emitter);
337
+ });
338
+ fighter.skillDatas = null;
339
+ fighter.skillEmitters.length = 0;
340
+ }
341
+ updateSkillCd(dt) {
342
+ const entitys = this.game.gameContext.fighters;
343
+ for (let e = 0; e < entitys.length; e++) {
344
+ let entity = entitys[e];
345
+ if (entity.isDead)
346
+ continue;
302
347
  for (let key in entity.skillDatas) {
303
348
  let value = entity.skillDatas[key];
304
349
  if (value.skillCurCd > 0 && value.skillCurCd < 9999) {
@@ -316,7 +361,7 @@ class SkillSystem extends GameSystem_1.GameSystem {
316
361
  }
317
362
  for (let i = waitToLearnSKills.length - 1; i >= 0; i -= 2) {
318
363
  if (waitToLearnSKills[i - 1] === entity.ID) {
319
- waitToLearnSKills.splice(i - 1, 2);
364
+ BattleUtils_1.BattleUtils.removeAt(waitToLearnSKills, i - 1, 2);
320
365
  }
321
366
  }
322
367
  }
@@ -325,30 +370,12 @@ class SkillSystem extends GameSystem_1.GameSystem {
325
370
  entity.game.emit(entity, EntityEvent_1.EntityEvent.SkillNumCdFinish, value.skillId);
326
371
  }
327
372
  }
328
- }
329
- this._waitRemoveEmitters.length = 0;
330
- for (let i = 0; i < entity.skillEmitters.length; i++) {
331
- let emitter = entity.skillEmitters[i];
332
- if (!(0, BattleUtils_1.getClassByName)(emitter.emitterName).onUpdate(entity, emitter, entity.skillDatas[emitter.skillId], dt)) {
333
- this._waitRemoveEmitters.push(i);
373
+ if (entity.campType === battle_interface_1.CampType.MY && value.cfg.useType === 3) {
374
+ Notifier_1.Notifier.send(ListenID_1.ListenID.Battle_UpdateUseType3SkillCd, value.cfg.id, value.skillCurCd, value.maxCd);
334
375
  }
335
376
  }
336
- //移除过期发射器
337
- for (let i = this._waitRemoveEmitters.length - 1; i >= 0; i--) {
338
- let index = this._waitRemoveEmitters[i];
339
- let emitter = entity.skillEmitters[index];
340
- entity.skillEmitters.splice(index, 1);
341
- SkillEmitterPool_1.SkillEmitterPool.despawn(emitter);
342
- }
343
377
  }
344
378
  }
345
- clearSkillData(fighter) {
346
- fighter.skillEmitters.forEach(emitter => {
347
- SkillEmitterPool_1.SkillEmitterPool.despawn(emitter);
348
- });
349
- fighter.skillDatas = null;
350
- fighter.skillEmitters.length = 0;
351
- }
352
379
  }
353
380
  exports.default = SkillSystem;
354
381
  __decorate([
@@ -391,3 +418,6 @@ __decorate([
391
418
  __decorate([
392
419
  (0, EventBind_1.GameEventListener)(GameEvent_1.GameEvent.SkillClearSkillData)
393
420
  ], SkillSystem.prototype, "clearSkillData", null);
421
+ __decorate([
422
+ (0, EventBind_1.GameEventListener)(GameEvent_1.GameEvent.StepSkill)
423
+ ], SkillSystem.prototype, "updateSkillCd", null);
@@ -0,0 +1,52 @@
1
+ import { CampType } from "../battle.interface";
2
+ import { TurnUnit } from "../entity/TurnUnit";
3
+ import { GameOptions } from "../Game";
4
+ import { TurnPhase } from "../turn/TurnBattleTypes";
5
+ import { GameSystem } from "./GameSystem";
6
+ /**
7
+ * 阵营阶段机:MY → ENEMY → ROUND_END → MY(下一回合)。
8
+ * 只维护阶段与行动队列,外部调度器负责推进和单位行动。
9
+ */
10
+ export declare class TurnPhaseSystem extends GameSystem {
11
+ readonly name: string;
12
+ private _round;
13
+ get round(): number;
14
+ set round(value: number);
15
+ phase: TurnPhase;
16
+ private _units;
17
+ private _pending;
18
+ /** 本回合先手/后手阵营:由双方主角属性 50000 决定,每回合开始时重算 */
19
+ private _firstCamp;
20
+ private _secondCamp;
21
+ get firstCamp(): CampType;
22
+ get secondCamp(): CampType;
23
+ private get turnGame();
24
+ onUpdate(dt: number): void;
25
+ init(options?: GameOptions): void;
26
+ onDestroy(): void;
27
+ setup(units: TurnUnit[]): void;
28
+ startBattle(): void;
29
+ getPending(): readonly TurnUnit[];
30
+ getUnits(): readonly TurnUnit[];
31
+ getUnit(id: number): TurnUnit | null;
32
+ consume(unit: TurnUnit): void;
33
+ removeUnit(id: number): void;
34
+ isPhaseComplete(): boolean;
35
+ advancePhase(): TurnPhase;
36
+ beginNextRound(): void;
37
+ private onRoundStart;
38
+ /** 战斗结束:进入 FINISHED */
39
+ finish(): void;
40
+ clear(): void;
41
+ /** 阶段进入:重建行动队列 */
42
+ private enterPhase;
43
+ private transitionTo;
44
+ /** 每回合重算先手:双方主角属性 50000 大者先手,相同则挑战者(MY)先手 */
45
+ private updateTurnOrder;
46
+ /** 本回合先手阵营:双方主角属性 50000 大者先手,相同则挑战者(MY)先手 */
47
+ getFirstCamp(): CampType;
48
+ private phaseOf;
49
+ private resetActed;
50
+ private buildPending;
51
+ private removeFromPending;
52
+ }