大概修了
This commit is contained in:
parent
53e262dbd5
commit
732d9e5613
@ -305,6 +305,7 @@ events.prototype._gameOver_askRate = function (ending) {
|
|||||||
events.prototype.restart = function () {
|
events.prototype.restart = function () {
|
||||||
core.showStartAnimate();
|
core.showStartAnimate();
|
||||||
core.playBgm(main.startBgm);
|
core.playBgm(main.startBgm);
|
||||||
|
core.resumeBgm();
|
||||||
};
|
};
|
||||||
|
|
||||||
////// 询问是否需要重新开始 //////
|
////// 询问是否需要重新开始 //////
|
||||||
|
@ -630,6 +630,7 @@ loader.prototype._loadMusics = function () {
|
|||||||
});
|
});
|
||||||
// 直接开始播放
|
// 直接开始播放
|
||||||
core.playBgm(main.startBgm);
|
core.playBgm(main.startBgm);
|
||||||
|
core.resumeBgm();
|
||||||
};
|
};
|
||||||
|
|
||||||
loader.prototype._loadSounds_sync = function () {
|
loader.prototype._loadSounds_sync = function () {
|
||||||
|
938
libs/utils.js
938
libs/utils.js
File diff suppressed because it is too large
Load Diff
@ -3849,8 +3849,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
var mid = Math.floor((start + end) / 2);
|
var mid = Math.floor((start + end) / 2);
|
||||||
if (mid - start > end - mid) mid--;
|
if (mid - start > end - mid) mid--;
|
||||||
var nextInfo = core.enemys.getDamageInfo(
|
var nextInfo = core.enemys.getDamageInfo(
|
||||||
enemy,
|
enemy, { atk: mid },
|
||||||
{ atk: mid },
|
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
floorId
|
floorId
|
||||||
@ -3860,17 +3859,16 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
else start = mid + 1;
|
else start = mid + 1;
|
||||||
}
|
}
|
||||||
var nextInfo = core.enemys.getDamageInfo(
|
var nextInfo = core.enemys.getDamageInfo(
|
||||||
enemy,
|
enemy, { atk: start },
|
||||||
{ atk: start },
|
|
||||||
x,
|
x,
|
||||||
y,
|
y,
|
||||||
floorId
|
floorId
|
||||||
);
|
);
|
||||||
return nextInfo == null ||
|
return nextInfo == null ||
|
||||||
typeof nextInfo == "number" ||
|
typeof nextInfo == "number" ||
|
||||||
nextInfo.damage >= pre
|
nextInfo.damage >= pre ?
|
||||||
? null
|
null :
|
||||||
: [start, nextInfo.damage];
|
[start, nextInfo.damage];
|
||||||
};
|
};
|
||||||
var currAtk = start_atk;
|
var currAtk = start_atk;
|
||||||
while (true) {
|
while (true) {
|
||||||
@ -4300,7 +4298,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
}
|
}
|
||||||
// 仿RM窗口皮肤 ↑
|
// 仿RM窗口皮肤 ↑
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
"额外信息": function () {
|
"额外信息": function () {
|
||||||
/* 宝石血瓶左下角显示数值
|
/* 宝石血瓶左下角显示数值
|
||||||
* 注意!!!不要在道具属性中直接操作flags,使用core.status.hero.flags或core.setFlag系列函数代替!
|
* 注意!!!不要在道具属性中直接操作flags,使用core.status.hero.flags或core.setFlag系列函数代替!
|
||||||
@ -10713,7 +10711,23 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
};
|
};
|
||||||
//bgm相关复写
|
//bgm相关复写
|
||||||
control.prototype.playBgm = (bgm, when) => {
|
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);
|
bgmController.play(bgm, when);
|
||||||
core.setMusicBtn();
|
core.setMusicBtn();
|
||||||
};
|
};
|
||||||
@ -15435,7 +15449,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
[x + w, y + h],
|
[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;
|
return sx <= x && x <= dx && sy <= y && y <= dy;
|
||||||
};
|
};
|
||||||
const pos = [px, py];
|
const pos = [px, py];
|
||||||
@ -15616,9 +15633,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
config.defaultFont = config.font = config.font || globalAttribute.font;
|
config.defaultFont = config.font = config.font || globalAttribute.font;
|
||||||
config.time = config.time || 0;
|
config.time = config.time || 0;
|
||||||
config.letterSpacing =
|
config.letterSpacing =
|
||||||
config.letterSpacing == null
|
config.letterSpacing == null ?
|
||||||
? textAttribute.letterSpacing || 0
|
textAttribute.letterSpacing || 0 :
|
||||||
: config.letterSpacing;
|
config.letterSpacing;
|
||||||
|
|
||||||
config.index = 0;
|
config.index = 0;
|
||||||
config.currcolor = config.color;
|
config.currcolor = config.color;
|
||||||
@ -15672,9 +15689,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
var block = config.blocks[config.index++];
|
var block = config.blocks[config.index++];
|
||||||
if (block != null) {
|
if (block != null) {
|
||||||
// It works, why?
|
// It works, why?
|
||||||
const scale = config.isHD
|
const scale = config.isHD ?
|
||||||
? devicePixelRatio * core.domStyle.scale
|
devicePixelRatio * core.domStyle.scale :
|
||||||
: 1;
|
1;
|
||||||
ctx.restore();
|
ctx.restore();
|
||||||
ctx.save(); //保存设置
|
ctx.save(); //保存设置
|
||||||
if (core.domStyle.isVertical) {
|
if (core.domStyle.isVertical) {
|
||||||
@ -15777,17 +15794,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
const indexList = this.textList;
|
const indexList = this.textList;
|
||||||
core.setTextAlign(logctx, "left");
|
core.setTextAlign(logctx, "left");
|
||||||
for (
|
for (
|
||||||
let i = (page - 1) * 6;
|
let i = (page - 1) * 6; i <= Math.min(this.index, page * 6 - 1); i++
|
||||||
i <= Math.min(this.index, page * 6 - 1);
|
|
||||||
i++
|
|
||||||
) {
|
) {
|
||||||
const text = this.textList[i][1].replaceAll(
|
const text = this.textList[i][1].replaceAll(
|
||||||
/(\\(d|e|f|g|i|n|r|b|c|t|z))(\[.*?\])?/g,
|
/(\\(d|e|f|g|i|n|r|b|c|t|z))(\[.*?\])?/g,
|
||||||
""
|
""
|
||||||
); //取消打字机
|
); //取消打字机
|
||||||
const name = this.textList[i][0]
|
const name = this.textList[i][0] ?
|
||||||
? "【" + this.textList[i][0] + "】"
|
"【" + this.textList[i][0] + "】" :
|
||||||
: "";
|
"";
|
||||||
if (name) {
|
if (name) {
|
||||||
core.fillBoldText1(
|
core.fillBoldText1(
|
||||||
logctx,
|
logctx,
|
||||||
@ -16139,7 +16154,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
core.ui.cgText = new cgText();
|
core.ui.cgText = new cgText();
|
||||||
},
|
},
|
||||||
"旁白": function () {
|
"旁白": function () {
|
||||||
// 在此增加新插件
|
// 在此增加新插件
|
||||||
const over = document.createElement("canvas"); //over画布设置
|
const over = document.createElement("canvas"); //over画布设置
|
||||||
@ -17113,6 +17128,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
music.height = 1248;
|
music.height = 1248;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mousedown(px, py) {
|
mousedown(px, py) {
|
||||||
//鼠标按下时
|
//鼠标按下时
|
||||||
|
|
||||||
@ -17181,7 +17197,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
page = this.selection[0];
|
page = this.selection[0];
|
||||||
@ -17217,7 +17233,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -17247,7 +17263,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -17261,7 +17277,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
page = this.selection[0];
|
page = this.selection[0];
|
||||||
@ -17297,7 +17313,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -17327,7 +17343,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -17365,7 +17381,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
this.stop = false;
|
this.stop = false;
|
||||||
@ -17427,7 +17443,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
page = this.selection[0];
|
page = this.selection[0];
|
||||||
@ -17464,7 +17480,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -17495,7 +17511,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -17509,7 +17525,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
page = this.selection[0];
|
page = this.selection[0];
|
||||||
@ -17547,7 +17563,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -17577,7 +17593,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -17615,7 +17631,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
this.stop = false;
|
this.stop = false;
|
||||||
}
|
}
|
||||||
@ -18060,7 +18076,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
|
|||||||
core.playBgm(
|
core.playBgm(
|
||||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||||
main.core.ui.music.selection[1]
|
main.core.ui.music.selection[1]
|
||||||
]
|
], 0
|
||||||
);
|
);
|
||||||
|
|
||||||
const arr = main.core.ui.music.musicMx.flat(Infinity);
|
const arr = main.core.ui.music.musicMx.flat(Infinity);
|
||||||
|
Loading…
Reference in New Issue
Block a user