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/BattleBuffInGameRefresh.ts

38 lines
1.4 KiB

4 days ago
import { getBattleBuffDigitStatHost } from './BattleBuffDigitStatHost';
import { getBattleBuffUnitAttackSpeedHost } from './BattleBuffUnitAttackSpeedHost';
import { getBattleBuffMoveSpeedHost } from './BattleBuffMoveSpeedHost';
import { getBattleBuffBaseThunderHost } from './BattleBuffBaseThunderHost';
/** afterPick 所需最小战斗句柄 */
interface InGameRefreshBattle {
/** 本机 */
localPlayerId: number;
/** 取玩家 */
getPlayer(playerId: number): { deployedUnits: readonly number[] } | null | undefined;
/** 会话 */
session: import('db://assets/mx/module/battle').BattleSession;
4 days ago
/**
* 气血丸/双生盾增量加基地血。
* @param playerId 携带方
*/
applyInGameBaseHpCarry(playerId: number): boolean;
4 days ago
}
/**
* 局内获得 buff 后刷新战斗侧效果。
*/
export class BattleBuffInGameRefresh {
/**
* @param battle 战斗句柄
* @param playerId 玩家
*/
static afterPick(battle: InGameRefreshBattle, playerId: number): void {
getBattleBuffDigitStatHost().bind(battle);
getBattleBuffDigitStatHost().reapplyPlayer(playerId);
getBattleBuffUnitAttackSpeedHost().bind(battle as never);
getBattleBuffMoveSpeedHost().bind(battle as never);
getBattleBuffBaseThunderHost().refreshCarry(battle as never);
4 days ago
battle.applyInGameBaseHpCarry(playerId);
4 days ago
}
}