captainbattle 1.0.6 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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 +215 -11
  312. package/dist/register-all.d.ts +2 -0
  313. package/dist/register-all.js +2 -0
  314. package/package.json +1 -1
@@ -56,25 +56,33 @@ class PreAttackToAttack extends FighterStateTransition_1.BaseFighterStateTransit
56
56
  static toState = FighterStateType_1.StateType.ATTACK;
57
57
  static priority = 40;
58
58
  static onCheck(entity) {
59
+ let isOk = true;
59
60
  const skillData = entity.skillDatas[entity.curSkillId];
60
61
  if (entity.actionTime > 0 && skillData.needReleaseCd)
61
- return false;
62
- if (entity.isInBuffByTypes(BattleConfig_1.NoInAttackBuff) || entity.attackTarget <= 0)
63
- return false;
62
+ isOk = false;
63
+ if (isOk && entity.attackTarget <= 0)
64
+ isOk = false;
65
+ if (isOk && (entity.isInBuffByTypes(BattleConfig_1.NoInAttackBuff) || entity.attackTarget <= 0))
66
+ isOk = false;
64
67
  if (entity.subType === battle_interface_1.SubEntityType.DRAGON) {
65
68
  const dragon = entity;
66
- if (dragon.curDis - dragon.targetDis > 10)
67
- return false;
69
+ if (isOk && (dragon.curDis - dragon.targetDis > 10))
70
+ isOk = false;
68
71
  }
69
72
  const attackTarget = entity.game.getEntityLogic(entity.attackTarget);
70
- if (attackTarget.isDead || attackTarget.NoSelect(entity.normalSkillIds[0]))
71
- return false;
72
- if (!entity.game.gameModule.moduleState.autoFight && entity.campType !== battle_interface_1.CampType.ENEMY)
73
- return false;
74
- if (!entity.isTouchAtkDir && !entity.cfg.gunRotation) {
73
+ if (isOk && !attackTarget)
74
+ isOk = false;
75
+ if (isOk && (attackTarget.isDead || attackTarget.NoSelect(entity.normalSkillIds[0])))
76
+ isOk = false;
77
+ if (isOk && (!entity.game.gameModule.moduleState.autoFight && entity.campType !== battle_interface_1.CampType.ENEMY))
78
+ isOk = false;
79
+ if (isOk && (!entity.isTouchAtkDir && !entity.cfg.gunRotation)) {
75
80
  entity.horDir = entity.x < attackTarget.x ? -1 : 1;
76
81
  }
77
- return true;
82
+ if (!isOk && entity.curDoubleShootNum > 0) {
83
+ entity.curDoubleShootNum = 0;
84
+ }
85
+ return isOk;
78
86
  }
79
87
  }
80
88
  exports.PreAttackToAttack = PreAttackToAttack;
@@ -105,7 +113,11 @@ class AttackToPreAttack extends FighterStateTransition_1.BaseFighterStateTransit
105
113
  static toState = FighterStateType_1.StateType.PREATTACK;
106
114
  static priority = 40;
107
115
  static onCheck(entity) {
108
- return entity.actionTime <= 0 && IdleToPreAttack.onCheck(entity);
116
+ const isok = entity.actionTime <= 0 && IdleToPreAttack.onCheck(entity);
117
+ // if (!isok && entity.curDoubleShootNum > 0) {
118
+ // entity.curDoubleShootNum = 0;
119
+ // }
120
+ return isok;
109
121
  }
110
122
  }
111
123
  exports.AttackToPreAttack = AttackToPreAttack;
