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.
86 lines
2.8 KiB
86 lines
2.8 KiB
/** Hero 行 → MX 战斗配置 ID 约定(历史名 weapon1 仍表示 Hero.id) */
|
|
|
|
/** 塔单位配置 id */
|
|
export function towerUnitId(heroId: number): string {
|
|
return `tower_w1_${heroId}`;
|
|
}
|
|
|
|
/** 旧版普攻技能 ID(保留兼容) */
|
|
export function towerAbilityId(heroId: number): string {
|
|
return `ability_w1_${heroId}`;
|
|
}
|
|
|
|
/** 普攻 Ability id(共享;未覆盖 atk 形态时用) */
|
|
export function normalAbilityId(skillId: number): string {
|
|
return `ability_norm_${skillId}`;
|
|
}
|
|
|
|
/** 普攻 Ability id(按实体隔离;被动改普攻后用) */
|
|
export function entityNormalAbilityId(skillId: number, entityId: number): string {
|
|
return `ability_norm_${skillId}_e${entityId}`;
|
|
}
|
|
|
|
/** 是否为普攻(含实体覆盖 id) */
|
|
export function isNormalAbilityId(abilityId: string): boolean {
|
|
return /^ability_norm_\d+(?:_e\d+)?$/.test(abilityId);
|
|
}
|
|
|
|
/** @deprecated 使用 entityHeroAbilityId */
|
|
export function ultAbilityId(skillId: number): string {
|
|
return `ability_ult_${skillId}`;
|
|
}
|
|
|
|
/** @deprecated 使用 entityHeroAbilityId */
|
|
export function entityUltAbilityId(skillId: number, entityId: number): string {
|
|
return entityHeroAbilityId(skillId, entityId);
|
|
}
|
|
|
|
/** 英雄主动 Ability id(按实体隔离) */
|
|
export function entityHeroAbilityId(skillId: number, entityId: number): string {
|
|
return `ability_hero_${skillId}_e${entityId}`;
|
|
}
|
|
|
|
/** 武器主动 Ability id(按实体隔离) */
|
|
export function entityWeaponAbilityId(skillId: number, entityId: number): string {
|
|
return `ability_weapon_${skillId}_e${entityId}`;
|
|
}
|
|
|
|
/** 是否为英雄/武器主动(非普攻) */
|
|
export function isActiveAbilityId(abilityId: string): boolean {
|
|
return /^ability_(?:ult|hero|weapon)_\d+(?:_e\d+)?$/.test(abilityId);
|
|
}
|
|
|
|
/** @deprecated 使用 isActiveAbilityId */
|
|
export function isUltAbilityId(abilityId: string): boolean {
|
|
return isActiveAbilityId(abilityId);
|
|
}
|
|
|
|
/** 是否为武器主动 */
|
|
export function isWeaponAbilityId(abilityId: string): boolean {
|
|
return /^ability_weapon_\d+(?:_e\d+)?$/.test(abilityId);
|
|
}
|
|
|
|
/** 是否为英雄主动(含旧 ability_ult_) */
|
|
export function isHeroAbilityId(abilityId: string): boolean {
|
|
return /^ability_(?:ult|hero)_\d+(?:_e\d+)?$/.test(abilityId);
|
|
}
|
|
|
|
/** 怪物技能 Ability id(按实体隔离) */
|
|
export function entityMonsterAbilityId(skillId: number, entityId: number): string {
|
|
return `ability_monster_${skillId}_e${entityId}`;
|
|
}
|
|
|
|
/** 是否为怪物技能 */
|
|
export function isMonsterAbilityId(abilityId: string): boolean {
|
|
return /^ability_monster_\d+_e\d+$/.test(abilityId);
|
|
}
|
|
|
|
/** 塔实体 Hero 标签 */
|
|
export function weapon1Tag(heroId: number): string {
|
|
return `weapon1_${heroId}`;
|
|
}
|
|
|
|
/** @deprecated 使用 weapon1Tag */
|
|
export function heroTag(heroId: number): string {
|
|
return weapon1Tag(heroId);
|
|
}
|
|
|