CG #6

Merged
strawberry42271 merged 15 commits from CG into main 2024-12-08 10:12:36 +08:00
63 changed files with 218 additions and 19 deletions
Showing only changes of commit 0c4d2be0bf - Show all commits

View File

@ -949,6 +949,7 @@ action
| function_s
| changeMouse_s
| removeMouse_s
| drawWarning_s
| addPop_s
| pass_s
;
@ -1827,6 +1828,20 @@ var code = '{"type": "sleep", "time": '+Int_0+Bool_0+'},\n';
return code;
*/;
drawWarning_s
: '警告坐标x' PosString 'y' PosString '警告内容' EvalString? Newline
/* drawWarning_s
tooltip : drawWarning: 绘制warning警告并拉进镜头
helpUrl : /_docs/#/instruction
default : [0, 0,"这里是提示内容"]
colour : this.soundColor
selectPoint : ["PosString_0", "PosString_1"]
var code = '{"type": "drawWarning", "x": '+PosString_0+', "y": '+PosString_1+', "text": "'+EvalString_0+'"},\n';
return code;
*/;
changeMouse_s
: '鼠标指针变更为' EvalString '在' Div_List? BGNL? Newline
'画布偏移X' Number? '画布偏移Y' Number? 'X轴缩放' Number? 'Y轴缩放' Number '顺时针转角' Number '点击X偏移' Number '点击Y偏移' Number Newline

View File

