音乐拼接等

This commit is contained in:
草莓 2025-01-23 21:46:59 +08:00
parent aa7c17f460
commit c5c1e12d8b
4 changed files with 2683 additions and 2631 deletions

View File

@ -854,6 +854,8 @@ action
| waitAsync_s
| stopAsync_s
| op_s
| setmusics_s
| introAndLoop_s
| battle_s
| battle_1_s
| openDoor_s
@ -2612,6 +2614,23 @@ var code = '{"type": "setq"'+IdString_0+'},\n';
return code;
*/;
introAndLoop_s
: '前奏音乐文件'EvalString? '前奏音乐文件'EvalString'循环音乐文件'EvalString? Newline
/* introAndLoop_s
tooltip : introAndLoop设置任务目标楼层显示在小地图
helpUrl : /_docs/#/instruction
default : ["",1,""]
allBgms : ['EvalString_0','EvalString_2']
colour :this.imageColor
if(EvalString_1&&!/^(0|([1-9][0-9]*))(\.[\d]+)?$/.test(EvalString_1))throw new Error("此项仅能填写小数或整数,单位为秒");
EvalString_0 = EvalString_0 ? (', "intro": "'+EvalString_0+'"') : '';
EvalString_1= EvalString_1 ? (', "time": '+EvalString_1+'') : '';
EvalString_2 = EvalString_2 ? (', "loop": "'+EvalString_2+'"') : '';
var code = '{"type": "introAndLoop"'+EvalString_0+EvalString_1+EvalString_2+'},\n';
return code;
*/;
setcgs_s
: 'cg回廊获取cg 文件名'EvalString?'不填为清空cg获取记录' Newline
@ -2627,6 +2646,20 @@ var code = '{"type": "setcgs"'+EvalString_0+'},\n';
return code;
*/;
setmusics_s
: '音乐鉴赏music 文件名'EvalString?'不填为清空cg获取记录' Newline
/* setmusics_s
tooltip : setmusics音乐鉴赏中的隐藏music获取
helpUrl : /_docs/#/instruction
default : [""]
allBgms : ['EvalString_0']
colour : this.soundColor
EvalString_0 = EvalString_0 ? (', "bgm": "'+EvalString_0+'"') : '';
var code = '{"type": "setmusics"'+EvalString_0+'},\n';
return code;
*/;
scaleImage_s
: '图片放缩' '图片编号' NInt '中心点像素' 'x' PosString? 'y' PosString? '移动方式' MoveMode_List BGNL? '放缩比例' Number '动画时间' Int '不等待执行完毕' Bool Newline
@ -2635,7 +2668,7 @@ scaleImage_s
tooltip : scaleImage图片放缩
helpUrl : /_docs/#/instruction
default : [1,'','','',0.8,0,false]
colour : this.imageColor
colour : this.soundColor
if (Number_0 <= 0) throw new Error('放缩比例需要大于0');
var loc = '';
if (PosString_0 && PosString_1)

View File

