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
@@ -76,22 +76,20 @@ let MonitorBuff = class MonitorBuff extends BaseBuff_1.BaseBuff {
76
76
  }
77
77
  if (filter === 1) {
78
78
  let hitdata = tparam;
79
- if (hitdata) {
80
- if (hitdata.beHiter) {
81
- if (Array.isArray(hitdata.beHiter)) {
82
- fighter = [...hitdata.beHiter];
83
- if (impact.target[1] && impact.target[1] < fighter.length) {
84
- fighter = entity.game.getRandomSDiffInArray(fighter, impact.target[1]);
85
- }
86
- }
87
- else {
88
- fighter = [hitdata.beHiter];
79
+ if (hitdata && hitdata.beHiter) {
80
+ if (Array.isArray(hitdata.beHiter)) {
81
+ fighter = [...hitdata.beHiter];
82
+ if (impact.target[1] && impact.target[1] < fighter.length) {
83
+ fighter = entity.game.getRandomSDiffInArray(fighter, impact.target[1]);
89
84
  }
90
85
  }
91
- else if (hitdata instanceof FighterData_1.default) {
92
- fighter = [hitdata];
86
+ else {
87
+ fighter = [hitdata.beHiter];
93
88
  }
94
89
  }
90
+ else if (hitdata && hitdata instanceof FighterData_1.default) {
91
+ fighter = [hitdata];
92
+ }
95
93
  else if (entity.attackTarget) {
96
94
  let attackTarget = entity.game.getEntityLogic(entity.attackTarget);
97
95
  if (attackTarget) {
@@ -0,0 +1,3 @@
1
+ import { BaseBuff } from "./BaseBuff";
2
+ export declare class PosionBanCureBuff extends BaseBuff {
3
+ }
@@ -0,0 +1,18 @@
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
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.PosionBanCureBuff = void 0;
10
+ const BuffCfg_1 = require("../../../../config/BuffCfg");
11
+ const BuffMgr_1 = require("../BuffMgr");
12
+ const BaseBuff_1 = require("./BaseBuff");
13
+ let PosionBanCureBuff = class PosionBanCureBuff extends BaseBuff_1.BaseBuff {
14
+ };
15
+ exports.PosionBanCureBuff = PosionBanCureBuff;
16
+ exports.PosionBanCureBuff = PosionBanCureBuff = __decorate([
17
+ BuffMgr_1.Buff.cacheBuff(BuffCfg_1.BuffDefine.PosionBanCure)
18
+ ], PosionBanCureBuff);
@@ -11,5 +11,6 @@ import { BaseBuff } from "./BaseBuff";
11
11
  export declare class PosionBuff extends BaseBuff {
12
12
  static onEnter(entity: FighterData, buff: Buff.BuffItem): void;
13
13
  static onExecute(entity: FighterData, buff: Buff.BuffItem, dt: number): boolean;
14
+ static onExit(entity: FighterData, buff: Buff.BuffItem): void;
14
15
  static layerChange(entity: FighterData, buff: Buff.BuffItem, layer: number): void;
15
16
  }
@@ -8,6 +8,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  exports.PosionBuff = void 0;
10
10
  const BuffCfg_1 = require("../../../../config/BuffCfg");
11
+ const Cfg_1 = require("../../../../config/Cfg");
11
12
  const Property_1 = require("../../../property/Property");
12
13
  const EntityEvent_1 = require("../../event/EntityEvent");
13
14
  const GameEvent_1 = require("../../event/GameEvent");
@@ -39,8 +40,9 @@ let PosionBuff = class PosionBuff extends BaseBuff_1.BaseBuff {
39
40
  const roleId = entity.game.roles[entity.playerId];
40
41
  const role = entity.game.getEntityLogic(roleId);
41
42
  let noreduce = impact.p9 ? entity.game.IsHitOrNot(impact.p9) : false;
42
- const leftlayer = noreduce ? buff.buffLayer : Math.floor(buff.buffLayer * (10000 - impact.p8) / 10000);
43
- const reduce = Math.max(0, buff.buffLayer - leftlayer);
43
+ const normalLeftLayer = Math.floor(buff.buffLayer * (10000 - impact.p8) / 10000);
44
+ const leftlayer = noreduce ? buff.buffLayer : normalLeftLayer;
45
+ const reduce = Math.max(0, buff.buffLayer - normalLeftLayer);
44
46
  buff.buffLayer = leftlayer;
45
47
  entity.udpateEffectInfo(buff.buffTypeId);
46
48
  entity.game.emit(GameEvent_1.GameEvent.SkillInitSkillById, role, useSkillId);
@@ -64,19 +66,28 @@ let PosionBuff = class PosionBuff extends BaseBuff_1.BaseBuff {
64
66
  }
65
67
  return true;
66
68
  }
69
+ static onExit(entity, buff) {
70
+ entity.game.emit(GameEvent_1.GameEvent.BuffClearByType, entity, BuffCfg_1.BuffDefine.PosionBanCure, false, 0);
71
+ }
67
72
  static layerChange(entity, buff, layer) {
68
73
  // let extraLayer = buff.buffValue || 0;
69
74
  const impact = (0, BuffMgr_1.getBuffImpact)((0, BuffMgr_1.getBuffCaster)(entity, buff), buff);
70
75
  const debuffRatio = impact.p7 / 10000;
71
76
  const reallayer = (buff.buffValue || 1);
72
- const extraAddBuffs = entity.getBuffsByType(BuffCfg_1.BuffDefine.PosionExtraAdd);
77
+ const caster = (0, BuffMgr_1.getBuffCaster)(entity, buff);
78
+ const extraAddBuffs = caster.getBuffsByType(BuffCfg_1.BuffDefine.PosionExtraAdd);
73
79
  buff.buffLayer += Math.floor(reallayer * (1 + debuffRatio));
74
80
  if (extraAddBuffs && extraAddBuffs.length > 0) {
75
81
  const extraBuff = extraAddBuffs[0];
76
- const extraImpact = (0, BuffMgr_1.getBuffImpact)((0, BuffMgr_1.getBuffCaster)(entity, extraBuff), extraBuff);
82
+ const extraImpact = (0, BuffMgr_1.getBuffImpact)(caster, extraBuff);
77
83
  const extraLayer = entity.game.randomRange(extraImpact.p5, extraImpact.p6);
78
84
  buff.buffLayer += extraLayer;
79
85
  }
86
+ const buffCfg = Cfg_1.Cfg.Buff.get(buff.buffTypeId);
87
+ const maxLayer = (entity.game.gameContext.buffMaxLayer[buff.buffTypeId] || buffCfg.maxLayer);
88
+ if (buff.buffLayer > maxLayer) {
89
+ buff.buffLayer = maxLayer;
90
+ }
80
91
  }
81
92
  };
82
93
  exports.PosionBuff = PosionBuff;
@@ -357,7 +357,7 @@ let ProjectileOrbLinkBuff = class ProjectileOrbLinkBuff extends BaseBuff_1.BaseB
357
357
  group.time -= dt;
358
358
  if (group.time <= 0) {
359
359
  this.killOrbsByIds(entity, group.orbIds);
360
- groups.splice(i, 1);
360
+ BattleUtils_1.BattleUtils.removeAt(groups, i);
361
361
  }
362
362
  }
363
363
  }
@@ -57,7 +57,8 @@ let ProjectileScaleUpBuff = class ProjectileScaleUpBuff extends BaseBuff_1.BaseB
57
57
  if (!buff.context.projectileMap) {
58
58
  buff.context.projectileMap = {};
59
59
  }
60
- if (skillId === projectile.skillId && !projectile.parentID) {
60
+ let includeSub = impact.p7;
61
+ if (skillId === projectile.skillId && (includeSub || !projectile.parentID)) {
61
62
  if (!buff.context.projectileMap[projectile.ID]) {
62
63
  buff.context.projectileMap[projectile.ID] = projectile.scaleY;
63
64
  }
@@ -72,7 +73,8 @@ let ProjectileScaleUpBuff = class ProjectileScaleUpBuff extends BaseBuff_1.BaseB
72
73
  const buff = buffs[i];
73
74
  const impact = (0, BuffMgr_1.getBuffImpact)((0, BuffMgr_1.getBuffCaster)(entity, buff), buff);
74
75
  const skillId = impact.p5 || 0;
75
- if (skillId === projectile.skillId && !projectile.parentID) {
76
+ let includeSub = impact.p7;
77
+ if (skillId === projectile.skillId && (includeSub || !projectile.parentID)) {
76
78
  if (buff.context.projectileMap && buff.context.projectileMap[projectile.ID]) {
77
79
  delete buff.context.projectileMap[projectile.ID];
78
80
  }
@@ -8,11 +8,19 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  const BuffCfg_1 = require("../../../../config/BuffCfg");
10
10
  const EntityEvent_1 = require("../../event/EntityEvent");
11
+ const GameEvent_1 = require("../../event/GameEvent");
11
12
  const BuffMgr_1 = require("../BuffMgr");
12
13
  const BaseBuff_1 = require("./BaseBuff");
13
14
  let SameHitAddDamageBuff = class SameHitAddDamageBuff extends BaseBuff_1.BaseBuff {
14
15
  static onEnter(entity, buff) {
15
16
  buff.curBuffTime = 0;
17
+ //需要移除其他目标buff
18
+ for (let i = 0; i < entity.game.gameContext.fighters.length; i++) {
19
+ let fighter = entity.game.gameContext.fighters[i];
20
+ if (fighter.ID !== entity.ID) {
21
+ entity.game.emit(GameEvent_1.GameEvent.BuffClearByType, fighter, BuffCfg_1.BuffDefine.SameHitAddDamage);
22
+ }
23
+ }
16
24
  entity.game.on(entity.ID, EntityEvent_1.EntityEvent.SkillHurtCalStart, this.onCalSkillStart, this);
17
25
  entity.game.on(entity.ID, EntityEvent_1.EntityEvent.SkillHurtCalEnd, this.onCalSkillEnd, this);
18
26
  }
@@ -32,7 +32,7 @@ let SlayBuff = class SlayBuff extends BaseBuff_1.BaseBuff {
32
32
  const impact = (0, BuffMgr_1.getBuffImpact)((0, BuffMgr_1.getBuffCaster)(entity, buff), buff);
33
33
  if (impact.p5) {
34
34
  const param = SkillEffectByIdParamsPool_1.SkillEffectByIdParamsPool.pop();
35
- entity.getBodyTop(param.pos);
35
+ entity.getBodyCenter(param.pos);
36
36
  entity.game.emit(GameEvent_1.GameEvent.ShowSkillEffectById, impact.p5, entity, param);
37
37
  }
38
38
  }
@@ -5,7 +5,7 @@ import { BaseBuff } from "./BaseBuff";
5
5
  export default class TimeAddDamageBuff extends BaseBuff {
6
6
  static onEnter(entity: FighterData, buff: Buff.BuffItem): void;
7
7
  static onExit(entity: FighterData, buff: Buff.BuffItem): void;
8
+ static onExecute(entity: FighterData, buff: Buff.BuffItem, dt: number): boolean;
8
9
  static onProjectileCreate(entity: FighterData, projectile: ProjectileData): void;
9
- static onProjectileBeforeCross(entity: FighterData, projectile: ProjectileData): void;
10
10
  static onProjectileDead(entity: FighterData, projectile: ProjectileData): void;
11
11
  }
@@ -7,6 +7,7 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
7
7
  };
8
8
  Object.defineProperty(exports, "__esModule", { value: true });
9
9
  const BuffCfg_1 = require("../../../../config/BuffCfg");
10
+ const battle_interface_1 = require("../../battle.interface");
10
11
  const EntityEvent_1 = require("../../event/EntityEvent");
11
12
  const BuffMgr_1 = require("../BuffMgr");
12
13
  const BaseBuff_1 = require("./BaseBuff");
@@ -14,31 +15,44 @@ let TimeAddDamageBuff = class TimeAddDamageBuff extends BaseBuff_1.BaseBuff {
14
15
  static onEnter(entity, buff) {
15
16
  buff.curBuffTime = 0;
16
17
  entity.game.on(entity.ID, EntityEvent_1.EntityEvent.ProjectileCreate, this.onProjectileCreate, this);
17
- entity.game.on(entity.ID, EntityEvent_1.EntityEvent.ProjectileBeforeCross, this.onProjectileBeforeCross, this);
18
18
  entity.game.on(entity.ID, EntityEvent_1.EntityEvent.ProjectileDead, this.onProjectileDead, this);
19
19
  }
20
20
  static onExit(entity, buff) {
21
21
  entity.game.off(entity.ID, EntityEvent_1.EntityEvent.ProjectileCreate, this.onProjectileCreate, this);
22
- entity.game.off(entity.ID, EntityEvent_1.EntityEvent.ProjectileBeforeCross, this.onProjectileBeforeCross, this);
23
22
  entity.game.off(entity.ID, EntityEvent_1.EntityEvent.ProjectileDead, this.onProjectileDead, this);
24
23
  }
25
- static onProjectileCreate(entity, projectile) {
26
- let buffs = entity.getBuffsByType(BuffCfg_1.BuffDefine.TimeAddDamage);
27
- if (!buffs || !buffs.length)
28
- return;
29
- for (let i = 0; i < buffs.length; i++) {
30
- let buff = buffs[i];
24
+ static onExecute(entity, buff, dt) {
25
+ buff.curBuffTime += dt;
26
+ if (buff.context.projectileMap) {
31
27
  const impact = (0, BuffMgr_1.getBuffImpact)((0, BuffMgr_1.getBuffCaster)(entity, buff), buff);
32
- let skillId = impact.p6;
33
- if (skillId === projectile.skillId && !projectile.parentID) {
34
- if (!buff.context.projectileMap) {
35
- buff.context.projectileMap = {};
28
+ for (let key in buff.context.projectileMap) {
29
+ const projectileID = +key;
30
+ const curProjectInfo = buff.context.projectileMap[projectileID];
31
+ if (!curProjectInfo)
32
+ continue;
33
+ if (curProjectInfo.maxDamage >= impact.p7)
34
+ continue;
35
+ curProjectInfo.time -= dt;
36
+ if (curProjectInfo.time <= 0) {
37
+ curProjectInfo.time = impact.p5;
38
+ const maxDamage = impact.p7;
39
+ const projectile = entity.game.getEntityLogic(projectileID, battle_interface_1.EntityType.PROJECTILE);
40
+ if (projectile) {
41
+ if (maxDamage > curProjectInfo.maxDamage) {
42
+ const addValue = Math.min(maxDamage - curProjectInfo.maxDamage, buff.buffValue);
43
+ projectile.extraHurtRatio += addValue;
44
+ curProjectInfo.maxDamage += addValue;
45
+ }
46
+ }
36
47
  }
37
- buff.context.projectileMap[projectile.ID] = buff.curBuffTime;
38
48
  }
39
49
  }
50
+ if (buff.buffTime >= 0 && buff.curBuffTime > buff.buffTime) {
51
+ return false;
52
+ }
53
+ return true;
40
54
  }
41
- static onProjectileBeforeCross(entity, projectile) {
55
+ static onProjectileCreate(entity, projectile) {
42
56
  let buffs = entity.getBuffsByType(BuffCfg_1.BuffDefine.TimeAddDamage);
43
57
  if (!buffs || !buffs.length)
44
58
  return;
@@ -46,19 +60,13 @@ let TimeAddDamageBuff = class TimeAddDamageBuff extends BaseBuff_1.BaseBuff {
46
60
  let buff = buffs[i];
47
61
  const impact = (0, BuffMgr_1.getBuffImpact)((0, BuffMgr_1.getBuffCaster)(entity, buff), buff);
48
62
  let skillId = impact.p6;
49
- let n = impact.p5;
50
- let buffTime = buff.curBuffTime;
51
- let maxDamage = impact.p7 || 0;
52
- if (skillId === projectile.skillId && !projectile.parentID) {
53
- let startTime = buff.context.projectileMap[projectile.ID] || 0;
54
- let curDelay = buffTime - startTime;
55
- if (curDelay > 0) {
56
- let addDamage = buff.buffValue * Math.floor(curDelay / n);
57
- if (addDamage > maxDamage) {
58
- addDamage = maxDamage;
59
- }
60
- projectile.extraHurtRatio += addDamage;
63
+ const maxDamage = impact.p7 || 0;
64
+ const includeSub = impact.p8 || 0;
65
+ if (skillId === projectile.skillId && (includeSub || !projectile.parentID)) {
66
+ if (!buff.context.projectileMap) {
67
+ buff.context.projectileMap = {};
61
68
  }
69
+ buff.context.projectileMap[projectile.ID] = { startTime: buff.curBuffTime, maxDamage: 0, time: impact.p5 || 0.1 };
62
70
  }
63
71
  }
64
72
  }
@@ -70,7 +78,8 @@ let TimeAddDamageBuff = class TimeAddDamageBuff extends BaseBuff_1.BaseBuff {
70
78
  let buff = buffs[i];
71
79
  const impact = (0, BuffMgr_1.getBuffImpact)((0, BuffMgr_1.getBuffCaster)(entity, buff), buff);
72
80
  let skillId = impact.p6;
73
- if (skillId === projectile.skillId && !projectile.parentID) {
81
+ let includeSub = impact.p8;
82
+ if (skillId === projectile.skillId && (includeSub || !projectile.parentID)) {
74
83
  if (buff.context.projectileMap[projectile.ID]) {
75
84
  delete buff.context.projectileMap[projectile.ID];
76
85
  }
@@ -30,6 +30,7 @@ import "./DamMarkBuff";
30
30
  import "./DebuffAddAttrBuff";
31
31
  import "./DeltaUseSkillBuff";
32
32
  import "./DiceAddAttrBuff";
33
+ import "./DiceAddCritBuff";
33
34
  import "./DisarmBuff";
34
35
  import "./DizzinessBuff";
35
36
  import "./DominationBuff";
@@ -37,6 +38,7 @@ import "./ElectricMarkBuff";
37
38
  import "./ElectrifyBuff";
38
39
  import "./EnemyBuff1Buff";
39
40
  import "./EnemyRatioBuff";
41
+ import "./FireHurtLayerBuff";
40
42
  import "./FixedProjectileNumBuff";
41
43
  import "./FollowMainEntityBuff";
42
44
  import "./ForceTargetBuff";
@@ -44,6 +46,7 @@ import "./FrozenBuff";
44
46
  import "./HaulBuff";
45
47
  import "./HightHpAddCritBuff";
46
48
  import "./HitBoundAddDamageBuff";
49
+ import "./HitBoundAddScaleBuff";
47
50
  import "./HitEnemyAddDamBuff";
48
51
  import "./HornBuff";
49
52
  import "./HpAddDamageBuff";
@@ -80,6 +83,7 @@ import "./ModifyProjectileAttrBuff";
80
83
  import "./MonitorBuff";
81
84
  import "./NotAllowSplitBuff";
82
85
  import "./ParalysisBuff";
86
+ import "./PosionBanCureBuff";
83
87
  import "./PosionBuff";
84
88
  import "./PosionExtraAddBuff";
85
89
  import "./PowerUpAddDamBuff";
@@ -8,7 +8,7 @@
8
8
  // Cocos 的资源系统会把 assets 下所有脚本加载一遍,所以引擎里天然成立;
9
9
  // Node 只执行从入口 import 可达的模块,不引这一下,注册表就是空的。
10
10
  //
11
- // 共 122 个模块。下面的 import 只为副作用,不需要用到导出。
11
+ // 共 126 个模块。下面的 import 只为副作用,不需要用到导出。
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  require("./AddActionTimeBuff");
14
14
  require("./AddAtrBuff");
@@ -42,6 +42,7 @@ require("./DamMarkBuff");
42
42
  require("./DebuffAddAttrBuff");
43
43
  require("./DeltaUseSkillBuff");
44
44
  require("./DiceAddAttrBuff");
45
+ require("./DiceAddCritBuff");
45
46
  require("./DisarmBuff");
46
47
  require("./DizzinessBuff");
47
48
  require("./DominationBuff");
@@ -49,6 +50,7 @@ require("./ElectricMarkBuff");
49
50
  require("./ElectrifyBuff");
50
51
  require("./EnemyBuff1Buff");
51
52
  require("./EnemyRatioBuff");
53
+ require("./FireHurtLayerBuff");
52
54
  require("./FixedProjectileNumBuff");
53
55
  require("./FollowMainEntityBuff");
54
56
  require("./ForceTargetBuff");
@@ -56,6 +58,7 @@ require("./FrozenBuff");
56
58
  require("./HaulBuff");
57
59
  require("./HightHpAddCritBuff");
58
60
  require("./HitBoundAddDamageBuff");
61
+ require("./HitBoundAddScaleBuff");
59
62
  require("./HitEnemyAddDamBuff");
60
63
  require("./HornBuff");
61
64
  require("./HpAddDamageBuff");
@@ -92,6 +95,7 @@ require("./ModifyProjectileAttrBuff");
92
95
  require("./MonitorBuff");
93
96
  require("./NotAllowSplitBuff");
94
97
  require("./ParalysisBuff");
98
+ require("./PosionBanCureBuff");
95
99
  require("./PosionBuff");
96
100
  require("./PosionExtraAddBuff");
97
101
  require("./PowerUpAddDamBuff");
@@ -1,3 +1,4 @@
1
+ import type { PoolItem, PoolSpawner } from "../../../framework/Pool";
1
2
  import { EntityType, SubEntityType } from "../battle.interface";
2
3
  import { ColliderShape } from "../collider/Collider";
3
4
  import type Game from "../Game";
@@ -78,10 +79,12 @@ export interface IBaseEntityValueSnapshot {
78
79
  x: number;
79
80
  y: number;
80
81
  }
81
- export default class BaseEntityData {
82
+ export default class BaseEntityData implements PoolItem {
82
83
  ID: number;
83
84
  game: Game;
84
85
  dataName: string;
86
+ /** 创建该实例的池生成器,回池时按它定位 */
87
+ spawner: PoolSpawner;
85
88
  entityType: EntityType;
86
89
  subType: SubEntityType;
87
90
  isPause: boolean;
@@ -103,6 +106,17 @@ export default class BaseEntityData {
103
106
  x: number;
104
107
  y: number;
105
108
  isDirty: number;
109
+ /**
110
+ * 回收:先归还碰撞体并标记死亡,再交给子类清理自身状态,
111
+ * 最后清理实体事件并断开 game 引用。
112
+ */
113
+ unuse(): void;
114
+ /** 子类在此清理自身运行时状态;此时碰撞体已归还、game 仍然有效 */
115
+ protected onUnuse(): void;
116
+ /** 取出时由工厂或快照重建状态,基类无需处理 */
117
+ reuse(..._param: any[]): void;
118
+ /** 池裁剪时销毁实例;实体没有额外资源需要释放 */
119
+ destroy(): void;
106
120
  setPosition(x: number, y: number): void;
107
121
  setScale(scaleX: number, scaleY: number): void;
108
122
  setAngle(angle: number): void;
@@ -19,6 +19,8 @@ class BaseEntityData {
19
19
  ID = -1;
20
20
  game = null;
21
21
  dataName = "";
22
+ /** 创建该实例的池生成器,回池时按它定位 */
23
+ spawner = null;
22
24
  entityType = battle_interface_1.EntityType.NONE;
23
25
  subType = battle_interface_1.SubEntityType.NONE;
24
26
  isPause = false;
@@ -45,6 +47,31 @@ class BaseEntityData {
45
47
  x = 0;
46
48
  y = 0;
47
49
  isDirty = 1 /* LocalDirtyFlag.POSITION */ | 2 /* LocalDirtyFlag.SCALE */ | 4 /* LocalDirtyFlag.ROTATION */; //脏数据标记
50
+ // region 对象池
51
+ /**
52
+ * 回收:先归还碰撞体并标记死亡,再交给子类清理自身状态,
53
+ * 最后清理实体事件并断开 game 引用。
54
+ */
55
+ unuse() {
56
+ if (this.shape) {
57
+ ColliderPool_1.ColliderPool.despawn(this.shape);
58
+ this.shape = null;
59
+ }
60
+ this.isDead = true;
61
+ this.onUnuse();
62
+ const game = this.game;
63
+ if (game && game.gameContext.entityEvents.entityEventList.has(this.ID)) {
64
+ game.gameContext.entityEvents.entityEventList.delete(this.ID);
65
+ }
66
+ this.game = null;
67
+ }
68
+ /** 子类在此清理自身运行时状态;此时碰撞体已归还、game 仍然有效 */
69
+ onUnuse() { }
70
+ /** 取出时由工厂或快照重建状态,基类无需处理 */
71
+ reuse(..._param) { }
72
+ /** 池裁剪时销毁实例;实体没有额外资源需要释放 */
73
+ destroy() { }
74
+ // endregion
48
75
  // region 变换
49
76
  setPosition(x, y) {
50
77
  this.x = x;
@@ -1,4 +1,20 @@
1
- import FighterData from "./FighterData";
1
+ import FighterData, { IFighterValueSnapshot } from "./FighterData";
2
+ /** DragonBodyData 权威值快照 */
3
+ export interface IDragonBodyValueSnapshot extends IFighterValueSnapshot {
4
+ curDis: number;
5
+ targetDis: number;
6
+ isRotationHead: boolean;
7
+ ownerId: number;
8
+ bodyIndex: number;
9
+ renderHp: number;
10
+ mainId: number;
11
+ subIds: number[];
12
+ renderIndex: number;
13
+ isTail: boolean;
14
+ bodyDirX: number;
15
+ bodyDirY: number;
16
+ forceNoShape: boolean;
17
+ }
2
18
  export default class DragonBodyData extends FighterData {
3
19
  curDis: number;
4
20
  targetDis: number;
@@ -13,4 +29,6 @@ export default class DragonBodyData extends FighterData {
13
29
  bodyDirX: number;
14
30
  bodyDirY: number;
15
31
  forceNoShape: boolean;
32
+ getValueSnapshot(out?: IDragonBodyValueSnapshot): IDragonBodyValueSnapshot;
33
+ resetFromSnapshot(snapshot: IDragonBodyValueSnapshot): void;
16
34
  }
@@ -10,6 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const BattleUtils_1 = require("../util/BattleUtils");
13
+ const BaseEntityData_1 = require("./BaseEntityData");
13
14
  const FighterData_1 = __importDefault(require("./FighterData"));
14
15
  let DragonBodyData = class DragonBodyData extends FighterData_1.default {
15
16
  curDis = 0; //当前在线段上的距离
@@ -25,6 +26,39 @@ let DragonBodyData = class DragonBodyData extends FighterData_1.default {
25
26
  bodyDirX = 0;
26
27
  bodyDirY = 0;
27
28
  forceNoShape = false; //强制不创建碰撞体,主要用于龙身的装饰单位
29
+ getValueSnapshot(out) {
30
+ const snapshot = super.getValueSnapshot(out);
31
+ snapshot.curDis = this.curDis;
32
+ snapshot.targetDis = this.targetDis;
33
+ snapshot.isRotationHead = this.isRotationHead;
34
+ snapshot.ownerId = this.ownerId;
35
+ snapshot.bodyIndex = this.bodyIndex;
36
+ snapshot.renderHp = this.renderHp;
37
+ snapshot.mainId = this.mainId;
38
+ snapshot.subIds = (0, BaseEntityData_1.copySnapshotValue)(this.subIds, snapshot.subIds);
39
+ snapshot.renderIndex = this.renderIndex;
40
+ snapshot.isTail = this.isTail;
41
+ snapshot.bodyDirX = this.bodyDirX;
42
+ snapshot.bodyDirY = this.bodyDirY;
43
+ snapshot.forceNoShape = this.forceNoShape;
44
+ return snapshot;
45
+ }
46
+ resetFromSnapshot(snapshot) {
47
+ super.resetFromSnapshot(snapshot);
48
+ this.curDis = snapshot.curDis;
49
+ this.targetDis = snapshot.targetDis;
50
+ this.isRotationHead = snapshot.isRotationHead;
51
+ this.ownerId = snapshot.ownerId;
52
+ this.bodyIndex = snapshot.bodyIndex;
53
+ this.renderHp = snapshot.renderHp;
54
+ this.mainId = snapshot.mainId;
55
+ this.subIds = (0, BaseEntityData_1.copySnapshotValue)(snapshot.subIds, this.subIds);
56
+ this.renderIndex = snapshot.renderIndex;
57
+ this.isTail = snapshot.isTail;
58
+ this.bodyDirX = snapshot.bodyDirX;
59
+ this.bodyDirY = snapshot.bodyDirY;
60
+ this.forceNoShape = snapshot.forceNoShape;
61
+ }
28
62
  };
29
63
  DragonBodyData = __decorate([
30
64
  (0, BattleUtils_1.cacheFunction)("DragonBodyData")
@@ -1,4 +1,19 @@
1
- import FighterData from "./FighterData";
1
+ import FighterData, { IFighterValueSnapshot } from "./FighterData";
2
+ /** DragonData 权威值快照 */
3
+ export interface IDragonValueSnapshot extends IFighterValueSnapshot {
4
+ pathIndex: number;
5
+ curDis: number;
6
+ targetDis: number;
7
+ spacing: number;
8
+ backExtraSpeed: number;
9
+ reliveExtraSpeed: number;
10
+ loadBodyIndex: number;
11
+ curCreateTime: number;
12
+ isRotationHead: boolean;
13
+ bodyOtherPath: string;
14
+ jointNum: number;
15
+ dragonBodyIds: number[];
16
+ }
2
17
  export default class DragonData extends FighterData {
3
18
  pathIndex: number;
4
19
  curDis: number;
@@ -12,4 +27,6 @@ export default class DragonData extends FighterData {
12
27
  bodyOtherPath: string;
13
28
  jointNum: number;
14
29
  dragonBodyIds: number[];
30
+ getValueSnapshot(out?: IDragonValueSnapshot): IDragonValueSnapshot;
31
+ resetFromSnapshot(snapshot: IDragonValueSnapshot): void;
15
32
  }
@@ -10,6 +10,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
10
10
  };
11
11
  Object.defineProperty(exports, "__esModule", { value: true });
12
12
  const BattleUtils_1 = require("../util/BattleUtils");
13
+ const BaseEntityData_1 = require("./BaseEntityData");
13
14
  const FighterData_1 = __importDefault(require("./FighterData"));
14
15
  let DragonData = class DragonData extends FighterData_1.default {
15
16
  pathIndex = 0; //路径下标
@@ -24,6 +25,37 @@ let DragonData = class DragonData extends FighterData_1.default {
24
25
  bodyOtherPath = "";
25
26
  jointNum = 8; //关节数量
26
27
  dragonBodyIds = [];
28
+ getValueSnapshot(out) {
29
+ const snapshot = super.getValueSnapshot(out);
30
+ snapshot.pathIndex = this.pathIndex;
31
+ snapshot.curDis = this.curDis;
32
+ snapshot.targetDis = this.targetDis;
33
+ snapshot.spacing = this.spacing;
34
+ snapshot.backExtraSpeed = this.backExtraSpeed;
35
+ snapshot.reliveExtraSpeed = this.reliveExtraSpeed;
36
+ snapshot.loadBodyIndex = this.loadBodyIndex;
37
+ snapshot.curCreateTime = this.curCreateTime;
38
+ snapshot.isRotationHead = this.isRotationHead;
39
+ snapshot.bodyOtherPath = this.bodyOtherPath;
40
+ snapshot.jointNum = this.jointNum;
41
+ snapshot.dragonBodyIds = (0, BaseEntityData_1.copySnapshotValue)(this.dragonBodyIds, snapshot.dragonBodyIds);
42
+ return snapshot;
43
+ }
44
+ resetFromSnapshot(snapshot) {
45
+ super.resetFromSnapshot(snapshot);
46
+ this.pathIndex = snapshot.pathIndex;
47
+ this.curDis = snapshot.curDis;
48
+ this.targetDis = snapshot.targetDis;
49
+ this.spacing = snapshot.spacing;
50
+ this.backExtraSpeed = snapshot.backExtraSpeed;
51
+ this.reliveExtraSpeed = snapshot.reliveExtraSpeed;
52
+ this.loadBodyIndex = snapshot.loadBodyIndex;
53
+ this.curCreateTime = snapshot.curCreateTime;
54
+ this.isRotationHead = snapshot.isRotationHead;
55
+ this.bodyOtherPath = snapshot.bodyOtherPath;
56
+ this.jointNum = snapshot.jointNum;
57
+ this.dragonBodyIds = (0, BaseEntityData_1.copySnapshotValue)(snapshot.dragonBodyIds, this.dragonBodyIds);
58
+ }
27
59
  };
28
60
  DragonData = __decorate([
29
61
  (0, BattleUtils_1.cacheFunction)("DragonData")
@@ -2,11 +2,10 @@ import BaseEntityData from "./BaseEntityData";
2
2
  declare class _EntityPool {
3
3
  private _poolType;
4
4
  private _pool;
5
- private _spawnerMap;
6
5
  constructor();
7
6
  private initPool;
8
7
  private compCreateDelegate;
9
- despawn(item: BaseEntityData, clearData?: boolean): void;
8
+ despawn(item: BaseEntityData): void;
10
9
  spawn<T extends BaseEntityData>(id: number | string, ...param: any[]): T;
11
10
  }
12
11
  export declare const EntityPool: _EntityPool;