Merge branch 'story' into status-itcfangye
This commit is contained in:
commit
1eec945d93
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
_saves/
|
||||
_server/config.json
|
@ -1 +0,0 @@
|
||||
1
|
@ -1 +0,0 @@
|
||||
N4IgZgNg9lBOCSATEAuEBnALrApjzADAIwgA0IAFjrFKqAJYC2AhgOY6qXVQB0A7jgBGABzIhmAOybNMHFGGYR0OchOaM5IAMLMmYiADdURchWEsAHqgCct66dEoiBF+RZrLqALQmQ75qgE5DIA1sauIIg4YOFBflExKHHownjISW5QEjgAnoHkOBaOcTgAjgCu9OY4EpioANoAuuT0sozodCAAxllYkpgdKKCCMGFO5JB5TgC+5JgwSnSzIGWVwoOg6HxwiCQzy9BdnYj0uF2Y9Fmc5aLkVigArORTzsuQbBsgrTiMACL4uggqGw5RUIHKygAQvgBDUADL0VgUOooEFggD66OUOEQmOMAHYAGwEawADgATOSACxxTGwSS49EE4lkyk04K4ZiDeqgDyaAA65SpOAIgkFDy6VPJYhY6wa2l0jAoUA0IEas156gFQpFYvKEqlMuYcpQ9RAACt6OVWOVJGqNSA+ZxBcLReLJdK3MbuSAANIAFQAavbSJrVWhBfjyYTyZHyWASF6TWaA4GAGLS9Whx1a53lKMxuMJo3JkCsKAQRAhXIhsPa116g2evze+WCegUCHlWhZut513Md2GpM+y3MKCYSSsWs58MgF0iwf6j0ln3oKgSVgSAzK1W92f1xdD5uytcUejb3ccfdOiP56Ox+/Fkfyy048cz2/z++Fp+JlullguD4MQYhAXghDNjaU5dBQU5iNBm6wVOzYWPQ45oVOoF3OhUCYZuBCobh+GsAAzJ+uYoBI5QQBAL6miAOT0BUJA3pR1G0fRZpMRUmYOreHF0QBPo8eU5FseGglcYxzFChRkk0UJp7yqJDzyXIUnCSpsmEupqCacpDGifielUYp0miaSpkGa2RmydY1nmVpdksQQ9rNBgIRVKgChKGCcGwOktLogFiBaBWcB4mguDIOQmLfIwAASF6YFFTRxeiEA4MwBg4HCUBdFFwDLJiBj0Og3yMp04EgXsaLLIIMJ4BIACCmCTl0IS/DIARmZxICYswOD0GlHmYic6DMIIWVVUMGDYBBoGmvURCkQ8zRNOqbwVtAAiwNyHlYDgJq+H0FxYPQXSfPMk4QP6TByOSDxEEQUpRjwhJ2C91hPN05SwLA93hkQDxUtYPCkXYUNQ4SDj5CAggyJgWXw4wWQ1hkKxFPDiPtVl3UsOw8PCFA5VZATbByCUFjYMwFNE5jaO5b8pw4OcEBTHEiISHAOAAMqyCaySTrAKKElSDykTwVLTMsoWcKu1ULbVnSyg0QQa6Qmva1ruv1D4pAG0bJgG0ExuGyblsWxbzQa1t5A0OUsicL6UAZloVKsAAvGIBiKKCGzLLl+2XBIebWDgpGIOKggPAQkbMNY0flNYhHx/qpKg+6BBgIK1iEkQMTkDa9DpCA5LMIghKEog1iFYgYBgFS6JUqSifooIVKEmA6JgIgU0EDgNJV3gYgXMD+KkficfWKRBBSi40xAA==
|
@ -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
|
||||
@ -2621,12 +2640,26 @@ tooltip : setcgs:cg回廊中的cg获取
|
||||
helpUrl : /_docs/#/instruction
|
||||
default : [""]
|
||||
allImages : ['EvalString_0']
|
||||
colour : this.imageColor
|
||||
colour : this.soundColor
|
||||
EvalString_0 = EvalString_0 ? (', "img": "'+EvalString_0+'"') : '';
|
||||
var code = '{"type": "setcgs"'+EvalString_0+'},\n';
|
||||
return code;
|
||||
*/;
|
||||
|
||||
setmusics_s
|
||||
: '音乐鉴赏music 文件名'EvalString?'不填为清空music获取记录' 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
|
||||
|
||||
|
@ -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),
|
||||
|
@ -1 +0,0 @@
|
||||
{ "viewportLoc": [0, 0], "editorLastFloorId": "jiedao" }
|
@ -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];
|
||||
|
1
main.js
1
main.js
@ -492,7 +492,6 @@ main.prototype.selectButton = function (index) {
|
||||
main.prototype.importFonts = function (fonts) {
|
||||
if (!(fonts instanceof Array) || fonts.length == 0) return;
|
||||
var style = document.createElement("style");
|
||||
style.type = "text/css";
|
||||
var html = "";
|
||||
fonts.forEach(function (font) {
|
||||
html +=
|
||||
|
BIN
project/bgms/Ascension.opus
Normal file
BIN
project/bgms/Ascension.opus
Normal file
Binary file not shown.
Binary file not shown.
BIN
project/bgms/Blood_Stain.opus
Normal file
BIN
project/bgms/Blood_Stain.opus
Normal file
Binary file not shown.
BIN
project/bgms/Halbmond.opus
Normal file
BIN
project/bgms/Halbmond.opus
Normal file
Binary file not shown.
BIN
project/bgms/ed.opus
Normal file
BIN
project/bgms/ed.opus
Normal file
Binary file not shown.
BIN
project/bgms/theme.mp3
Normal file
BIN
project/bgms/theme.mp3
Normal file
Binary file not shown.
Binary file not shown.
@ -897,11 +897,15 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
||||
"zone"
|
||||
],
|
||||
"bgms": [
|
||||
"Ascension.opus",
|
||||
"Asphodelus_Ceui.opus",
|
||||
"Blind_Alley.opus",
|
||||
"Blood_Stain.opus",
|
||||
"Crawler.opus",
|
||||
"Halbmond.opus",
|
||||
"ed.opus",
|
||||
"op.opus",
|
||||
"theme.opus"
|
||||
"theme.mp3"
|
||||
],
|
||||
"sounds": [
|
||||
"aiy010000010.opus",
|
||||
@ -1019,6 +1023,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
||||
],
|
||||
"fonts": [
|
||||
"HATTEN",
|
||||
"Verdana",
|
||||
"number",
|
||||
"pala",
|
||||
"simhei"
|
||||
@ -1057,7 +1062,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
||||
"饰品",
|
||||
"饰品"
|
||||
],
|
||||
"startBgm": "theme.opus",
|
||||
"startBgm": "theme.mp3",
|
||||
"styles": {
|
||||
"startBackground": "project/images/background.webp",
|
||||
"startVerticalBackground": "project/images/backgroundvertical.webp",
|
||||
@ -1489,6 +1494,10 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
|
||||
"type": "setValue",
|
||||
"name": "item:fly",
|
||||
"value": "1"
|
||||
},
|
||||
{
|
||||
"type": "insert",
|
||||
"name": "强制横屏"
|
||||
}
|
||||
],
|
||||
"shops": [
|
||||
|
@ -435,6 +435,11 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 =
|
||||
"time": 30,
|
||||
"style": "场景切换"
|
||||
},
|
||||
{
|
||||
"type": "playBgm",
|
||||
"name": "Blood_Stain.opus",
|
||||
"keep": true
|
||||
},
|
||||
{
|
||||
"type": "cgtext",
|
||||
"bg": "other_0001.webp",
|
||||
@ -3397,6 +3402,11 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 =
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "playBgm",
|
||||
"name": "Halbmond.opus",
|
||||
"keep": true
|
||||
},
|
||||
{
|
||||
"type": "cgtext",
|
||||
"bg": "bg_3601.webp",
|
||||
|
@ -26,58 +26,25 @@ main.floors.street01=
|
||||
"direction": "up"
|
||||
}
|
||||
],
|
||||
"6,11": [
|
||||
"10,11": [
|
||||
{
|
||||
"type": "insert",
|
||||
"name": "chapter04"
|
||||
"type": "setmusics",
|
||||
"bgm": "op.opus"
|
||||
}
|
||||
],
|
||||
"4,11": [
|
||||
"10,10": [
|
||||
{
|
||||
"type": "animationDrawable",
|
||||
"allFarme": 300,
|
||||
"color": [
|
||||
0,
|
||||
0,
|
||||
0
|
||||
],
|
||||
"imageList": [
|
||||
{
|
||||
"image": "bg_1511.webp",
|
||||
"beforefarme": 50,
|
||||
"globalAlpha": 0,
|
||||
"afterfarme": 250,
|
||||
"aglobalAlpha": 100
|
||||
"type": "setmusics",
|
||||
"bgm": "ed.opus"
|
||||
},
|
||||
{
|
||||
"image": "eve_010304.webp",
|
||||
"beforefarme": 70,
|
||||
"globalAlpha": 0,
|
||||
"afterfarme": 170,
|
||||
"aglobalAlpha": 100,
|
||||
"ax": 0,
|
||||
"ay": 0
|
||||
},
|
||||
{
|
||||
"image": "eve_010304.webp",
|
||||
"beforefarme": 171,
|
||||
"globalAlpha": 100,
|
||||
"afterfarme": 270,
|
||||
"aglobalAlpha": 100,
|
||||
"ax": 800,
|
||||
"ay": 0
|
||||
"type": "setmusics",
|
||||
"bgm": "Asphodelus_Ceui.opus"
|
||||
}
|
||||
],
|
||||
"soundList": [
|
||||
"10,9": [
|
||||
{
|
||||
"sound": "",
|
||||
"startfarme": 0,
|
||||
"stopbefore": false
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"type": "op"
|
||||
"type": "setmusics"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
BIN
project/fonts/Verdana.ttf
Normal file
BIN
project/fonts/Verdana.ttf
Normal file
Binary file not shown.
@ -3,6 +3,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
this._afterLoadResources = function () {
|
||||
// 本函数将在所有资源加载完毕后,游戏开启前被执行
|
||||
core.ui.statusBar.init();
|
||||
core.dom.playGame.style.fontFamily = "pala";
|
||||
core.dom.loadGame.style.fontFamily = "pala";
|
||||
core.dom.CGMode.style.fontFamily = "pala";
|
||||
core.dom.musicMode.style.fontFamily = "pala";
|
||||
core.dom.replayGame.style.fontFamily = "pala";
|
||||
core.registerEvent("changeMouse", function (data) {
|
||||
if (!main.replayChecking && !core.isReplaying())
|
||||
core.changeMouse(
|
||||
@ -218,6 +223,45 @@ 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 (
|
||||
(core.getLocalStorage("musics") &&
|
||||
core.getLocalStorage("musics").length === 0) ||
|
||||
!core.getLocalStorage("musics")
|
||||
)
|
||||
core.setLocalStorage("musics", ["theme.mp3"]);
|
||||
let a = core.getLocalStorage("musics");
|
||||
if (!data.bgm) {
|
||||
core.setLocalStorage("musics", ["theme.mp3"]);
|
||||
} else {
|
||||
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 () {
|
||||
@ -9528,6 +9572,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
this.gain = this.ac.createGain();
|
||||
this.gain.connect(this.ac.destination);
|
||||
this.audioRoutes = new Map();
|
||||
const func = () => {
|
||||
this.ac.resume();
|
||||
document.body.removeEventListener("mousedown", func);
|
||||
document.body.removeEventListener("touchstart", func);
|
||||
document.body.removeEventListener("keydown", func);
|
||||
};
|
||||
document.body.addEventListener("mousedown", func, { capture: true });
|
||||
document.body.addEventListener("touchstart", func, { capture: true });
|
||||
document.body.addEventListener("keydown", func, { capture: true });
|
||||
}
|
||||
/**
|
||||
* 解码音频数据
|
||||
@ -11613,6 +11666,9 @@ 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",
|
||||
@ -11664,10 +11720,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(),
|
||||
@ -11689,6 +11741,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(),
|
||||
@ -16453,19 +16506,28 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
|
||||
class musicclass {
|
||||
constructor() {
|
||||
this.musics = ["theme.mp3"];
|
||||
//music列表
|
||||
//需全塔属性注册并保存在bgms文件夹,每个数组为显示的一页内容
|
||||
this.musicMx = [
|
||||
["Asphodelus_Ceui.opus", "Blind_Alley.opus"],
|
||||
["Crawler.opus", "op.opus", "theme.opus"],
|
||||
[
|
||||
"Crawler.opus",
|
||||
"Blood_Stain.opus",
|
||||
"Blind_Alley.opus",
|
||||
"Halbmond.opus",
|
||||
],
|
||||
["theme.mp3", "op.opus", "Asphodelus_Ceui.opus", "ed.opus"],
|
||||
];
|
||||
//音乐别名(将在播放器内显示的音乐名,music列表内的都要有对应歌名)
|
||||
this.musicname = {
|
||||
"Asphodelus_Ceui.opus": "Asphodelus",
|
||||
"Blind_Alley.opus": "Blind",
|
||||
"Asphodelus_Ceui.opus": "Asphodelus (Full.ver)",
|
||||
"Blind_Alley.opus": "Blind Alley",
|
||||
"Crawler.opus": "Crawler",
|
||||
"op.opus": "op",
|
||||
"theme.opus": "theme",
|
||||
"op.opus": "Asphodelus",
|
||||
"theme.mp3": "One of Episodes",
|
||||
"ed.opus": "親愛なる世界へ",
|
||||
"Blood_Stain.opus": "Blood Stain",
|
||||
"Halbmond.opus": "Halbmond",
|
||||
};
|
||||
this.selection = [0, 0];
|
||||
this.stop = false;
|
||||
@ -16561,6 +16623,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
|
||||
break;
|
||||
case "xunhuan":
|
||||
for (;;) {
|
||||
if (this.selection[1] === 0) {
|
||||
if (this.selection[0] === 0) {
|
||||
this.selection[0] = this.musicMx.length - 1;
|
||||
@ -16574,11 +16637,18 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
} else {
|
||||
this.selection[1] -= 1;
|
||||
}
|
||||
this.randomList.indexOf(
|
||||
this.random = this.randomList.indexOf(
|
||||
this.musicMx[this.selection[0]][this.selection[1]]
|
||||
);
|
||||
page = this.selection[0];
|
||||
|
||||
if (
|
||||
this.musics.includes(
|
||||
this.musicMx[this.selection[0]][this.selection[1]]
|
||||
) ||
|
||||
page !== this.musicMx.length - 1
|
||||
)
|
||||
break;
|
||||
}
|
||||
core.playBgm(
|
||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||
main.core.ui.music.selection[1]
|
||||
@ -16587,6 +16657,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
|
||||
break;
|
||||
case "suiji":
|
||||
for (;;) {
|
||||
if (this.random > 0) {
|
||||
this.random -= 1;
|
||||
} else {
|
||||
@ -16600,7 +16671,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
);
|
||||
|
||||
page = this.selection[0];
|
||||
|
||||
if (
|
||||
this.musics.includes(
|
||||
this.musicMx[this.selection[0]][this.selection[1]]
|
||||
) ||
|
||||
page !== this.musicMx.length - 1
|
||||
)
|
||||
break;
|
||||
}
|
||||
core.playBgm(
|
||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||
main.core.ui.music.selection[1]
|
||||
@ -16624,6 +16702,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
page = this.selection[0];
|
||||
break;
|
||||
case "xunhuan":
|
||||
for (;;) {
|
||||
if (
|
||||
this.selection[1] ===
|
||||
this.musicMx[this.selection[0]].length - 1
|
||||
@ -16642,7 +16721,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
this.musicMx[this.selection[0]][this.selection[1]]
|
||||
);
|
||||
page = this.selection[0];
|
||||
|
||||
if (
|
||||
this.musics.includes(
|
||||
this.musicMx[this.selection[0]][this.selection[1]]
|
||||
) ||
|
||||
page !== this.musicMx.length - 1
|
||||
)
|
||||
break;
|
||||
}
|
||||
core.playBgm(
|
||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||
main.core.ui.music.selection[1]
|
||||
@ -16651,6 +16737,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
|
||||
break;
|
||||
case "suiji":
|
||||
for (;;) {
|
||||
if (this.random < this.randomList.length - 1) {
|
||||
this.random += 1;
|
||||
} else {
|
||||
@ -16664,6 +16751,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
);
|
||||
|
||||
page = this.selection[0];
|
||||
if (
|
||||
this.musics.includes(
|
||||
this.musicMx[this.selection[0]][this.selection[1]]
|
||||
) ||
|
||||
page !== this.musicMx.length - 1
|
||||
)
|
||||
break;
|
||||
}
|
||||
core.playBgm(
|
||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||
main.core.ui.music.selection[1]
|
||||
@ -16691,7 +16786,12 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
if (inRect(pos, musicbox)) {
|
||||
const index = Math.floor((py - 200) / 100);
|
||||
if (page !== this.selection[0] || index !== this.selection[1]) {
|
||||
if (
|
||||
this.musics.includes(this.musicMx[page][index]) ||
|
||||
page !== this.musicMx.length - 1
|
||||
) {
|
||||
this.selection[0] = page;
|
||||
|
||||
this.selection[1] = index;
|
||||
this.randomList.indexOf(
|
||||
this.musicMx[this.selection[0]][this.selection[1]]
|
||||
@ -16704,6 +16804,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
);
|
||||
|
||||
this.stop = false;
|
||||
}
|
||||
} else {
|
||||
if (this.stop) {
|
||||
this.stop = !this.stop;
|
||||
@ -16758,7 +16859,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
this.stop = false;
|
||||
switch (this.type) {
|
||||
case "danqu":
|
||||
if (!this.stop)
|
||||
core.playBgm(
|
||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||
main.core.ui.music.selection[1]
|
||||
@ -16769,6 +16869,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
|
||||
break;
|
||||
case "xunhuan":
|
||||
for (;;) {
|
||||
if (this.selection[1] === 0) {
|
||||
if (this.selection[0] === 0) {
|
||||
this.selection[0] = this.musicMx.length - 1;
|
||||
@ -16787,7 +16888,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
);
|
||||
page = this.selection[0];
|
||||
|
||||
if (!this.stop)
|
||||
if (
|
||||
this.musics.includes(
|
||||
this.musicMx[this.selection[0]][this.selection[1]]
|
||||
) ||
|
||||
page !== this.musicMx.length - 1
|
||||
)
|
||||
break;
|
||||
}
|
||||
core.playBgm(
|
||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||
main.core.ui.music.selection[1]
|
||||
@ -16796,6 +16904,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
|
||||
break;
|
||||
case "suiji":
|
||||
for (;;) {
|
||||
if (this.random > 0) {
|
||||
this.random -= 1;
|
||||
} else {
|
||||
@ -16810,7 +16919,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
|
||||
page = this.selection[0];
|
||||
|
||||
if (!this.stop)
|
||||
if (
|
||||
this.musics.includes(
|
||||
this.musicMx[this.selection[0]][this.selection[1]]
|
||||
) ||
|
||||
page !== this.musicMx.length - 1
|
||||
)
|
||||
break;
|
||||
}
|
||||
core.playBgm(
|
||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||
main.core.ui.music.selection[1]
|
||||
@ -16825,7 +16941,6 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
this.stop = false;
|
||||
switch (this.type) {
|
||||
case "danqu":
|
||||
if (!this.stop)
|
||||
core.playBgm(
|
||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||
main.core.ui.music.selection[1]
|
||||
@ -16835,6 +16950,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
page = this.selection[0];
|
||||
break;
|
||||
case "xunhuan":
|
||||
for (;;) {
|
||||
if (
|
||||
this.selection[1] ===
|
||||
this.musicMx[this.selection[0]].length - 1
|
||||
@ -16855,7 +16971,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
);
|
||||
page = this.selection[0];
|
||||
|
||||
if (!this.stop)
|
||||
if (
|
||||
this.musics.includes(
|
||||
this.musicMx[this.selection[0]][this.selection[1]]
|
||||
) ||
|
||||
page !== this.musicMx.length - 1
|
||||
)
|
||||
break;
|
||||
}
|
||||
core.playBgm(
|
||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||
main.core.ui.music.selection[1]
|
||||
@ -16864,6 +16987,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
|
||||
break;
|
||||
case "suiji":
|
||||
for (;;) {
|
||||
if (this.random < this.randomList.length - 1) {
|
||||
this.random += 1;
|
||||
} else {
|
||||
@ -16877,7 +17001,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
);
|
||||
|
||||
page = this.selection[0];
|
||||
if (!this.stop)
|
||||
if (
|
||||
this.musics.includes(
|
||||
this.musicMx[this.selection[0]][this.selection[1]]
|
||||
) ||
|
||||
page !== this.musicMx.length - 1
|
||||
)
|
||||
break;
|
||||
}
|
||||
core.playBgm(
|
||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||
main.core.ui.music.selection[1]
|
||||
@ -16905,10 +17036,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
if (inRect(pos, musicbox)) {
|
||||
const index = Math.floor((py - 100) / 100);
|
||||
if (page !== this.selection[0] || index !== this.selection[1]) {
|
||||
if (
|
||||
this.musics.includes(this.musicMx[page][index]) ||
|
||||
page !== this.musicMx.length - 1
|
||||
) {
|
||||
this.selection[0] = page;
|
||||
this.selection[1] = index;
|
||||
this.randomList.indexOf(
|
||||
(v) => v === this.musicMx[this.selection[0]][this.selection[1]]
|
||||
(v) =>
|
||||
v === this.musicMx[this.selection[0]][this.selection[1]]
|
||||
);
|
||||
|
||||
core.playBgm(
|
||||
@ -16917,6 +17053,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
]
|
||||
);
|
||||
this.stop = false;
|
||||
}
|
||||
} else {
|
||||
if (this.stop) {
|
||||
this.stop = !this.stop;
|
||||
@ -16989,6 +17126,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
core.setTextAlign(ctx, "left");
|
||||
for (let i = 0; i < indexList.length; i++) {
|
||||
const text = this.musicname[indexList[i]];
|
||||
if (
|
||||
this.musics.includes(this.musicMx[page][i]) ||
|
||||
page !== this.musicMx.length - 1
|
||||
) {
|
||||
core.fillBoldText1(
|
||||
ctx,
|
||||
text,
|
||||
@ -17001,12 +17142,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
6,
|
||||
core.ui._buildFont(66, true)
|
||||
);
|
||||
|
||||
ctx.strokeStyle = "#FFFFFF";
|
||||
ctx.lineWidth = 3;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(100, posy);
|
||||
ctx.lineTo(1148, posy);
|
||||
ctx.stroke();
|
||||
}
|
||||
posy += 100;
|
||||
}
|
||||
ctx.beginPath();
|
||||
@ -17051,19 +17194,63 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
ctx.strokeStyle = "#ffffff";
|
||||
ctx.lineWidth = 3;
|
||||
|
||||
ctx.fillStyle = "#ffffff";
|
||||
ctx.font = "bold 96px Verdana";
|
||||
ctx.fillText("|", 100, 1697);
|
||||
ctx.fillText("◀", 115, 1700);
|
||||
core.fillBoldText(
|
||||
ctx,
|
||||
"|",
|
||||
100,
|
||||
1697,
|
||||
"#FFFFFF",
|
||||
6,
|
||||
core.ui._buildFont(96, true)
|
||||
);
|
||||
core.fillBoldText(
|
||||
ctx,
|
||||
"◀",
|
||||
115,
|
||||
1700,
|
||||
"#FFFFFF",
|
||||
6,
|
||||
core.ui._buildFont(96, true)
|
||||
);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(505, 1670, 80, 0, 3 * Math.PI);
|
||||
ctx.stroke();
|
||||
ctx.fillText("|", 835, 1697);
|
||||
ctx.fillText("▶", 785, 1700);
|
||||
core.fillText(
|
||||
ctx,
|
||||
"|",
|
||||
835,
|
||||
1697,
|
||||
"#FFFFFF",
|
||||
core.ui._buildFont(96, true)
|
||||
);
|
||||
core.fillText(
|
||||
ctx,
|
||||
"▶",
|
||||
785,
|
||||
1700,
|
||||
"#FFFFFF",
|
||||
core.ui._buildFont(96, true)
|
||||
);
|
||||
|
||||
if (this.stop) {
|
||||
ctx.fillText("▶", 473, 1697);
|
||||
core.fillText(
|
||||
ctx,
|
||||
"▶",
|
||||
473,
|
||||
1700,
|
||||
"#FFFFFF",
|
||||
core.ui._buildFont(96, true)
|
||||
);
|
||||
} else {
|
||||
ctx.fillText("||", 453, 1694);
|
||||
core.fillText(
|
||||
ctx,
|
||||
"||",
|
||||
453,
|
||||
1700,
|
||||
"#FFFFFF",
|
||||
core.ui._buildFont(96, true)
|
||||
);
|
||||
}
|
||||
|
||||
const img = core.material.images.images[this.type + ".webp"];
|
||||
@ -17139,6 +17326,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
core.setTextAlign(ctx, "left");
|
||||
for (let i = 0; i < indexList.length; i++) {
|
||||
const text = this.musicname[indexList[i]];
|
||||
if (
|
||||
this.musics.includes(this.musicMx[page][i]) ||
|
||||
page !== this.musicMx.length - 1
|
||||
) {
|
||||
core.fillBoldText1(
|
||||
ctx,
|
||||
text,
|
||||
@ -17151,12 +17342,14 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
6,
|
||||
core.ui._buildFont(66, true)
|
||||
);
|
||||
|
||||
ctx.strokeStyle = "#FFFFFF";
|
||||
ctx.lineWidth = 3;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(900, posy);
|
||||
ctx.lineTo(1900, posy);
|
||||
ctx.stroke();
|
||||
}
|
||||
posy += 100;
|
||||
}
|
||||
core.fillBoldText1(
|
||||
@ -17193,21 +17386,62 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
ctx.strokeStyle = "#ffffff";
|
||||
ctx.lineWidth = 3;
|
||||
|
||||
ctx.fillStyle = "#ffffff";
|
||||
ctx.font = "bold 96px Verdana";
|
||||
ctx.fillText("|", 60, 697);
|
||||
ctx.fillText("◀", 70, 700);
|
||||
core.fillText(
|
||||
ctx,
|
||||
"|",
|
||||
55,
|
||||
697,
|
||||
"#FFFFFF",
|
||||
core.ui._buildFont(96, true)
|
||||
);
|
||||
core.fillText(
|
||||
ctx,
|
||||
"◀",
|
||||
70,
|
||||
700,
|
||||
"#FFFFFF",
|
||||
core.ui._buildFont(96, true)
|
||||
);
|
||||
|
||||
ctx.beginPath();
|
||||
ctx.arc(295, 670, 80, 0, 2 * Math.PI);
|
||||
ctx.stroke();
|
||||
if (this.stop) {
|
||||
ctx.fillText("▶", 245, 697);
|
||||
core.fillText(
|
||||
ctx,
|
||||
"▶",
|
||||
265,
|
||||
700,
|
||||
"#FFFFFF",
|
||||
core.ui._buildFont(96, true)
|
||||
);
|
||||
} else {
|
||||
ctx.fillText("||", 245, 694);
|
||||
core.fillText(
|
||||
ctx,
|
||||
"||",
|
||||
245,
|
||||
700,
|
||||
"#FFFFFF",
|
||||
core.ui._buildFont(96, true)
|
||||
);
|
||||
}
|
||||
core.fillText(
|
||||
ctx,
|
||||
"|",
|
||||
495,
|
||||
697,
|
||||
"#FFFFFF",
|
||||
core.ui._buildFont(96, true)
|
||||
);
|
||||
core.fillText(
|
||||
ctx,
|
||||
"▶",
|
||||
450,
|
||||
700,
|
||||
"#FFFFFF",
|
||||
core.ui._buildFont(96, true)
|
||||
);
|
||||
|
||||
ctx.fillText("|", 490, 697);
|
||||
ctx.fillText("▶", 450, 700);
|
||||
ctx.font = "bold 48px Verdana";
|
||||
ctx.fillText("音量", 350, 900);
|
||||
ctx.beginPath();
|
||||
@ -17251,7 +17485,13 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
|
||||
core.ui.music = new musicclass();
|
||||
main.dom.musicMode.onclick = function () {
|
||||
//点击开始页面的CG MODE进入cg回廊
|
||||
|
||||
if (
|
||||
(core.getLocalStorage("musics") &&
|
||||
core.getLocalStorage("musics").length === 0) ||
|
||||
!core.getLocalStorage("musics")
|
||||
)
|
||||
core.setLocalStorage("musics", ["theme.mp3"]);
|
||||
core.ui.music.musics = core.getLocalStorage("musics");
|
||||
core.playBgm(
|
||||
main.core.ui.music.musicMx[main.core.ui.music.selection[0]][
|
||||
main.core.ui.music.selection[1]
|
||||
@ -17563,4 +17803,348 @@ 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);
|
||||
};
|
||||
},
|
||||
开局选项悬停: function () {
|
||||
// 在此增加新插件
|
||||
|
||||
main.dom.playGame.addEventListener("mouseenter", () => {
|
||||
core.dom.playGame.style.backgroundColor = "#808080";
|
||||
});
|
||||
main.dom.playGame.addEventListener("mouseleave", () => {
|
||||
core.dom.playGame.style.backgroundColor = "transparent";
|
||||
});
|
||||
main.dom.playGame.addEventListener("touchmove", () => {
|
||||
core.dom.playGame.style.backgroundColor = "#808080";
|
||||
});
|
||||
main.dom.playGame.addEventListener("touchend", () => {
|
||||
core.dom.playGame.style.backgroundColor = "transparent";
|
||||
});
|
||||
main.dom.playGame.addEventListener("touchcancel", () => {
|
||||
core.dom.playGame.style.backgroundColor = "transparent";
|
||||
});
|
||||
|
||||
main.dom.loadGame.addEventListener("mouseenter", () => {
|
||||
core.dom.loadGame.style.backgroundColor = "#808080";
|
||||
});
|
||||
main.dom.loadGame.addEventListener("mouseleave", () => {
|
||||
core.dom.loadGame.style.backgroundColor = "transparent";
|
||||
});
|
||||
main.dom.loadGame.addEventListener("touchmove", () => {
|
||||
core.dom.loadGame.style.backgroundColor = "#808080";
|
||||
});
|
||||
main.dom.loadGame.addEventListener("touchend", () => {
|
||||
core.dom.loadGame.style.backgroundColor = "transparent";
|
||||
});
|
||||
main.dom.loadGame.addEventListener("touchcancel", () => {
|
||||
core.dom.loadGame.style.backgroundColor = "transparent";
|
||||
});
|
||||
|
||||
main.dom.CGMode.addEventListener("mouseenter", () => {
|
||||
core.dom.CGMode.style.backgroundColor = "#808080";
|
||||
});
|
||||
main.dom.CGMode.addEventListener("mouseleave", () => {
|
||||
core.dom.CGMode.style.backgroundColor = "transparent";
|
||||
});
|
||||
main.dom.CGMode.addEventListener("touchmove", () => {
|
||||
core.dom.CGMode.style.backgroundColor = "#808080";
|
||||
});
|
||||
main.dom.CGMode.addEventListener("touchend", () => {
|
||||
core.dom.CGMode.style.backgroundColor = "transparent";
|
||||
});
|
||||
main.dom.CGMode.addEventListener("touchcancel", () => {
|
||||
core.dom.CGMode.style.backgroundColor = "transparent";
|
||||
});
|
||||
|
||||
main.dom.musicMode.addEventListener("mouseenter", () => {
|
||||
core.dom.musicMode.style.backgroundColor = "#808080";
|
||||
});
|
||||
main.dom.musicMode.addEventListener("mouseleave", () => {
|
||||
core.dom.musicMode.style.backgroundColor = "transparent";
|
||||
});
|
||||
main.dom.musicMode.addEventListener("touchmove", () => {
|
||||
core.dom.musicMode.style.backgroundColor = "#808080";
|
||||
});
|
||||
main.dom.musicMode.addEventListener("touchend", () => {
|
||||
core.dom.musicMode.style.backgroundColor = "transparent";
|
||||
});
|
||||
main.dom.musicMode.addEventListener("touchcancel", () => {
|
||||
core.dom.musicMode.style.backgroundColor = "transparent";
|
||||
});
|
||||
|
||||
main.dom.replayGame.addEventListener("mouseenter", () => {
|
||||
core.dom.replayGame.style.backgroundColor = "#808080";
|
||||
});
|
||||
main.dom.replayGame.addEventListener("mouseleave", () => {
|
||||
core.dom.replayGame.style.backgroundColor = "transparent";
|
||||
});
|
||||
main.dom.replayGame.addEventListener("touchmove", () => {
|
||||
core.dom.replayGame.style.backgroundColor = "#808080";
|
||||
});
|
||||
main.dom.replayGame.addEventListener("touchend", () => {
|
||||
core.dom.replayGame.style.backgroundColor = "transparent";
|
||||
});
|
||||
main.dom.replayGame.addEventListener("touchcancel", () => {
|
||||
core.dom.replayGame.style.backgroundColor = "transparent";
|
||||
});
|
||||
},
|
||||
天气叠加: function () {
|
||||
//使用方法:使用core.setWeather(天气,等级)来增加天气,使用core.setWeather()来清空天气
|
||||
// 天气叠加功能
|
||||
////// 更改天气效果 //////
|
||||
control.prototype.setWeather = function (type, level) {
|
||||
// 非雨雪
|
||||
if (type == null) {
|
||||
Object.keys(core.control.weathers).forEach(function (one) {
|
||||
core.deleteCanvas("weather" + one);
|
||||
});
|
||||
core.animateFrame.weather.type = [];
|
||||
core.animateFrame.weather.nodes = {};
|
||||
core.animateFrame.weather.level = {};
|
||||
core.animateFrame.weather.time = {};
|
||||
return;
|
||||
}
|
||||
if (!core.animateFrame.weather.level || level == null)
|
||||
core.animateFrame.weather.level = {};
|
||||
if (!core.animateFrame.weather.type) core.animateFrame.weather.type = [];
|
||||
level = core.clamp(parseInt(level) || 5, 1, 10);
|
||||
// 当前天气:则忽略
|
||||
if (
|
||||
core.animateFrame.weather.type.includes(type) &&
|
||||
level == core.animateFrame.weather.level[type]
|
||||
)
|
||||
return;
|
||||
if (core.animateFrame.weather.nodes[type]) return;
|
||||
// 计算当前的宽高
|
||||
core.createCanvas(
|
||||
"weather" + type,
|
||||
0,
|
||||
0,
|
||||
core.__PIXELS__,
|
||||
core.__PIXELS__,
|
||||
80
|
||||
);
|
||||
core.animateFrame.weather.type.push(type);
|
||||
core.animateFrame.weather.level[type] = level;
|
||||
this._setWeather_createNodes(type, level);
|
||||
};
|
||||
control.prototype._setWeather_createNodes = function (type, level) {
|
||||
var number =
|
||||
level *
|
||||
parseInt(
|
||||
(20 * core.bigmap.width * core.bigmap.height) /
|
||||
(core.__SIZE__ * core.__SIZE__)
|
||||
);
|
||||
if (!core.animateFrame.weather.nodes[type])
|
||||
core.animateFrame.weather.nodes[type] = [];
|
||||
switch (type) {
|
||||
case "rain":
|
||||
for (var a = 0; a < number; a++) {
|
||||
core.animateFrame.weather.nodes.rain.push({
|
||||
x: Math.random() * core.bigmap.width * 32,
|
||||
y: Math.random() * core.bigmap.height * 32,
|
||||
l: Math.random() * 2.5,
|
||||
xs: -4 + Math.random() * 4 + 2,
|
||||
ys: Math.random() * 10 + 10,
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "snow":
|
||||
for (var a = 0; a < number; a++) {
|
||||
core.animateFrame.weather.nodes.snow.push({
|
||||
x: Math.random() * core.bigmap.width * 32,
|
||||
y: Math.random() * core.bigmap.height * 32,
|
||||
r: Math.random() * 5 + 1,
|
||||
d: Math.random() * Math.min(level, 200),
|
||||
});
|
||||
}
|
||||
break;
|
||||
case "fog":
|
||||
if (core.animateFrame.weather.fog) {
|
||||
core.animateFrame.weather.nodes[type] = [
|
||||
{
|
||||
level: number,
|
||||
x: 0,
|
||||
y: -core.__PIXELS__ / 2,
|
||||
dx: -Math.random() * 1.5,
|
||||
dy: Math.random(),
|
||||
delta: 0.001,
|
||||
},
|
||||
];
|
||||
}
|
||||
break;
|
||||
case "cloud":
|
||||
if (core.animateFrame.weather.cloud) {
|
||||
core.animateFrame.weather.nodes[type] = [
|
||||
{
|
||||
level: number,
|
||||
x: 0,
|
||||
y: -core.__PIXELS__ / 2,
|
||||
dx: -Math.random() * 1.5,
|
||||
dy: Math.random(),
|
||||
delta: 0.001,
|
||||
},
|
||||
];
|
||||
}
|
||||
break;
|
||||
case "sun":
|
||||
if (core.animateFrame.weather.sun) {
|
||||
// 直接绘制
|
||||
core.clearMap("weather" + type);
|
||||
core.setAlpha("weather" + type, level / 10);
|
||||
core.drawImage(
|
||||
"weather" + type,
|
||||
core.animateFrame.weather.sun,
|
||||
0,
|
||||
0,
|
||||
core.animateFrame.weather.sun.width,
|
||||
core.animateFrame.weather.sun.height,
|
||||
0,
|
||||
0,
|
||||
core.__PIXELS__,
|
||||
core.__PIXELS__
|
||||
);
|
||||
core.setAlpha("weather" + type, 1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
};
|
||||
core.registerAnimationFrame("weather", true, function (timestamp) {
|
||||
var weather = core.animateFrame.weather;
|
||||
if (!weather.type) return;
|
||||
weather.type.forEach(function (one) {
|
||||
if (
|
||||
timestamp - weather.time[one] <= 30 ||
|
||||
!core.dymCanvas["weather" + one]
|
||||
)
|
||||
return;
|
||||
core.control["_animationFrame_weather_" + one]();
|
||||
weather.time[one] = timestamp;
|
||||
});
|
||||
});
|
||||
// 雨
|
||||
control.prototype._animationFrame_weather_rain = function () {
|
||||
var ctx = core.dymCanvas.weatherrain,
|
||||
ox = core.bigmap.offsetX,
|
||||
oy = core.bigmap.offsetY;
|
||||
core.clearMap("weatherrain");
|
||||
ctx.strokeStyle = "rgba(174,194,224,0.8)";
|
||||
ctx.lineWidth = 1;
|
||||
ctx.lineCap = "round";
|
||||
core.animateFrame.weather.nodes.rain.forEach(function (p) {
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(p.x - ox, p.y - oy);
|
||||
ctx.lineTo(p.x + p.l * p.xs - ox, p.y + p.l * p.ys - oy);
|
||||
ctx.stroke();
|
||||
p.x += p.xs;
|
||||
p.y += p.ys;
|
||||
if (p.x > core.bigmap.width * 32 || p.y > core.bigmap.height * 32) {
|
||||
p.x = Math.random() * core.bigmap.width * 32;
|
||||
p.y = -10;
|
||||
}
|
||||
});
|
||||
ctx.fill();
|
||||
};
|
||||
// 雪
|
||||
control.prototype._animationFrame_weather_snow = function () {
|
||||
var ctx = core.dymCanvas.weathersnow,
|
||||
ox = core.bigmap.offsetX,
|
||||
oy = core.bigmap.offsetY;
|
||||
core.clearMap("weathersnow");
|
||||
ctx.fillStyle = "rgba(255, 255, 255, 0.8)";
|
||||
ctx.beginPath();
|
||||
if (!core.animateFrame.weather.data) core.animateFrame.weather.data = {};
|
||||
core.animateFrame.weather.data.snow =
|
||||
core.animateFrame.weather.data.snow || 0;
|
||||
core.animateFrame.weather.data.snow += 0.01;
|
||||
var angle = core.animateFrame.weather.data.snow;
|
||||
core.animateFrame.weather.nodes.snow.forEach(function (p) {
|
||||
ctx.moveTo(p.x - ox, p.y - oy);
|
||||
ctx.arc(p.x - ox, p.y - oy, p.r, 0, Math.PI * 2, true);
|
||||
// update
|
||||
p.x += Math.sin(angle) * core.animateFrame.weather.level.snow;
|
||||
p.y += Math.cos(angle + p.d) + 1 + p.r / 2;
|
||||
if (
|
||||
p.x > core.bigmap.width * 32 + 5 ||
|
||||
p.x < -5 ||
|
||||
p.y > core.bigmap.height * 32
|
||||
) {
|
||||
if (Math.random() > 1 / 3) {
|
||||
p.x = Math.random() * core.bigmap.width * 32;
|
||||
p.y = -10;
|
||||
} else {
|
||||
if (Math.sin(angle) > 0) p.x = -5;
|
||||
else p.x = core.bigmap.width * 32 + 5;
|
||||
p.y = Math.random() * core.bigmap.height * 32;
|
||||
}
|
||||
}
|
||||
});
|
||||
ctx.fill();
|
||||
};
|
||||
// 图片天气
|
||||
control.prototype.__animateFrame_weather_image = function (image, type) {
|
||||
if (!image) return;
|
||||
var node = core.animateFrame.weather.nodes[type][0];
|
||||
core.setAlpha("weather" + type, node.level / 500);
|
||||
var wind = 1.5;
|
||||
var width = image.width,
|
||||
height = image.height;
|
||||
node.x += node.dx * wind;
|
||||
node.y += (2 * node.dy - 1) * wind;
|
||||
if (node.x + 3 * width <= core.__PIXELS__) {
|
||||
node.x += 4 * width;
|
||||
while (node.x > 0) node.x -= width;
|
||||
}
|
||||
node.dy += node.delta;
|
||||
if (node.dy >= 1) {
|
||||
node.delta = -0.001;
|
||||
} else if (node.dy <= 0) {
|
||||
node.delta = 0.001;
|
||||
}
|
||||
if (node.y + 3 * height <= core.__PIXELS__) {
|
||||
node.y += 4 * height;
|
||||
while (node.y > 0) node.y -= height;
|
||||
} else if (node.y >= 0) {
|
||||
node.y -= height;
|
||||
}
|
||||
for (var i = 0; i < 3; ++i) {
|
||||
for (var j = 0; j < 3; ++j) {
|
||||
if (
|
||||
node.x + (i + 1) * width <= 0 ||
|
||||
node.x + i * width >= core.__PIXELS__ ||
|
||||
node.y + (j + 1) * height <= 0 ||
|
||||
node.y + j * height >= core.__PIXELS__
|
||||
)
|
||||
continue;
|
||||
core.drawImage(
|
||||
"weather" + type,
|
||||
image,
|
||||
node.x + i * width,
|
||||
node.y + j * height
|
||||
);
|
||||
}
|
||||
}
|
||||
core.setAlpha("weather" + type, 1);
|
||||
};
|
||||
// 雾
|
||||
control.prototype._animationFrame_weather_fog = function () {
|
||||
core.clearMap("weatherfog");
|
||||
this.__animateFrame_weather_image(core.animateFrame.weather.fog, "fog");
|
||||
};
|
||||
// 云
|
||||
control.prototype._animationFrame_weather_cloud = function () {
|
||||
core.clearMap("weathercloud");
|
||||
this.__animateFrame_weather_image(
|
||||
core.animateFrame.weather.cloud,
|
||||
"cloud"
|
||||
);
|
||||
};
|
||||
},
|
||||
};
|
||||
|
117
styles.css
117
styles.css
@ -1,4 +1,5 @@
|
||||
html, body {
|
||||
html,
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
@ -89,7 +90,7 @@
|
||||
}
|
||||
|
||||
#startTopHint {
|
||||
color: #66CCFF;
|
||||
color: #66ccff;
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 5%;
|
||||
@ -144,8 +145,8 @@
|
||||
/* default value */
|
||||
background-color: #000000;
|
||||
opacity: 0.55;
|
||||
color: #FFFFFF;
|
||||
border: #FFFFFF 0px solid;
|
||||
color: #ffffff;
|
||||
border: #ffffff 0px solid;
|
||||
caret-color: #ffffff;
|
||||
border-radius: 0px;
|
||||
}
|
||||
@ -161,7 +162,7 @@
|
||||
.startButton {
|
||||
width: 100%;
|
||||
margin: 0;
|
||||
font:1.2rem "pala", sans-serif;
|
||||
font: 1.2rem pala, sans-serif;
|
||||
font-weight: normal;
|
||||
display: block;
|
||||
cursor: pointer;
|
||||
@ -268,7 +269,12 @@ p#hard {
|
||||
word-break: keep-all;
|
||||
}
|
||||
|
||||
span#poison, span#weak, span#curse, span#pickaxe, span#bomb, span#fly {
|
||||
span#poison,
|
||||
span#weak,
|
||||
span#curse,
|
||||
span#pickaxe,
|
||||
span#bomb,
|
||||
span#fly {
|
||||
font-style: normal;
|
||||
font-size: 1em;
|
||||
}
|
||||
@ -351,7 +357,7 @@ p#name {
|
||||
top: 0;
|
||||
left: 0;
|
||||
background: rgba(127, 127, 127, 0.6);
|
||||
z-index: 2000
|
||||
z-index: 2000;
|
||||
}
|
||||
|
||||
#inputDialog {
|
||||
@ -377,7 +383,7 @@ p#name {
|
||||
margin-bottom: 10px;
|
||||
padding: 5px 3px;
|
||||
border: 1px solid;
|
||||
background: #F0F0F0;
|
||||
background: #f0f0f0;
|
||||
}
|
||||
|
||||
#inputYes {
|
||||
@ -390,20 +396,33 @@ p#name {
|
||||
margin-right: 10%;
|
||||
}
|
||||
|
||||
#_selector, ._uievent_selector {
|
||||
#_selector,
|
||||
._uievent_selector {
|
||||
animation: selector 2s ease-in-out 0s infinite normal none running;
|
||||
}
|
||||
|
||||
@-webkit-keyframes selector {
|
||||
0% { opacity: 0.95; }
|
||||
50% { opacity: 0.55; }
|
||||
100% { opacity: 0.95; }
|
||||
0% {
|
||||
opacity: 0.95;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.55;
|
||||
}
|
||||
100% {
|
||||
opacity: 0.95;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes selector {
|
||||
0% { opacity: 0.95; }
|
||||
50% { opacity: 0.55; }
|
||||
100% { opacity: 0.95; }
|
||||
0% {
|
||||
opacity: 0.95;
|
||||
}
|
||||
50% {
|
||||
opacity: 0.55;
|
||||
}
|
||||
100% {
|
||||
opacity: 0.95;
|
||||
}
|
||||
}
|
||||
|
||||
#next {
|
||||
@ -416,8 +435,8 @@ p#name {
|
||||
border-bottom-style: solid;
|
||||
border-right-width: 4px;
|
||||
border-right-style: solid;
|
||||
-webkit-animation: next .5s ease-in-out alternate infinite;
|
||||
animation: next .5s ease-in-out alternate infinite;
|
||||
-webkit-animation: next 0.5s ease-in-out alternate infinite;
|
||||
animation: next 0.5s ease-in-out alternate infinite;
|
||||
left: 0;
|
||||
top: 0;
|
||||
opacity: 0.7;
|
||||
@ -467,15 +486,27 @@ p#name {
|
||||
}
|
||||
|
||||
@-webkit-keyframes startImage {
|
||||
0% { opacity: 0; }
|
||||
60% { opacity: 1; }
|
||||
100% { opacity: 0; }
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
60% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes startImage {
|
||||
0% { opacity: 0; }
|
||||
60% { opacity: 1; }
|
||||
100% { opacity: 0; }
|
||||
0% {
|
||||
opacity: 0;
|
||||
}
|
||||
60% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.startImageDivAnimation {
|
||||
@ -484,13 +515,21 @@ p#name {
|
||||
}
|
||||
|
||||
@-webkit-keyframes startImageDivDisappear {
|
||||
0% { opacity: 1 }
|
||||
100% { opacity: 0 }
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes startImageDivDisappear {
|
||||
0% { opacity: 1 }
|
||||
100% { opacity: 0 }
|
||||
0% {
|
||||
opacity: 1;
|
||||
}
|
||||
100% {
|
||||
opacity: 0;
|
||||
}
|
||||
}
|
||||
#ui-editor {
|
||||
z-index: 9999;
|
||||
@ -517,15 +556,27 @@ p#name {
|
||||
}
|
||||
|
||||
@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);}
|
||||
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);}
|
||||
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 {
|
||||
|
Loading…
Reference in New Issue
Block a user