@@ -30,7 +30,7 @@ class BornState extends FighterStateShared_1.BaseFighterState {
30
30
  static isReEnter = false;
31
31
  static onEnter(entity) {
32
32
  entity.actionTime = (0, FighterStateShared_1.playAction)(entity, "appear", false);
33
- if (entity.cfg.type === battle_interface_1.SubEntityType.PET && entity.campType === battle_interface_1.CampType.MY) {
33
+ if (entity.cfg.type === battle_interface_1.SubEntityType.TOWER && entity.campType === battle_interface_1.CampType.MY) {
34
34
  entity.actionTime += 2;
35
35
  }
36
36
  entity.NoSelected = true;
@@ -58,7 +58,7 @@ class IdleState extends FighterStateShared_1.BaseFighterState {
58
58
  static profile = FighterStateProfiles_1.AnyFighterStateProfile;
59
59
  static onEnter(entity) {
60
60
  let name = (0, FighterStateShared_1.getActionNameByType)(entity.curState, entity.actionType);
61
- if (entity.campType === battle_interface_1.CampType.MY && entity.cfg.type === battle_interface_1.SubEntityType.ROLE) {
61
+ if ((entity.campType === battle_interface_1.CampType.MY || entity.game.isPVP) && entity.cfg.type === battle_interface_1.SubEntityType.ROLE) {
62
62
  name = "idle_" + entity.weaponType;
63
63
  }
64
64
  (0, FighterStateShared_1.playAction)(entity, name, true);
@@ -212,7 +212,12 @@ class AttackState extends FighterStateShared_1.BaseFighterState {
212
212
  entity.game.emit(entity, EntityEvent_1.EntityEvent.NormalAtkHitCrit, entity.curSkillId);
213
213
  }
214
214
  entity.curDoubleShootNum--;
215
- entity.game.emit(GameEvent_1.GameEvent.SkillResetSkillCd, entity, entity.curSkillId, entity.curDoubleShootNum > 0 && skillData.skillNum > 1 ? skillCd : 0);
215
+ let forceNum = 1;
216
+ if (entity.curDoubleShootNum > 0 && skillData.skillNum <= 1) {
217
+ forceNum = 0;
218
+ }
219
+ let forceCd = entity.curDoubleShootNum > 0 ? skillCd : 0;
220
+ entity.game.emit(GameEvent_1.GameEvent.SkillResetSkillCd, entity, entity.curSkillId, forceCd, forceNum);
216
221
  if (!anim || !anim.events || anim.events.length <= 0) {
217
222
  entity.game.call(GameEvent_1.GameEvent.UseSkillResult, entity, entity.curSkillId);
218
223
  entity.normalAtkTimes++;
@@ -252,7 +257,6 @@ class AttackState extends FighterStateShared_1.BaseFighterState {
252
257
  }
253
258
  static onExit(entity) {
254
259
  entity.timeScale = entity.game.gameModule.moduleState.timeScale;
255
- entity.curDoubleShootNum = 0;
256
260
  entity.game.emit(entity, EntityEvent_1.EntityEvent.AttackEnd, entity.curSkillId);
257
261
  }
258
262
  }
@@ -507,7 +511,7 @@ class PreAttackState extends FighterStateShared_1.BaseFighterState {
507
511
  if (!targetEntity)
508
512
  return;
509
513
  entity.getShootOriginPoition(FighterStateShared_1.tempVec2, entity.skillDatas[entity.curSkillId].cfg.attackName ? entity.skillDatas[entity.curSkillId].cfg.attackName[0] : null);
510
- if (targetEntity.subType === battle_interface_1.SubEntityType.ROLE && targetEntity.campType === battle_interface_1.CampType.MY) {
514
+ if (targetEntity.subType === battle_interface_1.SubEntityType.ROLE && targetEntity.campType === battle_interface_1.CampType.MY && entity.game.rolePosType === 0) {
511
515
  FighterStateShared_1.tempVec22.x = FighterStateShared_1.tempVec2.x;
512
516
  FighterStateShared_1.tempVec22.y = targetEntity.y;
513
517
  // EntityManager.getPursuePosition(targetEntity, entity, tempVec22);
@@ -1,4 +1,4 @@
1
- import FighterData from "../entity/FighterData";
1
+ import type FighterData from "../entity/FighterData";
2
2
  import { FighterStateProfile } from "./FighterStateProfiles";
3
3
  import { BaseFighterState } from "./FighterStateShared";
4
4
  import { StateType } from "./FighterStateType";
@@ -1,4 +1,4 @@
1
- import FighterData from "../entity/FighterData";
1
+ import type FighterData from "../entity/FighterData";
2
2
  import { FighterStateProfile } from "./FighterStateProfiles";
3
3
  import { BaseFighterState } from "./FighterStateShared";
4
4
  import { StateType } from "./FighterStateType";
@@ -4,4 +4,6 @@ export declare class FighterStateMachine {
4
4
  static update(entity: FighterData, dt: number): void;
5
5
  static change(entity: FighterData, state: StateType): void;
6
6
  static checkTransition(entity: FighterData): void;
7
+ /** 忽略凭证限制,由调用方手动触发一次转移检测 */
8
+ static checkTransitionManual(entity: FighterData): void;
7
9
  }
@@ -46,5 +46,11 @@ class FighterStateMachine {
46
46
  if (transition)
47
47
  FighterStateMachine.change(entity, transition.toState);
48
48
  }
49
+ /** 忽略凭证限制,由调用方手动触发一次转移检测 */
50
+ static checkTransitionManual(entity) {
51
+ const transition = (0, FighterStateRegistry_1.findFighterStateTransitionManually)(entity);
52
+ if (transition)
53
+ FighterStateMachine.change(entity, transition.toState);
54
+ }
49
55
  }
50
56
  exports.FighterStateMachine = FighterStateMachine;
@@ -1,3 +1,4 @@
1
+ import { StateType } from "./FighterStateType";
1
2
  /** 状态档案。一个档案描述一类实体可以使用哪些状态。 */
2
3
  export declare const enum FighterStateProfile {
3
4
  Fighter = 0,
@@ -6,7 +7,9 @@ export declare const enum FighterStateProfile {
6
7
  Dragon = 3,
7
8
  DragonBody = 4,
8
9
  Boss18110Call = 5,
9
- Boss18110 = 6
10
+ Boss18110 = 6,
11
+ /** 回合制:由回合调度器手动驱动状态转移 */
12
+ Turn = 7
10
13
  }
11
14
  export declare const AnyFighterStateProfile = -1;
12
15
  /**
@@ -15,4 +18,8 @@ export declare const AnyFighterStateProfile = -1;
15
18
  */
16
19
  export declare function registerFighterStateProfile(configId: number, profile: number): void;
17
20
  export declare function resolveFighterStateProfile(configId: number, defaultProfile: number): number;
21
+ /** 注册凭证(fsmType)下进入该状态必须由调用方手动检测转移 */
22
+ export declare function registerFighterProfileManualStates(profile: number, states: readonly StateType[]): void;
23
+ /** 当前凭证(fsmType)下,进入该状态是否必须手动检测 */
24
+ export declare function isFighterStateEntryManual(profile: number, state: StateType): boolean;
18
25
  export declare function getFighterStateMask(profile: number): number;
@@ -3,10 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AnyFighterStateProfile = void 0;
4
4
  exports.registerFighterStateProfile = registerFighterStateProfile;
5
5
  exports.resolveFighterStateProfile = resolveFighterStateProfile;
6
+ exports.registerFighterProfileManualStates = registerFighterProfileManualStates;
7
+ exports.isFighterStateEntryManual = isFighterStateEntryManual;
6
8
  exports.getFighterStateMask = getFighterStateMask;
7
9
  const FighterStateType_1 = require("./FighterStateType");
8
10
  exports.AnyFighterStateProfile = -1;
9
11
  const profileByConfigId = Object.create(null);
12
+ /** 凭证标识(fsmType)-> 只能手动进入的目标状态掩码(state 表示转移的 toState) */
13
+ const profileManualEntryStates = Object.create(null);
10
14
  /**
11
15
  * 为单个配置实体覆盖默认状态档案。
12
16
  * 注册发生在实体创建前,避免在 FsmSystem 的高频循环中读取配置 ID。
@@ -28,6 +32,15 @@ function makeStateMask(states) {
28
32
  }
29
33
  return mask;
30
34
  }
35
+ /** 注册凭证(fsmType)下进入该状态必须由调用方手动检测转移 */
36
+ function registerFighterProfileManualStates(profile, states) {
37
+ profileManualEntryStates[profile] = makeStateMask(states);
38
+ }
39
+ /** 当前凭证(fsmType)下,进入该状态是否必须手动检测 */
40
+ function isFighterStateEntryManual(profile, state) {
41
+ const mask = profileManualEntryStates[profile];
42
+ return mask !== undefined && (mask & (1 << state)) !== 0;
43
+ }
31
44
  //通用状态
32
45
  const normalFighterStates = makeStateMask([
33
46
  FighterStateType_1.StateType.BORN,
@@ -83,11 +96,27 @@ const boss18110Status = makeStateMask([
83
96
  FighterStateType_1.StateType.OUT,
84
97
  FighterStateType_1.StateType.PREATTACK,
85
98
  ]);
99
+ //回合制状态:能力与通用单位一致,攻击/移动的自动转移由回合调度器手动驱动
100
+ const turnStates = makeStateMask([
101
+ FighterStateType_1.StateType.BORN,
102
+ FighterStateType_1.StateType.IDLE,
103
+ FighterStateType_1.StateType.ATTACK,
104
+ FighterStateType_1.StateType.DEAD,
105
+ FighterStateType_1.StateType.WAIT,
106
+ FighterStateType_1.StateType.PREATTACK,
107
+ // 攻击结束后的收招状态
108
+ FighterStateType_1.StateType.BACK,
109
+ ]);
86
110
  registerFighterStateProfile(18110, 6 /* FighterStateProfile.Boss18110 */);
87
111
  registerFighterStateProfile(18112, 5 /* FighterStateProfile.Boss18110Call */);
88
112
  registerFighterStateProfile(18113, 5 /* FighterStateProfile.Boss18110Call */);
89
113
  registerFighterStateProfile(18114, 5 /* FighterStateProfile.Boss18110Call */);
90
114
  registerFighterStateProfile(18115, 5 /* FighterStateProfile.Boss18110Call */);
115
+ // 回合制:只有“进入前摇”必须由 TurnSchedulerSystem 手动触发;前摇→攻击、收招、回 IDLE 均自动
116
+ registerFighterProfileManualStates(7 /* FighterStateProfile.Turn */, [
117
+ FighterStateType_1.StateType.PREATTACK,
118
+ FighterStateType_1.StateType.IDLE,
119
+ ]);
91
120
  function getFighterStateMask(profile) {
92
121
  switch (profile) {
93
122
  case 5 /* FighterStateProfile.Boss18110Call */:
@@ -102,6 +131,8 @@ function getFighterStateMask(profile) {
102
131
  return dragonStates;
103
132
  case 4 /* FighterStateProfile.DragonBody */:
104
133
  return dragonBodyStates;
134
+ case 7 /* FighterStateProfile.Turn */:
135
+ return turnStates;
105
136
  default:
106
137
  // A custom monster profile inherits the normal fighter state set.
107
138
  return normalFighterStates;
@@ -22,4 +22,7 @@ export declare function registerFighterStateNode<T extends FighterStateNode>(nod
22
22
  export declare function requireFighterStateNode(entity: FighterData, state: StateType): FighterStateNode | null;
23
23
  export declare function registerFighterStateTransition<T extends FighterStateTransition>(transition: T): T;
24
24
  export declare function isFighterStateEnabled(entity: FighterData, state: StateType): boolean;
25
+ /** 自动检测转移:跳过"只能手动进入"的目标状态 */
25
26
  export declare function findFighterStateTransition(entity: FighterData): FighterStateTransition | null;
27
+ /** 忽略"只能手动进入"的限制,由调用方手动检测转移 */
28
+ export declare function findFighterStateTransitionManually(entity: FighterData): FighterStateTransition | null;
@@ -6,6 +6,7 @@ exports.requireFighterStateNode = requireFighterStateNode;
6
6
  exports.registerFighterStateTransition = registerFighterStateTransition;
7
7
  exports.isFighterStateEnabled = isFighterStateEnabled;
8
8
  exports.findFighterStateTransition = findFighterStateTransition;
9
+ exports.findFighterStateTransitionManually = findFighterStateTransitionManually;
9
10
  const FighterStateProfiles_1 = require("./FighterStateProfiles");
10
11
  const FighterStateType_1 = require("./FighterStateType");
11
12
  exports.AnyFighterState = -1;
@@ -49,23 +50,41 @@ function isFighterStateEnabled(entity, state) {
49
50
  return true;
50
51
  return ((0, FighterStateProfiles_1.getFighterStateMask)(entity.fsmType) & (1 << state)) !== 0;
51
52
  }
53
+ /** 自动检测转移:跳过"只能手动进入"的目标状态 */
52
54
  function findFighterStateTransition(entity) {
53
- const profile = entity.fsmType;
54
- const profileTransition = findTransitionInProfile(entity, profile);
55
- if (profileTransition)
56
- return profileTransition;
57
- return profile === FighterStateProfiles_1.AnyFighterStateProfile ? null : findTransitionInProfile(entity, FighterStateProfiles_1.AnyFighterStateProfile);
55
+ return findFighterStateTransitionInternal(entity, true);
56
+ }
57
+ /** 忽略"只能手动进入"的限制,由调用方手动检测转移 */
58
+ function findFighterStateTransitionManually(entity) {
59
+ return findFighterStateTransitionInternal(entity, false);
58
60
  }
59
- function findTransitionInProfile(entity, profile) {
60
- const transitions = stateTransitions[profile];
61
- if (!transitions)
61
+ function findFighterStateTransitionInternal(entity, skipManualEntry) {
62
+ const profile = entity.fsmType;
63
+ const profileTransitions = stateTransitions[profile];
64
+ if (profileTransitions) {
65
+ // profile 针对"当前 fromState"注册了任何专属转移:只扫 profile,不去 Any 兜底
66
+ // 这样 Turn 有专属 IDLE→PREATTACK 时,冷却没过不会被 Any 的 IdleToPreAttack 放行
67
+ const hasCurFromStateExclusive = profileTransitions.some(t => t.fromState === entity.curState);
68
+ if (hasCurFromStateExclusive) {
69
+ return findTransitionInList(entity, profileTransitions, skipManualEntry);
70
+ }
71
+ }
72
+ // profile 没有针对当前 fromState 的专属注册:让 Any 兜底(含 fromState==curState 和 fromState==AnyFighterState 的项)
73
+ if (profile === FighterStateProfiles_1.AnyFighterStateProfile)
62
74
  return null;
75
+ const anyTransitions = stateTransitions[FighterStateProfiles_1.AnyFighterStateProfile];
76
+ return anyTransitions ? findTransitionInList(entity, anyTransitions, skipManualEntry) : null;
77
+ }
78
+ function findTransitionInList(entity, transitions, skipManualEntry) {
63
79
  for (let i = 0; i < transitions.length; i++) {
64
80
  const transition = transitions[i];
65
81
  if (transition.fromState !== exports.AnyFighterState && transition.fromState !== entity.curState)
66
82
  continue;
67
83
  if (!isFighterStateEnabled(entity, transition.toState))
68
84
  continue;
85
+ // 目标状态登记为"必须手动进入"时,自动检测直接跳过这条转移
86
+ if (skipManualEntry && (0, FighterStateProfiles_1.isFighterStateEntryManual)(entity.fsmType, transition.toState))
87
+ continue;
69
88
  if (transition.onCheck(entity))
70
89
  return transition;
71
90
  }
@@ -265,8 +265,8 @@ function getCurSkillId(entity) {
265
265
  if (!tempCheckSkillIds.length)
266
266
  return 0;
267
267
  if (tempCheckSkillIds.length > 1) {
268
- entity.game.randomRange(0, tempCheckSkillIds.length - 1);
269
- return tempCheckSkillIds[entity.game.randomRange(0, tempCheckSkillIds.length)];
268
+ const index = entity.game.randomRange(0, tempCheckSkillIds.length - 1);
269
+ return tempCheckSkillIds[index];
270
270
  }
271
271
  else {
272
272
  return tempCheckSkillIds[0];
@@ -13,5 +13,6 @@ export declare enum StateType {
13
13
  IN = 11,
14
14
  OUT = 12,
15
15
  PREATTACK = 13,
16
- GLOBAL = 14
16
+ BACK = 14,
17
+ GLOBAL = 15
17
18
  }
@@ -17,5 +17,6 @@ var StateType;
17
17
  StateType[StateType["IN"] = 11] = "IN";
18
18
  StateType[StateType["OUT"] = 12] = "OUT";
19
19
  StateType[StateType["PREATTACK"] = 13] = "PREATTACK";
20
- StateType[StateType["GLOBAL"] = 14] = "GLOBAL";
20
+ StateType[StateType["BACK"] = 14] = "BACK";
21
+ StateType[StateType["GLOBAL"] = 15] = "GLOBAL";
21
22
  })(StateType || (exports.StateType = StateType = {}));
@@ -0,0 +1,29 @@
1
+ import type FighterData from "../entity/FighterData";
2
+ import { AttackState } from "./AnyFighterStates";
3
+ import { FighterStateProfile } from "./FighterStateProfiles";
4
+ import { BaseFighterState } from "./FighterStateShared";
5
+ import { StateType } from "./FighterStateType";
6
+ export declare class WaitState extends BaseFighterState {
7
+ static state: StateType;
8
+ static profile: FighterStateProfile;
9
+ static onEnter(entity: FighterData): void;
10
+ static onUpdate(entity: FighterData, dt: number): void;
11
+ }
12
+ export declare class TurnPreAttackState extends BaseFighterState {
13
+ static state: StateType;
14
+ static profile: FighterStateProfile;
15
+ static onEnter(entity: FighterData): void;
16
+ static onUpdate(entity: FighterData, dt: number): void;
17
+ }
18
+ export declare class TurnAttackState extends AttackState {
19
+ static state: StateType;
20
+ static profile: FighterStateProfile;
21
+ static onEnter(entity: FighterData): void;
22
+ }
23
+ export declare class TurnBackState extends BaseFighterState {
24
+ static state: StateType;
25
+ static profile: FighterStateProfile;
26
+ static onEnter(entity: FighterData): void;
27
+ static onUpdate(entity: FighterData, dt: number): void;
28
+ static onExit(entity: FighterData): void;
29
+ }
@@ -0,0 +1,208 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.TurnBackState = exports.TurnAttackState = exports.TurnPreAttackState = exports.WaitState = void 0;
4
+ const Property_1 = require("../../property/Property");
5
+ const battle_interface_1 = require("../battle.interface");
6
+ const EntityEvent_1 = require("../event/EntityEvent");
7
+ const GameEvent_1 = require("../event/GameEvent");
8
+ const BattleConfig_1 = require("../util/BattleConfig");
9
+ const BVec2_1 = require("../util/BVec2");
10
+ const AnyFighterStates_1 = require("./AnyFighterStates");
11
+ const FighterStateRegistry_1 = require("./FighterStateRegistry");
12
+ const FighterStateShared_1 = require("./FighterStateShared");
13
+ const FighterStateType_1 = require("./FighterStateType");
14
+ const moveSpeed = 1500;
15
+ class WaitState extends FighterStateShared_1.BaseFighterState {
16
+ static state = FighterStateType_1.StateType.WAIT;
17
+ static profile = 7 /* FighterStateProfile.Turn */;
18
+ static onEnter(entity) {
19
+ let name = (0, FighterStateShared_1.getActionNameByType)(FighterStateType_1.StateType.IDLE, entity.actionType);
20
+ if ((entity.campType === battle_interface_1.CampType.MY || entity.game.isPVP) && entity.cfg.type === battle_interface_1.SubEntityType.ROLE) {
21
+ name = "idle_" + entity.weaponType;
22
+ }
23
+ (0, FighterStateShared_1.playAction)(entity, name, true);
24
+ }
25
+ static onUpdate(entity, dt) {
26
+ entity.actionTime -= dt;
27
+ }
28
+ }
29
+ exports.WaitState = WaitState;
30
+ class TurnPreAttackState extends FighterStateShared_1.BaseFighterState {
31
+ static state = FighterStateType_1.StateType.PREATTACK;
32
+ static profile = 7 /* FighterStateProfile.Turn */;
33
+ static onEnter(entity) {
34
+ const skillData = entity.skillDatas[entity.curSkillId];
35
+ if (entity.curSkillId != entity.counterSkillId && skillData.cfg.skillImpacts[0].type === 1) {
36
+ const attackTarget = entity.game.getEntityLogic(entity.attackTarget);
37
+ if (!attackTarget) {
38
+ entity.actionTime = entity.game.logicStep;
39
+ return;
40
+ }
41
+ if (!entity.targetPos) {
42
+ entity.targetPos = new BVec2_1.BVec2();
43
+ }
44
+ // 方向向量:从当前位置指向目标身前点
45
+ const targetX = attackTarget.x + (entity.campType === battle_interface_1.CampType.MY ? -attackTarget.width : attackTarget.width);
46
+ BVec2_1.BVecHelper.set(entity.targetPos, targetX, attackTarget.y);
47
+ BVec2_1.BVecHelper.sub(entity.targetPos, entity.targetPos, entity);
48
+ const dis = BVec2_1.BVecHelper.length(entity.targetPos);
49
+ if (dis <= 0) {
50
+ entity.actionTime = entity.game.logicStep;
51
+ return;
52
+ }
53
+ // 预缩放:把 targetPos 变成"一帧步长向量",onUpdate 直接加即可(与 TurnBackState 同模式)
54
+ BVec2_1.BVecHelper.mulScalar(entity.targetPos, entity.targetPos, moveSpeed * entity.game.logicStep / dis);
55
+ entity.actionTime = dis / moveSpeed;
56
+ }
57
+ else {
58
+ entity.actionTime = entity.game.logicStep;
59
+ }
60
+ }
61
+ static onUpdate(entity, dt) {
62
+ entity.actionTime -= dt;
63
+ const skillData = entity.skillDatas[entity.curSkillId];
64
+ if (!skillData)
65
+ return;
66
+ if (entity.curSkillId === entity.counterSkillId)
67
+ return;
68
+ if (skillData.cfg.skillImpacts[0].type !== 1)
69
+ return;
70
+ const attackTarget = entity.game.getEntityLogic(entity.attackTarget);
71
+ if (!attackTarget)
72
+ return;
73
+ // 剩余时间不足一帧:直接吸附到目标身前点,避免 overshoot
74
+ if (entity.actionTime < entity.game.logicStep) {
75
+ let ratio = entity.actionTime / entity.game.logicStep;
76
+ if (ratio < 0)
77
+ ratio = 0;
78
+ entity.setPosition(entity.x + entity.targetPos.x * ratio, entity.y + entity.targetPos.y * ratio);
79
+ }
80
+ else {
81
+ entity.setPosition(entity.x + entity.targetPos.x, entity.y + entity.targetPos.y);
82
+ }
83
+ }
84
+ }
85
+ exports.TurnPreAttackState = TurnPreAttackState;
86
+ class TurnAttackState extends AnyFighterStates_1.AttackState {
87
+ static state = FighterStateType_1.StateType.ATTACK;
88
+ static profile = 7 /* FighterStateProfile.Turn */;
89
+ static onEnter(entity) {
90
+ entity.eventIndex = 0;
91
+ // 连击技能:头顶飘“连击”(参考 StateDisplay 的一次性飘字)
92
+ if (entity.comboSkillId && entity.curSkillId === entity.comboSkillId) {
93
+ entity.game.emit(GameEvent_1.GameEvent.ShowDisplay, 3 /* DisplayType.Combo */, "连击", entity);
94
+ }
95
+ let attackName = "attack";
96
+ const skillData = entity.skillDatas[entity.curSkillId];
97
+ if (!skillData.cfg.releaseSequence) {
98
+ entity.baseAtkUseTimes++;
99
+ }
100
+ else {
101
+ let max = 0;
102
+ for (let i = 0; i < entity.normalSkillIds.length; i++) {
103
+ let normalSkillId = entity.normalSkillIds[i];
104
+ let skillData = entity.skillDatas[normalSkillId];
105
+ if ((skillData.cfg.skillType || 0) == entity.step && skillData.cfg.releaseSequence) {
106
+ if (skillData.cfg.releaseSequence > max) {
107
+ max = skillData.cfg.releaseSequence;
108
+ }
109
+ }
110
+ }
111
+ if (entity.baseAtkUseTimes >= max) {
112
+ entity.baseAtkUseTimes = 0;
113
+ }
114
+ }
115
+ entity.markUseReleaseSeq = skillData.cfg.releaseSequence || 0;
116
+ if (skillData.cfg.attackName) {
117
+ attackName = skillData.cfg.attackName.length > 1
118
+ ? skillData.cfg.attackName[entity.game.randomRange(0, skillData.cfg.attackName.length - 1)]
119
+ : skillData.cfg.attackName[0];
120
+ }
121
+ entity.curAtkName = attackName;
122
+ entity.actionTime = (0, FighterStateShared_1.playAction)(entity, attackName, false);
123
+ entity.curAtkTime = 0;
124
+ const spineData = (0, BattleConfig_1.getSpineSkeletonDataMap)(entity.spineName);
125
+ const anim = spineData ? spineData.animations[attackName] : null;
126
+ let skillCd = Property_1.PropertyHelper.atkCd(skillData.cfg.atkInterval || 0, entity.property);
127
+ if (entity.curDoubleShootNum > 0 && entity.curSkillId === entity.comboSkillId) {
128
+ entity.curDoubleShootNum--;
129
+ entity.doubleShootNum--;
130
+ }
131
+ let attackTime = entity.actionTime;
132
+ if (skillCd <= attackTime) {
133
+ attackTime = skillCd;
134
+ entity.realExtraSpeed = entity.actionTime / attackTime;
135
+ }
136
+ else {
137
+ entity.realExtraSpeed = 1;
138
+ }
139
+ entity.timeScale = entity.game.gameModule.moduleState.timeScale * entity.realExtraSpeed;
140
+ entity.game.emit(entity, EntityEvent_1.EntityEvent.AttackStart, entity.curSkillId);
141
+ let crit = Property_1.PropertyHelper.crit(entity.property);
142
+ if (crit > 5000)
143
+ crit = 5000;
144
+ if (entity.game.IsHitOrNot(crit)) {
145
+ entity.game.emit(entity, EntityEvent_1.EntityEvent.NormalAtkHitCrit, entity.curSkillId);
146
+ }
147
+ entity.game.emit(GameEvent_1.GameEvent.SkillResetSkillCd, entity, entity.curSkillId, 0, 1);
148
+ if (!anim || !anim.events || anim.events.length <= 0) {
149
+ entity.game.call(GameEvent_1.GameEvent.UseSkillResult, entity, entity.curSkillId);
150
+ entity.normalAtkTimes++;
151
+ entity.game.emit(entity, EntityEvent_1.EntityEvent.NormalAttackTimes, entity.normalAtkTimes, entity.curSkillId);
152
+ }
153
+ else {
154
+ this.checkEventCall(entity);
155
+ }
156
+ }
157
+ }
158
+ exports.TurnAttackState = TurnAttackState;
159
+ class TurnBackState extends FighterStateShared_1.BaseFighterState {
160
+ static state = FighterStateType_1.StateType.BACK;
161
+ static profile = 7 /* FighterStateProfile.Turn */;
162
+ static onEnter(entity) {
163
+ if (!entity.targetPos) {
164
+ entity.targetPos = new BVec2_1.BVec2();
165
+ }
166
+ if (entity.curDoubleShootNum > 0 && entity.comboSkillId) {
167
+ //存在连击
168
+ entity.curSkillId = entity.comboSkillId;
169
+ const attackTarget = entity.game.getEntityLogic(entity.attackTarget);
170
+ entity.targetPos.x = (entity.moveStartX + attackTarget.x) / 2;
171
+ entity.targetPos.y = attackTarget.y;
172
+ }
173
+ else {
174
+ entity.targetPos.x = entity.moveStartX;
175
+ entity.targetPos.y = entity.moveStartY;
176
+ }
177
+ BVec2_1.BVecHelper.sub(entity.targetPos, entity.targetPos, entity);
178
+ const dis = BVec2_1.BVecHelper.length(entity.targetPos);
179
+ if (dis <= 0) {
180
+ // 已经在初始位置,不需要移动
181
+ entity.actionTime = 0;
182
+ return;
183
+ }
184
+ // 每帧位移固定为一个逻辑步长,走完由 onUpdate 吸附回初始位置
185
+ BVec2_1.BVecHelper.mulScalar(entity.targetPos, entity.targetPos, moveSpeed * entity.game.logicStep / dis);
186
+ entity.actionTime = dis / moveSpeed;
187
+ }
188
+ static onUpdate(entity, dt) {
189
+ entity.actionTime -= dt;
190
+ if (entity.actionTime > 0) {
191
+ entity.setPosition(entity.x + entity.targetPos.x, entity.y + entity.targetPos.y);
192
+ }
193
+ if (entity.actionTime <= 0) {
194
+ const stepdis = moveSpeed * entity.game.logicStep;
195
+ if (Math.abs(entity.x - entity.moveStartX) <= stepdis && Math.abs(entity.y - entity.moveStartY) <= stepdis) {
196
+ entity.setPosition(entity.moveStartX, entity.moveStartY);
197
+ }
198
+ (0, FighterStateShared_1.changeState)(entity, FighterStateType_1.StateType.IDLE);
199
+ }
200
+ }
201
+ static onExit(entity) {
202
+ }
203
+ }
204
+ exports.TurnBackState = TurnBackState;
205
+ (0, FighterStateRegistry_1.registerFighterStateNode)(TurnAttackState);
206
+ (0, FighterStateRegistry_1.registerFighterStateNode)(TurnPreAttackState);
207
+ (0, FighterStateRegistry_1.registerFighterStateNode)(TurnBackState);
208
+ (0, FighterStateRegistry_1.registerFighterStateNode)(WaitState);
@@ -0,0 +1,36 @@
1
+ import FighterData from "../entity/FighterData";
2
+ import { IdleToPreAttack } from "./AnyFighterStateTransitions";
3
+ import { FighterStateProfile } from "./FighterStateProfiles";
4
+ import { BaseFighterStateTransition } from "./FighterStateTransition";
5
+ import { StateType } from "./FighterStateType";
6
+ /**
7
+ * 攻击结束或存在插入行动请求:进入 WAIT 等待被打断。
8
+ */
9
+ export declare class TurnAttackToWait extends BaseFighterStateTransition {
10
+ static profile: FighterStateProfile;
11
+ static fromState: StateType;
12
+ static toState: StateType;
13
+ static priority: number;
14
+ static onCheck(entity: FighterData): boolean;
15
+ }
16
+ export declare class TurnWaitToBack extends BaseFighterStateTransition {
17
+ static profile: FighterStateProfile;
18
+ static fromState: StateType;
19
+ static toState: StateType;
20
+ static priority: number;
21
+ static onCheck(entity: FighterData): boolean;
22
+ }
23
+ export declare class TurnIdleToPreAttack extends IdleToPreAttack {
24
+ static profile: FighterStateProfile;
25
+ static fromState: StateType;
26
+ static toState: StateType;
27
+ static priority: number;
28
+ static onCheck(entity: FighterData): boolean;
29
+ }
30
+ export declare class TurnPreAttackToAttack extends BaseFighterStateTransition {
31
+ static profile: FighterStateProfile;
32
+ static fromState: StateType;
33
+ static toState: StateType;
34
+ static priority: number;
35
+ static onCheck(entity: FighterData): boolean;
36
+ }