captainbattle 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/CallID.d.ts +121 -105
- package/dist/core/CallID.js +128 -105
- package/dist/core/ListenID.d.ts +503 -443
- package/dist/core/ListenID.js +513 -443
- package/dist/core/config/AccessoriesDrawCfg.d.ts +9 -0
- package/dist/core/config/AccessoriesDrawCfg.js +8 -0
- package/dist/core/config/BadgeCfg.d.ts +76 -19
- package/dist/core/config/BadgeCfg.js +76 -19
- package/dist/core/config/BountyTaskCfg.d.ts +1 -1
- package/dist/core/config/BuffCfg.d.ts +3 -0
- package/dist/core/config/BuffCfg.js +3 -0
- package/dist/core/config/Cfg.d.ts +224 -120
- package/dist/core/config/Cfg.js +251 -121
- package/dist/core/config/ChatChannelCfg.d.ts +8 -2
- package/dist/core/config/ChatChannelCfg.js +7 -1
- package/dist/core/config/ChatEmojiCfg.d.ts +0 -2
- package/dist/core/config/Const.d.ts +3 -1
- package/dist/core/config/Const.js +2 -0
- package/dist/core/config/DailyTrialMapCfg.d.ts +1 -2
- package/dist/core/config/EmailCfg.d.ts +13 -1
- package/dist/core/config/EmailCfg.js +13 -1
- package/dist/core/config/FirstRechargeCfg.d.ts +1 -0
- package/dist/core/config/FuncDescCfg.d.ts +33 -3
- package/dist/core/config/FuncDescCfg.js +33 -3
- package/dist/core/config/FusionLevelCfg.d.ts +10 -0
- package/dist/core/config/FusionLevelCfg.js +8 -0
- package/dist/core/config/GuildBonusLogCfg.d.ts +8 -0
- package/dist/core/config/GuildBonusLogCfg.js +8 -0
- package/dist/core/config/GuildBossRankRewardCfg.d.ts +2 -1
- package/dist/core/config/GuildConfigCfg.d.ts +1 -1
- package/dist/core/config/GuildConfigCfg.js +1 -1
- package/dist/core/config/GuildDonateCfg.d.ts +4 -2
- package/dist/core/config/GuildIslandBuildCfg.d.ts +16 -0
- package/dist/core/config/GuildIslandBuildCfg.js +8 -0
- package/dist/core/config/GuildIslandBuildItemCfg.d.ts +11 -0
- package/dist/core/config/GuildIslandBuildItemCfg.js +8 -0
- package/dist/core/config/GuildIslandConfigCfg.d.ts +19 -0
- package/dist/core/config/GuildIslandConfigCfg.js +16 -0
- package/dist/core/config/GuildIslandIslandCfg.d.ts +9 -0
- package/dist/core/config/GuildIslandIslandCfg.js +8 -0
- package/dist/core/config/GuildIslandRankCfg.d.ts +11 -0
- package/dist/core/config/GuildIslandRankCfg.js +8 -0
- package/dist/core/config/GuildIslandZoneCfg.d.ts +11 -0
- package/dist/core/config/GuildIslandZoneCfg.js +8 -0
- package/dist/core/config/GuildLogCfg.d.ts +1 -0
- package/dist/core/config/GuildLvCfg.d.ts +1 -1
- package/dist/core/config/InviteConfigCfg.d.ts +14 -0
- package/dist/core/config/InviteConfigCfg.js +11 -0
- package/dist/core/config/InviteRewardCfg.d.ts +9 -0
- package/dist/core/config/InviteRewardCfg.js +8 -0
- package/dist/core/config/ItemsCfg.d.ts +5 -1
- package/dist/core/config/ItemsCfg.js +4 -0
- package/dist/core/config/MarqueeContentCfg.d.ts +7 -0
- package/dist/core/config/MarqueeContentCfg.js +7 -1
- package/dist/core/config/ModAffixLvCfg.d.ts +12 -0
- package/dist/core/config/ModAffixLvCfg.js +8 -0
- package/dist/core/config/PetCfg.d.ts +0 -2
- package/dist/core/config/PetConfigCfg.d.ts +19 -0
- package/dist/core/config/PetConfigCfg.js +16 -0
- package/dist/core/config/PetDrawCfg.d.ts +9 -0
- package/dist/core/config/PetDrawCfg.js +8 -0
- package/dist/core/config/PetSkillCfg.d.ts +2 -1
- package/dist/core/config/PrivilegeCfg.d.ts +2 -0
- package/dist/core/config/PrivilegeCfg.js +2 -0
- package/dist/core/config/ProDefineCfg.d.ts +2 -0
- package/dist/core/config/QualityCfg.d.ts +1 -0
- package/dist/core/config/RelicDungeonConfigCfg.d.ts +14 -4
- package/dist/core/config/RelicDungeonConfigCfg.js +14 -4
- package/dist/core/config/RelicDungeonGrowCfg.d.ts +7 -0
- package/dist/core/config/RelicDungeonGrowCfg.js +8 -0
- package/dist/core/config/RelicDungeonLevelCfg.d.ts +4 -10
- package/dist/core/config/RelicDungeonRankRewardCfg.d.ts +9 -0
- package/dist/core/config/RelicDungeonRankRewardCfg.js +8 -0
- package/dist/core/config/RelicDungeonScoreCfg.d.ts +11 -0
- package/dist/core/config/RelicDungeonScoreCfg.js +8 -0
- package/dist/core/config/RelicDungeonScoreRewardCfg.d.ts +9 -0
- package/dist/core/config/RelicDungeonScoreRewardCfg.js +8 -0
- package/dist/core/config/RelicTiesCfg.d.ts +1 -0
- package/dist/core/config/RobotConfigCfg.d.ts +17 -0
- package/dist/core/config/RobotConfigCfg.js +8 -0
- package/dist/core/config/RoleCfg.d.ts +1 -0
- package/dist/core/config/RuleDescCfg.d.ts +12 -2
- package/dist/core/config/RuleDescCfg.js +12 -2
- package/dist/core/config/SeaArenaConfigCfg.d.ts +22 -0
- package/dist/core/config/SeaArenaConfigCfg.js +19 -0
- package/dist/core/config/SeaArenaRankRewardCfg.d.ts +10 -0
- package/dist/core/config/SeaArenaRankRewardCfg.js +8 -0
- package/dist/core/config/SeaArenaRobotCfg.d.ts +8 -0
- package/dist/core/config/SeaArenaRobotCfg.js +8 -0
- package/dist/core/config/SeaArenaTierCfg.d.ts +13 -0
- package/dist/core/config/SeaArenaTierCfg.js +8 -0
- package/dist/core/config/ShopCfg.d.ts +1 -0
- package/dist/core/config/SkillLvCfg.d.ts +10 -0
- package/dist/core/config/SkillLvCfg.js +8 -0
- package/dist/core/config/SkinSkillCfg.d.ts +2 -1
- package/dist/core/config/SprintActivityConfigCfg.d.ts +18 -3
- package/dist/core/config/SprintActivityConfigCfg.js +18 -3
- package/dist/core/config/StageCfg.d.ts +2 -0
- package/dist/core/config/TConfig.d.ts +1 -1
- package/dist/core/config/TConfig.js +6 -4
- package/dist/core/config/TalentTreeLvCfg.d.ts +1 -1
- package/dist/core/config/TurretFusionLevelCfg.d.ts +10 -0
- package/dist/core/config/TurretFusionLevelCfg.js +8 -0
- package/dist/core/config/TurretModAffixLvCfg.d.ts +12 -0
- package/dist/core/config/TurretModAffixLvCfg.js +8 -0
- package/dist/core/config/TurretModCfg.d.ts +20 -0
- package/dist/core/config/TurretModCfg.js +8 -0
- package/dist/core/config/TurretModConfigCfg.d.ts +20 -0
- package/dist/core/config/TurretModConfigCfg.js +17 -0
- package/dist/core/config/TurretModQualityCfg.d.ts +12 -0
- package/dist/core/config/TurretModQualityCfg.js +8 -0
- package/dist/core/config/TurretSkillLvCfg.d.ts +10 -0
- package/dist/core/config/TurretSkillLvCfg.js +8 -0
- package/dist/core/config/VehicleWashAffixCfg.d.ts +14 -0
- package/dist/core/config/VehicleWashAffixCfg.js +8 -0
- package/dist/core/config/VehicleWashLevelCfg.d.ts +6 -2
- package/dist/core/framework/Pool.d.ts +4 -1
- package/dist/core/framework/Pool.js +19 -21
- package/dist/core/framework/Time.js +13 -3
- package/dist/core/framework/Watcher.js +0 -1
- package/dist/core/framework/collections/MinSortList.d.ts +0 -2
- package/dist/core/framework/collections/MinSortList.js +9 -33
- package/dist/core/framework/collections/ObjectPool.js +6 -3
- package/dist/core/framework/notify/Notifier.d.ts +1 -1
- package/dist/core/framework/notify/Notifier.js +5 -4
- package/dist/core/framework/notify/NotifyID.d.ts +2 -1
- package/dist/core/framework/notify/NotifyID.js +1 -0
- package/dist/core/framework/notify/NotifyListener.js +35 -9
- package/dist/core/module/arena/ArenaBattleModule.d.ts +7 -0
- package/dist/core/module/arena/ArenaBattleModule.js +32 -0
- package/dist/core/module/arena/index.d.ts +1 -0
- package/dist/core/module/arena/index.js +13 -0
- package/dist/core/module/battle/Game.d.ts +104 -13
- package/dist/core/module/battle/Game.js +218 -45
- package/dist/core/module/battle/IGameModule.d.ts +6 -0
- package/dist/core/module/battle/IGameModule.js +19 -6
- package/dist/core/module/battle/battle.interface.d.ts +31 -7
- package/dist/core/module/battle/battle.interface.js +5 -1
- package/dist/core/module/battle/buff/BuffMgr.d.ts +25 -0
- package/dist/core/module/battle/buff/BuffMgr.js +43 -0
- package/dist/core/module/battle/buff/BuffTrigger.js +9 -1
- package/dist/core/module/battle/buff/buffitem/AddPhysicDamBuff.js +2 -2
- package/dist/core/module/battle/buff/buffitem/ChangeSetpAddDamageBuff.js +3 -2
- package/dist/core/module/battle/buff/buffitem/DeltaUseSkillBuff.js +3 -2
- package/dist/core/module/battle/buff/buffitem/DiceAddCritBuff.d.ts +8 -0
- package/dist/core/module/battle/buff/buffitem/DiceAddCritBuff.js +35 -0
- package/dist/core/module/battle/buff/buffitem/FireHurtLayerBuff.d.ts +7 -0
- package/dist/core/module/battle/buff/buffitem/FireHurtLayerBuff.js +28 -0
- package/dist/core/module/battle/buff/buffitem/ForceTargetBuff.js +2 -1
- package/dist/core/module/battle/buff/buffitem/HitBoundAddDamageBuff.js +1 -1
- package/dist/core/module/battle/buff/buffitem/HitBoundAddScaleBuff.d.ts +11 -0
- package/dist/core/module/battle/buff/buffitem/HitBoundAddScaleBuff.js +79 -0
- package/dist/core/module/battle/buff/buffitem/LinkCurseBuff.js +3 -2
- package/dist/core/module/battle/buff/buffitem/MonitorBuff.js +10 -12
- package/dist/core/module/battle/buff/buffitem/PosionBanCureBuff.d.ts +3 -0
- package/dist/core/module/battle/buff/buffitem/PosionBanCureBuff.js +18 -0
- package/dist/core/module/battle/buff/buffitem/PosionBuff.d.ts +1 -0
- package/dist/core/module/battle/buff/buffitem/PosionBuff.js +15 -4
- package/dist/core/module/battle/buff/buffitem/ProjectileOrbLinkBuff.js +1 -1
- package/dist/core/module/battle/buff/buffitem/ProjectileScaleUpBuff.js +4 -2
- package/dist/core/module/battle/buff/buffitem/SameHitAddDamageBuff.js +8 -0
- package/dist/core/module/battle/buff/buffitem/SlayBuff.js +1 -1
- package/dist/core/module/battle/buff/buffitem/TimeAddDamageBuff.d.ts +1 -1
- package/dist/core/module/battle/buff/buffitem/TimeAddDamageBuff.js +36 -27
- package/dist/core/module/battle/buff/buffitem/index.d.ts +4 -0
- package/dist/core/module/battle/buff/buffitem/index.js +5 -1
- package/dist/core/module/battle/entity/BaseEntityData.d.ts +15 -1
- package/dist/core/module/battle/entity/BaseEntityData.js +27 -0
- package/dist/core/module/battle/entity/DragonBodyData.d.ts +19 -1
- package/dist/core/module/battle/entity/DragonBodyData.js +34 -0
- package/dist/core/module/battle/entity/DragonData.d.ts +18 -1
- package/dist/core/module/battle/entity/DragonData.js +32 -0
- package/dist/core/module/battle/entity/EntityPool.d.ts +1 -2
- package/dist/core/module/battle/entity/EntityPool.js +9 -18
- package/dist/core/module/battle/entity/FighterData.d.ts +114 -3
- package/dist/core/module/battle/entity/FighterData.js +350 -6
- package/dist/core/module/battle/entity/ProjectileData.d.ts +2 -0
- package/dist/core/module/battle/entity/ProjectileData.js +25 -0
- package/dist/core/module/battle/entity/RoleData.d.ts +12 -1
- package/dist/core/module/battle/entity/RoleData.js +19 -0
- package/dist/core/module/battle/entity/TurnUnit.d.ts +36 -0
- package/dist/core/module/battle/entity/TurnUnit.js +74 -0
- package/dist/core/module/battle/entity/index.d.ts +1 -1
- package/dist/core/module/battle/entity/index.js +1 -1
- package/dist/core/module/battle/event/EntityEvent.d.ts +13 -0
- package/dist/core/module/battle/event/EntityEvent.js +14 -0
- package/dist/core/module/battle/event/EntityEventBus.d.ts +10 -0
- package/dist/core/module/battle/event/EntityEventBus.js +35 -0
- package/dist/core/module/battle/event/EventListener.d.ts +6 -1
- package/dist/core/module/battle/event/EventListener.js +140 -7
- package/dist/core/module/battle/event/GameEvent.d.ts +8 -0
- package/dist/core/module/battle/event/GameEvent.js +9 -0
- package/dist/core/module/battle/factory/FighterFactory.js +26 -10
- package/dist/core/module/battle/fsm-state/AnyFighterStateTransitions.js +24 -12
- package/dist/core/module/battle/fsm-state/AnyFighterStates.js +9 -5
- package/dist/core/module/battle/fsm-state/Boss18110CallState.d.ts +1 -1
- package/dist/core/module/battle/fsm-state/Boss18110State.d.ts +1 -1
- package/dist/core/module/battle/fsm-state/FighterStateMachine.d.ts +2 -0
- package/dist/core/module/battle/fsm-state/FighterStateMachine.js +6 -0
- package/dist/core/module/battle/fsm-state/FighterStateProfiles.d.ts +8 -1
- package/dist/core/module/battle/fsm-state/FighterStateProfiles.js +31 -0
- package/dist/core/module/battle/fsm-state/FighterStateRegistry.d.ts +3 -0
- package/dist/core/module/battle/fsm-state/FighterStateRegistry.js +27 -8
- package/dist/core/module/battle/fsm-state/FighterStateShared.js +2 -2
- package/dist/core/module/battle/fsm-state/FighterStateType.d.ts +2 -1
- package/dist/core/module/battle/fsm-state/FighterStateType.js +2 -1
- package/dist/core/module/battle/fsm-state/TurnState.d.ts +29 -0
- package/dist/core/module/battle/fsm-state/TurnState.js +208 -0
- package/dist/core/module/battle/fsm-state/TurnTransitions.d.ts +36 -0
- package/dist/core/module/battle/fsm-state/TurnTransitions.js +90 -0
- package/dist/core/module/battle/fsm-state/index.d.ts +2 -0
- package/dist/core/module/battle/fsm-state/index.js +3 -1
- package/dist/core/module/battle/manager/EntityManager.d.ts +1 -0
- package/dist/core/module/battle/manager/EntityManager.js +138 -20
- package/dist/core/module/battle/skill/SkillData.d.ts +27 -0
- package/dist/core/module/battle/skill/SkillData.js +43 -0
- package/dist/core/module/battle/skill/emitter/SkillEmitter.js +4 -1
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter1.d.ts +3 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter1.js +30 -2
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter10.js +2 -2
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter13.d.ts +1 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter13.js +25 -2
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter15.js +1 -1
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter2.js +1 -1
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter23.d.ts +9 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter23.js +75 -11
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter24.js +1 -1
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter26.js +4 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter28.js +1 -1
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter3.d.ts +14 -8
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter3.js +127 -31
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter30.d.ts +36 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter30.js +235 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter31.d.ts +13 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter31.js +47 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter4.d.ts +1 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter4.js +25 -2
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter6.js +10 -6
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter8.js +2 -2
- package/dist/core/module/battle/skill/emitter/projectiles/index.d.ts +2 -0
- package/dist/core/module/battle/skill/emitter/projectiles/index.js +3 -1
- package/dist/core/module/battle/skill/impacts/Impact1.js +2 -0
- package/dist/core/module/battle/skill/impacts/Impact10.js +1 -1
- package/dist/core/module/battle/skill/impacts/Impact100.d.ts +13 -0
- package/dist/core/module/battle/skill/impacts/Impact100.js +61 -0
- package/dist/core/module/battle/skill/impacts/Impact101.d.ts +13 -0
- package/dist/core/module/battle/skill/impacts/Impact101.js +49 -0
- package/dist/core/module/battle/skill/impacts/Impact17.d.ts +1 -1
- package/dist/core/module/battle/skill/impacts/Impact18.d.ts +1 -1
- package/dist/core/module/battle/skill/impacts/Impact19.d.ts +13 -0
- package/dist/core/module/battle/skill/impacts/Impact19.js +31 -0
- package/dist/core/module/battle/skill/impacts/Impact2.js +1 -1
- package/dist/core/module/battle/skill/impacts/Impact3.js +6 -5
- package/dist/core/module/battle/skill/impacts/index.d.ts +3 -0
- package/dist/core/module/battle/skill/impacts/index.js +4 -1
- package/dist/core/module/battle/skill/pool/SkillEmitterPool.js +11 -6
- package/dist/core/module/battle/system/BornSystem.js +2 -2
- package/dist/core/module/battle/system/BuffSystem.d.ts +8 -5
- package/dist/core/module/battle/system/BuffSystem.js +47 -22
- package/dist/core/module/battle/system/CollisionSystem.d.ts +4 -0
- package/dist/core/module/battle/system/CollisionSystem.js +31 -22
- package/dist/core/module/battle/system/DestroySystem.d.ts +6 -0
- package/dist/core/module/battle/system/DestroySystem.js +61 -20
- package/dist/core/module/battle/system/InputSystem.d.ts +3 -1
- package/dist/core/module/battle/system/InputSystem.js +15 -4
- package/dist/core/module/battle/system/ProjectileSystem.d.ts +1 -0
- package/dist/core/module/battle/system/ProjectileSystem.js +49 -29
- package/dist/core/module/battle/system/SkillSystem.d.ts +3 -1
- package/dist/core/module/battle/system/SkillSystem.js +55 -25
- package/dist/core/module/battle/system/TurnPhaseSystem.d.ts +52 -0
- package/dist/core/module/battle/system/TurnPhaseSystem.js +189 -0
- package/dist/core/module/battle/system/TurnSchedulerSystem.d.ts +51 -0
- package/dist/core/module/battle/system/TurnSchedulerSystem.js +363 -0
- package/dist/core/module/battle/target/CloseAngleTargetSelection.js +30 -10
- package/dist/core/module/battle/target/CloseDownTargetSelection.js +64 -17
- package/dist/core/module/battle/target/CloseTargetSelection.js +22 -5
- package/dist/core/module/battle/target/RandomRangeTargetSelection.js +8 -8
- package/dist/core/module/battle/target/SelfRandomTargetSelection.js +2 -0
- package/dist/core/module/battle/target/SelfRandomTowerTargetSelection.js +0 -1
- package/dist/core/module/battle/turn/TurnBattleGame.d.ts +85 -0
- package/dist/core/module/battle/turn/TurnBattleGame.js +453 -0
- package/dist/core/module/battle/turn/TurnBattleModule.d.ts +14 -0
- package/dist/core/module/battle/turn/TurnBattleModule.js +65 -0
- package/dist/core/module/battle/turn/TurnBattleTypes.d.ts +25 -0
- package/dist/core/module/battle/turn/TurnBattleTypes.js +15 -0
- package/dist/core/module/battle/util/BattleInputCodec.d.ts +2 -3
- package/dist/core/module/battle/util/BattleInputCodec.js +14 -3
- package/dist/core/module/battle/util/BattleUtils.d.ts +21 -1
- package/dist/core/module/battle/util/BattleUtils.js +217 -41
- package/dist/core/module/battle/util/EllipseArc.d.ts +2 -0
- package/dist/core/module/battle/util/EllipseArc.js +43 -0
- package/dist/core/module/battle/util/HitDataPool.js +3 -1
- package/dist/core/module/battle/util/Random.js +13 -4
- package/dist/core/module/dailyTrial/DailyTrialBattleModule.d.ts +11 -0
- package/dist/core/module/dailyTrial/DailyTrialBattleModule.js +103 -0
- package/dist/core/module/dailyTrial/index.d.ts +1 -0
- package/dist/core/module/dailyTrial/index.js +13 -0
- package/dist/core/module/guild/view/boss/GuildBossBattleModule.d.ts +2 -1
- package/dist/core/module/guild/view/boss/GuildBossBattleModule.js +12 -2
- package/dist/core/module/module.interface.d.ts +1 -0
- package/dist/core/module/property/Property.d.ts +22 -3
- package/dist/core/module/property/Property.js +43 -5
- package/dist/core/module/property/PropertyUtil.d.ts +17 -2
- package/dist/core/module/property/PropertyUtil.js +67 -7
- package/dist/core/module/relicDungeon/RelicBattleModule.d.ts +5 -0
- package/dist/core/module/relicDungeon/RelicBattleModule.js +26 -2
- package/dist/core/module/stage/StageBattleModule.js +1 -0
- package/dist/core/proto/CommonProto.d.ts +24671 -14643
- package/dist/core/proto/Proto.d.ts +289 -77
- package/dist/index.d.ts +39 -3
- package/dist/index.js +230 -17
- package/dist/register-all.d.ts +2 -0
- package/dist/register-all.js +2 -0
- package/package.json +1 -1
- package/resources/config/GameJsonCfg.bin +0 -0
|
@@ -6,6 +6,13 @@ const battle_interface_1 = require("../battle.interface");
|
|
|
6
6
|
const BattleUtils_1 = require("../util/BattleUtils");
|
|
7
7
|
const BVec2_1 = require("../util/BVec2");
|
|
8
8
|
const TargetSelection_1 = require("./TargetSelection");
|
|
9
|
+
/**
|
|
10
|
+
* 多目标查询的候选缓存:并行数组分别存目标与距离平方,下标即候选的原有先后顺序。
|
|
11
|
+
* 每次查询为每个候选建 {target, dis} 对象再整体排序,会在高频目标查询里制造大量短命对象,
|
|
12
|
+
* 这里复用数组,取 k 个最近用"逐槽选最小"完成,不需要排序。
|
|
13
|
+
*/
|
|
14
|
+
const candTargets = [];
|
|
15
|
+
const candDises = [];
|
|
9
16
|
class CloseDownTargetSelection {
|
|
10
17
|
static select(owner, targetTypes, x, y, ignoreList, searchRange, forceSkillId) {
|
|
11
18
|
let realx = owner.x;
|
|
@@ -34,25 +41,65 @@ class CloseDownTargetSelection {
|
|
|
34
41
|
if (isAim) {
|
|
35
42
|
return BattleUtils_1.BattleUtils.getAimAnglePos(owner, minDis, maxDis, angle);
|
|
36
43
|
}
|
|
37
|
-
|
|
44
|
+
const targetNum = targetTypes[1] || 1;
|
|
38
45
|
if (targetNum >= 1) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
if (targetNum === 1) {
|
|
47
|
+
// 只要最近 1 个:单次线性扫描取最小距离,等价于"稳定升序排序后取首元素"
|
|
48
|
+
// (距离并列时取候选顺序靠前者),且全程零中间对象。
|
|
49
|
+
let best = null;
|
|
50
|
+
let bestDis = Number.MAX_VALUE;
|
|
51
|
+
for (let i = 0; i < fighters.length; i++) {
|
|
52
|
+
const value = fighters[i];
|
|
53
|
+
if (!(0, TargetSelection_1.isEnemyTarget)(owner, value, skillId, maxDis, minDis, ignoreList) || owner.attackTarget === value.ID)
|
|
54
|
+
continue;
|
|
55
|
+
if (isAim && !BattleUtils_1.BattleUtils.isInAtkAimAngle(owner, value, angle))
|
|
56
|
+
continue;
|
|
57
|
+
if (value.y >= owner.y)
|
|
58
|
+
continue;
|
|
59
|
+
const dis = BVec2_1.BVecHelper.distanceSqr(value, TargetSelection_1.tempTargetVec);
|
|
60
|
+
if (dis < bestDis) {
|
|
61
|
+
bestDis = dis;
|
|
62
|
+
best = value;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (best)
|
|
66
|
+
targets.push(best);
|
|
49
67
|
}
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
68
|
+
else {
|
|
69
|
+
candTargets.length = 0;
|
|
70
|
+
candDises.length = 0;
|
|
71
|
+
for (let i = 0; i < fighters.length; i++) {
|
|
72
|
+
const value = fighters[i];
|
|
73
|
+
if (!(0, TargetSelection_1.isEnemyTarget)(owner, value, skillId, maxDis, minDis, ignoreList) || owner.attackTarget === value.ID)
|
|
74
|
+
continue;
|
|
75
|
+
if (isAim && !BattleUtils_1.BattleUtils.isInAtkAimAngle(owner, value, angle))
|
|
76
|
+
continue;
|
|
77
|
+
if (value.y >= owner.y)
|
|
78
|
+
continue;
|
|
79
|
+
candTargets.push(value);
|
|
80
|
+
candDises.push(BVec2_1.BVecHelper.distanceSqr(value, TargetSelection_1.tempTargetVec));
|
|
81
|
+
}
|
|
82
|
+
// 逐槽选最小,等价于稳定升序排序后取前 k 个(并列取候选顺序靠前者)
|
|
83
|
+
const k = Math.min(targetNum, candTargets.length);
|
|
84
|
+
for (let slot = 0; slot < k; slot++) {
|
|
85
|
+
let pick = -1;
|
|
86
|
+
let pickDis = Number.MAX_VALUE;
|
|
87
|
+
for (let i = 0; i < candTargets.length; i++) {
|
|
88
|
+
if (candDises[i] < pickDis) {
|
|
89
|
+
pickDis = candDises[i];
|
|
90
|
+
pick = i;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
targets.push(candTargets[pick]);
|
|
94
|
+
// 选中槽位置为无效距离,避免被重复选中
|
|
95
|
+
candDises[pick] = Number.MAX_VALUE;
|
|
96
|
+
}
|
|
97
|
+
// 候选不足 targetNum 时用最近目标补齐:旧实现如此,行为保持不变
|
|
98
|
+
while (targets.length > 0 && targets.length < targetNum) {
|
|
99
|
+
targets.push(targets[0]);
|
|
100
|
+
}
|
|
101
|
+
candTargets.length = 0;
|
|
102
|
+
candDises.length = 0;
|
|
56
103
|
}
|
|
57
104
|
}
|
|
58
105
|
// if (isAim && targets.length <= 0) return BattleUtils.getAimAnglePos(owner, minDis, maxDis, angle);
|
|
@@ -40,19 +40,36 @@ class CloseTargetSelection {
|
|
|
40
40
|
targets.push(entity);
|
|
41
41
|
}
|
|
42
42
|
if (targetTypes[1] && targetTypes[1] > 1) {
|
|
43
|
-
const
|
|
43
|
+
const maxCandidates = Math.ceil(targetTypes[1]);
|
|
44
|
+
const waitTargets = [];
|
|
45
|
+
const waitDistances = [];
|
|
44
46
|
for (let i = 0; i < fighters.length; i++) {
|
|
45
47
|
const value = fighters[i];
|
|
46
48
|
if (!(0, TargetSelection_1.isEnemyTarget)(owner, value, skillId, maxDis, minDis, ignoreList) || owner.attackTarget === value.ID)
|
|
47
49
|
continue;
|
|
48
50
|
if (isAim && !BattleUtils_1.BattleUtils.isInAtkAimAngle(owner, value, angle))
|
|
49
51
|
continue;
|
|
50
|
-
|
|
52
|
+
const distance = BVec2_1.BVecHelper.distanceSqr(value, TargetSelection_1.tempTargetVec);
|
|
53
|
+
// Keep a stable, bounded nearest-first list; equal distances stay in input order.
|
|
54
|
+
const candidateCount = waitDistances.length;
|
|
55
|
+
let insertIndex = candidateCount;
|
|
56
|
+
while (insertIndex > 0 && waitDistances[insertIndex - 1] > distance)
|
|
57
|
+
insertIndex--;
|
|
58
|
+
if (insertIndex >= maxCandidates)
|
|
59
|
+
continue;
|
|
60
|
+
const lastIndex = Math.min(candidateCount, maxCandidates - 1);
|
|
61
|
+
for (let j = lastIndex; j > insertIndex; j--) {
|
|
62
|
+
waitTargets[j] = waitTargets[j - 1];
|
|
63
|
+
waitDistances[j] = waitDistances[j - 1];
|
|
64
|
+
}
|
|
65
|
+
waitTargets[insertIndex] = value;
|
|
66
|
+
waitDistances[insertIndex] = distance;
|
|
67
|
+
const nextCount = Math.min(candidateCount + 1, maxCandidates);
|
|
68
|
+
waitTargets.length = nextCount;
|
|
69
|
+
waitDistances.length = nextCount;
|
|
51
70
|
}
|
|
52
|
-
if (waitList.length > 0)
|
|
53
|
-
BattleUtils_1.BattleUtils.bubbleSort(waitList, (a, b) => a.dis > b.dis);
|
|
54
71
|
for (let i = 1; i < targetTypes[1]; i++) {
|
|
55
|
-
const target =
|
|
72
|
+
const target = waitTargets[i] || targets[0];
|
|
56
73
|
if (target)
|
|
57
74
|
targets.push(target);
|
|
58
75
|
}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RandomRangeTargetSelection = void 0;
|
|
4
4
|
const battle_interface_1 = require("../battle.interface");
|
|
5
|
-
const BattleUtils_1 = require("../util/BattleUtils");
|
|
6
5
|
const TargetSelection_1 = require("./TargetSelection");
|
|
7
6
|
class RandomRangeTargetSelection {
|
|
8
7
|
static select(owner, targetTypes, x, y, ignoreList, searchRange, forceSkillId) {
|
|
@@ -17,7 +16,7 @@ class RandomRangeTargetSelection {
|
|
|
17
16
|
return [];
|
|
18
17
|
const center = targets[0];
|
|
19
18
|
const radiusSqr = rangeRadius * rangeRadius;
|
|
20
|
-
const gridRadius = Math.ceil(rangeRadius / minInterval);
|
|
19
|
+
const gridRadius = Math.ceil(2 * rangeRadius / minInterval);
|
|
21
20
|
const result = [];
|
|
22
21
|
for (let gridY = -gridRadius; gridY <= gridRadius; gridY++) {
|
|
23
22
|
const offsetY = gridY * minInterval;
|
|
@@ -25,16 +24,17 @@ class RandomRangeTargetSelection {
|
|
|
25
24
|
const offsetX = gridX * minInterval;
|
|
26
25
|
if (offsetX * offsetX + offsetY * offsetY > radiusSqr)
|
|
27
26
|
continue;
|
|
28
|
-
const param = { ID: -1, x: center.x + offsetX, y: center.y + offsetY, anchorX: 0.5, anchorY: 0, game: owner.game, scaleX: 1, scaleY: 1
|
|
29
|
-
param.disSqrt = (param.x - owner.x) ** 2 + (param.y - owner.y) ** 2;
|
|
27
|
+
const param = { ID: -1, x: center.x + offsetX, y: center.y + offsetY, anchorX: 0.5, anchorY: 0, game: owner.game, scaleX: 1, scaleY: 1 /* disSqrt: 0 */ };
|
|
28
|
+
// param.disSqrt = (param.x - owner.x) ** 2 + (param.y - owner.y) ** 2;
|
|
30
29
|
result.push(param);
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
game.getRandomSDiffInArray(result, pointCount);
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
33
|
+
//直接随机选点
|
|
34
|
+
// BattleUtils.bubbleSort(result, (a, b) => {
|
|
35
|
+
// //@ts-ignore
|
|
36
|
+
// return a.disSqrt < b.disSqrt;
|
|
37
|
+
// });
|
|
38
38
|
return result;
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -27,6 +27,8 @@ class SelfRandomTargetSelection {
|
|
|
27
27
|
continue;
|
|
28
28
|
if (notincludeSelf && value.ID === owner.ID)
|
|
29
29
|
continue;
|
|
30
|
+
if (value.cfg.type === battle_interface_1.SubEntityType.PET)
|
|
31
|
+
continue;
|
|
30
32
|
if (ignoreList && ignoreList.indexOf(value.ID) !== -1)
|
|
31
33
|
continue;
|
|
32
34
|
if (value.campType !== owner.campType || value.NoSelect(forceSkillId) || !value.shape || !value.shape.isActive)
|
|
@@ -6,7 +6,6 @@ const TargetSelection_1 = require("./TargetSelection");
|
|
|
6
6
|
class SelfRandomTowerTargetSelection {
|
|
7
7
|
static select(owner, targetTypes, x, y, ignoreList, searchRange, forceSkillId) {
|
|
8
8
|
const game = owner.game;
|
|
9
|
-
const fighters = owner.game.gameContext.fighters;
|
|
10
9
|
const targets = [];
|
|
11
10
|
const entityLogic = game.getEntityLogic(game.roles[owner.playerId]);
|
|
12
11
|
const isContainSelf = targetTypes[1] || 0;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { GameInput, IFighterInfo } from "../battle.interface";
|
|
2
|
+
import FighterData from "../entity/FighterData";
|
|
3
|
+
import Game from "../Game";
|
|
4
|
+
import { TurnPhaseSystem } from "../system/TurnPhaseSystem";
|
|
5
|
+
import { TurnSchedulerSystem } from "../system/TurnSchedulerSystem";
|
|
6
|
+
import type { HitData } from "../util/HitDataPool";
|
|
7
|
+
import { CampType } from './../battle.interface';
|
|
8
|
+
import { TurnBattleConfig, TurnBattleOptions, TurnBattleState, TurnPhase } from "./TurnBattleTypes";
|
|
9
|
+
/**
|
|
10
|
+
* 回合制战斗主类。
|
|
11
|
+
* 逻辑与表现共用同一套实时系统:回合调度器只决定“当前哪个单位可以行动”,
|
|
12
|
+
* 移动、攻击、技能、子弹、碰撞、伤害都由原有实时管线逐帧结算,前后端跑同一份模拟。
|
|
13
|
+
*/
|
|
14
|
+
export default class TurnBattleGame extends Game {
|
|
15
|
+
/** 维修技能表现时长(秒):回合末触发维修后,等表现播完再进入下一回合 */
|
|
16
|
+
private static readonly REPAIR_ACTION_DELAY;
|
|
17
|
+
turnState: TurnBattleState;
|
|
18
|
+
phaseSystem: TurnPhaseSystem;
|
|
19
|
+
turnScheduler: TurnSchedulerSystem;
|
|
20
|
+
mainRoleId: number;
|
|
21
|
+
enemyMainRoleId: number;
|
|
22
|
+
/** 回合制:当前允许行动的单位 ID;<0 表示非回合制(实时战斗),0 表示无单位可行动 */
|
|
23
|
+
turnActiveFighterId: number;
|
|
24
|
+
/** 双方主角本回合实际损失的生命值,由 ArenaBattleModule.onHurt 统计,回合末维修结算后清零 */
|
|
25
|
+
myMainHurtHp: number;
|
|
26
|
+
enemyMainHurtHp: number;
|
|
27
|
+
getTurnHurtHp(campType: CampType): number;
|
|
28
|
+
/** 回合末等待延迟(秒):大于 0 时停在 ROUND_END,不进入下一回合 */
|
|
29
|
+
private _roundEndDelay;
|
|
30
|
+
config: TurnBattleConfig;
|
|
31
|
+
constructor(options: TurnBattleOptions);
|
|
32
|
+
private initTurnSystems;
|
|
33
|
+
/** 回合制开战入口:只做初始化,之后由 fixUpdate 逐帧推进(前端)/ runToEnd(后端) */
|
|
34
|
+
initPVPFight(challenger: IFighterInfo[], defender: IFighterInfo[]): void;
|
|
35
|
+
fixUpdate(dt: number): void;
|
|
36
|
+
setReady(): void;
|
|
37
|
+
getCurrentPhase(): TurnPhase;
|
|
38
|
+
getRound(): number;
|
|
39
|
+
/** 将 hp 已归零但还没进入死亡状态的单位补一次死亡状态,交给死亡动画结束后统一结算 */
|
|
40
|
+
collectDeaths(): void;
|
|
41
|
+
/** 死亡动画结束后由 DeadState 调用;只做回合制侧的身份移除与胜负判定 */
|
|
42
|
+
notifyFighterDead(fighter: FighterData): void;
|
|
43
|
+
/** 回合末:buff/时间由实时系统自行推进,这里只处理死亡兜底、回合上限与下一回合 */
|
|
44
|
+
endRound(): void;
|
|
45
|
+
/**
|
|
46
|
+
* 追加回合末等待时间(秒)。维修等需要表现播完后,由回合末逻辑调用。
|
|
47
|
+
* 多段逻辑可以累加,统一在 tickRoundEndDelay 中倒计时。
|
|
48
|
+
*/
|
|
49
|
+
addRoundEndDelay(delay: number): void;
|
|
50
|
+
/**
|
|
51
|
+
* 调度器每帧推进回合末延迟。
|
|
52
|
+
* 返回 true 表示仍在等待,本帧不要开始任何行动;返回 false 表示已可继续(必要时已进入下一回合)。
|
|
53
|
+
*/
|
|
54
|
+
tickRoundEndDelay(dt: number): boolean;
|
|
55
|
+
private enterNextRound;
|
|
56
|
+
setGameWin(lastDeadFight?: FighterData): void;
|
|
57
|
+
setGameFail(isCross?: boolean): void;
|
|
58
|
+
/** 回合制全自动,不复用实时输入 */
|
|
59
|
+
applyInput(input: GameInput): void;
|
|
60
|
+
/**
|
|
61
|
+
* 回合制受击回调:受击方配置了反击技能且当前没有在行动时,插入一次反击行动。
|
|
62
|
+
* 插入行动期间不会再次插入,避免反击互相触发形成死循环。
|
|
63
|
+
*/
|
|
64
|
+
tryCounterAttack(attacker: FighterData, defender: FighterData): void;
|
|
65
|
+
tryDizzinessAttack(attacker: FighterData, defender: FighterData): void;
|
|
66
|
+
/**
|
|
67
|
+
* 回合末维修:只处理双方主角。
|
|
68
|
+
*/
|
|
69
|
+
private processRepair;
|
|
70
|
+
/** @returns 是否触发了维修 */
|
|
71
|
+
private repairMainRole;
|
|
72
|
+
destroy(): void;
|
|
73
|
+
syncState(): void;
|
|
74
|
+
private handleFighter;
|
|
75
|
+
private checkFinish;
|
|
76
|
+
private pickMainRole;
|
|
77
|
+
private finishTurnBattle;
|
|
78
|
+
calNormalHurt(hurtData: HitData, attacker: FighterData, defender: FighterData): number;
|
|
79
|
+
calComboCount(attacker: FighterData, defender: FighterData): void;
|
|
80
|
+
isTriggerCrit(attacker: FighterData, defender: FighterData): boolean;
|
|
81
|
+
isTriggerMiss(attacker: FighterData, defender: FighterData): boolean;
|
|
82
|
+
isTriggerStun(attacker: FighterData, defender: FighterData): boolean;
|
|
83
|
+
isTriggerCounter(attacker: FighterData, defender: FighterData): boolean;
|
|
84
|
+
isTriggerRepair(attacker: FighterData, defender: FighterData): boolean;
|
|
85
|
+
}
|