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.
- 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 +215 -11
- package/dist/register-all.d.ts +2 -0
- package/dist/register-all.js +2 -0
- package/package.json +1 -1
|
@@ -22,13 +22,27 @@ export declare class BattleUtils {
|
|
|
22
22
|
* @param seed
|
|
23
23
|
*/
|
|
24
24
|
static getBornInfoByWavesId(lvModeId: number, type: number, seed: number): any[];
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* 解析战斗单位
|
|
27
|
+
* @param roleId 角色id
|
|
28
|
+
* @param playerData 战斗数据
|
|
29
|
+
*/
|
|
30
|
+
static parseBattleInfoById(roleId: number, playerData: PlayerProto.IBattlePlayer): IFighterInfo;
|
|
31
|
+
/**
|
|
32
|
+
* 解析PVP战斗单位信息
|
|
33
|
+
* @param roleId 角色id
|
|
34
|
+
* @param playerData 战斗数据
|
|
35
|
+
*/
|
|
36
|
+
static parsePVPBattleInfoById(roleId: number, playerData: PlayerProto.IBattlePlayer): IFighterInfo;
|
|
26
37
|
private static handleGemSkill;
|
|
27
38
|
private static handleRelicSkill;
|
|
28
39
|
private static handleSkinSkill;
|
|
29
40
|
private static handleSkinId;
|
|
41
|
+
private static handleVehicleId;
|
|
30
42
|
private static handleEquipSkill;
|
|
31
43
|
private static handleWeaponSkinId;
|
|
44
|
+
private static handleVehicleSkill;
|
|
45
|
+
private static handlePetSkill;
|
|
32
46
|
static clampf(value: number, min: number, max: number): number;
|
|
33
47
|
/**
|
|
34
48
|
* 冒泡排序
|
|
@@ -36,6 +50,12 @@ export declare class BattleUtils {
|
|
|
36
50
|
*/
|
|
37
51
|
static bubbleSort<T>(arr: T[], compare: (a: T, b: T) => boolean, needForAll?: boolean): boolean;
|
|
38
52
|
static GetAngleByDir(x: any, y: any): number;
|
|
53
|
+
/**
|
|
54
|
+
* 保序移除 [index, index + count) 区间的元素,返回被移除的第一个元素。
|
|
55
|
+
* 语义与 list.splice(index, count) 逐项一致(负下标从尾部数、越界按 splice 规则裁剪),
|
|
56
|
+
* 但它不会为"被移除的元素"新建一个返回数组 —— 热路径(每帧/每次命中)删数组元素一律走这里。
|
|
57
|
+
*/
|
|
58
|
+
static removeAt<T>(list: T[], index: number, count?: number): T;
|
|
39
59
|
static isBackHitByDot(entityCenter: BVec2Like, entityForward: BVec2Like, projectileCenter: BVec2Like, threshold?: number): boolean;
|
|
40
60
|
static limitAtkDir(entity: FighterData, attackAngle: number): void;
|
|
41
61
|
static isInAtkAimAngle(entity: FighterData, target: FighterData, angle: number): boolean;
|
|
@@ -12,6 +12,7 @@ const Const_1 = require("../../../config/Const");
|
|
|
12
12
|
const Notifier_1 = require("../../../framework/notify/Notifier");
|
|
13
13
|
const BattlePlayerUtil_1 = __importDefault(require("../../../util/BattlePlayerUtil"));
|
|
14
14
|
const PropertyUtil_1 = __importDefault(require("../../property/PropertyUtil"));
|
|
15
|
+
const battle_interface_1 = require("../battle.interface");
|
|
15
16
|
const BVec2_1 = require("./BVec2");
|
|
16
17
|
const JMath_1 = __importDefault(require("./JMath"));
|
|
17
18
|
const Random_1 = __importDefault(require("./Random"));
|
|
@@ -94,15 +95,16 @@ class BattleUtils {
|
|
|
94
95
|
}
|
|
95
96
|
return bronInfo;
|
|
96
97
|
}
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
98
|
+
/**
|
|
99
|
+
* 解析战斗单位
|
|
100
|
+
* @param roleId 角色id
|
|
101
|
+
* @param playerData 战斗数据
|
|
102
|
+
*/
|
|
103
|
+
static parseBattleInfoById(roleId, playerData) {
|
|
104
|
+
let property = PropertyUtil_1.default.getFightPropertyByBattlePlayer(roleId, playerData);
|
|
103
105
|
let roleCfg = Cfg_1.Cfg.Role.get(roleId);
|
|
104
106
|
let data = {
|
|
105
|
-
oid,
|
|
107
|
+
oid: 0,
|
|
106
108
|
id: roleId,
|
|
107
109
|
property,
|
|
108
110
|
skills: [],
|
|
@@ -115,6 +117,7 @@ class BattleUtils {
|
|
|
115
117
|
y: 0,
|
|
116
118
|
fashionId: 0,
|
|
117
119
|
weaponFashionId: 0,
|
|
120
|
+
vehicleId: 0,
|
|
118
121
|
};
|
|
119
122
|
if (roleCfg.normalSkillId) {
|
|
120
123
|
data.skills.push(...roleCfg.normalSkillId);
|
|
@@ -127,19 +130,75 @@ class BattleUtils {
|
|
|
127
130
|
this.handleSkinSkill(data, playerData);
|
|
128
131
|
//处理皮肤id
|
|
129
132
|
this.handleSkinId(data, playerData);
|
|
130
|
-
|
|
133
|
+
//处理宠物技能
|
|
134
|
+
this.handlePetSkill(data, playerData);
|
|
135
|
+
if (roleCfg.type === battle_interface_1.SubEntityType.ROLE) {
|
|
131
136
|
//装备技能
|
|
132
137
|
this.handleEquipSkill(data, playerData);
|
|
133
138
|
//武器皮肤
|
|
134
139
|
this.handleWeaponSkinId(data, playerData);
|
|
140
|
+
//载具技能
|
|
141
|
+
this.handleVehicleSkill(data, playerData);
|
|
135
142
|
}
|
|
136
|
-
else if (roleCfg.type ===
|
|
143
|
+
else if (roleCfg.type === battle_interface_1.SubEntityType.TOWER) {
|
|
137
144
|
//炮塔技能
|
|
138
145
|
let info = playerData ? playerData.turretMap[roleId] : Notifier_1.Notifier.call(CallID_1.CallID.Turret_GetInfoById, roleId);
|
|
139
146
|
if (info) {
|
|
140
147
|
data.level = info.lv;
|
|
141
148
|
}
|
|
142
149
|
}
|
|
150
|
+
else if (roleCfg.type === battle_interface_1.SubEntityType.PET) {
|
|
151
|
+
}
|
|
152
|
+
return data;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* 解析PVP战斗单位信息
|
|
156
|
+
* @param roleId 角色id
|
|
157
|
+
* @param playerData 战斗数据
|
|
158
|
+
*/
|
|
159
|
+
static parsePVPBattleInfoById(roleId, playerData) {
|
|
160
|
+
let property = PropertyUtil_1.default.getFightPropertyByBattlePlayer(roleId, playerData, null, true, true);
|
|
161
|
+
let roleCfg = Cfg_1.Cfg.Role.get(roleId);
|
|
162
|
+
let data = {
|
|
163
|
+
oid: 0,
|
|
164
|
+
id: roleId,
|
|
165
|
+
property,
|
|
166
|
+
skills: [],
|
|
167
|
+
waitCallSkills: [],
|
|
168
|
+
waitToBorn: [],
|
|
169
|
+
waitToLearn: [],
|
|
170
|
+
scale: roleCfg.scale || 1,
|
|
171
|
+
level: 1,
|
|
172
|
+
x: 0,
|
|
173
|
+
y: 0,
|
|
174
|
+
fashionId: 0,
|
|
175
|
+
weaponFashionId: 0,
|
|
176
|
+
comboSkillId: 0,
|
|
177
|
+
counterSkillId: 0,
|
|
178
|
+
vehicleId: 0,
|
|
179
|
+
};
|
|
180
|
+
//处理宠物技能
|
|
181
|
+
this.handlePetSkill(data, playerData, true);
|
|
182
|
+
if (roleCfg.type === battle_interface_1.SubEntityType.ROLE) {
|
|
183
|
+
//普攻技能
|
|
184
|
+
data.skills.push(10020000);
|
|
185
|
+
data.skills.push(10020031); //通用被动
|
|
186
|
+
data.collision = [0, 100, 60];
|
|
187
|
+
//装备技能,连击反击
|
|
188
|
+
this.handleEquipSkill(data, playerData, true);
|
|
189
|
+
//处理皮肤id
|
|
190
|
+
this.handleSkinId(data, playerData);
|
|
191
|
+
//处理皮肤技能
|
|
192
|
+
this.handleSkinSkill(data, playerData);
|
|
193
|
+
//武器皮肤
|
|
194
|
+
this.handleWeaponSkinId(data, playerData);
|
|
195
|
+
//处理载体id
|
|
196
|
+
this.handleVehicleId(data, playerData);
|
|
197
|
+
//载具技能
|
|
198
|
+
this.handleVehicleSkill(data, playerData, true);
|
|
199
|
+
}
|
|
200
|
+
else if (roleCfg.type === battle_interface_1.SubEntityType.PET) {
|
|
201
|
+
}
|
|
143
202
|
return data;
|
|
144
203
|
}
|
|
145
204
|
static handleGemSkill(data, playerData) {
|
|
@@ -168,15 +227,14 @@ class BattleUtils {
|
|
|
168
227
|
}
|
|
169
228
|
}
|
|
170
229
|
}
|
|
171
|
-
else {
|
|
172
|
-
let gemIds =
|
|
173
|
-
if (!gemIds || !gemIds.length)
|
|
174
|
-
return;
|
|
230
|
+
/* else {
|
|
231
|
+
let gemIds = Notifier.call(CallID.Gem_GetEquippedGems);
|
|
232
|
+
if (!gemIds || !gemIds.length) return;
|
|
175
233
|
for (let i = 0; i < gemIds.length; i++) {
|
|
176
234
|
let gemId = gemIds[i];
|
|
177
|
-
let gemCfg =
|
|
235
|
+
let gemCfg = Cfg.Gem.get(gemId);
|
|
178
236
|
if (gemCfg && gemCfg.coreSkill) {
|
|
179
|
-
let skillCfg =
|
|
237
|
+
let skillCfg = Cfg.Skill.get(gemCfg.coreSkill);
|
|
180
238
|
if (skillCfg?.belong === roleId) {
|
|
181
239
|
let type = skillCfg.impactType[0];
|
|
182
240
|
if (type !== 1 || skillCfg.impactType.indexOf(roleId, 1) >= 1) {
|
|
@@ -189,7 +247,7 @@ class BattleUtils {
|
|
|
189
247
|
}
|
|
190
248
|
}
|
|
191
249
|
}
|
|
192
|
-
}
|
|
250
|
+
}*/
|
|
193
251
|
}
|
|
194
252
|
static handleRelicSkill(data, playerData) {
|
|
195
253
|
let roleId = data.id;
|
|
@@ -222,27 +280,25 @@ class BattleUtils {
|
|
|
222
280
|
}
|
|
223
281
|
}
|
|
224
282
|
}
|
|
225
|
-
else {
|
|
226
|
-
let relic =
|
|
283
|
+
/* else {
|
|
284
|
+
let relic = Notifier.call(CallID.Relic_GetEquipMap) as RelicProto.IRelic[];
|
|
227
285
|
if (relic && relic.length) {
|
|
228
286
|
for (let i = 0; i < relic.length; i++) {
|
|
229
287
|
let entrys = relic[i].randomEntryList;
|
|
230
288
|
if (entrys && entrys.length) {
|
|
231
289
|
for (let j = 0; j < entrys.length; j++) {
|
|
232
290
|
const entryInfo = entrys[j];
|
|
233
|
-
const entryCfg =
|
|
291
|
+
const entryCfg = Cfg.RelicEntry.get(entryInfo.id);
|
|
234
292
|
if (entryCfg.skillId) {
|
|
235
|
-
let skillCfg =
|
|
293
|
+
let skillCfg = Cfg.Skill.get(entryCfg.skillId);
|
|
236
294
|
if (skillCfg.belong === roleId) {
|
|
237
295
|
data.skills.push(entryCfg.skillId);
|
|
238
|
-
}
|
|
239
|
-
else if (!skillCfg.belong) {
|
|
296
|
+
} else if (!skillCfg.belong) {
|
|
240
297
|
let impactTypes = skillCfg.impactType || [];
|
|
241
298
|
let impactType = impactTypes[0] || 0;
|
|
242
299
|
if (impactType === 1 && impactTypes.indexOf(roleId, 1) >= 1) {
|
|
243
300
|
data.skills.push(entryCfg.skillId);
|
|
244
|
-
}
|
|
245
|
-
else if (impactType == 4) {
|
|
301
|
+
} else if (impactType == 4) {
|
|
246
302
|
data.skills.push(entryCfg.skillId);
|
|
247
303
|
}
|
|
248
304
|
}
|
|
@@ -251,7 +307,7 @@ class BattleUtils {
|
|
|
251
307
|
}
|
|
252
308
|
}
|
|
253
309
|
}
|
|
254
|
-
}
|
|
310
|
+
}*/
|
|
255
311
|
}
|
|
256
312
|
static handleSkinSkill(data, playerData) {
|
|
257
313
|
let roleId = data.id;
|
|
@@ -261,10 +317,10 @@ class BattleUtils {
|
|
|
261
317
|
skinMap = BattlePlayerUtil_1.default.getAllSkinMap(playerData.skinMap);
|
|
262
318
|
slotInfo = playerData.skinSlotMap;
|
|
263
319
|
}
|
|
264
|
-
else {
|
|
265
|
-
skinMap =
|
|
266
|
-
slotInfo =
|
|
267
|
-
}
|
|
320
|
+
/* else {
|
|
321
|
+
skinMap = Notifier.call(CallID.Skin_GetAllSkinMap) as { [key: number]: { id: number, star: number } };
|
|
322
|
+
slotInfo = Notifier.call(CallID.Skin_GetAllSlotInfo) as { [key: number]: SkinProto.ISlotInfo };
|
|
323
|
+
}*/
|
|
268
324
|
if (!slotInfo)
|
|
269
325
|
return;
|
|
270
326
|
for (let key in slotInfo) {
|
|
@@ -288,7 +344,7 @@ class BattleUtils {
|
|
|
288
344
|
for (let j = skillList.length - 1; j >= 0; j--) {
|
|
289
345
|
let skinCfg = skillList[j];
|
|
290
346
|
if (skinCfg.level <= star) {
|
|
291
|
-
skills.push(...skinCfg.
|
|
347
|
+
skills.push(...skinCfg.skillPve);
|
|
292
348
|
break;
|
|
293
349
|
}
|
|
294
350
|
}
|
|
@@ -319,9 +375,9 @@ class BattleUtils {
|
|
|
319
375
|
let skinId = playerData.equipSkinMap[roleId];
|
|
320
376
|
hasSkin = Cfg_1.Cfg.Skin.get(skinId);
|
|
321
377
|
}
|
|
322
|
-
else {
|
|
323
|
-
hasSkin =
|
|
324
|
-
}
|
|
378
|
+
/* else {
|
|
379
|
+
hasSkin = Notifier.call(CallID.Skin_GetEquipSkin, roleId) as SkinCfg;
|
|
380
|
+
}*/
|
|
325
381
|
if (hasSkin) {
|
|
326
382
|
let isMax = false;
|
|
327
383
|
if (playerData) {
|
|
@@ -337,9 +393,27 @@ class BattleUtils {
|
|
|
337
393
|
data.fashionId = hasSkin.id * 10 + (isMax ? 1 : 0);
|
|
338
394
|
}
|
|
339
395
|
}
|
|
340
|
-
static
|
|
396
|
+
static handleVehicleId(data, playerData) {
|
|
397
|
+
if (playerData) {
|
|
398
|
+
let roleId = Const_1.Const.vehicleRoleId;
|
|
399
|
+
if (playerData && playerData.equipSkinMap[roleId]) {
|
|
400
|
+
let skinId = playerData.equipSkinMap[roleId];
|
|
401
|
+
const hasSkin = Cfg_1.Cfg.Skin.get(skinId);
|
|
402
|
+
let isMax = false;
|
|
403
|
+
let star = playerData.skinMap[hasSkin.id];
|
|
404
|
+
let lvCfg = Cfg_1.Cfg.SkinLv.filter({ skinId: hasSkin.id });
|
|
405
|
+
if (lvCfg && lvCfg.length) {
|
|
406
|
+
isMax = lvCfg[lvCfg.length - 1].level == star;
|
|
407
|
+
}
|
|
408
|
+
data.vehicleId = hasSkin.id * 10 + (isMax ? 1 : 0);
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
static handleEquipSkill(data, playerData, isPvp = false) {
|
|
413
|
+
if (!playerData)
|
|
414
|
+
return;
|
|
341
415
|
//装备技能
|
|
342
|
-
let equiPart = playerData
|
|
416
|
+
let equiPart = playerData.equipPartMap;
|
|
343
417
|
data.equipList = [];
|
|
344
418
|
for (let key in equiPart) {
|
|
345
419
|
const part = equiPart[key];
|
|
@@ -348,11 +422,35 @@ class BattleUtils {
|
|
|
348
422
|
data.equipList[part.partId - 1] = 810000;
|
|
349
423
|
}
|
|
350
424
|
let equipCfg = Cfg_1.Cfg.Equip.get(data.equipList[part.partId - 1]);
|
|
351
|
-
if (
|
|
352
|
-
|
|
425
|
+
if (isPvp) {
|
|
426
|
+
if (equipCfg && equipCfg.part === 1) {
|
|
427
|
+
if (equipCfg.type === 101) {
|
|
428
|
+
data.comboSkillId = 10020001;
|
|
429
|
+
data.counterSkillId = 10020004;
|
|
430
|
+
}
|
|
431
|
+
else if (equipCfg.type === 102) {
|
|
432
|
+
data.comboSkillId = 10020002;
|
|
433
|
+
data.counterSkillId = 10020005;
|
|
434
|
+
}
|
|
435
|
+
else if (equipCfg.type === 103) {
|
|
436
|
+
data.comboSkillId = 10020003;
|
|
437
|
+
data.counterSkillId = 10020006;
|
|
438
|
+
}
|
|
439
|
+
if (data.comboSkillId) {
|
|
440
|
+
data.skills.push(data.comboSkillId);
|
|
441
|
+
}
|
|
442
|
+
if (data.counterSkillId) {
|
|
443
|
+
data.skills.push(data.counterSkillId);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
353
446
|
}
|
|
354
|
-
|
|
355
|
-
|
|
447
|
+
else {
|
|
448
|
+
if (equipCfg && equipCfg.wSkill) {
|
|
449
|
+
data.skills.push(...equipCfg.wSkill);
|
|
450
|
+
}
|
|
451
|
+
if (equipCfg && equipCfg.qSkill) {
|
|
452
|
+
data.skills.push(...equipCfg.qSkill);
|
|
453
|
+
}
|
|
356
454
|
}
|
|
357
455
|
}
|
|
358
456
|
}
|
|
@@ -368,7 +466,8 @@ class BattleUtils {
|
|
|
368
466
|
hasSkin = Cfg_1.Cfg.Skin.get(skinId);
|
|
369
467
|
}
|
|
370
468
|
else {
|
|
371
|
-
|
|
469
|
+
return;
|
|
470
|
+
//hasSkin = Notifier.call(CallID.Skin_GetEquipSkin, weaponType) as SkinCfg;
|
|
372
471
|
}
|
|
373
472
|
if (hasSkin) {
|
|
374
473
|
let isMax = false;
|
|
@@ -385,6 +484,62 @@ class BattleUtils {
|
|
|
385
484
|
data.weaponFashionId = hasSkin.id * 10 + (isMax ? 1 : 0);
|
|
386
485
|
}
|
|
387
486
|
}
|
|
487
|
+
static handleVehicleSkill(data, playerData, isPvp = false) {
|
|
488
|
+
if (!playerData)
|
|
489
|
+
return;
|
|
490
|
+
const vehicleSkillLevel = playerData.purifySkillLevel || 0;
|
|
491
|
+
let washLevelCfg = Cfg_1.Cfg.VehicleWashLevel.get(vehicleSkillLevel);
|
|
492
|
+
if (isPvp) {
|
|
493
|
+
if (washLevelCfg && washLevelCfg.skillPvp) {
|
|
494
|
+
data.skills.push(...washLevelCfg.skillPvp);
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
else {
|
|
498
|
+
if (washLevelCfg && washLevelCfg.skillPve) {
|
|
499
|
+
data.skills.push(...washLevelCfg.skillPve);
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
static handlePetSkill(data, playerData, isPvp = false) {
|
|
504
|
+
if (!playerData)
|
|
505
|
+
return;
|
|
506
|
+
const roleId = data.id;
|
|
507
|
+
if (playerData.petSlots) {
|
|
508
|
+
for (let key in playerData.petSlots) {
|
|
509
|
+
let slot = playerData.petSlots[key];
|
|
510
|
+
if (slot) {
|
|
511
|
+
const petId = slot.petId;
|
|
512
|
+
const star = playerData.pets[petId]?.star || 1;
|
|
513
|
+
let petSkills = Cfg_1.Cfg.PetSkill.filter({ pet: petId, star });
|
|
514
|
+
if (petSkills && petSkills.length) {
|
|
515
|
+
for (let j = 0; j < petSkills.length; j++) {
|
|
516
|
+
let skills = isPvp ? petSkills[j].skillPvp : petSkills[j].skillPve;
|
|
517
|
+
if (!skills || skills.length === 0)
|
|
518
|
+
continue;
|
|
519
|
+
for (let i = 0; i < skills.length; i++) {
|
|
520
|
+
let skillCfg = Cfg_1.Cfg.Skill.get(skills[i]);
|
|
521
|
+
if (skillCfg) {
|
|
522
|
+
if (skillCfg.belong === roleId) {
|
|
523
|
+
data.skills.push(skillCfg.id);
|
|
524
|
+
}
|
|
525
|
+
else if (!skillCfg.belong) {
|
|
526
|
+
let impactTypes = skillCfg.impactType || [];
|
|
527
|
+
let impactType = impactTypes[0] || 0;
|
|
528
|
+
if (impactType === 1 && impactTypes.indexOf(roleId, 1) >= 1) {
|
|
529
|
+
data.skills.push(skillCfg.id);
|
|
530
|
+
}
|
|
531
|
+
else if (impactType == 4) {
|
|
532
|
+
data.skills.push(skillCfg.id);
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
}
|
|
388
543
|
static clampf(value, min, max) {
|
|
389
544
|
return Math.max(min, Math.min(max, value));
|
|
390
545
|
}
|
|
@@ -398,7 +553,9 @@ class BattleUtils {
|
|
|
398
553
|
let flag = false; // 防止数组已经有序而继续排序
|
|
399
554
|
for (let j = 0; j < len - i; j++) {
|
|
400
555
|
if (compare(arr[j], arr[j + 1])) { // 交换两个
|
|
401
|
-
|
|
556
|
+
const tmp = arr[j];
|
|
557
|
+
arr[j] = arr[j + 1];
|
|
558
|
+
arr[j + 1] = tmp;
|
|
402
559
|
flag = true;
|
|
403
560
|
ischange = true;
|
|
404
561
|
}
|
|
@@ -412,6 +569,25 @@ class BattleUtils {
|
|
|
412
569
|
static GetAngleByDir(x, y) {
|
|
413
570
|
return Math.round(JMath_1.default.atan2(y, x) * (180 / Math.PI) + 360) % 360;
|
|
414
571
|
}
|
|
572
|
+
/**
|
|
573
|
+
* 保序移除 [index, index + count) 区间的元素,返回被移除的第一个元素。
|
|
574
|
+
* 语义与 list.splice(index, count) 逐项一致(负下标从尾部数、越界按 splice 规则裁剪),
|
|
575
|
+
* 但它不会为"被移除的元素"新建一个返回数组 —— 热路径(每帧/每次命中)删数组元素一律走这里。
|
|
576
|
+
*/
|
|
577
|
+
static removeAt(list, index, count = 1) {
|
|
578
|
+
const len = list.length;
|
|
579
|
+
const start = index < 0 ? Math.max(len + index, 0) : Math.min(index, len);
|
|
580
|
+
const deleteCount = count > 0 ? Math.min(count, len - start) : 0;
|
|
581
|
+
if (deleteCount <= 0) {
|
|
582
|
+
return undefined;
|
|
583
|
+
}
|
|
584
|
+
const removed = list[start];
|
|
585
|
+
for (let i = start; i + deleteCount < len; i++) {
|
|
586
|
+
list[i] = list[i + deleteCount];
|
|
587
|
+
}
|
|
588
|
+
list.length = len - deleteCount;
|
|
589
|
+
return removed;
|
|
590
|
+
}
|
|
415
591
|
static isBackHitByDot(entityCenter, entityForward, projectileCenter, threshold = -0.7) {
|
|
416
592
|
const t = BVec2_1.BVecHelper.pop();
|
|
417
593
|
BVec2_1.BVecHelper.sub(t, projectileCenter, entityCenter);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
export declare function getEllipsePerimeter(semiMajor: number, semiMinor: number): number;
|
|
2
|
+
/** 由参数角求沿椭圆一周的弧长进度,与 getEllipseAngleAtArcProgress 互逆。 */
|
|
3
|
+
export declare function getEllipseArcProgressAtAngle(semiMajor: number, semiMinor: number, angle: number): number;
|
|
2
4
|
/** Converts travelled perimeter progress to angle for x = b * sin(angle), y = -a * cos(angle). */
|
|
3
5
|
export declare function getEllipseAngleAtArcProgress(semiMajor: number, semiMinor: number, progress: number): number;
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getEllipsePerimeter = getEllipsePerimeter;
|
|
7
|
+
exports.getEllipseArcProgressAtAngle = getEllipseArcProgressAtAngle;
|
|
7
8
|
exports.getEllipseAngleAtArcProgress = getEllipseAngleAtArcProgress;
|
|
8
9
|
const JMath_1 = __importDefault(require("./JMath"));
|
|
9
10
|
const EPSILON = 1e-8;
|
|
@@ -71,6 +72,48 @@ function getEllipsePerimeter(semiMajor, semiMinor) {
|
|
|
71
72
|
return 0;
|
|
72
73
|
return getArcProfile(semiMajor, semiMinor).quarterArcLength * semiMajor * 4;
|
|
73
74
|
}
|
|
75
|
+
/** 取第一象限内 [0, π/2] 的弧长(线性插值查表),是 getQuarterAngle 的正向对应。 */
|
|
76
|
+
function getQuarterArcDistance(profile, angle) {
|
|
77
|
+
if (angle <= 0)
|
|
78
|
+
return 0;
|
|
79
|
+
if (angle >= QUARTER_TURN)
|
|
80
|
+
return profile.quarterArcLength;
|
|
81
|
+
const scaled = angle / QUARTER_TURN * ARC_TABLE_SEGMENTS;
|
|
82
|
+
const index = Math.floor(scaled);
|
|
83
|
+
const lengths = profile.cumulativeArcLengths;
|
|
84
|
+
const startLength = lengths[index];
|
|
85
|
+
return startLength + (lengths[index + 1] - startLength) * (scaled - index);
|
|
86
|
+
}
|
|
87
|
+
/** 由参数角求沿椭圆一周的弧长进度,与 getEllipseAngleAtArcProgress 互逆。 */
|
|
88
|
+
function getEllipseArcProgressAtAngle(semiMajor, semiMinor, angle) {
|
|
89
|
+
if (semiMajor <= EPSILON)
|
|
90
|
+
return 0;
|
|
91
|
+
const profile = getArcProfile(semiMajor, semiMinor);
|
|
92
|
+
const quarterArcLength = profile.quarterArcLength;
|
|
93
|
+
const perimeter = quarterArcLength * 4;
|
|
94
|
+
if (perimeter <= EPSILON)
|
|
95
|
+
return 0;
|
|
96
|
+
let normalizedAngle = angle % FULL_TURN;
|
|
97
|
+
if (normalizedAngle < 0)
|
|
98
|
+
normalizedAngle += FULL_TURN;
|
|
99
|
+
const quadrant = Math.floor(normalizedAngle / QUARTER_TURN);
|
|
100
|
+
const localAngle = normalizedAngle - quadrant * QUARTER_TURN;
|
|
101
|
+
// 椭圆各象限弧长相等,用短轴/长轴镜像折算回第一象限
|
|
102
|
+
let arcDistance;
|
|
103
|
+
if (quadrant === 0) {
|
|
104
|
+
arcDistance = getQuarterArcDistance(profile, localAngle);
|
|
105
|
+
}
|
|
106
|
+
else if (quadrant === 1) {
|
|
107
|
+
arcDistance = quarterArcLength * 2 - getQuarterArcDistance(profile, QUARTER_TURN - localAngle);
|
|
108
|
+
}
|
|
109
|
+
else if (quadrant === 2) {
|
|
110
|
+
arcDistance = quarterArcLength * 2 + getQuarterArcDistance(profile, localAngle);
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
arcDistance = perimeter - getQuarterArcDistance(profile, QUARTER_TURN - localAngle);
|
|
114
|
+
}
|
|
115
|
+
return arcDistance / perimeter;
|
|
116
|
+
}
|
|
74
117
|
/** Converts travelled perimeter progress to angle for x = b * sin(angle), y = -a * cos(angle). */
|
|
75
118
|
function getEllipseAngleAtArcProgress(semiMajor, semiMinor, progress) {
|
|
76
119
|
if (progress <= 0)
|
|
@@ -74,7 +74,9 @@ class _HitDataPool {
|
|
|
74
74
|
this._pool = Pool_1.PoolManager.create(this._poolType, this);
|
|
75
75
|
}
|
|
76
76
|
compCreateDelegate(id, spawner) {
|
|
77
|
-
|
|
77
|
+
const hitData = new HitData();
|
|
78
|
+
hitData.spawner = spawner;
|
|
79
|
+
return hitData;
|
|
78
80
|
}
|
|
79
81
|
despawn(item) {
|
|
80
82
|
if (this._pool == null) {
|
|
@@ -37,7 +37,10 @@ class Random {
|
|
|
37
37
|
return array;
|
|
38
38
|
for (let i = 0; i < n; i++) {
|
|
39
39
|
let t = Random.randomIntBySeed(i, len - 1, data);
|
|
40
|
-
|
|
40
|
+
// 解构交换每次都会分配一个 2 元数组,改用临时变量
|
|
41
|
+
const tmp = array[i];
|
|
42
|
+
array[i] = array[t];
|
|
43
|
+
array[t] = tmp;
|
|
41
44
|
}
|
|
42
45
|
array.length = n;
|
|
43
46
|
return array;
|
|
@@ -81,7 +84,9 @@ class Random {
|
|
|
81
84
|
return array;
|
|
82
85
|
for (let i = 0; i < n; i++) {
|
|
83
86
|
let t = this.randomInt(i, len - 1);
|
|
84
|
-
|
|
87
|
+
const tmp = array[i];
|
|
88
|
+
array[i] = array[t];
|
|
89
|
+
array[t] = tmp;
|
|
85
90
|
}
|
|
86
91
|
array.length = n;
|
|
87
92
|
}
|
|
@@ -93,7 +98,9 @@ class Random {
|
|
|
93
98
|
// 洗牌算法(Fisher-Yates),用种子随机保证跨端一致
|
|
94
99
|
for (let i = candidates.length - 1; i > 0; i--) {
|
|
95
100
|
const j = Random.randomIntBySeed(0, i, data);
|
|
96
|
-
|
|
101
|
+
const tmp = candidates[i];
|
|
102
|
+
candidates[i] = candidates[j];
|
|
103
|
+
candidates[j] = tmp;
|
|
97
104
|
}
|
|
98
105
|
return candidates.slice(0, count);
|
|
99
106
|
}
|
|
@@ -105,7 +112,9 @@ class Random {
|
|
|
105
112
|
}
|
|
106
113
|
for (let i = candidates.length - 1; i > 0; i--) {
|
|
107
114
|
const j = this.randomInt(0, i);
|
|
108
|
-
|
|
115
|
+
const tmp = candidates[i];
|
|
116
|
+
candidates[i] = candidates[j];
|
|
117
|
+
candidates[j] = tmp;
|
|
109
118
|
}
|
|
110
119
|
return candidates.slice(0, count);
|
|
111
120
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { GameModule } from "../battle/IGameModule";
|
|
2
|
+
export default class DailyTrialBattleModule extends GameModule {
|
|
3
|
+
buffs: number[];
|
|
4
|
+
init(): void;
|
|
5
|
+
getMode(): number;
|
|
6
|
+
gameWin(): void;
|
|
7
|
+
gameFail(isCross?: boolean): void;
|
|
8
|
+
gameFinish(isWin: boolean, isCross?: boolean): void;
|
|
9
|
+
onUpdateWaveInfo(curWave: number, allWave: number): void;
|
|
10
|
+
reportStageInfo(): void;
|
|
11
|
+
}
|