You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AdLike2048/assets/script/battle/combat/TowerCombatSetup.ts

27 lines
1.4 KiB

3 weeks ago
import type { BattleSession } from 'db://assets/mx/module/battle';
import type { EntityId } from 'db://assets/mx/module/ecs';
import type { Player } from '../../game/Player';
import { getTowerLoadoutService } from './TowerLoadoutService';
import { SkillPickApplier } from '../skill/SkillPickApplier';
import { getInBattleBondHost } from '../bond/InBattleBondHost';
import { getBattleGameGlobalAttackSpeedHost } from './BattleGameGlobalAttackSpeedHost';
import { getBattleGameGlobalAttackRangeHost } from './BattleGameGlobalAttackRangeHost';
import { getBattleBuffUnitAttackSpeedHost } from './BattleBuffUnitAttackSpeedHost';
/** 塔部署后的战斗初始化:Combat + Ability + 词条空操作 */
export function setupTowerCombat(
session: BattleSession,
entityId: EntityId,
weapon1Id: number,
level: number,
player: Player,
): void {
const loadoutSvc = getTowerLoadoutService();
loadoutSvc.setupCombat(session, entityId, weapon1Id, level, player);
new SkillPickApplier(session).materializePlayerSkillsToEntity(entityId, player);
getInBattleBondHost().refreshEntity(entityId, player);
getBattleGameGlobalAttackSpeedHost().refreshEntity(session, entityId, player);
getBattleGameGlobalAttackRangeHost().refreshEntity(session, entityId, player);
getBattleBuffUnitAttackSpeedHost().refreshEntity(session, entityId, player.playerId);
}