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
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import type { Node } from "cc";
|
|
2
2
|
import { WavesInfoCfg } from "../../config/WavesInfoCfg";
|
|
3
|
-
import { IProperty } from "../property/Property";
|
|
4
3
|
import { DEBUG_EVENT, EGameModule, EntityType, GameAddPartner, GameInput, GameState, IBattleFrameData, IFightData, IFighterInfo, IImpact } from "./battle.interface";
|
|
5
4
|
import BaseEntityData from "./entity/BaseEntityData";
|
|
6
|
-
import FighterData from "./entity/FighterData";
|
|
7
|
-
import ProjectileData from "./entity/ProjectileData";
|
|
5
|
+
import FighterData, { IFighterValueSnapshot } from "./entity/FighterData";
|
|
6
|
+
import ProjectileData, { IProjectileValueSnapshot } from "./entity/ProjectileData";
|
|
8
7
|
import EntityEventBus from "./event/EntityEventBus";
|
|
9
8
|
import { GameModule } from "./IGameModule";
|
|
10
9
|
import RenderModule from "./render/RenderModule";
|
|
@@ -14,6 +13,7 @@ import CollisionSystem, { type IColliderPair } from "./system/CollisionSystem";
|
|
|
14
13
|
import DebugSystem, { type DebugLogItem } from "./system/DebugSystem";
|
|
15
14
|
import DestroySystem from "./system/DestroySystem";
|
|
16
15
|
import FsmSystem from "./system/FsmSystem";
|
|
16
|
+
import { GameSystem } from "./system/GameSystem";
|
|
17
17
|
import InputSystem from "./system/InputSystem";
|
|
18
18
|
import ProjectileSystem from "./system/ProjectileSystem";
|
|
19
19
|
import SkillSystem, { CustomUseSkillParam } from "./system/SkillSystem";
|
|
@@ -97,13 +97,14 @@ export interface IGameContext {
|
|
|
97
97
|
dropId: number;
|
|
98
98
|
};
|
|
99
99
|
};
|
|
100
|
-
collisionPairs:
|
|
101
|
-
[key: number]: IColliderPair;
|
|
102
|
-
};
|
|
100
|
+
collisionPairs: Map<number, IColliderPair>;
|
|
103
101
|
activeSkills: {
|
|
104
102
|
[key: number]: number[][];
|
|
105
103
|
};
|
|
106
|
-
|
|
104
|
+
curBornRole: {
|
|
105
|
+
[key: number]: number[];
|
|
106
|
+
};
|
|
107
|
+
curBornPet: {
|
|
107
108
|
[key: number]: number[];
|
|
108
109
|
};
|
|
109
110
|
myFightData: {
|
|
@@ -123,6 +124,76 @@ export interface IGameContext {
|
|
|
123
124
|
projectiles: ProjectileData[];
|
|
124
125
|
entityEvents: EntityEventBus;
|
|
125
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* 碰撞对快照条目:用数组保序而不是对象平铺——
|
|
129
|
+
* Map 按"插入序"迭代,onExit 派发顺序是模拟契约的一部分;
|
|
130
|
+
* 普通对象 for...in 会变成 key 升序,恢复后插入序改变会导致重演分叉。
|
|
131
|
+
*/
|
|
132
|
+
export interface IColliderPairSnapshotEntry {
|
|
133
|
+
key: number;
|
|
134
|
+
pair: IColliderPair;
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* gameContext 权威值快照。
|
|
138
|
+
* 实体快照由各实体类的 getValueSnapshot 生成;entityEvents 为生命周期派生状态不进入快照,
|
|
139
|
+
* 其上由系统动态注册的监听由各系统自行恢复(BuffSystem 已提供 BuffRestoreTriggers 参考实现)。
|
|
140
|
+
*/
|
|
141
|
+
export interface IGameContextValueSnapshot {
|
|
142
|
+
now: number;
|
|
143
|
+
reliveTime: number;
|
|
144
|
+
relivePlayerId: number;
|
|
145
|
+
logicTimeAccumulator: number;
|
|
146
|
+
bornIndex: number;
|
|
147
|
+
bornAddTime: number;
|
|
148
|
+
curWaveId: number;
|
|
149
|
+
noSpawnTimer: number;
|
|
150
|
+
checkTimer: number;
|
|
151
|
+
cooldownTimer: number;
|
|
152
|
+
shouldBuffNextWave: boolean;
|
|
153
|
+
myFighterNum: number;
|
|
154
|
+
enemyFighterNum: number;
|
|
155
|
+
levelExp: number;
|
|
156
|
+
seed: number;
|
|
157
|
+
curFrame: number;
|
|
158
|
+
fighterNextId: number;
|
|
159
|
+
oidNextId: number;
|
|
160
|
+
collisionFrameId: number;
|
|
161
|
+
waitBornInfo: IWaitBronInfo[];
|
|
162
|
+
collisionPairList: IColliderPairSnapshotEntry[];
|
|
163
|
+
waitSkills: number[];
|
|
164
|
+
waitBelong: number[];
|
|
165
|
+
delayWaitSkills: {
|
|
166
|
+
skillId: number;
|
|
167
|
+
delay: number;
|
|
168
|
+
}[];
|
|
169
|
+
waitCallDeadDrop: {
|
|
170
|
+
[key: number]: {
|
|
171
|
+
callNum: number;
|
|
172
|
+
dropId: number;
|
|
173
|
+
};
|
|
174
|
+
};
|
|
175
|
+
activeSkills: {
|
|
176
|
+
[key: number]: number[][];
|
|
177
|
+
};
|
|
178
|
+
curBornRole: {
|
|
179
|
+
[key: number]: number[];
|
|
180
|
+
};
|
|
181
|
+
myFightData: {
|
|
182
|
+
[key: number]: IFightData;
|
|
183
|
+
};
|
|
184
|
+
buffMaxLayer: {
|
|
185
|
+
[key: number]: number;
|
|
186
|
+
};
|
|
187
|
+
waitUseSkill: {
|
|
188
|
+
[key: number]: IWaitUseSkill[];
|
|
189
|
+
};
|
|
190
|
+
waitToDestroyList: IWaitDestroyData[];
|
|
191
|
+
waitCreateFighterInfo: IWaitCreateFighterInfo[];
|
|
192
|
+
waitKillSelfList: IWaitKillSelfInfo[];
|
|
193
|
+
waitToLearnSKills: number[];
|
|
194
|
+
fighters: IFighterValueSnapshot[];
|
|
195
|
+
projectiles: IProjectileValueSnapshot[];
|
|
196
|
+
}
|
|
126
197
|
export interface BattleAttackAreaInfo {
|
|
127
198
|
battleId: number;
|
|
128
199
|
x: number;
|
|
@@ -148,6 +219,7 @@ export interface GameOptions {
|
|
|
148
219
|
inputs?: IBattleFrameData[];
|
|
149
220
|
debugEvent?: DEBUG_EVENT;
|
|
150
221
|
maxExpLevel?: number;
|
|
222
|
+
selfPlayerId?: number;
|
|
151
223
|
/** 战斗结束结算回调,debugLog 为本局调试日志(未开启 debugEvent 时为空数组),怎么用由调用方决定 */
|
|
152
224
|
resultCall?: (isWin: boolean, debugLog?: DebugLogItem[]) => void;
|
|
153
225
|
}
|
|
@@ -191,6 +263,9 @@ export default class Game {
|
|
|
191
263
|
freeChangeSkillTimes: number;
|
|
192
264
|
freeChangeSkillBoxTimes: number;
|
|
193
265
|
firstSelectTimes: number;
|
|
266
|
+
proMaxMap: Map<number, number>;
|
|
267
|
+
proMinMap: Map<number, number>;
|
|
268
|
+
get isPVP(): boolean;
|
|
194
269
|
protected inputSystem: InputSystem;
|
|
195
270
|
protected destroySystem: DestroySystem;
|
|
196
271
|
protected bornSystem: BornSystem;
|
|
@@ -202,7 +277,7 @@ export default class Game {
|
|
|
202
277
|
protected debugSystem: DebugSystem;
|
|
203
278
|
private _events;
|
|
204
279
|
constructor(options?: GameOptions);
|
|
205
|
-
|
|
280
|
+
protected initSystem(options?: GameOptions): void;
|
|
206
281
|
protected initGameModule(options?: GameOptions): void;
|
|
207
282
|
changeListener(enable: boolean): void;
|
|
208
283
|
/**初始化战斗
|
|
@@ -283,6 +358,11 @@ export default class Game {
|
|
|
283
358
|
off(entityId: number, eventId: number, eventCall: Function, eventObj?: Object): void;
|
|
284
359
|
emit(eventId: GameEventId, ...argArray: any[]): void;
|
|
285
360
|
emit(entity: BaseEntityData, eventId: number, ...argArray: any[]): void;
|
|
361
|
+
/** 固定参数实体事件快速路径:与 emit 语义一致,调用点直呼可再省掉 emit 边界的一次 rest 分配 */
|
|
362
|
+
emit0(entity: BaseEntityData, eventId: number): void;
|
|
363
|
+
emit1(entity: BaseEntityData, eventId: number, a: any): void;
|
|
364
|
+
emit2(entity: BaseEntityData, eventId: number, a: any, b: any): void;
|
|
365
|
+
emit3(entity: BaseEntityData, eventId: number, a: any, b: any, c: any): void;
|
|
286
366
|
addCall(eventId: GameEventId, eventCall: Function, eventObj?: Object): void;
|
|
287
367
|
addCall(entityId: number, eventId: number, eventCall: Function, eventObj?: Object): void;
|
|
288
368
|
removeCall(eventId: GameEventId, eventCall: Function, eventObj?: Object): void;
|
|
@@ -310,7 +390,7 @@ export default class Game {
|
|
|
310
390
|
roles: {
|
|
311
391
|
[key: number]: number;
|
|
312
392
|
};
|
|
313
|
-
|
|
393
|
+
protected _systems: GameSystem[];
|
|
314
394
|
setSeed(value: number): void;
|
|
315
395
|
/**
|
|
316
396
|
* 把所有 fighters 的 property[10050](HP)做 FNV-1a hash
|
|
@@ -321,8 +401,8 @@ export default class Game {
|
|
|
321
401
|
getColliderEntity(ID1: number, ID2: number, arr: BaseEntityData[]): void;
|
|
322
402
|
initData(myFightData: IFighterInfo[], wavesInfo: WavesInfoCfg[]): void;
|
|
323
403
|
calNormalHurt(hurtData: HitData, attacker: FighterData, defender: FighterData): number;
|
|
324
|
-
isTriggerCrit(
|
|
325
|
-
isTriggerMiss(defender: FighterData): boolean;
|
|
404
|
+
isTriggerCrit(attacker: FighterData, defender: FighterData): boolean;
|
|
405
|
+
isTriggerMiss(attacker: FighterData, defender: FighterData): boolean;
|
|
326
406
|
dragonBodyPathInfo: {
|
|
327
407
|
[key: number]: IFighterInfo[];
|
|
328
408
|
};
|
|
@@ -333,12 +413,23 @@ export default class Game {
|
|
|
333
413
|
matchSkillImpact(impactType: readonly number[], fighter: FighterData, playerId: number): boolean;
|
|
334
414
|
pausePlayerAction(playerId: number): void;
|
|
335
415
|
relivePlayerAction(playerId: number): void;
|
|
336
|
-
|
|
416
|
+
protected _tickLogic(dt: number): void;
|
|
337
417
|
private onUpdate;
|
|
338
|
-
useSkill(ownerId: number, skillId: number): void;
|
|
339
418
|
addFightNum(num: number, ismycamp: any): void;
|
|
340
419
|
addProjectile(projectile: ProjectileData): void;
|
|
341
420
|
getEntityLogic(entityId: number, type?: EntityType): FighterData | ProjectileData;
|
|
421
|
+
/**
|
|
422
|
+
* 获取 gameContext 完整权威值快照;out 可复用容器。
|
|
423
|
+
* 回滚/校验用:实体数组保持原顺序(ID 升序),collisionPairs 平铺为普通对象。
|
|
424
|
+
*/
|
|
425
|
+
getContextValueSnapshot(out?: IGameContextValueSnapshot): IGameContextValueSnapshot;
|
|
426
|
+
/** 从权威快照恢复 gameContext;实体数组按快照顺序(ID 升序)复用/回收/补建 */
|
|
427
|
+
resetContextFromSnapshot(snapshot: IGameContextValueSnapshot): void;
|
|
428
|
+
/**
|
|
429
|
+
* 按快照恢复实体数组:ID 匹配的复用活对象(含池化子结构重建),
|
|
430
|
+
* 多余的回收进 EntityPool,缺失的按 dataName 从对象池补建;最终顺序与快照一致。
|
|
431
|
+
*/
|
|
432
|
+
private resetEntitiesFromSnapshot;
|
|
342
433
|
getEntityLogicByRoleId(roleId: number): FighterData;
|
|
343
434
|
getCloseTargetSortHitSign(pos: BVec2Like): any;
|
|
344
435
|
getFighterByTargetType(owner: FighterData, targetTypes: number[], x?: number, y?: number, ignoreList?: number[], searchRange?: number, forceSkillId?: number): FighterData[];
|
|
@@ -9,6 +9,7 @@ const Notifier_1 = require("../../framework/notify/Notifier");
|
|
|
9
9
|
const ListenID_1 = require("../../ListenID");
|
|
10
10
|
const Property_1 = require("../property/Property");
|
|
11
11
|
const battle_interface_1 = require("./battle.interface");
|
|
12
|
+
const BaseEntityData_1 = require("./entity/BaseEntityData");
|
|
12
13
|
const EntityPool_1 = require("./entity/EntityPool");
|
|
13
14
|
const EntityEvent_1 = require("./event/EntityEvent");
|
|
14
15
|
const EntityEventBus_1 = __importDefault(require("./event/EntityEventBus"));
|
|
@@ -82,6 +83,11 @@ class Game {
|
|
|
82
83
|
freeChangeSkillTimes = 0; //免费刷新技能次数
|
|
83
84
|
freeChangeSkillBoxTimes = 1; //免费刷新精英转盘技能次数
|
|
84
85
|
firstSelectTimes = 0; //首次选择词条次数
|
|
86
|
+
proMaxMap = new Map();
|
|
87
|
+
proMinMap = new Map();
|
|
88
|
+
get isPVP() {
|
|
89
|
+
return this.gameModule.moduleState.isPvp;
|
|
90
|
+
}
|
|
85
91
|
inputSystem = null;
|
|
86
92
|
destroySystem = null;
|
|
87
93
|
bornSystem = null;
|
|
@@ -104,6 +110,11 @@ class Game {
|
|
|
104
110
|
this.freeChangeSkillTimes = options.freeChangeSkillTimes || 0;
|
|
105
111
|
this.freeChangeSkillBoxTimes = options.freeChangeSkillBoxTimes ?? 1;
|
|
106
112
|
this.firstSelectTimes = options.firstSelectTimes || 0;
|
|
113
|
+
this.selfPlayerId = options.selfPlayerId || 0;
|
|
114
|
+
Cfg_1.Cfg.ProDefine.forEach(value => {
|
|
115
|
+
this.proMaxMap.set(value.id, value.maxValue != null ? value.maxValue : Number.MAX_SAFE_INTEGER);
|
|
116
|
+
this.proMinMap.set(value.id, value.minValue != null ? value.minValue : 0);
|
|
117
|
+
});
|
|
107
118
|
this.gameContext = {
|
|
108
119
|
//need hash or rollback
|
|
109
120
|
now: 0,
|
|
@@ -126,7 +137,7 @@ class Game {
|
|
|
126
137
|
levelExp: 0,
|
|
127
138
|
seed: options.seed || 1,
|
|
128
139
|
collisionFrameId: 0,
|
|
129
|
-
collisionPairs:
|
|
140
|
+
collisionPairs: new Map(),
|
|
130
141
|
waitToDestroyList: [],
|
|
131
142
|
waitSkills: [],
|
|
132
143
|
waitBelong: [],
|
|
@@ -142,7 +153,8 @@ class Game {
|
|
|
142
153
|
myFightData: {},
|
|
143
154
|
projectiles: [],
|
|
144
155
|
activeSkills: {},
|
|
145
|
-
|
|
156
|
+
curBornRole: {},
|
|
157
|
+
curBornPet: {},
|
|
146
158
|
entityEvents: new EntityEventBus_1.default(),
|
|
147
159
|
};
|
|
148
160
|
this._onlyLogic = !options.renderRoot;
|
|
@@ -204,7 +216,7 @@ class Game {
|
|
|
204
216
|
for (let i = 0; i < myFightData.length; i++) {
|
|
205
217
|
const data = myFightData[i];
|
|
206
218
|
const cfg = Cfg_1.Cfg.Role.get(data.id);
|
|
207
|
-
if (cfg.type
|
|
219
|
+
if (cfg.type !== battle_interface_1.SubEntityType.TOWER) {
|
|
208
220
|
firstBron.push(data);
|
|
209
221
|
}
|
|
210
222
|
//记录上阵角色信息
|
|
@@ -517,7 +529,7 @@ class Game {
|
|
|
517
529
|
return null;
|
|
518
530
|
}
|
|
519
531
|
getCurBornRoleIds(playerId = this.selfPlayerId) {
|
|
520
|
-
return this.gameContext.
|
|
532
|
+
return this.gameContext.curBornRole[playerId] || [];
|
|
521
533
|
}
|
|
522
534
|
getActiveSkills(playerId = this.selfPlayerId) {
|
|
523
535
|
return this.gameContext.activeSkills[playerId] || [];
|
|
@@ -624,12 +636,39 @@ class Game {
|
|
|
624
636
|
this._events.emitArgs(entityOrEventId, argArray);
|
|
625
637
|
return;
|
|
626
638
|
}
|
|
627
|
-
// 进来的 argArray 是 [eventId, ...业务实参]
|
|
628
|
-
//
|
|
639
|
+
// 进来的 argArray 是 [eventId, ...业务实参]。实体通道按业务实参数量路由到固定参数快速路径
|
|
640
|
+
// (emit0-3 内部仍补 eventId 尾参,语义与 emitArgs 完全一致);超过 3 个业务实参走数组兜底路径。
|
|
629
641
|
const eventId = argArray[0];
|
|
642
|
+
switch (argArray.length) {
|
|
643
|
+
case 1:
|
|
644
|
+
this.gameContext.entityEvents.emit0(entityOrEventId, eventId);
|
|
645
|
+
return;
|
|
646
|
+
case 2:
|
|
647
|
+
this.gameContext.entityEvents.emit1(entityOrEventId, eventId, argArray[1]);
|
|
648
|
+
return;
|
|
649
|
+
case 3:
|
|
650
|
+
this.gameContext.entityEvents.emit2(entityOrEventId, eventId, argArray[1], argArray[2]);
|
|
651
|
+
return;
|
|
652
|
+
case 4:
|
|
653
|
+
this.gameContext.entityEvents.emit3(entityOrEventId, eventId, argArray[1], argArray[2], argArray[3]);
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
630
656
|
argArray[0] = entityOrEventId;
|
|
631
657
|
this.gameContext.entityEvents.emitArgs(entityOrEventId, eventId, argArray);
|
|
632
658
|
}
|
|
659
|
+
/** 固定参数实体事件快速路径:与 emit 语义一致,调用点直呼可再省掉 emit 边界的一次 rest 分配 */
|
|
660
|
+
emit0(entity, eventId) {
|
|
661
|
+
this.gameContext.entityEvents.emit0(entity, eventId);
|
|
662
|
+
}
|
|
663
|
+
emit1(entity, eventId, a) {
|
|
664
|
+
this.gameContext.entityEvents.emit1(entity, eventId, a);
|
|
665
|
+
}
|
|
666
|
+
emit2(entity, eventId, a, b) {
|
|
667
|
+
this.gameContext.entityEvents.emit2(entity, eventId, a, b);
|
|
668
|
+
}
|
|
669
|
+
emit3(entity, eventId, a, b, c) {
|
|
670
|
+
this.gameContext.entityEvents.emit3(entity, eventId, a, b, c);
|
|
671
|
+
}
|
|
633
672
|
addCall(entityIdOrEventId, eventIdOrEventCall, eventCallOrEventObj, eventObj) {
|
|
634
673
|
if (typeof eventIdOrEventCall === "function") {
|
|
635
674
|
this._events.addCall(entityIdOrEventId, eventIdOrEventCall, eventCallOrEventObj);
|
|
@@ -654,7 +693,7 @@ class Game {
|
|
|
654
693
|
return this.gameContext.entityEvents.callArgs(entityOrEventId, eventId, argArray);
|
|
655
694
|
}
|
|
656
695
|
hasBronRole(playerId, role) {
|
|
657
|
-
let data = this.gameContext.
|
|
696
|
+
let data = this.gameContext.curBornRole[playerId];
|
|
658
697
|
if (data) {
|
|
659
698
|
return data.indexOf(role) != -1;
|
|
660
699
|
}
|
|
@@ -739,24 +778,12 @@ class Game {
|
|
|
739
778
|
this.destroySystem.pushToDestroyList(obj);
|
|
740
779
|
}
|
|
741
780
|
getColliderEntity(ID1, ID2, arr) {
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
break;
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
for (let i = 0; i < this.gameContext.projectiles.length; i++) {
|
|
752
|
-
if (arr.length >= 2)
|
|
753
|
-
break;
|
|
754
|
-
let projectile = this.gameContext.projectiles[i];
|
|
755
|
-
if (projectile.ID === ID1 || projectile.ID === ID2) {
|
|
756
|
-
arr.push(projectile);
|
|
757
|
-
break;
|
|
758
|
-
}
|
|
759
|
-
}
|
|
781
|
+
const entity1 = this.getEntityLogic(ID1) || this.getEntityLogic(ID1, battle_interface_1.EntityType.PROJECTILE);
|
|
782
|
+
const entity2 = this.getEntityLogic(ID2) || this.getEntityLogic(ID2, battle_interface_1.EntityType.PROJECTILE);
|
|
783
|
+
if (entity1)
|
|
784
|
+
arr.push(entity1);
|
|
785
|
+
if (entity2)
|
|
786
|
+
arr.push(entity2);
|
|
760
787
|
}
|
|
761
788
|
initData(myFightData, wavesInfo) {
|
|
762
789
|
let mydata = myFightData;
|
|
@@ -904,15 +931,17 @@ class Game {
|
|
|
904
931
|
projectileBaseHurtRatio = hurtData.extraHurtRatio || 0;
|
|
905
932
|
}
|
|
906
933
|
//最终技能伤害= 技能基础伤害% × (1 + 对应标签的技能基础倍率放大%) × (1 + ∑局内对应技能基础伤害加成%) *(1+子弹额外系数)
|
|
934
|
+
let minvalue = this.proMinMap.get(10460);
|
|
935
|
+
let basehurt = Math.max(minvalue, atkpro[10460]);
|
|
907
936
|
let a5 = (hurtData.attackRatio)
|
|
908
937
|
* (1 + atkpro[24000] / Property_1.PROPERTY_SCALE)
|
|
909
|
-
* (1 + (
|
|
938
|
+
* (1 + (basehurt + (atkpro[hurtData.skillData.skillId] || 0) + (projectileHurtRatio || 0)) / Property_1.PROPERTY_SCALE)
|
|
910
939
|
* (Math.max(0, 1 + (projectileBaseHurtRatio / Property_1.PROPERTY_SCALE)));
|
|
911
940
|
//基础伤害
|
|
912
941
|
let a6 = Math.ceil(a1 * (a5 / Property_1.PROPERTY_SCALE) * (1 + a2 / Property_1.PROPERTY_SCALE) * a4);
|
|
913
942
|
//暴击率实际暴击率 = clamp(最终暴击率 - target暴击抵抗, 0 , 100%)
|
|
914
943
|
if (!hurtData.event.isIgnoreCrit) {
|
|
915
|
-
if (hurtData.event.isCrit || this.isTriggerCrit(
|
|
944
|
+
if (hurtData.event.isCrit || this.isTriggerCrit(attacker, defender)) {
|
|
916
945
|
hurtData.event.isCrit = true;
|
|
917
946
|
}
|
|
918
947
|
}
|
|
@@ -926,7 +955,7 @@ class Game {
|
|
|
926
955
|
a8 = a6 * (a7 / Property_1.PROPERTY_SCALE);
|
|
927
956
|
}
|
|
928
957
|
//最终伤害 = max(1 , (主伤害 + 附加点伤) × (1 + 最终伤害%) × (1 - min(90% , target最终减伤%) ) - 固定减伤)
|
|
929
|
-
let finalDamage = Math.max(1, (a8 + a3) * (1 + atkpro[10130] / Property_1.PROPERTY_SCALE) * (1 - Math.min(0.9, defpro[10140] / Property_1.PROPERTY_SCALE)) - defpro[10070] * 0.5);
|
|
958
|
+
let finalDamage = Math.max(1, Math.ceil((a8 + a3) * (1 + atkpro[10130] / Property_1.PROPERTY_SCALE) * (1 - Math.min(0.9, defpro[10140] / Property_1.PROPERTY_SCALE)) - defpro[10070] * 0.5));
|
|
930
959
|
if (defender.campType === battle_interface_1.CampType.ENEMY && defpro[24480]) {
|
|
931
960
|
const maxDamage = Math.ceil(defpro[24480] * Property_1.PropertyHelper.hp(defpro) / Property_1.PROPERTY_SCALE);
|
|
932
961
|
if (maxDamage < finalDamage)
|
|
@@ -935,14 +964,14 @@ class Game {
|
|
|
935
964
|
return finalDamage;
|
|
936
965
|
}
|
|
937
966
|
//是否触发暴击
|
|
938
|
-
isTriggerCrit(
|
|
939
|
-
const a = Property_1.PropertyHelper.crit(
|
|
967
|
+
isTriggerCrit(attacker, defender) {
|
|
968
|
+
const a = Property_1.PropertyHelper.crit(attacker.property);
|
|
940
969
|
const b = Property_1.PropertyHelper.critdef(defender.property);
|
|
941
970
|
let ratio = BattleUtils_1.BattleUtils.clampf(a - b, 0, 10000);
|
|
942
971
|
return this.IsHitOrNot(ratio, 10000);
|
|
943
972
|
}
|
|
944
973
|
//是否触发闪避
|
|
945
|
-
isTriggerMiss(defender) {
|
|
974
|
+
isTriggerMiss(attacker, defender) {
|
|
946
975
|
const a = Property_1.PropertyHelper.miss(defender.property);
|
|
947
976
|
let ratio = BattleUtils_1.BattleUtils.clampf(a, 0, 10000);
|
|
948
977
|
return this.IsHitOrNot(ratio, 10000);
|
|
@@ -1022,24 +1051,11 @@ class Game {
|
|
|
1022
1051
|
}
|
|
1023
1052
|
}
|
|
1024
1053
|
onUpdate(dt) {
|
|
1025
|
-
if (this.isOver())
|
|
1026
|
-
return;
|
|
1054
|
+
// if (this.isOver()) return;
|
|
1027
1055
|
for (const s of this._systems) {
|
|
1028
|
-
if (this.isOver())
|
|
1029
|
-
return;
|
|
1030
1056
|
s.onUpdate(dt);
|
|
1031
1057
|
}
|
|
1032
1058
|
}
|
|
1033
|
-
useSkill(ownerId, skillId) {
|
|
1034
|
-
let fighter = this.getEntityLogic(ownerId);
|
|
1035
|
-
if (fighter) {
|
|
1036
|
-
let code = this.call(GameEvent_1.GameEvent.SkillCheckSkillReady, fighter, skillId);
|
|
1037
|
-
if (!code) {
|
|
1038
|
-
this.call(GameEvent_1.GameEvent.UseSkillResult, fighter, skillId);
|
|
1039
|
-
this.skillSystem.resetSkillCd(fighter, skillId);
|
|
1040
|
-
}
|
|
1041
|
-
}
|
|
1042
|
-
}
|
|
1043
1059
|
//增加战斗单位
|
|
1044
1060
|
addFightNum(num, ismycamp) {
|
|
1045
1061
|
ismycamp ? this.gameContext.myFighterNum += num : (this.gameContext.enemyFighterNum += num, this.enemyTotalNum += num);
|
|
@@ -1072,6 +1088,163 @@ class Game {
|
|
|
1072
1088
|
}
|
|
1073
1089
|
return null;
|
|
1074
1090
|
}
|
|
1091
|
+
/**
|
|
1092
|
+
* 获取 gameContext 完整权威值快照;out 可复用容器。
|
|
1093
|
+
* 回滚/校验用:实体数组保持原顺序(ID 升序),collisionPairs 平铺为普通对象。
|
|
1094
|
+
*/
|
|
1095
|
+
getContextValueSnapshot(out) {
|
|
1096
|
+
const snapshot = out || {};
|
|
1097
|
+
const ctx = this.gameContext;
|
|
1098
|
+
// 标量
|
|
1099
|
+
snapshot.now = ctx.now;
|
|
1100
|
+
snapshot.reliveTime = ctx.reliveTime;
|
|
1101
|
+
snapshot.relivePlayerId = ctx.relivePlayerId;
|
|
1102
|
+
snapshot.logicTimeAccumulator = ctx.logicTimeAccumulator;
|
|
1103
|
+
snapshot.bornIndex = ctx.bornIndex;
|
|
1104
|
+
snapshot.bornAddTime = ctx.bornAddTime;
|
|
1105
|
+
snapshot.curWaveId = ctx.curWaveId;
|
|
1106
|
+
snapshot.noSpawnTimer = ctx.noSpawnTimer;
|
|
1107
|
+
snapshot.checkTimer = ctx.checkTimer;
|
|
1108
|
+
snapshot.cooldownTimer = ctx.cooldownTimer;
|
|
1109
|
+
snapshot.shouldBuffNextWave = ctx.shouldBuffNextWave;
|
|
1110
|
+
snapshot.myFighterNum = ctx.myFighterNum;
|
|
1111
|
+
snapshot.enemyFighterNum = ctx.enemyFighterNum;
|
|
1112
|
+
snapshot.levelExp = ctx.levelExp;
|
|
1113
|
+
snapshot.seed = ctx.seed;
|
|
1114
|
+
snapshot.curFrame = ctx.curFrame;
|
|
1115
|
+
snapshot.fighterNextId = ctx.fighterNextId;
|
|
1116
|
+
snapshot.oidNextId = ctx.oidNextId;
|
|
1117
|
+
snapshot.collisionFrameId = ctx.collisionFrameId;
|
|
1118
|
+
// 容器
|
|
1119
|
+
snapshot.waitBornInfo = (0, BaseEntityData_1.copySnapshotValue)(ctx.waitBornInfo, snapshot.waitBornInfo);
|
|
1120
|
+
snapshot.waitSkills = (0, BaseEntityData_1.copySnapshotValue)(ctx.waitSkills, snapshot.waitSkills);
|
|
1121
|
+
snapshot.waitBelong = (0, BaseEntityData_1.copySnapshotValue)(ctx.waitBelong, snapshot.waitBelong);
|
|
1122
|
+
snapshot.delayWaitSkills = (0, BaseEntityData_1.copySnapshotValue)(ctx.delayWaitSkills, snapshot.delayWaitSkills);
|
|
1123
|
+
snapshot.waitCallDeadDrop = (0, BaseEntityData_1.copySnapshotValue)(ctx.waitCallDeadDrop, snapshot.waitCallDeadDrop);
|
|
1124
|
+
snapshot.activeSkills = (0, BaseEntityData_1.copySnapshotValue)(ctx.activeSkills, snapshot.activeSkills);
|
|
1125
|
+
snapshot.curBornRole = (0, BaseEntityData_1.copySnapshotValue)(ctx.curBornRole, snapshot.curBornRole);
|
|
1126
|
+
snapshot.myFightData = (0, BaseEntityData_1.copySnapshotValue)(ctx.myFightData, snapshot.myFightData);
|
|
1127
|
+
snapshot.buffMaxLayer = (0, BaseEntityData_1.copySnapshotValue)(ctx.buffMaxLayer, snapshot.buffMaxLayer);
|
|
1128
|
+
snapshot.waitUseSkill = (0, BaseEntityData_1.copySnapshotValue)(ctx.waitUseSkill, snapshot.waitUseSkill);
|
|
1129
|
+
snapshot.waitToDestroyList = (0, BaseEntityData_1.copySnapshotValue)(ctx.waitToDestroyList, snapshot.waitToDestroyList);
|
|
1130
|
+
snapshot.waitCreateFighterInfo = (0, BaseEntityData_1.copySnapshotValue)(ctx.waitCreateFighterInfo, snapshot.waitCreateFighterInfo);
|
|
1131
|
+
snapshot.waitKillSelfList = (0, BaseEntityData_1.copySnapshotValue)(ctx.waitKillSelfList, snapshot.waitKillSelfList);
|
|
1132
|
+
snapshot.waitToLearnSKills = (0, BaseEntityData_1.copySnapshotValue)(ctx.waitToLearnSKills, snapshot.waitToLearnSKills);
|
|
1133
|
+
// 碰撞对:Map.forEach 本身按插入序遍历,按序写入数组保留原插入序
|
|
1134
|
+
const pairList = snapshot.collisionPairList || (snapshot.collisionPairList = []);
|
|
1135
|
+
pairList.length = ctx.collisionPairs.size;
|
|
1136
|
+
let pairIdx = 0;
|
|
1137
|
+
ctx.collisionPairs.forEach((value, key) => {
|
|
1138
|
+
const entry = pairList[pairIdx] || (pairList[pairIdx] = { key: 0, pair: null });
|
|
1139
|
+
entry.key = key;
|
|
1140
|
+
entry.pair = (0, BaseEntityData_1.copySnapshotValue)(value, entry.pair);
|
|
1141
|
+
pairIdx++;
|
|
1142
|
+
});
|
|
1143
|
+
// 实体
|
|
1144
|
+
const fightersSnap = snapshot.fighters || (snapshot.fighters = []);
|
|
1145
|
+
fightersSnap.length = ctx.fighters.length;
|
|
1146
|
+
for (let i = 0; i < ctx.fighters.length; i++) {
|
|
1147
|
+
fightersSnap[i] = ctx.fighters[i].getValueSnapshot(fightersSnap[i]);
|
|
1148
|
+
}
|
|
1149
|
+
const projSnap = snapshot.projectiles || (snapshot.projectiles = []);
|
|
1150
|
+
projSnap.length = ctx.projectiles.length;
|
|
1151
|
+
for (let i = 0; i < ctx.projectiles.length; i++) {
|
|
1152
|
+
projSnap[i] = ctx.projectiles[i].getValueSnapshot(projSnap[i]);
|
|
1153
|
+
}
|
|
1154
|
+
return snapshot;
|
|
1155
|
+
}
|
|
1156
|
+
/** 从权威快照恢复 gameContext;实体数组按快照顺序(ID 升序)复用/回收/补建 */
|
|
1157
|
+
resetContextFromSnapshot(snapshot) {
|
|
1158
|
+
const ctx = this.gameContext;
|
|
1159
|
+
// 标量
|
|
1160
|
+
ctx.now = snapshot.now;
|
|
1161
|
+
ctx.reliveTime = snapshot.reliveTime;
|
|
1162
|
+
ctx.relivePlayerId = snapshot.relivePlayerId;
|
|
1163
|
+
ctx.logicTimeAccumulator = snapshot.logicTimeAccumulator;
|
|
1164
|
+
ctx.bornIndex = snapshot.bornIndex;
|
|
1165
|
+
ctx.bornAddTime = snapshot.bornAddTime;
|
|
1166
|
+
ctx.curWaveId = snapshot.curWaveId;
|
|
1167
|
+
ctx.noSpawnTimer = snapshot.noSpawnTimer;
|
|
1168
|
+
ctx.checkTimer = snapshot.checkTimer;
|
|
1169
|
+
ctx.cooldownTimer = snapshot.cooldownTimer;
|
|
1170
|
+
ctx.shouldBuffNextWave = snapshot.shouldBuffNextWave;
|
|
1171
|
+
ctx.myFighterNum = snapshot.myFighterNum;
|
|
1172
|
+
ctx.enemyFighterNum = snapshot.enemyFighterNum;
|
|
1173
|
+
ctx.levelExp = snapshot.levelExp;
|
|
1174
|
+
ctx.seed = snapshot.seed;
|
|
1175
|
+
ctx.curFrame = snapshot.curFrame;
|
|
1176
|
+
ctx.fighterNextId = snapshot.fighterNextId;
|
|
1177
|
+
ctx.oidNextId = snapshot.oidNextId;
|
|
1178
|
+
ctx.collisionFrameId = snapshot.collisionFrameId;
|
|
1179
|
+
// 容器(copySnapshotValue 复用现有容器并清除多余键)
|
|
1180
|
+
ctx.waitBornInfo = (0, BaseEntityData_1.copySnapshotValue)(snapshot.waitBornInfo, ctx.waitBornInfo);
|
|
1181
|
+
ctx.waitSkills = (0, BaseEntityData_1.copySnapshotValue)(snapshot.waitSkills, ctx.waitSkills);
|
|
1182
|
+
ctx.waitBelong = (0, BaseEntityData_1.copySnapshotValue)(snapshot.waitBelong, ctx.waitBelong);
|
|
1183
|
+
ctx.delayWaitSkills = (0, BaseEntityData_1.copySnapshotValue)(snapshot.delayWaitSkills, ctx.delayWaitSkills);
|
|
1184
|
+
ctx.waitCallDeadDrop = (0, BaseEntityData_1.copySnapshotValue)(snapshot.waitCallDeadDrop, ctx.waitCallDeadDrop);
|
|
1185
|
+
ctx.activeSkills = (0, BaseEntityData_1.copySnapshotValue)(snapshot.activeSkills, ctx.activeSkills);
|
|
1186
|
+
ctx.curBornRole = (0, BaseEntityData_1.copySnapshotValue)(snapshot.curBornRole, ctx.curBornRole);
|
|
1187
|
+
ctx.myFightData = (0, BaseEntityData_1.copySnapshotValue)(snapshot.myFightData, ctx.myFightData);
|
|
1188
|
+
ctx.buffMaxLayer = (0, BaseEntityData_1.copySnapshotValue)(snapshot.buffMaxLayer, ctx.buffMaxLayer);
|
|
1189
|
+
ctx.waitUseSkill = (0, BaseEntityData_1.copySnapshotValue)(snapshot.waitUseSkill, ctx.waitUseSkill);
|
|
1190
|
+
ctx.waitToDestroyList = (0, BaseEntityData_1.copySnapshotValue)(snapshot.waitToDestroyList, ctx.waitToDestroyList);
|
|
1191
|
+
ctx.waitCreateFighterInfo = (0, BaseEntityData_1.copySnapshotValue)(snapshot.waitCreateFighterInfo, ctx.waitCreateFighterInfo);
|
|
1192
|
+
ctx.waitKillSelfList = (0, BaseEntityData_1.copySnapshotValue)(snapshot.waitKillSelfList, ctx.waitKillSelfList);
|
|
1193
|
+
ctx.waitToLearnSKills = (0, BaseEntityData_1.copySnapshotValue)(snapshot.waitToLearnSKills, ctx.waitToLearnSKills);
|
|
1194
|
+
// 碰撞对:按快照数组顺序重插,精确复现快照时的 Map 插入序(onExit 派发契约)
|
|
1195
|
+
ctx.collisionPairs.clear();
|
|
1196
|
+
const pairList = snapshot.collisionPairList;
|
|
1197
|
+
for (let i = 0; i < pairList.length; i++) {
|
|
1198
|
+
const entry = pairList[i];
|
|
1199
|
+
ctx.collisionPairs.set(entry.key, (0, BaseEntityData_1.copySnapshotValue)(entry.pair, undefined));
|
|
1200
|
+
}
|
|
1201
|
+
// 实体(必须保持 ID 升序,getEntityLogic 二分查找依赖)
|
|
1202
|
+
this.resetEntitiesFromSnapshot(ctx.fighters, snapshot.fighters);
|
|
1203
|
+
this.resetEntitiesFromSnapshot(ctx.projectiles, snapshot.projectiles);
|
|
1204
|
+
}
|
|
1205
|
+
/**
|
|
1206
|
+
* 按快照恢复实体数组:ID 匹配的复用活对象(含池化子结构重建),
|
|
1207
|
+
* 多余的回收进 EntityPool,缺失的按 dataName 从对象池补建;最终顺序与快照一致。
|
|
1208
|
+
*/
|
|
1209
|
+
resetEntitiesFromSnapshot(liveList, snapList) {
|
|
1210
|
+
// 1) 回收快照中不存在的实体(压缩存活段,避免边遍历边删除)
|
|
1211
|
+
let alive = 0;
|
|
1212
|
+
for (let i = 0; i < liveList.length; i++) {
|
|
1213
|
+
const entity = liveList[i];
|
|
1214
|
+
let keep = false;
|
|
1215
|
+
for (let j = 0; j < snapList.length; j++) {
|
|
1216
|
+
if (snapList[j].ID === entity.ID) {
|
|
1217
|
+
keep = true;
|
|
1218
|
+
break;
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
if (keep) {
|
|
1222
|
+
liveList[alive++] = entity;
|
|
1223
|
+
}
|
|
1224
|
+
else {
|
|
1225
|
+
EntityPool_1.EntityPool.despawn(entity);
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
liveList.length = alive;
|
|
1229
|
+
// 2) 按快照顺序复用/补建
|
|
1230
|
+
for (let i = 0; i < snapList.length; i++) {
|
|
1231
|
+
const snap = snapList[i];
|
|
1232
|
+
let entity = null;
|
|
1233
|
+
for (let j = 0; j < liveList.length; j++) {
|
|
1234
|
+
if (liveList[j].ID === snap.ID) {
|
|
1235
|
+
entity = liveList[j];
|
|
1236
|
+
break;
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
if (!entity) {
|
|
1240
|
+
entity = EntityPool_1.EntityPool.spawn(snap.dataName);
|
|
1241
|
+
entity.game = this;
|
|
1242
|
+
}
|
|
1243
|
+
entity.resetFromSnapshot(snap);
|
|
1244
|
+
liveList[i] = entity;
|
|
1245
|
+
}
|
|
1246
|
+
liveList.length = snapList.length;
|
|
1247
|
+
}
|
|
1075
1248
|
getEntityLogicByRoleId(roleId) {
|
|
1076
1249
|
return this.gameContext.fighters.find(fighter => fighter.cfg.id === roleId);
|
|
1077
1250
|
}
|
|
@@ -16,6 +16,7 @@ export interface ModuleState {
|
|
|
16
16
|
isPvp?: boolean;
|
|
17
17
|
reliveTime?: number;
|
|
18
18
|
noPopSelectSkill?: boolean;
|
|
19
|
+
isTurn?: boolean;
|
|
19
20
|
}
|
|
20
21
|
export declare abstract class GameModule {
|
|
21
22
|
gameType: EGameModule;
|
|
@@ -25,6 +26,7 @@ export declare abstract class GameModule {
|
|
|
25
26
|
stageId: number;
|
|
26
27
|
talentSkillIds: number[];
|
|
27
28
|
myPosIndexs: number[][];
|
|
29
|
+
myPetsIndexs: number[][];
|
|
28
30
|
moduleState: ModuleState;
|
|
29
31
|
fightExpCfgs: FightExpCfg[];
|
|
30
32
|
maxExpLevel: number;
|
|
@@ -33,6 +35,9 @@ export declare abstract class GameModule {
|
|
|
33
35
|
playPro: number[][];
|
|
34
36
|
/**精英宝箱刷新次数保底 */
|
|
35
37
|
getBoxMinCt: number;
|
|
38
|
+
killTypeList: {
|
|
39
|
+
[key: number]: number;
|
|
40
|
+
};
|
|
36
41
|
codeInfo: CodexProto.IBattleCodexInfo;
|
|
37
42
|
constructor(type: EGameModule, game: Game);
|
|
38
43
|
abstract init(): any;
|
|
@@ -64,6 +69,7 @@ export declare abstract class GameModule {
|
|
|
64
69
|
onLose(): void;
|
|
65
70
|
onFighterBeForceDead(defen: FighterData, hurtData: HitData): void;
|
|
66
71
|
notifyFighterDead(fighter: FighterData): void;
|
|
72
|
+
protected handleKillType(fighter: FighterData): void;
|
|
67
73
|
protected handleDropExp(fighter: FighterData): void;
|
|
68
74
|
protected pushLevelUpSelectSkill(level: number): void;
|
|
69
75
|
/**等级升级 */
|