HumanBreak/src/types/enemy.d.ts

401 lines
9.1 KiB
TypeScript
Raw Normal View History

type PartialNumbericEnemyProperty =
| 'value'
| 'zone'
| 'repulse'
| 'laser'
| 'breakArmor'
| 'counterAttack'
| 'vampire'
| 'hpBuff'
| 'atkBuff'
| 'defBuff'
| 'range'
| 'haloRange'
| 'n'
| 'purify'
| 'atkValue'
| 'defValue'
| 'damage';
type BooleanEnemyProperty =
| 'zoneSquare'
| 'haloSquare'
| 'notBomb'
| 'add'
| 'haloAdd';
type DetailedEnemy<I extends EnemyIds = EnemyIds> = {
specialText: string[];
toShowSpecial: string[];
toShowColor: Color[];
specialColor: Color[];
damageColor: Color;
2022-12-28 12:13:52 +08:00
criticalDamage: number;
critical: number;
defDamage: number;
} & Enemy<I>;
type Enemy<I extends EnemyIds = EnemyIds> = {
/**
* id
*/
id: I;
/**
*
*/
name: string;
2022-12-29 00:26:12 +08:00
/**
*
*/
description: string;
/**
* IDnullID来替换该怪物原本的ID
*
*/
displayIdInBook: EnemyIds;
/**
*
*/
beforeBattle: MotaEvent;
/**
*
*/
afterBattle: MotaEvent;
} & {
[P in PartialNumbericEnemyProperty]?: number;
} & {
[P in BooleanEnemyProperty]: boolean;
} & EnemyInfoBase;
/**
*
*/
type EnemySpecialDeclaration = [
id: number,
2023-01-06 16:21:17 +08:00
name: string | ((enemy: EnemySpecialBase) => string),
desc: string | ((enemy: EnemySpecialBase) => string),
color: Color,
extra?: number
];
interface DamageString {
/**
*
*/
damage: string;
/**
*
*/
color: Color;
}
2023-01-06 16:21:17 +08:00
interface EnemySpecialBase {
/**
*
*/
special: number[];
}
interface EnemyInfoBase extends EnemySpecialBase {
/**
*
*/
hp: number;
/**
*
*/
atk: number;
/**
*
*/
def: number;
/**
*
*/
money: number;
/**
*
*/
exp: number;
/**
*
*/
point: number;
}
interface EnemyInfo extends EnemyInfoBase {
/**
*
*/
guards: [x: number, y: number, id: EnemyIds];
}
interface DamageInfo {
/**
*
*/
mon_hp: number;
/**
*
*/
mon_atk: number;
/**
*
*/
mon_def: number;
/**
*
*/
init_damage: number;
/**
*
*/
per_damage: number;
/**
*
*/
hero_per_damage: number;
/**
*
*/
turn: number;
/**
*
*/
damage: number;
}
interface BookEnemyInfo extends Enemy, EnemyInfo {
/**
*
*/
locs?: [x: number, y: number][];
/**
*
*/
name: string;
/**
*
*/
specialText: string[];
/**
*
*/
specialColor: Color[];
/**
*
*/
damage: number;
/**
*
*/
critical: number;
/**
*
*/
criticalDamage: number;
/**
* ratio防减伤
*/
defDamage: number;
}
/**
*
*/
interface Enemys extends EnemyData {
/**
*
*/
readonly enemys: {
[P in EnemyIds]: Enemy<P>;
};
/**
*
*/
readonly enemydata: EnemyData;
/**
*
*/
getEnemys(): {
[P in EnemyIds]: Enemy<P>;
};
2022-11-13 18:02:05 +08:00
/**
*
* @example core.getSpecialText('greenSlime') // ['先攻', '3连击', '破甲', '反击']
* @param enemy id或敌人对象core.material.enemys.greenSlime
* @returns
*/
getSpecialText(enemy: EnemyIds | Enemy): string[];
/**
*
* @param enemy id或敌人对象core.material.enemys.greenSlime
*/
getSpecialColor(enemy: EnemyIds | Enemy): Color[];
/**
*
* @param enemy id或敌人对象core.material.enemys.greenSlime
*/
getSpecialFlag(enemy: EnemyIds | Enemy): number[];
2022-11-13 18:02:05 +08:00
/**
*
* @example core.getSpecialHint('bat', 1) // '先攻:怪物首先攻击'
* @param enemy id或敌人对象
2022-11-13 18:02:05 +08:00
* @param special
* @returns
*/
getSpecialHint(enemy: EnemyIds | Enemy, special: number): string;
2022-11-13 18:02:05 +08:00
/**
*
* @param enemy id或敌人对象
* @param name
* @param x
* @param y
* @param floorId
*/
getEnemyValue<K extends keyof Enemy>(
enemy: EnemyIds | Enemy,
name: K,
2022-11-13 18:02:05 +08:00
x?: number,
y?: number,
floorId?: FloorIds
): Enemy[K];
2022-11-13 18:02:05 +08:00
/**
*
* @example core.canBattle('greenSlime',0,0,'MT0') // 能否打败主塔0层左上角的绿头怪假设有
* @param enemy id或敌人对象
* @param x
* @param y
* @param floorId
2022-11-13 18:02:05 +08:00
* @returns true表示可以打败false表示无法打败
*/
canBattle(
enemy: EnemyIds | Enemy,
2022-11-13 18:02:05 +08:00
x?: number,
y?: number,
floorId?: FloorIds
2022-11-13 18:02:05 +08:00
): boolean;
/**
*
* @example core.getDamageString('greenSlime', 0, 0, 'MT0') // 绿头怪的地图显伤
* @param enemy id或敌人对象
* @param x
* @param y
* @param floorId
2022-11-13 18:02:05 +08:00
*/
getDamageString(
enemy: EnemyIds | Enemy,
2022-11-13 18:02:05 +08:00
x?: number,
y?: number,
floorId?: FloorIds
): DamageString;
2022-11-13 18:02:05 +08:00
/**
* useLoop开关选择回合法或二分法
* @example core.nextCriticals('greenSlime', 9, 0, 0, 'MT0') // 绿头怪接下来的9个临界
* @param enemy id或敌人对象
* @param number 1
* @param x
* @param y
* @param floorId
2022-11-13 18:02:05 +08:00
* @returns
*/
nextCriticals(
enemy: EnemyIds | Enemy,
2022-11-13 18:02:05 +08:00
number?: number,
x?: number,
y?: number,
floorId?: FloorIds
): [critical: number, damage: 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
2022-11-13 18:02:05 +08:00
* @returns
*/
getDefDamage(
enemy: EnemyIds | Enemy,
2022-11-13 18:02:05 +08:00
k?: number,
x?: number,
y?: number,
floorId?: FloorIds
): number;
/**
*
* @example core.getDamage('greenSlime',0,0,'MT0') // 绿头怪的总伤害
* @param enemy id或敌人对象
* @param x
* @param y
* @param floorId
* @returns null
*/
getDamage(
enemy: EnemyIds | Enemy,
x?: number,
y?: number,
floorId?: FloorIds
2022-11-13 18:02:05 +08:00
): number;
/**
*
* @example core.getCurrentEnemys('MT0') // 主塔0层的敌人集合
* @param floorId id
2022-11-13 18:02:05 +08:00
* @returns
*/
getCurrentEnemys(floorId?: FloorIds): 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?: EnemyIds | EnemyIds[],
floorId?: FloorIds | FloorIds[]
): boolean;
2022-11-13 18:02:05 +08:00
}
declare const enemys: new () => Enemys;