变更初始事件、cgtext实现方式

This commit is contained in:
草莓 2025-03-23 09:34:39 +08:00
parent a132bb8d16
commit 31f6a76b4b
11 changed files with 2052 additions and 2821 deletions

View File

@ -905,6 +905,8 @@ action
| resumeBgm_s | resumeBgm_s
| loadBgm_s | loadBgm_s
| freeBgm_s | freeBgm_s
| drawbackground_s
| clearbackground_s
| playSound_s | playSound_s
| playSound_1_s | playSound_1_s
| stopSound_s | stopSound_s
@ -1137,7 +1139,7 @@ return code;
*/; */;
cgtext_s cgtext_s
: '背景' EvalString? '不使用背景' Bool? '回忆滤镜' Bool? '移除对话框' Bool? '剧情库序列' Int '头像' EvalString?'坐标PX' Number'打字间隔' Int? BGNL? Newline : '剧情cg文本 移除对话框' Bool? '剧情库序列' Int '头像' EvalString?'坐标PX' Number'打字间隔' Int? BGNL? Newline
'自动等待时长' Int BGNL? Newline '自动等待时长' Int BGNL? Newline
textcgDrawingList+? Newline textcgDrawingList+? Newline
@ -1145,12 +1147,11 @@ cgtext_s
/* cgtext_s /* cgtext_s
tooltip : cgtext显示一段包含cg的文字剧情 tooltip : cgtext显示一段包含cg的文字剧情
helpUrl : /_docs/#/instruction helpUrl : /_docs/#/instruction
allImages : ['EvalString_0','EvalString_1'] allImages : ['EvalString_0']
default : ["bg_5043.webp",false,false,false,0,"face_050445.webp",-300,0,2000,"","这句话显示在对话框内",[{ "name":"tati_050145a.webp" , "px": 100,"filter":false }]] default : [false,0,"face_050445.webp",-300,0,2000,"","这句话显示在对话框内",[{ "name":"tati_050145a.webp" , "px": 100,"filter":false }]]
var head ='{ "name": "'+EvalString_1+'", "px": '+Number_0+' }' var head ='{ "name": "'+EvalString_0+'", "px": '+Number_0+' }'
var list=',"bodyList": [\n'+textcgDrawingList_0.slice(0,-1)+'\n]' var list=',"bodyList": [\n'+textcgDrawingList_0.slice(0,-1)+'\n]'
Bool_0=Bool_0?',"nobg":'+Bool_0:'' var code = '{"type": "cgtext","WindowSkin":'+Bool_0+',"head":'+head+' ,"index":"'+Int_0+'","time":'+Int_1+',"wait":'+Int_2+list+' },\n';
var code = '{"type": "cgtext", "bg":"'+EvalString_0+'"'+Bool_0+',"memory":'+Bool_1+',"WindowSkin":'+Bool_2+',"head":'+head+' ,"index":"'+Int_0+'","time":'+Int_1+',"wait":'+Int_2+list+' },\n';
return code; return code;
*/; */;
textcgDrawingList textcgDrawingList
@ -1967,6 +1968,34 @@ var code = '{"type": "changebg", "img1": "'+EvalString_0+'","memory1":'+Bool_0+'
return code; return code;
*/; */;
drawbackground_s
: '绘制背景' EvalString? '回忆滤镜' Bool? Newline
/* drawbackground_s
tooltip : drawbackground 绘制剧情背景
helpUrl : /_docs/#/instruction
default : ["",false]
colour : this.soundColor
allImages : ['EvalString_0']
var code = '{"type": "drawbackground", "image": "'+EvalString_0+'","memory":'+Bool_0+'},\n';
return code;
*/;
clearbackground_s
: '清除cg背景' Newline
/* clearbackground_s
tooltip : clearbackground: 剧情背景清除
helpUrl : /_docs/#/instruction
default : []
colour : this.soundColor
var code = '{"type": "clearbackground"},\n';
return code;
*/;
drawWarning_s drawWarning_s
: '警告坐标x' PosString 'y' PosString '缩放倍率'EvalString '文字大小'Int '警告内容' EvalString? '副标题' EvalString? '不播放音效' Bool? Newline : '警告坐标x' PosString 'y' PosString '缩放倍率'EvalString '文字大小'Int '警告内容' EvalString? '副标题' EvalString? '不播放音效' Bool? Newline

View File

