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
@@ -0,0 +1,90 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TurnPreAttackToAttack = exports.TurnIdleToPreAttack = exports.TurnWaitToBack = exports.TurnAttackToWait = void 0;
4
+ const battle_interface_1 = require("../battle.interface");
5
+ const GameEvent_1 = require("../event/GameEvent");
6
+ const BattleConfig_1 = require("../util/BattleConfig");
7
+ const AnyFighterStateTransitions_1 = require("./AnyFighterStateTransitions");
8
+ const FighterStateRegistry_1 = require("./FighterStateRegistry");
9
+ const FighterStateShared_1 = require("./FighterStateShared");
10
+ const FighterStateTransition_1 = require("./FighterStateTransition");
11
+ const FighterStateType_1 = require("./FighterStateType");
12
+ const WAIT_DEFAULT_TIME = 0.5;
13
+ /**
14
+ * 攻击结束或存在插入行动请求:进入 WAIT 等待被打断。
15
+ */
16
+ class TurnAttackToWait extends FighterStateTransition_1.BaseFighterStateTransition {
17
+ static profile = 7 /* FighterStateProfile.Turn */;
18
+ static fromState = FighterStateType_1.StateType.ATTACK;
19
+ static toState = FighterStateType_1.StateType.WAIT;
20
+ static priority = 60;
21
+ static onCheck(entity) {
22
+ //是被打断的攻击,延长进入等待的动作时间表现
23
+ const game = entity.game;
24
+ if (entity.actionTime <= 0) {
25
+ if ((game.turnScheduler && game.turnScheduler.isInterruptRequested(entity.ID))) {
26
+ entity.actionTime = 30;
27
+ }
28
+ else { //正常等待
29
+ entity.actionTime = WAIT_DEFAULT_TIME;
30
+ }
31
+ return true;
32
+ }
33
+ }
34
+ }
35
+ exports.TurnAttackToWait = TurnAttackToWait;
36
+ class TurnWaitToBack extends FighterStateTransition_1.BaseFighterStateTransition {
37
+ static profile = 7 /* FighterStateProfile.Turn */;
38
+ static fromState = FighterStateType_1.StateType.WAIT;
39
+ static toState = FighterStateType_1.StateType.BACK;
40
+ static priority = 40;
41
+ static onCheck(entity) {
42
+ const game = entity.game;
43
+ //时间结束且没有插入行动请求,进入回去状态;有请求时由调度器在插入行动结束后强制切 BACK
44
+ return entity.actionTime <= 0 && !(game.turnScheduler && game.turnScheduler.isInterruptRequested(entity.ID));
45
+ }
46
+ }
47
+ exports.TurnWaitToBack = TurnWaitToBack;
48
+ class TurnIdleToPreAttack extends AnyFighterStateTransitions_1.IdleToPreAttack {
49
+ static profile = 7 /* FighterStateProfile.Turn */;
50
+ static fromState = FighterStateType_1.StateType.IDLE;
51
+ static toState = FighterStateType_1.StateType.PREATTACK;
52
+ static priority = 40;
53
+ static onCheck(entity) {
54
+ if (entity.isInBuffByTypes(BattleConfig_1.NoInAttackBuff) || entity.attackTarget <= 0)
55
+ return false;
56
+ const attackTarget = entity.game.getEntityLogic(entity.attackTarget);
57
+ if (attackTarget.isDead || attackTarget.NoSelect(entity.normalSkillIds[0]))
58
+ return false;
59
+ if (!entity.game.gameModule.moduleState.autoFight && entity.campType !== battle_interface_1.CampType.ENEMY)
60
+ return false;
61
+ if (entity.curDoubleShootNum > 0 && entity.comboSkillId != 0) {
62
+ entity.curSkillId = entity.comboSkillId;
63
+ }
64
+ else {
65
+ entity.curSkillId = (0, FighterStateShared_1.getCurSkillId)(entity);
66
+ }
67
+ if (!entity.curSkillId)
68
+ return false;
69
+ const normalSkillId = entity.curSkillId;
70
+ if (entity.game.call(GameEvent_1.GameEvent.SkillCheckSkillReady, entity, normalSkillId)) {
71
+ return false;
72
+ }
73
+ return true;
74
+ }
75
+ }
76
+ exports.TurnIdleToPreAttack = TurnIdleToPreAttack;
77
+ class TurnPreAttackToAttack extends FighterStateTransition_1.BaseFighterStateTransition {
78
+ static profile = 7 /* FighterStateProfile.Turn */;
79
+ static fromState = FighterStateType_1.StateType.PREATTACK;
80
+ static toState = FighterStateType_1.StateType.ATTACK;
81
+ static priority = 40;
82
+ static onCheck(entity) {
83
+ return entity.actionTime <= 0;
84
+ }
85
+ }
86
+ exports.TurnPreAttackToAttack = TurnPreAttackToAttack;
87
+ (0, FighterStateRegistry_1.registerFighterStateTransition)(TurnIdleToPreAttack);
88
+ (0, FighterStateRegistry_1.registerFighterStateTransition)(TurnAttackToWait);
89
+ (0, FighterStateRegistry_1.registerFighterStateTransition)(TurnWaitToBack);
90
+ (0, FighterStateRegistry_1.registerFighterStateTransition)(TurnPreAttackToAttack);
@@ -5,3 +5,5 @@ import "./Boss18110State";
5
5
  import "./Boss18110Transitions";
