fix: fix some type

This commit is contained in:
ShakeFlower 2025-04-30 16:48:10 +08:00
parent b64daf19cd
commit ce8581f6e1
2 changed files with 82 additions and 44 deletions

View File

@ -462,7 +462,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var shopId = null; // 当前商店ID var shopId = null; // 当前商店ID
var type = 0; // 当前正在选中的类型0买入1卖出 var type = 0; // 当前正在选中的类型0买入1卖出
var selectItem = 0; // 当前正在选中的道具 /**
* @type {number | null}
*/
var selectItem = 0;
var selectCount = 0; // 当前已经选中的数量 var selectCount = 0; // 当前已经选中的数量
var page = 0; var page = 0;
var totalPage = 0; var totalPage = 0;
@ -1024,7 +1027,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
// ------ 前进/后退 // ------ 前进/后退
var o = direction == 'backward' ? -1 : 1; var o = direction == 'backward' ? -1 : 1;
if (direction == 'forward' || direction == 'backward') direction = core.getHeroLoc('direction'); if (direction == 'forward' || direction == 'backward') direction = core.getHeroLoc('direction');
var faceDirection = direction; /** @type {direction} */var faceDirection = direction;
if (direction == 'leftup' || direction == 'leftdown') faceDirection = 'left'; if (direction == 'leftup' || direction == 'leftdown') faceDirection = 'left';
if (direction == 'rightup' || direction == 'rightdown') faceDirection = 'right'; if (direction == 'rightup' || direction == 'rightdown') faceDirection = 'right';
core.setHeroLoc('direction', direction); core.setHeroLoc('direction', direction);
@ -1163,7 +1166,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var M = Object.defineProperty; var M = Object.defineProperty;
var E = (n, i, t) => i in n ? M(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t; var E = (n, i, t) => i in n ? M(n, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : n[i] = t;
var o = (n, i, t) => (E(n, typeof i != "symbol" ? i + "" : i, t), t); // var o = (n, i, t) => (E(n, typeof i != "symbol" ? i + "" : i, t), t);
let w = []; let w = [];
const k = (n) => { const k = (n) => {
for (const i of w) for (const i of w)
@ -1178,12 +1181,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}; };
requestAnimationFrame(k); requestAnimationFrame(k);
// I is Ticker /** Ticker类 */
class I { class I {
constructor() { constructor() {
o(this, "funcs", /* @__PURE__ */ new Set()); this.funcs = /* @__PURE__ */ new Set();
o(this, "status", "stop"); this.status = "stop";
o(this, "startTime", 0); this.startTime = 0;
this.status = "running", w.push(this), requestAnimationFrame((i) => this.startTime = i); this.status = "running", w.push(this), requestAnimationFrame((i) => this.startTime = i);
} }
add(i) { add(i) {
@ -1202,18 +1205,18 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this.status = "stop", w = w.filter((i) => i !== this); this.status = "stop", w = w.filter((i) => i !== this);
} }
} }
// F is AnimationBase /** AnimationBase类 */
class F { class F {
constructor() { constructor() {
o(this, "timing"); this.timing = Date.now;
o(this, "relation", "absolute"); this.relation = "absolute";
o(this, "easeTime", 0); this.easeTime = 0;
o(this, "applying", {}); this.applying = {};
o(this, "getTime", Date.now); this.getTime = Date.now;
const ticker = new I(); const ticker = new I();
o(this, "ticker", ticker); this.ticker = ticker;
o(this, "value", {}); this.value = {};
o(this, "listener", {}); this.listener = {};
this.timing = (i) => i; this.timing = (i) => i;
} }
async all() { async all() {
@ -1278,17 +1281,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
async function R(n) { async function R(n) {
return new Promise((i) => setTimeout(i, n)); return new Promise((i) => setTimeout(i, n));
} }
// j is Animation /** Animation类 */
class j extends F { class j extends F {
constructor() { constructor() {
super(); super();
o(this, "shakeTiming"); this.shakeTiming;
o(this, "path"); this.path;
o(this, "multiTiming"); this.multiTiming;
o(this, "value", {}); this.value = {};
o(this, "size", 1); this.size = 1;
o(this, "angle", 0); this.angle = 0;
o(this, "targetValue", { this.targetValue = {
system: { system: {
move: [0, 0], move: [0, 0],
moveAs: [0, 0], moveAs: [0, 0],
@ -1298,8 +1301,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"@@bind": [] "@@bind": []
}, },
custom: {} custom: {}
}); };
o(this, "animateFn", { this.animateFn = {
system: { system: {
move: [() => 0, () => 0], move: [() => 0, () => 0],
moveAs: () => 0, moveAs: () => 0,
@ -1309,12 +1312,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"@@bind": () => 0 "@@bind": () => 0
}, },
custom: {} custom: {}
}); };
o(this, "ox", 0); this.ox = 0;
o(this, "oy", 0); this.oy = 0;
o(this, "sx", 0); this.sx = 0;
o(this, "sy", 0); this.sy = 0;
o(this, "bindInfo", []); this.bindInfo = [];
this.timing = (t) => t, this.shakeTiming = (t) => t, this.multiTiming = (t) => [t, t], this.path = (t) => [t, t], this.applying = { this.timing = (t) => t, this.shakeTiming = (t) => t, this.multiTiming = (t) => [t, t], this.path = (t) => [t, t], this.applying = {
move: !1, move: !1,
scale: !1, scale: !1,
@ -1507,12 +1510,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
class O extends F { class O extends F {
constructor() { constructor() {
super(); super();
o(this, "now", {}); this.now = {};
o(this, "target", {}); this.target = {};
o(this, "transitionFn", {}); this.transitionFn = {};
o(this, "value"); this.value = undefined;
o(this, "handleSet", (t, e, s) => (this.transition(e, s), !0)); this.handleSet = (t, e, s) => (this.transition(e, s), !0);
o(this, "handleGet", (t, e) => this.now[e]); this.handleGet = (t, e) => this.now[e];
this.timing = (t) => t, this.value = new Proxy(this.target, { this.timing = (t) => t, this.value = new Proxy(this.target, {
set: this.handleSet, set: this.handleSet,
get: this.handleGet get: this.handleGet
@ -3595,7 +3598,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
compareMode = false; compareMode = false;
core.unregisterAction('onclick', 'bestEquip'); core.unregisterAction('onclick', 'bestEquip');
core.deleteCanvas(canvas); core.deleteCanvas(canvas);
res(); res(void 0);
} }
core.createCanvas(canvas, 0, 0, width, height, 160); core.createCanvas(canvas, 0, 0, width, height, 160);
@ -3677,7 +3680,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
function getEquipList(equipNum, equipOwned, equipNameList) { function getEquipList(equipNum, equipOwned, equipNameList) {
// equipNameList:计入切装计算的装备格子的名称列表,可重复 // equipNameList:计入切装计算的装备格子的名称列表,可重复
// 形如['武器', '武器', '盾牌'] // 形如['武器', '武器', '盾牌']
let equipList = Array(equipNameList.length).fill().map(() => new Set([null])); let equipList = Array(equipNameList.length).fill(void 0).map(() => new Set([null]));
//对每个装备孔展开 //对每个装备孔展开
for (let i = 0, l = equipNameList.length; i < l; i++) { for (let i = 0, l = equipNameList.length; i < l; i++) {

43
runtime.d.ts vendored
View File

@ -973,7 +973,9 @@ interface control {
/**@file events.js将处理所有和事件相关的操作。 */ /**@file events.js将处理所有和事件相关的操作。 */
interface events { interface events {
/** 根据难度设置flag:hard */ /** 根据难度设置flag:hard */
_startGame_setHard():void _startGame_setHard(): void
_eventMoveHero_moving(step: number, moveSteps: [direction | 'forward' | 'backward' |
'leftup' | 'leftdown' | 'rightup' | 'rightdown', number][]): boolean
/** /**
* *
@ -2332,6 +2334,7 @@ interface items {
interface ui { interface ui {
_buildFont(fontSize?: number | string, bold?: boolean, italic?: boolean, font?: string): string _buildFont(fontSize?: number | string, bold?: boolean, italic?: boolean, font?: string): string
_createUIEvent(): void _createUIEvent(): void
_drawBook_drawName(index: number, enemy: Enemy, top: number, left: number, width: number): void
/** /**
* contextnull * contextnull
@ -3012,19 +3015,49 @@ interface plugin {
initHeros(): void initHeros(): void
/** 多角色插件,切换到另一角色 */ /** 多角色插件,切换到另一角色 */
changeHero(toHeroId?: number): void changeHero(toHeroId?: number): void
[x: string]: () => void
} }
type CoreMixin = { type CoreMixin = {
firstData: { [x: string]: any } firstData: { [x: string]: any }
// 全塔属性开关 /** 全塔属性开关 */flags: { [flagName: string]: boolean }
flags: { [flagName: string]: boolean } /** 全局数值 */values:
{
/** 全局帧动画时间 */animateSpeed: number;
floorChangeTime: number;
/** 勇士移速 */moveSpeed: number;
statusCanvasRowsOnMobile: number;
redGem: number;
blueGem: number;
greenGem: number;
redPotion: number;
bluePotion: number;
yellowPotion: number;
greenPotion: number;
breakArmor: number;
counterAttack: number;
hatred: number;
lavaDamage: number;
poisonDamage: number;
purify: number;
weakValue: number;
}
/** 地图可视部分大小 */ /** 地图可视部分大小 */
readonly __SIZE__: number; readonly __SIZE__: number;
/** 地图像素 */ /** 地图像素 */
readonly __PIXELS__: number; readonly __PIXELS__: number;
/** 地图像素的一半 */ /** 地图像素的一半 */
readonly __HALF_SIZE__: number; readonly __HALF_SIZE__: number;
/** 地图长度仅2.10有效 */
readonly _PX_: number;
/** 地图宽度仅2.10有效 */
readonly _PY_: number;
/** 游戏素材 */ /** 游戏素材 */
readonly material: { readonly material: {
readonly animates: { [key: string]: Animate }, readonly animates: { [key: string]: Animate },
@ -3214,6 +3247,8 @@ interface Main {
} }
declare let main: Main declare let main: Main
declare let core: CoreMixin declare let core: CoreMixin
declare let flags: { [x: string]: any } declare let flags: { [x: string]: any }
declare let hero: CoreMixin['status']['hero'] declare let hero: CoreMixin['status']['hero']
declare let editor: editor declare let editor: editor