HumanBreak/src/types/enemy.d.ts

243 lines
4.2 KiB
TypeScript
Raw Normal View History

type PartialNumbericEnemyProperty =
| 'value'
| 'zone'
| 'repulse'
| 'laser'
| 'breakArmor'
| 'counterAttack'
| 'vampire'
| 'hpBuff'
| 'atkBuff'
| 'defBuff'
| 'range'
| 'haloRange'
| 'n'
| 'purify'
| 'atkValue'
| 'defValue'
2023-05-04 22:06:25 +08:00
| 'damage'
| 'iceDecline'
| 'iceCore'
| 'fireCore'
| 'together'
2023-05-14 21:59:36 +08:00
| 'hungry'
| 'ice'
| 'crit'
| 'courage'
2023-06-30 21:56:54 +08:00
| 'charge'
2023-07-12 18:34:55 +08:00
| 'paleShield'
2023-07-30 16:46:34 +08:00
| 'iceHalo'
| 'day'
| 'night'
2024-08-30 00:23:29 +08:00
| 'melt'
2024-09-21 19:48:36 +08:00
| 'hpHalo'
| 'assimilateRange';
type BooleanEnemyProperty =
| 'zoneSquare'
| 'haloSquare'
| 'notBomb'
| 'add'
| 'haloAdd'
| 'specialMultiply';
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;
2024-04-20 12:27:38 +08:00
/**
*
*/
faceIds: Record<Dir, EnemyIds>;
/**
*
*/
beforeBattle: MotaEvent;
/**
*
*/
afterBattle: MotaEvent;
specialHalo?: number[];
2024-05-03 12:52:23 +08:00
translation?: [number, number];
2024-05-16 22:43:24 +08:00
/** 大怪物绑定贴图 */
bigImage?: ImageIds;
} & {
[P in PartialNumbericEnemyProperty]?: number;
} & {
[P in BooleanEnemyProperty]?: boolean;
} & EnemyInfoBase;
2024-08-30 00:23:29 +08:00
interface EnemyInfoBase extends EnemySpecialBase {
/**
*
*/
hp: number;
/**
*
*/
atk: number;
/**
*
*/
def: number;
/**
*
*/
money: number;
/**
*
*/
exp: number;
/**
*
*/
point: number;
}
/**
*
*/
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 BookEnemyInfo extends Enemy, EnemyInfo {
/**
*
*/
locs?: [x: number, y: number][];
/**
*
*/
name: string;
/**
*
*/
specialText: string[];
/**
*
*/
specialColor: Color[];
/**
*
*/
damage: number;
/**
*
*/
critical: number;
/**
*
*/
criticalDamage: number;
/**
* ratio防减伤
*/
defDamage: number;
}
/**
*
*/
2023-08-07 17:57:51 +08:00
interface Enemys {
/**
*
*/
readonly enemys: {
[P in EnemyIds]: Enemy<P>;
};
/**
*
*/
getEnemys(): {
[P in EnemyIds]: Enemy<P>;
};
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(
2023-07-30 16:46:34 +08:00
x: number,
y: number,
floorId?: FloorIds,
dir?: Dir | 'none' | (Dir | 'none')[]
2022-11-13 18:02:05 +08:00
): boolean;
}
declare const enemys: new () => Enemys;