winskin增加缩放倍率,楼传修复,部分战斗动画

This commit is contained in:
草莓 2025-01-25 22:25:57 +08:00
parent 1eec945d93
commit 4936449f67
5 changed files with 2266 additions and 2027 deletions

View File

@ -389,7 +389,7 @@ var comment_c456ea59_6018_45ef_8bcc_211a24c627dc = {
}
}
},
"enemys_template": { 'name': '新敌人', 'hp': 0, 'atk': 0, 'def': 0, 'money': 0, 'exp': 0, 'point': 0, 'special': [] },
"enemys_template": { 'name': '新敌人', 'hp': 0, 'atk': 0, 'def': 0, 'mdef': 0, 'speed': 0, 'money': 0, 'exp': 0, 'point': 0, 'special': [] },
// --------------------------- 【图块属性】相关的表格配置 --------------------------- //

View File

@ -46,6 +46,12 @@ main.floors.street01=
{
"type": "setmusics"
}
],
"6,11": [
{
"type": "insert",
"name": "chapter01"
}
]
},
"changeFloor": {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -1,5 +1,6 @@
var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
init: function () {
var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
{
"init": function () {
this._afterLoadResources = function () {
// 本函数将在所有资源加载完毕后,游戏开启前被执行
core.ui.statusBar.init();
@ -264,7 +265,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
});
};
},
drawLight: function () {
"drawLight": function () {
// 绘制灯光/漆黑层效果。调用方式 core.plugin.drawLight(...)
// 【参数说明】
// name必填要绘制到的画布名可以是一个系统画布或者是个自定义画布如果不存在则创建
@ -330,7 +331,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
// 可以在任何地方如afterXXX或自定义脚本事件调用函数方法为 core.plugin.xxx();
};
},
shop: function () {
"shop": function () {
// 【全局商店】相关的功能
//
// 打开一个全局商店
@ -606,7 +607,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
60
);
},
removeMap: function () {
"removeMap": function () {
// 高层塔砍层插件,删除后不会存入存档,不可浏览地图也不可飞到。
// 推荐用法:
// 对于超高层或分区域塔当在1区时将2区以后的地图删除1区结束时恢复2区进二区时删除1区地图以此类推
@ -695,7 +696,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
});
};
},
fiveLayers: function () {
"fiveLayers": function () {
// 是否启用五图层增加背景2层和前景2层 将__enable置为true即会启用启用后请保存后刷新编辑器
// 背景层2将会覆盖背景层 被事件层覆盖 前景层2将会覆盖前景层
// 另外 请注意加入两个新图层 会让大地图的性能降低一些
@ -897,7 +898,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
};
};
},
itemShop: function () {
"itemShop": function () {
// 道具商店相关的插件
// 可在全塔属性-全局商店中使用「道具商店」事件块进行编辑(如果找不到可以在入口方块中找)
@ -1299,7 +1300,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
]);
};
},
enemyLevel: function () {
"enemyLevel": function () {
// 此插件将提供怪物手册中的怪物境界显示
// 使用此插件需要先给每个怪物定义境界,方法如下:
// 点击怪物的【配置表格】,找到“【怪物】相关的表格配置”,然后在【名称】仿照增加境界定义:
@ -1467,7 +1468,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
);
};
},
multiHeros: function () {
"multiHeros": function () {
// 多角色插件
// Step 1: 启用本插件
// Step 2: 定义每个新的角色各项初始数据(参见下方注释)
@ -1621,7 +1622,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
core.setFlag("heroId", toHeroId); // 保存切换到的角色ID
};
},
heroFourFrames: function () {
"heroFourFrames": function () {
// 样板的勇士/跟随者移动时只使用2、4两帧观感较差。本插件可以将四帧全用上。
// 是否启用本插件
@ -1684,7 +1685,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
return false;
};
},
routeFixing: function () {
"routeFixing": function () {
// 是否开启本插件true 表示启用false 表示禁用。
var __enable = true;
if (!__enable) return;
@ -1808,7 +1809,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
100
);
},
numpad: function () {
"numpad": function () {
// 样板自带的整数输入事件为白屏弹窗且可以误输入任意非法内容但不支持负整数观感较差。本插件可以将其美化成仿RM样式使其支持负整数同时带有音效
// 另一方面4399等第三方平台不允许使用包括 core.myprompt() 和 core.myconfirm() 在内的弹窗,因此也需要此插件来替代,不然类似生命魔杖的道具就不好实现了
// 关于负整数输入V2.8.2原生支持其录像的压缩和解压,只是默认的 core.events._action_input() 函数将负数取了绝对值,可以只复写下面的 core.isReplaying() 部分来取消
@ -2065,7 +2066,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}
};
},
sprites: function () {
"sprites": function () {
// 基于canvas的sprite化摘编整理自万宁魔塔
//
// ---------------------------------------- 第一部分 js代码 (必装) --------------------------------------- //
@ -2269,7 +2270,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
window.Sprite = Sprite;
},
hotReload: function () {
"hotReload": function () {
/* ---------- ---------- *
1. libs/ main.js index.html 中的任意一个文件被更改后会自动刷新塔的页面
@ -2526,7 +2527,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}
})();
},
statusBar: function () {
"statusBar": function () {
main.dom.floorMsgGroup.style.display = "none";
main.dom.statusBar.style.display = "none";
main.dom.toolBar.style.display = "none";
@ -3731,7 +3732,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
};
// init() called in `afterLoadResources`.
},
override: function () {
"override": function () {
core.statusBar.icons = {
floor: 0,
name: null,
@ -3843,8 +3844,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
var mid = Math.floor((start + end) / 2);
if (mid - start > end - mid) mid--;
var nextInfo = core.enemys.getDamageInfo(
enemy,
{ atk: mid },
enemy, { atk: mid },
x,
y,
floorId
@ -3854,17 +3854,15 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
else start = mid + 1;
}
var nextInfo = core.enemys.getDamageInfo(
enemy,
{ atk: start },
enemy, { atk: start },
x,
y,
floorId
);
return nextInfo == null ||
typeof nextInfo == "number" ||
nextInfo.damage >= pre
? null
: [start, nextInfo.damage];
nextInfo.damage >= pre ?
null : [start, nextInfo.damage];
};
var currAtk = start_atk;
while (true) {
@ -4080,8 +4078,47 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
ctx.fillStyle = style;
ctx.fillText(text, x, y);
};
////// 绘制 WindowSkin
ui.prototype.drawWindowSkin = function (background, ctx, x, y, w, h, direction, px, py, size = 1) {
background = background || core.status.textAttribute.background;
// 仿RM窗口皮肤 ↓
// 绘制背景
core.drawImage(ctx, background, 0, 0, 128, 128, x + 2 * size, y + 2 * size, w - 4 * size, h - 4 * size);
// 绘制边框
// 上方
core.drawImage(ctx, background, 128, 0, 16, 16, x, y, 16 * size, 16 * size);
for (var dx = 0; dx < w - 64 * size; dx += 32 * size) {
core.drawImage(ctx, background, 144, 0, 32, 16, x + dx + 16 * size, y, 32 * size, 16 * size);
core.drawImage(ctx, background, 144, 48, 32, 16, x + dx + 16 * size, y + h - 16 * size, 32 * size, 16 * size);
}
core.drawImage(ctx, background, 144, 0, (w - dx - 32 * size) / size, 16, x + dx + 16 * size, y, w - dx - 32 * size, 16 * size);
core.drawImage(ctx, background, 144, 48, (w - dx - 32 * size) / size, 16, x + dx + 16 * size, y + h - 16 * size, w - dx - 32 * size, 16 * size);
core.drawImage(ctx, background, 176, 0, 16, 16, x + w - 16 * size, y, 16 * size, 16 * size);
// 左右
for (var dy = 0; dy < h - 64 * size; dy += 32 * size) {
core.drawImage(ctx, background, 128, 16, 16, 32, x, y + dy + 16 * size, 16 * size, 32 * size);
core.drawImage(ctx, background, 176, 16, 16, 32, x + w - 16 * size, y + dy + 16 * size, 16 * size, 32 * size);
}
core.drawImage(ctx, background, 128, 16, 16, (h - dy - 32 * size) / size, x, y + dy + 16 * size, 16 * size, h - dy - 32 * size);
core.drawImage(ctx, background, 176, 16, 16, (h - dy - 32 * size) / size, x + w - 16 * size, y + dy + 16 * size, 16 * size, h - dy - 32 * size);
//下方
core.drawImage(ctx, background, 128, 48, 16, 16, x, y + h - 16 * size, 16 * size, 16 * size);
core.drawImage(ctx, background, 176, 48, 16, 16, x + w - 16 * size, y + h - 16 * size, 16 * size, 16 * size);
// arrow
if (px != null && py != null) {
if (direction == 'up') {
core.drawImage(ctx, background, 128, 96, 32, 32, px, y + h - 3 * size, 32 * size, 32 * size);
} else if (direction == 'down') {
core.drawImage(ctx, background, 160, 96, 32, 32, px, y - 29 * size, 32 * size, 32 * size);
}
}
// 仿RM窗口皮肤 ↑
}
},
额外信息: function () {
"额外信息": function () {
/*
* 注意不要在道具属性中直接操作flags使用core.status.hero.flags或core.setFlag系列函数代替
* 需要将 变量itemDetail改为true才可正常运行
@ -4238,7 +4275,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}
}
},
编辑器显伤: function () {
"编辑器显伤": function () {
// 在此增加新插件
/////// 用户设置 ///////
// 将__enable置为false将关闭插件
@ -4512,7 +4549,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}
};
},
手册区分特殊属性: function () {
"手册区分特殊属性": function () {
// 在此增加新插件
this.arrsame = function (Arraya, Arrayb) {
let a = Arraya || [];
@ -4864,7 +4901,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
return [enemy, texts];
};
},
一防减伤: function () {
"一防减伤": function () {
// 在此增加新插件
ui.prototype._drawBook_drawRow3 = function (
index,
@ -6375,7 +6412,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
core.registerReplayAction("equip", core.control._replayAction_equip);
core.registerReplayAction("unEquip", core.control._replayAction_unEquip);
},
技能树: function () {
"技能树": function () {
// 在此增加新插件
//
// 已学习的技能等级 flags._hasSkill_
@ -7177,7 +7214,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
};
core.registerReplayAction("skill", control.prototype._replayAction_skill);
},
animate: function () {
"animate": function () {
// -------------------- 插件说明 -------------------- //
// github仓库https://github.com/unanmed/animate
@ -8051,7 +8088,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
inverseTrigo: N,
};
},
func: function () {
"func": function () {
// 功能函数集,具体有哪些函数看每个函数前的注释即可
// 安装方式:直接复制到插件里面,注意新建插件自带的 function () { } 不能删
// 使用方式:可以直接使用对象解构按需引入
@ -8491,7 +8528,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}
};
},
音频系统: function () {
"音频系统": function () {
// 在此增加新插件
/* libs/thirdparty index.html
@ -10602,7 +10639,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
core.ui._drawSwitchs_sounds();
};
},
怪物碎裂特效: function () {
"怪物碎裂特效": function () {
// 在此增加新插件
// -------------------- 安装说明 -------------------- //
// 先安装两个在插件简介中说明的前置插件
@ -10847,7 +10884,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
applyFragWith,
};
},
自定义常用事件: function () {
"自定义常用事件": function () {
// editorBlocklyconfigPlus.js
// 自訂常見事件模板插件
// 本插件引用了通用函數插件(Utility.js)
@ -12136,7 +12173,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
.split("// end mark sfergsvae")[0];
}
},
夹击激光动画: function () {
"夹击激光动画": function () {
function createCanvas(name, zIndex) {
if (!name) return;
var canvas = document.createElement("canvas");
@ -12367,7 +12404,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}
};
},
瞬移轨迹: function () {
"瞬移轨迹": function () {
// 在此增加新插件
function popMove() {
var ctx = core.getContextByName("popMove");
@ -12514,7 +12551,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
core.setAlpha("event2", alpha);
};
},
小地图: function () {
"小地图": function () {
// 在此增加新插件
// ----- 不可自定义 杂七杂八的变量
/** @type {{[x: string]: BFSResult}} */
@ -12933,7 +12970,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}
};
},
楼传: function () {
"楼传": function () {
// 在此增加新插件
core.canMoveFloor = function () {
@ -12958,10 +12995,11 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
ui.prototype._drawViewMaps_drawHint = function () {
core.playSound("打开界面");
};
let canMoveFloor
////// 绘制浏览地图界面 //////
ui.prototype._drawViewMaps = function (index, x, y) {
core.lockControl();
canMoveFloor = core.canMoveFloor()
core.clearMap("data");
core.status.event.id = "viewMaps";
this.clearUI();
@ -13703,7 +13741,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
} else if (
core.flags.flyNearStair &&
!core.nearStair() &&
!core.canMoveFloor()
canMoveFloor
) {
core.playSound("操作失败");
core.drawTip(
@ -13712,6 +13750,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
);
} else {
core.flyTo(core.status.event.data.floorId);
core.updateStatusBar()
}
return;
}
@ -13721,7 +13760,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
if (
(core.flags.flyNearStair && !core.nearStair()) ||
!core.canMoveFloor()
canMoveFloor
) {
core.playSound("操作失败");
core.drawTip(
@ -13833,6 +13872,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
core.ui.closePanel();
core.getItemDetail();
core.redrawMap();
core.updateStatusBar()
core.ui.statusBar._update_map();
return;
} else if (px >= 55 && px <= 317 && py >= 11 && py <= 54) {
@ -14041,7 +14081,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
0
);
},
CG回廊: function () {
"CG回廊": function () {
// 在此增加新插件
const CGUI = document.createElement("canvas"); //CGui画布设置
CGUI.style.position = "absolute";
@ -14436,7 +14476,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
ctx.globalAlpha = 0.5; //透明度
if (bg) ctx.drawImage(bg, 0, 0, 1280, 720, 0, 0, 2028, 1248); //绘制半透明背景图片
ctx.globalAlpha = 1; //恢复为不透明
//core.drawWindowSkin('winskin1.png', ctx, 0, 0, 2028, 1248);
core.setTextAlign(ctx, "center");
core.fillBoldText1(
ctx,
@ -14544,7 +14584,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
main.core.ui.CG.update();
};
},
光标设置: function () {
"光标设置": function () {
// 在此增加新插件
this.changeMouse = function (
icon,
@ -14581,7 +14621,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
core.dom[div].style.cursor = "auto";
};
},
信息弹出: function () {
"信息弹出": function () {
// 在此增加新插件
/*
* 使用方法core.addPop(px, py, value, color, boldColor, left, jump, time, show, font, speed)
@ -14688,7 +14728,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
else core.status.pop.push(data);
};
},
warning: function () {
"warning": function () {
// 在此增加新插件
// 默认音效名
var defaultSound = "jingbao.opus";
@ -14751,7 +14791,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}, 1600);
};
},
立体声音效: function () {
"立体声音效": function () {
// 在此增加新插件
// 音效双声道播放
var can = true;
@ -14855,7 +14895,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}, 10);
};
},
滑动转场: function () {
"滑动转场": function () {
// 在此增加新插件
const defaultChange = {
left: "leftPortal", // 左箭头
@ -15045,7 +15085,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}, 25);
};
},
剧情cg: function () {
"剧情cg": function () {
// 在此增加新插件
const cg = document.createElement("canvas"); //cg画布设置
cg.style.position = "absolute";
@ -15158,7 +15198,10 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
[x + w, y + h],
];
};
const inRect = ([x, y], [[sx, sy], [dx, dy]]) => {
const inRect = ([x, y], [
[sx, sy],
[dx, dy]
]) => {
return sx <= x && x <= dx && sy <= y && y <= dy;
};
const pos = [px, py];
@ -15285,9 +15328,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
config.defaultFont = config.font = config.font || globalAttribute.font;
config.time = config.time || 0;
config.letterSpacing =
config.letterSpacing == null
? textAttribute.letterSpacing || 0
: config.letterSpacing;
config.letterSpacing == null ?
textAttribute.letterSpacing || 0 :
config.letterSpacing;
config.index = 0;
config.currcolor = config.color;
@ -15341,9 +15384,9 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
var block = config.blocks[config.index++];
if (block != null) {
// It works, why?
const scale = config.isHD
? devicePixelRatio * core.domStyle.scale
: 1;
const scale = config.isHD ?
devicePixelRatio * core.domStyle.scale :
1;
ctx.restore();
ctx.save(); //保存设置
if (core.domStyle.isVertical) {
@ -15466,7 +15509,18 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
ctx.filter = "none";
});
if (core.isPlaying() && !this.WindowSkin)
core.drawWindowSkin("winskin.webp", ctx, 30, 802, 1968, 416); //绘制对话框
core.drawWindowSkin(
"winskin.webp",
ctx,
30,
802,
1968,
416,
null,
null,
null,
3
); //绘制对话框
const head = core.material.images.images?.[this.head.name];
if (head) {
//绘制头像
@ -15483,7 +15537,18 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
);
}
if (core.isPlaying() && !this.WindowSkin) {
core.drawWindowSkin("winskin.webp", ctx, 1700, 1100, 192, 96);
core.drawWindowSkin(
"winskin.webp",
ctx,
1700,
1100,
192,
96,
null,
null,
null,
3
);
core.fillBoldText1(
ctx,
"存 档",
@ -15494,7 +15559,18 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
6,
"bold 48px Verdana"
);
core.drawWindowSkin("winskin.webp", ctx, 1400, 1100, 192, 96);
core.drawWindowSkin(
"winskin.webp",
ctx,
1400,
1100,
192,
96,
null,
null,
null,
3
);
core.fillBoldText1(
ctx,
"▶▶",
@ -15505,7 +15581,18 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
6,
"bold 48px Verdana"
);
core.drawWindowSkin("winskin.webp", ctx, 1700, 900, 192, 96);
core.drawWindowSkin(
"winskin.webp",
ctx,
1700,
900,
192,
96,
null,
null,
null,
3
);
let autoText = "AUTO";
if (auto) autoText = "STOP";
core.fillBoldText1(
@ -15574,7 +15661,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}
core.ui.cgText = new cgText();
},
旁白: function () {
"旁白": function () {
// 在此增加新插件
const over = document.createElement("canvas"); //over画布设置
over.style.position = "absolute";
@ -16064,7 +16151,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}
};
},
回合制boss战: function () {
"回合制boss战": function () {
// 在此增加新插件
const boss = document.createElement("canvas"); //boss战画布设置
boss.style.position = "absolute";
@ -16112,7 +16199,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}
core.ui.boss = new boss1();
},
剧情视频引用: function () {
"剧情视频引用": function () {
// 在此增加新插件
let a;
let bgm;
@ -16418,7 +16505,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
);
};
},
musicMode: function () {
"musicMode": function () {
// 在此增加新插件
const music = document.createElement("canvas");
music.style.position = "absolute";
@ -17538,7 +17625,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
});
};
},
横屏切换: function () {
"横屏切换": function () {
// 在此增加新插件
this.triggerFullscreen = async function (full) {
if (!!document.fullscreenElement && !full) {
@ -17576,7 +17663,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}
};
},
图片压缩webp导出: function () {
"图片压缩webp导出": function () {
// 在此增加新插件
//使用方法进入游戏后开始游戏F12打开控制台输入core.towebp(image),image为已在全塔属性中注册过的图片名字需要""括起来
this.towebp = function (image) {
@ -17610,7 +17697,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
"帧动画特效(游戏界面)": function () {
// 在此增加新插件
const animate2 = document.createElement("canvas"); //画布设置
animate2.style.zIndex = 71;
animate2.style.zIndex = 91;
animate2.id = "animate2";
animate2.classList.add("gameCanvas", "anti-aliasing");
animate2.style.display = "block";
@ -17812,7 +17899,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
}, time * 1000);
};
},
开局选项悬停: function () {
"开局选项悬停": function () {
// 在此增加新插件
main.dom.playGame.addEventListener("mouseenter", () => {
@ -17895,7 +17982,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
core.dom.replayGame.style.backgroundColor = "transparent";
});
},
天气叠加: function () {
"天气叠加": function () {
//使用方法使用core.setWeather(天气,等级)来增加天气使用core.setWeather()来清空天气
// 天气叠加功能
////// 更改天气效果 //////
@ -18147,4 +18234,150 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
);
};
},
"回合战斗动画": function () {
// 在此增加新插件
const animateAttack = document.createElement("canvas"); //画布设置
animateAttack.style.zIndex = 80;
animateAttack.id = "animateAttack";
animateAttack.classList.add("gameCanvas", "anti-aliasing");
animateAttack.style.display = "block";
animateAttack.width = 416;
animateAttack.height = 416;
animateAttack.style.width = core.__PIXELS__ * core.domStyle.scale + "px";
animateAttack.style.height = core.__PIXELS__ * core.domStyle.scale + "px";
main.dom.animateAttack = animateAttack;
const ctx = animateAttack.getContext("2d");
main.dom.gameDraw.appendChild(animateAttack);
this.drawAttackAnimate = function (
heroInfo,
oneTurn,
enemyInfo,
equipInfo,
farme
) {
core.clearMap(ctx);
let animate = Math.floor(farme / 30);
core.fillRect(ctx, 64, 64, 288, 288, "rgba(0,0,0,0.5)");
core.strokeRect(ctx, 64, 64, 288, 288, "rgba(255,255,255,0.5)", 4);
core.setTextAlign(ctx, "left");
core.fillBoldText(
ctx,
hero.name,
112,
128,
"#FFFFFF",
"#000000",
core.ui._buildFont(14, true)
);
core.strokeRect(ctx, 112, 144, 32, 48, "rgba(255,255,255,1)", 1);
core.drawImage(
ctx,
"hero.webp",
32 * (animate % 4),
0,
32,
48,
112,
144,
32,
48
);
core.setTextAlign(ctx, "right");
core.fillBoldText(
ctx,
enemyInfo.name,
304,
128,
"#FFFFFF",
"#000000",
core.ui._buildFont(14, true)
);
if (enemyInfo.cls === "enemys") {
core.strokeRect(ctx, 272, 160, 32, 32, "rgba(255,255,255,1)", 1);
core.drawImage(
ctx,
core.getBlockInfo(enemyInfo.id).image,
32 * (animate % 2),
core.getBlockInfo(enemyInfo.id).posY * 32,
32,
32,
272,
160,
32,
32
);
} else {
core.strokeRect(ctx, 272, 144, 32, 48, "rgba(255,255,255,1)", 1);
core.drawImage(
ctx,
core.getBlockInfo(enemyInfo.id).image,
32 * (animate % 4),
core.getBlockInfo(enemyInfo.id).posY * 48,
32,
32,
272,
144,
32,
48
);
}
};
this.attackAnimate = function (
enemyId,
enemyInfo,
damageInfo,
equipInfo = []
) {
//参数分别为怪物真实属性,战斗信息,特殊装备(如火焰风衣)属性特殊装备属性为以元组{equipId,oneDamage,speed,now:0}构成的数组(列出每个需要计算的特殊装备,没有则为空数组或不填)
core.lockControl();
core.clearMap(ctx);
core.status.event.id = "attackAnimate";
let hero_hp = core.getRealStatusOrDefault(hero, "hp"),
hero_atk = core.getRealStatusOrDefault(hero, "atk"),
hero_def = core.getRealStatusOrDefault(hero, "def"),
hero_mdef = core.getRealStatusOrDefault(hero, "mdef"),
hero_speed = core.getRealStatusOrDefault(hero, "speed");
const heroInfo = {
hp: hero_hp,
atk: hero_atk,
def: hero_def,
mdef: hero_mdef,
speed: hero_speed,
now: 0,
};
enemyInfo.id = enemyId;
enemyInfo.cls = core.getClsFromId(enemyId);
enemyInfo.name = core.material.enemys[enemyId].name;
let oneTurn = heroInfo.speed + enemyInfo.speed;
if (equipInfo.length > 0) {
for (let i; i < equipInfo.length - 1; i++) {
oneTurn += equipInfo[i].speed;
}
}
oneTurn *= 100;
let time = 0,
farme = 0;
core.registerAnimationFrame("attackAnimate", true, (temptime) => {
if (temptime - time > 1000 / 60) {
time = temptime;
this.drawAttackAnimate(
heroInfo,
oneTurn,
enemyInfo,
equipInfo,
farme
);
farme++;
}
});
};
}
}