6
6
  import "./DragonBodyFighterStates";
7
7
  import "./DragonFighterStates";
8
+ import "./TurnState";
9
+ import "./TurnTransitions";
@@ -8,7 +8,7 @@
8
8
  // Cocos 的资源系统会把 assets 下所有脚本加载一遍,所以引擎里天然成立;
9
9
  // Node 只执行从入口 import 可达的模块,不引这一下,注册表就是空的。
10
10
  //
11
- // 共 7 个模块。下面的 import 只为副作用,不需要用到导出。
11
+ // 共 9 个模块。下面的 import 只为副作用,不需要用到导出。
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  require("./AnyFighterStates");
14
14
  require("./AnyFighterStateTransitions");
@@ -17,3 +17,5 @@ require("./Boss18110State");
17
17
  require("./Boss18110Transitions");
18
18
  require("./DragonBodyFighterStates");
19
19
  require("./DragonFighterStates");
20
+ require("./TurnState");
21
+ require("./TurnTransitions");
@@ -4,6 +4,7 @@ import type FighterData from "../entity/FighterData";
4
4
  import { HitData } from "../util/HitDataPool";
5
5
  export declare class EntityManager {
6
6
  static behit(defen: FighterData, hurtData: HitData): void;
7
+ static behitInTurn(defen: FighterData, hurtData: HitData): void;
7
8
  static onSubDragonBodyHit(entity: DragonBodyData, hurtData: HitData): void;
8
9
  static killSelf(entity: FighterData): void;
9
10
  static onBodyDead(dragon: DragonData, dragonBody: DragonBodyData): void;
@@ -9,11 +9,9 @@ const EntityEvent_1 = require("../event/EntityEvent");
9
9
  const GameEvent_1 = require("../event/GameEvent");
10
10
  const FighterStateType_1 = require("../fsm-state/FighterStateType");
11
11
  const BattleConfig_1 = require("../util/BattleConfig");
12
+ const BattleUtils_1 = require("../util/BattleUtils");
12
13
  const HitDataPool_1 = require("../util/HitDataPool");
13
14
  class EntityManager {
14
- // ==============================
15
- // region EntityDamage 方法
16
- // ==============================
17
15
  static behit(defen, hurtData) {
18
16
  if (!defen || !defen.game || defen.isDead) {
19
17
  return;
@@ -29,18 +27,19 @@ class EntityManager {
29
27
  return;
30
28
  }
31
29
  }
30
+ if (defen.game.gameModule.moduleState.isTurn) {
31
+ this.behitInTurn(defen, hurtData);
32
+ return;
33
+ }
32
34
  hurtData.beHiter = defen;
33
35
  hurtData.x = defen.x;
34
36
  hurtData.y = defen.y;
35
- if (defen.isDead) {
36
- return;
37
- }
38
37
  if (defen.isInBuffByTypes(BattleConfig_1.InvisibleBuff)) {
39
38
  return;
40
39
  }
41
40
  //是否触发闪避
42
- if (!defen.isKillSelf && defen.game.isTriggerMiss(defen)) {
43
- defen.game.emit(GameEvent_1.GameEvent.ShowDisplay, 2 /* DisplayType.State */, "Miss", defen, "");
41
+ if (!hurtData.event.isIgnoreMiss && !defen.isKillSelf && defen.game.isTriggerMiss(hurtData.attacker, defen)) {
42
+ defen.game.emit(GameEvent_1.GameEvent.ShowDisplay, 2 /* DisplayType.State */, "Miss", defen);
44
43
  return;
45
44
  }
46
45
  if (defen.property[10080] > 0) { //扣除护盾次数
@@ -67,19 +66,20 @@ class EntityManager {
67
66
  if (hurtData.hurt < 0) {
68
67
  hurtData.hurt = 0;
69
68
  }
70
- if (defen.property[10090] > 0) {
71
- if (hurtData.hurt <= defen.property[10090]) {
72
- defen.property[10090] -= hurtData.hurt;
69
+ const shield = 10090;
70
+ if (defen.property[shield] > 0) {
71
+ if (hurtData.hurt <= defen.property[shield]) {
72
+ defen.property[shield] -= hurtData.hurt;
73
73
  defen.game.emit(GameEvent_1.GameEvent.ShowDamage, hurtData.hurt, defen, hurtData.event.isCrit, attacker.x, "00F0FF");
74
74
  defen.game.emit(defen.ID, EntityEvent_1.EntityEvent.ShieldReduce, hurtData.hurt);
75
75
  hurtData.hurt = 0;
76
76
  // return;
77
77
  }
78
78
  else {
79
- hurtData.hurt -= defen.property[10090];
80
- defen.game.emit(GameEvent_1.GameEvent.ShowDamage, defen.property[10090], defen, hurtData.event.isCrit, attacker.x, "00F0FF");
81
- defen.game.emit(defen.ID, EntityEvent_1.EntityEvent.ShieldReduce, defen.property[10090]);
82
- defen.property[10090] = 0;
79
+ hurtData.hurt -= defen.property[shield];
80
+ defen.game.emit(GameEvent_1.GameEvent.ShowDamage, defen.property[shield], defen, hurtData.event.isCrit, attacker.x, "00F0FF");
81
+ defen.game.emit(defen.ID, EntityEvent_1.EntityEvent.ShieldReduce, defen.property[shield]);
82
+ defen.property[shield] = 0;
83
83
  }
84
84
  }
85
85
  if (defen.curHp <= hurtData.hurt) {
@@ -143,7 +143,7 @@ class EntityManager {
143
143
  }
144
144
  if (hurtData.hurt > 0) {
145
145
  if (defen.ID !== attacker.ID) {
146
- defen.game.emit(GameEvent_1.GameEvent.ShowDamage, hurtData.hurt, defen, hurtData.event.isCrit, attacker.x, "");
146
+ defen.game.emit(GameEvent_1.GameEvent.ShowDamage, hurtData.hurt, defen, hurtData.event.isCrit, attacker.x);
147
147
  }
148
148
  if (!hurtData.event.isNoHit) {
149
149
  defen.hitColorTime = BattleConfig_1.HitTime;
@@ -154,6 +154,127 @@ class EntityManager {
154
154
  }
155
155
  }
156
156
  }
157
+ static behitInTurn(defen, hurtData) {
158
+ if (!defen || !defen.game || defen.isDead) {
159
+ return;
160
+ }
161
+ hurtData.beHiter = defen;
162
+ hurtData.x = defen.x;
163
+ hurtData.y = defen.y;
164
+ if (defen.isInBuffByTypes(BattleConfig_1.InvisibleBuff)) {
165
+ return;
166
+ }
167
+ const game = defen.game;
168
+ //是否触发闪避
169
+ if (!hurtData.event.isIgnoreMiss && !defen.isKillSelf && defen.game.isTriggerMiss(hurtData.attacker, defen)) {
170
+ game.emit(GameEvent_1.GameEvent.ShowDisplay, 2 /* DisplayType.State */, "Miss", defen);
171
+ game.emit1(hurtData.attacker, EntityEvent_1.EntityEvent.AfterBeMiss, hurtData);
172
+ game.emit1(defen, EntityEvent_1.EntityEvent.AfterMiss, hurtData);
173
+ return;
174
+ }
175
+ const attacker = hurtData.attacker;
176
+ hurtData.hurt = 0;
177
+ if (hurtData.event.isRealHit) {
178
+ hurtData.hurt = hurtData.attackRatio;
179
+ }
180
+ else if (hurtData.skillData) {
181
+ game.emit(attacker, EntityEvent_1.EntityEvent.SkillHurtCalStart, hurtData);
182
+ game.emit(defen, EntityEvent_1.EntityEvent.SkillHurtCalStart, hurtData);
183
+ hurtData.hurt = defen.game.calNormalHurt(hurtData, attacker, defen);
184
+ game.emit(defen, EntityEvent_1.EntityEvent.SkillHurtCalEnd, hurtData);
185
+ game.emit(attacker, EntityEvent_1.EntityEvent.SkillHurtCalEnd, hurtData);
186
+ }
187
+ if (hurtData.event.isImmune) {
188
+ return;
189
+ }
190
+ hurtData.hurt = Math.ceil(hurtData.hurt);
191
+ if (hurtData.hurt < 0) {
192
+ hurtData.hurt = 0;
193
+ }
194
+ const shield = 50720;
195
+ if (defen.property[shield] > 0) {
196
+ if (hurtData.hurt <= defen.property[shield]) {
197
+ defen.property[shield] -= hurtData.hurt;
198
+ defen.game.emit(GameEvent_1.GameEvent.ShowDamage, hurtData.hurt, defen, hurtData.event.isCrit, attacker.x, "00F0FF");
199
+ defen.game.emit(defen.ID, EntityEvent_1.EntityEvent.ShieldReduce, hurtData.hurt);
200
+ hurtData.hurt = 0;
201
+ // return;
202
+ }
203
+ else {
204
+ hurtData.hurt -= defen.property[shield];
205
+ defen.game.emit(GameEvent_1.GameEvent.ShowDamage, defen.property[shield], defen, hurtData.event.isCrit, attacker.x, "00F0FF");
206
+ defen.game.emit(defen.ID, EntityEvent_1.EntityEvent.ShieldReduce, defen.property[shield]);
207
+ defen.property[shield] = 0;
208
+ }
209
+ }
210
+ if (defen.curHp <= hurtData.hurt) {
211
+ game.emit(defen, EntityEvent_1.EntityEvent.BeforeDead, hurtData);
212
+ if (attacker) {
213
+ game.emit(attacker, EntityEvent_1.EntityEvent.EnemyBeforeDead, hurtData);
214
+ }
215
+ game.gameModule.onFighterBeForceDead(defen, hurtData);
216
+ }
217
+ if (hurtData.event.isCrit) {
218
+ game.emit(attacker, EntityEvent_1.EntityEvent.TriggerCrit, hurtData);
219
+ }
220
+ if (hurtData.event.isOneKill) {
221
+ hurtData.hurt = defen.curHp;
222
+ }
223
+ defen.setCurHp(defen.curHp - hurtData.hurt);
224
+ if (defen.curHp > 0) {
225
+ defen.game.emit(GameEvent_1.GameEvent.OnBehit, defen.ID);
226
+ }
227
+ defen.game.gameModule.onHurt(attacker?.ID, hurtData.hurt, defen);
228
+ game.emit(defen, EntityEvent_1.EntityEvent.BeHit, hurtData);
229
+ if (hurtData.event.isDef) {
230
+ game.emit(defen, EntityEvent_1.EntityEvent.AfterTriggerDef, hurtData);
231
+ }
232
+ if (attacker) {
233
+ let fightType = defen.isBoss === 1 ? 1 : 0;
234
+ let skillId = hurtData.event.isRealHit ? hurtData.skillId : hurtData.skillData.cfg.id;
235
+ if (attacker.campType === battle_interface_1.CampType.MY && !defen.isKillSelf) {
236
+ defen.game.logFightData(attacker, fightType, hurtData.hurt, skillId);
237
+ }
238
+ if (hurtData.hurt > 0) {
239
+ if (!hurtData.event.isRealHit && hurtData.skillData.isNormalAttack) {
240
+ attacker.normalDamageTimes++;
241
+ game.emit(attacker, EntityEvent_1.EntityEvent.AfterAtkNum, hurtData, attacker.normalDamageTimes);
242
+ }
243
+ if (!hurtData.event.isRealHit) {
244
+ game.emit(attacker, EntityEvent_1.EntityEvent.AtkHasBuff, hurtData);
245
+ }
246
+ if (!hurtData.event.isRealHit) {
247
+ game.emit(attacker, EntityEvent_1.EntityEvent.AfterAtkHit, hurtData);
248
+ }
249
+ }
250
+ if (defen.curHp <= 0) {
251
+ game.emit(attacker, EntityEvent_1.EntityEvent.KillOne, hurtData);
252
+ attacker.killNumTimes++;
253
+ game.emit(attacker, EntityEvent_1.EntityEvent.KillNum, attacker.killNumTimes);
254
+ }
255
+ }
256
+ Notifier_1.Notifier.send(ListenID_1.ListenID.Battle_OnHurt, attacker?.ID, hurtData.hurt, game, defen);
257
+ if (hurtData.hurt > 0) {
258
+ if (defen.ID !== attacker.ID) {
259
+ defen.game.emit(GameEvent_1.GameEvent.ShowDamage, hurtData.hurt, defen, hurtData.event.isCrit, attacker.x);
260
+ }
261
+ if (!hurtData.event.isNoHit) {
262
+ defen.hitColorTime = BattleConfig_1.HitTime;
263
+ defen.color = defen.campType === battle_interface_1.CampType.MY ? 4278190335 : 4285887999;
264
+ }
265
+ if (defen.curHp <= 0) {
266
+ defen.game.emit(GameEvent_1.GameEvent.FsmChangeState, defen, FighterStateType_1.StateType.DEAD);
267
+ }
268
+ }
269
+ //回合制:判断击晕
270
+ if (hurtData.hurt > 0 && defen.curHp > 0 && (hurtData.skillData.isNormalAttack || hurtData.skillData.skillId === attacker.comboSkillId) && attacker.subType === battle_interface_1.SubEntityType.ROLE) {
271
+ game.tryDizzinessAttack(attacker, defen);
272
+ }
273
+ // 回合制:受击方存活且配置了反击技能时,插入一次反击行动,等其走完攻击流程再结束攻击方行动
274
+ if (hurtData.hurt > 0 && defen.curHp > 0 && (hurtData.skillData.isNormalAttack || hurtData.skillData.skillId === attacker.comboSkillId) && defen.counterSkillId && !defen.isInBuffByTypes(BattleConfig_1.NoInAttackBuff) && attacker.subType === battle_interface_1.SubEntityType.ROLE) {
275
+ game.tryCounterAttack(attacker, defen);
276
+ }
277
+ }
157
278
  static onSubDragonBodyHit(entity, hurtData) {
158
279
  entity.setCurHp(entity.curHp - hurtData.hurt);
159
280
  entity.hitColorTime = BattleConfig_1.HitTime;
@@ -176,9 +297,6 @@ class EntityManager {
176
297
  this.behit(entity, hitData);
177
298
  HitDataPool_1.HitDataPool.despawn(hitData);
178
299
  }
179
- // ==============================
180
- // region EntityLifecycle 方法
181
- // ==============================
182
300
  static onBodyDead(dragon, dragonBody) {
183
301
  let index = -1;
184
302
  if (!dragonBody.mainId) {
@@ -187,7 +305,7 @@ class EntityManager {
187
305
  for (let i = 0; i < dragon.dragonBodyIds.length; i++) {
188
306
  const item = dragon.dragonBodyIds[i];
189
307
  if (item === dragonBody.ID) {
190
- dragon.dragonBodyIds.splice(i, 1);
308
+ BattleUtils_1.BattleUtils.removeAt(dragon.dragonBodyIds, i);
191
309
  index = i;
192
310
  dragon.targetDis -=
193
311
  (dragon.spacing * dragon.backExtraSpeed) /
@@ -1,4 +1,27 @@
1
1
  import { SkillCfg } from "../../../config/SkillCfg";
2
+ /** SkillData 权威值快照:cfg 会被战斗改写(词条/替换类 buff 直接修改字段),属权威值,深拷贝进快照 */
3
+ export interface ISkillDataValueSnapshot {
4
+ skillId: number;
5
+ cfg: SkillCfg;
6
+ atkDir: {
7
+ x: number;
8
+ y: number;
9
+ };
10
+ ignoreOid: number[];
11
+ target: number[];
12
+ realOwnerId: number;
13
+ parentID: number;
14
+ skillCurCd: number;
15
+ needReleaseCd: boolean;
16
+ maxCd: number;
17
+ skillNum: number;
18
+ allSkillNum: number;
19
+ atkProjectileNum: number;
20
+ ignoreNum: number;
21
+ fighterId: number;
22
+ isNormalAttack: boolean;
23
+ hitId: number;
24
+ }
2
25
  export declare class SkillData {
3
26
  skillId: number;
4
27
  cfg: SkillCfg;
@@ -20,4 +43,8 @@ export declare class SkillData {
20
43
  fighterId: number;
21
44
  isNormalAttack: boolean;
22
45
  hitId: number;
46
+ /** 获取权威值快照;out 可复用容器。cfg 属权威值,深拷贝隔离后续战斗改写 */
47
+ getValueSnapshot(out?: ISkillDataValueSnapshot): ISkillDataValueSnapshot;
48
+ /** 从权威值快照恢复,复用已有数组容器。cfg 拷贝回原对象(保持 this.cfg 身份不变) */
49
+ resetFromSnapshot(snapshot: ISkillDataValueSnapshot): void;
23
50
  }
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SkillData = void 0;
4
+ const BaseEntityData_1 = require("../entity/BaseEntityData");
4
5
  class SkillData {
5
6
  skillId = 0;
6
7
  cfg = null;
@@ -19,5 +20,47 @@ class SkillData {
19
20
  fighterId = 0;
20
21
  isNormalAttack = true;
21
22
  hitId = 0;
23
+ /** 获取权威值快照;out 可复用容器。cfg 属权威值,深拷贝隔离后续战斗改写 */
24
+ getValueSnapshot(out) {
25
+ const snapshot = out || {};
26
+ snapshot.skillId = this.skillId;
27
+ snapshot.cfg = (0, BaseEntityData_1.copySnapshotValue)(this.cfg, snapshot.cfg);
28
+ snapshot.atkDir = (0, BaseEntityData_1.copySnapshotValue)(this.atkDir, snapshot.atkDir);
29
+ snapshot.ignoreOid = (0, BaseEntityData_1.copySnapshotValue)(this.ignoreOid, snapshot.ignoreOid);
30
+ snapshot.target = (0, BaseEntityData_1.copySnapshotValue)(this.target, snapshot.target);
31
+ snapshot.realOwnerId = this.realOwnerId;
32
+ snapshot.parentID = this.parentID;
33
+ snapshot.skillCurCd = this.skillCurCd;
34
+ snapshot.needReleaseCd = this.needReleaseCd;
35
+ snapshot.maxCd = this.maxCd;
36
+ snapshot.skillNum = this.skillNum;
37
+ snapshot.allSkillNum = this.allSkillNum;
38
+ snapshot.atkProjectileNum = this.atkProjectileNum;
39
+ snapshot.ignoreNum = this.ignoreNum;
40
+ snapshot.fighterId = this.fighterId;
41
+ snapshot.isNormalAttack = this.isNormalAttack;
42
+ snapshot.hitId = this.hitId;
43
+ return snapshot;
44
+ }
45
+ /** 从权威值快照恢复,复用已有数组容器。cfg 拷贝回原对象(保持 this.cfg 身份不变) */
46
+ resetFromSnapshot(snapshot) {
47
+ this.skillId = snapshot.skillId;
48
+ this.cfg = (0, BaseEntityData_1.copySnapshotValue)(snapshot.cfg, this.cfg);
49
+ this.atkDir = (0, BaseEntityData_1.copySnapshotValue)(snapshot.atkDir, this.atkDir);
50
+ this.ignoreOid = (0, BaseEntityData_1.copySnapshotValue)(snapshot.ignoreOid, this.ignoreOid);
51
+ this.target = (0, BaseEntityData_1.copySnapshotValue)(snapshot.target, this.target);
52
+ this.realOwnerId = snapshot.realOwnerId;
53
+ this.parentID = snapshot.parentID;
54
+ this.skillCurCd = snapshot.skillCurCd;
55
+ this.needReleaseCd = snapshot.needReleaseCd;
56
+ this.maxCd = snapshot.maxCd;
57
+ this.skillNum = snapshot.skillNum;
58
+ this.allSkillNum = snapshot.allSkillNum;
59
+ this.atkProjectileNum = snapshot.atkProjectileNum;
60
+ this.ignoreNum = snapshot.ignoreNum;
61
+ this.fighterId = snapshot.fighterId;
62
+ this.isNormalAttack = snapshot.isNormalAttack;
63
+ this.hitId = snapshot.hitId;
64
+ }
22
65
  }
23
66
  exports.SkillData = SkillData;
@@ -29,7 +29,10 @@ class SkillEmitter {
29
29
  fighters[0] = targetFighter;
30
30
  }
31
31
  else {
32
- [fighters[0], fighters[index]] = [fighters[index], fighters[0]];
32
+ // 解构交换每次都会分配一个 2 元数组,改用临时变量
33
+ const tmp = fighters[0];
34
+ fighters[0] = fighters[index];
35
+ fighters[index] = tmp;
33
36
  }
34
37
  }
35
38
  fight.needFindTarget = true;
@@ -9,6 +9,9 @@ export interface IProjectileEmitter1 extends IProjectileEmitter {
9
9
  y: number;
10
10
  };
11
11
  needCheckAttackRange: boolean;
12
+ acceleration: number;
13
+ maxMoveSpeed: number;
14
+ bottomLimit: number;
12
15
  }
13
16
  export interface BounceHitRender {
14
17
  playBounceHitAction(hitSide: number): void;
@@ -92,6 +92,14 @@ let ProjectileEmitter1 = class ProjectileEmitter1 extends ProjectileEmitter_1.Pr
92
92
  }
93
93
  static onUpdate(projectile, dt) {
94
94
  let emitter = projectile.emitter;
95
+ //匀加速:每帧先按加速度累加当前速度(带上限),再以该速度位移
96
+ if (dt > 0 && emitter.acceleration) {
97
+ let speed = projectile.moveSpeed + emitter.acceleration * dt;
98
+ if (emitter.maxMoveSpeed > 0 && speed > emitter.maxMoveSpeed) {
99
+ speed = emitter.maxMoveSpeed;
100
+ }
101
+ projectile.moveSpeed = Math.max(0, speed);
102
+ }
95
103
  BVec2_1.BVecHelper.set(emitter.lastPoint, projectile.x, projectile.y);
96
104
  if (emitter.needCheckAttackRange) {
97
105
  if (this.checkOutAttackRange(projectile)) {
@@ -102,6 +110,7 @@ let ProjectileEmitter1 = class ProjectileEmitter1 extends ProjectileEmitter_1.Pr
102
110
  const top = projectile.game.halfHeight;
103
111
  const left = -projectile.game.halfWidth;
104
112
  const right = projectile.game.halfWidth;
113
+ const bottom = emitter.bottomLimit;
105
114
  let reflected = false;
106
115
  if (emitter.backNum > 0) {
107
116
  if (projectile.y > top) {
@@ -110,6 +119,12 @@ let ProjectileEmitter1 = class ProjectileEmitter1 extends ProjectileEmitter_1.Pr
110
119
  emitter.shootDir.y = -emitter.shootDir.y;
111
120
  reflected = true;
112
121
  }
122
+ if (projectile.y < bottom) {
123
+ projectile.y = bottom;
124
+ projectile.setPosition(projectile.x, bottom);
125
+ emitter.shootDir.y = -emitter.shootDir.y;
126
+ reflected = true;
127
+ }
113
128
  if (projectile.x > right) {
114
129
  projectile.x = right;
115
130
  projectile.setPosition(right, projectile.y);
@@ -124,8 +139,8 @@ let ProjectileEmitter1 = class ProjectileEmitter1 extends ProjectileEmitter_1.Pr
124
139
  }
125
140
  if (reflected) {
126
141
  let entity = projectile.game.getEntityLogic(projectile.owner);
127
- projectile.game.emit(entity, EntityEvent_1.EntityEvent.ProjectileBoundary, projectile);
128
- projectile.game.emit(entity, EntityEvent_1.EntityEvent.ProjectileBounce, projectile);
142
+ projectile.game.emit1(entity, EntityEvent_1.EntityEvent.ProjectileBoundary, projectile);
143
+ projectile.game.emit1(entity, EntityEvent_1.EntityEvent.ProjectileBounce, projectile);
129
144
  emitter.backNum--;
130
145
  this._updateAngle(projectile);
131
146
  if (emitter.backNum <= 0) {
@@ -140,6 +155,16 @@ let ProjectileEmitter1 = class ProjectileEmitter1 extends ProjectileEmitter_1.Pr
140
155
  emitter.backNum = p9 || 0;
141
156
  emitter.ignoreNum = p10 || 0;
142
157
  emitter.needCheckAttackRange = p11 && p11[0] === 1;
158
+ emitter.acceleration = p11 && p11[1] || 0;
159
+ emitter.maxMoveSpeed = p11 && p11[2] || 0;
160
+ if (emitter.maxMoveSpeed > 0 && owner.moveSpeed > emitter.maxMoveSpeed) {
161
+ owner.moveSpeed = emitter.maxMoveSpeed;
162
+ }
163
+ emitter.bottomLimit = -owner.game.halfHeight;
164
+ if (!owner.game.rolePosType) {
165
+ const mainrole = owner.game.getEntityLogic(owner.game.getMainRoleBattleId());
166
+ emitter.bottomLimit = mainrole.getBodyRadius() + mainrole.y + mainrole.shape.offset.y * mainrole.scaleY;
167
+ }
143
168
  BVec2_1.BVecHelper.set(emitter.lastPoint, owner.x, owner.y);
144
169
  this._updateAngle(owner);
145
170
  }
@@ -152,7 +177,10 @@ let ProjectileEmitter1 = class ProjectileEmitter1 extends ProjectileEmitter_1.Pr
152
177
  ignoreNum: 0,
153
178
  lastPoint: { x: 0, y: 0 },
154
179
  needCheckAttackRange: false,
180
+ acceleration: 0,
181
+ maxMoveSpeed: 0,
155
182
  attackRange: 0,
183
+ bottomLimit: 0,
156
184
  };
157
185
  }
158
186
  };
@@ -31,7 +31,7 @@ let ProjectileEmitter10 = class ProjectileEmitter10 extends ProjectileEmitter_1.
31
31
  // projectile.shape && (projectile.shape.isActive = true);
32
32
  projectile.lifeTime = 99999;
33
33
  let role = projectile.game.getEntityLogic(projectile.owner);
34
- projectile.game.emit(role, EntityEvent_1.EntityEvent.ProjectileStay, projectile);
34
+ projectile.game.emit1(role, EntityEvent_1.EntityEvent.ProjectileStay, projectile);
35
35
  }
36
36
  else {
37
37
  projectile.game.emit(GameEvent_1.GameEvent.ProjectileToDead, projectile);
@@ -65,7 +65,7 @@ let ProjectileEmitter10 = class ProjectileEmitter10 extends ProjectileEmitter_1.
65
65
  emitter.backTime = 0;
66
66
  emitter.state = this.STATE_BACK_TO_OWNER;
67
67
  if (emitter.backMoveSpeed <= 0) {
68
- projectile.game.emit(owner, EntityEvent_1.EntityEvent.ProjectileBackToOwner, projectile);
68
+ projectile.game.emit1(owner, EntityEvent_1.EntityEvent.ProjectileBackToOwner, projectile);
69
69
  projectile.game.emit(GameEvent_1.GameEvent.ProjectileToDead, projectile);
70
70
  return false;
71
71
  }
@@ -45,6 +45,7 @@ export interface IProjectileEmitter13 extends IProjectileEmitter {
45
45
  boundTime: number;
46
46
  isFindEnemy: number;
47
47
  warningEffectId: number;
48
+ delayTime: number;
48
49
  }
49
50
  export declare class ProjectileEmitter13 extends ProjectileEmitter {
50
51
  static getPoints(out: BVec2[], startX: number, startY: number, endX: number, endY: number, dis: number, p11?: number[]): BVec2[];
@@ -165,6 +165,15 @@ let ProjectileEmitter13 = class ProjectileEmitter13 extends ProjectileEmitter_1.
165
165
  }
166
166
  static onUpdate(owner, dt) {
167
167
  const emitter = owner.emitter;
168
+ //弹跳延迟: 停在弹跳点等待, 延迟结束后用本帧剩余时间继续运动
169
+ if (emitter.delayTime > 0) {
170
+ emitter.delayTime -= dt;
171
+ if (emitter.delayTime > 0) {
172
+ return false;
173
+ }
174
+ dt = -emitter.delayTime;
175
+ emitter.delayTime = 0;
176
+ }
168
177
  if (emitter.curTime < emitter.totalTime) {
169
178
  emitter.curTime += dt;
170
179
  let t = emitter.curTime / emitter.totalTime;
@@ -227,7 +236,7 @@ let ProjectileEmitter13 = class ProjectileEmitter13 extends ProjectileEmitter_1.
227
236
  target.getBeHitPoint(owner.owner, ProjectileEmitterShared_1.tempVec22);
228
237
  if (!this._isPointInSceneRect(ProjectileEmitterShared_1.tempVec22.x, ProjectileEmitterShared_1.tempVec22.y)
229
238
  || !this._isPointInBoundDistance(owner, ProjectileEmitterShared_1.tempVec22.x, ProjectileEmitterShared_1.tempVec22.y, boundDis.minSqr, boundDis.maxSqr)) {
230
- subList.splice(i, 1);
239
+ BattleUtils_1.BattleUtils.removeAt(subList, i);
231
240
  }
232
241
  }
233
242
  }
@@ -254,7 +263,17 @@ let ProjectileEmitter13 = class ProjectileEmitter13 extends ProjectileEmitter_1.
254
263
  // let totalDistance = this.calculateCubicBezierLength(emitter.startPoint, emitter.controlPoint1, emitter.controlPoint2, emitter.endPoint);
255
264
  emitter.totalTime = emitter.boundTime;
256
265
  emitter.curTime = 0;
257
- owner.lifeTime = emitter.totalTime + 0.2;
266
+ //弹跳延迟 p11[12] 从技能配置实时读取, 不在发射器参数里冗余保存
267
+ const index = owner.impact[owner.impact.length - 1];
268
+ owner.impact.length = owner.impact.length - 1;
269
+ const impactCfg = owner.game.getSkillImpactByImpactPath(owner.impact);
270
+ owner.impact.push(index);
271
+ const bounceDelayTime = impactCfg && impactCfg.p11 && impactCfg.p11[12] || 0;
272
+ emitter.delayTime = bounceDelayTime;
273
+ owner.lifeTime = bounceDelayTime + emitter.totalTime + 0.2;
274
+ if (emitter.warningEffectId) {
275
+ owner.game.emit(GameEvent_1.GameEvent.ShowProjectileWarning, owner.ID, emitter.warningEffectId, emitter.endPoint, owner.owner, owner.scaleX, owner.scaleY, owner.lifeTime);
276
+ }
258
277
  }
259
278
  static calculateParabolicProgress(t) {
260
279
  const speedBias = 0.10;
@@ -280,6 +299,7 @@ let ProjectileEmitter13 = class ProjectileEmitter13 extends ProjectileEmitter_1.
280
299
  emitter.boundMaxDis = p11 && p11[6] || 400;
281
300
  emitter.boundTime = p11 && p11[7] || 1;
282
301
  emitter.isFindEnemy = p11 && p11[4] || 0;
302
+ emitter.delayTime = 0;
283
303
  emitter.curTime = 0;
284
304
  emitter.bounceCount = p9 || 0;
285
305
  emitter.scaleRatio = (p10 || 0) / 10000;
@@ -330,6 +350,8 @@ let ProjectileEmitter13 = class ProjectileEmitter13 extends ProjectileEmitter_1.
330
350
  target.getBeHitPoint(owner.owner, emitter.endPoint);
331
351
  }
332
352
  }
353
+ // 目标x位置需要添加偏移量
354
+ emitter.endPoint.x += emitter.offsetDegress;
333
355
  }
334
356
  else {
335
357
  emitter.endPoint.x = owner.x;
@@ -422,6 +444,7 @@ let ProjectileEmitter13 = class ProjectileEmitter13 extends ProjectileEmitter_1.
422
444
  boundMaxDis: 400,
423
445
  boundTime: 0.5,
424
446
  isFindEnemy: 0,
447
+ delayTime: 0,
425
448
  };
426
449
  }
427
450
  };
@@ -54,7 +54,7 @@ let ProjectileEmitter15 = class ProjectileEmitter15 extends ProjectileEmitter_1.
54
54
  const halfWidth = projectile.game.halfWidth;
55
55
  if (!emitter.isTriggerBound && (projectile.y > halfHeight || projectile.x > halfWidth || projectile.x < -halfWidth)) {
56
56
  let entity = projectile.game.getEntityLogic(projectile.owner);
57
- projectile.game.emit(entity, EntityEvent_1.EntityEvent.ProjectileBoundary, projectile);
57
+ projectile.game.emit1(entity, EntityEvent_1.EntityEvent.ProjectileBoundary, projectile);
58
58
  emitter.isTriggerBound = true;
59
59
  }
60
60
  return false;
@@ -25,7 +25,7 @@ let ProjectileEmitter2 = class ProjectileEmitter2 extends ProjectileEmitter_1.Pr
25
25
  const halfWidth = projectile.game.halfWidth;
26
26
  if (!emitter.isTriggerBound && (projectile.y > halfHeight || projectile.x > halfWidth || projectile.x < -halfWidth)) {
27
27
  let entity = projectile.game.getEntityLogic(projectile.owner);
28
- projectile.game.emit(entity, EntityEvent_1.EntityEvent.ProjectileBoundary, projectile);
28
+ projectile.game.emit1(entity, EntityEvent_1.EntityEvent.ProjectileBoundary, projectile);
29
29
  emitter.isTriggerBound = true;
30
30
  }
31
31
  return false;