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.
47 lines
1.8 KiB
47 lines
1.8 KiB
|
3 weeks ago
|
import type { ProjectBattleHandle } from '../../battle/runtime/BattleRuntime';
|
||
|
|
import { BattleGamePassivePeachTreeSpawn } from './BattleGamePassivePeachTreeSpawn';
|
||
|
|
import type { BattleGamePassiveSkillHost } from './BattleGamePassiveSkillHost';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* 局内被动 buff CD 结束触发(按 functiontype 扩展具体逻辑)。
|
||
|
|
* 无 CD 的被动为携带即生效,不在此处理。
|
||
|
|
*/
|
||
|
|
export class BattleGamePassiveSkillRuntime {
|
||
|
|
/**
|
||
|
|
* 被动 buff CD 结束
|
||
|
|
* @param row Battlebuff 表行
|
||
|
|
* @param battle 战斗句柄
|
||
|
|
* @param host 被动 UI / 棋盘上下文
|
||
|
|
* @returns 是否已受理本次触发(异步产字返回 true;无空挖格返回 false)
|
||
|
|
*/
|
||
|
|
static onPassiveCdReady(
|
||
|
|
row: ITableBattlebuff,
|
||
|
|
battle: ProjectBattleHandle | null,
|
||
|
|
host: BattleGamePassiveSkillHost | null,
|
||
|
|
slotIndex: number,
|
||
|
|
): boolean {
|
||
|
|
const ft = Math.floor(Number(row.functiontype) || 0);
|
||
|
|
const id = Math.floor(Number(row.id) || 0);
|
||
|
|
if (ft <= 0 || id <= 0) return false;
|
||
|
|
if (!host) {
|
||
|
|
console.log('[PassiveSkill] CD 结束缺少 host', ft, 'id=', id);
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
|
||
|
|
switch (ft) {
|
||
|
|
case 3:
|
||
|
|
return BattleGamePassivePeachTreeSpawn.trySpawn(row, host, slotIndex);
|
||
|
|
case 17:
|
||
|
|
BattleGamePassiveSkillRuntime._onPassiveAttackSpeedReady(row, battle);
|
||
|
|
return false;
|
||
|
|
default:
|
||
|
|
console.log('[PassiveSkill] CD 结束未实现 functiontype', ft, 'id=', id);
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
/** functiontype=17 九天天鼓(被动攻速) */
|
||
|
|
private static _onPassiveAttackSpeedReady(_row: ITableBattlebuff, _battle: ProjectBattleHandle | null): void {
|
||
|
|
}
|
||
|
|
}
|