@ -566,9 +566,6 @@ MotaActionParser = function () {
return res; return res;
}; };
this.next = MotaActionBlocks["cgtext_s"].xmlText([ this.next = MotaActionBlocks["cgtext_s"].xmlText([
data.bg,
data.nobg??false,
data.memory,
data.WindowSkin, data.WindowSkin,
data.index, data.index,
data.head.name, data.head.name,
@ -1994,7 +1991,7 @@ MotaActionParser = function () {
this.next, this.next,
]); ]);
break; break;
case "changebg": // 等待多少毫秒 case "changebg": // 改变背景
this.next = MotaActionBlocks["changebg_s"].xmlText([ this.next = MotaActionBlocks["changebg_s"].xmlText([
data.img1 ?? "", data.img1 ?? "",
data.memory1 ?? false, data.memory1 ?? false,
@ -2005,6 +2002,18 @@ MotaActionParser = function () {
this.next, this.next,
]); ]);
break; break;
case "drawbackground": // 绘制背景
this.next = MotaActionBlocks["drawbackground_s"].xmlText([
data.image ?? "",
data.memory ?? false,
this.next,
]);
break;
case "clearbackground": // 清除背景
this.next = MotaActionBlocks["clearbackground_s"].xmlText([
this.next,
]);
break;
case "wait": // 等待用户操作 case "wait": // 等待用户操作
var case_waitList = null; var case_waitList = null;
if (data.data) { if (data.data) {

View File

@ -2,6 +2,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
{ {
"main": { "main": {
"floorIds": [ "floorIds": [
"chushi",
"Caimhome", "Caimhome",
"jiuguan", "jiuguan",
"KTV", "KTV",
@ -1523,7 +1524,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"title": "秽翼的尤斯蒂娅", "title": "秽翼的尤斯蒂娅",
"name": "Eustia_text", "name": "Eustia_text",
"version": "鸽子窝造塔小队", "version": "鸽子窝造塔小队",
"floorId": "jiaocheng01", "floorId": "chushi",
"hero": { "hero": {
"image": "hero.webp", "image": "hero.webp",
"animate": false, "animate": false,
@ -1548,7 +1549,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"loc": { "loc": {
"direction": "up", "direction": "up",
"x": 6, "x": 6,
"y": 12 "y": 6
}, },
"flags": { "flags": {
"itemDetail": true, "itemDetail": true,
@ -1949,21 +1950,6 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
{ {
"type": "insert", "type": "insert",
"name": "chapter0" "name": "chapter0"
},
{
"type": "confirm",
"text": "要进行教程内容吗",
"yes": [],
"no": [
{
"type": "changeFloor",
"floorId": "guangchang",
"loc": [
6,
10
]
}
]
} }
], ],
"shops": [ "shops": [

File diff suppressed because it is too large Load Diff

View File

@ -27,8 +27,6 @@ main.floors.KTV=
}, },
{ {
"type": "cgtext", "type": "cgtext",
"bg": "bg_3531.webp",
"memory": false,
"WindowSkin": false, "WindowSkin": false,
"head": { "head": {
"name": "", "name": "",
@ -47,8 +45,6 @@ main.floors.KTV=
}, },
{ {
"type": "cgtext", "type": "cgtext",
"bg": "bg_3531.webp",
"memory": false,
"WindowSkin": false, "WindowSkin": false,
"head": { "head": {
"name": "", "name": "",
@ -67,8 +63,6 @@ main.floors.KTV=
}, },
{ {
"type": "cgtext", "type": "cgtext",
"bg": "bg_3531.webp",
"memory": false,
"WindowSkin": false, "WindowSkin": false,
"head": { "head": {
"name": "", "name": "",
@ -87,8 +81,6 @@ main.floors.KTV=
}, },
{ {
"type": "cgtext", "type": "cgtext",
"bg": "bg_3531.webp",
"memory": false,
"WindowSkin": false, "WindowSkin": false,
"head": { "head": {
"name": "", "name": "",
@ -107,8 +99,6 @@ main.floors.KTV=
}, },
{ {
"type": "cgtext", "type": "cgtext",
"bg": "bg_3531.webp",
"memory": false,
"WindowSkin": false, "WindowSkin": false,
"head": { "head": {
"name": "", "name": "",
@ -127,8 +117,6 @@ main.floors.KTV=
}, },
{ {
"type": "cgtext", "type": "cgtext",
"bg": "bg_3531.webp",
"memory": false,
"WindowSkin": false, "WindowSkin": false,
"head": { "head": {
"name": "", "name": "",
@ -147,8 +135,6 @@ main.floors.KTV=
}, },
{ {
"type": "cgtext", "type": "cgtext",
"bg": "bg_3531.webp",
"memory": false,
"WindowSkin": false, "WindowSkin": false,
"head": { "head": {
"name": "", "name": "",
@ -167,8 +153,6 @@ main.floors.KTV=
}, },
{ {
"type": "cgtext", "type": "cgtext",
"bg": "bg_3531.webp",
"memory": false,
"WindowSkin": false, "WindowSkin": false,
"head": { "head": {
"name": "", "name": "",
@ -185,6 +169,15 @@ main.floors.KTV=
} }
] ]
}, },
{
"type": "changebg",
"img1": "bg_3531.webp",
"memory1": false,
"img2": "",
"memory2": false,
"time": 30,
"style": "引出"
},
{ {
"type": "setHeroOpacity", "type": "setHeroOpacity",
"opacity": 1 "opacity": 1

79
project/floors/chushi.js Normal file
View File

@ -0,0 +1,79 @@
main.floors.chushi=
{
"floorId": "chushi",
"title": "抉择",
"name": "1",
"width": 13,
"height": 13,
"canFlyTo": true,
"canFlyFrom": true,
"canUseQuickShop": true,
"images": [],
"ratio": 1,
"defaultGround": "T400",
"firstArrive": [
{
"type": "confirm",
"text": "要进行教程内容吗",
"yes": [
{
"type": "changeFloor",
"floorId": "jiaocheng01",
"loc": [
6,
12
]
}
],
"no": [
{
"type": "changeFloor",
"floorId": "guangchang",
"loc": [
6,
10
]
}
]
}
],
"eachArrive": [],
"parallelDo": "",
"events": {},
"changeFloor": {},
"beforeBattle": {},
"afterBattle": {},
"afterGetItem": {},
"afterOpenDoor": {},
"autoEvent": {},
"cannotMove": {},
"cannotMoveIn": {},
"map": [
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
"areas": "抉择",
"bgmap": [
],
"fgmap": [
],
"bg2map": [
],
"fg2map": [
]
}

View File

@ -1724,6 +1724,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
} }
}, },
"updateStatusBar": function () { "updateStatusBar": function () {
if (!core.control.noAutoEvents) core.checkAutoEvents()
// 更新状态栏 // 更新状态栏
core.ui.statusBar.update(); core.ui.statusBar.update();
// 更新阻激夹域的伤害值 // 更新阻激夹域的伤害值

View File

@ -120,7 +120,8 @@ var icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 =
"T364": 88, "T364": 88,
"T365": 89, "T365": 89,
"T397": 90, "T397": 90,
"T399": 91 "T399": 91,
"T400": 92
}, },
"animates": { "animates": {
"star": 0, "star": 0,

View File

@ -298,6 +298,7 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e =
"397": {"cls":"items","id":"postman"}, "397": {"cls":"items","id":"postman"},
"398": {"cls":"terrains","id":"T397"}, "398": {"cls":"terrains","id":"T397"},
"399": {"cls":"terrains","id":"T399"}, "399": {"cls":"terrains","id":"T399"},
"400": {"cls":"terrains","id":"T400"},
"20034": {"cls":"tileset","id":"X20034","canPass":true}, "20034": {"cls":"tileset","id":"X20034","canPass":true},
"20154": {"cls":"tileset","id":"X20154","canPass":true}, "20154": {"cls":"tileset","id":"X20154","canPass":true},
"20216": {"cls":"tileset","id":"X20216","canPass":true}, "20216": {"cls":"tileset","id":"X20216","canPass":true},

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

@ -29,6 +29,24 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.removeMouse(data.div); core.removeMouse(data.div);
core.doAction(); core.doAction();
}); });
core.registerEvent("drawbackground", function (data) {
if (!main.replayChecking && !core.isReplaying()) {
core.drawbackground(data.image, data.memory);
core.ui.cgText.image = data.image;
core.ui.cgText.memory = data.memory;
} else {
core.doAction();
}
});
core.registerEvent("clearbackground", function (data) {
if (!main.replayChecking && !core.isReplaying()) {
core.clearbackground();
core.ui.cgText.image = "";
} else {
core.doAction();
}
});
core.registerEvent("addPop", function (data) { core.registerEvent("addPop", function (data) {
if (!main.replayChecking && !core.isReplaying()) { if (!main.replayChecking && !core.isReplaying()) {
data.value = core.replaceText(data.value); data.value = core.replaceText(data.value);
@ -103,6 +121,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
data.time, data.time,
data.style data.style
); );
if (data.style === "引出") { core.ui.cgText.image = ""; } else {} core.ui.cgText.image = data.img2;
core.ui.cgText.memory = data.memory2;
} else { } else {
core.doAction(); core.doAction();
} }
@ -196,9 +216,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}); });
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.nobg = data.nobg ?? false;
core.ui.cgText.memory = data.memory;
core.ui.cgText.head = core.clone(data.head); core.ui.cgText.head = core.clone(data.head);
core.ui.cgText.index = data.index; core.ui.cgText.index = data.index;
core.ui.cgText.name = core.ui.cgText.textList[data.index][0]; core.ui.cgText.name = core.ui.cgText.textList[data.index][0];
@ -11613,18 +11631,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
* @type {{[EvnetName:actionParserJson]}} * @type {{[EvnetName:actionParserJson]}}
*/ */
events_c12a15a8_c380_4b28_8144_256cba95f760.CommonEventTemplate = { events_c12a15a8_c380_4b28_8144_256cba95f760.CommonEventTemplate = {
检测音乐如果没有开启则系统提示开启: [ 检测音乐如果没有开启则系统提示开启: [{
{
type: "if", type: "if",
condition: "!core.musicStatus.bgmStatus", condition: "!core.musicStatus.bgmStatus",
true: [ true: [
"\t[系统提示]你当前音乐处于关闭状态,本塔开音乐游戏效果更佳", "\t[系统提示]你当前音乐处于关闭状态,本塔开音乐游戏效果更佳",
], ],
false: [], false: [],
}, }, ],
], 仿新新魔塔一次性商人: [{
仿新新魔塔一次性商人: [
{
type: "if", type: "if",
condition: "switch:A", condition: "switch:A",
true: [ true: [
@ -11639,16 +11654,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
time: 250, time: 250,
}, },
], ],
false: [ false: [{
{
type: "confirm", type: "confirm",
text: "我有3把黄钥匙\n你出50金币就卖给你。", text: "我有3把黄钥匙\n你出50金币就卖给你。",
yes: [ yes: [{
{
type: "if", type: "if",
condition: "status:money>=50", condition: "status:money>=50",
true: [ true: [{
{
type: "setValue", type: "setValue",
name: "status:money", name: "status:money",
operator: "-=", operator: "-=",
@ -11671,22 +11683,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
value: "true", value: "true",
}, },
], ],
false: [ false: [{
{
type: "playSound", type: "playSound",
name: "操作失败", name: "操作失败",
}, },
"\t[行商,trader]\b[this]你的金币不足!", "\t[行商,trader]\b[this]你的金币不足!",
], ],
}, }, ],
],
no: [], no: [],
}, }, ],
], }, ],
}, 全地图选中一个点: [{
],
全地图选中一个点: [
{
type: "comment", type: "comment",
text: "全地图选中一个点,需要用鼠标或触屏操作", text: "全地图选中一个点,需要用鼠标或触屏操作",
}, },
@ -11707,8 +11714,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
{ {
type: "while", type: "while",
condition: "true", condition: "true",
data: [ data: [{
{
type: "drawSelector", type: "drawSelector",
image: "winskin.webp", image: "winskin.webp",
code: 1, code: 1,
@ -11723,16 +11729,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
{ {
type: "if", type: "if",
condition: "(flag:type === 1)", condition: "(flag:type === 1)",
true: [ true: [{
{
type: "if", type: "if",
condition: "((temp:X===flag:x)&&(temp:Y===flag:y))", condition: "((temp:X===flag:x)&&(temp:Y===flag:y))",
true: [ true: [{
{
type: "break", type: "break",
n: 1, n: 1,
}, }, ],
],
}, },
{ {
type: "setValue", type: "setValue",
@ -11762,8 +11765,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
loc: ["temp:X", "temp:Y"], loc: ["temp:X", "temp:Y"],
}, },
], ],
多阶段Boss战斗: [ 多阶段Boss战斗: [{
{
type: "comment", type: "comment",
text: "多阶段boss请直接作为战后事件使用", text: "多阶段boss请直接作为战后事件使用",
}, },
@ -11776,11 +11778,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
{ {
type: "switch", type: "switch",
condition: "switch:A", condition: "switch:A",
caseList: [ caseList: [{
{
case: "1", case: "1",
action: [ action: [{
{
type: "setBlock", type: "setBlock",
number: "redSlime", number: "redSlime",
}, },
@ -11789,8 +11789,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}, },
{ {
case: "2", case: "2",
action: [ action: [{
{
type: "setBlock", type: "setBlock",
number: "blackSlime", number: "blackSlime",
}, },
@ -11799,8 +11798,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}, },
{ {
case: "3", case: "3",
action: [ action: [{
{
type: "setBlock", type: "setBlock",
number: "slimelord", number: "slimelord",
}, },
@ -12054,8 +12052,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
], ],
"event" "event"
), ),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse({
{
condition: "flag:__door__===2", condition: "flag:__door__===2",
currentFloor: true, currentFloor: true,
priority: 0, priority: 0,
@ -12067,17 +12064,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
), ),
MotaActionBlocks["changeFloor_m"].xmlText(), MotaActionBlocks["changeFloor_m"].xmlText(),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse(
[ [{
{
id: "shop1", id: "shop1",
text: "\t[贪婪之神,moneyShop]勇敢的武士啊, 给我${20+2*flag:shop1}金币就可以:", text: "\t[贪婪之神,moneyShop]勇敢的武士啊, 给我${20+2*flag:shop1}金币就可以:",
textInList: "1F金币商店", textInList: "1F金币商店",
choices: [ choices: [{
{
text: "生命+800", text: "生命+800",
need: "status:money>=20+2*flag:shop1", need: "status:money>=20+2*flag:shop1",
action: [ action: [{
{
type: "comment", type: "comment",
text: "新版商店中需要手动扣减金币和增加访问次数", text: "新版商店中需要手动扣减金币和增加访问次数",
}, },
@ -12100,8 +12094,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
value: "800", value: "800",
}, },
], ],
}, }, ],
],
}, },
{ {
id: "itemShop", id: "itemShop",
@ -12127,26 +12120,25 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
MotaActionBlocks["eachArrive_m"].xmlText(), MotaActionBlocks["eachArrive_m"].xmlText(),
MotaActionBlocks["level_m"].xmlText(), MotaActionBlocks["level_m"].xmlText(),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse(
[["MTx", ""]], [
["MTx", ""]
],
"floorPartition" "floorPartition"
), ),
MotaActionBlocks["commonEvent_m"].xmlText(), MotaActionBlocks["commonEvent_m"].xmlText(),
MotaActionBlocks["item_m"].xmlText(), MotaActionBlocks["item_m"].xmlText(),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse(
[ [{
{
title: "简单", title: "简单",
name: "Easy", name: "Easy",
hard: 1, hard: 1,
action: [ action: [
{ type: "comment", text: "在这里写该难度需执行的事件" }, { type: "comment", text: "在这里写该难度需执行的事件" },
], ],
}, }, ],
],
"levelChoose" "levelChoose"
), ),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse({
{
type: 0, type: 0,
value: { atk: 10 }, value: { atk: 10 },
percentage: { speed: 10 }, percentage: { speed: 10 },
@ -12154,18 +12146,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"equip" "equip"
), ),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse(
[ [{
{
name: "bg.webp", name: "bg.webp",
x: 0, x: 0,
y: 0, y: 0,
canvas: "bg", canvas: "bg",
}, }, ],
],
"floorImage" "floorImage"
), ),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse({
{
time: 160, time: 160,
openSound: "door.opus", openSound: "door.opus",
closeSound: "door.opus", closeSound: "door.opus",
@ -12175,8 +12164,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
), ),
MotaActionBlocks["faceIds_m"].xmlText(), MotaActionBlocks["faceIds_m"].xmlText(),
MotaActionBlocks["mainStyle_m"].xmlText(), MotaActionBlocks["mainStyle_m"].xmlText(),
MotaActionFunctions.actionParser.parse( MotaActionFunctions.actionParser.parse({
{
背景音乐: "bgm.opus", 背景音乐: "bgm.opus",
确定: "confirm.opus", 确定: "confirm.opus",
攻击: "attack.opus", 攻击: "attack.opus",
@ -12198,14 +12186,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
"\t[小妖精,fairy]\f[fairy.webp,0,0]欢迎使用事件编辑器(双击方块可直接预览)" "\t[小妖精,fairy]\f[fairy.webp,0,0]欢迎使用事件编辑器(双击方块可直接预览)"
), ),
MotaActionBlocks["over_s"].xmlText(), MotaActionBlocks["over_s"].xmlText(),
MotaActionFunctions.actionParser.parseList([ MotaActionFunctions.actionParser.parseList([{
{
type: "overlist", type: "overlist",
image: "bg_5043.webp", image: "bg_5043.webp",
memory: false, memory: false,
hidetime: 30, hidetime: 30,
list: [ list: [{
{
text: "", text: "",
sound: "", sound: "",
time: 50, time: 50,
@ -12213,13 +12199,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
boldColor: "0,0,0,1", boldColor: "0,0,0,1",
font: "bold 48px Verdana", font: "bold 48px Verdana",
frame: 0, frame: 0,
}, }, ],
], }, ]),
},
]),
MotaActionBlocks["cgtextList_s"].xmlText(), MotaActionBlocks["cgtextList_s"].xmlText(),
MotaActionFunctions.actionParser.parseList([ MotaActionFunctions.actionParser.parseList([{
{
type: "cgtext", type: "cgtext",
bg: "bg_5043.webp", bg: "bg_5043.webp",
memory: false, memory: false,
@ -12234,8 +12217,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
bodyList: [ bodyList: [
{ name: "tati_050145a.webp", px: 100, filter: false }, { name: "tati_050145a.webp", px: 100, filter: false },
], ],
}, }, ]),
]),
MotaActionBlocks["moveTextBox_s"].xmlText(), MotaActionBlocks["moveTextBox_s"].xmlText(),
MotaActionBlocks["clearTextBox_s"].xmlText(), MotaActionBlocks["clearTextBox_s"].xmlText(),
MotaActionBlocks["comment_s"].xmlText(), MotaActionBlocks["comment_s"].xmlText(),
@ -12329,20 +12311,17 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
MotaActionFunctions.actionParser.parseList({ MotaActionFunctions.actionParser.parseList({
type: "switch", type: "switch",
condition: "判别值", condition: "判别值",
caseList: [ caseList: [{
{
action: [ action: [
{ type: "comment", text: "当判别值是值的场合执行此事件" }, { type: "comment", text: "当判别值是值的场合执行此事件" },
], ],
}, },
{ {
case: "default", case: "default",
action: [ action: [{
{
type: "comment", type: "comment",
text: "当没有符合的值的场合执行default事件", text: "当没有符合的值的场合执行default事件",
}, }, ],
],
}, },
], ],
}), }),
@ -12375,40 +12354,35 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
MotaActionBlocks["setcgs_s"].xmlText(), MotaActionBlocks["setcgs_s"].xmlText(),
MotaActionBlocks["setmusics_s"].xmlText(), MotaActionBlocks["setmusics_s"].xmlText(),
MotaActionBlocks["changebg_s"].xmlText(), MotaActionBlocks["changebg_s"].xmlText(),
MotaActionBlocks["drawbackground_s"].xmlText(),
MotaActionBlocks["clearbackground_s"].xmlText(),
MotaActionFunctions.actionParser.parseList({ MotaActionFunctions.actionParser.parseList({
type: "wait", type: "wait",
timeout: 0, timeout: 0,
data: [ data: [{
{
case: "keyboard", case: "keyboard",
keycode: "13,32", keycode: "13,32",
action: [ action: [{
{
type: "comment", type: "comment",
text: "当按下回车(keycode=13)或空格(keycode=32)时执行此事件\n超时剩余时间会写入flag:timeout", text: "当按下回车(keycode=13)或空格(keycode=32)时执行此事件\n超时剩余时间会写入flag:timeout",
}, }, ],
],
}, },
{ {
case: "mouse", case: "mouse",
px: [0, 32], px: [0, 32],
py: [0, 32], py: [0, 32],
action: [ action: [{
{
type: "comment", type: "comment",
text: "当点击地图左上角时执行此事件\n超时剩余时间会写入flag:timeout", text: "当点击地图左上角时执行此事件\n超时剩余时间会写入flag:timeout",
}, }, ],
],
}, },
{ {
case: "condition", case: "condition",
condition: "flag:type==0\n&&flag:keycode==13", condition: "flag:type==0\n&&flag:keycode==13",
action: [ action: [{
{
type: "comment", type: "comment",
text: "当满足自定义条件时会执行此事件\n超时剩余时间会写入flag:timeout", text: "当满足自定义条件时会执行此事件\n超时剩余时间会写入flag:timeout",
}, }, ],
],
}, },
{ {
case: "timeout", case: "timeout",
@ -12625,10 +12599,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var list = toolboxObj["入口方块"]; var list = toolboxObj["入口方块"];
var xmlList = []; var xmlList = [];
var eventType = var eventType =
(editor_blockly.isCommonEntry() (editor_blockly.isCommonEntry() ?
? "common" "common" :
: editor_blockly.entryType) + "_m"; editor_blockly.entryType) + "_m";
for (var ii = 0, blockText; (blockText = list[ii]); ii++) { for (var ii = 0, blockText;
(blockText = list[ii]); ii++) {
if ( if (
new RegExp('<block type="' + eventType + '">').exec(blockText) new RegExp('<block type="' + eventType + '">').exec(blockText)
) { ) {
@ -12683,14 +12658,16 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
var mousewheelOffsetValue = var mousewheelOffsetValue =
(20 / 380) * workspace.scrollbar[hvScroll].handleLength_ * 3; (20 / 380) * workspace.scrollbar[hvScroll].handleLength_ * 3;
workspace.scrollbar[hvScroll].handlePosition_ += workspace.scrollbar[hvScroll].handlePosition_ +=
(e.deltaY || 0) + (e.detail || 0) > 0 (e.deltaY || 0) + (e.detail || 0) > 0 ?
? mousewheelOffsetValue mousewheelOffsetValue :
: -mousewheelOffsetValue; -mousewheelOffsetValue;
workspace.scrollbar[hvScroll].onScroll_(); workspace.scrollbar[hvScroll].onScroll_();
// workspace.setScale(workspace.scale); // workspace.setScale(workspace.scale);
}; };
var doubleClickCheck = [[0, "abc"]]; var doubleClickCheck = [
[0, "abc"]
];
function omitedcheckUpdateFunction(event) { function omitedcheckUpdateFunction(event) {
if (event.type === "create") { if (event.type === "create") {
@ -12774,7 +12751,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
">" ">"
); );
if (!inputs) inputs = []; 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 = inputs[ii];
var _input = ""; var _input = "";
var noinput = input === null || input === undefined; var noinput = input === null || input === undefined;
@ -12838,7 +12816,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
.split("// start mark sfergsvae")[1] .split("// start mark sfergsvae")[1]
.split("// end mark sfergsvae")[0]; .split("// end mark sfergsvae")[0];
} }
}, },
"夹击激光动画": function () { "夹击激光动画": function () {
function createCanvas(name, zIndex) { function createCanvas(name, zIndex) {
if (!name) return; if (!name) return;
@ -15748,7 +15726,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
// 在此增加新插件 // 在此增加新插件
const cg = document.createElement("canvas"); //cg画布设置 const cg = document.createElement("canvas"); //cg画布设置
cg.style.position = "absolute"; cg.style.position = "absolute";
cg.style.zIndex = 300; cg.style.zIndex = 320;
cg.style.display = "none"; cg.style.display = "none";
cg.id = "cgText"; cg.id = "cgText";
main.dom.gameGroup.insertAdjacentElement("afterend", cg); main.dom.gameGroup.insertAdjacentElement("afterend", cg);
@ -15759,7 +15737,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
main.dom.cgText = cg; main.dom.cgText = cg;
const logcanvas = document.createElement("canvas"); //cg画布设置 const logcanvas = document.createElement("canvas"); //cg画布设置
logcanvas.style.position = "absolute"; logcanvas.style.position = "absolute";
logcanvas.style.zIndex = 301; logcanvas.style.zIndex = 321;
logcanvas.style.display = "none"; logcanvas.style.display = "none";
logcanvas.id = "cgText"; logcanvas.id = "cgText";
main.dom.gameGroup.insertAdjacentElement("afterend", logcanvas); main.dom.gameGroup.insertAdjacentElement("afterend", logcanvas);
@ -16267,7 +16245,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
update() { update() {
this.background(); this.background()
if (this.log) this.logdraw(this.page); if (this.log) this.logdraw(this.page);
} }
logdraw(page) { logdraw(page) {
@ -16435,9 +16413,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.ui._buildFont(66, true) core.ui._buildFont(66, true)
); );
} }
background() {
const img = core.material.images.images?.[this.image];
background() {
if (core.domStyle.isVertical) { if (core.domStyle.isVertical) {
ctx.canvas.width = 1248; ctx.canvas.width = 1248;
ctx.canvas.height = 2028; ctx.canvas.height = 2028;
@ -16448,16 +16425,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
ctx.canvas.width = 2028; ctx.canvas.width = 2028;
ctx.canvas.height = 1248; ctx.canvas.height = 1248;
} }
if (this.nobg) {} else {
if (img) {
//绘制背景
if (this.memory) ctx.filter = "sepia(50%)";
ctx.drawImage(img, 0, 0, 2028, 1248);
ctx.filter = "none";
} else {
core.fillRect(ctx, 0, 0, 2028, 1248);
}
}
this.bodyList.forEach((v) => { this.bodyList.forEach((v) => {
//绘制立绘 //绘制立绘
const body = core.material.images.images?.[v.name]; const body = core.material.images.images?.[v.name];
@ -16766,8 +16734,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
image, image,
memory, memory,
hidetime = 30, hidetime = 30,
list = [ list = [{
{
text: "", text: "",
sound: "", sound: "",
time: 50, time: 50,
@ -16775,8 +16742,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();
@ -17062,7 +17028,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
ctx.restore(); ctx.restore();
if (globalAlpha1 >= time) { if (globalAlpha1 >= time) {
core.unregisterAnimationFrame("bgin"); core.unregisterAnimationFrame("bgin");
over.style.display = "none";
core.doAction(); core.doAction();
} }
} }
@ -17144,16 +17110,47 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
ctx.restore(); ctx.restore();
if (globalAlpha2 <= 0 || globalAlpha1 >= time) { if (globalAlpha2 <= 0 || globalAlpha1 >= time) {
core.unregisterAnimationFrame("changebg"); core.unregisterAnimationFrame("changebg");
over.style.display = "none";
core.doAction(); core.doAction();
} }
} }
}); });
break; break;
} }
}; };
}, this.drawbackground = function (image, memory) {
const img = core.material.images.images?.[this.image];
over.style.display = "block";
if (core.domStyle.isVertical) {
ctx.canvas.width = 1248;
ctx.canvas.height = 2028;
ctx.save(); //保存设置
ctx.translate(1248, 0); //重新定位右上角为基准
ctx.rotate(Math.PI / 2); //旋转90度
} else {
ctx.canvas.width = 2028;
ctx.canvas.height = 1248;
}
if (img) {
//绘制背景
if (memory) ctx.filter = "sepia(70%)";
ctx.drawImage(img, 0, 0, 2028, 1248);
ctx.filter = "none";
} else {
core.fillRect(ctx, 0, 0, 2028, 1248);
}
ctx.restore();
core.doAction();
}
this.clearbackground = function () {
over.style.display = "none";
core.doAction();
}
},
"回合制boss战": function () { "回合制boss战": function () {
// 在此增加新插件 // 在此增加新插件
const boss = document.createElement("canvas"); //boss战画布设置 const boss = document.createElement("canvas"); //boss战画布设置
@ -19702,14 +19699,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (farme > allFarme) { if (farme > allFarme) {
core.unregisterAnimationFrame("animationDrawable"); core.unregisterAnimationFrame("animationDrawable");
over.style.display = "none";
core.doAction(); core.doAction();
} }
} }
} }
); );
}; };
}, },
"musicMode": function () { "musicMode": function () {
// 在此增加新插件 // 在此增加新插件
const music = document.createElement("canvas"); const music = document.createElement("canvas");
@ -23673,11 +23670,26 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
//////存读档界面更新 //////存读档界面更新
class SL { class SL {
constructor() { constructor() {
this.index = -1; this.index = 0;
this.refresh = false this.refresh = false;
this.page = 0;
this.max_page = 1000
}
update() {
core.clearMap(ctx)
core.ui._drawSLPanel_draw(this.page, this.max_page)
}
setIndex(index = this.index, refresh = this.refresh) {
this.index = index
this.refresh = refresh
}
setPage(page = this.page) {
this.page = page
}
setMax_page(max_page = this.max_page) {
this.max_page = max_page
} }
update() {}
set() {}
} }
core.saveLoad = new SL() core.saveLoad = new SL()
////// 绘制存档/读档界面 ////// ////// 绘制存档/读档界面 //////
@ -23703,8 +23715,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
last_page = core.status.event.data.page; last_page = core.status.event.data.page;
mode = core.status.event.data.mode; mode = core.status.event.data.mode;
} }
core.saveLoad.setIndex(index, refresh)
core.saveLoad.setPage(page)
core.saveLoad.setMax_page(max_page)
core.status.event.data = { 'page': page, 'offset': offset, 'mode': mode }; core.status.event.data = { 'page': page, 'offset': offset, 'mode': mode };
core.status.event.ui = core.status.event.ui || []; core.status.event.ui = core.status.event.ui || [];
saveLoad.style.display = "block"
if (refresh || page != last_page) { if (refresh || page != last_page) {
core.status.event.ui = []; core.status.event.ui = [];
this._drawSLPanel_loadSave(page, function () { this._drawSLPanel_loadSave(page, function () {
@ -23714,34 +23730,94 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
} }
ui.prototype._drawSLPanel_draw = function (page, max_page) { ui.prototype._drawSLPanel_draw = function (page, max_page) {
if (core.domStyle.isVertical) {
ctx.canvas.width = 1248;
ctx.canvas.height = 2028;
ctx.save(); //保存设置
ctx.translate(1248, 0); //重新定位右上角为基准
ctx.rotate(Math.PI / 2); //旋转90度
} else {
ctx.canvas.width = 2028;
ctx.canvas.height = 1248;
}
// --- 绘制背景 // --- 绘制背景
this._drawSLPanel_drawBackground(); this._drawSLPanel_drawBackground();
// --- 绘制文字 // --- 绘制文字
core.ui.drawPagination(page + 1, max_page); core.setTextAlign(ctx, 'center');
core.setTextAlign('ui', 'center');
var bottom = core._PY_ - 13; var bottom = 1248 - 39;
core.fillText('ui', '返回游戏', core._PX_ - 48, bottom, '#DDDDDD', this._buildFont(15, true)); core.fillText(ctx, '返回游戏', 1850, bottom, '#DDDDDD', this._buildFont(45, true));
if (core.status.event.selection) if (core.status.event.selection)
core.setFillStyle('ui', '#FF6A6A'); core.setFillStyle(ctx, '#FF6A6A');
if (core.status.event.id == 'save') if (core.status.event.id == 'save')
core.fillText('ui', '删除模式', 48, bottom); core.fillText(ctx, '删除模式', 1300, bottom);
else { else {
if (core.status.event.data.mode == 'all') {
core.fillText('ui', '[E]显示收藏', 52, bottom); core.fillText(ctx, '收藏', 100, 800, core.status.event.data.mode == 'all' ? "#DDDDDD" : "#DDDD44");
} else {
core.fillText('ui', '[E]显示全部', 52, bottom); core.fillText(ctx, '全部', 100, 400, core.status.event.data.mode == 'all' ? "#DDDD44" : "#DDDDDD");
} }
if (core.status.event.id !== 'save') {
ctx.strokeStyle = "#DDDDDD";
ctx.lineWidth = 6
ctx.beginPath();
ctx.moveTo(60, 624)
if (core.status.event.data.mode == 'all') {
ctx.arcTo(60, 624, 30, 624, 60)
ctx.lineTo(30, 994)
ctx.arcTo(30, 994, 60, 1024, 30)
ctx.lineTo(200, 1024)
ctx.lineTo(200, 624)
ctx.stroke()
ctx.strokeStyle = "#DDDD44"
ctx.beginPath()
ctx.moveTo(200, 624)
ctx.lineTo(60, 624)
ctx.arcTo(60, 624, 30, 594, 30)
ctx.lineTo(30, 254)
ctx.arcTo(30, 254, 60, 224, 30)
ctx.lineTo(200, 224)
ctx.stroke()
} else {
ctx.lineTo(60, 624)
ctx.arc(60, 654, 30, Math.PI / 2, Math.PI)
ctx.lineTo(30, 254)
ctx.arc(60, 254, 30, 3 / 2 * Math.PI, 2 * Math.PI)
ctx.lineTo(200, 224)
ctx.lineTo(200, 624)
ctx.stroke()
ctx.strokeStyle = "#DDDD44"
ctx.beginPath()
ctx.moveTo(200, 624)
ctx.lineTo(60, 624)
ctx.arc(60, 654, 30, 2 * Math.PI, 3 / 2 * Math.PI)
ctx.lineTo(30, 994)
ctx.arc(60, 994, 30, Math.PI, Math.PI / 2)
ctx.lineTo(200, 1024)
ctx.stroke()
}
} }
// --- 绘制记录 // --- 绘制记录
this._drawSLPanel_drawRecords(); this._drawSLPanel_drawRecords();
ctx.restore();
} }
ui.prototype._drawSLPanel_drawBackground = function () { ui.prototype._drawSLPanel_drawBackground = function () {
core.clearMap('ui');
core.setAlpha('ui', 0.85); const bg = core.material.images.images["bg_5043.webp"]; //背景
core.fillRect('ui', 0, 0, core._PX_, core._PY_, '#000000'); // 可改成背景图 core.fillRect(ctx, 0, 0, 2028, 1248, "#000000"); //黑色背景
core.setAlpha('ui', 1); ctx.globalAlpha = 0.5; //透明度
if (bg) ctx.drawImage(bg, 0, 0, 1280, 720, 0, 0, 2028, 1248); //绘制半透明背景图片
ctx.globalAlpha = 1; //恢复为不透明
} }
ui.prototype._drawSLPanel_loadSave = function (page, callback) { ui.prototype._drawSLPanel_loadSave = function (page, callback) {
@ -24138,7 +24214,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
if (keycode == 70 && core.status.event.data.mode == 'all') { // F if (keycode == 70 && core.status.event.data.mode == 'all') { // F
this._clickSL_favorite(page, offset); this._clickSL_favorite(page, offset);
} }
}}, }
},
"scrollingText": function () { "scrollingText": function () {
// 本插件用于绘制在线留言 // 本插件用于绘制在线留言
// 说明https://h5mota.com/bbs/thread/?tid=1017 // 说明https://h5mota.com/bbs/thread/?tid=1017