diff --git a/project/functions.js b/project/functions.js index 87bccc9..e31ebdd 100644 --- a/project/functions.js +++ b/project/functions.js @@ -747,7 +747,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = mon_turn = 0; let equipInfo = [] //回合生效的装备列表 if (core.hasSpecial(mon_special, 13)) equipInfo.push({ - id: "献祭", //需注册图标 + id: "A374", //需注册图标 speed: mon_hp }) for (let i = 0; i < 5; i++) { diff --git a/project/icons.js b/project/icons.js index 48b911d..0d40858 100644 --- a/project/icons.js +++ b/project/icons.js @@ -152,7 +152,8 @@ var icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 = "rightPortal": 25, "upPortal": 26, "ice": 27, - "magentaWall": 28 + "magentaWall": 28, + "A437": 29 }, "npcs": { "man": 0, diff --git a/project/maps.js b/project/maps.js index 3ad9d50..717d595 100644 --- a/project/maps.js +++ b/project/maps.js @@ -335,6 +335,7 @@ var maps_90f36752_8815_4be8_b32b_d7fad1d0542e = "434": {"cls":"enemys","id":"E434"}, "435": {"cls":"enemys","id":"E435"}, "436": {"cls":"enemys","id":"E436"}, + "437": {"cls":"animates","id":"A437"}, "20034": {"cls":"tileset","id":"X20034","canPass":true}, "20154": {"cls":"tileset","id":"X20154","canPass":true}, "20216": {"cls":"tileset","id":"X20216","canPass":true}, diff --git a/project/materials/animates.png b/project/materials/animates.png index 89d8789..2769cbc 100644 Binary files a/project/materials/animates.png and b/project/materials/animates.png differ diff --git a/project/plugins.js b/project/plugins.js index 9afa92d..dbedeb9 100644 --- a/project/plugins.js +++ b/project/plugins.js @@ -323,7 +323,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = data.sound : core.plugin[core.ui.cgText.textList][data.index][2] || ""; core.ui.cgText.bodyList = core.clone(data.bodyList); - main.dom.cgText.style.display = "block"; + main.dom.cg.style.display = "block"; core.ui.cgText.update(); } else { core.doAction(); @@ -2785,9 +2785,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = main.dom.music.style.width = obj.totalWidth + "px"; main.dom.music.style.height = obj.totalHeight + "px"; } - if (main.dom.cgText) { - main.dom.cgText.style.width = obj.totalWidth + "px"; - main.dom.cgText.style.height = obj.totalHeight + "px"; + if (main.dom.cg) { + main.dom.cg.style.width = obj.totalWidth + "px"; + main.dom.cg.style.height = obj.totalHeight + "px"; } if (main.dom.logcanvas) { main.dom.logcanvas.style.width = obj.totalWidth + "px"; @@ -2804,17 +2804,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = if (main.dom.video) { main.dom.video.style.width = obj.totalWidth + "px"; main.dom.video.style.height = obj.totalHeight + "px"; - if (core.domStyle.isVertical) - main.dom.video.style.width = obj.totalHeight + "px"; - if (core.domStyle.isVertical) - main.dom.video.style.height = obj.totalWidth + "px"; - main.dom.video.style.top = "50%"; - main.dom.video.style.left = "50%"; - main.dom.video.style.transform = "translate(-50%,-50%)"; - - if (core.domStyle.isVertical) - main.dom.video.style.transform = "translate(-50%,-50%) rotate(90deg)"; } if (main.dom.video1) { main.dom.video1.style.width = obj.totalWidth + "px"; @@ -13102,76 +13092,75 @@ let time=0 }; }, "墓碑(编辑器)": function () { - // 在此增加新插件 - if (main.mode != "editor") return; // 编辑器模式下使用 - var mapData = null; - var drawMap = core.maps._drawMap_drawAll; - core.maps._drawMap_drawAll = function (floorId) { - floorId = floorId || core.status.floorId; - if (!main.useCompress) { - core.getLocalForage( - "autoSave", - { maps: [] }, - function (v) { - mapData = v.maps[floorId]?.map; - drawMap.call(core.maps, floorId); - }, - function (e) { - console.log(e); - } - ); - } - }; + // 在此增加新插件 + if (main.mode != "editor") return; // 编辑器模式下使用 + var mapData = null; + var drawMap = core.maps._drawMap_drawAll; + core.maps._drawMap_drawAll = function (floorId) { + floorId = floorId || core.status.floorId; + if (!main.useCompress) { + core.getLocalForage( + "autoSave", { maps: [] }, + function (v) { + mapData = v.maps[floorId]?.map; + drawMap.call(core.maps, floorId); + }, + function (e) { + console.log(e); + } + ); + } + }; - maps.prototype._drawBlockInfo = function (blockInfo, x, y) { - var alpha = 1.0; - if (mapData && !!mapData[y] && mapData[y][x] == 0) { - core.setAlpha("event", 0.5); - core.setAlpha("event2", 0.5); - } - var image = blockInfo.image, - posX = blockInfo.posX, - posY = blockInfo.posY, - height = blockInfo.height; + maps.prototype._drawBlockInfo = function (blockInfo, x, y) { + var alpha = 1.0; + if (mapData && !!mapData[y] && mapData[y][x] == 0) { + core.setAlpha("event", 0.5); + core.setAlpha("event2", 0.5); + } + var image = blockInfo.image, + posX = blockInfo.posX, + posY = blockInfo.posY, + height = blockInfo.height; - core.clearMap("event", x * 32, y * 32, 32, 32); - if (blockInfo.bigImage) { - this._drawBlockInfo_bigImage(blockInfo, x, y, "event"); - core.setAlpha("event", alpha); - core.setAlpha("event2", alpha); - return; - } - core.drawImage( - "event", - image, - posX * 32, - posY * height + height - 32, - 32, - 32, - x * 32, - y * 32, - 32, - 32 - ); - if (height > 32) { - core.clearMap("event2", x * 32, y * 32 + 32 - height, 32, height - 32); - core.drawImage( - "event2", - image, - posX * 32, - posY * height, - 32, - height - 32, - x * 32, - y * 32 + 32 - height, - 32, - height - 32 - ); - } - core.setAlpha("event", alpha); - core.setAlpha("event2", alpha); - }; - }, + core.clearMap("event", x * 32, y * 32, 32, 32); + if (blockInfo.bigImage) { + this._drawBlockInfo_bigImage(blockInfo, x, y, "event"); + core.setAlpha("event", alpha); + core.setAlpha("event2", alpha); + return; + } + core.drawImage( + "event", + image, + posX * 32, + posY * height + height - 32, + 32, + 32, + x * 32, + y * 32, + 32, + 32 + ); + if (height > 32) { + core.clearMap("event2", x * 32, y * 32 + 32 - height, 32, height - 32); + core.drawImage( + "event2", + image, + posX * 32, + posY * height, + 32, + height - 32, + x * 32, + y * 32 + 32 - height, + 32, + height - 32 + ); + } + core.setAlpha("event", alpha); + core.setAlpha("event2", alpha); + }; +}, "小地图": function () { // 在此增加新插件 // ----- 不可自定义 杂七杂八的变量 @@ -13622,10 +13611,7 @@ let time=0 CGUI.style.zIndex = 300; CGUI.style.display = "none"; CGUI.id = "CGUI"; - main.dom.gameGroup.insertAdjacentElement("afterend", CGUI); - CGUI.style.top = "50%"; - CGUI.style.left = "50%"; - CGUI.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", CGUI) const ctx = CGUI.getContext("2d"); main.dom.CGUI = CGUI; let page = 0; //初始页面 @@ -14582,22 +14568,16 @@ let time=0 cg.style.position = "absolute"; cg.style.zIndex = 320; cg.style.display = "none"; - cg.id = "cgText"; - main.dom.gameGroup.insertAdjacentElement("afterend", cg); - cg.style.top = "50%"; - cg.style.left = "50%"; - cg.style.transform = "translate(-50%,-50%)"; + cg.id = "cg"; + main.dom.startPanel.insertAdjacentElement("afterend", cg) const ctx = cg.getContext("2d"); - main.dom.cgText = cg; + main.dom.cg = cg; const logcanvas = document.createElement("canvas"); //cg画布设置 logcanvas.style.position = "absolute"; logcanvas.style.zIndex = 321; logcanvas.style.display = "none"; - logcanvas.id = "cgText"; - main.dom.gameGroup.insertAdjacentElement("afterend", logcanvas); - logcanvas.style.top = "50%"; - logcanvas.style.left = "50%"; - logcanvas.style.transform = "translate(-50%,-50%)"; + logcanvas.id = "logcanvas"; + main.dom.startPanel.insertAdjacentElement("afterend", logcanvas) const logctx = logcanvas.getContext("2d"); main.dom.logcanvas = logcanvas; logcanvas.onmouseup = function (e) { @@ -14855,7 +14835,7 @@ let time=0 core.status.event.data.type == "cgtext" ) { core.setFlag("skip", true); - main.dom.cgText.style.display = "none"; + main.dom.cg.style.display = "none"; core.doAction(); } }); @@ -15477,10 +15457,7 @@ let time=0 over.style.zIndex = 310; over.style.display = "none"; over.id = "over"; - main.dom.gameGroup.insertAdjacentElement("afterend", over); - over.style.top = "50%"; - over.style.left = "50%"; - over.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", over) const ctx1 = over.getContext("2d"); main.dom.over = over; @@ -16036,10 +16013,7 @@ let time=0 boss.style.zIndex = 310; boss.style.display = "none"; boss.id = "boss"; - main.dom.gameGroup.insertAdjacentElement("afterend", boss); - boss.style.top = "50%"; - boss.style.left = "50%"; - boss.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", boss) const ctx = boss.getContext("2d"); main.dom.boss = boss; const boss1 = document.createElement("canvas"); //boss战画布设置 @@ -16047,10 +16021,7 @@ let time=0 boss1.style.zIndex = 300; boss1.style.display = "none"; boss1.id = "boss1"; - main.dom.gameGroup.insertAdjacentElement("afterend", boss1); - boss1.style.top = "50%"; - boss1.style.left = "50%"; - boss1.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", boss1) const ctx1 = boss1.getContext("2d"); main.dom.boss1 = boss1; const boss2 = document.createElement("canvas"); //boss战画布设置 @@ -16058,10 +16029,7 @@ let time=0 boss2.style.zIndex = 301; boss2.style.display = "none"; boss2.id = "boss2"; - main.dom.gameGroup.insertAdjacentElement("afterend", boss2); - boss2.style.top = "50%"; - boss2.style.left = "50%"; - boss2.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", boss2) main.dom.boss2 = boss2; const ctx2 = boss2.getContext("2d"); const boss3 = document.createElement("canvas"); //boss战画布设置 @@ -16069,10 +16037,7 @@ let time=0 boss3.style.zIndex = 302; boss3.style.display = "none"; boss3.id = "boss3"; - main.dom.gameGroup.insertAdjacentElement("afterend", boss3); - boss3.style.top = "50%"; - boss3.style.left = "50%"; - boss3.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", boss3) main.dom.boss3 = boss3; const ctx3 = boss3.getContext("2d"); const boss4 = document.createElement("canvas"); //boss战画布设置 @@ -16080,10 +16045,7 @@ let time=0 boss4.style.zIndex = 303; boss4.style.display = "none"; boss4.id = "boss4"; - main.dom.gameGroup.insertAdjacentElement("afterend", boss4); - boss4.style.top = "50%"; - boss4.style.left = "50%"; - boss4.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", boss4) const ctx4 = boss4.getContext("2d"); main.dom.boss4 = boss4; const boss5 = document.createElement("canvas"); //boss战画布设置 @@ -16091,10 +16053,7 @@ let time=0 boss5.style.zIndex = 304; boss5.style.display = "none"; boss5.id = "boss5"; - main.dom.gameGroup.insertAdjacentElement("afterend", boss5); - boss5.style.top = "50%"; - boss5.style.left = "50%"; - boss5.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", boss5) const ctx5 = boss5.getContext("2d"); main.dom.boss5 = boss5; @@ -16103,10 +16062,7 @@ let time=0 boss6.style.zIndex = 305; boss6.style.display = "none"; boss6.id = "boss6"; - main.dom.gameGroup.insertAdjacentElement("afterend", boss6); - boss6.style.top = "50%"; - boss6.style.left = "50%"; - boss6.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", boss6) const ctx6 = boss6.getContext("2d"); main.dom.boss6 = boss6; const boss7 = document.createElement("canvas"); //boss战画布设置 @@ -16114,10 +16070,7 @@ let time=0 boss7.style.zIndex = 306; boss7.style.display = "none"; boss7.id = "boss7"; - main.dom.gameGroup.insertAdjacentElement("afterend", boss7); - boss7.style.top = "50%"; - boss7.style.left = "50%"; - boss7.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", boss7) const ctx7 = boss7.getContext("2d"); main.dom.boss7 = boss7; const boss8 = document.createElement("canvas"); //boss战画布设置 @@ -16125,10 +16078,7 @@ let time=0 boss8.style.zIndex = 307; boss8.style.display = "none"; boss8.id = "boss8"; - main.dom.gameGroup.insertAdjacentElement("afterend", boss8); - boss8.style.top = "50%"; - boss8.style.left = "50%"; - boss8.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", boss8) const ctx8 = boss8.getContext("2d"); main.dom.boss8 = boss8; const { imagelighter } = core.plugin.utils; @@ -18196,10 +18146,7 @@ let time=0 video.style.zIndex = 320; video.style.display = "block"; video.id = "video"; - main.dom.gameGroup.insertAdjacentElement("afterend", video); - video.style.top = "50%"; - video.style.left = "50%"; - video.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", video) main.dom.video = video; const ctx2 = video.getContext('2d') const video1 = document.createElement("canvas"); //video1画布设置 @@ -18207,10 +18154,7 @@ let time=0 video1.style.zIndex = 330; video1.style.display = "block"; video1.id = "video1"; - main.dom.gameGroup.insertAdjacentElement("afterend", video1); - video1.style.top = "50%"; - video1.style.left = "50%"; - video1.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", video1) const ctx = video1.getContext("2d"); main.dom.video1 = video1; if (core.domStyle.isVertical) { @@ -18487,10 +18431,7 @@ let time=0 music.style.zIndex = 300; music.style.display = "none"; music.id = "music"; - main.dom.gameGroup.insertAdjacentElement("afterend", music); - music.style.top = "50%"; - music.style.left = "50%"; - music.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", music) const ctx = music.getContext("2d"); main.dom.music = music; @@ -19208,18 +19149,19 @@ let time=0 this.musics.includes(this.musicMx[page][i]) || page !== this.musicMx.length - 1 ) { - core.fillBoldText1( + core.fillBoldText( ctx, text, 50, - posy - 100, + posy - 10, page === this.selection[0] && i === this.selection[1] ? "#FFFFFF" : "#444444", "#000000", - 6, core.ui._buildFont(22, true) - ); + ) + + ctx.strokeStyle = "#FFFFFF"; ctx.lineWidth = 1; @@ -19297,7 +19239,7 @@ let time=0 core.fillText( ctx, "|", - 278, + 282, 566, "#FFFFFF", core.ui._buildFont(32, true) @@ -19506,7 +19448,7 @@ let time=0 core.fillText( ctx, "|", - 165, + 169, 232, "#FFFFFF", core.ui._buildFont(32, true) @@ -20837,7 +20779,6 @@ let time=0 text = "暴击" + herodamage else text = herodamage === 0 ? "抵抗" : herodamage; - console.log([enemyDiffList[turn].hp, heroDiffList[turn].hp]) Dove.MorePerform.ShowDamagePop.PopDamage( ctx, // 默认画布名称 270, // 英雄位置 x @@ -22121,10 +22062,7 @@ let time=0 book.style.zIndex = 400; book.style.display = "none"; book.id = "book"; - main.dom.gameGroup.insertAdjacentElement("afterend", book); - book.style.top = "50%"; - book.style.left = "50%"; - book.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", book) const ctx = book.getContext("2d"); main.dom.book = book @@ -22138,11 +22076,11 @@ let time=0 let x, y; if (core.domStyle.isVertical) { //对竖屏进行坐标转换 - x = py * 3; - y = 1248 - px * 3; + x = py; + y = 416 - px; } else { - x = px * 3; - y = py * 3; + x = px; + y = py; } bookclick(x, y) } catch (ee) { @@ -22172,19 +22110,118 @@ let time=0 } this.drawBook = function (floorId = core.status.floorId) { if (core.domStyle.isVertical) { //对竖屏进行绘制坐标变换,只需要考虑横屏绘制,竖屏将自适应转置 - ctx.canvas.width = 1248; - ctx.canvas.height = 2028; + core.maps._setHDCanvasSize(ctx, 416, 676) ctx.save(); //保存设置 - ctx.translate(1248, 0); //重新定位右上角为基准 + ctx.translate(416, 0); //重新定位右上角为基准 ctx.rotate(Math.PI / 2); //旋转90度 } else { - ctx.canvas.width = 2028; - ctx.canvas.height = 1248; + core.maps._setHDCanvasSize(ctx, 676, 676) } //在这里写绘制内容,只写横屏就行 ctx.restore(); //恢复变换前的坐标,否则将连续转置 } + class Book { + constructor() { + this.width = 325 + this.height = 400 + this.pagemax = 1 + this.page = 0 + this.paper = this.paperTexture() + + } + paperTexture() { + const paperleft = document.createElement('canvas') + paperleft.width = 64 + paperleft.height = 64 + const paperright = document.createElement('canvas') + paperright.width = 64 + paperright.height = 64 + const textureCanvas = document.createElement('canvas'); + textureCanvas.width = 64; + textureCanvas.height = 64; + const textureCtx = textureCanvas.getContext('2d'); + + // 填充浅色背景 + textureCtx.fillStyle = '#f8f4e8'; + textureCtx.fillRect(0, 0, 64, 64); + + // 添加纸张纹理 + textureCtx.globalAlpha = 0.03; + for (let i = 0; i < 100; i++) { + const x = Math.random() * 64; + const y = Math.random() * 64; + const radius = Math.random() * 3; + + textureCtx.beginPath(); + textureCtx.arc(x, y, radius, 0, Math.PI * 2); + textureCtx.fillStyle = '#000000'; + textureCtx.fill(); + } + const right = paperright.getContext('2d'), + left = paperleft.getContext('2d') + right.translate(64, 0) + right.scale(-1, 1) + right.drawImage(textureCanvas, 0, 0, 64, 64) + left.drawImage(textureCanvas, 0, 0, 64, 64) + return [paperleft, paperright]; + } + background() { + book.style.display = "block" + if (core.domStyle.isVertical) { //对竖屏进行绘制坐标变换,只需要考虑横屏绘制,竖屏将自适应转置 + core.maps._setHDCanvasSize(ctx, 416, 676) + ctx.save(); //保存设置 + ctx.translate(416, 0); //重新定位右上角为基准 + ctx.rotate(Math.PI / 2); //旋转90度 + } else { + core.maps._setHDCanvasSize(ctx, 676, 416) + ctx.save(); //保存设置 + } + core.fillRect(ctx, 0, 0, 676, 416, "#000000") + //在这里写绘制内容,只写横屏就行 + ctx.beginPath() + const dx = (676 - this.width * 2) / 2, + dy = 416 - this.height + ctx.moveTo(0, 416) + ctx.lineTo(dx, this.height) + ctx.lineTo(dx, 0) + ctx.lineTo(0, dy) + ctx.closePath() + ctx.fillStyle = "#e0d6c2" + ctx.fill() + ctx.beginPath() + ctx.moveTo(676, 416) + ctx.lineTo(676 - dx, this.height) + ctx.lineTo(676 - dx, 0) + ctx.lineTo(676, dy) + ctx.closePath() + ctx.fillStyle = "#e0d6c2" + ctx.fill() + + core.drawImage(ctx, this.paper[0], 0, 0, this.paper[0].width, this.paper[0].height, dx, 0, this.width, this.height) + core.drawImage(ctx, this.paper[1], 0, 0, this.paper[1].width, this.paper[1].height, dx + this.width, 0, this.width, this.height) + + ctx.beginPath() + ctx.moveTo(0, 416) + ctx.lineTo(dx, this.height) + ctx.lineTo(338, this.height) + ctx.lineTo(this.width, 416) + ctx.closePath() + ctx.fillStyle = '#706b61' + ctx.fill() + ctx.beginPath() + ctx.moveTo(676, 416) + ctx.lineTo(676 - dx, this.height) + ctx.lineTo(338, this.height) + ctx.lineTo(338 + dx, 416) + ctx.closePath() + ctx.fillStyle = '#706b61' + ctx.fill() + ctx.restore(); //恢复变换前的坐标,否则将连续转置 + } + } + core.book = new Book() + }, "存读档": function () { // 在此增加新插件 @@ -22193,10 +22230,7 @@ let time=0 saveLoad.style.zIndex = 390; saveLoad.style.display = "none"; saveLoad.id = "saveLoad"; - main.dom.gameGroup.insertAdjacentElement("afterend", saveLoad); - saveLoad.style.top = "50%"; - saveLoad.style.left = "50%"; - saveLoad.style.transform = "translate(-50%,-50%)"; + main.dom.startPanel.insertAdjacentElement("afterend", saveLoad) const ctx = saveLoad.getContext("2d"); main.dom.saveLoad = saveLoad let cg = false