op制作完毕/cg事件重制

This commit is contained in:
草莓 2024-12-30 20:44:53 +08:00
parent 74e903905e
commit cd6d511175
8 changed files with 2576 additions and 2450 deletions

View File

@ -1 +1 @@
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=

View File

@ -853,6 +853,7 @@ action
| wait_s | wait_s
| waitAsync_s | waitAsync_s
| stopAsync_s | stopAsync_s
| op_s
| battle_s | battle_s
| battle_1_s | battle_1_s
| openDoor_s | openDoor_s
@ -3295,6 +3296,17 @@ var code = '{"type": "stopAsync"},\n';
return code; return code;
*/; */;
op_s
: '播放op长按2秒可跳过' BGNL Newline
/* op_s
tooltip : op: 开始播放op
helpUrl : /_docs/#/instruction
colour : this.soundColor
var code = '{"type": "op"},\n';
return code;
*/;
callBook_s callBook_s
: '呼出怪物手册' : '呼出怪物手册'

View File

@ -1955,6 +1955,9 @@ MotaActionParser = function () {
case "stopAsync": // 立刻停止所有异步事件 case "stopAsync": // 立刻停止所有异步事件
this.next = MotaActionBlocks["stopAsync_s"].xmlText([this.next]); this.next = MotaActionBlocks["stopAsync_s"].xmlText([this.next]);
break; break;
case "op": // 立刻停止所有异步事件
this.next = MotaActionBlocks["op_s"].xmlText([this.next]);
break;
case "drawWarning": case "drawWarning":
this.next = MotaActionBlocks["drawWarning_s"].xmlText([ this.next = MotaActionBlocks["drawWarning_s"].xmlText([
data.x, data.x,

BIN
project/bgms/op.mp3 Normal file

Binary file not shown.

View File

@ -305,6 +305,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"Asphodelus_Ceui.mp3", "Asphodelus_Ceui.mp3",
"Blind_Alley.mp3", "Blind_Alley.mp3",
"Crawler.mp3", "Crawler.mp3",
"op.mp3",
"theme.mp3" "theme.mp3"
], ],
"sounds": [ "sounds": [

View File

@ -29,7 +29,7 @@ main.floors.street01=
"5,10": [ "5,10": [
{ {
"type": "insert", "type": "insert",
"name": "chapter01" "name": "chapter0"
} }
], ],
"6,11": [ "6,11": [
@ -40,88 +40,7 @@ main.floors.street01=
], ],
"4,11": [ "4,11": [
{ {
"type": "overlist", "type": "op"
"image": "bg_5043.png",
"memory": true,
"hidetime": 30,
"list": [
{
"text": "试试",
"sound": "",
"time": 30,
"textColor": [
255,
255,
255,
1
],
"boldColor": [
0,
0,
0,
1
],
"font": "bold 48px Verdana",
"frame": 0
},
{
"text": "这可以",
"sound": "",
"time": 50,
"textColor": [
255,
255,
255,
1
],
"boldColor": [
0,
0,
0,
1
],
"font": "bold 48px Verdana",
"frame": 0
},
{
"text": "变速的脏翅膀对话",
"sound": "",
"time": 80,
"textColor": [
255,
255,
255,
1
],
"boldColor": [
0,
0,
0,
1
],
"font": "bold 48px Verdana",
"frame": 0
},
{
"text": "牛逼",
"sound": "",
"time": 20,
"textColor": [
255,
255,
255,
1
],
"boldColor": [
0,
0,
0,
1
],
"font": "bold 48px Verdana",
"frame": 0
}
]
} }
] ]
}, },

View File

@ -171,8 +171,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.removeFlag("__events__"); core.removeFlag("__events__");
} else { } else {
// 每次抵达楼层执行的事件 // 每次抵达楼层执行的事件
core.ui.statusBar._update_map(); //更新小地图缓存
core.insertAction(core.floors[floorId].eachArrive); core.insertAction(core.floors[floorId].eachArrive);
core.ui.statusBar._update_map()
// 首次抵达楼层时执行的事件(后插入,先执行) // 首次抵达楼层时执行的事件(后插入,先执行)
if (!core.hasVisitedFloor(floorId)) { if (!core.hasVisitedFloor(floorId)) {
core.insertAction(core.floors[floorId].firstArrive); core.insertAction(core.floors[floorId].firstArrive);
@ -1166,7 +1166,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.updateStatus() core.updateStatus()
// 更新状态栏 // 更新状态栏
core.ui.statusBar.update(); core.ui.statusBar.update();
// 更新阻激夹域的伤害值 // 更新阻激夹域的伤害值
core.updateCheckBlock(); core.updateCheckBlock();
// 更新全地图显伤 // 更新全地图显伤

View File

@ -104,12 +104,20 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}); });
core.registerEvent("changebg", function (data) { core.registerEvent("changebg", function (data) {
if (!main.replayChecking && !core.isReplaying()) { if (!main.replayChecking && !core.isReplaying()) {
core.changebg(data.img1, data.memory1, data.img2, data.memory2, data.time, data.style); core.changebg(
data.img1,
data.memory1,
data.img2,
data.memory2,
data.time,
data.style
);
} else { } else {
core.doAction(); core.doAction();
} }
}); });
core.registerEvent("overlist", function (data) { core.registerEvent("overlist", function (data) {
if (!main.replayChecking && !core.isReplaying()) {
core.overlist( core.overlist(
data.image, data.image,
data.memory, data.memory,
@ -122,10 +130,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
boldColor: "#000000", boldColor: "#000000",
font: "bold 48px Verdana", font: "bold 48px Verdana",
frame: 0, frame: 0,
}] }, ]
) );
} else { core.doAction(); }
});
core.registerEvent('op', function (data) {
if (!main.replayChecking && !core.isReplaying()) {
core.openvideo()
} else {
core.doAction()
}
}) })
core.registerEvent("cgtext", function (data) { core.registerEvent("cgtext", function (data) {
if (!main.replayChecking && !core.isReplaying()) { if (!main.replayChecking && !core.isReplaying()) {
core.ui.cgText.image = data.bg; core.ui.cgText.image = data.bg;
@ -2530,9 +2545,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
(obj.clientWidth - obj.totalWidth) / 2 + "px"; (obj.clientWidth - obj.totalWidth) / 2 + "px";
core.dom.musicBtn.style.bottom = core.dom.musicBtn.style.bottom =
(obj.clientHeight - obj.totalHeight) / 2 - 27 + "px"; (obj.clientHeight - obj.totalHeight) / 2 - 27 + "px";
let startBackground = core.domStyle.isVertical let startBackground = core.domStyle.isVertical ?
? main.styles.startVerticalBackground || main.styles.startBackground main.styles.startVerticalBackground || main.styles.startBackground :
: main.styles.startBackground; main.styles.startBackground;
if (main.dom.startBackground.getAttribute("__src__") != startBackground) { if (main.dom.startBackground.getAttribute("__src__") != startBackground) {
main.dom.startBackground.setAttribute("__src__", startBackground); main.dom.startBackground.setAttribute("__src__", startBackground);
main.dom.startBackground.src = startBackground; main.dom.startBackground.src = startBackground;
@ -2556,13 +2571,48 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
main.dom.outerBackground.style.height = obj.totalHeight + "px"; main.dom.outerBackground.style.height = obj.totalHeight + "px";
main.dom.outerUI.style.width = obj.totalWidth + "px"; main.dom.outerUI.style.width = obj.totalWidth + "px";
main.dom.outerUI.style.height = obj.totalHeight + "px"; main.dom.outerUI.style.height = obj.totalHeight + "px";
if (main.dom.CGUI) {
main.dom.CGUI.style.width = obj.totalWidth + 3 + "px"; main.dom.CGUI.style.width = obj.totalWidth + 3 + "px";
main.dom.CGUI.style.height = obj.totalHeight + 3 + "px"; main.dom.CGUI.style.height = obj.totalHeight + 3 + "px";
}
if (main.dom.cgText) {
main.dom.cgText.style.width = obj.totalWidth + 3 + "px"; main.dom.cgText.style.width = obj.totalWidth + 3 + "px";
main.dom.cgText.style.height = obj.totalHeight + 3 + "px"; main.dom.cgText.style.height = obj.totalHeight + 3 + "px";
}
if (main.dom.over) {
main.dom.over.style.width = obj.totalWidth + 3 + "px"; main.dom.over.style.width = obj.totalWidth + 3 + "px";
main.dom.over.style.height = obj.totalHeight + 3 + "px"; main.dom.over.style.height = obj.totalHeight + 3 + "px";
}
if (main.dom.video) {
main.dom.video.style.width = obj.totalWidth + 3 + "px";
main.dom.video.style.height = obj.totalHeight + 3 + "px";
if (core.domStyle.isVertical)
main.dom.video.style.width = obj.totalHeight + 3 + "px";
if (core.domStyle.isVertical)
main.dom.video.style.height = obj.totalWidth + 3 + "px";
main.dom.video.style.top = "50%";
main.dom.video.style.left = "50%";
main.dom.video.style.transform = "translate(-50%,-50%)";
if (core.domStyle.isVertical)
main.dom.video.style.transform = "translate(-50%,-50%) rotate(90deg)";
}
if (main.dom.video1) {
main.dom.video1.style.width = obj.totalWidth + 3 + "px";
main.dom.video1.style.height = obj.totalHeight + 3 + "px";
if (core.domStyle.isVertical)
main.dom.video1.style.width = obj.totalHeight + 3 + "px";
if (core.domStyle.isVertical)
main.dom.video1.style.height = obj.totalWidth + 3 + "px";
main.dom.video1.style.top = "50%";
main.dom.video1.style.left = "50%";
main.dom.video1.style.transform = "translate(-50%,-50%)";
if (core.domStyle.isVertical)
main.dom.video1.style.transform = "translate(-50%,-50%) rotate(90deg)";
}
const innerSize = obj.canvasWidth * core.domStyle.scale + "px"; const innerSize = obj.canvasWidth * core.domStyle.scale + "px";
for (let i = 0; i < core.dom.gameCanvas.length; ++i) for (let i = 0; i < core.dom.gameCanvas.length; ++i)
core.dom.gameCanvas[i].style.width = core.dom.gameCanvas[ core.dom.gameCanvas[i].style.width = core.dom.gameCanvas[
@ -2578,9 +2628,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
obj.gameDrawBox.left * core.domStyle.scale + "px"; obj.gameDrawBox.left * core.domStyle.scale + "px";
// resize bigmap // resize bigmap
core.bigmap.canvas.forEach(function (cn) { core.bigmap.canvas.forEach(function (cn) {
const ratio = core.canvas[cn].canvas.hasAttribute("isHD") const ratio = core.canvas[cn].canvas.hasAttribute("isHD") ?
? core.domStyle.ratio core.domStyle.ratio :
: 1; 1;
core.canvas[cn].canvas.style.width = core.canvas[cn].canvas.style.width =
(innerSize / ratio) * core.domStyle.scale + "px"; (innerSize / ratio) * core.domStyle.scale + "px";
core.canvas[cn].canvas.style.height = core.canvas[cn].canvas.style.height =
@ -2607,24 +2657,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}; };
const bgctx = main.dom.outerBackground.getContext("2d"); const bgctx = main.dom.outerBackground.getContext("2d");
const uictx = main.dom.outerUI.getContext("2d"); const uictx = main.dom.outerUI.getContext("2d");
const floor = document.createElement("canvas");
const floorVertical = document.createElement("canvas");
floor.width = GAMEVIEW_WIDTH;
floor.height = GAMEVIEW_HEIGHT;
floorVertical.width = GAMEVIEW_WIDTH_VERTICAL;
floorVertical.height = GAMEVIEW_HEIGHT_VERTICAL;
const floorctx = floor.getContext("2d");
const floorVerticalctx = floorVertical.getContext("2d");
core.registerAnimationFrame("lightFloor", true, function () { core.registerAnimationFrame("lightFloor", true, function () {
globalAlphafloor += globalAlphafloorStatus; globalAlphafloor += globalAlphafloorStatus;
if (globalAlphafloor === 100) globalAlphafloorStatus = -4; if (globalAlphafloor === 100) globalAlphafloorStatus = -4;
if (globalAlphafloor === 0) globalAlphafloorStatus = 4; if (globalAlphafloor === 0) globalAlphafloorStatus = 4;
if (core.status.event.id === "viewMaps") {
core.ui.statusBar._update_map(core.status.event.data.floorId);
} else {
core.ui.statusBar._update_map();
}
if (core.domStyle.isVertical) { if (core.domStyle.isVertical) {
core.clearMap( core.clearMap(
uictx, uictx,
@ -2633,7 +2670,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
340, 340,
360 360
); );
uictx.drawImage(floorVertical, 0, 0); if (core.status.event.id === "viewMaps") {
core.ui.statusBar._update_map(core.status.event.data.floorId);
} else {
core.ui.statusBar._update_map();
}
uictx.globalAlpha = globalAlphafloor / 100; uictx.globalAlpha = globalAlphafloor / 100;
core.drawImage( core.drawImage(
uictx, uictx,
@ -2644,7 +2686,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
uictx.globalAlpha = 1; uictx.globalAlpha = 1;
} else { } else {
core.clearMap(uictx, MAP_BLOCK_LEFT, MAP_BLOCK_TOP, 340, 360); core.clearMap(uictx, MAP_BLOCK_LEFT, MAP_BLOCK_TOP, 340, 360);
uictx.drawImage(floor, 0, 0); if (core.status.event.id === "viewMaps") {
core.ui.statusBar._update_map(core.status.event.data.floorId);
} else {
core.ui.statusBar._update_map();
}
uictx.globalAlpha = globalAlphafloor / 100; uictx.globalAlpha = globalAlphafloor / 100;
core.drawImage( core.drawImage(
uictx, uictx,
@ -2667,12 +2713,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
const isVertical = clientHeight > clientWidth; const isVertical = clientHeight > clientWidth;
core.domStyle.isVertical = isVertical; core.domStyle.isVertical = isVertical;
const totalWidth = isVertical const totalWidth = isVertical ?
? GAMEVIEW_WIDTH_VERTICAL / 3 GAMEVIEW_WIDTH_VERTICAL / 3 :
: GAMEVIEW_WIDTH / 3, GAMEVIEW_WIDTH / 3,
totalHeight = isVertical totalHeight = isVertical ?
? GAMEVIEW_HEIGHT_VERTICAL / 3 GAMEVIEW_HEIGHT_VERTICAL / 3 :
: GAMEVIEW_HEIGHT / 3; GAMEVIEW_HEIGHT / 3;
const maxRatio = Math.min( const maxRatio = Math.min(
clientWidth / totalWidth, clientWidth / totalWidth,
@ -2700,12 +2746,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
const totalWidthScaled = totalWidth * core.domStyle.scale, const totalWidthScaled = totalWidth * core.domStyle.scale,
totalHeightScaled = totalHeight * core.domStyle.scale; totalHeightScaled = totalHeight * core.domStyle.scale;
const gameDrawBox = isVertical const gameDrawBox = isVertical ? {
? {
left: BORDER_WIDTH / 3, left: BORDER_WIDTH / 3,
top: BAR_HEIGHT_VERTICAL / 3 + BORDER_HEIGHT / 3, top: BAR_HEIGHT_VERTICAL / 3 + BORDER_HEIGHT / 3,
} } : { left: BAR_WIDTH / 3 + BORDER_WIDTH / 3, top: BORDER_HEIGHT / 3 };
: { left: BAR_WIDTH / 3 + BORDER_WIDTH / 3, top: BORDER_HEIGHT / 3 };
const obj = { const obj = {
clientWidth: clientWidth, clientWidth: clientWidth,
@ -2714,8 +2758,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
totalWidth: totalWidthScaled, totalWidth: totalWidthScaled,
totalHeight: totalHeightScaled, totalHeight: totalHeightScaled,
gameDrawBox: gameDrawBox, gameDrawBox: gameDrawBox,
globalAttribute: globalAttribute: core.status.globalAttribute || core.initStatus.globalAttribute,
core.status.globalAttribute || core.initStatus.globalAttribute,
}; };
_resize_gameGroup(obj); _resize_gameGroup(obj);
@ -2723,8 +2766,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (core.status.automaticRoute == null) core.status.automaticRoute = {}; if (core.status.automaticRoute == null) core.status.automaticRoute = {};
core.updateStatusBar(); core.updateStatusBar();
core.ui.CG.update(); if (main.dom.CGUI) core.ui.CG.update();
core.ui.cgText.update(); if (main.dom.cgText) core.ui.cgText.update();
}; };
class StatusBar { class StatusBar {
@ -2776,7 +2819,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
340, 340,
360 360
); );
uictx.drawImage(floorVertical, 0, 0); this._update_map();
uictx.globalAlpha = globalAlphafloor / 100; uictx.globalAlpha = globalAlphafloor / 100;
core.drawImage( core.drawImage(
uictx, uictx,
@ -2787,7 +2830,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
uictx.globalAlpha = 1; uictx.globalAlpha = 1;
} else { } else {
core.clearMap(uictx, MAP_BLOCK_LEFT, MAP_BLOCK_TOP, 340, 360); core.clearMap(uictx, MAP_BLOCK_LEFT, MAP_BLOCK_TOP, 340, 360);
uictx.drawImage(floor, 0, 0); this._update_map();
uictx.globalAlpha = globalAlphafloor / 100; uictx.globalAlpha = globalAlphafloor / 100;
core.drawImage( core.drawImage(
uictx, uictx,
@ -3002,50 +3045,18 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
_update_map(floorId = core.status.floorId) { _update_map(floorId = core.status.floorId) {
const x = core.domStyle.isVertical const x = core.domStyle.isVertical ?
? MAP_BLOCK_LEFT_VERTICAL MAP_BLOCK_LEFT_VERTICAL :
: MAP_BLOCK_LEFT; MAP_BLOCK_LEFT;
const y = core.domStyle.isVertical const y = core.domStyle.isVertical ?
? MAP_BLOCK_TOP_VERTICAL MAP_BLOCK_TOP_VERTICAL :
: MAP_BLOCK_TOP; MAP_BLOCK_TOP;
const w = core.domStyle.isVertical ? 300 : 300;
const h = core.domStyle.isVertical ? 300 : 300;
let sx, sy;
if (core.domStyle.isVertical) {
sy = y + 50;
sx = x + 5;
} else {
sy = y + 50;
sx = x + 30;
}
if (!floorId) return; if (!floorId) return;
const info = core.plugin.getMapDrawInfo(floorId, Infinity, true); const info = core.plugin.getMapDrawInfo(floorId, Infinity, true);
//core.clearMap(uictx, sx, sy, w + 40, h + 60)
//core.fillRect(uictx, sx, sy, w, h, '#000')
//core.strokeRect(uictx, sx, sy, w, h, '#fff', 5)
core.setTextAlign("outerUI", "center"); core.setTextAlign("outerUI", "center");
core.plugin.drawSmallMap(
floorctx, core.plugin.drawSmallMap(uictx, info, floorId, x, y, 300, 300);
info,
floorId,
MAP_BLOCK_LEFT,
MAP_BLOCK_TOP,
w,
h,
false
);
core.plugin.drawSmallMap(
floorVerticalctx,
info,
floorId,
MAP_BLOCK_LEFT_VERTICAL,
MAP_BLOCK_TOP_VERTICAL,
w,
h,
true
);
//core.fillText(uictx, core.status.maps[floorId].areas, sx + w / 2, sy - 10, '#FFFFFF')
} }
_update_equips() { _update_equips() {
@ -3361,12 +3372,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
this._update_infoWindow(); this._update_infoWindow();
} }
_update_toolBox() { _update_toolBox() {
const tools = core.isReplaying() const tools = core.isReplaying() ? [
? [
[core.status.replay.pausing ? "play" : "pause", "stop", "rewind"], [core.status.replay.pausing ? "play" : "pause", "stop", "rewind"],
["speedDown", "speedUp", "save"], ["speedDown", "speedUp", "save"],
] ] : [
: [
["keyboard", "shop", "pack", "T332"], ["keyboard", "shop", "pack", "T332"],
["settings", "save", "load", "T331"], ["settings", "save", "load", "T331"],
]; ];
@ -3451,7 +3460,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
} }
}; };
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 relativeTo = ([x, y], [ax, ay]) => { const relativeTo = ([x, y], [ax, ay]) => {
@ -3602,7 +3614,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.clearMap("outerUI"); core.clearMap("outerUI");
}; };
// init() called in `afterLoadResources`. // init() called in `afterLoadResources`.
}, },
"override": function () { "override": function () {
core.statusBar.icons = { core.statusBar.icons = {
floor: 0, floor: 0,
@ -9196,9 +9208,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
image: "bg_5043.png", image: "bg_5043.png",
memory: false, memory: false,
hidetime: 30, hidetime: 30,
list: [ list: [{
{ text: "", sound: "", time: 50, textColor: "255,255,255,1", boldColor: "0,0,0,1", font: "bold 48px Verdana", frame: 0 } text: "",
], sound: "",
time: 50,
textColor: "255,255,255,1",
boldColor: "0,0,0,1",
font: "bold 48px Verdana",
frame: 0,
}, ],
}, ]), }, ]),
MotaActionFunctions.actionParser.parseList([{ MotaActionFunctions.actionParser.parseList([{
type: "cgtext", type: "cgtext",
@ -9212,7 +9230,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
sound: "", sound: "",
text: "这句话显示在对话框内", text: "这句话显示在对话框内",
bodyList: [ bodyList: [
{ name: "tati_050145a.png", px: 100, filter: false } { name: "tati_050145a.png", px: 100, filter: false },
], ],
}, ]), }, ]),
MotaActionBlocks["moveTextBox_s"].xmlText(), MotaActionBlocks["moveTextBox_s"].xmlText(),
@ -9386,6 +9404,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}), }),
MotaActionBlocks["waitAsync_s"].xmlText(), MotaActionBlocks["waitAsync_s"].xmlText(),
MotaActionBlocks["stopAsync_s"].xmlText(), MotaActionBlocks["stopAsync_s"].xmlText(),
MotaActionBlocks["op_s"].xmlText(),
MotaActionBlocks["drawWarning_s"].xmlText(), MotaActionBlocks["drawWarning_s"].xmlText(),
MotaActionBlocks["changeMouse_s"].xmlText(), MotaActionBlocks["changeMouse_s"].xmlText(),
MotaActionBlocks["removeMouse_s"].xmlText(), MotaActionBlocks["removeMouse_s"].xmlText(),
@ -10514,15 +10533,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
sy, sy,
sw, sw,
sh, sh,
vertical = core.domStyle.isVertical,
scale = defaultValue.scale scale = defaultValue.scale
) { ) {
core.clearMap(ctx, sx, sy, sw + 40, sh + 60); core.clearMap(ctx, sx, sy, sw + 40, sh + 60);
if (vertical) { if (core.domStyle.isVertical) {
sy += 50; sy += 50;
sx += 5; sx += 15;
} else { } else {
sy += 50; sy += 60;
sx += 30; sx += 30;
} }
core.fillRect(ctx, sx, sy, sw, sh, "#000"); core.fillRect(ctx, sx, sy, sw, sh, "#000");
@ -10531,7 +10549,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.fillBoldText1( core.fillBoldText1(
ctx, ctx,
core.status.maps[center].areas, core.status.maps[center].areas,
sx + (sw * 3) / 8, sx + sw / 2,
sy - 10, sy - 10,
"#FFFFFF", "#FFFFFF",
"#000000", "#000000",
@ -11705,7 +11723,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
actions.prototype._sys_onmousewheel, actions.prototype._sys_onmousewheel,
0 0
); );
}, },
"CG回廊": function () { "CG回廊": function () {
// 在此增加新插件 // 在此增加新插件
const CGUI = document.createElement("canvas"); //CGui画布设置 const CGUI = document.createElement("canvas"); //CGui画布设置
@ -12008,8 +12026,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
const imagebox2 = makeBox([200, 1200], [480, 320]); const imagebox2 = makeBox([200, 1200], [480, 320]);
const imagebox3 = makeBox([700, 300], [480, 320]); const imagebox3 = makeBox([700, 300], [480, 320]);
const imagebox4 = makeBox([700, 850], [480, 320]); const imagebox4 = makeBox([700, 750], [480, 320]);
const imagebox5 = makeBox([700, 1300], [480, 320]); const imagebox5 = makeBox([700, 1200], [480, 320]);
if (inRect(pos, pagedownbox)) { if (inRect(pos, pagedownbox)) {
//2代表当前最大页数-1 //2代表当前最大页数-1
if (page < this.UIMx.length - 1) { if (page < this.UIMx.length - 1) {
@ -12054,7 +12072,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
show = !show; show = !show;
} }
} else if (inRect(pos, imagebox3)) { } else if (inRect(pos, imagebox3)) {
console.log(3);
const img = core.material.images.images[this.UIMx[page][1][0]]; const img = core.material.images.images[this.UIMx[page][1][0]];
if (img) { if (img) {
ctx.save(); //保存设置 ctx.save(); //保存设置
@ -12576,7 +12594,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (!core.status.pop) core.status.pop = [data]; if (!core.status.pop) core.status.pop = [data];
else core.status.pop.push(data); else core.status.pop.push(data);
}; };
}, },
"warning": function () { "warning": function () {
// 在此增加新插件 // 在此增加新插件
// 默认音效名 // 默认音效名
@ -13311,7 +13329,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (img) { if (img) {
//绘制背景 //绘制背景
if (this.memory) ctx.filter = "sepia(50%)" if (this.memory) ctx.filter = "sepia(50%)";
ctx.drawImage(img, 0, 0, 2028, 1248); ctx.drawImage(img, 0, 0, 2028, 1248);
ctx.filter = "none"; ctx.filter = "none";
} else { } else {
@ -13492,9 +13510,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
ctx.globalAlpha = 1; ctx.globalAlpha = 1;
if (img) { if (img) {
//绘制背景 //绘制背景
if (memory) ctx.filter = "sepia(50%)" if (memory) ctx.filter = "sepia(50%)";
ctx.drawImage(img, 0, 0, 676 * 3, 416 * 3); ctx.drawImage(img, 0, 0, 676 * 3, 416 * 3);
ctx.filter = "none" ctx.filter = "none";
} else { } else {
core.fillRect(ctx, 0, 0, 676 * 3, 416 * 3); core.fillRect(ctx, 0, 0, 676 * 3, 416 * 3);
} }
@ -13538,7 +13556,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
boldColor: "#000000", boldColor: "#000000",
font: "bold 48px Verdana", font: "bold 48px Verdana",
frame: 0, frame: 0,
}] }, ]
) { ) {
if (!core.isPlaying()) { if (!core.isPlaying()) {
return core.doAction(); return core.doAction();
@ -13562,9 +13580,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
ctx.globalAlpha = 1; ctx.globalAlpha = 1;
if (img) { if (img) {
//绘制背景 //绘制背景
if (memory) ctx.filter = "sepia(50%)" if (memory) ctx.filter = "sepia(50%)";
ctx.drawImage(img, 0, 0, 676 * 3, 416 * 3); ctx.drawImage(img, 0, 0, 676 * 3, 416 * 3);
ctx.filter = "none" ctx.filter = "none";
} else { } else {
core.fillRect(ctx, 0, 0, 676 * 3, 416 * 3); core.fillRect(ctx, 0, 0, 676 * 3, 416 * 3);
} }
@ -13577,7 +13595,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
cy = 624, cy = 624,
dy = 624; dy = 624;
if (i === 0 && !list[1]) { if (i === 0 && !list[1]) {
core.over(image, core.over(
image,
memory, memory,
a.time, a.time,
hidetime, hidetime,
@ -13585,19 +13604,28 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
a.textColor, a.textColor,
a.boldColor, a.boldColor,
a.font, a.font,
a.text) a.text
);
} else { } else {
const numa = parseInt(a?.font?.match(/\s*[\d.-]+[a-zA-Z%]*\s*/)?.[0].trim()) || 48; const numa =
const numb = parseInt(b?.font?.match(/\s*[\d.-]+[a-zA-Z%]*\s*/)?.[0].trim()) || 48; parseInt(a?.font?.match(/\s*[\d.-]+[a-zA-Z%]*\s*/)?.[0].trim()) ||
const numc = parseInt(c?.font?.match(/\s*[\d.-]+[a-zA-Z%]*\s*/)?.[0].trim()) || 48; 48;
const numd = parseInt(d?.font?.match(/\s*[\d.-]+[a-zA-Z%]*\s*/)?.[0].trim()) || 48; const numb =
parseInt(b?.font?.match(/\s*[\d.-]+[a-zA-Z%]*\s*/)?.[0].trim()) ||
48;
const numc =
parseInt(c?.font?.match(/\s*[\d.-]+[a-zA-Z%]*\s*/)?.[0].trim()) ||
48;
const numd =
parseInt(d?.font?.match(/\s*[\d.-]+[a-zA-Z%]*\s*/)?.[0].trim()) ||
48;
// 绘制 // 绘制
if (a) { if (a) {
if (a.frame < hidetime / 2) { if (a.frame < hidetime / 2) {
a.frame++; a.frame++;
core.setAlpha(ctx, 1 - (hidetime - a.frame) / hidetime); core.setAlpha(ctx, 1 - (hidetime - a.frame) / hidetime);
ay += (numa * (hidetime - a.frame)) / hidetime * 3; ay += ((numa * (hidetime - a.frame)) / hidetime) * 3;
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
core.fillBoldText1( core.fillBoldText1(
ctx, ctx,
@ -13611,9 +13639,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
); );
} }
if (a.frame === hidetime / 2) { if (a.frame === hidetime / 2) {
core.setAlpha(ctx, 1 - (hidetime - a.frame) / hidetime); core.setAlpha(ctx, 1 - (hidetime - a.frame) / hidetime);
ay = 624 + (numa * (hidetime - a.frame)) / hidetime * 3; ay = 624 + ((numa * (hidetime - a.frame)) / hidetime) * 3;
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
core.fillBoldText1( core.fillBoldText1(
@ -13628,7 +13655,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
); );
if (!b) { if (!b) {
a.frame++; a.frame++;
i++ i++;
} }
} }
} }
@ -13636,7 +13663,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (b.frame > hidetime / 2 && b.frame <= hidetime) { if (b.frame > hidetime / 2 && b.frame <= hidetime) {
b.frame++; b.frame++;
core.setAlpha(ctx, 1 - (hidetime - b.frame) / hidetime); core.setAlpha(ctx, 1 - (hidetime - b.frame) / hidetime);
by += (numb * (hidetime - b.frame)) / hidetime * 3; by += ((numb * (hidetime - b.frame)) / hidetime) * 3;
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
core.fillBoldText1( core.fillBoldText1(
ctx, ctx,
@ -13649,13 +13676,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
b.font b.font
); );
core.stopSound(sod) core.stopSound(sod);
}
const lisenb =
b.sound &&
core.material.sounds[b.sound] &&
core.musicStatus.soundStatus;
if (b.frame && lisenb) {
sod = core.playSound(sound);
} }
const lisenb = b.sound && core.material.sounds[b.sound] && core.musicStatus.soundStatus;
if (b.frame && lisenb) { sod = core.playSound(sound); }
if (b.frame > hidetime && b.frame < hidetime + b.time) { if (b.frame > hidetime && b.frame < hidetime + b.time) {
b.frame++ b.frame++;
ctx.globalAlpha = 1; ctx.globalAlpha = 1;
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
core.fillBoldText1( core.fillBoldText1(
@ -13668,8 +13699,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
6, 6,
b.font b.font
); );
} }
if (b.frame == hidetime + b.time) { if (b.frame == hidetime + b.time) {
@ -13688,14 +13717,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (a) a.frame++; if (a) a.frame++;
if (b) b.frame++; if (b) b.frame++;
if (c) c.frame++; if (c) c.frame++;
i++ i++;
} }
} }
if (c) { if (c) {
if (c.frame > hidetime + c.time && c.frame < hidetime * 3 / 2 + c.time) { if (
c.frame > hidetime + c.time &&
c.frame < (hidetime * 3) / 2 + c.time
) {
c.frame++; c.frame++;
core.setAlpha(ctx, 1 - (c.frame - hidetime - c.time) / hidetime) core.setAlpha(ctx, 1 - (c.frame - hidetime - c.time) / hidetime);
cy -= (numc * (c.frame - hidetime - c.time)) / hidetime * 3; cy -= ((numc * (c.frame - hidetime - c.time)) / hidetime) * 3;
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
core.fillBoldText1( core.fillBoldText1(
ctx, ctx,
@ -13708,9 +13740,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
c.font c.font
); );
} }
if (c.frame === hidetime * 3 / 2 + c.time) { if (c.frame === (hidetime * 3) / 2 + c.time) {
core.setAlpha(ctx, 1 - (c.frame - hidetime - c.time) / hidetime) core.setAlpha(ctx, 1 - (c.frame - hidetime - c.time) / hidetime);
cy = 624 - (numc * (c.frame - hidetime - c.time)) / hidetime * 3; cy =
624 - ((numc * (c.frame - hidetime - c.time)) / hidetime) * 3;
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
core.fillBoldText1( core.fillBoldText1(
ctx, ctx,
@ -13723,17 +13756,19 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
c.font c.font
); );
if (!b) { if (!b) {
c.frame++ c.frame++;
i++ i++;
} }
} }
} }
if (d) { if (d) {
if (d.frame > hidetime * 3 / 2 + d.time && d.frame < hidetime * 2 + d.time) { if (
d.frame > (hidetime * 3) / 2 + d.time &&
d.frame < hidetime * 2 + d.time
) {
d.frame++; d.frame++;
core.setAlpha(ctx, 1 - (d.frame - hidetime - d.time) / hidetime) core.setAlpha(ctx, 1 - (d.frame - hidetime - d.time) / hidetime);
dy -= (numd * (d.frame - hidetime - d.time)) / hidetime * 3; dy -= ((numd * (d.frame - hidetime - d.time)) / hidetime) * 3;
core.setTextAlign(ctx, "center"); core.setTextAlign(ctx, "center");
core.fillBoldText1( core.fillBoldText1(
ctx, ctx,
@ -13754,7 +13789,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.doAction(); core.doAction();
return; return;
} }
} }
} }
ctx.restore(); ctx.restore();
@ -13784,9 +13818,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
ctx.globalAlpha = globalAlpha1 / time; ctx.globalAlpha = globalAlpha1 / time;
if (img2) { if (img2) {
//绘制背景 //绘制背景
if (memory2) ctx.filter = "sepia(50%)" if (memory2) ctx.filter = "sepia(50%)";
ctx.drawImage(img2, 0, 0, 676 * 3, 1248); ctx.drawImage(img2, 0, 0, 676 * 3, 1248);
ctx.filter = "none" ctx.filter = "none";
} else { } else {
core.fillRect(ctx, 0, 0, 676 * 3, 1248); core.fillRect(ctx, 0, 0, 676 * 3, 1248);
} }
@ -13816,12 +13850,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
ctx.globalAlpha = globalAlpha2 / time; ctx.globalAlpha = globalAlpha2 / time;
if (img1) { if (img1) {
//绘制背景 //绘制背景
if (memory1) ctx.filter = "sepia(50%)" if (memory1) ctx.filter = "sepia(50%)";
ctx.drawImage(img1, 0, 0, 676 * 3, 1248); ctx.drawImage(img1, 0, 0, 676 * 3, 1248);
ctx.filter = "none" ctx.filter = "none";
} else { } else {
core.fillRect(ctx, 0, 0, 676 * 3, 1248); core.fillRect(ctx, 0, 0, 676 * 3, 1248);
} }
globalAlpha2--; globalAlpha2--;
ctx.restore(); ctx.restore();
@ -13851,16 +13884,16 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
ctx.globalAlpha = globalAlpha2 / time; ctx.globalAlpha = globalAlpha2 / time;
if (img1) { if (img1) {
//绘制背景 //绘制背景
if (memory1) ctx.filter = "sepia(50%)" if (memory1) ctx.filter = "sepia(50%)";
ctx.drawImage(img1, 0, 0, 676 * 3, 1248); ctx.drawImage(img1, 0, 0, 676 * 3, 1248);
ctx.filter = "none" ctx.filter = "none";
} else { } else {
core.fillRect(ctx, 0, 0, 676 * 3, 1248); core.fillRect(ctx, 0, 0, 676 * 3, 1248);
} }
ctx.globalAlpha = globalAlpha1 / time; ctx.globalAlpha = globalAlpha1 / time;
if (img2) { if (img2) {
//绘制背景 //绘制背景
if (memory2) ctx.filter = "sepia(50%)" if (memory2) ctx.filter = "sepia(50%)";
ctx.drawImage(img2, 0, 0, 676 * 3, 1248); ctx.drawImage(img2, 0, 0, 676 * 3, 1248);
ctx.filter = "none"; ctx.filter = "none";
} else { } else {
@ -13993,5 +14026,164 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
onclick(px, py) {} onclick(px, py) {}
} }
core.ui.boss = new boss1(); core.ui.boss = new boss1();
},
"剧情视频引用": function () {
// 在此增加新插件
let a;
let bgm;
function gtouchstart() {
timeOutEvent = setTimeout(() => {
video.remove();
video1.remove();
core.doAction()
clearTimeout(a)
core.playBgm(bgm)
core.resumeBgm()
}, 2000); //这里设置定时器定义长按500毫秒触发长按事件时间可以自己改个人感觉500毫秒非常合适
return false;
};
//手释放如果在500毫秒内就释放则取消长按事件此时可以执行onclick应该执行的事件
function gtouchend() {
if (timeOutEvent != 0) {
//这里写要执行的内容尤如onclick事件
console.log("你这是点击,不是长按");
} }
clearTimeout(timeOutEvent); //清除定时器
return false;
};
this.openvideo = function () {
if (!core.isPlaying()) return
const video = document.createElement("iframe"); //iframe设置
video.style.position = "absolute";
video.style.zIndex = 320;
video.style.display = "block";
video.id = "video";
main.dom.gameGroup.insertAdjacentElement("afterend", video);
video.style.top = "50%";
video.style.left = "50%";
video.style.transform = "translate(-50%,-50%)";
main.dom.video = video;
const video1 = document.createElement('canvas'); //iframe设置
video1.style.position = "absolute";
video1.style.zIndex = 330;
video1.style.display = "block";
video1.id = "video1";
main.dom.gameGroup.insertAdjacentElement("afterend", video1);
video1.style.top = "50%";
video1.style.left = "50%";
video1.style.transform = "translate(-50%,-50%)";
main.dom.video1 = video1;
if (core.domStyle.isVertical) {
video.width = 416 * 3;
video.height = 676 * 3;
video.style.transform = "translate(-50%,-50%) rotate(90deg)"; //重新定位右上角为基准
video1.width = 416 * 3;
video1.height = 676 * 3;
video1.style.transform = "translate(-50%,-50%) rotate(90deg)"; //重新定位右上角为基准
} else {
video.width = 676 * 3;
video.height = 416 * 3;
video.style.transform = "translate(-50%,-50%)";
video1.width = 676 * 3;
video1.height = 416 * 3;
video1.style.transform = "translate(-50%,-50%)";
}
video1.ontouchstart = function (e) {
try {
e.preventDefault();
if (core.isPlaying()) return false;
gtouchstart()
} catch (ee) {
main.log(ee);
}
};
video1.ontouchend = function (e) {
try {
e.preventDefault();
if (core.isPlaying()) return false;
gtouchend()
} catch (ee) {
main.log(ee);
}
};
video1.onmouseup = function (e) {
//鼠标抬起
try {
e.stopPropagation();
if (!core.isPlaying()) return false;
gtouchend()
} catch (ee) {
console.error(ee);
}
};
video1.onmousedown = function (e) {
//鼠标按下
try {
e.stopPropagation();
if (!core.isPlaying()) return false;
gtouchstart()
} catch (ee) {
main.log(ee);
}
};
let globalAlpha = 0
let frame = 1
core.registerAnimationFrame('op', true, function () {
const ctx = video1.getContext('2d')
core.clearMap(ctx)
ctx.globalAlpha = 1
core.fillRect(ctx, 0, 0, video1.width, video.height, "#000000")
ctx.globalAlpha = globalAlpha / 30
core.setTextAlign(ctx, "center");
core.fillBoldText1(ctx, "长按2秒后跳过op", 1014, 624, "#FFFFFF", '#000000', 6, "bold 48px Verdana")
globalAlpha += frame
if (globalAlpha > 29) frame = -1
if (frame === -1 && globalAlpha < 0) {
core.clearMap(ctx)
core.unregisterAnimationFrame('op')
}
})
core.control.resize();
//player.bilibili.com/player.html
//www.bilibili.com/blackboard/html5mobileplayer.html
//<iframe src="//player.bilibili.com/player.html?isOutside=true&aid=6484104&bvid=BV1cs411b7cH&cid=10546155&p=1" scrolling="no" border="0" frameborder="no" framespacing="0" allowfullscreen="true"></iframe>
video.src = "///www.bilibili.com/blackboard/html5mobileplayer.html?isOutside=true&aid=6484104&bvid=BV1cs411b7cH&cid=10546155&p=1&poster=0&autoplay=1&high_quality=1&muted=0&danmaku=0";
video.scrolling = "no";
video.border = "0";
video.crossorigin = true;
video.frameborder = "no";
video.framespacing = "0";
video.allowfullscreen = false;
video.sandbox = "allow-top-navigation allow-same-origin allow-forms allow-scripts allow-cross-origin";
//gsl_play_mask
video.addEventListener('load', function () {
bgm = core.musicStatus.playingBgm;
core.playBgm("op.mp3")
a = setTimeout(() => {
video.remove();
video1.remove();
core.playBgm(bgm)
core.doAction()
}, 130000)
})
};
}
} }