MC_survival/status.d.ts

975 lines
15 KiB
TypeScript
Raw Permalink Normal View History

2025-01-14 12:27:52 +08:00
/**
* buff缓存
*/
interface EnemyBuffCache {
/**
*
*/
hp_buff: number;
/**
*
*/
atk_buff: number;
/**
*
*/
def_buff: number;
/**
*
*/
guards: [number, number, string][];
}
interface CheckBlockStatus {
/**
*
*/
ambush: Record<LocString, [number, number, string, Dir]>;
/**
*
*/
repulse: Record<LocString, [number, number, string, Dir]>;
/**
* 0
*/
damage: Record<LocString, number>;
/**
*
*/
needCache: boolean;
/**
*
*/
type: Record<LocString, Record<string, number>>;
/**
*
*/
cache: Record<string, DeepReadonly<EnemyBuffCache>>;
/**
*
*/
halo: Record<LocString, string[]>;
}
interface DamageStatus {
/**
* v2优化下当前的偏移横坐标
*/
posX: number;
/**
* v2优化下当前的偏移纵坐标
*/
posY: number;
/**
*
*/
data: DamageStatusData[];
/**
*
*/
extraData: DamageStatusExtraData[];
/**
*
*/
dir: DamageDirData[];
}
interface DamageStatusData {
/**
*
*/
text: string;
/**
*
*/
px: number;
/**
*
*/
py: number;
/**
*
*/
color: Color;
}
interface DamageStatusExtraData extends DamageStatusData {
/**
*
*/
alpha: number;
}
interface DamageDirData {
x: number;
y: number;
dir: Dir;
color: Color;
}
interface AutomaticRouteStatus {
/**
*
*/
autoHeroMove: boolean;
/**
*
*/
autoStep: number;
/**
*
*/
movedStep: number;
/**
*
*/
destStep: number;
/**
*
*/
destX: number;
/**
*
*/
destY: number;
/**
*
*/
offsetX: number;
/**
*
*/
offsetY: number;
/**
* 线
*/
autoStepRoutes: AutoStep[];
/**
* 线
*/
moveStepBeforeStop: AutoStep[];
/**
*
*/
lastDirection: Dir;
/**
* (E时的界面)
*/
cursorX: number;
/**
* (E时的界面)
*/
cursorY: number;
/**
*
*/
moveDirectly: boolean;
}
interface AutoStep {
/**
*
*/
step: number;
/**
*
*/
direction: Dir;
}
interface ReplaySaveBase {
/**
*
*/
toReplay: string[];
/**
*
*/
totalList: string[];
/**
* 退
*/
steps: number;
}
interface ReplayStatus extends ReplaySaveBase {
/**
* core.isReplaying()
*/
replaying: boolean;
/**
*
*/
pausing: boolean;
/**
*
*/
animate: boolean;
/**
*
*/
failed: boolean;
/**
*
*/
speed: number;
/**
* 退
*/
save: ReplaySave[];
}
interface ReplaySave {
/**
* 退
*/
data: Save;
/**
* 退
*/
replay: ReplaySaveBase;
}
interface TextAttribute {
/**
*
*/
position: TextPosition;
/**
*
*/
align: 'left' | 'center' | 'right';
/**
*
*/
offset: number;
/**
*
*/
title: RGBArray;
/**
*
*/
background: RGBArray | ImageIds;
/**
*
*/
text: RGBArray;
/**
*
*/
titlefont: number;
/**
*
*/
textfont: number;
/**
*
*/
bold: boolean;
/**
*
*/
time: number;
/**
*
*/
letterSpacing: number;
/**
*
*/
animateTime: number;
/**
*
*/
lineHeight: number;
}
interface StatusStyle {
/**
*
*/
borderColor: Color;
/**
*
*/
statusBarColor: Color;
/**
* css字符串
*/
floorChangingStyle: string;
/**
*
*/
font: string;
}
interface GlobalAttribute extends StatusStyle {
/**
*
*/
equipName: string[];
}
interface FloorAnimate {
/**
*
*/
canvas: 'bg' | 'fg';
/**
*
*/
name: ImageIds;
/**
*
*/
x: number;
/**
*
*/
y: number;
/**
*
*/
sx?: number;
/**
*
*/
sy?: number;
/**
*
*/
w?: number;
/**
*
*/
h?: number;
/**
*
*/
frame?: number;
/**
*
*/
reverse?: ':x' | ':y' | ':o';
/**
*
*/
disable?: boolean;
}
interface BoxAnimate {
/**
*
*/
animate: number;
/**
*
*/
bgHeight: number;
/**
*
*/
bgWidth: number;
/**
*
*/
bgx: number;
/**
*
*/
bgy: number;
/**
*
*/
height: 32 | 48;
/**
*
*/
img: HTMLImageElement;
/**
*
*/
pos: number;
/**
*
*/
x: number;
/**
*
*/
y: number;
}
interface BigImageBoxAnimate {
/**
*
*/
bigImage: HTMLImageElement;
/**
*
*/
face: Dir;
/**
*
*/
centerX: number;
/**
*
*/
centerY: number;
/**
*
*/
max_width: number;
/**
*
*/
ctx: CtxRefer;
}
interface AnimateObj {
/**
*
*/
name: AnimationIds;
/**
*
*/
id: number;
/**
*
*/
animate: Animate;
/**
*
*/
centerX: number;
/**
*
*/
centerY: number;
/**
*
*/
index: number;
/**
*
*/
callback: () => void;
}
interface ActionsPreview {
/**
*
*/
dragging: boolean;
/**
*
*/
enabled: boolean;
/**
*
*/
prepareDragging: boolean;
/**
*
*/
px: number;
/**
*
*/
py: number;
}
interface RouteFolding {
/**
*
*/
hero: Omit<SelectType<HeroStatus, number>, 'steps'>;
/**
*
*/
length: number;
}
/**
*
*/
interface InitGameStatus {
/**
*
*/
played: boolean;
/**
*
*/
gameOver: boolean;
/**
*
*/
maps: {
[P in FloorIds]: Floor<P>;
};
/**
*
*/
bgmaps: Record<FloorIds, number[][]>;
/**
*
*/
fgmaps: Record<FloorIds, number[][]>;
/**
*
*/
mapBlockObjs: Record<FloorIds, Record<LocString, Block>>;
/**
*
*/
damage: DamageStatus;
/**
*
*/
lockControl: boolean;
/**
* libs翻西西
*/
heroMoving: number;
/**
*
*/
heroStop: boolean;
/**
*
*/
automaticRoute: DeepReadonly<AutomaticRouteStatus>;
/**
*
*/
downTime: number;
/**
* ctrl键是否倍按下
*/
ctrlDown: boolean;
/**
*
*/
route: string[];
/**
*
*/
replay: DeepReadonly<ReplayStatus>;
/**
*
*/
shops: Record<string, ShopEventOf<keyof ShopEventMap>>;
/**
*
*/
event: EventStatusOf;
/**
*
*/
autoEvents: DeepReadonly<AutoEvent[]>;
/**
*
*/
textAttribute: TextAttribute;
/**
*
*/
globalAttribute: GlobalAttribute;
/**
*
*/
curtainColor: Color;
/**
*
*/
globalAnimateObjs: Block<
IdToNumber[AllIdsOf<Exclude<AnimatableCls, 'autotile'>>]
>[];
/**
*
*/
floorAnimateObjs: FloorAnimate[];
/**
* BoxAnimate信息
*/
boxAnimateObjs: (BoxAnimate | BigImageBoxAnimate)[];
/**
*
*/
autotileAnimateObjs: Block<IdToNumber[AllIdsOf<'autotile'>]>[];
/**
* 便
*/
globalAnimateStatus: number;
/**
*
*/
animateObjs: AnimateObj[];
/**
*
*/
hard: string;
/**
*
*/
heroCenter: Record<'px' | 'py', number>;
/**
*
*/
holdingKeys: number[];
/**
* id转数字
*/
id2number: IdToNumber;
/**
*
*/
number2block: {
[P in keyof NumberToId]: Block<P>;
};
/**
*
*/
preview: ActionsPreview;
/**
*
*/
routeFolding: Record<`${LocString},${FirstCharOf<Dir>}`, RouteFolding>;
}
/**
*
*/
interface GameStatus extends InitGameStatus {
/**
* floorId
*/
floorId: FloorIds;
/**
* core.status.maps[core.status.floorId]
*/
thisMap: Floor;
/**
*
*/
checkBlock: Readonly<CheckBlockStatus>;
/**
* core.status.hero.atk就是当前勇士的攻击力数值
*/
hero: HeroStatus;
}
interface Follower {
/**
* id
*/
name: ImageIds;
}
interface HeroStatistics {
/**
*
*/
battle: number;
/**
*
*/
battleDamage: number;
/**
*
*/
currentTime: number;
/**
*
*/
exp: number;
/**
*
*/
extraDamage: number;
/**
*
*/
hp: number;
/**
*
*/
ignoreSteps: number;
/**
*
*/
money: number;
/**
*
*/
moveDirectly: number;
/**
*
*/
poisonDamage: number;
/**
*
*/
startTime: number;
/**
*
*/
totalTime: number;
}
/**
*
*/
interface HeroStatus {
/**
*
*/
animate: boolean;
/**
*
*/
hp: number;
/**
*
*/
hpmax: number;
/**
*
*/
atk: number;
/**
*
*/
def: number;
/**
*
*/
mdef: number;
/**
*
*/
lv: number;
/**
*
*/
exp: number;
/**
*
*/
money: number;
/**
*
*/
mana: number;
/**
*
*/
manamax: number;
/**
*
*/
name: string;
/**
*
*/
steps: number;
/**
*
*/
image: ImageIds;
/**
*
*/
equipment: ItemIdOf<'equips'>[];
/**
*
*/
loc: DiredLoc;
/**
*
*/
flags: Flags;
/**
*
*/
followers: Follower[];
statistics: HeroStatistics;
/**
*
*/
items: {
[P in Exclude<ItemCls, 'items'>]: Record<ItemIdOf<P>, number>;
};
/**
*
*/
special: {
num: number[];
last: number[];
[k: string]: any;
};
x?: number;
y?: number;
floorId?: FloorIds;
}