2022-12-27 23:31:14 +08:00
|
|
|
|
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';
|
2022-12-27 23:31:14 +08:00
|
|
|
|
|
|
|
|
|
type BooleanEnemyProperty =
|
|
|
|
|
| 'zoneSquare'
|
|
|
|
|
| 'haloSquare'
|
|
|
|
|
| 'notBomb'
|
|
|
|
|
| 'add'
|
2024-04-26 21:24:12 +08:00
|
|
|
|
| 'haloAdd'
|
|
|
|
|
| 'specialMultiply';
|
2022-12-27 23:31:14 +08:00
|
|
|
|
|
|
|
|
|
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;
|
2022-12-27 23:31:14 +08:00
|
|
|
|
} & Enemy<I>;
|
|
|
|
|
|
|
|
|
|
type Enemy<I extends EnemyIds = EnemyIds> = {
|
|
|
|
|
/**
|
|
|
|
|
* 怪物id
|
|
|
|
|
*/
|
|
|
|
|
id: I;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 怪物名称
|
|
|
|
|
*/
|
|
|
|
|
name: string;
|
|
|
|
|
|
2022-12-29 00:26:12 +08:00
|
|
|
|
/**
|
|
|
|
|
* 怪物说明
|
|
|
|
|
*/
|
|
|
|
|
description: string;
|
|
|
|
|
|
2022-12-27 23:31:14 +08:00
|
|
|
|
/**
|
|
|
|
|
* 在怪物手册中映射到的怪物ID。如果此项不为null,则在怪物手册中,将用目标ID来替换该怪物原本的ID。
|
|
|
|
|
* 常被运用在同一个怪物的多朝向上
|
|
|
|
|
*/
|
|
|
|
|
displayIdInBook: EnemyIds;
|
|
|
|
|
|
2024-04-20 12:27:38 +08:00
|
|
|
|
/**
|
|
|
|
|
* 行走图朝向。在勇士撞上图块时,或图块在移动时,会自动选择最合适的朝向图块(如果存在定义)来进行绘制。
|
|
|
|
|
*/
|
|
|
|
|
faceIds: Record<Dir, EnemyIds>;
|
|
|
|
|
|
2022-12-27 23:31:14 +08:00
|
|
|
|
/**
|
|
|
|
|
* 战前事件
|
|
|
|
|
*/
|
|
|
|
|
beforeBattle: MotaEvent;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 战后事件
|
|
|
|
|
*/
|
|
|
|
|
afterBattle: MotaEvent;
|
2024-04-26 21:24:12 +08:00
|
|
|
|
|
|
|
|
|
specialHalo?: number[];
|
2024-05-03 12:52:23 +08:00
|
|
|
|
translation?: [number, number];
|
2024-05-16 22:43:24 +08:00
|
|
|
|
|
|
|
|
|
/** 大怪物绑定贴图 */
|
|
|
|
|
bigImage?: ImageIds;
|
2022-12-27 23:31:14 +08:00
|
|
|
|
} & {
|
|
|
|
|
[P in PartialNumbericEnemyProperty]?: number;
|
|
|
|
|
} & {
|
2024-04-26 21:24:12 +08:00
|
|
|
|
[P in BooleanEnemyProperty]?: boolean;
|
2022-12-27 23:31:14 +08:00
|
|
|
|
} & 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;
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-27 23:31:14 +08:00
|
|
|
|
/**
|
|
|
|
|
* 怪物的特殊属性定义
|
|
|
|
|
*/
|
|
|
|
|
type EnemySpecialDeclaration = [
|
|
|
|
|
id: number,
|
2023-01-06 16:21:17 +08:00
|
|
|
|
name: string | ((enemy: EnemySpecialBase) => string),
|
|
|
|
|
desc: string | ((enemy: EnemySpecialBase) => string),
|
2022-12-27 23:31:14 +08:00
|
|
|
|
color: Color,
|
|
|
|
|
extra?: number
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
interface DamageString {
|
|
|
|
|
/**
|
|
|
|
|
* 伤害字符串
|
|
|
|
|
*/
|
|
|
|
|
damage: string;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 伤害颜色
|
|
|
|
|
*/
|
|
|
|
|
color: Color;
|
|
|
|
|
}
|
|
|
|
|
|
2023-01-06 16:21:17 +08:00
|
|
|
|
interface EnemySpecialBase {
|
|
|
|
|
/**
|
|
|
|
|
* 怪物特殊属性
|
|
|
|
|
*/
|
|
|
|
|
special: number[];
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-27 23:31:14 +08:00
|
|
|
|
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 {
|
2022-12-27 23:31:14 +08:00
|
|
|
|
/**
|
|
|
|
|
* 所有的怪物信息
|
|
|
|
|
*/
|
|
|
|
|
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或敌人对象
|
2022-12-27 23:31:14 +08:00
|
|
|
|
* @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;
|
|
|
|
|
}
|
2022-12-27 23:31:14 +08:00
|
|
|
|
|
|
|
|
|
declare const enemys: new () => Enemys;
|