captainbattle 1.0.6 → 1.0.8
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 +220 -13
- package/dist/register-all.d.ts +2 -0
- package/dist/register-all.js +2 -0
- package/package.json +1 -1
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
import { BVec2Like } from "../util/BVec2";
|
|
2
|
-
import FighterData from "./FighterData";
|
|
2
|
+
import FighterData, { IFighterValueSnapshot } from "./FighterData";
|
|
3
|
+
/** RoleData 权威值快照 */
|
|
4
|
+
export interface IRoleValueSnapshot extends IFighterValueSnapshot {
|
|
5
|
+
partnersId: number[];
|
|
6
|
+
equipList: number[];
|
|
7
|
+
weaponFashionId: number;
|
|
8
|
+
weaponType: number;
|
|
9
|
+
vehicleId: number;
|
|
10
|
+
}
|
|
3
11
|
export default class RoleData extends FighterData {
|
|
4
12
|
partnersId: number[];
|
|
5
13
|
equipList: number[];
|
|
6
14
|
weaponFashionId: number;
|
|
7
15
|
weaponType: number;
|
|
16
|
+
vehicleId: number;
|
|
17
|
+
getValueSnapshot(out?: IRoleValueSnapshot): IRoleValueSnapshot;
|
|
18
|
+
resetFromSnapshot(snapshot: IRoleValueSnapshot): void;
|
|
8
19
|
getPartner(): FighterData[];
|
|
9
20
|
/** 身体顶端(世界坐标),out 省略时新建 */
|
|
10
21
|
getBodyTop(out?: BVec2Like): BVec2Like;
|
|
@@ -10,12 +10,31 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
const BattleUtils_1 = require("../util/BattleUtils");
|
|
13
|
+
const BaseEntityData_1 = require("./BaseEntityData");
|
|
13
14
|
const FighterData_1 = __importDefault(require("./FighterData"));
|
|
14
15
|
let RoleData = class RoleData extends FighterData_1.default {
|
|
15
16
|
partnersId = [];
|
|
16
17
|
equipList = [];
|
|
17
18
|
weaponFashionId = 0;
|
|
18
19
|
weaponType = 0;
|
|
20
|
+
vehicleId = 0;
|
|
21
|
+
getValueSnapshot(out) {
|
|
22
|
+
const snapshot = super.getValueSnapshot(out);
|
|
23
|
+
snapshot.partnersId = (0, BaseEntityData_1.copySnapshotValue)(this.partnersId, snapshot.partnersId);
|
|
24
|
+
snapshot.equipList = (0, BaseEntityData_1.copySnapshotValue)(this.equipList, snapshot.equipList);
|
|
25
|
+
snapshot.weaponFashionId = this.weaponFashionId;
|
|
26
|
+
snapshot.weaponType = this.weaponType;
|
|
27
|
+
snapshot.vehicleId = this.vehicleId;
|
|
28
|
+
return snapshot;
|
|
29
|
+
}
|
|
30
|
+
resetFromSnapshot(snapshot) {
|
|
31
|
+
super.resetFromSnapshot(snapshot);
|
|
32
|
+
this.partnersId = (0, BaseEntityData_1.copySnapshotValue)(snapshot.partnersId, this.partnersId);
|
|
33
|
+
this.equipList = (0, BaseEntityData_1.copySnapshotValue)(snapshot.equipList, this.equipList);
|
|
34
|
+
this.weaponFashionId = snapshot.weaponFashionId;
|
|
35
|
+
this.weaponType = snapshot.weaponType;
|
|
36
|
+
this.vehicleId = snapshot.vehicleId;
|
|
37
|
+
}
|
|
19
38
|
getPartner() {
|
|
20
39
|
const list = [];
|
|
21
40
|
const fighters = this.game.gameContext.fighters;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { CampType } from "../battle.interface";
|
|
2
|
+
import type FighterData from "./FighterData";
|
|
3
|
+
/** 单位在一回合内的行动状态 */
|
|
4
|
+
export declare enum TurnUnitState {
|
|
5
|
+
WAITING = 0,// 本回合待行动
|
|
6
|
+
ACTING = 1,// 本回合已开始行动(行动开始结算已执行)
|
|
7
|
+
DONE = 2,// 本回合行动结束
|
|
8
|
+
DEAD = 3
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 单位回合状态包装。
|
|
12
|
+
* 只持有 FighterData 引用和回合状态,不复制属性/技能/弹匣字段。
|
|
13
|
+
*/
|
|
14
|
+
export declare class TurnUnit {
|
|
15
|
+
readonly fighter: FighterData;
|
|
16
|
+
state: TurnUnitState;
|
|
17
|
+
/** 本次行动开始时仍在装填、本回合不可用的技能 id;startTurn/resetTurn 时清空 */
|
|
18
|
+
readonly blockedSkillIds: Set<number>;
|
|
19
|
+
constructor(fighter: FighterData);
|
|
20
|
+
get id(): number;
|
|
21
|
+
get camp(): CampType;
|
|
22
|
+
get alive(): boolean;
|
|
23
|
+
/** 本回合是否已经行动完(死亡视为行动结束) */
|
|
24
|
+
get hasActed(): boolean;
|
|
25
|
+
/** 本回合“行动开始时结算”是否已执行,用于避免重复扣 CD */
|
|
26
|
+
get turnStarted(): boolean;
|
|
27
|
+
/** 回合开始:回到 WAITING */
|
|
28
|
+
resetTurn(): void;
|
|
29
|
+
/** 行动开始:WAITING → ACTING */
|
|
30
|
+
startTurn(): void;
|
|
31
|
+
/** 标记目标 */
|
|
32
|
+
markTarget(): void;
|
|
33
|
+
/** 行动结束:ACTING → DONE */
|
|
34
|
+
finishTurn(): void;
|
|
35
|
+
markDead(): void;
|
|
36
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TurnUnit = exports.TurnUnitState = void 0;
|
|
4
|
+
const EntityEvent_1 = require("../event/EntityEvent");
|
|
5
|
+
const FighterStateShared_1 = require("../fsm-state/FighterStateShared");
|
|
6
|
+
/** 单位在一回合内的行动状态 */
|
|
7
|
+
var TurnUnitState;
|
|
8
|
+
(function (TurnUnitState) {
|
|
9
|
+
TurnUnitState[TurnUnitState["WAITING"] = 0] = "WAITING";
|
|
10
|
+
TurnUnitState[TurnUnitState["ACTING"] = 1] = "ACTING";
|
|
11
|
+
TurnUnitState[TurnUnitState["DONE"] = 2] = "DONE";
|
|
12
|
+
TurnUnitState[TurnUnitState["DEAD"] = 3] = "DEAD";
|
|
13
|
+
})(TurnUnitState || (exports.TurnUnitState = TurnUnitState = {}));
|
|
14
|
+
/**
|
|
15
|
+
* 单位回合状态包装。
|
|
16
|
+
* 只持有 FighterData 引用和回合状态,不复制属性/技能/弹匣字段。
|
|
17
|
+
*/
|
|
18
|
+
class TurnUnit {
|
|
19
|
+
fighter;
|
|
20
|
+
state = TurnUnitState.WAITING;
|
|
21
|
+
/** 本次行动开始时仍在装填、本回合不可用的技能 id;startTurn/resetTurn 时清空 */
|
|
22
|
+
blockedSkillIds = new Set();
|
|
23
|
+
constructor(fighter) {
|
|
24
|
+
this.fighter = fighter;
|
|
25
|
+
}
|
|
26
|
+
get id() {
|
|
27
|
+
return this.fighter.ID;
|
|
28
|
+
}
|
|
29
|
+
get camp() {
|
|
30
|
+
return this.fighter.campType;
|
|
31
|
+
}
|
|
32
|
+
get alive() {
|
|
33
|
+
return this.state !== TurnUnitState.DEAD && !this.fighter.isDead && this.fighter.curHp > 0;
|
|
34
|
+
}
|
|
35
|
+
/** 本回合是否已经行动完(死亡视为行动结束) */
|
|
36
|
+
get hasActed() {
|
|
37
|
+
return this.state === TurnUnitState.DONE || this.state === TurnUnitState.DEAD;
|
|
38
|
+
}
|
|
39
|
+
/** 本回合“行动开始时结算”是否已执行,用于避免重复扣 CD */
|
|
40
|
+
get turnStarted() {
|
|
41
|
+
return this.state === TurnUnitState.ACTING || this.state === TurnUnitState.DONE;
|
|
42
|
+
}
|
|
43
|
+
/** 回合开始:回到 WAITING */
|
|
44
|
+
resetTurn() {
|
|
45
|
+
if (this.state === TurnUnitState.DEAD)
|
|
46
|
+
return;
|
|
47
|
+
this.state = TurnUnitState.WAITING;
|
|
48
|
+
}
|
|
49
|
+
/** 行动开始:WAITING → ACTING */
|
|
50
|
+
startTurn() {
|
|
51
|
+
if (this.state === TurnUnitState.DEAD)
|
|
52
|
+
return;
|
|
53
|
+
this.state = TurnUnitState.ACTING;
|
|
54
|
+
this.fighter.game.emit(this.fighter, EntityEvent_1.EntityEvent.TrunFighterActionStart);
|
|
55
|
+
this.markTarget();
|
|
56
|
+
}
|
|
57
|
+
/** 标记目标 */
|
|
58
|
+
markTarget() {
|
|
59
|
+
if ((0, FighterStateShared_1.needFightTarget)(this.fighter)) {
|
|
60
|
+
(0, FighterStateShared_1.findTarget)(this.fighter);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** 行动结束:ACTING → DONE */
|
|
64
|
+
finishTurn() {
|
|
65
|
+
if (this.state === TurnUnitState.DEAD)
|
|
66
|
+
return;
|
|
67
|
+
this.fighter.game.emit(this.fighter, EntityEvent_1.EntityEvent.TrunFighterActionEnd);
|
|
68
|
+
this.state = TurnUnitState.DONE;
|
|
69
|
+
}
|
|
70
|
+
markDead() {
|
|
71
|
+
this.state = TurnUnitState.DEAD;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.TurnUnit = TurnUnit;
|
|
@@ -14,7 +14,7 @@ require("./BaseEntityData");
|
|
|
14
14
|
require("./DragonBodyData");
|
|
15
15
|
require("./DragonData");
|
|
16
16
|
require("./EntityPool");
|
|
17
|
-
require("./EntityPoolSpawner");
|
|
18
17
|
require("./FighterData");
|
|
19
18
|
require("./ProjectileData");
|
|
20
19
|
require("./RoleData");
|
|
20
|
+
require("./TurnUnit");
|
|
@@ -65,6 +65,9 @@ export declare const EntityEvent: {
|
|
|
65
65
|
ProjectileSubImpactAll: number;
|
|
66
66
|
CallProjectileSubImpactAll: number;
|
|
67
67
|
AttackEnd: number;
|
|
68
|
+
ProjectileMergeFinish: number;
|
|
69
|
+
AfterBeMiss: number;
|
|
70
|
+
AfterMiss: number;
|
|
68
71
|
BuffTrigger: number;
|
|
69
72
|
BeHit: number;
|
|
70
73
|
SkillHurtCalStart: number;
|
|
@@ -77,4 +80,14 @@ export declare const EntityEvent: {
|
|
|
77
80
|
ProjectilePriorityTarget: number;
|
|
78
81
|
BuffExit: number;
|
|
79
82
|
ShieldReduce: number;
|
|
83
|
+
TurnStart: number;
|
|
84
|
+
TurnEnd: number;
|
|
85
|
+
TurnActionStart: number;
|
|
86
|
+
TurnActionEnd: number;
|
|
87
|
+
TrunFighterActionStart: number;
|
|
88
|
+
TrunFighterActionEnd: number;
|
|
89
|
+
TurnActionStartPer: number;
|
|
90
|
+
TurnActionEndPer: number;
|
|
91
|
+
TrunFighterActionStartPer: number;
|
|
92
|
+
TrunFighterActionEndPer: number;
|
|
80
93
|
};
|
|
@@ -68,6 +68,9 @@ exports.EntityEvent = {
|
|
|
68
68
|
ProjectileSubImpactAll: 64, //子弹子impact全部触发时
|
|
69
69
|
CallProjectileSubImpactAll: 65, //召唤单位释放的子弹子impact全部触发时
|
|
70
70
|
AttackEnd: 66, //攻击结束时
|
|
71
|
+
ProjectileMergeFinish: 67, //子弹融合完成时
|
|
72
|
+
AfterBeMiss: 68, //攻击被闪避后
|
|
73
|
+
AfterMiss: 69, //闪避后
|
|
71
74
|
BuffTrigger: 100, //buff触发时
|
|
72
75
|
BeHit: 101, //受到伤害后
|
|
73
76
|
SkillHurtCalStart: 102, //攻击伤害计算开始
|
|
@@ -81,4 +84,15 @@ exports.EntityEvent = {
|
|
|
81
84
|
BuffExit: 110, //buff退出时
|
|
82
85
|
//恢复
|
|
83
86
|
ShieldReduce: 200, //护盾减少时
|
|
87
|
+
//回合制
|
|
88
|
+
TurnStart: 1000, //整体回合开始时
|
|
89
|
+
TurnEnd: 1001, //整体回合结束时
|
|
90
|
+
TurnActionStart: 1002, //阵营行动开始
|
|
91
|
+
TurnActionEnd: 1003, //阵营行动结束
|
|
92
|
+
TrunFighterActionStart: 1004, //单位行动开始
|
|
93
|
+
TrunFighterActionEnd: 1005, //单位行动结束
|
|
94
|
+
TurnActionStartPer: 1006, //阵营行动开始时,每N个回合触发
|
|
95
|
+
TurnActionEndPer: 1007, //阵营行动结束时,每N个回合触发
|
|
96
|
+
TrunFighterActionStartPer: 1008, //单位行动开始时,每N个回合触发
|
|
97
|
+
TrunFighterActionEndPer: 1009, //单位行动结束时,每N个回合触发
|
|
84
98
|
};
|
|
@@ -13,6 +13,8 @@ export default class EntityEventBus {
|
|
|
13
13
|
off(entityId: number, eventId: number, eventCall: Function, eventObj: Object): void;
|
|
14
14
|
addCall(entityId: number, eventId: number, eventCall: Function, eventObj: Object): void;
|
|
15
15
|
removeCall(entityId: number, eventId: number, eventCall: Function, eventObj: Object): void;
|
|
16
|
+
/** 移除该实体上指定 context 注册的全部监听/取值(快照恢复时清理过期触发器用) */
|
|
17
|
+
targetOff(entityId: number, context: Object): void;
|
|
16
18
|
/** 取值:与 emit 保持一致,把 entity 作为第一个实参传给取值回调 */
|
|
17
19
|
call(entity: BaseEntityData, eventId: number, ...argArray: any[]): any;
|
|
18
20
|
/** 取值的「传数组」形态:argArray = [entity, ...业务实参] */
|
|
@@ -23,5 +25,13 @@ export default class EntityEventBus {
|
|
|
23
25
|
* 末尾的 eventId 由这里补上——实体监听通道的契约是 entity 在前、eventId 在末尾。
|
|
24
26
|
*/
|
|
25
27
|
emitArgs(entity: BaseEntityData, eventId: number, argArray: any[]): void;
|
|
28
|
+
/**
|
|
29
|
+
* 固定参数广播 emit0-3:与 emit 语义一致(含调用栈深度保护、快照派发、eventId 尾参契约),
|
|
30
|
+
* 但全程离散变量下传——热路径零 rest 分配、零数组读写、固定 arity 调用。
|
|
31
|
+
*/
|
|
32
|
+
emit0(entity: BaseEntityData, eventId: number): void;
|
|
33
|
+
emit1(entity: BaseEntityData, eventId: number, a: any): void;
|
|
34
|
+
emit2(entity: BaseEntityData, eventId: number, a: any, b: any): void;
|
|
35
|
+
emit3(entity: BaseEntityData, eventId: number, a: any, b: any, c: any): void;
|
|
26
36
|
destroy(): void;
|
|
27
37
|
}
|
|
@@ -36,6 +36,13 @@ class EntityEventBus {
|
|
|
36
36
|
eventList.removeCall(eventId, eventCall, eventObj);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
+
/** 移除该实体上指定 context 注册的全部监听/取值(快照恢复时清理过期触发器用) */
|
|
40
|
+
targetOff(entityId, context) {
|
|
41
|
+
let eventList = this.entityEventList.get(entityId);
|
|
42
|
+
if (eventList) {
|
|
43
|
+
eventList.targetOff(context);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
39
46
|
/** 取值:与 emit 保持一致,把 entity 作为第一个实参传给取值回调 */
|
|
40
47
|
call(entity, eventId, ...argArray) {
|
|
41
48
|
argArray.unshift(entity);
|
|
@@ -65,6 +72,34 @@ class EntityEventBus {
|
|
|
65
72
|
argArray.pop();
|
|
66
73
|
}
|
|
67
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* 固定参数广播 emit0-3:与 emit 语义一致(含调用栈深度保护、快照派发、eventId 尾参契约),
|
|
77
|
+
* 但全程离散变量下传——热路径零 rest 分配、零数组读写、固定 arity 调用。
|
|
78
|
+
*/
|
|
79
|
+
emit0(entity, eventId) {
|
|
80
|
+
let eventList = this.entityEventList.get(entity.ID);
|
|
81
|
+
if (eventList) {
|
|
82
|
+
eventList.emitEntity0(entity, eventId);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
emit1(entity, eventId, a) {
|
|
86
|
+
let eventList = this.entityEventList.get(entity.ID);
|
|
87
|
+
if (eventList) {
|
|
88
|
+
eventList.emitEntity1(entity, eventId, a);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
emit2(entity, eventId, a, b) {
|
|
92
|
+
let eventList = this.entityEventList.get(entity.ID);
|
|
93
|
+
if (eventList) {
|
|
94
|
+
eventList.emitEntity2(entity, eventId, a, b);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
emit3(entity, eventId, a, b, c) {
|
|
98
|
+
let eventList = this.entityEventList.get(entity.ID);
|
|
99
|
+
if (eventList) {
|
|
100
|
+
eventList.emitEntity3(entity, eventId, a, b, c);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
68
103
|
destroy() {
|
|
69
104
|
this.entityEventList.clear();
|
|
70
105
|
this.entityEventList = null;
|
|
@@ -26,9 +26,14 @@ export declare class EventListener {
|
|
|
26
26
|
* @param context target上下文
|
|
27
27
|
*/
|
|
28
28
|
off(notifyid: string | number, callback: Function, context: any): void;
|
|
29
|
-
emit(notifyid: string | number,
|
|
29
|
+
emit(notifyid: string | number, argArray: any[]): void;
|
|
30
30
|
/** 广播的「传数组」形态,argArray 见 ListenerManager.emitArgs */
|
|
31
31
|
emitArgs(notifyid: string | number, argArray: any[]): void;
|
|
32
|
+
/** 固定参数广播 emit0-3:语义同上(调用栈深度保护 + 快照派发),eventId 追加在监听方实参末尾 */
|
|
33
|
+
emitEntity0(entity: any, eventId: number): void;
|
|
34
|
+
emitEntity1(entity: any, eventId: number, a: any): void;
|
|
35
|
+
emitEntity2(entity: any, eventId: number, a: any, b: any): void;
|
|
36
|
+
emitEntity3(entity: any, eventId: number, a: any, b: any, c: any): void;
|
|
32
37
|
/**
|
|
33
38
|
* 注册取值回调(参考 NotifyCaller.Register)
|
|
34
39
|
* @param notifyid 消息id
|
|
@@ -106,15 +106,111 @@ class ListenerManager {
|
|
|
106
106
|
emit(...argArray) {
|
|
107
107
|
this.emitArgs(argArray);
|
|
108
108
|
}
|
|
109
|
+
/** 派发用复用快照:迭代快照而非原数组,派发中增删监听不会导致数组错位(重复/遗漏调用) */
|
|
110
|
+
_scratch = [];
|
|
109
111
|
/**
|
|
110
|
-
* 广播的「传数组」形态:argArray 就是要喂给 handler
|
|
111
|
-
*
|
|
112
|
+
* 广播的「传数组」形态:argArray 就是要喂给 handler 的实参表本身。
|
|
113
|
+
* 派发前把 handler 引用快照到 _scratch(水位法,嵌套派发互不干扰,热路径零分配),
|
|
114
|
+
* 语义与 Node.js EventEmitter 对齐:本轮派发中移除的 handler 仍会收到本次事件,
|
|
115
|
+
* 派发中新注册的 handler 不会收到本次事件。
|
|
112
116
|
*/
|
|
113
117
|
emitArgs(argArray) {
|
|
114
|
-
let
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
+
let handlers = this._handlers;
|
|
119
|
+
let len = handlers.length;
|
|
120
|
+
if (len === 0)
|
|
121
|
+
return;
|
|
122
|
+
let scratch = this._scratch;
|
|
123
|
+
let start = scratch.length; // 水位:嵌套派发只读写水位之上的区间
|
|
124
|
+
for (let i = 0; i < len; i++) {
|
|
125
|
+
scratch.push(handlers[i]);
|
|
126
|
+
}
|
|
127
|
+
try {
|
|
128
|
+
for (let i = scratch.length - 1; i >= start; i--) {
|
|
129
|
+
const handler = scratch[i];
|
|
130
|
+
handler.callback.apply(handler.context, argArray);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
finally {
|
|
134
|
+
scratch.length = start; // handler 抛异常也要回收水位
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* 固定参数广播 emit0-3:与 emitArgs 语义逐字一致
|
|
139
|
+
*/
|
|
140
|
+
emit0(entity, a) {
|
|
141
|
+
let handlers = this._handlers;
|
|
142
|
+
let len = handlers.length;
|
|
143
|
+
if (len === 0)
|
|
144
|
+
return;
|
|
145
|
+
let scratch = this._scratch;
|
|
146
|
+
let start = scratch.length;
|
|
147
|
+
for (let i = 0; i < len; i++)
|
|
148
|
+
scratch.push(handlers[i]);
|
|
149
|
+
try {
|
|
150
|
+
for (let i = scratch.length - 1; i >= start; i--) {
|
|
151
|
+
const h = scratch[i];
|
|
152
|
+
h.callback.call(h.context, entity, a);
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
finally {
|
|
156
|
+
scratch.length = start;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
emit1(entity, a, b) {
|
|
160
|
+
let handlers = this._handlers;
|
|
161
|
+
let len = handlers.length;
|
|
162
|
+
if (len === 0)
|
|
163
|
+
return;
|
|
164
|
+
let scratch = this._scratch;
|
|
165
|
+
let start = scratch.length;
|
|
166
|
+
for (let i = 0; i < len; i++)
|
|
167
|
+
scratch.push(handlers[i]);
|
|
168
|
+
try {
|
|
169
|
+
for (let i = scratch.length - 1; i >= start; i--) {
|
|
170
|
+
const h = scratch[i];
|
|
171
|
+
h.callback.call(h.context, entity, a, b);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
finally {
|
|
175
|
+
scratch.length = start;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
emit2(entity, a, b, c) {
|
|
179
|
+
let handlers = this._handlers;
|
|
180
|
+
let len = handlers.length;
|
|
181
|
+
if (len === 0)
|
|
182
|
+
return;
|
|
183
|
+
let scratch = this._scratch;
|
|
184
|
+
let start = scratch.length;
|
|
185
|
+
for (let i = 0; i < len; i++)
|
|
186
|
+
scratch.push(handlers[i]);
|
|
187
|
+
try {
|
|
188
|
+
for (let i = scratch.length - 1; i >= start; i--) {
|
|
189
|
+
const h = scratch[i];
|
|
190
|
+
h.callback.call(h.context, entity, a, b, c);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
finally {
|
|
194
|
+
scratch.length = start;
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
emit3(entity, a, b, c, d) {
|
|
198
|
+
let handlers = this._handlers;
|
|
199
|
+
let len = handlers.length;
|
|
200
|
+
if (len === 0)
|
|
201
|
+
return;
|
|
202
|
+
let scratch = this._scratch;
|
|
203
|
+
let start = scratch.length;
|
|
204
|
+
for (let i = 0; i < len; i++)
|
|
205
|
+
scratch.push(handlers[i]);
|
|
206
|
+
try {
|
|
207
|
+
for (let i = scratch.length - 1; i >= start; i--) {
|
|
208
|
+
const h = scratch[i];
|
|
209
|
+
h.callback.call(h.context, entity, a, b, c, d);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
finally {
|
|
213
|
+
scratch.length = start;
|
|
118
214
|
}
|
|
119
215
|
}
|
|
120
216
|
IsExistCallHandler(callback, context) {
|
|
@@ -269,7 +365,7 @@ class EventListener {
|
|
|
269
365
|
}
|
|
270
366
|
}
|
|
271
367
|
}
|
|
272
|
-
emit(notifyid,
|
|
368
|
+
emit(notifyid, argArray) {
|
|
273
369
|
this.emitArgs(notifyid, argArray);
|
|
274
370
|
}
|
|
275
371
|
/** 广播的「传数组」形态,argArray 见 ListenerManager.emitArgs */
|
|
@@ -285,6 +381,43 @@ class EventListener {
|
|
|
285
381
|
manager.emitArgs(argArray);
|
|
286
382
|
this.PopCallStack();
|
|
287
383
|
}
|
|
384
|
+
/** 固定参数广播 emit0-3:语义同上(调用栈深度保护 + 快照派发),eventId 追加在监听方实参末尾 */
|
|
385
|
+
emitEntity0(entity, eventId) {
|
|
386
|
+
let manager = this._managers[eventId];
|
|
387
|
+
if (manager == null)
|
|
388
|
+
return;
|
|
389
|
+
if (!this.CheckAndPushCallStack(eventId))
|
|
390
|
+
return;
|
|
391
|
+
manager.emit0(entity, eventId);
|
|
392
|
+
this.PopCallStack();
|
|
393
|
+
}
|
|
394
|
+
emitEntity1(entity, eventId, a) {
|
|
395
|
+
let manager = this._managers[eventId];
|
|
396
|
+
if (manager == null)
|
|
397
|
+
return;
|
|
398
|
+
if (!this.CheckAndPushCallStack(eventId))
|
|
399
|
+
return;
|
|
400
|
+
manager.emit1(entity, a, eventId);
|
|
401
|
+
this.PopCallStack();
|
|
402
|
+
}
|
|
403
|
+
emitEntity2(entity, eventId, a, b) {
|
|
404
|
+
let manager = this._managers[eventId];
|
|
405
|
+
if (manager == null)
|
|
406
|
+
return;
|
|
407
|
+
if (!this.CheckAndPushCallStack(eventId))
|
|
408
|
+
return;
|
|
409
|
+
manager.emit2(entity, a, b, eventId);
|
|
410
|
+
this.PopCallStack();
|
|
411
|
+
}
|
|
412
|
+
emitEntity3(entity, eventId, a, b, c) {
|
|
413
|
+
let manager = this._managers[eventId];
|
|
414
|
+
if (manager == null)
|
|
415
|
+
return;
|
|
416
|
+
if (!this.CheckAndPushCallStack(eventId))
|
|
417
|
+
return;
|
|
418
|
+
manager.emit3(entity, a, b, c, eventId);
|
|
419
|
+
this.PopCallStack();
|
|
420
|
+
}
|
|
288
421
|
/**
|
|
289
422
|
* 注册取值回调(参考 NotifyCaller.Register)
|
|
290
423
|
* @param notifyid 消息id
|
|
@@ -26,9 +26,14 @@ export declare const GameEvent: {
|
|
|
26
26
|
ProjectileToDead: string;
|
|
27
27
|
ProjectileHit: string;
|
|
28
28
|
ProjectileRealHit: string;
|
|
29
|
+
RecycleProjectile: string;
|
|
29
30
|
FsmChangeState: string;
|
|
30
31
|
BuffClearByType: string;
|
|
31
32
|
BuffAddBuff: string;
|
|
33
|
+
/** 快照恢复后重挂该实体全部 buff 触发器(参数:fighter) */
|
|
34
|
+
BuffRestoreTriggers: string;
|
|
35
|
+
/** 更新 buff(参数:dt) */
|
|
36
|
+
StepBuff: string;
|
|
32
37
|
SkillInitSkillData: string;
|
|
33
38
|
SkillInitSkillById: string;
|
|
34
39
|
SkillInitSkill: string;
|
|
@@ -40,5 +45,8 @@ export declare const GameEvent: {
|
|
|
40
45
|
SkillClearSkillData: string;
|
|
41
46
|
SkillCheckSkillReady: string;
|
|
42
47
|
SkillCanLearnSkillImmediate: string;
|
|
48
|
+
/** 更新技能冷却(参数:dt) */
|
|
49
|
+
StepSkill: string;
|
|
43
50
|
AddEnemy: string;
|
|
51
|
+
TurnGameStart: string;
|
|
44
52
|
};
|
|
@@ -30,11 +30,16 @@ exports.GameEvent = {
|
|
|
30
30
|
ProjectileToDead: "ProjectileToDead",
|
|
31
31
|
ProjectileHit: "ProjectileHit",
|
|
32
32
|
ProjectileRealHit: "ProjectileRealHit",
|
|
33
|
+
RecycleProjectile: "RecycleProjectile",
|
|
33
34
|
// FsmSystem
|
|
34
35
|
FsmChangeState: "FsmChangeState",
|
|
35
36
|
// BuffSystem
|
|
36
37
|
BuffClearByType: "BuffClearByType",
|
|
37
38
|
BuffAddBuff: "BuffAddBuff",
|
|
39
|
+
/** 快照恢复后重挂该实体全部 buff 触发器(参数:fighter) */
|
|
40
|
+
BuffRestoreTriggers: "BuffRestoreTriggers",
|
|
41
|
+
/** 更新 buff(参数:dt) */
|
|
42
|
+
StepBuff: "StepBuff",
|
|
38
43
|
// SkillSystem
|
|
39
44
|
SkillInitSkillData: "SkillInitSkillData",
|
|
40
45
|
SkillInitSkillById: "SkillInitSkillById",
|
|
@@ -47,6 +52,10 @@ exports.GameEvent = {
|
|
|
47
52
|
SkillClearSkillData: "SkillClearSkillData",
|
|
48
53
|
SkillCheckSkillReady: "SkillCheckSkillReady",
|
|
49
54
|
SkillCanLearnSkillImmediate: "SkillCanLearnSkillImmediate",
|
|
55
|
+
/** 更新技能冷却(参数:dt) */
|
|
56
|
+
StepSkill: "StepSkill",
|
|
50
57
|
// BornSystem
|
|
51
58
|
AddEnemy: "AddEnemy",
|
|
59
|
+
// TurnBattleSystem
|
|
60
|
+
TurnGameStart: "TurnGameStart",
|
|
52
61
|
};
|
|
@@ -17,13 +17,13 @@ const FighterStateType_1 = require("../fsm-state/FighterStateType");
|
|
|
17
17
|
class FighterFactory {
|
|
18
18
|
/** 产出一个战斗单位 */
|
|
19
19
|
static create(game, data, ismy) {
|
|
20
|
-
let rolecfg = ismy ? Cfg_1.Cfg.Role.get(data.id) : Cfg_1.Cfg.Enemy.get(data.id);
|
|
21
|
-
let fighter = this.spawnFighter(data, rolecfg, ismy);
|
|
20
|
+
let rolecfg = (ismy || game.isPVP) ? Cfg_1.Cfg.Role.get(data.id) : Cfg_1.Cfg.Enemy.get(data.id);
|
|
21
|
+
let fighter = this.spawnFighter(data, rolecfg, ismy, game);
|
|
22
22
|
this.initFighter(game, fighter, data, ismy, rolecfg);
|
|
23
23
|
return fighter;
|
|
24
24
|
}
|
|
25
25
|
/** 按 SubEntityType 从对象池取出对应子类,并定下初始 fsmType。 */
|
|
26
|
-
static spawnFighter(data, rolecfg, ismy) {
|
|
26
|
+
static spawnFighter(data, rolecfg, ismy, game) {
|
|
27
27
|
let fighter = null;
|
|
28
28
|
if (rolecfg.type === battle_interface_1.SubEntityType.DRAGON) {
|
|
29
29
|
fighter = EntityPool_1.EntityPool.spawn("DragonData");
|
|
@@ -37,7 +37,7 @@ class FighterFactory {
|
|
|
37
37
|
fighter = EntityPool_1.EntityPool.spawn("FighterData");
|
|
38
38
|
fighter.fsmType = 2 /* FighterStateProfile.Boat */;
|
|
39
39
|
}
|
|
40
|
-
else if (rolecfg.type === battle_interface_1.SubEntityType.ROLE && ismy) {
|
|
40
|
+
else if (rolecfg.type === battle_interface_1.SubEntityType.ROLE && (ismy || game.isPVP)) {
|
|
41
41
|
fighter = EntityPool_1.EntityPool.spawn("RoleData");
|
|
42
42
|
fighter.fsmType = 1 /* FighterStateProfile.Role */;
|
|
43
43
|
let role = fighter;
|
|
@@ -46,8 +46,9 @@ class FighterFactory {
|
|
|
46
46
|
role.weaponFashionId = data.weaponFashionId || 0;
|
|
47
47
|
let equipCfg = Cfg_1.Cfg.Equip.get(role.equipList[0]);
|
|
48
48
|
role.weaponType = equipCfg.type;
|
|
49
|
+
role.vehicleId = data.vehicleId || 0;
|
|
49
50
|
}
|
|
50
|
-
else if (ismy && rolecfg.type === battle_interface_1.SubEntityType.PET) {
|
|
51
|
+
else if (ismy && (rolecfg.type === battle_interface_1.SubEntityType.TOWER || rolecfg.type === battle_interface_1.SubEntityType.PET)) {
|
|
51
52
|
fighter = EntityPool_1.EntityPool.spawn("FighterData");
|
|
52
53
|
fighter.fsmType = 1 /* FighterStateProfile.Role */;
|
|
53
54
|
}
|
|
@@ -55,6 +56,9 @@ class FighterFactory {
|
|
|
55
56
|
fighter = EntityPool_1.EntityPool.spawn("FighterData");
|
|
56
57
|
fighter.fsmType = 0 /* FighterStateProfile.Fighter */;
|
|
57
58
|
}
|
|
59
|
+
if (game.gameModule.moduleState.isTurn) {
|
|
60
|
+
fighter.fsmType = 7 /* FighterStateProfile.Turn */;
|
|
61
|
+
}
|
|
58
62
|
fighter.fsmType = (0, FighterStateProfiles_1.resolveFighterStateProfile)(rolecfg.id, fighter.fsmType);
|
|
59
63
|
return fighter;
|
|
60
64
|
}
|
|
@@ -112,6 +116,8 @@ class FighterFactory {
|
|
|
112
116
|
delete fighter.buffList[key];
|
|
113
117
|
}
|
|
114
118
|
}
|
|
119
|
+
fighter.comboSkillId = data.comboSkillId || 0;
|
|
120
|
+
fighter.counterSkillId = data.counterSkillId || 0;
|
|
115
121
|
game.emit(GameEvent_1.GameEvent.SkillInitSkill, fighter, data.skills, data.waitCallSkills);
|
|
116
122
|
if (!ismy && rolecfg.type == battle_interface_1.SubEntityType.DRAGON) {
|
|
117
123
|
let dragon = fighter;
|
|
@@ -128,18 +134,28 @@ class FighterFactory {
|
|
|
128
134
|
}
|
|
129
135
|
//出生信息
|
|
130
136
|
if (ismy) {
|
|
131
|
-
if (rolecfg.type === battle_interface_1.SubEntityType.ROLE || rolecfg.type === battle_interface_1.SubEntityType.
|
|
132
|
-
let bronids = game.gameContext.
|
|
137
|
+
if (rolecfg.type === battle_interface_1.SubEntityType.ROLE || rolecfg.type === battle_interface_1.SubEntityType.TOWER) {
|
|
138
|
+
let bronids = game.gameContext.curBornRole[data.playerId];
|
|
139
|
+
if (!bronids) {
|
|
140
|
+
bronids = [rolecfg.id];
|
|
141
|
+
game.gameContext.curBornRole[data.playerId] = bronids;
|
|
142
|
+
}
|
|
143
|
+
else {
|
|
144
|
+
bronids.push(rolecfg.id);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else if (rolecfg.type === battle_interface_1.SubEntityType.PET) {
|
|
148
|
+
let bronids = game.gameContext.curBornPet[data.playerId];
|
|
133
149
|
if (!bronids) {
|
|
134
150
|
bronids = [rolecfg.id];
|
|
135
|
-
game.gameContext.
|
|
151
|
+
game.gameContext.curBornPet[data.playerId] = bronids;
|
|
136
152
|
}
|
|
137
153
|
else {
|
|
138
154
|
bronids.push(rolecfg.id);
|
|
139
155
|
}
|
|
140
156
|
}
|
|
141
157
|
}
|
|
142
|
-
if (ismy && (fighter.cfg.type === battle_interface_1.SubEntityType.
|
|
158
|
+
if (ismy && (fighter.cfg.type === battle_interface_1.SubEntityType.TOWER || fighter.cfg.type === battle_interface_1.SubEntityType.ROLE)) {
|
|
143
159
|
game.gameContext.myFightData[fighter.ID] = { oid: fighter.oid, ID: fighter.ID, fightId: fighter.cfg.id, hurtBoss: 0, hurtNormal: 0, level: 0, star: 0, maxQuality: 2, isself: 1, stage: 1, attackSkillId: fighter.normalSkillIds[0] || 0 };
|
|
144
160
|
if (game.selfPlayerId === fighter.playerId) {
|
|
145
161
|
let rolelevel = game.getRoleLevelByRoleId(fighter.cfg.id);
|
|
@@ -202,7 +218,7 @@ class FighterFactory {
|
|
|
202
218
|
fighter.sprintSpeed = 0;
|
|
203
219
|
fighter.checkEnemyTime = 0.5;
|
|
204
220
|
fighter.curState = FighterStateType_1.StateType.NONE;
|
|
205
|
-
const [type, width, height] = fighter.cfg.Collision || [0, 40, 40];
|
|
221
|
+
const [type, width, height] = data.collision || fighter.cfg.Collision || [0, 40, 40];
|
|
206
222
|
const centerPoint = fighter.cfg.centerPoint || [0, 0];
|
|
207
223
|
if (type === 0) {
|
|
208
224
|
fighter.shape = null;
|