@ -980,6 +980,11 @@ ActionParser.prototype.parseAction = function() {
this.next = MotaActionBlocks['stopAsync_s'].xmlText([
this.next]);
break;
case "drawWarning":
this.next = MotaActionBlocks['drawWarning_s'].xmlText([
data.x,data.y,data?.text,this.next]);
break;
case "changeMouse":
this.next = MotaActionBlocks['changeMouse_s'].xmlText([

File diff suppressed because one or more lines are too long

View File

@ -26,13 +26,68 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"bear.png",
"bg.jpg",
"bg2.jpg",
"bg_1511.png",
"bg_1521.png",
"bg_2010.png",
"bg_2011.png",
"bg_2521.png",
"bg_3042.png",
"bg_3551.png",
"bg_3571.png",
"bg_3721.png",
"bg_5033.png",
"bg_5043.png",
"bg_5044.png",
"brave.png",
"d.png",
"dl.png",
"dlr.png",
"dr.png",
"dragon.png",
"eve_010102.png",
"eve_010203.png",
"eve_010304.png",
"eve_010501.png",
"eve_010601.png",
"eve_010701.png",
"eve_010801.png",
"eve_010902.png",
"eve_011001.png",
"eve_011101.png",
"eve_011202.png",
"eve_011302.png",
"eve_011402.png",
"eve_020102.png",
"eve_020201.png",
"eve_020301.png",
"eve_020401.png",
"eve_020501.png",
"eve_020605.png",
"eve_020701.png",
"eve_020801.png",
"eve_030101.png",
"eve_030206.png",
"eve_030302.png",
"eve_030508.png",
"eve_030601.png",
"eve_030801.png",
"eve_030901.png",
"eve_031002.png",
"eve_031101.png",
"eve_040201.png",
"eve_040401.png",
"eve_040501.png",
"eve_040601.png",
"eve_040702.png",
"eve_040801.png",
"eve_050101.png",
"eve_050201.png",
"eve_050401.png",
"eve_050501.png",
"eve_050601.png",
"eve_050704.png",
"eve_050801.png",
"eve_070101.png",
"green.png",
"h25.png",
"hero.png",
@ -113,6 +168,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"gem.mp3",
"icePickaxe.mp3",
"item.mp3",
"jingbao.mp3",
"jump.mp3",
"load.mp3",
"open_ui.mp3",

View File

@ -18,7 +18,16 @@ main.floors.jiuguan=
"firstArrive": [],
"eachArrive": [],
"parallelDo": "",
"events": {},
"events": {
"4,6": [
{
"type": "drawWarning",
"x": 9,
"y": 4,
"text": "本区域领袖"
}
]
},
"changeFloor": {},
"beforeBattle": {},
"afterBattle": {},

BIN
project/images/bg_1511.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
project/images/bg_1521.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
project/images/bg_2010.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 MiB

BIN
project/images/bg_2011.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
project/images/bg_2521.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

BIN
project/images/bg_3042.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
project/images/bg_3551.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
project/images/bg_3571.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

BIN
project/images/bg_3721.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

BIN
project/images/bg_5033.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
project/images/bg_5044.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 992 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

View File

@ -16,6 +16,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.addPop(data.value, data.px, data.py, data.color, data.boldColor, data.left, data.jump, data.time, data.show, data.font, data.speed)
core.doAction()
})
core.registerEvent("drawWarning", function (data) {
core.drawWarning(data.x, data.y, data?.text)
core.doAction()
})
}
},
"drawLight": function () {
@ -7208,6 +7212,7 @@ core.plugin.animate = {
}),
MotaActionBlocks['waitAsync_s'].xmlText(),
MotaActionBlocks['stopAsync_s'].xmlText(),
MotaActionBlocks['drawWarning_s'].xmlText(),
MotaActionBlocks['changeMouse_s'].xmlText(),
MotaActionBlocks['removeMouse_s'].xmlText(),
MotaActionBlocks['vibrate_s'].xmlText(),
@ -8766,16 +8771,40 @@ core.plugin.animate = {
//cg列表
this.UIMx = [ //空位用none填充当前ui至多4列6行
[
["background.png", "bg.jpg", 'bg_5043.png'],
["none", "none", "none"]
["eve_010102.png", "eve_010203.png", 'eve_010304.png'],
["eve_010501.png", "eve_010601.png", "eve_010701.png"]
],
[
["none", "none", 'none'],
["none", "none", "none"]
["eve_010801.png", "eve_010902.png", 'eve_011001.png'],
["eve_011101.png", "eve_011202.png", "eve_011302.png"]
],
[
["none", "none", 'none'],
["none", "none", "none"]
["eve_011402.png", "eve_020102.png", 'eve_020201.png'],
["eve_020301.png", "eve_020401.png", "eve_020501.png"]
],
[
["eve_020605.png", "eve_020701.png", 'eve_020801.png'],
["eve_030101.png", "eve_030206.png", "eve_030302.png"]
],
[
["eve_030508.png", "eve_030601.png", 'eve_030801.png'],
["eve_030901.png", "eve_031002.png", "eve_031101.png"]
],
[
["eve_040201.png", "eve_040401.png", 'eve_040501.png'],
["eve_040601.png", "eve_040702.png", "eve_040801.png"]
],
[
["eve_050101.png", "eve_050201.png", 'eve_050401.png'],
["eve_050501.png", "eve_050601.png", "eve_050704.png"]
],
[
["eve_050801.png", "eve_070101.png", 'bg_1511.png'],
["bg_1521.png", "bg_2011.png", "bg_2521.png"]
],
[
["bg_3042.png", "bg_3551.png", 'bg_3571.png'],
["bg_3721.png", "bg_5033.png", "bg_5044.png"]
]
]
}
@ -8804,7 +8833,7 @@ core.plugin.animate = {
if (show) {
show = !show
core.clearMap(ctx);
this.drawUI();
this.update();
return
}
console.log([px, py]);
@ -8840,18 +8869,18 @@ core.plugin.animate = {
const imagebox3 = makeBox([700, 300], [480, 320])
const imagebox4 = makeBox([700, 850], [480, 320])
const imagebox5 = makeBox([700, 1300], [480, 320])
if (inRect(pos, pageupbox)) {
if (inRect(pos, pagedownbox)) {
//2代表当前最大页数-1
if (page < 2) {
if (page < this.UIMx.length - 1) {
page++;
core.clearMap(ctx);
this.drawUI();
this.update();
}
} else if (inRect(pos, pagedownbox)) {
} else if (inRect(pos, pageupbox)) {
if (page > 0) {
page--;
core.clearMap(ctx);
this.drawUI();
this.update();
}
} else if (inRect(pos, imagebox0)) {
const img = core.material.images.images[this.UIMx[page][0][0]]
@ -8925,16 +8954,16 @@ core.plugin.animate = {
const imagebox4 = makeBox([800, 750], [480, 320])
const imagebox5 = makeBox([1300, 750], [480, 320])
if (inRect(pos, pageupbox)) {
if (page < 2) {
if (page < this.UIMx.length - 1) {
page++;
core.clearMap(ctx);
this.drawUI();
this.update();
}
} else if (inRect(pos, pagedownbox)) {
if (page > 0) {
page--;
core.clearMap(ctx);
this.drawUI();
this.update();
}
} else if (inRect(pos, imagebox0)) {
const img = core.material.images.images[this.UIMx[page][0][0]]
@ -9001,7 +9030,7 @@ core.plugin.animate = {
//core.drawWindowSkin('winskin1.png', ctx, 0, 0, 1248, 2028);
core.fillRect(ctx, 0, 0, 1248, 2028, "#000000") //黑色背景
ctx.globalAlpha = 0.5 //透明度
drawImage(ctx, "backgroundvertical.png", 0, 0, 1280, 1500, 0, 0, 1248, 2028) //绘制半透明背景图片
drawImage(ctx, "bg_2010.png", 0, 0, 1280, 1500, 0, 0, 1248, 2028) //绘制半透明背景图片
ctx.globalAlpha = 1 //恢复为不透明
core.setTextAlign(ctx, 'center');
@ -9080,7 +9109,7 @@ core.plugin.animate = {
core.ui.CG = new CG();
main.dom.CGMode.onclick = function () {
main.core.control.checkBgm();
page = 0
CGUI.style.display = "block"
main.core.ui.CG.update()
}
@ -9162,5 +9191,66 @@ core.plugin.animate = {
if (!core.status.pop) core.status.pop = [data];
else core.status.pop.push(data);
}
},
"warning": function () {
// 在此增加新插件
// 默认音效名
var defaultSound = 'jingbao.mp3';
// 默认字体名
var defaultFont = 'Verdana';
var timeout;
/** warning
* @param {number} x 横坐标
* @param {number} y 纵坐标
* @param {string} text 显示的文字
*/
this.drawWarning = function (x, y, text) {
if (timeout) return;
x = x || 6;
y = y || 6;
text = text || 'boss';
text += '</br>';
for (var i = 0; i < 10; i++) text += ' ';
if (core.material.enemys?.[core.getBlock(x, y)?.event?.id]?.name) text += core.material.enemys?.[core.getBlock(x, y)?.event?.id]?.name;
// 生成文字
var elements = document.querySelectorAll('.gameCanvas');
var t = document.createElement('p');
t.innerHTML = text;
t.style.position = 'absolute';
t.style.fontSize = '4em';
t.style.left = -(300 * core.domStyle.scale) + 'px';
t.style.top = (parseInt(elements[0].style.height) / 2 - 100) + 'px';
t.style.zIndex = '300';
t.style.color = '#f11';
t.style.fontFamily = defaultFont;
t.style.overflow = 'none';
t.style.width = '100%';
t.classList.add('warning');
core.dom.gameDraw.appendChild(t);
setTimeout(function () { t.style.left = (416 * core.domStyle.scale) + 'px' }, 50);
// 计算偏移量
var px = (6 - x) / 12 * 50;
var py = (6 - y) / 12 * 50;
// 修改画布的scale和transform
elements.forEach(function (v) {
if (v instanceof HTMLCanvasElement) {
v.style.transform = 'scale(2)translate(' + px + '%, ' + py + '%)';
}
});
core.playSound(defaultSound);
// 拉回镜头
timeout = setTimeout(function () {
timeout = setTimeout(function () {
timeout = void 0;
core.dom.gameDraw.removeChild(t);
}, 1500);
elements.forEach(function (v) {
if (v instanceof HTMLCanvasElement) {
v.style.transform = 'none';
}
});
}, 1600);
}
}
}

BIN
project/sounds/jingbao.mp3 Normal file

Binary file not shown.

View File

@ -508,3 +508,27 @@ p#name {
.anti-aliasing {
image-rendering: pixelated;
}
.warning {
transition: left cubic-bezier(0, 0.9, 1, 0.1) 2.5s;
-webkit-transition: left cubic-bezier(0, 0.9, 1, 0.1) 2.5s;
animation: warning 1s linear 0s alternate infinite;
-webkit-animation: warning 1s linear 0s alternate infinite;
}
@keyframes warning {
0 % { text-shadow: 0px 0px 9px rgba(255, 0, 0, 0.5), 0px 0px 6px rgb(129, 0, 0);}
50 % { text-shadow: 0px 0px 30px rgba(255, 0, 0, 1), 0px 0px 6px rgb(129, 0, 0);}
100 % { text-shadow: 0px 0px 9px rgba(255, 0, 0, 0.5), 0px 0px 6px rgb(129, 0, 0);}
}
@-webkit - keyframes warning {
0 % { text-shadow: 0px 0px 9px rgba(255, 0, 0, 0.5), 0px 0px 6px rgb(129, 0, 0);}
50 % { text-shadow: 0px 0px 30px rgba(255, 0, 0, 1), 0px 0px 6px rgb(129, 0, 0);}
100 % { text-shadow: 0px 0px 9px rgba(255, 0, 0, 0.5), 0px 0px 6px rgb(129, 0, 0);}
}
.gameCanvas {
transition: transform 1.5s ease-out;
-webkit-transition: transform 1.5s ease-out;
}