修复样板傻逼bug,循环动画挂载存档

This commit is contained in:
草莓 2025-04-18 21:20:21 +08:00
parent c5600f78d1
commit 7e3625e637
2 changed files with 88 additions and 77 deletions

View File

@ -2192,6 +2192,7 @@ maps.prototype.showBgFgMap = function (name, loc, floorId, callback) {
////// 隐藏前景/背景地图 //////
maps.prototype.hideBgFgMap = function (name, loc, floorId, callback) {
this.removeGlobalAnimate(loc.x, loc.y, name)
this._triggerBgFgMap('hide', name, loc, floorId, callback);
}
@ -2455,7 +2456,7 @@ maps.prototype.setBgFgBlock = function (name, number, x, y, floorId) {
if (/^\d+$/.test(number)) number = parseInt(number);
else number = core.getNumberById(number);
}
this.removeGlobalAnimate(x, y, name)
var values = core.getFlag('__' + name + 'v__', {});
values[floorId] = (values[floorId] || []).filter(function (one) { return one[0] != x || one[1] != y });
values[floorId].push([x, y, number]);

View File

@ -8,6 +8,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 清除游戏数据
// 这一步会清空状态栏和全部画布内容,并删除所有动态创建的画布
core.clearStatus();
core.status.animateObjs = []
core.plugin.playing.clear()
// 初始化status
core.status = core.clone(core.initStatus, function (name) {
return name != "hero" && name != "maps";
@ -68,6 +70,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (replaying) core.stopReplay();
core.waitHeroToStop(function () {
if (!noexit) {
core.status.animateObjs = []
core.plugin.playing.clear()
core.clearMap("all"); // 清空全地图
core.deleteAllCanvas(); // 删除所有创建的画布
core.dom.gif2.innerHTML = "";
@ -86,6 +90,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
core.ui.closePanel();
var replaying = core.isReplaying();
core.stopReplay();
core.status.animateObjs = []
core.plugin.playing.clear()
core.waitHeroToStop(function () {
core.drawText(
["\t[" + (reason || "结局1") + "]你死了。\n如题。"],
@ -1598,7 +1604,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
version: core.firstData.version,
guid: core.getGuid(),
time: new Date().getTime(),
cg: cg
cg: cg,
animateObjs: core.status.animateObjs.filter(v => v.loop),
playing: [...core.plugin.playing].filter(v => v.loop)
};
return data;
},
@ -1645,6 +1653,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// TODO增加自己的一些读档处理
core.ui.statusBar.clearItemInfo();
core.ui.statusBar.update();
core.status.animateObjs = data.animateObjs
core.plugin.playing = new Set(data.playing)
if (core.getFlag("_cgText")) {
core.setFlag("_cgText", false)
for (let v in data.cg) {