大概修了

This commit is contained in:
草莓 2025-01-27 21:46:45 +08:00
parent 53e262dbd5
commit 732d9e5613
4 changed files with 2704 additions and 2534 deletions

View File

@ -305,6 +305,7 @@ events.prototype._gameOver_askRate = function (ending) {
events.prototype.restart = function () {
core.showStartAnimate();
core.playBgm(main.startBgm);
core.resumeBgm();
};
////// 询问是否需要重新开始 //////

View File

@ -630,6 +630,7 @@ loader.prototype._loadMusics = function () {
});
// 直接开始播放
core.playBgm(main.startBgm);
core.resumeBgm();
};
loader.prototype._loadSounds_sync = function () {

File diff suppressed because it is too large Load Diff

View File

@ -3849,8 +3849,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var mid = Math.floor((start + end) / 2);
if (mid - start > end - mid) mid--;
var nextInfo = core.enemys.getDamageInfo(
enemy,
{ atk: mid },
enemy, { atk: mid },
x,
y,
floorId
@ -3860,17 +3859,16 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
else start = mid + 1;
}
var nextInfo = core.enemys.getDamageInfo(
enemy,
{ atk: start },
enemy, { atk: start },
x,
y,
floorId
);
return nextInfo == null ||
typeof nextInfo == "number" ||
nextInfo.damage >= pre
? null
: [start, nextInfo.damage];
nextInfo.damage >= pre ?
null :
[start, nextInfo.damage];
};
var currAtk = start_atk;
while (true) {
@ -10713,7 +10711,23 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
};
//bgm相关复写
control.prototype.playBgm = (bgm, when) => {
if (!bgm || core.bgms.includes(bgm))
bgm = core.getMappedName(bgm)
if (main.mode != "play" || !bgm || !core.bgms.includes(bgm)) return
if (!core.musicStatus.bgmStatus) {
try {
core.musicStatus.playingBgm = bgm;
core.musicStatus.lastBgm = bgm;
bgmController.pause();
} catch (e) {
console.error(e);
}
return;
}
if (
bgmController.playingBgm == bgm && isNil(when)
) {
return;
}
bgmController.play(bgm, when);
core.setMusicBtn();
};
@ -15435,7 +15449,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
[x + w, y + h],
];
};
const inRect = ([x, y], [[sx, sy], [dx, dy]]) => {
const inRect = ([x, y], [
[sx, sy],
[dx, dy]
]) => {
return sx <= x && x <= dx && sy <= y && y <= dy;
};
const pos = [px, py];
@ -15616,9 +15633,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
config.defaultFont = config.font = config.font || globalAttribute.font;
config.time = config.time || 0;
config.letterSpacing =
config.letterSpacing == null
? textAttribute.letterSpacing || 0
: config.letterSpacing;
config.letterSpacing == null ?
textAttribute.letterSpacing || 0 :
config.letterSpacing;
config.index = 0;
config.currcolor = config.color;
@ -15672,9 +15689,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var block = config.blocks[config.index++];
if (block != null) {
// It works, why?
const scale = config.isHD
? devicePixelRatio * core.domStyle.scale
: 1;
const scale = config.isHD ?
devicePixelRatio * core.domStyle.scale :
1;
ctx.restore();
ctx.save(); //保存设置
if (core.domStyle.isVertical) {
@ -15777,17 +15794,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
const indexList = this.textList;
core.setTextAlign(logctx, "left");
for (
let i = (page - 1) * 6;
i <= Math.min(this.index, page * 6 - 1);
i++
let i = (page - 1) * 6; i <= Math.min(this.index, page * 6 - 1); i++
) {
const text = this.textList[i][1].replaceAll(
/(\\(d|e|f|g|i|n|r|b|c|t|z))(\[.*?\])?/g,
""
); //取消打字机
const name = this.textList[i][0]
? "【" + this.textList[i][0] + "】"
: "";
const name = this.textList[i][0] ?
"【" + this.textList[i][0] + "】" :
"";
if (name) {
core.fillBoldText1(
logctx,
@ -17113,6 +17128,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
music.height = 1248;
}
}
mousedown(px, py) {
//鼠标按下时
@ -17181,7 +17197,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
page = this.selection[0];
@ -17217,7 +17233,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
break;
@ -17247,7 +17263,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
break;
@ -17261,7 +17277,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
page = this.selection[0];
@ -17297,7 +17313,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
break;
@ -17327,7 +17343,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
break;
@ -17365,7 +17381,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
this.stop = false;
@ -17427,7 +17443,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
page = this.selection[0];
@ -17464,7 +17480,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
break;
@ -17495,7 +17511,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
break;
@ -17509,7 +17525,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
page = this.selection[0];
@ -17547,7 +17563,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
break;
@ -17577,7 +17593,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
break;
@ -17615,7 +17631,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
this.stop = false;
}
@ -18060,7 +18076,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.playBgm(
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
main.core.ui.music.selection[1]
]
], 0
);
const arr = main.core.ui.music.musicMx.flat(Infinity);