@ -620,6 +620,20 @@ MotaActionParser = function () {
case "setcgs":
this.next = MotaActionBlocks["setcgs_s"].xmlText([data.img, this.next]);
break;
case "setmusics":
this.next = MotaActionBlocks["setmusics_s"].xmlText([
data.bgm,
this.next,
]);
break;
case "introAndLoop":
this.next = MotaActionBlocks["introAndLoop_s"].xmlText([
data.intro,
data.time,
data.loop,
this.next,
]);
break;
case "comment": // 注释
this.next = MotaActionBlocks["comment_s"].xmlText([
this.EvalString_Multi(data.text),

View File

@ -122,6 +122,12 @@ var plugins_comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "音乐鉴赏"
},
"intro&loop": {
"_leaf": true,
"_type": "textarea",
"_range": "typeof(thiseval)=='string' || thiseval==null",
"_data": "背景音乐拼接"
}
}
if (obj[key]) return obj[key];

View File

@ -122,8 +122,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
data.image,
data.memory,
data.hidetime || 30,
data.list || [
{
data.list || [{
text: "",
sound: "",
time: 50,
@ -131,8 +130,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
boldColor: "#000000",
font: "bold 48px Verdana",
frame: 0,
},
]
}, ]
);
} else {
core.doAction();
@ -219,6 +217,40 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.doAction();
}
});
core.registerEvent("introAndLoop", function (data) {
if (!main.replayChecking && !core.isReplaying()) {
core.plugin.introAndLoop(data.intro, data.time, data.loop)
core.doAction();
} else {
core.doAction();
}
});
core.registerEvent("setq", function (data) {
core.setFlag("任务地点", data.id)
core.doAction();
});
core.registerEvent("setmusics", function (data) {
if (!data.img) { core.setLocalStorage('musics', []) } else {
let a = core.getLocalStorage('musics') ?? []
if (!a.includes(data.bgm)) a.push(data.bgm)
core.setLocalStorage('musics', a)
}
core.doAction();
});
core.registerEvent("setcgs", function (data) {
if (!data.img) { core.setLocalStorage('cgs', []) } else {
let a = core.getLocalStorage('cgs') ?? []
if (!a.includes(data.img)) a.push(data.img)
core.setLocalStorage('cgs', a)
}
core.doAction();
});
};
},
"drawLight": function () {
@ -3800,8 +3832,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
@ -3811,17 +3842,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) {
@ -10856,18 +10886,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
* @type {{[EvnetName:actionParserJson]}}
*/
events_c12a15a8_c380_4b28_8144_256cba95f760.CommonEventTemplate = {
检测音乐如果没有开启则系统提示开启: [
{
检测音乐如果没有开启则系统提示开启: [{
type: "if",
condition: "!core.musicStatus.bgmStatus",
true: [
"\t[系统提示]你当前音乐处于关闭状态,本塔开音乐游戏效果更佳",
],
false: [],
},
],
仿新新魔塔一次性商人: [
{
}, ],
仿新新魔塔一次性商人: [{
type: "if",
condition: "switch:A",
true: [
@ -10882,16 +10909,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
time: 250,
},
],
false: [
{
false: [{
type: "confirm",
text: "我有3把黄钥匙\n你出50金币就卖给你。",
yes: [
{
yes: [{
type: "if",
condition: "status:money>=50",
true: [
{
true: [{
type: "setValue",
name: "status:money",
operator: "-=",
@ -10914,22 +10938,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
value: "true",
},
],
false: [
{
false: [{
type: "playSound",
name: "操作失败",
},
"\t[行商,trader]\b[this]你的金币不足!",
],
},
],
}, ],
no: [],
},
],
},
],
全地图选中一个点: [
{
}, ],
}, ],
全地图选中一个点: [{
type: "comment",
text: "全地图选中一个点,需要用鼠标或触屏操作",
},
@ -10950,8 +10969,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
{
type: "while",
condition: "true",
data: [
{
data: [{
type: "drawSelector",
image: "winskin.webp",
code: 1,
@ -10966,16 +10984,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
{
type: "if",
condition: "(flag:type === 1)",
true: [
{
true: [{
type: "if",
condition: "((temp:X===flag:x)&&(temp:Y===flag:y))",
true: [
{
true: [{
type: "break",
n: 1,
},
],
}, ],
},
{
type: "setValue",
@ -11005,8 +11020,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
loc: ["temp:X", "temp:Y"],
},
],
多阶段Boss战斗: [
{
多阶段Boss战斗: [{
type: "comment",
text: "多阶段boss请直接作为战后事件使用",
},
@ -11019,11 +11033,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
{
type: "switch",
condition: "switch:A",
caseList: [
{
caseList: [{
case: "1",
action: [
{
action: [{
type: "setBlock",
number: "redSlime",
},
@ -11032,8 +11044,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
},
{
case: "2",
action: [
{
action: [{
type: "setBlock",
number: "blackSlime",
},
@ -11042,8 +11053,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
},
{
case: "3",
action: [
{
action: [{
type: "setBlock",
number: "slimelord",
},
@ -11297,8 +11307,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
],
"event"
),
MotaActionFunctions.actionParser.parse(
{
MotaActionFunctions.actionParser.parse({
condition: "flag:__door__===2",
currentFloor: true,
priority: 0,
@ -11310,17 +11319,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
),
MotaActionBlocks["changeFloor_m"].xmlText(),
MotaActionFunctions.actionParser.parse(
[
{
[{
id: "shop1",
text: "\t[贪婪之神,moneyShop]勇敢的武士啊, 给我${20+2*flag:shop1}金币就可以:",
textInList: "1F金币商店",
choices: [
{
choices: [{
text: "生命+800",
need: "status:money>=20+2*flag:shop1",
action: [
{
action: [{
type: "comment",
text: "新版商店中需要手动扣减金币和增加访问次数",
},
@ -11343,8 +11349,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
value: "800",
},
],
},
],
}, ],
},
{
id: "itemShop",
@ -11370,26 +11375,25 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
MotaActionBlocks["eachArrive_m"].xmlText(),
MotaActionBlocks["level_m"].xmlText(),
MotaActionFunctions.actionParser.parse(
[["MTx", ""]],
[
["MTx", ""]
],
"floorPartition"
),
MotaActionBlocks["commonEvent_m"].xmlText(),
MotaActionBlocks["item_m"].xmlText(),
MotaActionFunctions.actionParser.parse(
[
{
[{
title: "简单",
name: "Easy",
hard: 1,
action: [
{ type: "comment", text: "在这里写该难度需执行的事件" },
],
},
],
}, ],
"levelChoose"
),
MotaActionFunctions.actionParser.parse(
{
MotaActionFunctions.actionParser.parse({
type: 0,
value: { atk: 10 },
percentage: { speed: 10 },
@ -11397,18 +11401,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"equip"
),
MotaActionFunctions.actionParser.parse(
[
{
[{
name: "bg.webp",
x: 0,
y: 0,
canvas: "bg",
},
],
}, ],
"floorImage"
),
MotaActionFunctions.actionParser.parse(
{
MotaActionFunctions.actionParser.parse({
time: 160,
openSound: "door.opus",
closeSound: "door.opus",
@ -11418,8 +11419,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
),
MotaActionBlocks["faceIds_m"].xmlText(),
MotaActionBlocks["mainStyle_m"].xmlText(),
MotaActionFunctions.actionParser.parse(
{
MotaActionFunctions.actionParser.parse({
背景音乐: "bgm.opus",
确定: "confirm.opus",
攻击: "attack.opus",
@ -11441,14 +11441,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"\t[小妖精,fairy]\f[fairy.webp,0,0]欢迎使用事件编辑器(双击方块可直接预览)"
),
MotaActionBlocks["over_s"].xmlText(),
MotaActionFunctions.actionParser.parseList([
{
MotaActionFunctions.actionParser.parseList([{
type: "overlist",
image: "bg_5043.webp",
memory: false,
hidetime: 30,
list: [
{
list: [{
text: "",
sound: "",
time: 50,
@ -11456,12 +11454,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
boldColor: "0,0,0,1",
font: "bold 48px Verdana",
frame: 0,
},
],
},
]),
MotaActionFunctions.actionParser.parseList([
{
}, ],
}, ]),
MotaActionFunctions.actionParser.parseList([{
type: "cgtext",
bg: "bg_5043.webp",
memory: false,
@ -11475,8 +11470,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
bodyList: [
{ name: "tati_050145a.webp", px: 100, filter: false },
],
},
]),
}, ]),
MotaActionBlocks["moveTextBox_s"].xmlText(),
MotaActionBlocks["clearTextBox_s"].xmlText(),
MotaActionBlocks["comment_s"].xmlText(),
@ -11541,6 +11535,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
MotaActionBlocks["setHeroIcon_s"].xmlText(),
MotaActionBlocks["follow_s"].xmlText(),
MotaActionBlocks["unfollow_s"].xmlText(),
],
地图处理: [
MotaActionBlocks["battle_1_s"].xmlText(),
@ -11570,20 +11565,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
MotaActionFunctions.actionParser.parseList({
type: "switch",
condition: "判别值",
caseList: [
{
caseList: [{
action: [
{ type: "comment", text: "当判别值是值的场合执行此事件" },
],
},
{
case: "default",
action: [
{
action: [{
type: "comment",
text: "当没有符合的值的场合执行default事件",
},
],
}, ],
},
],
}),
@ -11612,41 +11604,37 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
],
特效表现: [
MotaActionBlocks["sleep_s"].xmlText(),
MotaActionBlocks["setq_s"].xmlText(),
MotaActionBlocks["setcgs_s"].xmlText(),
MotaActionBlocks["setmusics_s"].xmlText(),
MotaActionBlocks["changebg_s"].xmlText(),
MotaActionFunctions.actionParser.parseList({
type: "wait",
timeout: 0,
data: [
{
data: [{
case: "keyboard",
keycode: "13,32",
action: [
{
action: [{
type: "comment",
text: "当按下回车(keycode=13)或空格(keycode=32)时执行此事件\n超时剩余时间会写入flag:timeout",
},
],
}, ],
},
{
case: "mouse",
px: [0, 32],
py: [0, 32],
action: [
{
action: [{
type: "comment",
text: "当点击地图左上角时执行此事件\n超时剩余时间会写入flag:timeout",
},
],
}, ],
},
{
case: "condition",
condition: "flag:type==0\n&&flag:keycode==13",
action: [
{
action: [{
type: "comment",
text: "当满足自定义条件时会执行此事件\n超时剩余时间会写入flag:timeout",
},
],
}, ],
},
{
case: "timeout",
@ -11663,10 +11651,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
MotaActionBlocks["changeMouse_s"].xmlText(),
MotaActionBlocks["removeMouse_s"].xmlText(),
MotaActionBlocks["vibrate_s"].xmlText(),
MotaActionBlocks["setanimate_s"].xmlText(),
MotaActionBlocks["deleteanimate_s"].xmlText(),
MotaActionBlocks["playanimate_s"].xmlText(),
MotaActionBlocks["clearanimate_s"].xmlText(),
MotaActionBlocks["animate_s"].xmlText(),
MotaActionBlocks["animate_1_s"].xmlText(),
MotaActionBlocks["stopAnimate_s"].xmlText(),
@ -11688,6 +11672,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
],
音像处理: [
MotaActionBlocks["animationDrawable_s"].xmlText(),
MotaActionBlocks["introAndLoop_s"].xmlText(),
MotaActionBlocks["setanimate_s"].xmlText(),
MotaActionBlocks["deleteanimate_s"].xmlText(),
MotaActionBlocks["playanimate_s"].xmlText(),
@ -11868,10 +11853,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var list = toolboxObj["入口方块"];
var xmlList = [];
var eventType =
(editor_blockly.isCommonEntry()
? "common"
: editor_blockly.entryType) + "_m";
for (var ii = 0, blockText; (blockText = list[ii]); ii++) {
(editor_blockly.isCommonEntry() ?
"common" :
editor_blockly.entryType) + "_m";
for (var ii = 0, blockText;
(blockText = list[ii]); ii++) {
if (
new RegExp('<block type="' + eventType + '">').exec(blockText)
) {
@ -11926,14 +11912,16 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var mousewheelOffsetValue =
(20 / 380) * workspace.scrollbar[hvScroll].handleLength_ * 3;
workspace.scrollbar[hvScroll].handlePosition_ +=
(e.deltaY || 0) + (e.detail || 0) > 0
? mousewheelOffsetValue
: -mousewheelOffsetValue;
(e.deltaY || 0) + (e.detail || 0) > 0 ?
mousewheelOffsetValue :
-mousewheelOffsetValue;
workspace.scrollbar[hvScroll].onScroll_();
// workspace.setScale(workspace.scale);
};
var doubleClickCheck = [[0, "abc"]];
var doubleClickCheck = [
[0, "abc"]
];
function omitedcheckUpdateFunction(event) {
if (event.type === "create") {
@ -12017,7 +12005,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
">"
);
if (!inputs) inputs = [];
for (var ii = 0, inputType; (inputType = rule.argsType[ii]); ii++) {
for (var ii = 0, inputType;
(inputType = rule.argsType[ii]); ii++) {
var input = inputs[ii];
var _input = "";
var noinput = input === null || input === undefined;
@ -14092,7 +14081,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];
@ -17564,5 +17556,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
});
}
});
},
"intro&loop": function () {
// 在此增加新插件
this.introAndLoop = function (intro, time, loop) {
core.playBgm(intro)
setTimeout(() => { core.playBgm(loop) }, time * 1000)
}
}
}