captainbattle 1.0.5 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/CallID.d.ts +121 -105
- package/dist/core/CallID.js +128 -105
- package/dist/core/ListenID.d.ts +503 -443
- package/dist/core/ListenID.js +513 -443
- package/dist/core/config/AccessoriesDrawCfg.d.ts +9 -0
- package/dist/core/config/AccessoriesDrawCfg.js +8 -0
- package/dist/core/config/BadgeCfg.d.ts +76 -19
- package/dist/core/config/BadgeCfg.js +76 -19
- package/dist/core/config/BountyTaskCfg.d.ts +1 -1
- package/dist/core/config/BuffCfg.d.ts +3 -0
- package/dist/core/config/BuffCfg.js +3 -0
- package/dist/core/config/Cfg.d.ts +224 -120
- package/dist/core/config/Cfg.js +251 -121
- package/dist/core/config/ChatChannelCfg.d.ts +8 -2
- package/dist/core/config/ChatChannelCfg.js +7 -1
- package/dist/core/config/ChatEmojiCfg.d.ts +0 -2
- package/dist/core/config/Const.d.ts +3 -1
- package/dist/core/config/Const.js +2 -0
- package/dist/core/config/DailyTrialMapCfg.d.ts +1 -2
- package/dist/core/config/EmailCfg.d.ts +13 -1
- package/dist/core/config/EmailCfg.js +13 -1
- package/dist/core/config/FirstRechargeCfg.d.ts +1 -0
- package/dist/core/config/FuncDescCfg.d.ts +33 -3
- package/dist/core/config/FuncDescCfg.js +33 -3
- package/dist/core/config/FusionLevelCfg.d.ts +10 -0
- package/dist/core/config/FusionLevelCfg.js +8 -0
- package/dist/core/config/GuildBonusLogCfg.d.ts +8 -0
- package/dist/core/config/GuildBonusLogCfg.js +8 -0
- package/dist/core/config/GuildBossRankRewardCfg.d.ts +2 -1
- package/dist/core/config/GuildConfigCfg.d.ts +1 -1
- package/dist/core/config/GuildConfigCfg.js +1 -1
- package/dist/core/config/GuildDonateCfg.d.ts +4 -2
- package/dist/core/config/GuildIslandBuildCfg.d.ts +16 -0
- package/dist/core/config/GuildIslandBuildCfg.js +8 -0
- package/dist/core/config/GuildIslandBuildItemCfg.d.ts +11 -0
- package/dist/core/config/GuildIslandBuildItemCfg.js +8 -0
- package/dist/core/config/GuildIslandConfigCfg.d.ts +19 -0
- package/dist/core/config/GuildIslandConfigCfg.js +16 -0
- package/dist/core/config/GuildIslandIslandCfg.d.ts +9 -0
- package/dist/core/config/GuildIslandIslandCfg.js +8 -0
- package/dist/core/config/GuildIslandRankCfg.d.ts +11 -0
- package/dist/core/config/GuildIslandRankCfg.js +8 -0
- package/dist/core/config/GuildIslandZoneCfg.d.ts +11 -0
- package/dist/core/config/GuildIslandZoneCfg.js +8 -0
- package/dist/core/config/GuildLogCfg.d.ts +1 -0
- package/dist/core/config/GuildLvCfg.d.ts +1 -1
- package/dist/core/config/InviteConfigCfg.d.ts +14 -0
- package/dist/core/config/InviteConfigCfg.js +11 -0
- package/dist/core/config/InviteRewardCfg.d.ts +9 -0
- package/dist/core/config/InviteRewardCfg.js +8 -0
- package/dist/core/config/ItemsCfg.d.ts +5 -1
- package/dist/core/config/ItemsCfg.js +4 -0
- package/dist/core/config/MarqueeContentCfg.d.ts +7 -0
- package/dist/core/config/MarqueeContentCfg.js +7 -1
- package/dist/core/config/ModAffixLvCfg.d.ts +12 -0
- package/dist/core/config/ModAffixLvCfg.js +8 -0
- package/dist/core/config/PetCfg.d.ts +0 -2
- package/dist/core/config/PetConfigCfg.d.ts +19 -0
- package/dist/core/config/PetConfigCfg.js +16 -0
- package/dist/core/config/PetDrawCfg.d.ts +9 -0
- package/dist/core/config/PetDrawCfg.js +8 -0
- package/dist/core/config/PetSkillCfg.d.ts +2 -1
- package/dist/core/config/PrivilegeCfg.d.ts +2 -0
- package/dist/core/config/PrivilegeCfg.js +2 -0
- package/dist/core/config/ProDefineCfg.d.ts +2 -0
- package/dist/core/config/QualityCfg.d.ts +1 -0
- package/dist/core/config/RelicDungeonConfigCfg.d.ts +14 -4
- package/dist/core/config/RelicDungeonConfigCfg.js +14 -4
- package/dist/core/config/RelicDungeonGrowCfg.d.ts +7 -0
- package/dist/core/config/RelicDungeonGrowCfg.js +8 -0
- package/dist/core/config/RelicDungeonLevelCfg.d.ts +4 -10
- package/dist/core/config/RelicDungeonRankRewardCfg.d.ts +9 -0
- package/dist/core/config/RelicDungeonRankRewardCfg.js +8 -0
- package/dist/core/config/RelicDungeonScoreCfg.d.ts +11 -0
- package/dist/core/config/RelicDungeonScoreCfg.js +8 -0
- package/dist/core/config/RelicDungeonScoreRewardCfg.d.ts +9 -0
- package/dist/core/config/RelicDungeonScoreRewardCfg.js +8 -0
- package/dist/core/config/RelicTiesCfg.d.ts +1 -0
- package/dist/core/config/RobotConfigCfg.d.ts +17 -0
- package/dist/core/config/RobotConfigCfg.js +8 -0
- package/dist/core/config/RoleCfg.d.ts +1 -0
- package/dist/core/config/RuleDescCfg.d.ts +12 -2
- package/dist/core/config/RuleDescCfg.js +12 -2
- package/dist/core/config/SeaArenaConfigCfg.d.ts +22 -0
- package/dist/core/config/SeaArenaConfigCfg.js +19 -0
- package/dist/core/config/SeaArenaRankRewardCfg.d.ts +10 -0
- package/dist/core/config/SeaArenaRankRewardCfg.js +8 -0
- package/dist/core/config/SeaArenaRobotCfg.d.ts +8 -0
- package/dist/core/config/SeaArenaRobotCfg.js +8 -0
- package/dist/core/config/SeaArenaTierCfg.d.ts +13 -0
- package/dist/core/config/SeaArenaTierCfg.js +8 -0
- package/dist/core/config/ShopCfg.d.ts +1 -0
- package/dist/core/config/SkillLvCfg.d.ts +10 -0
- package/dist/core/config/SkillLvCfg.js +8 -0
- package/dist/core/config/SkinSkillCfg.d.ts +2 -1
- package/dist/core/config/SprintActivityConfigCfg.d.ts +18 -3
- package/dist/core/config/SprintActivityConfigCfg.js +18 -3
- package/dist/core/config/StageCfg.d.ts +2 -0
- package/dist/core/config/TConfig.d.ts +1 -1
- package/dist/core/config/TConfig.js +6 -4
- package/dist/core/config/TalentTreeLvCfg.d.ts +1 -1
- package/dist/core/config/TurretFusionLevelCfg.d.ts +10 -0
- package/dist/core/config/TurretFusionLevelCfg.js +8 -0
- package/dist/core/config/TurretModAffixLvCfg.d.ts +12 -0
- package/dist/core/config/TurretModAffixLvCfg.js +8 -0
- package/dist/core/config/TurretModCfg.d.ts +20 -0
- package/dist/core/config/TurretModCfg.js +8 -0
- package/dist/core/config/TurretModConfigCfg.d.ts +20 -0
- package/dist/core/config/TurretModConfigCfg.js +17 -0
- package/dist/core/config/TurretModQualityCfg.d.ts +12 -0
- package/dist/core/config/TurretModQualityCfg.js +8 -0
- package/dist/core/config/TurretSkillLvCfg.d.ts +10 -0
- package/dist/core/config/TurretSkillLvCfg.js +8 -0
- package/dist/core/config/VehicleWashAffixCfg.d.ts +14 -0
- package/dist/core/config/VehicleWashAffixCfg.js +8 -0
- package/dist/core/config/VehicleWashLevelCfg.d.ts +6 -2
- package/dist/core/framework/Pool.d.ts +4 -1
- package/dist/core/framework/Pool.js +19 -21
- package/dist/core/framework/Time.js +13 -3
- package/dist/core/framework/Watcher.js +0 -1
- package/dist/core/framework/collections/MinSortList.d.ts +0 -2
- package/dist/core/framework/collections/MinSortList.js +9 -33
- package/dist/core/framework/collections/ObjectPool.js +6 -3
- package/dist/core/framework/notify/Notifier.d.ts +1 -1
- package/dist/core/framework/notify/Notifier.js +5 -4
- package/dist/core/framework/notify/NotifyID.d.ts +2 -1
- package/dist/core/framework/notify/NotifyID.js +1 -0
- package/dist/core/framework/notify/NotifyListener.js +35 -9
- package/dist/core/module/arena/ArenaBattleModule.d.ts +7 -0
- package/dist/core/module/arena/ArenaBattleModule.js +32 -0
- package/dist/core/module/arena/index.d.ts +1 -0
- package/dist/core/module/arena/index.js +13 -0
- package/dist/core/module/battle/Game.d.ts +104 -13
- package/dist/core/module/battle/Game.js +218 -45
- package/dist/core/module/battle/IGameModule.d.ts +6 -0
- package/dist/core/module/battle/IGameModule.js +19 -6
- package/dist/core/module/battle/battle.interface.d.ts +31 -7
- package/dist/core/module/battle/battle.interface.js +5 -1
- package/dist/core/module/battle/buff/BuffMgr.d.ts +25 -0
- package/dist/core/module/battle/buff/BuffMgr.js +43 -0
- package/dist/core/module/battle/buff/BuffTrigger.js +9 -1
- package/dist/core/module/battle/buff/buffitem/AddPhysicDamBuff.js +2 -2
- package/dist/core/module/battle/buff/buffitem/ChangeSetpAddDamageBuff.js +3 -2
- package/dist/core/module/battle/buff/buffitem/DeltaUseSkillBuff.js +3 -2
- package/dist/core/module/battle/buff/buffitem/DiceAddCritBuff.d.ts +8 -0
- package/dist/core/module/battle/buff/buffitem/DiceAddCritBuff.js +35 -0
- package/dist/core/module/battle/buff/buffitem/FireHurtLayerBuff.d.ts +7 -0
- package/dist/core/module/battle/buff/buffitem/FireHurtLayerBuff.js +28 -0
- package/dist/core/module/battle/buff/buffitem/ForceTargetBuff.js +2 -1
- package/dist/core/module/battle/buff/buffitem/HitBoundAddDamageBuff.js +1 -1
- package/dist/core/module/battle/buff/buffitem/HitBoundAddScaleBuff.d.ts +11 -0
- package/dist/core/module/battle/buff/buffitem/HitBoundAddScaleBuff.js +79 -0
- package/dist/core/module/battle/buff/buffitem/LinkCurseBuff.js +3 -2
- package/dist/core/module/battle/buff/buffitem/MonitorBuff.js +10 -12
- package/dist/core/module/battle/buff/buffitem/PosionBanCureBuff.d.ts +3 -0
- package/dist/core/module/battle/buff/buffitem/PosionBanCureBuff.js +18 -0
- package/dist/core/module/battle/buff/buffitem/PosionBuff.d.ts +1 -0
- package/dist/core/module/battle/buff/buffitem/PosionBuff.js +15 -4
- package/dist/core/module/battle/buff/buffitem/ProjectileOrbLinkBuff.js +1 -1
- package/dist/core/module/battle/buff/buffitem/ProjectileScaleUpBuff.js +4 -2
- package/dist/core/module/battle/buff/buffitem/SameHitAddDamageBuff.js +8 -0
- package/dist/core/module/battle/buff/buffitem/SlayBuff.js +1 -1
- package/dist/core/module/battle/buff/buffitem/TimeAddDamageBuff.d.ts +1 -1
- package/dist/core/module/battle/buff/buffitem/TimeAddDamageBuff.js +36 -27
- package/dist/core/module/battle/buff/buffitem/index.d.ts +4 -0
- package/dist/core/module/battle/buff/buffitem/index.js +5 -1
- package/dist/core/module/battle/entity/BaseEntityData.d.ts +15 -1
- package/dist/core/module/battle/entity/BaseEntityData.js +27 -0
- package/dist/core/module/battle/entity/DragonBodyData.d.ts +19 -1
- package/dist/core/module/battle/entity/DragonBodyData.js +34 -0
- package/dist/core/module/battle/entity/DragonData.d.ts +18 -1
- package/dist/core/module/battle/entity/DragonData.js +32 -0
- package/dist/core/module/battle/entity/EntityPool.d.ts +1 -2
- package/dist/core/module/battle/entity/EntityPool.js +9 -18
- package/dist/core/module/battle/entity/FighterData.d.ts +114 -3
- package/dist/core/module/battle/entity/FighterData.js +350 -6
- package/dist/core/module/battle/entity/ProjectileData.d.ts +2 -0
- package/dist/core/module/battle/entity/ProjectileData.js +25 -0
- package/dist/core/module/battle/entity/RoleData.d.ts +12 -1
- package/dist/core/module/battle/entity/RoleData.js +19 -0
- package/dist/core/module/battle/entity/TurnUnit.d.ts +36 -0
- package/dist/core/module/battle/entity/TurnUnit.js +74 -0
- package/dist/core/module/battle/entity/index.d.ts +1 -1
- package/dist/core/module/battle/entity/index.js +1 -1
- package/dist/core/module/battle/event/EntityEvent.d.ts +13 -0
- package/dist/core/module/battle/event/EntityEvent.js +14 -0
- package/dist/core/module/battle/event/EntityEventBus.d.ts +10 -0
- package/dist/core/module/battle/event/EntityEventBus.js +35 -0
- package/dist/core/module/battle/event/EventListener.d.ts +6 -1
- package/dist/core/module/battle/event/EventListener.js +140 -7
- package/dist/core/module/battle/event/GameEvent.d.ts +8 -0
- package/dist/core/module/battle/event/GameEvent.js +9 -0
- package/dist/core/module/battle/factory/FighterFactory.js +26 -10
- package/dist/core/module/battle/fsm-state/AnyFighterStateTransitions.js +24 -12
- package/dist/core/module/battle/fsm-state/AnyFighterStates.js +9 -5
- package/dist/core/module/battle/fsm-state/Boss18110CallState.d.ts +1 -1
- package/dist/core/module/battle/fsm-state/Boss18110State.d.ts +1 -1
- package/dist/core/module/battle/fsm-state/FighterStateMachine.d.ts +2 -0
- package/dist/core/module/battle/fsm-state/FighterStateMachine.js +6 -0
- package/dist/core/module/battle/fsm-state/FighterStateProfiles.d.ts +8 -1
- package/dist/core/module/battle/fsm-state/FighterStateProfiles.js +31 -0
- package/dist/core/module/battle/fsm-state/FighterStateRegistry.d.ts +3 -0
- package/dist/core/module/battle/fsm-state/FighterStateRegistry.js +27 -8
- package/dist/core/module/battle/fsm-state/FighterStateShared.js +2 -2
- package/dist/core/module/battle/fsm-state/FighterStateType.d.ts +2 -1
- package/dist/core/module/battle/fsm-state/FighterStateType.js +2 -1
- package/dist/core/module/battle/fsm-state/TurnState.d.ts +29 -0
- package/dist/core/module/battle/fsm-state/TurnState.js +208 -0
- package/dist/core/module/battle/fsm-state/TurnTransitions.d.ts +36 -0
- package/dist/core/module/battle/fsm-state/TurnTransitions.js +90 -0
- package/dist/core/module/battle/fsm-state/index.d.ts +2 -0
- package/dist/core/module/battle/fsm-state/index.js +3 -1
- package/dist/core/module/battle/manager/EntityManager.d.ts +1 -0
- package/dist/core/module/battle/manager/EntityManager.js +138 -20
- package/dist/core/module/battle/skill/SkillData.d.ts +27 -0
- package/dist/core/module/battle/skill/SkillData.js +43 -0
- package/dist/core/module/battle/skill/emitter/SkillEmitter.js +4 -1
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter1.d.ts +3 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter1.js +30 -2
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter10.js +2 -2
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter13.d.ts +1 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter13.js +25 -2
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter15.js +1 -1
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter2.js +1 -1
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter23.d.ts +9 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter23.js +75 -11
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter24.js +1 -1
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter26.js +4 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter28.js +1 -1
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter3.d.ts +14 -8
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter3.js +127 -31
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter30.d.ts +36 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter30.js +235 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter31.d.ts +13 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter31.js +47 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter4.d.ts +1 -0
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter4.js +25 -2
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter6.js +10 -6
- package/dist/core/module/battle/skill/emitter/projectiles/ProjectileEmitter8.js +2 -2
- package/dist/core/module/battle/skill/emitter/projectiles/index.d.ts +2 -0
- package/dist/core/module/battle/skill/emitter/projectiles/index.js +3 -1
- package/dist/core/module/battle/skill/impacts/Impact1.js +2 -0
- package/dist/core/module/battle/skill/impacts/Impact10.js +1 -1
- package/dist/core/module/battle/skill/impacts/Impact100.d.ts +13 -0
- package/dist/core/module/battle/skill/impacts/Impact100.js +61 -0
- package/dist/core/module/battle/skill/impacts/Impact101.d.ts +13 -0
- package/dist/core/module/battle/skill/impacts/Impact101.js +49 -0
- package/dist/core/module/battle/skill/impacts/Impact17.d.ts +1 -1
- package/dist/core/module/battle/skill/impacts/Impact18.d.ts +1 -1
- package/dist/core/module/battle/skill/impacts/Impact19.d.ts +13 -0
- package/dist/core/module/battle/skill/impacts/Impact19.js +31 -0
- package/dist/core/module/battle/skill/impacts/Impact2.js +1 -1
- package/dist/core/module/battle/skill/impacts/Impact3.js +6 -5
- package/dist/core/module/battle/skill/impacts/index.d.ts +3 -0
- package/dist/core/module/battle/skill/impacts/index.js +4 -1
- package/dist/core/module/battle/skill/pool/SkillEmitterPool.js +11 -6
- package/dist/core/module/battle/system/BornSystem.js +2 -2
- package/dist/core/module/battle/system/BuffSystem.d.ts +8 -5
- package/dist/core/module/battle/system/BuffSystem.js +47 -22
- package/dist/core/module/battle/system/CollisionSystem.d.ts +4 -0
- package/dist/core/module/battle/system/CollisionSystem.js +31 -22
- package/dist/core/module/battle/system/DestroySystem.d.ts +6 -0
- package/dist/core/module/battle/system/DestroySystem.js +61 -20
- package/dist/core/module/battle/system/InputSystem.d.ts +3 -1
- package/dist/core/module/battle/system/InputSystem.js +15 -4
- package/dist/core/module/battle/system/ProjectileSystem.d.ts +1 -0
- package/dist/core/module/battle/system/ProjectileSystem.js +49 -29
- package/dist/core/module/battle/system/SkillSystem.d.ts +3 -1
- package/dist/core/module/battle/system/SkillSystem.js +55 -25
- package/dist/core/module/battle/system/TurnPhaseSystem.d.ts +52 -0
- package/dist/core/module/battle/system/TurnPhaseSystem.js +189 -0
- package/dist/core/module/battle/system/TurnSchedulerSystem.d.ts +51 -0
- package/dist/core/module/battle/system/TurnSchedulerSystem.js +363 -0
- package/dist/core/module/battle/target/CloseAngleTargetSelection.js +30 -10
- package/dist/core/module/battle/target/CloseDownTargetSelection.js +64 -17
- package/dist/core/module/battle/target/CloseTargetSelection.js +22 -5
- package/dist/core/module/battle/target/RandomRangeTargetSelection.js +8 -8
- package/dist/core/module/battle/target/SelfRandomTargetSelection.js +2 -0
- package/dist/core/module/battle/target/SelfRandomTowerTargetSelection.js +0 -1
- package/dist/core/module/battle/turn/TurnBattleGame.d.ts +85 -0
- package/dist/core/module/battle/turn/TurnBattleGame.js +453 -0
- package/dist/core/module/battle/turn/TurnBattleModule.d.ts +14 -0
- package/dist/core/module/battle/turn/TurnBattleModule.js +65 -0
- package/dist/core/module/battle/turn/TurnBattleTypes.d.ts +25 -0
- package/dist/core/module/battle/turn/TurnBattleTypes.js +15 -0
- package/dist/core/module/battle/util/BattleInputCodec.d.ts +2 -3
- package/dist/core/module/battle/util/BattleInputCodec.js +14 -3
- package/dist/core/module/battle/util/BattleUtils.d.ts +21 -1
- package/dist/core/module/battle/util/BattleUtils.js +217 -41
- package/dist/core/module/battle/util/EllipseArc.d.ts +2 -0
- package/dist/core/module/battle/util/EllipseArc.js +43 -0
- package/dist/core/module/battle/util/HitDataPool.js +3 -1
- package/dist/core/module/battle/util/Random.js +13 -4
- package/dist/core/module/dailyTrial/DailyTrialBattleModule.d.ts +11 -0
- package/dist/core/module/dailyTrial/DailyTrialBattleModule.js +103 -0
- package/dist/core/module/dailyTrial/index.d.ts +1 -0
- package/dist/core/module/dailyTrial/index.js +13 -0
- package/dist/core/module/guild/view/boss/GuildBossBattleModule.d.ts +2 -1
- package/dist/core/module/guild/view/boss/GuildBossBattleModule.js +12 -2
- package/dist/core/module/module.interface.d.ts +1 -0
- package/dist/core/module/property/Property.d.ts +22 -3
- package/dist/core/module/property/Property.js +43 -5
- package/dist/core/module/property/PropertyUtil.d.ts +17 -2
- package/dist/core/module/property/PropertyUtil.js +67 -7
- package/dist/core/module/relicDungeon/RelicBattleModule.d.ts +5 -0
- package/dist/core/module/relicDungeon/RelicBattleModule.js +26 -2
- package/dist/core/module/stage/StageBattleModule.js +1 -0
- package/dist/core/proto/CommonProto.d.ts +24671 -14643
- package/dist/core/proto/Proto.d.ts +289 -77
- package/dist/index.d.ts +39 -3
- package/dist/index.js +230 -17
- package/dist/register-all.d.ts +2 -0
- package/dist/register-all.js +2 -0
- package/package.json +1 -1
- package/resources/config/GameJsonCfg.bin +0 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TConfig, IConfig } from "./TConfig";
|
|
2
|
+
export interface TurretModAffixLvCfg extends IConfig {
|
|
3
|
+
/** 序列*/ readonly id: number;
|
|
4
|
+
/** 属性类型*/ readonly type: number;
|
|
5
|
+
/** 属性id*/ readonly attrId: number;
|
|
6
|
+
/** 基础属性
|
|
7
|
+
[[品质,数值],[品质,数值],[品质,数值]]*/ readonly baseAttr: ReadonlyArray<ReadonlyArray<number>>;
|
|
8
|
+
/** 等级加成*/ readonly growthValue: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class TurretModAffixLvCfgReader extends TConfig<TurretModAffixLvCfg> {
|
|
11
|
+
protected _name: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TurretModAffixLvCfgReader = void 0;
|
|
4
|
+
const TConfig_1 = require("./TConfig");
|
|
5
|
+
class TurretModAffixLvCfgReader extends TConfig_1.TConfig {
|
|
6
|
+
_name = "TurretModAffixLv";
|
|
7
|
+
}
|
|
8
|
+
exports.TurretModAffixLvCfgReader = TurretModAffixLvCfgReader;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TConfig, IConfig } from "./TConfig";
|
|
2
|
+
export interface TurretModCfg extends IConfig {
|
|
3
|
+
/** 改造件id*/ readonly id: number;
|
|
4
|
+
/** 名称*/ readonly name: string;
|
|
5
|
+
/** 描述*/ readonly desc?: string;
|
|
6
|
+
/** 携带技能*/ readonly skillGroup?: ReadonlyArray<number>;
|
|
7
|
+
/** 关联道具id*/ readonly itemId: number;
|
|
8
|
+
/** 角标炮塔图*/ readonly image?: string;
|
|
9
|
+
/** 关联炮塔id*/ readonly turretId: number;
|
|
10
|
+
/** 图鉴排序*/ readonly sortId: number;
|
|
11
|
+
/** 解锁奖励*/ readonly unlockReward?: ReadonlyArray<ReadonlyArray<number>>;
|
|
12
|
+
/** 主属性id*/ readonly mainAttrId: number;
|
|
13
|
+
/** 主属性品质数值
|
|
14
|
+
[[品质,数值],[品质,数值],[品质,数值]]*/ readonly baseMainAttr: ReadonlyArray<ReadonlyArray<number>>;
|
|
15
|
+
/** 主属性等级加成*/ readonly mainAttrGrowth: number;
|
|
16
|
+
/** 融合等级组*/ readonly fusionGroupId: number;
|
|
17
|
+
}
|
|
18
|
+
export declare class TurretModCfgReader extends TConfig<TurretModCfg> {
|
|
19
|
+
protected _name: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TurretModCfgReader = void 0;
|
|
4
|
+
const TConfig_1 = require("./TConfig");
|
|
5
|
+
class TurretModCfgReader extends TConfig_1.TConfig {
|
|
6
|
+
_name = "TurretMod";
|
|
7
|
+
}
|
|
8
|
+
exports.TurretModCfgReader = TurretModCfgReader;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TConfig, IConfig } from "./TConfig";
|
|
2
|
+
export interface TurretModConfigCfg extends IConfig {
|
|
3
|
+
/** 定义Id*/ readonly id: number;
|
|
4
|
+
/** 唯一定义*/ readonly define?: string;
|
|
5
|
+
/** 名称*/ readonly name?: string;
|
|
6
|
+
/** 参数1*/ readonly value?: number;
|
|
7
|
+
/** 参数2*/ readonly value2?: object;
|
|
8
|
+
}
|
|
9
|
+
export declare const TurretModConfigDefine: {
|
|
10
|
+
/** 养成道具id */ upgrade_item_id: number;
|
|
11
|
+
/** 融合消耗 */ fusion_cost: number;
|
|
12
|
+
/** 继承 */ inherit_cost: number;
|
|
13
|
+
/** 重铸消耗 */ reforge_cost: number;
|
|
14
|
+
/** 分解材料id */ dismantle_item_id: number;
|
|
15
|
+
/** 分解获得 */ dismantle_reward: number;
|
|
16
|
+
/** 副属性品质 */ affix_quality_range: number;
|
|
17
|
+
};
|
|
18
|
+
export declare class TurretModConfigCfgReader extends TConfig<TurretModConfigCfg> {
|
|
19
|
+
protected _name: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TurretModConfigCfgReader = exports.TurretModConfigDefine = void 0;
|
|
4
|
+
const TConfig_1 = require("./TConfig");
|
|
5
|
+
exports.TurretModConfigDefine = {
|
|
6
|
+
/** 养成道具id */ "upgrade_item_id": 101,
|
|
7
|
+
/** 融合消耗 */ "fusion_cost": 102,
|
|
8
|
+
/** 继承 */ "inherit_cost": 103,
|
|
9
|
+
/** 重铸消耗 */ "reforge_cost": 104,
|
|
10
|
+
/** 分解材料id */ "dismantle_item_id": 105,
|
|
11
|
+
/** 分解获得 */ "dismantle_reward": 106,
|
|
12
|
+
/** 副属性品质 */ "affix_quality_range": 107,
|
|
13
|
+
};
|
|
14
|
+
class TurretModConfigCfgReader extends TConfig_1.TConfig {
|
|
15
|
+
_name = "TurretModConfig";
|
|
16
|
+
}
|
|
17
|
+
exports.TurretModConfigCfgReader = TurretModConfigCfgReader;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TConfig, IConfig } from "./TConfig";
|
|
2
|
+
export interface TurretModQualityCfg extends IConfig {
|
|
3
|
+
/** 改造件品质*/ readonly id: number;
|
|
4
|
+
/** 技能等级随机权重
|
|
5
|
+
[[等级下限,等级上限,权重],…]*/ readonly skillLevelWeights: ReadonlyArray<ReadonlyArray<number>>;
|
|
6
|
+
/** 属性等级上限随机权重
|
|
7
|
+
[[等级下限,等级上限,权重],…]*/ readonly affixCapWeights: ReadonlyArray<ReadonlyArray<number>>;
|
|
8
|
+
/** 副属性数量*/ readonly secondaryAffixCount: number;
|
|
9
|
+
}
|
|
10
|
+
export declare class TurretModQualityCfgReader extends TConfig<TurretModQualityCfg> {
|
|
11
|
+
protected _name: string;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TurretModQualityCfgReader = void 0;
|
|
4
|
+
const TConfig_1 = require("./TConfig");
|
|
5
|
+
class TurretModQualityCfgReader extends TConfig_1.TConfig {
|
|
6
|
+
_name = "TurretModQuality";
|
|
7
|
+
}
|
|
8
|
+
exports.TurretModQualityCfgReader = TurretModQualityCfgReader;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TConfig, IConfig } from "./TConfig";
|
|
2
|
+
export interface TurretSkillLvCfg extends IConfig {
|
|
3
|
+
/** 唯一ID*/ readonly id: number;
|
|
4
|
+
/** 技能组*/ readonly skillGroup: number;
|
|
5
|
+
/** 技能等级*/ readonly level?: number;
|
|
6
|
+
/** 技能id*/ readonly skillId: number;
|
|
7
|
+
}
|
|
8
|
+
export declare class TurretSkillLvCfgReader extends TConfig<TurretSkillLvCfg> {
|
|
9
|
+
protected _name: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TurretSkillLvCfgReader = void 0;
|
|
4
|
+
const TConfig_1 = require("./TConfig");
|
|
5
|
+
class TurretSkillLvCfgReader extends TConfig_1.TConfig {
|
|
6
|
+
_name = "TurretSkillLv";
|
|
7
|
+
}
|
|
8
|
+
exports.TurretSkillLvCfgReader = TurretSkillLvCfgReader;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TConfig, IConfig } from "./TConfig";
|
|
2
|
+
export interface VehicleWashAffixCfg extends IConfig {
|
|
3
|
+
/** 配置ID*/ readonly id: number;
|
|
4
|
+
/** 属性类型*/ readonly attrType: number;
|
|
5
|
+
/** 词条展示文本
|
|
6
|
+
如“对首领伤害 +{value}”*/ readonly desc: string;
|
|
7
|
+
/** 权重*/ readonly Weight: number;
|
|
8
|
+
/** 品质*/ readonly quality: number;
|
|
9
|
+
/** 数值下限*/ readonly valueMin: number;
|
|
10
|
+
/** 数值上限*/ readonly valueMax: number;
|
|
11
|
+
}
|
|
12
|
+
export declare class VehicleWashAffixCfgReader extends TConfig<VehicleWashAffixCfg> {
|
|
13
|
+
protected _name: string;
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VehicleWashAffixCfgReader = void 0;
|
|
4
|
+
const TConfig_1 = require("./TConfig");
|
|
5
|
+
class VehicleWashAffixCfgReader extends TConfig_1.TConfig {
|
|
6
|
+
_name = "VehicleWashAffix";
|
|
7
|
+
}
|
|
8
|
+
exports.VehicleWashAffixCfgReader = VehicleWashAffixCfgReader;
|
|
@@ -3,8 +3,12 @@ export interface VehicleWashLevelCfg extends IConfig {
|
|
|
3
3
|
/** 洗练等级*/ readonly id: number;
|
|
4
4
|
/** 升至下一级所需经验
|
|
5
5
|
满级配 0*/ readonly expNeed?: number;
|
|
6
|
-
/**
|
|
7
|
-
|
|
6
|
+
/** 品质抽取权重
|
|
7
|
+
[[品质ID,权重]]*/ readonly qualityWeight: ReadonlyArray<ReadonlyArray<number>>;
|
|
8
|
+
/** PVE技能*/ readonly skillPve?: ReadonlyArray<number>;
|
|
9
|
+
/** PVP技能*/ readonly skillPvp?: ReadonlyArray<number>;
|
|
10
|
+
/** 技能升级消耗*/ readonly skillCost?: ReadonlyArray<number>;
|
|
11
|
+
/** 技能描述*/ readonly desc?: string;
|
|
8
12
|
}
|
|
9
13
|
export declare class VehicleWashLevelCfgReader extends TConfig<VehicleWashLevelCfg> {
|
|
10
14
|
protected _name: string;
|
|
@@ -2,13 +2,16 @@ export interface PoolItem {
|
|
|
2
2
|
unuse(): any;
|
|
3
3
|
reuse(...argArray: any[]): any;
|
|
4
4
|
destroy(): any;
|
|
5
|
-
spawner
|
|
5
|
+
spawner?: PoolSpawner;
|
|
6
6
|
}
|
|
7
7
|
export type PoolDespawnDelegate = (data: PoolItem) => void;
|
|
8
8
|
/**
|
|
9
9
|
* 创建实例数据回调,由外部决定具体创建操作
|
|
10
10
|
*/
|
|
11
11
|
export type PoolCreateDelegate = (id: number | string, spawner: PoolSpawner) => PoolItem;
|
|
12
|
+
/**
|
|
13
|
+
* 对象生成器
|
|
14
|
+
*/
|
|
12
15
|
export declare class PoolSpawner {
|
|
13
16
|
protected _pool: Pool;
|
|
14
17
|
protected _id: number | string;
|
|
@@ -13,17 +13,6 @@ const kCullMaxPerPass = 5;
|
|
|
13
13
|
/**
|
|
14
14
|
* 对象生成器
|
|
15
15
|
*/
|
|
16
|
-
function toArray(obj) {
|
|
17
|
-
let array = [];
|
|
18
|
-
if (obj === null || typeof obj !== 'object') {
|
|
19
|
-
return array;
|
|
20
|
-
}
|
|
21
|
-
for (const key in obj) {
|
|
22
|
-
const value = obj[key];
|
|
23
|
-
array.push(value);
|
|
24
|
-
}
|
|
25
|
-
return array;
|
|
26
|
-
}
|
|
27
16
|
class PoolSpawner {
|
|
28
17
|
_pool;
|
|
29
18
|
_id;
|
|
@@ -55,10 +44,10 @@ class PoolSpawner {
|
|
|
55
44
|
this.cullAbove = cullAbove;
|
|
56
45
|
}
|
|
57
46
|
clearPoolItem(item) {
|
|
58
|
-
|
|
47
|
+
const index = this._spawneds.indexOf(item);
|
|
59
48
|
if (index != -1) {
|
|
60
|
-
|
|
61
|
-
this._clear(item
|
|
49
|
+
this._spawneds.splice(index, 1);
|
|
50
|
+
this._clear(item);
|
|
62
51
|
}
|
|
63
52
|
}
|
|
64
53
|
smoothClear() {
|
|
@@ -76,7 +65,8 @@ class PoolSpawner {
|
|
|
76
65
|
length = kCullMaxPerPass;
|
|
77
66
|
}
|
|
78
67
|
for (let index = length - 1; index >= 0; index--) {
|
|
79
|
-
|
|
68
|
+
// shift 清除闲置最久的对象(FIFO 头部),与 spawn 的取用端一致
|
|
69
|
+
const data = this._spawneds.shift();
|
|
80
70
|
this._clear(data);
|
|
81
71
|
}
|
|
82
72
|
}
|
|
@@ -89,6 +79,8 @@ class PoolSpawner {
|
|
|
89
79
|
this._isPreload = true;
|
|
90
80
|
for (let i = 0; i < this._preloadCount; i++) {
|
|
91
81
|
let data = this.spawnNew();
|
|
82
|
+
if (!data)
|
|
83
|
+
continue;
|
|
92
84
|
if (!this._pool.adapterRecycle) {
|
|
93
85
|
data.unuse();
|
|
94
86
|
}
|
|
@@ -177,7 +169,7 @@ class PoolSpawner {
|
|
|
177
169
|
}
|
|
178
170
|
spawnNew() {
|
|
179
171
|
if (this._pool == null) {
|
|
180
|
-
console.warn(
|
|
172
|
+
console.warn("PoolSpawner.spawnNew pool has destroyed!!!", this._id);
|
|
181
173
|
return null;
|
|
182
174
|
}
|
|
183
175
|
let data;
|
|
@@ -219,10 +211,11 @@ class Pool {
|
|
|
219
211
|
* 通过PoolManager调用
|
|
220
212
|
*/
|
|
221
213
|
_clear() {
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
214
|
+
// Object.keys 快照后再逐个 delete,避免遍历中修改键集
|
|
215
|
+
const keys = Object.keys(this._spawners);
|
|
216
|
+
for (let i = 0, len = keys.length; i < len; i++) {
|
|
217
|
+
const spawner = this._spawners[keys[i]];
|
|
218
|
+
delete this._spawners[keys[i]];
|
|
226
219
|
spawner.destroy();
|
|
227
220
|
}
|
|
228
221
|
if (this._cullWatcher) {
|
|
@@ -239,7 +232,7 @@ class Pool {
|
|
|
239
232
|
const spawner = this._spawners[key];
|
|
240
233
|
spawner.destroy();
|
|
241
234
|
}
|
|
242
|
-
this._spawners =
|
|
235
|
+
this._spawners = {};
|
|
243
236
|
if (this._cullWatcher) {
|
|
244
237
|
this._cullWatcher.cancel();
|
|
245
238
|
this._cullWatcher = null;
|
|
@@ -279,6 +272,10 @@ class Pool {
|
|
|
279
272
|
data.spawner.smoothClear();
|
|
280
273
|
}
|
|
281
274
|
}
|
|
275
|
+
else {
|
|
276
|
+
// 无 spawner 的对象既无法回池也不销毁,只会在外层泄漏,必须暴露出来
|
|
277
|
+
console.warn("Pool.despawn item has no spawner:", this.poolType, data);
|
|
278
|
+
}
|
|
282
279
|
}
|
|
283
280
|
_cullWatcher = null;
|
|
284
281
|
smoothClear() {
|
|
@@ -306,6 +303,7 @@ class Pool {
|
|
|
306
303
|
let spawner = this._spawners[id];
|
|
307
304
|
if (spawner == null) {
|
|
308
305
|
console.error(this.poolType, "can't find spawner id:", id);
|
|
306
|
+
return null;
|
|
309
307
|
}
|
|
310
308
|
return spawner.spawnInstance(...argArray);
|
|
311
309
|
}
|
|
@@ -76,9 +76,8 @@ class _Time {
|
|
|
76
76
|
this._time += dt;
|
|
77
77
|
this._gameTime += dt;
|
|
78
78
|
this.updateScale(dt);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}
|
|
79
|
+
// send 内部已判空,无需再走一次 isExist 查表
|
|
80
|
+
Notifier_1.Notifier.send(NotifyID_1.NotifyID.Game_Update, dt);
|
|
82
81
|
let times = 0;
|
|
83
82
|
// eslint-disable-next-line no-constant-condition
|
|
84
83
|
while (true) {
|
|
@@ -106,6 +105,12 @@ class _Time {
|
|
|
106
105
|
_scaleTimeout = 0;
|
|
107
106
|
_scaleSmooth = true;
|
|
108
107
|
setScale(scale, dura, smooth = true) {
|
|
108
|
+
if (dura <= 0) {
|
|
109
|
+
// 无过渡直接生效,避免 updateScale 除零产生 NaN
|
|
110
|
+
cc_1.director.getScheduler().setTimeScale(scale);
|
|
111
|
+
Notifier_1.Notifier.send(NotifyID_1.NotifyID.Time_Scale, scale);
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
109
114
|
this._scaling = true;
|
|
110
115
|
this._scale = scale;
|
|
111
116
|
this._scaleDura = dura;
|
|
@@ -168,6 +173,11 @@ class _Time {
|
|
|
168
173
|
Log_1.Log.error("Time.delay delay:" + delay);
|
|
169
174
|
return null;
|
|
170
175
|
}
|
|
176
|
+
if (delay === 0 && times < 0) {
|
|
177
|
+
// 0 间隔无限重复(times<0 会被 Watcher 归一为 -1)会单帧连打回调直到触发 2000 次防护,直接拒绝
|
|
178
|
+
Log_1.Log.error("Time.delay infinite repeat requires delay > 0, got:" + delay);
|
|
179
|
+
return null;
|
|
180
|
+
}
|
|
171
181
|
let watcher = this._pool.pop();
|
|
172
182
|
let id = ++this._index;
|
|
173
183
|
watcher.setIndex(id);
|
|
@@ -4,10 +4,8 @@ export declare class MinSortList<T> {
|
|
|
4
4
|
get element(): T[];
|
|
5
5
|
private _compareEv;
|
|
6
6
|
constructor(compareEv: CompareDelegate);
|
|
7
|
-
private _count;
|
|
8
7
|
get count(): number;
|
|
9
8
|
clear(action?: (t: T) => void, target?: any): void;
|
|
10
|
-
frist(predicate: (t: T) => boolean, target?: any): T;
|
|
11
9
|
forEach(action: (t: T) => void, target: any): void;
|
|
12
10
|
add(t: T): void;
|
|
13
11
|
del(t: T): T;
|
|
@@ -14,33 +14,14 @@ class MinSortList {
|
|
|
14
14
|
this._compareEv = compareEv;
|
|
15
15
|
this._element = new Array();
|
|
16
16
|
}
|
|
17
|
-
_count = 0;
|
|
18
17
|
get count() {
|
|
19
|
-
return this.
|
|
18
|
+
return this._element.length;
|
|
20
19
|
}
|
|
21
20
|
clear(action = null, target = null) {
|
|
22
|
-
this._count = 0;
|
|
23
21
|
if (action != null) {
|
|
24
|
-
this.
|
|
25
|
-
action.call(target, element);
|
|
26
|
-
});
|
|
22
|
+
this.forEach(action, target);
|
|
27
23
|
}
|
|
28
|
-
this._element.
|
|
29
|
-
}
|
|
30
|
-
frist(predicate, target = null) {
|
|
31
|
-
if (predicate == null) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
if (this._element == null) {
|
|
35
|
-
return null;
|
|
36
|
-
}
|
|
37
|
-
for (let index = 0; index < this._element.length; index++) {
|
|
38
|
-
const element = this._element[index];
|
|
39
|
-
if (predicate.call(target, element)) {
|
|
40
|
-
return element;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return null;
|
|
24
|
+
this._element.length = 0;
|
|
44
25
|
}
|
|
45
26
|
forEach(action, target) {
|
|
46
27
|
if (this._element == null) {
|
|
@@ -52,31 +33,26 @@ class MinSortList {
|
|
|
52
33
|
}
|
|
53
34
|
add(t) {
|
|
54
35
|
this._element.push(t);
|
|
55
|
-
this.sortDown(this.
|
|
56
|
-
++this._count;
|
|
36
|
+
this.sortDown(this._element.length - 1, t);
|
|
57
37
|
}
|
|
58
38
|
del(t) {
|
|
59
39
|
let index = this._element.indexOf(t);
|
|
60
40
|
if (index < 0) {
|
|
61
41
|
return null;
|
|
62
42
|
}
|
|
63
|
-
|
|
64
|
-
let element = this._element.splice(index, 1);
|
|
65
|
-
return element[0];
|
|
43
|
+
return this._element.splice(index, 1)[0];
|
|
66
44
|
}
|
|
67
45
|
peek() {
|
|
68
|
-
if (this.
|
|
46
|
+
if (this._element.length <= 0) {
|
|
69
47
|
return null;
|
|
70
48
|
}
|
|
71
49
|
return this._element[0];
|
|
72
50
|
}
|
|
73
51
|
pop() {
|
|
74
|
-
if (this.
|
|
52
|
+
if (this._element.length <= 0) {
|
|
75
53
|
return null;
|
|
76
54
|
}
|
|
77
|
-
|
|
78
|
-
let t = this._element.shift();
|
|
79
|
-
return t;
|
|
55
|
+
return this._element.shift();
|
|
80
56
|
}
|
|
81
57
|
/// <summary>
|
|
82
58
|
/// 重新排序
|
|
@@ -121,7 +97,7 @@ class MinSortList {
|
|
|
121
97
|
}
|
|
122
98
|
sortUp(index, t) {
|
|
123
99
|
let element;
|
|
124
|
-
for (let i = index + 1; i < this.
|
|
100
|
+
for (let i = index + 1; i < this._element.length; i++) {
|
|
125
101
|
element = this._element[i];
|
|
126
102
|
if (this._compareEv(element, t) >= 0) {
|
|
127
103
|
break;
|
|
@@ -15,7 +15,8 @@ class ObjectPool {
|
|
|
15
15
|
pop() {
|
|
16
16
|
let t;
|
|
17
17
|
if (this._queue.length > 0) {
|
|
18
|
-
|
|
18
|
+
// LIFO:从尾部取用 O(1),且复用最近回收的热对象(battle 模块高频进出池)
|
|
19
|
+
t = this._queue.pop();
|
|
19
20
|
}
|
|
20
21
|
else {
|
|
21
22
|
t = this._ctor();
|
|
@@ -35,8 +36,10 @@ class ObjectPool {
|
|
|
35
36
|
return this._queue.length;
|
|
36
37
|
}
|
|
37
38
|
clear(num) {
|
|
38
|
-
if (num) {
|
|
39
|
-
|
|
39
|
+
if (num != null) {
|
|
40
|
+
// 钳制到 [0, length]:负数会反向扩大队列产生 undefined 洞,0 表示不清
|
|
41
|
+
const n = Math.min(Math.max(num, 0), this._queue.length);
|
|
42
|
+
this._queue.length -= n;
|
|
40
43
|
return;
|
|
41
44
|
}
|
|
42
45
|
this._queue.length = 0;
|
|
@@ -12,7 +12,7 @@ export declare const PriorHighest = 200;
|
|
|
12
12
|
* @ListenEventListener(ListenID.Cheat_ColliderDraw)
|
|
13
13
|
* cheatDrawCollider() { }
|
|
14
14
|
*/
|
|
15
|
-
export declare function ListenEventListener(listenId: number): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
15
|
+
export declare function ListenEventListener(listenId: number, prior?: number): (target: any, propertyKey: string, descriptor: PropertyDescriptor) => void;
|
|
16
16
|
/**
|
|
17
17
|
* 统一注册/释放所有 @ListenEventListener 装饰的方法
|
|
18
18
|
* @param instance 持有方法的实例(即 this)
|
|
@@ -23,14 +23,15 @@ const listenEventBindings = new WeakMap();
|
|
|
23
23
|
* @ListenEventListener(ListenID.Cheat_ColliderDraw)
|
|
24
24
|
* cheatDrawCollider() { }
|
|
25
25
|
*/
|
|
26
|
-
function ListenEventListener(listenId) {
|
|
26
|
+
function ListenEventListener(listenId, prior) {
|
|
27
27
|
return function (target, propertyKey, descriptor) {
|
|
28
28
|
let list = listenEventBindings.get(target);
|
|
29
29
|
if (!list) {
|
|
30
30
|
list = [];
|
|
31
31
|
listenEventBindings.set(target, list);
|
|
32
32
|
}
|
|
33
|
-
|
|
33
|
+
prior ||= exports.PriorMiddle;
|
|
34
|
+
list.push({ listenId, methodName: propertyKey, prior });
|
|
34
35
|
};
|
|
35
36
|
}
|
|
36
37
|
/** 沿原型链收集实例上所有已装饰的绑定(支持继承,基类绑定对子类同样生效) */
|
|
@@ -53,10 +54,10 @@ function collectListenEventBindings(instance) {
|
|
|
53
54
|
*/
|
|
54
55
|
function bindListenEvents(instance, enable) {
|
|
55
56
|
const list = collectListenEventBindings(instance);
|
|
56
|
-
for (const { listenId, methodName } of list) {
|
|
57
|
+
for (const { listenId, methodName, prior } of list) {
|
|
57
58
|
// 通过 this[methodName] 取同一份原型方法引用,注册/释放传一致引用才能被正确匹配
|
|
58
59
|
const callback = instance[methodName];
|
|
59
|
-
Notifier.changeListener(enable, listenId, callback, instance);
|
|
60
|
+
Notifier.changeListener(enable, listenId, callback, instance, prior);
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
/** 以类原型为 key,记录每个 @CallEventListener 声明的 Notifier Call 注册绑定 */
|
|
@@ -15,4 +15,5 @@ var NotifyID;
|
|
|
15
15
|
NotifyID[NotifyID["View_Close"] = 10] = "View_Close";
|
|
16
16
|
NotifyID[NotifyID["ViewQueue_Stop"] = 11] = "ViewQueue_Stop";
|
|
17
17
|
NotifyID[NotifyID["Tips_Close"] = 12] = "Tips_Close";
|
|
18
|
+
NotifyID[NotifyID["View_Visible"] = 13] = "View_Visible";
|
|
18
19
|
})(NotifyID || (exports.NotifyID = NotifyID = {}));
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.NotifyListener = void 0;
|
|
4
|
-
const
|
|
4
|
+
const cc_1 = require("cc");
|
|
5
5
|
const ListenID_1 = require("../../ListenID");
|
|
6
|
+
const Log_1 = require("../Log");
|
|
6
7
|
const NotifyID_1 = require("./NotifyID");
|
|
7
|
-
const cc_1 = require("cc");
|
|
8
8
|
const kMaxStackDepth = 15; //调用深度 防止死循环
|
|
9
9
|
const kWarningStackDepth = 10;
|
|
10
10
|
class ListenerHandler {
|
|
@@ -90,11 +90,32 @@ class ListenerManager {
|
|
|
90
90
|
this._handlers.splice(index, 1);
|
|
91
91
|
return true;
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
93
|
+
/** 派发用复用快照:迭代快照而非原数组,派发中增删监听不会导致数组错位(重复/遗漏调用) */
|
|
94
|
+
_scratch = [];
|
|
95
|
+
/**
|
|
96
|
+
* 广播的「传数组」形态:argArray 就是要喂给 handler 的实参表本身。
|
|
97
|
+
* 派发前把 handler 引用快照到 _scratch(水位法,嵌套派发互不干扰,热路径零分配),
|
|
98
|
+
* 语义与 Node.js EventEmitter 对齐:本轮派发中移除的 handler 仍会收到本次事件,
|
|
99
|
+
* 派发中新注册的 handler 不会收到本次事件。
|
|
100
|
+
*/
|
|
101
|
+
Send(argArray) {
|
|
102
|
+
let handlers = this._handlers;
|
|
103
|
+
let len = handlers.length;
|
|
104
|
+
if (len === 0)
|
|
105
|
+
return;
|
|
106
|
+
let scratch = this._scratch;
|
|
107
|
+
let start = scratch.length; // 水位:嵌套派发只读写水位之上的区间
|
|
108
|
+
for (let i = 0; i < len; i++) {
|
|
109
|
+
scratch.push(handlers[i]);
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
for (let i = scratch.length - 1; i >= start; i--) {
|
|
113
|
+
const handler = scratch[i];
|
|
114
|
+
handler.callback.apply(handler.context, argArray);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
finally {
|
|
118
|
+
scratch.length = start; // handler 抛异常也要回收水位
|
|
98
119
|
}
|
|
99
120
|
}
|
|
100
121
|
}
|
|
@@ -176,8 +197,13 @@ class NotifyListener {
|
|
|
176
197
|
if (!this.CheckAndPushCallStack(notifyid)) {
|
|
177
198
|
return;
|
|
178
199
|
}
|
|
179
|
-
|
|
180
|
-
|
|
200
|
+
// try/finally 保证 handler 抛异常时调用栈也能弹出,否则 _callStacks 泄漏导致整个通知系统瘫痪
|
|
201
|
+
try {
|
|
202
|
+
manager.Send(argArray); // 直接传数组,避免展开成 rest 再复制一次
|
|
203
|
+
}
|
|
204
|
+
finally {
|
|
205
|
+
this.PopCallStack();
|
|
206
|
+
}
|
|
181
207
|
}
|
|
182
208
|
/**
|
|
183
209
|
* 是否存在该消息id事件
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
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
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
9
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const TurnBattleModule_1 = __importDefault(require("../battle/turn/TurnBattleModule"));
|
|
13
|
+
const BattleUtils_1 = require("../battle/util/BattleUtils");
|
|
14
|
+
let ArenaBattleModule = class ArenaBattleModule extends TurnBattleModule_1.default {
|
|
15
|
+
getMode() {
|
|
16
|
+
return 5;
|
|
17
|
+
}
|
|
18
|
+
onUpdate(dt) {
|
|
19
|
+
}
|
|
20
|
+
gameWin() {
|
|
21
|
+
super.gameWin();
|
|
22
|
+
console.log('胜利');
|
|
23
|
+
}
|
|
24
|
+
gameFail() {
|
|
25
|
+
super.gameFail();
|
|
26
|
+
console.log('失败');
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
ArenaBattleModule = __decorate([
|
|
30
|
+
(0, BattleUtils_1.cacheFunction)("ArenaBattleModule")
|
|
31
|
+
], ArenaBattleModule);
|
|
32
|
+
exports.default = ArenaBattleModule;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "./ArenaBattleModule";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// 本文件由 scripts/gen-registry.mjs 自动生成,请勿手动编辑。
|
|
3
|
+
// 改了目录里的文件后跑 `npm run gen` 重新生成(prestart / prebuild 会自动跑)。
|
|
4
|
+
//
|
|
5
|
+
// 作用:@cacheFunction -> bufferCache
|
|
6
|
+
//
|
|
7
|
+
// 这些类靠装饰器往注册表里登记自己,而装饰器只在模块被求值时执行。
|
|
8
|
+
// Cocos 的资源系统会把 assets 下所有脚本加载一遍,所以引擎里天然成立;
|
|
9
|
+
// Node 只执行从入口 import 可达的模块,不引这一下,注册表就是空的。
|
|
10
|
+
//
|
|
11
|
+
// 共 1 个模块。下面的 import 只为副作用,不需要用到导出。
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
require("./ArenaBattleModule");
|