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
|
@@ -3,11 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.EntityPool = void 0;
|
|
4
4
|
const Pool_1 = require("../../../framework/Pool");
|
|
5
5
|
const BattleUtils_1 = require("../util/BattleUtils");
|
|
6
|
-
const EntityPoolSpawner_1 = require("./EntityPoolSpawner");
|
|
7
6
|
class _EntityPool {
|
|
8
7
|
_poolType = "EntityPool";
|
|
9
8
|
_pool;
|
|
10
|
-
_spawnerMap = new Map();
|
|
11
9
|
constructor() {
|
|
12
10
|
this.initPool();
|
|
13
11
|
}
|
|
@@ -15,7 +13,7 @@ class _EntityPool {
|
|
|
15
13
|
if (Pool_1.PoolManager.isExist(this._poolType)) {
|
|
16
14
|
return;
|
|
17
15
|
}
|
|
18
|
-
this._pool = Pool_1.PoolManager.create(this._poolType, this
|
|
16
|
+
this._pool = Pool_1.PoolManager.create(this._poolType, this);
|
|
19
17
|
}
|
|
20
18
|
compCreateDelegate(id, spawner) {
|
|
21
19
|
let classname = id;
|
|
@@ -23,6 +21,7 @@ class _EntityPool {
|
|
|
23
21
|
if (func) {
|
|
24
22
|
let obj = new func();
|
|
25
23
|
obj.dataName = classname;
|
|
24
|
+
obj.spawner = spawner;
|
|
26
25
|
return obj;
|
|
27
26
|
}
|
|
28
27
|
else {
|
|
@@ -30,29 +29,21 @@ class _EntityPool {
|
|
|
30
29
|
return null;
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
|
-
despawn(item
|
|
32
|
+
despawn(item) {
|
|
33
|
+
if (item == null)
|
|
34
|
+
return;
|
|
34
35
|
if (this._pool == null) {
|
|
35
|
-
|
|
36
|
-
EntityPoolSpawner_1.EntityPoolSpawner.unuse(item);
|
|
37
|
-
}
|
|
36
|
+
item.unuse();
|
|
38
37
|
return;
|
|
39
38
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
//@ts-ignore
|
|
43
|
-
spawner.despawnInstance(item, false, true, clearData);
|
|
44
|
-
//@ts-ignore
|
|
45
|
-
this._pool.smoothClear(); //回收的时候设置定时器清除对象
|
|
46
|
-
spawner.smoothClear();
|
|
47
|
-
}
|
|
39
|
+
// 实体自己处理 unuse;Pool 按 item.spawner 回收到对应生成器并触发延迟裁剪
|
|
40
|
+
this._pool.despawn(item);
|
|
48
41
|
}
|
|
49
42
|
spawn(id, ...param) {
|
|
50
43
|
if (this._pool == null)
|
|
51
44
|
return null;
|
|
52
45
|
if (!this._pool.isExitsSpawner(id)) {
|
|
53
|
-
|
|
54
|
-
let pool = this._pool.createSpawner(id, this.compCreateDelegate, null, 0);
|
|
55
|
-
this._spawnerMap.set(id, pool);
|
|
46
|
+
this._pool.createSpawner(id, this.compCreateDelegate, null, 0);
|
|
56
47
|
}
|
|
57
48
|
return this._pool.spawn(id, param);
|
|
58
49
|
}
|
|
@@ -3,10 +3,105 @@ import { IProperty } from "../../property/Property";
|
|
|
3
3
|
import { CampType } from "../battle.interface";
|
|
4
4
|
import { type Buff } from "../buff/BuffMgr";
|
|
5
5
|
import { StateType } from "../fsm-state/FighterStateType";
|
|
6
|
-
import { SkillData } from "../skill/SkillData";
|
|
6
|
+
import { ISkillDataValueSnapshot, SkillData } from "../skill/SkillData";
|
|
7
7
|
import type { ISkillEmitter } from "../system/SkillSystem";
|
|
8
8
|
import { BVec2, BVec2Like } from "../util/BVec2";
|
|
9
|
-
import BaseEntityData from "./BaseEntityData";
|
|
9
|
+
import BaseEntityData, { IBaseEntityValueSnapshot } from "./BaseEntityData";
|
|
10
|
+
/**
|
|
11
|
+
* FighterData 权威值快照。
|
|
12
|
+
* cfg 为只读配置单例按引用携带;game/矩阵/脏标记/prevState 等派生值不进入快照。
|
|
13
|
+
*/
|
|
14
|
+
export interface IFighterValueSnapshot extends IBaseEntityValueSnapshot {
|
|
15
|
+
curState: StateType;
|
|
16
|
+
fsmType: number;
|
|
17
|
+
actionTime: number;
|
|
18
|
+
waitActionTime: number;
|
|
19
|
+
realExtraSpeed: number;
|
|
20
|
+
eventIndex: number;
|
|
21
|
+
curAtkTime: number;
|
|
22
|
+
needFindTarget: boolean;
|
|
23
|
+
actionType: number;
|
|
24
|
+
spineName: string;
|
|
25
|
+
curSpineAnimName: string;
|
|
26
|
+
isLoop: boolean;
|
|
27
|
+
timeScale: number;
|
|
28
|
+
skinNameIndex: number;
|
|
29
|
+
limitHp: number;
|
|
30
|
+
cfg: RoleCfg;
|
|
31
|
+
atkDir: {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
};
|
|
35
|
+
touchPos: {
|
|
36
|
+
x: number;
|
|
37
|
+
y: number;
|
|
38
|
+
};
|
|
39
|
+
isTouchAtkDir: boolean;
|
|
40
|
+
horDir: number;
|
|
41
|
+
campType: CampType;
|
|
42
|
+
NoSelected: boolean;
|
|
43
|
+
hitColorTime: number;
|
|
44
|
+
checkEnemyTime: number;
|
|
45
|
+
oid: number;
|
|
46
|
+
callEntityId: number;
|
|
47
|
+
callTopEntityId: number;
|
|
48
|
+
callNum: number;
|
|
49
|
+
isBoss: number;
|
|
50
|
+
level: number;
|
|
51
|
+
isFarAttack: boolean;
|
|
52
|
+
isKillSelf: boolean;
|
|
53
|
+
noInMove: boolean;
|
|
54
|
+
bossHpSplit: number;
|
|
55
|
+
boxType: number;
|
|
56
|
+
dropId: number;
|
|
57
|
+
dropExp: number;
|
|
58
|
+
hasProjectileNum: number;
|
|
59
|
+
normalAtkTimes: number;
|
|
60
|
+
normalAtkProjectileNum: number;
|
|
61
|
+
normalDamageTimes: number;
|
|
62
|
+
killNumTimes: number;
|
|
63
|
+
hitSign: number;
|
|
64
|
+
step: number;
|
|
65
|
+
quality: number;
|
|
66
|
+
curWave: number;
|
|
67
|
+
bornCfgId: number;
|
|
68
|
+
bleedDis: number;
|
|
69
|
+
moveCfg: number[];
|
|
70
|
+
moveDirX: number;
|
|
71
|
+
moveDirY: number;
|
|
72
|
+
movePathReady: boolean;
|
|
73
|
+
moveStartX: number;
|
|
74
|
+
moveStartY: number;
|
|
75
|
+
moveEndY: number;
|
|
76
|
+
lastProjectileTarget: number;
|
|
77
|
+
fashionId: number;
|
|
78
|
+
curSkillId: number;
|
|
79
|
+
baseAtkUseTimes: number;
|
|
80
|
+
markUseReleaseSeq: number;
|
|
81
|
+
curAtkName: string;
|
|
82
|
+
normalSkillIds: number[];
|
|
83
|
+
waitCallSkills: number[];
|
|
84
|
+
skillDatas: {
|
|
85
|
+
[key: number]: ISkillDataValueSnapshot;
|
|
86
|
+
};
|
|
87
|
+
skillEmitters: ISkillEmitter[];
|
|
88
|
+
doubleShootNum: number;
|
|
89
|
+
curDoubleShootNum: number;
|
|
90
|
+
buffList: {
|
|
91
|
+
[key: number]: Buff.IBuffItemValueSnapshot[];
|
|
92
|
+
};
|
|
93
|
+
buffEffectMap: Buff.BuffEffectMap;
|
|
94
|
+
sprintPos: number[];
|
|
95
|
+
sprintSpeed: number;
|
|
96
|
+
curHp: number;
|
|
97
|
+
property: IProperty;
|
|
98
|
+
attackTarget: number;
|
|
99
|
+
targetPos: {
|
|
100
|
+
x: number;
|
|
101
|
+
y: number;
|
|
102
|
+
};
|
|
103
|
+
resPath: string;
|
|
104
|
+
}
|
|
10
105
|
export default class FighterData extends BaseEntityData {
|
|
11
106
|
curState: StateType;
|
|
12
107
|
fsmType: number;
|
|
@@ -72,11 +167,14 @@ export default class FighterData extends BaseEntityData {
|
|
|
72
167
|
lastProjectileTarget: number;
|
|
73
168
|
fashionId: number;
|
|
74
169
|
curSkillId: number;
|
|
170
|
+
posIndex: number;
|
|
75
171
|
baseAtkUseTimes: number;
|
|
76
172
|
markUseReleaseSeq: number;
|
|
77
173
|
curAtkName: string;
|
|
78
174
|
normalSkillIds: number[];
|
|
79
175
|
waitCallSkills: number[];
|
|
176
|
+
comboSkillId: number;
|
|
177
|
+
counterSkillId: number;
|
|
80
178
|
skillDatas: {
|
|
81
179
|
[key: number]: SkillData;
|
|
82
180
|
};
|
|
@@ -116,6 +214,8 @@ export default class FighterData extends BaseEntityData {
|
|
|
116
214
|
curRateHp(): number;
|
|
117
215
|
startFight(): void;
|
|
118
216
|
endFight(): void;
|
|
217
|
+
/** 回池清理:buff/技能的释放逻辑在监听方,必须早于基类断开 game */
|
|
218
|
+
protected onUnuse(): void;
|
|
119
219
|
/** 攻击发射原点(世界坐标);spine 无 Gun 点时回退到受击点 */
|
|
120
220
|
getShootOriginPoition(out: BVec2Like, atkName?: string): BVec2Like;
|
|
121
221
|
getPursuePosition(attackTarget: number | FighterData, out: BVec2Like): void;
|
|
@@ -126,6 +226,17 @@ export default class FighterData extends BaseEntityData {
|
|
|
126
226
|
/** 目标是否在攻击范围内 */
|
|
127
227
|
isInAttackRadius(defenTarget: FighterData, maxDis: number, minDis?: number, forceTargetPos?: BVec2): boolean;
|
|
128
228
|
checkSkillListInAttackRadius(defenTarget: FighterData): number;
|
|
129
|
-
setSpineName(): void;
|
|
229
|
+
setSpineName(forcePath?: string): void;
|
|
130
230
|
setResPath(ismy: boolean, forceResPath?: string): void;
|
|
231
|
+
/**
|
|
232
|
+
* 获取 fighter 完整权威值快照;out 用于回滚场景复用容器。
|
|
233
|
+
* cfg 为只读配置单例按引用携带;skillDatas/skillEmitters/buffList 按各自池化策略处理。
|
|
234
|
+
*/
|
|
235
|
+
getValueSnapshot(out?: IFighterValueSnapshot): IFighterValueSnapshot;
|
|
236
|
+
/** 从权威快照恢复 fighter;恢复完成后派发 BuffRestoreTriggers 重挂 buff 触发器 */
|
|
237
|
+
resetFromSnapshot(snapshot: IFighterValueSnapshot): void;
|
|
238
|
+
/** 按快照重建技能发射器:回收现有池对象,逐个按 emitterName 重新获取后覆盖值 */
|
|
239
|
+
private resetSkillEmittersFromSnapshot;
|
|
240
|
+
/** 按快照重建 buff 列表:回收现有 BuffItem,再逐个从 BuffPool 取出覆盖值 */
|
|
241
|
+
private resetBuffListFromSnapshot;
|
|
131
242
|
}
|
|
@@ -1,26 +1,59 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
2
18
|
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
19
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
20
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
21
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
22
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
23
|
};
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
24
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
25
|
+
var ownKeys = function(o) {
|
|
26
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
27
|
+
var ar = [];
|
|
28
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
29
|
+
return ar;
|
|
30
|
+
};
|
|
31
|
+
return ownKeys(o);
|
|
32
|
+
};
|
|
33
|
+
return function (mod) {
|
|
34
|
+
if (mod && mod.__esModule) return mod;
|
|
35
|
+
var result = {};
|
|
36
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
37
|
+
__setModuleDefault(result, mod);
|
|
38
|
+
return result;
|
|
39
|
+
};
|
|
40
|
+
})();
|
|
11
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
42
|
const BuffCfg_1 = require("../../../config/BuffCfg");
|
|
13
43
|
const Cfg_1 = require("../../../config/Cfg");
|
|
14
44
|
const Property_1 = require("../../property/Property");
|
|
15
45
|
const battle_interface_1 = require("../battle.interface");
|
|
16
46
|
const BuffMgr_1 = require("../buff/BuffMgr");
|
|
47
|
+
const BuffPool_1 = require("../buff/BuffPool");
|
|
17
48
|
const EntityEvent_1 = require("../event/EntityEvent");
|
|
18
49
|
const GameEvent_1 = require("../event/GameEvent");
|
|
19
50
|
const FighterStateType_1 = require("../fsm-state/FighterStateType");
|
|
51
|
+
const SkillEmitterPool_1 = require("../skill/pool/SkillEmitterPool");
|
|
52
|
+
const SkillData_1 = require("../skill/SkillData");
|
|
20
53
|
const BattleConfig_1 = require("../util/BattleConfig");
|
|
21
54
|
const BattleUtils_1 = require("../util/BattleUtils");
|
|
22
55
|
const BVec2_1 = require("../util/BVec2");
|
|
23
|
-
const BaseEntityData_1 =
|
|
56
|
+
const BaseEntityData_1 = __importStar(require("./BaseEntityData"));
|
|
24
57
|
const tempVec2 = new BVec2_1.BVec2();
|
|
25
58
|
let FighterData = class FighterData extends BaseEntityData_1.default {
|
|
26
59
|
//#region state params
|
|
@@ -80,6 +113,7 @@ let FighterData = class FighterData extends BaseEntityData_1.default {
|
|
|
80
113
|
moveDirX = 0;
|
|
81
114
|
moveDirY = -1;
|
|
82
115
|
movePathReady = false;
|
|
116
|
+
//回合制模式下这两个是初始位置
|
|
83
117
|
moveStartX = 0;
|
|
84
118
|
moveStartY = 0;
|
|
85
119
|
moveEndY = 0;
|
|
@@ -88,11 +122,14 @@ let FighterData = class FighterData extends BaseEntityData_1.default {
|
|
|
88
122
|
//#endregion
|
|
89
123
|
//#region skill
|
|
90
124
|
curSkillId = 0;
|
|
125
|
+
posIndex = 0;
|
|
91
126
|
baseAtkUseTimes = 0;
|
|
92
127
|
markUseReleaseSeq = 0;
|
|
93
128
|
curAtkName = "";
|
|
94
129
|
normalSkillIds = [];
|
|
95
130
|
waitCallSkills = [];
|
|
131
|
+
comboSkillId = 0; //连击技能
|
|
132
|
+
counterSkillId = 0; //反击技能
|
|
96
133
|
skillDatas = null;
|
|
97
134
|
skillEmitters = [];
|
|
98
135
|
doubleShootNum = 1;
|
|
@@ -285,6 +322,22 @@ let FighterData = class FighterData extends BaseEntityData_1.default {
|
|
|
285
322
|
}
|
|
286
323
|
entity.game.emit(GameEvent_1.GameEvent.BuffClearByType, entity);
|
|
287
324
|
}
|
|
325
|
+
/** 回池清理:buff/技能的释放逻辑在监听方,必须早于基类断开 game */
|
|
326
|
+
onUnuse() {
|
|
327
|
+
this.game.emit(GameEvent_1.GameEvent.BuffClearByType, this);
|
|
328
|
+
this.game.emit(GameEvent_1.GameEvent.SkillClearSkillData, this);
|
|
329
|
+
this.attackTarget = 0;
|
|
330
|
+
this.dropId = 0;
|
|
331
|
+
this.skinNameIndex = 0;
|
|
332
|
+
this.boxType = 0;
|
|
333
|
+
this.cfg = null;
|
|
334
|
+
if (this.skillDatas) {
|
|
335
|
+
for (const key in this.skillDatas) {
|
|
336
|
+
delete this.skillDatas[key];
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
Property_1.PropertyHelper.resetProperty(this.property);
|
|
340
|
+
}
|
|
288
341
|
//#endregion
|
|
289
342
|
//#region 攻击点 / 资源 / 攻击判定点
|
|
290
343
|
/** 攻击发射原点(世界坐标);spine 无 Gun 点时回退到受击点 */
|
|
@@ -435,8 +488,13 @@ let FighterData = class FighterData extends BaseEntityData_1.default {
|
|
|
435
488
|
}
|
|
436
489
|
return skillId;
|
|
437
490
|
}
|
|
438
|
-
setSpineName() {
|
|
439
|
-
const
|
|
491
|
+
setSpineName(forcePath) {
|
|
492
|
+
const spinePath = forcePath || this.cfg.spinePath;
|
|
493
|
+
if (!spinePath) {
|
|
494
|
+
this.spineName = "";
|
|
495
|
+
return;
|
|
496
|
+
}
|
|
497
|
+
const spineNames = spinePath.split("/");
|
|
440
498
|
this.spineName = spineNames[spineNames.length - 1];
|
|
441
499
|
}
|
|
442
500
|
setResPath(ismy, forceResPath) {
|
|
@@ -459,6 +517,292 @@ let FighterData = class FighterData extends BaseEntityData_1.default {
|
|
|
459
517
|
this.resPath = this.cfg.resPath;
|
|
460
518
|
}
|
|
461
519
|
}
|
|
520
|
+
//#endregion
|
|
521
|
+
/**
|
|
522
|
+
* 获取 fighter 完整权威值快照;out 用于回滚场景复用容器。
|
|
523
|
+
* cfg 为只读配置单例按引用携带;skillDatas/skillEmitters/buffList 按各自池化策略处理。
|
|
524
|
+
*/
|
|
525
|
+
getValueSnapshot(out) {
|
|
526
|
+
const snapshot = super.getValueSnapshot(out);
|
|
527
|
+
//#region state params
|
|
528
|
+
snapshot.curState = this.curState;
|
|
529
|
+
snapshot.fsmType = this.fsmType;
|
|
530
|
+
snapshot.actionTime = this.actionTime;
|
|
531
|
+
snapshot.waitActionTime = this.waitActionTime;
|
|
532
|
+
snapshot.realExtraSpeed = this.realExtraSpeed;
|
|
533
|
+
snapshot.eventIndex = this.eventIndex;
|
|
534
|
+
snapshot.curAtkTime = this.curAtkTime;
|
|
535
|
+
snapshot.needFindTarget = this.needFindTarget;
|
|
536
|
+
snapshot.actionType = this.actionType;
|
|
537
|
+
//#endregion
|
|
538
|
+
//#region animation
|
|
539
|
+
snapshot.spineName = this.spineName;
|
|
540
|
+
snapshot.curSpineAnimName = this.curSpineAnimName;
|
|
541
|
+
snapshot.isLoop = this.isLoop;
|
|
542
|
+
snapshot.timeScale = this.timeScale;
|
|
543
|
+
snapshot.skinNameIndex = this.skinNameIndex;
|
|
544
|
+
//#endregion
|
|
545
|
+
//#region config/runtime
|
|
546
|
+
snapshot.limitHp = this.limitHp;
|
|
547
|
+
snapshot.cfg = this.cfg;
|
|
548
|
+
snapshot.atkDir = (0, BaseEntityData_1.copySnapshotValue)(this.atkDir, snapshot.atkDir);
|
|
549
|
+
snapshot.touchPos = (0, BaseEntityData_1.copySnapshotValue)(this.touchPos, snapshot.touchPos);
|
|
550
|
+
snapshot.isTouchAtkDir = this.isTouchAtkDir;
|
|
551
|
+
snapshot.horDir = this.horDir;
|
|
552
|
+
snapshot.campType = this.campType;
|
|
553
|
+
snapshot.NoSelected = this.NoSelected;
|
|
554
|
+
snapshot.hitColorTime = this.hitColorTime;
|
|
555
|
+
snapshot.checkEnemyTime = this.checkEnemyTime;
|
|
556
|
+
snapshot.oid = this.oid;
|
|
557
|
+
snapshot.callEntityId = this.callEntityId;
|
|
558
|
+
snapshot.callTopEntityId = this.callTopEntityId;
|
|
559
|
+
snapshot.callNum = this.callNum;
|
|
560
|
+
snapshot.isBoss = this.isBoss;
|
|
561
|
+
snapshot.level = this.level;
|
|
562
|
+
snapshot.isFarAttack = this.isFarAttack;
|
|
563
|
+
snapshot.isKillSelf = this.isKillSelf;
|
|
564
|
+
snapshot.noInMove = this.noInMove;
|
|
565
|
+
snapshot.bossHpSplit = this.bossHpSplit;
|
|
566
|
+
snapshot.boxType = this.boxType;
|
|
567
|
+
snapshot.dropId = this.dropId;
|
|
568
|
+
snapshot.dropExp = this.dropExp;
|
|
569
|
+
snapshot.hasProjectileNum = this.hasProjectileNum;
|
|
570
|
+
snapshot.normalAtkTimes = this.normalAtkTimes;
|
|
571
|
+
snapshot.normalAtkProjectileNum = this.normalAtkProjectileNum;
|
|
572
|
+
snapshot.normalDamageTimes = this.normalDamageTimes;
|
|
573
|
+
snapshot.killNumTimes = this.killNumTimes;
|
|
574
|
+
snapshot.hitSign = this.hitSign;
|
|
575
|
+
snapshot.step = this.step;
|
|
576
|
+
snapshot.quality = this.quality;
|
|
577
|
+
snapshot.curWave = this.curWave;
|
|
578
|
+
snapshot.bornCfgId = this.bornCfgId;
|
|
579
|
+
snapshot.bleedDis = this.bleedDis;
|
|
580
|
+
snapshot.moveCfg = (0, BaseEntityData_1.copySnapshotValue)(this.moveCfg, snapshot.moveCfg);
|
|
581
|
+
snapshot.moveDirX = this.moveDirX;
|
|
582
|
+
snapshot.moveDirY = this.moveDirY;
|
|
583
|
+
snapshot.movePathReady = this.movePathReady;
|
|
584
|
+
snapshot.moveStartX = this.moveStartX;
|
|
585
|
+
snapshot.moveStartY = this.moveStartY;
|
|
586
|
+
snapshot.moveEndY = this.moveEndY;
|
|
587
|
+
snapshot.lastProjectileTarget = this.lastProjectileTarget;
|
|
588
|
+
snapshot.fashionId = this.fashionId;
|
|
589
|
+
//#endregion
|
|
590
|
+
//#region skill
|
|
591
|
+
snapshot.curSkillId = this.curSkillId;
|
|
592
|
+
snapshot.baseAtkUseTimes = this.baseAtkUseTimes;
|
|
593
|
+
snapshot.markUseReleaseSeq = this.markUseReleaseSeq;
|
|
594
|
+
snapshot.curAtkName = this.curAtkName;
|
|
595
|
+
snapshot.normalSkillIds = (0, BaseEntityData_1.copySnapshotValue)(this.normalSkillIds, snapshot.normalSkillIds);
|
|
596
|
+
snapshot.waitCallSkills = (0, BaseEntityData_1.copySnapshotValue)(this.waitCallSkills, snapshot.waitCallSkills);
|
|
597
|
+
if (this.skillDatas) {
|
|
598
|
+
const sdSnap = snapshot.skillDatas || (snapshot.skillDatas = {});
|
|
599
|
+
// 清掉源中已不存在的技能,防止恢复时残留
|
|
600
|
+
for (const key in sdSnap) {
|
|
601
|
+
if (!(key in this.skillDatas))
|
|
602
|
+
delete sdSnap[key];
|
|
603
|
+
}
|
|
604
|
+
for (const key in this.skillDatas) {
|
|
605
|
+
sdSnap[key] = this.skillDatas[key].getValueSnapshot(sdSnap[key]);
|
|
606
|
+
}
|
|
607
|
+
}
|
|
608
|
+
else {
|
|
609
|
+
snapshot.skillDatas = null;
|
|
610
|
+
}
|
|
611
|
+
snapshot.skillEmitters = (0, BaseEntityData_1.copySnapshotValue)(this.skillEmitters, snapshot.skillEmitters);
|
|
612
|
+
snapshot.doubleShootNum = this.doubleShootNum;
|
|
613
|
+
snapshot.curDoubleShootNum = this.curDoubleShootNum;
|
|
614
|
+
//#endregion
|
|
615
|
+
//#region buff
|
|
616
|
+
const buffList = this.buffList;
|
|
617
|
+
const blSnap = snapshot.buffList || (snapshot.buffList = {});
|
|
618
|
+
for (const key in blSnap) {
|
|
619
|
+
if (!(key in buffList))
|
|
620
|
+
delete blSnap[key];
|
|
621
|
+
}
|
|
622
|
+
for (const key in buffList) {
|
|
623
|
+
const list = buffList[key];
|
|
624
|
+
if (!list) {
|
|
625
|
+
delete blSnap[key];
|
|
626
|
+
continue;
|
|
627
|
+
}
|
|
628
|
+
const arr = blSnap[key] || (blSnap[key] = []);
|
|
629
|
+
arr.length = list.length;
|
|
630
|
+
for (let i = 0; i < list.length; i++) {
|
|
631
|
+
arr[i] = list[i].getValueSnapshot(arr[i]);
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
snapshot.buffEffectMap = (0, BaseEntityData_1.copySnapshotValue)(this.buffEffectMap, snapshot.buffEffectMap);
|
|
635
|
+
//#endregion
|
|
636
|
+
//#region sprint
|
|
637
|
+
snapshot.sprintPos = (0, BaseEntityData_1.copySnapshotValue)(this.sprintPos, snapshot.sprintPos);
|
|
638
|
+
snapshot.sprintSpeed = this.sprintSpeed;
|
|
639
|
+
//#endregion
|
|
640
|
+
//#region property
|
|
641
|
+
snapshot.curHp = this.curHp;
|
|
642
|
+
snapshot.property = (0, BaseEntityData_1.copySnapshotValue)(this.property, snapshot.property);
|
|
643
|
+
//#endregion
|
|
644
|
+
//#region target
|
|
645
|
+
snapshot.attackTarget = this.attackTarget;
|
|
646
|
+
snapshot.targetPos = (0, BaseEntityData_1.copySnapshotValue)(this.targetPos, snapshot.targetPos);
|
|
647
|
+
//#endregion
|
|
648
|
+
snapshot.resPath = this.resPath;
|
|
649
|
+
return snapshot;
|
|
650
|
+
}
|
|
651
|
+
/** 从权威快照恢复 fighter;恢复完成后派发 BuffRestoreTriggers 重挂 buff 触发器 */
|
|
652
|
+
resetFromSnapshot(snapshot) {
|
|
653
|
+
super.resetFromSnapshot(snapshot);
|
|
654
|
+
//#region state params
|
|
655
|
+
this.curState = snapshot.curState;
|
|
656
|
+
this.fsmType = snapshot.fsmType;
|
|
657
|
+
this.actionTime = snapshot.actionTime;
|
|
658
|
+
this.waitActionTime = snapshot.waitActionTime;
|
|
659
|
+
this.realExtraSpeed = snapshot.realExtraSpeed;
|
|
660
|
+
this.eventIndex = snapshot.eventIndex;
|
|
661
|
+
this.curAtkTime = snapshot.curAtkTime;
|
|
662
|
+
this.needFindTarget = snapshot.needFindTarget;
|
|
663
|
+
this.actionType = snapshot.actionType;
|
|
664
|
+
//#endregion
|
|
665
|
+
//#region animation
|
|
666
|
+
this.spineName = snapshot.spineName;
|
|
667
|
+
this.curSpineAnimName = snapshot.curSpineAnimName;
|
|
668
|
+
this.isLoop = snapshot.isLoop;
|
|
669
|
+
this.timeScale = snapshot.timeScale;
|
|
670
|
+
this.skinNameIndex = snapshot.skinNameIndex;
|
|
671
|
+
//#endregion
|
|
672
|
+
//#region config/runtime
|
|
673
|
+
this.limitHp = snapshot.limitHp;
|
|
674
|
+
this.cfg = snapshot.cfg;
|
|
675
|
+
this.atkDir = (0, BaseEntityData_1.copySnapshotValue)(snapshot.atkDir, this.atkDir);
|
|
676
|
+
this.touchPos = (0, BaseEntityData_1.copySnapshotValue)(snapshot.touchPos, this.touchPos);
|
|
677
|
+
this.isTouchAtkDir = snapshot.isTouchAtkDir;
|
|
678
|
+
this.horDir = snapshot.horDir;
|
|
679
|
+
this.campType = snapshot.campType;
|
|
680
|
+
this.NoSelected = snapshot.NoSelected;
|
|
681
|
+
this.hitColorTime = snapshot.hitColorTime;
|
|
682
|
+
this.checkEnemyTime = snapshot.checkEnemyTime;
|
|
683
|
+
this.oid = snapshot.oid;
|
|
684
|
+
this.callEntityId = snapshot.callEntityId;
|
|
685
|
+
this.callTopEntityId = snapshot.callTopEntityId;
|
|
686
|
+
this.callNum = snapshot.callNum;
|
|
687
|
+
this.isBoss = snapshot.isBoss;
|
|
688
|
+
this.level = snapshot.level;
|
|
689
|
+
this.isFarAttack = snapshot.isFarAttack;
|
|
690
|
+
this.isKillSelf = snapshot.isKillSelf;
|
|
691
|
+
this.noInMove = snapshot.noInMove;
|
|
692
|
+
this.bossHpSplit = snapshot.bossHpSplit;
|
|
693
|
+
this.boxType = snapshot.boxType;
|
|
694
|
+
this.dropId = snapshot.dropId;
|
|
695
|
+
this.dropExp = snapshot.dropExp;
|
|
696
|
+
this.hasProjectileNum = snapshot.hasProjectileNum;
|
|
697
|
+
this.normalAtkTimes = snapshot.normalAtkTimes;
|
|
698
|
+
this.normalAtkProjectileNum = snapshot.normalAtkProjectileNum;
|
|
699
|
+
this.normalDamageTimes = snapshot.normalDamageTimes;
|
|
700
|
+
this.killNumTimes = snapshot.killNumTimes;
|
|
701
|
+
this.hitSign = snapshot.hitSign;
|
|
702
|
+
this.step = snapshot.step;
|
|
703
|
+
this.quality = snapshot.quality;
|
|
704
|
+
this.curWave = snapshot.curWave;
|
|
705
|
+
this.bornCfgId = snapshot.bornCfgId;
|
|
706
|
+
this.bleedDis = snapshot.bleedDis;
|
|
707
|
+
this.moveCfg = (0, BaseEntityData_1.copySnapshotValue)(snapshot.moveCfg, this.moveCfg);
|
|
708
|
+
this.moveDirX = snapshot.moveDirX;
|
|
709
|
+
this.moveDirY = snapshot.moveDirY;
|
|
710
|
+
this.movePathReady = snapshot.movePathReady;
|
|
711
|
+
this.moveStartX = snapshot.moveStartX;
|
|
712
|
+
this.moveStartY = snapshot.moveStartY;
|
|
713
|
+
this.moveEndY = snapshot.moveEndY;
|
|
714
|
+
this.lastProjectileTarget = snapshot.lastProjectileTarget;
|
|
715
|
+
this.fashionId = snapshot.fashionId;
|
|
716
|
+
//#endregion
|
|
717
|
+
//#region skill
|
|
718
|
+
this.curSkillId = snapshot.curSkillId;
|
|
719
|
+
this.baseAtkUseTimes = snapshot.baseAtkUseTimes;
|
|
720
|
+
this.markUseReleaseSeq = snapshot.markUseReleaseSeq;
|
|
721
|
+
this.curAtkName = snapshot.curAtkName;
|
|
722
|
+
this.normalSkillIds = (0, BaseEntityData_1.copySnapshotValue)(snapshot.normalSkillIds, this.normalSkillIds);
|
|
723
|
+
this.waitCallSkills = (0, BaseEntityData_1.copySnapshotValue)(snapshot.waitCallSkills, this.waitCallSkills);
|
|
724
|
+
if (snapshot.skillDatas) {
|
|
725
|
+
if (!this.skillDatas)
|
|
726
|
+
this.skillDatas = {};
|
|
727
|
+
for (const key in this.skillDatas) {
|
|
728
|
+
if (!(key in snapshot.skillDatas))
|
|
729
|
+
delete this.skillDatas[key];
|
|
730
|
+
}
|
|
731
|
+
for (const key in snapshot.skillDatas) {
|
|
732
|
+
const sd = this.skillDatas[key] || (this.skillDatas[key] = new SkillData_1.SkillData());
|
|
733
|
+
sd.resetFromSnapshot(snapshot.skillDatas[key]);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
else {
|
|
737
|
+
this.skillDatas = null;
|
|
738
|
+
}
|
|
739
|
+
this.resetSkillEmittersFromSnapshot(snapshot.skillEmitters);
|
|
740
|
+
this.doubleShootNum = snapshot.doubleShootNum;
|
|
741
|
+
this.curDoubleShootNum = snapshot.curDoubleShootNum;
|
|
742
|
+
//#endregion
|
|
743
|
+
//#region buff
|
|
744
|
+
this.resetBuffListFromSnapshot(snapshot.buffList);
|
|
745
|
+
this.buffEffectMap = (0, BaseEntityData_1.copySnapshotValue)(snapshot.buffEffectMap, this.buffEffectMap);
|
|
746
|
+
//#endregion
|
|
747
|
+
//#region sprint
|
|
748
|
+
this.sprintPos = (0, BaseEntityData_1.copySnapshotValue)(snapshot.sprintPos, this.sprintPos);
|
|
749
|
+
this.sprintSpeed = snapshot.sprintSpeed;
|
|
750
|
+
//#endregion
|
|
751
|
+
//#region property
|
|
752
|
+
this.curHp = snapshot.curHp;
|
|
753
|
+
this.property = (0, BaseEntityData_1.copySnapshotValue)(snapshot.property, this.property);
|
|
754
|
+
//#endregion
|
|
755
|
+
//#region target
|
|
756
|
+
this.attackTarget = snapshot.attackTarget;
|
|
757
|
+
this.targetPos = (0, BaseEntityData_1.copySnapshotValue)(snapshot.targetPos, this.targetPos);
|
|
758
|
+
//#endregion
|
|
759
|
+
this.resPath = snapshot.resPath;
|
|
760
|
+
// 回滚窗口内 buff 的进入/退出会留下过期触发器注册,按恢复后的 buff 列表统一重挂
|
|
761
|
+
if (this.game) {
|
|
762
|
+
this.game.emit(GameEvent_1.GameEvent.BuffRestoreTriggers, this);
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
/** 按快照重建技能发射器:回收现有池对象,逐个按 emitterName 重新获取后覆盖值 */
|
|
766
|
+
resetSkillEmittersFromSnapshot(snapshotEmitters) {
|
|
767
|
+
const emitters = this.skillEmitters;
|
|
768
|
+
for (let i = 0; i < emitters.length; i++) {
|
|
769
|
+
SkillEmitterPool_1.SkillEmitterPool.despawn(emitters[i]);
|
|
770
|
+
}
|
|
771
|
+
emitters.length = 0;
|
|
772
|
+
if (!snapshotEmitters)
|
|
773
|
+
return;
|
|
774
|
+
for (let i = 0; i < snapshotEmitters.length; i++) {
|
|
775
|
+
const snap = snapshotEmitters[i];
|
|
776
|
+
const emitter = SkillEmitterPool_1.SkillEmitterPool.spawn(snap.emitterName);
|
|
777
|
+
(0, BaseEntityData_1.copySnapshotValue)(snap, emitter);
|
|
778
|
+
emitters.push(emitter);
|
|
779
|
+
}
|
|
780
|
+
}
|
|
781
|
+
/** 按快照重建 buff 列表:回收现有 BuffItem,再逐个从 BuffPool 取出覆盖值 */
|
|
782
|
+
resetBuffListFromSnapshot(snapshotBuffList) {
|
|
783
|
+
const buffList = this.buffList;
|
|
784
|
+
for (const key in buffList) {
|
|
785
|
+
const list = buffList[key];
|
|
786
|
+
if (list) {
|
|
787
|
+
for (let i = list.length - 1; i >= 0; i--) {
|
|
788
|
+
BuffPool_1.BuffPool.despawn(list[i]);
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
delete buffList[key];
|
|
792
|
+
}
|
|
793
|
+
if (!snapshotBuffList)
|
|
794
|
+
return;
|
|
795
|
+
for (const key in snapshotBuffList) {
|
|
796
|
+
const snapArr = snapshotBuffList[key];
|
|
797
|
+
const arr = [];
|
|
798
|
+
for (let i = 0; i < snapArr.length; i++) {
|
|
799
|
+
const item = BuffPool_1.BuffPool.spawn();
|
|
800
|
+
item.resetFromSnapshot(snapArr[i]);
|
|
801
|
+
arr.push(item);
|
|
802
|
+
}
|
|
803
|
+
buffList[key] = arr;
|
|
804
|
+
}
|
|
805
|
+
}
|
|
462
806
|
};
|
|
463
807
|
FighterData = __decorate([
|
|
464
808
|
(0, BattleUtils_1.cacheFunction)("FighterData")
|
|
@@ -104,4 +104,6 @@ export default class ProjectileData extends BaseEntityData {
|
|
|
104
104
|
resetFromSnapshot(snapshot: IProjectileValueSnapshot): void;
|
|
105
105
|
private resetEmitterFromSnapshot;
|
|
106
106
|
initProjectileData(nextId: number, campType: CampType, collision?: readonly number[], offsets?: readonly number[]): void;
|
|
107
|
+
/** 回池清理:归还发射器并清空投射物运行时状态,game 随后由基类断开 */
|
|
108
|
+
protected onUnuse(): void;
|
|
107
109
|
}
|
|
@@ -255,6 +255,31 @@ let ProjectileData = class ProjectileData extends BaseEntityData_1.default {
|
|
|
255
255
|
}
|
|
256
256
|
projectile.isDirty = 65535 /* LocalDirtyFlag.ALL */;
|
|
257
257
|
}
|
|
258
|
+
/** 回池清理:归还发射器并清空投射物运行时状态,game 随后由基类断开 */
|
|
259
|
+
onUnuse() {
|
|
260
|
+
if (this.emitter) {
|
|
261
|
+
SkillEmitterPool_1.SkillEmitterPool.despawn(this.emitter);
|
|
262
|
+
}
|
|
263
|
+
this.emitter = null;
|
|
264
|
+
this.emitterProxyHit = 0;
|
|
265
|
+
this.owner = 0;
|
|
266
|
+
this.hitoid = null;
|
|
267
|
+
this.ignoreOid.length = 0;
|
|
268
|
+
this.noTriggerTime = 0;
|
|
269
|
+
this.notriggerSubImpact = 0;
|
|
270
|
+
this.parentID = 0;
|
|
271
|
+
this.notriggerDead = 0;
|
|
272
|
+
this.hitNum = 0;
|
|
273
|
+
// 复用字典容器,避免每次回池新建
|
|
274
|
+
for (const key in this.hitDeltaMap) {
|
|
275
|
+
delete this.hitDeltaMap[key];
|
|
276
|
+
}
|
|
277
|
+
this.target = 0;
|
|
278
|
+
this.impact = null;
|
|
279
|
+
this.impact2 = null;
|
|
280
|
+
this.impact3 = null;
|
|
281
|
+
this.hitContext = null;
|
|
282
|
+
}
|
|
258
283
|
};
|
|
259
284
|
ProjectileData = __decorate([
|
|
260
285
|
(0, BattleUtils_1.cacheFunction)("ProjectileData")
|