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
|
@@ -56,25 +56,33 @@ class PreAttackToAttack extends FighterStateTransition_1.BaseFighterStateTransit
|
|
|
56
56
|
static toState = FighterStateType_1.StateType.ATTACK;
|
|
57
57
|
static priority = 40;
|
|
58
58
|
static onCheck(entity) {
|
|
59
|
+
let isOk = true;
|
|
59
60
|
const skillData = entity.skillDatas[entity.curSkillId];
|
|
60
61
|
if (entity.actionTime > 0 && skillData.needReleaseCd)
|
|
61
|
-
|
|
62
|
-
if (
|
|
63
|
-
|
|
62
|
+
isOk = false;
|
|
63
|
+
if (isOk && entity.attackTarget <= 0)
|
|
64
|
+
isOk = false;
|
|
65
|
+
if (isOk && (entity.isInBuffByTypes(BattleConfig_1.NoInAttackBuff) || entity.attackTarget <= 0))
|
|
66
|
+
isOk = false;
|
|
64
67
|
if (entity.subType === battle_interface_1.SubEntityType.DRAGON) {
|
|
65
68
|
const dragon = entity;
|
|
66
|
-
if (dragon.curDis - dragon.targetDis > 10)
|
|
67
|
-
|
|
69
|
+
if (isOk && (dragon.curDis - dragon.targetDis > 10))
|
|
70
|
+
isOk = false;
|
|
68
71
|
}
|
|
69
72
|
const attackTarget = entity.game.getEntityLogic(entity.attackTarget);
|
|
70
|
-
if (
|
|
71
|
-
|
|
72
|
-
if (
|
|
73
|
-
|
|
74
|
-
if (!entity.
|
|
73
|
+
if (isOk && !attackTarget)
|
|
74
|
+
isOk = false;
|
|
75
|
+
if (isOk && (attackTarget.isDead || attackTarget.NoSelect(entity.normalSkillIds[0])))
|
|
76
|
+
isOk = false;
|
|
77
|
+
if (isOk && (!entity.game.gameModule.moduleState.autoFight && entity.campType !== battle_interface_1.CampType.ENEMY))
|
|
78
|
+
isOk = false;
|
|
79
|
+
if (isOk && (!entity.isTouchAtkDir && !entity.cfg.gunRotation)) {
|
|
75
80
|
entity.horDir = entity.x < attackTarget.x ? -1 : 1;
|
|
76
81
|
}
|
|
77
|
-
|
|
82
|
+
if (!isOk && entity.curDoubleShootNum > 0) {
|
|
83
|
+
entity.curDoubleShootNum = 0;
|
|
84
|
+
}
|
|
85
|
+
return isOk;
|
|
78
86
|
}
|
|
79
87
|
}
|
|
80
88
|
exports.PreAttackToAttack = PreAttackToAttack;
|
|
@@ -105,7 +113,11 @@ class AttackToPreAttack extends FighterStateTransition_1.BaseFighterStateTransit
|
|
|
105
113
|
static toState = FighterStateType_1.StateType.PREATTACK;
|
|
106
114
|
static priority = 40;
|
|
107
115
|
static onCheck(entity) {
|
|
108
|
-
|
|
116
|
+
const isok = entity.actionTime <= 0 && IdleToPreAttack.onCheck(entity);
|
|
117
|
+
// if (!isok && entity.curDoubleShootNum > 0) {
|
|
118
|
+
// entity.curDoubleShootNum = 0;
|
|
119
|
+
// }
|
|
120
|
+
return isok;
|
|
109
121
|
}
|
|
110
122
|
}
|
|
111
123
|
exports.AttackToPreAttack = AttackToPreAttack;
|
|
@@ -30,7 +30,7 @@ class BornState extends FighterStateShared_1.BaseFighterState {
|
|
|
30
30
|
static isReEnter = false;
|
|
31
31
|
static onEnter(entity) {
|
|
32
32
|
entity.actionTime = (0, FighterStateShared_1.playAction)(entity, "appear", false);
|
|
33
|
-
if (entity.cfg.type === battle_interface_1.SubEntityType.
|
|
33
|
+
if (entity.cfg.type === battle_interface_1.SubEntityType.TOWER && entity.campType === battle_interface_1.CampType.MY) {
|
|
34
34
|
entity.actionTime += 2;
|
|
35
35
|
}
|
|
36
36
|
entity.NoSelected = true;
|
|
@@ -58,7 +58,7 @@ class IdleState extends FighterStateShared_1.BaseFighterState {
|
|
|
58
58
|
static profile = FighterStateProfiles_1.AnyFighterStateProfile;
|
|
59
59
|
static onEnter(entity) {
|
|
60
60
|
let name = (0, FighterStateShared_1.getActionNameByType)(entity.curState, entity.actionType);
|
|
61
|
-
if (entity.campType === battle_interface_1.CampType.MY && entity.cfg.type === battle_interface_1.SubEntityType.ROLE) {
|
|
61
|
+
if ((entity.campType === battle_interface_1.CampType.MY || entity.game.isPVP) && entity.cfg.type === battle_interface_1.SubEntityType.ROLE) {
|
|
62
62
|
name = "idle_" + entity.weaponType;
|
|
63
63
|
}
|
|
64
64
|
(0, FighterStateShared_1.playAction)(entity, name, true);
|
|
@@ -212,7 +212,12 @@ class AttackState extends FighterStateShared_1.BaseFighterState {
|
|
|
212
212
|
entity.game.emit(entity, EntityEvent_1.EntityEvent.NormalAtkHitCrit, entity.curSkillId);
|
|
213
213
|
}
|
|
214
214
|
entity.curDoubleShootNum--;
|
|
215
|
-
|
|
215
|
+
let forceNum = 1;
|
|
216
|
+
if (entity.curDoubleShootNum > 0 && skillData.skillNum <= 1) {
|
|
217
|
+
forceNum = 0;
|
|
218
|
+
}
|
|
219
|
+
let forceCd = entity.curDoubleShootNum > 0 ? skillCd : 0;
|
|
220
|
+
entity.game.emit(GameEvent_1.GameEvent.SkillResetSkillCd, entity, entity.curSkillId, forceCd, forceNum);
|
|
216
221
|
if (!anim || !anim.events || anim.events.length <= 0) {
|
|
217
222
|
entity.game.call(GameEvent_1.GameEvent.UseSkillResult, entity, entity.curSkillId);
|
|
218
223
|
entity.normalAtkTimes++;
|
|
@@ -252,7 +257,6 @@ class AttackState extends FighterStateShared_1.BaseFighterState {
|
|
|
252
257
|
}
|
|
253
258
|
static onExit(entity) {
|
|
254
259
|
entity.timeScale = entity.game.gameModule.moduleState.timeScale;
|
|
255
|
-
entity.curDoubleShootNum = 0;
|
|
256
260
|
entity.game.emit(entity, EntityEvent_1.EntityEvent.AttackEnd, entity.curSkillId);
|
|
257
261
|
}
|
|
258
262
|
}
|
|
@@ -507,7 +511,7 @@ class PreAttackState extends FighterStateShared_1.BaseFighterState {
|
|
|
507
511
|
if (!targetEntity)
|
|
508
512
|
return;
|
|
509
513
|
entity.getShootOriginPoition(FighterStateShared_1.tempVec2, entity.skillDatas[entity.curSkillId].cfg.attackName ? entity.skillDatas[entity.curSkillId].cfg.attackName[0] : null);
|
|
510
|
-
if (targetEntity.subType === battle_interface_1.SubEntityType.ROLE && targetEntity.campType === battle_interface_1.CampType.MY) {
|
|
514
|
+
if (targetEntity.subType === battle_interface_1.SubEntityType.ROLE && targetEntity.campType === battle_interface_1.CampType.MY && entity.game.rolePosType === 0) {
|
|
511
515
|
FighterStateShared_1.tempVec22.x = FighterStateShared_1.tempVec2.x;
|
|
512
516
|
FighterStateShared_1.tempVec22.y = targetEntity.y;
|
|
513
517
|
// EntityManager.getPursuePosition(targetEntity, entity, tempVec22);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import FighterData from "../entity/FighterData";
|
|
1
|
+
import type FighterData from "../entity/FighterData";
|
|
2
2
|
import { FighterStateProfile } from "./FighterStateProfiles";
|
|
3
3
|
import { BaseFighterState } from "./FighterStateShared";
|
|
4
4
|
import { StateType } from "./FighterStateType";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import FighterData from "../entity/FighterData";
|
|
1
|
+
import type FighterData from "../entity/FighterData";
|
|
2
2
|
import { FighterStateProfile } from "./FighterStateProfiles";
|
|
3
3
|
import { BaseFighterState } from "./FighterStateShared";
|
|
4
4
|
import { StateType } from "./FighterStateType";
|
|
@@ -4,4 +4,6 @@ export declare class FighterStateMachine {
|
|
|
4
4
|
static update(entity: FighterData, dt: number): void;
|
|
5
5
|
static change(entity: FighterData, state: StateType): void;
|
|
6
6
|
static checkTransition(entity: FighterData): void;
|
|
7
|
+
/** 忽略凭证限制,由调用方手动触发一次转移检测 */
|
|
8
|
+
static checkTransitionManual(entity: FighterData): void;
|
|
7
9
|
}
|
|
@@ -46,5 +46,11 @@ class FighterStateMachine {
|
|
|
46
46
|
if (transition)
|
|
47
47
|
FighterStateMachine.change(entity, transition.toState);
|
|
48
48
|
}
|
|
49
|
+
/** 忽略凭证限制,由调用方手动触发一次转移检测 */
|
|
50
|
+
static checkTransitionManual(entity) {
|
|
51
|
+
const transition = (0, FighterStateRegistry_1.findFighterStateTransitionManually)(entity);
|
|
52
|
+
if (transition)
|
|
53
|
+
FighterStateMachine.change(entity, transition.toState);
|
|
54
|
+
}
|
|
49
55
|
}
|
|
50
56
|
exports.FighterStateMachine = FighterStateMachine;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { StateType } from "./FighterStateType";
|
|
1
2
|
/** 状态档案。一个档案描述一类实体可以使用哪些状态。 */
|
|
2
3
|
export declare const enum FighterStateProfile {
|
|
3
4
|
Fighter = 0,
|
|
@@ -6,7 +7,9 @@ export declare const enum FighterStateProfile {
|
|
|
6
7
|
Dragon = 3,
|
|
7
8
|
DragonBody = 4,
|
|
8
9
|
Boss18110Call = 5,
|
|
9
|
-
Boss18110 = 6
|
|
10
|
+
Boss18110 = 6,
|
|
11
|
+
/** 回合制:由回合调度器手动驱动状态转移 */
|
|
12
|
+
Turn = 7
|
|
10
13
|
}
|
|
11
14
|
export declare const AnyFighterStateProfile = -1;
|
|
12
15
|
/**
|
|
@@ -15,4 +18,8 @@ export declare const AnyFighterStateProfile = -1;
|
|
|
15
18
|
*/
|
|
16
19
|
export declare function registerFighterStateProfile(configId: number, profile: number): void;
|
|
17
20
|
export declare function resolveFighterStateProfile(configId: number, defaultProfile: number): number;
|
|
21
|
+
/** 注册凭证(fsmType)下进入该状态必须由调用方手动检测转移 */
|
|
22
|
+
export declare function registerFighterProfileManualStates(profile: number, states: readonly StateType[]): void;
|
|
23
|
+
/** 当前凭证(fsmType)下,进入该状态是否必须手动检测 */
|
|
24
|
+
export declare function isFighterStateEntryManual(profile: number, state: StateType): boolean;
|
|
18
25
|
export declare function getFighterStateMask(profile: number): number;
|
|
@@ -3,10 +3,14 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AnyFighterStateProfile = void 0;
|
|
4
4
|
exports.registerFighterStateProfile = registerFighterStateProfile;
|
|
5
5
|
exports.resolveFighterStateProfile = resolveFighterStateProfile;
|
|
6
|
+
exports.registerFighterProfileManualStates = registerFighterProfileManualStates;
|
|
7
|
+
exports.isFighterStateEntryManual = isFighterStateEntryManual;
|
|
6
8
|
exports.getFighterStateMask = getFighterStateMask;
|
|
7
9
|
const FighterStateType_1 = require("./FighterStateType");
|
|
8
10
|
exports.AnyFighterStateProfile = -1;
|
|
9
11
|
const profileByConfigId = Object.create(null);
|
|
12
|
+
/** 凭证标识(fsmType)-> 只能手动进入的目标状态掩码(state 表示转移的 toState) */
|
|
13
|
+
const profileManualEntryStates = Object.create(null);
|
|
10
14
|
/**
|
|
11
15
|
* 为单个配置实体覆盖默认状态档案。
|
|
12
16
|
* 注册发生在实体创建前,避免在 FsmSystem 的高频循环中读取配置 ID。
|
|
@@ -28,6 +32,15 @@ function makeStateMask(states) {
|
|
|
28
32
|
}
|
|
29
33
|
return mask;
|
|
30
34
|
}
|
|
35
|
+
/** 注册凭证(fsmType)下进入该状态必须由调用方手动检测转移 */
|
|
36
|
+
function registerFighterProfileManualStates(profile, states) {
|
|
37
|
+
profileManualEntryStates[profile] = makeStateMask(states);
|
|
38
|
+
}
|
|
39
|
+
/** 当前凭证(fsmType)下,进入该状态是否必须手动检测 */
|
|
40
|
+
function isFighterStateEntryManual(profile, state) {
|
|
41
|
+
const mask = profileManualEntryStates[profile];
|
|
42
|
+
return mask !== undefined && (mask & (1 << state)) !== 0;
|
|
43
|
+
}
|
|
31
44
|
//通用状态
|
|
32
45
|
const normalFighterStates = makeStateMask([
|
|
33
46
|
FighterStateType_1.StateType.BORN,
|
|
@@ -83,11 +96,27 @@ const boss18110Status = makeStateMask([
|
|
|
83
96
|
FighterStateType_1.StateType.OUT,
|
|
84
97
|
FighterStateType_1.StateType.PREATTACK,
|
|
85
98
|
]);
|
|
99
|
+
//回合制状态:能力与通用单位一致,攻击/移动的自动转移由回合调度器手动驱动
|
|
100
|
+
const turnStates = makeStateMask([
|
|
101
|
+
FighterStateType_1.StateType.BORN,
|
|
102
|
+
FighterStateType_1.StateType.IDLE,
|
|
103
|
+
FighterStateType_1.StateType.ATTACK,
|
|
104
|
+
FighterStateType_1.StateType.DEAD,
|
|
105
|
+
FighterStateType_1.StateType.WAIT,
|
|
106
|
+
FighterStateType_1.StateType.PREATTACK,
|
|
107
|
+
// 攻击结束后的收招状态
|
|
108
|
+
FighterStateType_1.StateType.BACK,
|
|
109
|
+
]);
|
|
86
110
|
registerFighterStateProfile(18110, 6 /* FighterStateProfile.Boss18110 */);
|
|
87
111
|
registerFighterStateProfile(18112, 5 /* FighterStateProfile.Boss18110Call */);
|
|
88
112
|
registerFighterStateProfile(18113, 5 /* FighterStateProfile.Boss18110Call */);
|
|
89
113
|
registerFighterStateProfile(18114, 5 /* FighterStateProfile.Boss18110Call */);
|
|
90
114
|
registerFighterStateProfile(18115, 5 /* FighterStateProfile.Boss18110Call */);
|
|
115
|
+
// 回合制:只有“进入前摇”必须由 TurnSchedulerSystem 手动触发;前摇→攻击、收招、回 IDLE 均自动
|
|
116
|
+
registerFighterProfileManualStates(7 /* FighterStateProfile.Turn */, [
|
|
117
|
+
FighterStateType_1.StateType.PREATTACK,
|
|
118
|
+
FighterStateType_1.StateType.IDLE,
|
|
119
|
+
]);
|
|
91
120
|
function getFighterStateMask(profile) {
|
|
92
121
|
switch (profile) {
|
|
93
122
|
case 5 /* FighterStateProfile.Boss18110Call */:
|
|
@@ -102,6 +131,8 @@ function getFighterStateMask(profile) {
|
|
|
102
131
|
return dragonStates;
|
|
103
132
|
case 4 /* FighterStateProfile.DragonBody */:
|
|
104
133
|
return dragonBodyStates;
|
|
134
|
+
case 7 /* FighterStateProfile.Turn */:
|
|
135
|
+
return turnStates;
|
|
105
136
|
default:
|
|
106
137
|
// A custom monster profile inherits the normal fighter state set.
|
|
107
138
|
return normalFighterStates;
|
|
@@ -22,4 +22,7 @@ export declare function registerFighterStateNode<T extends FighterStateNode>(nod
|
|
|
22
22
|
export declare function requireFighterStateNode(entity: FighterData, state: StateType): FighterStateNode | null;
|
|
23
23
|
export declare function registerFighterStateTransition<T extends FighterStateTransition>(transition: T): T;
|
|
24
24
|
export declare function isFighterStateEnabled(entity: FighterData, state: StateType): boolean;
|
|
25
|
+
/** 自动检测转移:跳过"只能手动进入"的目标状态 */
|
|
25
26
|
export declare function findFighterStateTransition(entity: FighterData): FighterStateTransition | null;
|
|
27
|
+
/** 忽略"只能手动进入"的限制,由调用方手动检测转移 */
|
|
28
|
+
export declare function findFighterStateTransitionManually(entity: FighterData): FighterStateTransition | null;
|
|
@@ -6,6 +6,7 @@ exports.requireFighterStateNode = requireFighterStateNode;
|
|
|
6
6
|
exports.registerFighterStateTransition = registerFighterStateTransition;
|
|
7
7
|
exports.isFighterStateEnabled = isFighterStateEnabled;
|
|
8
8
|
exports.findFighterStateTransition = findFighterStateTransition;
|
|
9
|
+
exports.findFighterStateTransitionManually = findFighterStateTransitionManually;
|
|
9
10
|
const FighterStateProfiles_1 = require("./FighterStateProfiles");
|
|
10
11
|
const FighterStateType_1 = require("./FighterStateType");
|
|
11
12
|
exports.AnyFighterState = -1;
|
|
@@ -49,23 +50,41 @@ function isFighterStateEnabled(entity, state) {
|
|
|
49
50
|
return true;
|
|
50
51
|
return ((0, FighterStateProfiles_1.getFighterStateMask)(entity.fsmType) & (1 << state)) !== 0;
|
|
51
52
|
}
|
|
53
|
+
/** 自动检测转移:跳过"只能手动进入"的目标状态 */
|
|
52
54
|
function findFighterStateTransition(entity) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return
|
|
55
|
+
return findFighterStateTransitionInternal(entity, true);
|
|
56
|
+
}
|
|
57
|
+
/** 忽略"只能手动进入"的限制,由调用方手动检测转移 */
|
|
58
|
+
function findFighterStateTransitionManually(entity) {
|
|
59
|
+
return findFighterStateTransitionInternal(entity, false);
|
|
58
60
|
}
|
|
59
|
-
function
|
|
60
|
-
const
|
|
61
|
-
|
|
61
|
+
function findFighterStateTransitionInternal(entity, skipManualEntry) {
|
|
62
|
+
const profile = entity.fsmType;
|
|
63
|
+
const profileTransitions = stateTransitions[profile];
|
|
64
|
+
if (profileTransitions) {
|
|
65
|
+
// profile 针对"当前 fromState"注册了任何专属转移:只扫 profile,不去 Any 兜底
|
|
66
|
+
// 这样 Turn 有专属 IDLE→PREATTACK 时,冷却没过不会被 Any 的 IdleToPreAttack 放行
|
|
67
|
+
const hasCurFromStateExclusive = profileTransitions.some(t => t.fromState === entity.curState);
|
|
68
|
+
if (hasCurFromStateExclusive) {
|
|
69
|
+
return findTransitionInList(entity, profileTransitions, skipManualEntry);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
// profile 没有针对当前 fromState 的专属注册:让 Any 兜底(含 fromState==curState 和 fromState==AnyFighterState 的项)
|
|
73
|
+
if (profile === FighterStateProfiles_1.AnyFighterStateProfile)
|
|
62
74
|
return null;
|
|
75
|
+
const anyTransitions = stateTransitions[FighterStateProfiles_1.AnyFighterStateProfile];
|
|
76
|
+
return anyTransitions ? findTransitionInList(entity, anyTransitions, skipManualEntry) : null;
|
|
77
|
+
}
|
|
78
|
+
function findTransitionInList(entity, transitions, skipManualEntry) {
|
|
63
79
|
for (let i = 0; i < transitions.length; i++) {
|
|
64
80
|
const transition = transitions[i];
|
|
65
81
|
if (transition.fromState !== exports.AnyFighterState && transition.fromState !== entity.curState)
|
|
66
82
|
continue;
|
|
67
83
|
if (!isFighterStateEnabled(entity, transition.toState))
|
|
68
84
|
continue;
|
|
85
|
+
// 目标状态登记为"必须手动进入"时,自动检测直接跳过这条转移
|
|
86
|
+
if (skipManualEntry && (0, FighterStateProfiles_1.isFighterStateEntryManual)(entity.fsmType, transition.toState))
|
|
87
|
+
continue;
|
|
69
88
|
if (transition.onCheck(entity))
|
|
70
89
|
return transition;
|
|
71
90
|
}
|
|
@@ -265,8 +265,8 @@ function getCurSkillId(entity) {
|
|
|
265
265
|
if (!tempCheckSkillIds.length)
|
|
266
266
|
return 0;
|
|
267
267
|
if (tempCheckSkillIds.length > 1) {
|
|
268
|
-
entity.game.randomRange(0, tempCheckSkillIds.length - 1);
|
|
269
|
-
return tempCheckSkillIds[
|
|
268
|
+
const index = entity.game.randomRange(0, tempCheckSkillIds.length - 1);
|
|
269
|
+
return tempCheckSkillIds[index];
|
|
270
270
|
}
|
|
271
271
|
else {
|
|
272
272
|
return tempCheckSkillIds[0];
|
|
@@ -17,5 +17,6 @@ var StateType;
|
|
|
17
17
|
StateType[StateType["IN"] = 11] = "IN";
|
|
18
18
|
StateType[StateType["OUT"] = 12] = "OUT";
|
|
19
19
|
StateType[StateType["PREATTACK"] = 13] = "PREATTACK";
|
|
20
|
-
StateType[StateType["
|
|
20
|
+
StateType[StateType["BACK"] = 14] = "BACK";
|
|
21
|
+
StateType[StateType["GLOBAL"] = 15] = "GLOBAL";
|
|
21
22
|
})(StateType || (exports.StateType = StateType = {}));
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type FighterData from "../entity/FighterData";
|
|
2
|
+
import { AttackState } from "./AnyFighterStates";
|
|
3
|
+
import { FighterStateProfile } from "./FighterStateProfiles";
|
|
4
|
+
import { BaseFighterState } from "./FighterStateShared";
|
|
5
|
+
import { StateType } from "./FighterStateType";
|
|
6
|
+
export declare class WaitState extends BaseFighterState {
|
|
7
|
+
static state: StateType;
|
|
8
|
+
static profile: FighterStateProfile;
|
|
9
|
+
static onEnter(entity: FighterData): void;
|
|
10
|
+
static onUpdate(entity: FighterData, dt: number): void;
|
|
11
|
+
}
|
|
12
|
+
export declare class TurnPreAttackState extends BaseFighterState {
|
|
13
|
+
static state: StateType;
|
|
14
|
+
static profile: FighterStateProfile;
|
|
15
|
+
static onEnter(entity: FighterData): void;
|
|
16
|
+
static onUpdate(entity: FighterData, dt: number): void;
|
|
17
|
+
}
|
|
18
|
+
export declare class TurnAttackState extends AttackState {
|
|
19
|
+
static state: StateType;
|
|
20
|
+
static profile: FighterStateProfile;
|
|
21
|
+
static onEnter(entity: FighterData): void;
|
|
22
|
+
}
|
|
23
|
+
export declare class TurnBackState extends BaseFighterState {
|
|
24
|
+
static state: StateType;
|
|
25
|
+
static profile: FighterStateProfile;
|
|
26
|
+
static onEnter(entity: FighterData): void;
|
|
27
|
+
static onUpdate(entity: FighterData, dt: number): void;
|
|
28
|
+
static onExit(entity: FighterData): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TurnBackState = exports.TurnAttackState = exports.TurnPreAttackState = exports.WaitState = void 0;
|
|
4
|
+
const Property_1 = require("../../property/Property");
|
|
5
|
+
const battle_interface_1 = require("../battle.interface");
|
|
6
|
+
const EntityEvent_1 = require("../event/EntityEvent");
|
|
7
|
+
const GameEvent_1 = require("../event/GameEvent");
|
|
8
|
+
const BattleConfig_1 = require("../util/BattleConfig");
|
|
9
|
+
const BVec2_1 = require("../util/BVec2");
|
|
10
|
+
const AnyFighterStates_1 = require("./AnyFighterStates");
|
|
11
|
+
const FighterStateRegistry_1 = require("./FighterStateRegistry");
|
|
12
|
+
const FighterStateShared_1 = require("./FighterStateShared");
|
|
13
|
+
const FighterStateType_1 = require("./FighterStateType");
|
|
14
|
+
const moveSpeed = 1500;
|
|
15
|
+
class WaitState extends FighterStateShared_1.BaseFighterState {
|
|
16
|
+
static state = FighterStateType_1.StateType.WAIT;
|
|
17
|
+
static profile = 7 /* FighterStateProfile.Turn */;
|
|
18
|
+
static onEnter(entity) {
|
|
19
|
+
let name = (0, FighterStateShared_1.getActionNameByType)(FighterStateType_1.StateType.IDLE, entity.actionType);
|
|
20
|
+
if ((entity.campType === battle_interface_1.CampType.MY || entity.game.isPVP) && entity.cfg.type === battle_interface_1.SubEntityType.ROLE) {
|
|
21
|
+
name = "idle_" + entity.weaponType;
|
|
22
|
+
}
|
|
23
|
+
(0, FighterStateShared_1.playAction)(entity, name, true);
|
|
24
|
+
}
|
|
25
|
+
static onUpdate(entity, dt) {
|
|
26
|
+
entity.actionTime -= dt;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
exports.WaitState = WaitState;
|
|
30
|
+
class TurnPreAttackState extends FighterStateShared_1.BaseFighterState {
|
|
31
|
+
static state = FighterStateType_1.StateType.PREATTACK;
|
|
32
|
+
static profile = 7 /* FighterStateProfile.Turn */;
|
|
33
|
+
static onEnter(entity) {
|
|
34
|
+
const skillData = entity.skillDatas[entity.curSkillId];
|
|
35
|
+
if (entity.curSkillId != entity.counterSkillId && skillData.cfg.skillImpacts[0].type === 1) {
|
|
36
|
+
const attackTarget = entity.game.getEntityLogic(entity.attackTarget);
|
|
37
|
+
if (!attackTarget) {
|
|
38
|
+
entity.actionTime = entity.game.logicStep;
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
if (!entity.targetPos) {
|
|
42
|
+
entity.targetPos = new BVec2_1.BVec2();
|
|
43
|
+
}
|
|
44
|
+
// 方向向量:从当前位置指向目标身前点
|
|
45
|
+
const targetX = attackTarget.x + (entity.campType === battle_interface_1.CampType.MY ? -attackTarget.width : attackTarget.width);
|
|
46
|
+
BVec2_1.BVecHelper.set(entity.targetPos, targetX, attackTarget.y);
|
|
47
|
+
BVec2_1.BVecHelper.sub(entity.targetPos, entity.targetPos, entity);
|
|
48
|
+
const dis = BVec2_1.BVecHelper.length(entity.targetPos);
|
|
49
|
+
if (dis <= 0) {
|
|
50
|
+
entity.actionTime = entity.game.logicStep;
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
// 预缩放:把 targetPos 变成"一帧步长向量",onUpdate 直接加即可(与 TurnBackState 同模式)
|
|
54
|
+
BVec2_1.BVecHelper.mulScalar(entity.targetPos, entity.targetPos, moveSpeed * entity.game.logicStep / dis);
|
|
55
|
+
entity.actionTime = dis / moveSpeed;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
entity.actionTime = entity.game.logicStep;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
static onUpdate(entity, dt) {
|
|
62
|
+
entity.actionTime -= dt;
|
|
63
|
+
const skillData = entity.skillDatas[entity.curSkillId];
|
|
64
|
+
if (!skillData)
|
|
65
|
+
return;
|
|
66
|
+
if (entity.curSkillId === entity.counterSkillId)
|
|
67
|
+
return;
|
|
68
|
+
if (skillData.cfg.skillImpacts[0].type !== 1)
|
|
69
|
+
return;
|
|
70
|
+
const attackTarget = entity.game.getEntityLogic(entity.attackTarget);
|
|
71
|
+
if (!attackTarget)
|
|
72
|
+
return;
|
|
73
|
+
// 剩余时间不足一帧:直接吸附到目标身前点,避免 overshoot
|
|
74
|
+
if (entity.actionTime < entity.game.logicStep) {
|
|
75
|
+
let ratio = entity.actionTime / entity.game.logicStep;
|
|
76
|
+
if (ratio < 0)
|
|
77
|
+
ratio = 0;
|
|
78
|
+
entity.setPosition(entity.x + entity.targetPos.x * ratio, entity.y + entity.targetPos.y * ratio);
|
|
79
|
+
}
|
|
80
|
+
else {
|
|
81
|
+
entity.setPosition(entity.x + entity.targetPos.x, entity.y + entity.targetPos.y);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
exports.TurnPreAttackState = TurnPreAttackState;
|
|
86
|
+
class TurnAttackState extends AnyFighterStates_1.AttackState {
|
|
87
|
+
static state = FighterStateType_1.StateType.ATTACK;
|
|
88
|
+
static profile = 7 /* FighterStateProfile.Turn */;
|
|
89
|
+
static onEnter(entity) {
|
|
90
|
+
entity.eventIndex = 0;
|
|
91
|
+
// 连击技能:头顶飘“连击”(参考 StateDisplay 的一次性飘字)
|
|
92
|
+
if (entity.comboSkillId && entity.curSkillId === entity.comboSkillId) {
|
|
93
|
+
entity.game.emit(GameEvent_1.GameEvent.ShowDisplay, 3 /* DisplayType.Combo */, "连击", entity);
|
|
94
|
+
}
|
|
95
|
+
let attackName = "attack";
|
|
96
|
+
const skillData = entity.skillDatas[entity.curSkillId];
|
|
97
|
+
if (!skillData.cfg.releaseSequence) {
|
|
98
|
+
entity.baseAtkUseTimes++;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
let max = 0;
|
|
102
|
+
for (let i = 0; i < entity.normalSkillIds.length; i++) {
|
|
103
|
+
let normalSkillId = entity.normalSkillIds[i];
|
|
104
|
+
let skillData = entity.skillDatas[normalSkillId];
|
|
105
|
+
if ((skillData.cfg.skillType || 0) == entity.step && skillData.cfg.releaseSequence) {
|
|
106
|
+
if (skillData.cfg.releaseSequence > max) {
|
|
107
|
+
max = skillData.cfg.releaseSequence;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
if (entity.baseAtkUseTimes >= max) {
|
|
112
|
+
entity.baseAtkUseTimes = 0;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
entity.markUseReleaseSeq = skillData.cfg.releaseSequence || 0;
|
|
116
|
+
if (skillData.cfg.attackName) {
|
|
117
|
+
attackName = skillData.cfg.attackName.length > 1
|
|
118
|
+
? skillData.cfg.attackName[entity.game.randomRange(0, skillData.cfg.attackName.length - 1)]
|
|
119
|
+
: skillData.cfg.attackName[0];
|
|
120
|
+
}
|
|
121
|
+
entity.curAtkName = attackName;
|
|
122
|
+
entity.actionTime = (0, FighterStateShared_1.playAction)(entity, attackName, false);
|
|
123
|
+
entity.curAtkTime = 0;
|
|
124
|
+
const spineData = (0, BattleConfig_1.getSpineSkeletonDataMap)(entity.spineName);
|
|
125
|
+
const anim = spineData ? spineData.animations[attackName] : null;
|
|
126
|
+
let skillCd = Property_1.PropertyHelper.atkCd(skillData.cfg.atkInterval || 0, entity.property);
|
|
127
|
+
if (entity.curDoubleShootNum > 0 && entity.curSkillId === entity.comboSkillId) {
|
|
128
|
+
entity.curDoubleShootNum--;
|
|
129
|
+
entity.doubleShootNum--;
|
|
130
|
+
}
|
|
131
|
+
let attackTime = entity.actionTime;
|
|
132
|
+
if (skillCd <= attackTime) {
|
|
133
|
+
attackTime = skillCd;
|
|
134
|
+
entity.realExtraSpeed = entity.actionTime / attackTime;
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
entity.realExtraSpeed = 1;
|
|
138
|
+
}
|
|
139
|
+
entity.timeScale = entity.game.gameModule.moduleState.timeScale * entity.realExtraSpeed;
|
|
140
|
+
entity.game.emit(entity, EntityEvent_1.EntityEvent.AttackStart, entity.curSkillId);
|
|
141
|
+
let crit = Property_1.PropertyHelper.crit(entity.property);
|
|
142
|
+
if (crit > 5000)
|
|
143
|
+
crit = 5000;
|
|
144
|
+
if (entity.game.IsHitOrNot(crit)) {
|
|
145
|
+
entity.game.emit(entity, EntityEvent_1.EntityEvent.NormalAtkHitCrit, entity.curSkillId);
|
|
146
|
+
}
|
|
147
|
+
entity.game.emit(GameEvent_1.GameEvent.SkillResetSkillCd, entity, entity.curSkillId, 0, 1);
|
|
148
|
+
if (!anim || !anim.events || anim.events.length <= 0) {
|
|
149
|
+
entity.game.call(GameEvent_1.GameEvent.UseSkillResult, entity, entity.curSkillId);
|
|
150
|
+
entity.normalAtkTimes++;
|
|
151
|
+
entity.game.emit(entity, EntityEvent_1.EntityEvent.NormalAttackTimes, entity.normalAtkTimes, entity.curSkillId);
|
|
152
|
+
}
|
|
153
|
+
else {
|
|
154
|
+
this.checkEventCall(entity);
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
exports.TurnAttackState = TurnAttackState;
|
|
159
|
+
class TurnBackState extends FighterStateShared_1.BaseFighterState {
|
|
160
|
+
static state = FighterStateType_1.StateType.BACK;
|
|
161
|
+
static profile = 7 /* FighterStateProfile.Turn */;
|
|
162
|
+
static onEnter(entity) {
|
|
163
|
+
if (!entity.targetPos) {
|
|
164
|
+
entity.targetPos = new BVec2_1.BVec2();
|
|
165
|
+
}
|
|
166
|
+
if (entity.curDoubleShootNum > 0 && entity.comboSkillId) {
|
|
167
|
+
//存在连击
|
|
168
|
+
entity.curSkillId = entity.comboSkillId;
|
|
169
|
+
const attackTarget = entity.game.getEntityLogic(entity.attackTarget);
|
|
170
|
+
entity.targetPos.x = (entity.moveStartX + attackTarget.x) / 2;
|
|
171
|
+
entity.targetPos.y = attackTarget.y;
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
entity.targetPos.x = entity.moveStartX;
|
|
175
|
+
entity.targetPos.y = entity.moveStartY;
|
|
176
|
+
}
|
|
177
|
+
BVec2_1.BVecHelper.sub(entity.targetPos, entity.targetPos, entity);
|
|
178
|
+
const dis = BVec2_1.BVecHelper.length(entity.targetPos);
|
|
179
|
+
if (dis <= 0) {
|
|
180
|
+
// 已经在初始位置,不需要移动
|
|
181
|
+
entity.actionTime = 0;
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
// 每帧位移固定为一个逻辑步长,走完由 onUpdate 吸附回初始位置
|
|
185
|
+
BVec2_1.BVecHelper.mulScalar(entity.targetPos, entity.targetPos, moveSpeed * entity.game.logicStep / dis);
|
|
186
|
+
entity.actionTime = dis / moveSpeed;
|
|
187
|
+
}
|
|
188
|
+
static onUpdate(entity, dt) {
|
|
189
|
+
entity.actionTime -= dt;
|
|
190
|
+
if (entity.actionTime > 0) {
|
|
191
|
+
entity.setPosition(entity.x + entity.targetPos.x, entity.y + entity.targetPos.y);
|
|
192
|
+
}
|
|
193
|
+
if (entity.actionTime <= 0) {
|
|
194
|
+
const stepdis = moveSpeed * entity.game.logicStep;
|
|
195
|
+
if (Math.abs(entity.x - entity.moveStartX) <= stepdis && Math.abs(entity.y - entity.moveStartY) <= stepdis) {
|
|
196
|
+
entity.setPosition(entity.moveStartX, entity.moveStartY);
|
|
197
|
+
}
|
|
198
|
+
(0, FighterStateShared_1.changeState)(entity, FighterStateType_1.StateType.IDLE);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
static onExit(entity) {
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
exports.TurnBackState = TurnBackState;
|
|
205
|
+
(0, FighterStateRegistry_1.registerFighterStateNode)(TurnAttackState);
|
|
206
|
+
(0, FighterStateRegistry_1.registerFighterStateNode)(TurnPreAttackState);
|
|
207
|
+
(0, FighterStateRegistry_1.registerFighterStateNode)(TurnBackState);
|
|
208
|
+
(0, FighterStateRegistry_1.registerFighterStateNode)(WaitState);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import FighterData from "../entity/FighterData";
|
|
2
|
+
import { IdleToPreAttack } from "./AnyFighterStateTransitions";
|
|
3
|
+
import { FighterStateProfile } from "./FighterStateProfiles";
|
|
4
|
+
import { BaseFighterStateTransition } from "./FighterStateTransition";
|
|
5
|
+
import { StateType } from "./FighterStateType";
|
|
6
|
+
/**
|
|
7
|
+
* 攻击结束或存在插入行动请求:进入 WAIT 等待被打断。
|
|
8
|
+
*/
|
|
9
|
+
export declare class TurnAttackToWait extends BaseFighterStateTransition {
|
|
10
|
+
static profile: FighterStateProfile;
|
|
11
|
+
static fromState: StateType;
|
|
12
|
+
static toState: StateType;
|
|
13
|
+
static priority: number;
|
|
14
|
+
static onCheck(entity: FighterData): boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare class TurnWaitToBack extends BaseFighterStateTransition {
|
|
17
|
+
static profile: FighterStateProfile;
|
|
18
|
+
static fromState: StateType;
|
|
19
|
+
static toState: StateType;
|
|
20
|
+
static priority: number;
|
|
21
|
+
static onCheck(entity: FighterData): boolean;
|
|
22
|
+
}
|
|
23
|
+
export declare class TurnIdleToPreAttack extends IdleToPreAttack {
|
|
24
|
+
static profile: FighterStateProfile;
|
|
25
|
+
static fromState: StateType;
|
|
26
|
+
static toState: StateType;
|
|
27
|
+
static priority: number;
|
|
28
|
+
static onCheck(entity: FighterData): boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare class TurnPreAttackToAttack extends BaseFighterStateTransition {
|
|
31
|
+
static profile: FighterStateProfile;
|
|
32
|
+
static fromState: StateType;
|
|
33
|
+
static toState: StateType;
|
|
34
|
+
static priority: number;
|
|
35
|
+
static onCheck(entity: FighterData): boolean;
|
|
36
|
+
}
|