|
|
|
|
import { BattleBuffFunctionType } from './BattleBuffTypes';
|
|
|
|
|
import {
|
|
|
|
|
parseBattleBuffMultiplierCardConfig,
|
|
|
|
|
type BattleBuffMultiplierCardConfig,
|
|
|
|
|
} from './BattleBuffParamParse';
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 局内拖拽种类(新表仅倍率卡/属性卡实体拖拽,非商店主动槽)。
|
|
|
|
|
*/
|
|
|
|
|
export enum BattleGameSkillDragKind {
|
|
|
|
|
/** 倍率卡拖到数字升 1/2 级 */
|
|
|
|
|
MultiplierCard = 1,
|
|
|
|
|
/** 属性卡拖到数字随机换五行 */
|
|
|
|
|
AttrCard = 2,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 是否倍率卡被动行 */
|
|
|
|
|
export function isBattleBuffMultiplierCard(row: ITableBattlebuff | null | undefined): boolean {
|
|
|
|
|
if (!row) return false;
|
|
|
|
|
return Number(row.functiontype) === BattleBuffFunctionType.MultiplierCard;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 是否属性卡被动行 */
|
|
|
|
|
export function isBattleBuffAttrCard(row: ITableBattlebuff | null | undefined): boolean {
|
|
|
|
|
if (!row) return false;
|
|
|
|
|
return Number(row.functiontype) === BattleBuffFunctionType.AttrCard;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 读取倍率卡配置 */
|
|
|
|
|
export function readBattleBuffMultiplierCardConfig(row: ITableBattlebuff | null | undefined): BattleBuffMultiplierCardConfig | null {
|
|
|
|
|
if (!isBattleBuffMultiplierCard(row)) return null;
|
|
|
|
|
return parseBattleBuffMultiplierCardConfig(row!.functionpar);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 解析商店主动 skill 拖拽类型(Phase1 无主动栈) */
|
|
|
|
|
export function resolveBattleGameSkillDragKind(_row: ITableBattlebuff | null | undefined): BattleGameSkillDragKind | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 解析商店主动 skill 点击类型(Phase1 无) */
|
|
|
|
|
export function resolveBattleGameSkillClickKind(_row: ITableBattlebuff | null | undefined): number | null {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 是否拖拽升级 buff(Phase1 无) */
|
|
|
|
|
export function isBattleBuffDragUnitLevelUp(_row: ITableBattlebuff | null | undefined): boolean {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 读取升级 delta(Phase1 无) */
|
|
|
|
|
export function readBattleBuffUnitLevelDelta(_row: ITableBattlebuff | null | undefined): number {
|
|
|
|
|
if (!_row) return 0;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 读取缚仙网时长(Phase1 无) */
|
|
|
|
|
export function readBattleBuffBindNetDuration(_row: ITableBattlebuff | null | undefined): number {
|
|
|
|
|
if (!_row) return 0;
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 是否乾坤袋回收 buff(Phase1 无) */
|
|
|
|
|
export function isBattleBuffDragRecycleToPeach(_row: ITableBattlebuff | null | undefined): boolean {
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 倍率卡掷骰等级增量(+1 或 +2) */
|
|
|
|
|
export function rollMultiplierCardLevelDelta(cfg: BattleBuffMultiplierCardConfig): number {
|
|
|
|
|
const total = cfg.plus1Weight + cfg.plus2Weight;
|
|
|
|
|
if (total <= 0) {
|
|
|
|
|
console.log('[BattleBuff] 倍率卡权重无效');
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
const roll = Math.random() * total;
|
|
|
|
|
return roll < cfg.plus1Weight ? 1 : 2;
|
|
|
|
|
}
|