|
|
|
@ -23,7 +23,7 @@ const DIGIT_STAT_SOURCE = 'battle_buff_digit_'; |
|
|
|
|
|
|
|
|
|
|
|
/** 单塔战斗侧额外效果(105+) */ |
|
|
|
/** 单塔战斗侧额外效果(105+) */ |
|
|
|
export interface DigitCombatFlags { |
|
|
|
export interface DigitCombatFlags { |
|
|
|
/** 107:技能伤害倍数 */ |
|
|
|
/** 107/113:技能伤害倍数(113 为 Hero.skill_id) */ |
|
|
|
skillMuls: { skillIds: number[]; mul: number }[]; |
|
|
|
skillMuls: { skillIds: number[]; mul: number }[]; |
|
|
|
/** 110:技能必暴(convert=暴击率转爆伤) */ |
|
|
|
/** 110:技能必暴(convert=暴击率转爆伤) */ |
|
|
|
forceCritSkills: { skillIds: number[]; convert: boolean }[]; |
|
|
|
forceCritSkills: { skillIds: number[]; convert: boolean }[]; |
|
|
|
@ -60,7 +60,7 @@ interface DigitUnitSnap { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 局内 functiontype 101~112:按 target/targetpar 给数字塔属性/技能/战斗标记。 |
|
|
|
* 局内 functiontype 101~113:按 target/targetpar 给数字塔属性/技能/战斗标记。 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
export class BattleBuffDigitStatHost { |
|
|
|
export class BattleBuffDigitStatHost { |
|
|
|
private _battle: DigitStatBattleRef | null = null; |
|
|
|
private _battle: DigitStatBattleRef | null = null; |
|
|
|
@ -220,6 +220,7 @@ export class BattleBuffDigitStatHost { |
|
|
|
} |
|
|
|
} |
|
|
|
const grantSkills: number[] = []; |
|
|
|
const grantSkills: number[] = []; |
|
|
|
const flags = this._emptyFlags(); |
|
|
|
const flags = this._emptyFlags(); |
|
|
|
|
|
|
|
const defaultSkillId = Math.floor(Number(hero.skill_id) || 0); |
|
|
|
const passives = BattleBuffCarryStore.getPassives(pid); |
|
|
|
const passives = BattleBuffCarryStore.getPassives(pid); |
|
|
|
for (let i = 0; i < passives.length; i++) { |
|
|
|
for (let i = 0; i < passives.length; i++) { |
|
|
|
const row = passives[i].row as ITableBattlebuff | undefined; |
|
|
|
const row = passives[i].row as ITableBattlebuff | undefined; |
|
|
|
@ -227,8 +228,8 @@ export class BattleBuffDigitStatHost { |
|
|
|
if (!BattleBuffTargetParse.matches(row.target, row.targetpar, heroType, level, rank)) continue; |
|
|
|
if (!BattleBuffTargetParse.matches(row.target, row.targetpar, heroType, level, rank)) continue; |
|
|
|
const ft = Math.floor(Number(row.functiontype) || 0); |
|
|
|
const ft = Math.floor(Number(row.functiontype) || 0); |
|
|
|
const ft1 = Math.floor(Number(row.functiontype1) || 0); |
|
|
|
const ft1 = Math.floor(Number(row.functiontype1) || 0); |
|
|
|
this._applyPrimary(session, entityId, row, ft, i, grantSkills, flags); |
|
|
|
this._applyPrimary(session, entityId, row, ft, i, grantSkills, flags, defaultSkillId); |
|
|
|
this._applySecondary(row, ft1, flags); |
|
|
|
this._applySecondary(row, ft1, flags, defaultSkillId); |
|
|
|
} |
|
|
|
} |
|
|
|
this._setFlags(entityId, flags); |
|
|
|
this._setFlags(entityId, flags); |
|
|
|
getPassiveSkillHost().syncBuffSkills(session, entityId, grantSkills); |
|
|
|
getPassiveSkillHost().syncBuffSkills(session, entityId, grantSkills); |
|
|
|
@ -242,6 +243,7 @@ export class BattleBuffDigitStatHost { |
|
|
|
index: number, |
|
|
|
index: number, |
|
|
|
grantSkills: number[], |
|
|
|
grantSkills: number[], |
|
|
|
flags: DigitCombatFlags, |
|
|
|
flags: DigitCombatFlags, |
|
|
|
|
|
|
|
defaultSkillId: number, |
|
|
|
): void { |
|
|
|
): void { |
|
|
|
const source = `${DIGIT_STAT_SOURCE}${row.id}_${index}`; |
|
|
|
const source = `${DIGIT_STAT_SOURCE}${row.id}_${index}`; |
|
|
|
const nums = parseFunctionParNums(row.functionpar); |
|
|
|
const nums = parseFunctionParNums(row.functionpar); |
|
|
|
@ -320,11 +322,25 @@ export class BattleBuffDigitStatHost { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
flags.skillMuls.push({ skillIds: this._expandWeaponSkillIds(parsed.skillIds), mul: parsed.mul }); |
|
|
|
flags.skillMuls.push({ skillIds: this._expandWeaponSkillIds(parsed.skillIds), mul: parsed.mul }); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (ft === BattleBuffFunctionType.DigitDefaultSkillDmgMul) { |
|
|
|
|
|
|
|
this._pushDefaultSkillMul(row, row.functionpar, flags, defaultSkillId); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private _applySecondary(row: ITableBattlebuff, ft1: number, flags: DigitCombatFlags): void { |
|
|
|
/** |
|
|
|
|
|
|
|
* @param row Battlebuff 行 |
|
|
|
|
|
|
|
* @param ft1 functiontype1 |
|
|
|
|
|
|
|
* @param flags 塔战斗标记 |
|
|
|
|
|
|
|
* @param defaultSkillId 该数字 Hero.skill_id |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private _applySecondary(row: ITableBattlebuff, ft1: number, flags: DigitCombatFlags, defaultSkillId: number): void { |
|
|
|
if (!(ft1 > 0)) return; |
|
|
|
if (!(ft1 > 0)) return; |
|
|
|
|
|
|
|
if (ft1 === BattleBuffFunctionType.DigitDefaultSkillDmgMul) { |
|
|
|
|
|
|
|
this._pushDefaultSkillMul(row, row.functionpar1, flags, defaultSkillId); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
const parsed = parseBattleBuffSkillListMul(row.functionpar1); |
|
|
|
const parsed = parseBattleBuffSkillListMul(row.functionpar1); |
|
|
|
if (!parsed) { |
|
|
|
if (!parsed) { |
|
|
|
console.warn('[BattleBuffDigitStat] functiontype1 参数无效', row.id, ft1, row.functionpar1); |
|
|
|
console.warn('[BattleBuffDigitStat] functiontype1 参数无效', row.id, ft1, row.functionpar1); |
|
|
|
@ -342,6 +358,32 @@ export class BattleBuffDigitStatHost { |
|
|
|
console.warn('[BattleBuffDigitStat] 未知 functiontype1', row.id, ft1); |
|
|
|
console.warn('[BattleBuffDigitStat] 未知 functiontype1', row.id, ft1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 113:对锁定数字的 Hero.skill_id 技能施加伤害倍数。 |
|
|
|
|
|
|
|
* @param row Battlebuff 行 |
|
|
|
|
|
|
|
* @param raw functionpar / functionpar1(倍数) |
|
|
|
|
|
|
|
* @param flags 塔战斗标记 |
|
|
|
|
|
|
|
* @param defaultSkillId Hero.skill_id |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
private _pushDefaultSkillMul( |
|
|
|
|
|
|
|
row: ITableBattlebuff, |
|
|
|
|
|
|
|
raw: string | number | null | undefined, |
|
|
|
|
|
|
|
flags: DigitCombatFlags, |
|
|
|
|
|
|
|
defaultSkillId: number, |
|
|
|
|
|
|
|
): void { |
|
|
|
|
|
|
|
const nums = parseFunctionParNums(raw); |
|
|
|
|
|
|
|
const mul = nums.length > 0 ? Math.floor(nums[0]) : 0; |
|
|
|
|
|
|
|
if (!(mul > 0)) { |
|
|
|
|
|
|
|
console.warn('[BattleBuffDigitStat] ft113 倍数无效', row.id, raw); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!(defaultSkillId > 0)) { |
|
|
|
|
|
|
|
console.warn('[BattleBuffDigitStat] ft113 目标数字无 skill_id', row.id); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
flags.skillMuls.push({ skillIds: [defaultSkillId], mul }); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Weapon.id 列表展开为 act_skill(Skill.id),便于伤害管线按 Ability 匹配。 |
|
|
|
* Weapon.id 列表展开为 act_skill(Skill.id),便于伤害管线按 Ability 匹配。 |
|
|
|
* @param weaponIds Weapon.id |
|
|
|
* @param weaponIds Weapon.id |
|
|
|
@ -446,7 +488,8 @@ export class BattleBuffDigitStatHost { |
|
|
|
|| ft === BattleBuffFunctionType.DigitChanceMulDmg |
|
|
|
|| ft === BattleBuffFunctionType.DigitChanceMulDmg |
|
|
|
|| ft === BattleBuffFunctionType.DigitCondForceCrit |
|
|
|
|| ft === BattleBuffFunctionType.DigitCondForceCrit |
|
|
|
|| ft === BattleBuffFunctionType.DigitSkillDmgMul |
|
|
|
|| ft === BattleBuffFunctionType.DigitSkillDmgMul |
|
|
|
|| ft === BattleBuffFunctionType.DigitSkillForceCrit; |
|
|
|
|| ft === BattleBuffFunctionType.DigitSkillForceCrit |
|
|
|
|
|
|
|
|| ft === BattleBuffFunctionType.DigitDefaultSkillDmgMul; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private _resolveElementType(weapon1Id: number, hero: ITableHero): number { |
|
|
|
private _resolveElementType(weapon1Id: number, hero: ITableHero): number { |
|
|
|
|