Eustia/project/types/status.d.ts

964 lines
14 KiB
TypeScript
Raw Normal View History

/**
* 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>>;
}
interface DamageStatus {
/**
* v2优化下当前的偏移横坐标
*/
posX: number;
/**
* v2优化下当前的偏移纵坐标
*/
posY: number;
/**
*
*/
data: DamageStatusData[];
/**
*
*/
extraData: DamageStatusExtraData[];
}
interface DamageStatusData {
/**
*
*/
text: string;
/**
*
*/
px: number;
/**
*
*/
py: number;
/**
*
*/
color: Color;
}
interface DamageStatusExtraData extends DamageStatusData {
/**
*
*/
alpha: number;
}
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 {
/**
* css的background属性
*/
statusLeftBackground: string;
/**
* css的background属性
*/
statusTopBackground: string;
/**
* css的background属性
*/
toolsBackground: string;
/**
*
*/
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: false;
/**
*
*/
gameOver: false;
/**
* core.status.hero.atk就是当前勇士的攻击力数值
*/
hero: {};
/**
* floorId
*/
floorId: null;
/**
*
*/
maps: {
[P in FloorIds]: Floor<P>;
};
/**
* core.status.maps[core.status.floorId]
*/
thisMap: null;
/**
*
*/
bgmaps: Record<string, number[][]>;
/**
*
*/
fgmaps: Record<string, number[][]>;
/**
*
*/
mapBlockObjs: Record<string, Record<LocString, Block>>;
/**
*
*/
checkBlock: {};
/**
*
*/
damage: DeepReadonly<DamageStatus>;
/**
*
*/
lockControl: false;
/**
* 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<AllIdsOf<Exclude<AnimatableCls, 'autotile'>>>[];
/**
*
*/
floorAnimateObjs: FloorAnimate[];
/**
* BoxAnimate信息
*/
boxAnimateObjs: (BoxAnimate | BigImageBoxAnimate)[];
/**
*
*/
autotileAnimateObjs: Block<AllIdsOf<'autotile'>>[];
/**
* 便
*/
globalAnimateStatus: number;
/**
*
*/
animateObjs: AnimateObj[];
/**
*
*/
hard: string;
/**
*
*/
heroCenter: Record<'px' | 'py', number>;
/**
*
*/
holdingKeys: number[];
/**
* id转数字
*/
id2number: IdToNumber;
/**
*
*/
number2block: {
[P in AllNumbers]: Block<P>;
};
/**
*
*/
preview: ActionsPreview;
/**
*
*/
routeFolding: Record<`${LocString},${FirstCharOf<Dir>}`, RouteFolding>;
}
/**
*
*/
interface GameStatus extends InitGameStatus {
played: boolean;
gameOver: boolean;
floorId: FloorIds;
thisMap: ResolvedFloor;
checkBlock: Readonly<CheckBlockStatus>;
lockControl: boolean;
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: Loc;
/**
*
*/
flags: Flags;
/**
*
*/
followers: Follower[];
/**
*
*/
items: {
[P in Exclude<ItemCls, 'items'>]: Record<ItemIdOf<P>, number>;
};
}