HumanBreak/src/types/enemy.d.ts

203 lines
6.9 KiB
TypeScript
Raw Normal View History

2022-11-13 18:02:05 +08:00
/** @file enemys.js 定义了一系列和敌人相关的API函数。 */
declare class enemys {
/**
*
* @example core.hasSpecial('greenSlime', 1) // 判定绿头怪有无先攻属性
* @param special id或敌人对象或正整数数组或自然数
* @param test
* @returns special为数组或数且含有test或相等special为敌人id或对象且具有此属性true
*/
hasSpecial(
special: number | number[] | string | Enemy,
test: number
): boolean;
/**
*
* @example core.getSpecialText('greenSlime') // ['先攻', '3连击', '破甲', '反击']
* @param enemy id或敌人对象core.material.enemys.greenSlime
* @returns
*/
getSpecialText(enemy: string | Enemy): string[];
/**
*
* @example core.getSpecialHint('bat', 1) // '先攻:怪物首先攻击'
* @param enemy id或敌人对象
* @param special
* @returns
*/
getSpecialHint(enemy: string | Enemy, special: number): string;
/** 获得某个敌人的某项属性值 */
getEnemyValue(
enemy: string | Enemy,
name: string,
x?: number,
y?: number,
floorId?: string
): any;
/**
*
* @example core.canBattle('greenSlime',0,0,'MT0') // 能否打败主塔0层左上角的绿头怪假设有
* @param enemy id或敌人对象
* @param x
* @param y
* @param floorId
* @returns true表示可以打败false表示无法打败
*/
canBattle(
enemy: string | Enemy,
x?: number,
y?: number,
floorId?: string
): boolean;
/**
*
* @example core.getDamage('greenSlime',0,0,'MT0') // 绿头怪的总伤害
* @param enemy id或敌人对象
* @param x
* @param y
* @param floorId
* @returns null
*/
getDamage(
enemy: string | Enemy,
x?: number,
y?: number,
floorId?: string
): number;
/**
*
* @example core.getDamageString('greenSlime', 0, 0, 'MT0') // 绿头怪的地图显伤
* @param enemy id或敌人对象
* @param x
* @param y
* @param floorId
* @returns damage: 表示伤害值或为'???'color: 形如'#RrGgBb'
*/
getDamageString(
enemy: string | Enemy,
x?: number,
y?: number,
floorId?: string
): {
damage: string;
color: string;
};
/**
* useLoop开关选择回合法或二分法
* @example core.nextCriticals('greenSlime', 9, 0, 0, 'MT0') // 绿头怪接下来的9个临界
* @param enemy id或敌人对象
* @param number 1
* @param x
* @param y
* @param floorId
* @returns
*/
nextCriticals(
enemy: string | Enemy,
number?: number,
x?: number,
y?: number,
floorId?: string
2022-11-19 11:30:14 +08:00
): [atk: number, dam: number][];
2022-11-13 18:02:05 +08:00
/**
* 使
* @example core.nextCriticals('greenSlime', 10, 0, 0, 'MT0') // 再加10点防御能使绿头怪的伤害降低多少
* @param enemy id或敌人对象
* @param k 1
* @param x
* @param y
* @param floorId
* @returns
*/
getDefDamage(
enemy: string | Enemy,
k?: number,
x?: number,
y?: number,
floorId?: string
): number;
/**
*
* @example core.getCurrentEnemys('MT0') // 主塔0层的敌人集合
* @param floorId id
* @returns
*/
2022-11-16 23:01:23 +08:00
getCurrentEnemys(floorId?: string): (Enemy & DetailedEnemy)[];
2022-11-13 18:02:05 +08:00
/**
*
* @example core.hasEnemyLeft('greenSlime', ['sample0', 'sample1']) // 样板0层和1层是否有漏打的绿头怪
* @param enemyId id
* @param floorId id或其数组
* @returns true表示有敌人被漏打false表示敌人已死光
*/
hasEnemyLeft(enemyId?: string, floorId?: string | string[]): boolean;
/** 获得所有怪物原始数据的一个副本 */
getEnemys(): any;
/** 获得所有特殊属性定义 */
getSpecials(): [
number,
string | ((enemy: Enemy) => string),
string | ((enemy: Enemy) => string),
string | [number, number, number, number?],
number?
][];
/** 获得所有特殊属性的颜色 */
getSpecialColor(
enemy: string | Enemy
): Array<string | [number, number, number, number?]>;
/** 获得所有特殊属性的额外标记 */
getSpecialFlag(enemy: string | Enemy): Array<number>;
/** 获得怪物真实属性 */
getEnemyInfo(
enemy: string | Enemy,
hero?: any,
x?: number,
y?: number,
floorId?: string
): {
hp: number;
def: number;
atk: number;
money: number;
exp: number;
point: number;
special: number | number[];
guards: Array<[number, number, string]>;
[x: string]: any;
};
/** 获得战斗伤害信息(实际伤害计算函数) */
getDamageInfo(
enemy: string | Enemy,
hero?: any,
x?: number,
y?: number,
floorId?: string
): {
mon_hp: number;
mon_atk: number;
mon_def: number;
init_damage: number;
per_damage: number;
hero_per_damage: number;
turn: number;
damage: number;
[x: string]: any;
2022-11-19 11:30:14 +08:00
} | null;
2022-11-13 18:02:05 +08:00
}