封面异画

This commit is contained in:
strawberry42271 committed 2025-01-09 13:54:45 +08:00
1 parent 572cd40493
commit 4fbfe72989
6 files changed
+264 -262

No files matched your search

+1 -1
View File
@@ -1 +1 @@
{"viewportLoc":[0,0],"editorLastFloorId":"shinvhome","lastUsed":[{"idnum":210,"id":"skeletonWarrior","images":"enemys","y":9,"recent":1735825145197,"frequent":4},{"idnum":21,"id":"yellowKey","images":"items","y":0,"recent":1735824906066,"frequent":14},{"idnum":81,"id":"yellowDoor","images":"animates","y":4,"recent":1735824901122,"frequent":26},{"idnum":214,"id":"zombieKnight","images":"enemys","y":13,"recent":1735824888165,"frequent":2},{"idnum":82,"id":"blueDoor","images":"animates","y":5,"recent":1735824878838,"frequent":4},{"idnum":32,"id":"bluePotion","images":"items","y":21,"recent":1735824871469,"frequent":2},{"idnum":28,"id":"blueGem","images":"items","y":17,"recent":1735824867878,"frequent":6},{"idnum":27,"id":"redGem","images":"items","y":16,"recent":1735824864181,"frequent":5},{"idnum":22,"id":"blueKey","images":"items","y":1,"recent":1735824852246,"frequent":4},{"idnum":140,"id":"autotile4","images":"autotile","y":0,"recent":1735824840165,"frequent":138},{"idnum":209,"id":"skeleton","images":"enemys","y":8,"recent":1735824813505,"frequent":2},{"idnum":94,"id":"rightPortal","images":"animates","y":25,"recent":1735824733893,"frequent":6},{"idnum":92,"id":"leftPortal","images":"animates","y":24,"recent":1735824084823,"frequent":2},{"idnum":91,"id":"upPortal","images":"animates","y":26,"recent":1735821889246,"frequent":2},{"idnum":85,"id":"specialDoor","images":"animates","y":8,"recent":1735820976103,"frequent":3},{"idnum":93,"id":"downPortal","images":"animates","y":23,"recent":1735820969951,"frequent":2},{"idnum":89,"id":"portal","images":"animates","y":17,"recent":1735820958612,"frequent":1},{"idnum":26,"id":"bigKey","images":"items","y":6,"recent":1735820920269,"frequent":1},{"idnum":34,"id":"yellowPotion","images":"items","y":23,"recent":1735820909149,"frequent":1},{"idnum":33,"id":"greenPotion","images":"items","y":22,"recent":1735820906301,"frequent":1},{"idnum":83,"id":"redDoor","images":"animates","y":6,"recent":1735820844323,"frequent":2},{"idnum":247,"id":"magicMaster","images":"enemys","y":46,"recent":1735820830425,"frequent":1},{"idnum":20160,"id":"X20160","images":"5.png","x":0,"y":20,"isTile":true,"recent":1735398503013,"frequent":2},{"idnum":20168,"id":"X20168","images":"5.png","x":0,"y":21,"isTile":true,"recent":1735398496973,"frequent":3},{"idnum":20176,"id":"X20176","images":"5.png","x":0,"y":22,"isTile":true,"recent":1735398485125,"frequent":1},{"idnum":71742,"id":"X71742","images":"11.png","x":6,"y":217,"isTile":true,"recent":1735398452693,"frequent":1},{"idnum":71750,"id":"X71750","images":"11.png","x":6,"y":218,"isTile":true,"recent":1735398448325,"frequent":1},{"idnum":71751,"id":"X71751","images":"11.png","x":7,"y":218,"isTile":true,"recent":1735398443645,"frequent":1},{"idnum":71783,"id":"X71783","images":"11.png","x":7,"y":222,"isTile":true,"recent":1735398426909,"frequent":7},{"idnum":71799,"id":"X71799","images":"11.png","x":7,"y":224,"isTile":true,"recent":1735398421365,"frequent":5},{"idnum":71826,"id":"X71826","images":"11.png","x":2,"y":228,"isTile":true,"recent":1735398415661,"frequent":2},{"idnum":71818,"id":"X71818","images":"11.png","x":2,"y":227,"isTile":true,"recent":1735398413269,"frequent":3},{"idnum":224,"id":"swordsman","images":"enemys","y":23,"recent":1735398341974,"frequent":6},{"idnum":71842,"id":"X71842","images":"11.png","x":2,"y":230,"isTile":true,"recent":1735398315069,"frequent":1},{"idnum":71834,"id":"X71834","images":"11.png","x":2,"y":229,"isTile":true,"recent":1735398312437,"frequent":1},{"idnum":110114,"id":"X110114","images":"C4.png","x":2,"y":14,"isTile":true,"recent":1735398246502,"frequent":6},{"idnum":110122,"id":"X110122","images":"C4.png","x":2,"y":15,"isTile":true,"recent":1735398239998,"frequent":1},{"idnum":110028,"id":"X110028","images":"C4.png","x":4,"y":3,"isTile":true,"recent":1735398198709,"frequent":2},{"idnum":110020,"id":"X110020","images":"C4.png","x":4,"y":2,"isTile":true,"recent":1735398191398,"frequent":2},{"idnum":71791,"id":"X71791","images":"11.png","x":7,"y":223,"isTile":true,"recent":1735398163774,"frequent":3},{"idnum":71785,"id":"X71785","images":"11.png","x":1,"y":223,"isTile":true,"recent":1735398120734,"frequent":2},{"idnum":71784,"id":"X71784","images":"11.png","x":0,"y":223,"isTile":true,"recent":1735398118318,"frequent":3},{"idnum":71793,"id":"X71793","images":"11.png","x":1,"y":224,"isTile":true,"recent":1735398115446,"frequent":2},{"idnum":71792,"id":"X71792","images":"11.png","x":0,"y":224,"isTile":true,"recent":1735398113142,"frequent":2},{"idnum":71787,"id":"X71787","images":"11.png","x":3,"y":223,"isTile":true,"recent":1735398102326,"frequent":1},{"idnum":71786,"id":"X71786","images":"11.png","x":2,"y":223,"isTile":true,"recent":1735398099430,"frequent":1},{"idnum":71795,"id":"X71795","images":"11.png","x":3,"y":224,"isTile":true,"recent":1735398097359,"frequent":1},{"idnum":71794,"id":"X71794","images":"11.png","x":2,"y":224,"isTile":true,"recent":1735398094982,"frequent":1},{"idnum":130006,"id":"X1300Line truncated
{"viewportLoc":[0,0],"editorLastFloorId":"jiuguan","lastUsed":[{"idnum":210,"id":"skeletonWarrior","images":"enemys","y":9,"recent":1735825145197,"frequent":4},{"idnum":21,"id":"yellowKey","images":"items","y":0,"recent":1735824906066,"frequent":14},{"idnum":81,"id":"yellowDoor","images":"animates","y":4,"recent":1735824901122,"frequent":26},{"idnum":214,"id":"zombieKnight","images":"enemys","y":13,"recent":1735824888165,"frequent":2},{"idnum":82,"id":"blueDoor","images":"animates","y":5,"recent":1735824878838,"frequent":4},{"idnum":32,"id":"bluePotion","images":"items","y":21,"recent":1735824871469,"frequent":2},{"idnum":28,"id":"blueGem","images":"items","y":17,"recent":1735824867878,"frequent":6},{"idnum":27,"id":"redGem","images":"items","y":16,"recent":1735824864181,"frequent":5},{"idnum":22,"id":"blueKey","images":"items","y":1,"recent":1735824852246,"frequent":4},{"idnum":140,"id":"autotile4","images":"autotile","y":0,"recent":1735824840165,"frequent":138},{"idnum":209,"id":"skeleton","images":"enemys","y":8,"recent":1735824813505,"frequent":2},{"idnum":94,"id":"rightPortal","images":"animates","y":25,"recent":1735824733893,"frequent":6},{"idnum":92,"id":"leftPortal","images":"animates","y":24,"recent":1735824084823,"frequent":2},{"idnum":91,"id":"upPortal","images":"animates","y":26,"recent":1735821889246,"frequent":2},{"idnum":85,"id":"specialDoor","images":"animates","y":8,"recent":1735820976103,"frequent":3},{"idnum":93,"id":"downPortal","images":"animates","y":23,"recent":1735820969951,"frequent":2},{"idnum":89,"id":"portal","images":"animates","y":17,"recent":1735820958612,"frequent":1},{"idnum":26,"id":"bigKey","images":"items","y":6,"recent":1735820920269,"frequent":1},{"idnum":34,"id":"yellowPotion","images":"items","y":23,"recent":1735820909149,"frequent":1},{"idnum":33,"id":"greenPotion","images":"items","y":22,"recent":1735820906301,"frequent":1},{"idnum":83,"id":"redDoor","images":"animates","y":6,"recent":1735820844323,"frequent":2},{"idnum":247,"id":"magicMaster","images":"enemys","y":46,"recent":1735820830425,"frequent":1},{"idnum":20160,"id":"X20160","images":"5.png","x":0,"y":20,"isTile":true,"recent":1735398503013,"frequent":2},{"idnum":20168,"id":"X20168","images":"5.png","x":0,"y":21,"isTile":true,"recent":1735398496973,"frequent":3},{"idnum":20176,"id":"X20176","images":"5.png","x":0,"y":22,"isTile":true,"recent":1735398485125,"frequent":1},{"idnum":71742,"id":"X71742","images":"11.png","x":6,"y":217,"isTile":true,"recent":1735398452693,"frequent":1},{"idnum":71750,"id":"X71750","images":"11.png","x":6,"y":218,"isTile":true,"recent":1735398448325,"frequent":1},{"idnum":71751,"id":"X71751","images":"11.png","x":7,"y":218,"isTile":true,"recent":1735398443645,"frequent":1},{"idnum":71783,"id":"X71783","images":"11.png","x":7,"y":222,"isTile":true,"recent":1735398426909,"frequent":7},{"idnum":71799,"id":"X71799","images":"11.png","x":7,"y":224,"isTile":true,"recent":1735398421365,"frequent":5},{"idnum":71826,"id":"X71826","images":"11.png","x":2,"y":228,"isTile":true,"recent":1735398415661,"frequent":2},{"idnum":71818,"id":"X71818","images":"11.png","x":2,"y":227,"isTile":true,"recent":1735398413269,"frequent":3},{"idnum":224,"id":"swordsman","images":"enemys","y":23,"recent":1735398341974,"frequent":6},{"idnum":71842,"id":"X71842","images":"11.png","x":2,"y":230,"isTile":true,"recent":1735398315069,"frequent":1},{"idnum":71834,"id":"X71834","images":"11.png","x":2,"y":229,"isTile":true,"recent":1735398312437,"frequent":1},{"idnum":110114,"id":"X110114","images":"C4.png","x":2,"y":14,"isTile":true,"recent":1735398246502,"frequent":6},{"idnum":110122,"id":"X110122","images":"C4.png","x":2,"y":15,"isTile":true,"recent":1735398239998,"frequent":1},{"idnum":110028,"id":"X110028","images":"C4.png","x":4,"y":3,"isTile":true,"recent":1735398198709,"frequent":2},{"idnum":110020,"id":"X110020","images":"C4.png","x":4,"y":2,"isTile":true,"recent":1735398191398,"frequent":2},{"idnum":71791,"id":"X71791","images":"11.png","x":7,"y":223,"isTile":true,"recent":1735398163774,"frequent":3},{"idnum":71785,"id":"X71785","images":"11.png","x":1,"y":223,"isTile":true,"recent":1735398120734,"frequent":2},{"idnum":71784,"id":"X71784","images":"11.png","x":0,"y":223,"isTile":true,"recent":1735398118318,"frequent":3},{"idnum":71793,"id":"X71793","images":"11.png","x":1,"y":224,"isTile":true,"recent":1735398115446,"frequent":2},{"idnum":71792,"id":"X71792","images":"11.png","x":0,"y":224,"isTile":true,"recent":1735398113142,"frequent":2},{"idnum":71787,"id":"X71787","images":"11.png","x":3,"y":223,"isTile":true,"recent":1735398102326,"frequent":1},{"idnum":71786,"id":"X71786","images":"11.png","x":2,"y":223,"isTile":true,"recent":1735398099430,"frequent":1},{"idnum":71795,"id":"X71795","images":"11.png","x":3,"y":224,"isTile":true,"recent":1735398097359,"frequent":1},{"idnum":71794,"id":"X71794","images":"11.png","x":2,"y":224,"isTile":true,"recent":1735398094982,"frequent":1},{"idnum":130006,"id":"X130006Line truncated
+2
View File
@@ -262,6 +262,8 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"ulr.webp",
"unknow.webp",
"ur.webp",
"winbackground.webp",
"winbackgroundVertical.webp",
"winskin.webp",
"winskin1.webp"
],
Binary file not shown.

Before

Width:  |  Height:  |  Size: 257 KiB

After

Width:  |  Height:  |  Size: 262 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 171 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

+261 -261
View File
@@ -2593,8 +2593,8 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
core.dom.musicBtn.style.bottom =
(obj.clientHeight - obj.totalHeight) / 2 - 27 + "px";
let startBackground = core.domStyle.isVertical ?
main.styles.startVerticalBackground || main.styles.startBackground :
main.styles.startBackground;
core.getLocalStorage('end') ? 'project/images/winbackgroundVertical.webp' : main.styles.startVerticalBackground || main.styles.startBackground :
core.getLocalStorage('end') ? 'project/images/winbackground.webp' : main.styles.startBackground;
if (main.dom.startBackground.getAttribute("__src__") != startBackground) {
main.dom.startBackground.setAttribute("__src__", startBackground);
main.dom.startBackground.src = startBackground;
@@ -4181,279 +4181,279 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 =
}
},
"编辑器显伤": function () {
// 在此增加新插件
/////// 用户设置 ///////
// 将__enable置为false将关闭插件
var __enable = true;
// 魔防攻速之类的属性可以在这里加 ['atk', 'def', 'mdef']
var heroStatus = ["atk", "def", "mdef", "hp"];
// saveHero为true 将会把每次造塔测试时的角色数据存下来 否则会读取初始属性
// 用不着可以关了 节约缓存空间 (虽然根本没多少 还没一个存档大
// 也可以手动清理 控制台输入core.removeLocalStorage('editorHero')即可
var saveHero = true;
// 在此增加新插件
/////// 用户设置 ///////
// 将__enable置为false将关闭插件
var __enable = true;
// 魔防攻速之类的属性可以在这里加 ['atk', 'def', 'mdef']
var heroStatus = ["atk", "def", "mdef", "hp"];
// saveHero为true 将会把每次造塔测试时的角色数据存下来 否则会读取初始属性
// 用不着可以关了 节约缓存空间 (虽然根本没多少 还没一个存档大
// 也可以手动清理 控制台输入core.removeLocalStorage('editorHero')即可
var saveHero = true;
// 下为具体实现 懒得写注释了 大概就是写HTML然后注册交互
if (!__enable || main.mode != "editor") return;
core.plugin.initEditorDamage = false;
if (heroStatus.length >= 4 && !editor.isMobile)
editor.dom.mid2.style.top = 650 + 30 * (heroStatus.length - 3) + "px";
editor.statusRatio = core.getLocalStorage("statusRatio", 1);
editor.saveHero = saveHero;
editor._heroStatus = heroStatus;
editor.dom.mapEdit.appendChild(core.canvas.damage.canvas);
var HTML =
"<input type='button' value='←'/><input type='button' value='↑'/><input type='button' value='↓'/><input type='button' value='→'/><input type='button' id='bigmapBtn' value='大地图'' style='margin-left: '5px'/>";
// 下为具体实现 懒得写注释了 大概就是写HTML然后注册交互
if (!__enable || main.mode != "editor") return;
core.plugin.initEditorDamage = false;
if (heroStatus.length >= 4 && !editor.isMobile)
editor.dom.mid2.style.top = 650 + 30 * (heroStatus.length - 3) + "px";
editor.statusRatio = core.getLocalStorage("statusRatio", 1);
editor.saveHero = saveHero;
editor._heroStatus = heroStatus;
editor.dom.mapEdit.appendChild(core.canvas.damage.canvas);
var HTML =
"<input type='button' value='←'/><input type='button' value='↑'/><input type='button' value='↓'/><input type='button' value='→'/><input type='button' id='bigmapBtn' value='大地图'' style='margin-left: '5px'/>";
//if (heroStatus.length >= 4 && !editor.isMobile) editor.dom.mid2.style.top = 650 + 30 * (heroStatus.length - 3) + 'px';
heroStatus.forEach(function (status) {
var id = status + "set",
id2 = status + "add",
id3 = status + "rec",
id4 = status + "help";
HTML +=
"<br/><input type='text' size='15' id='" +
id +
"'><input type='button' id='" +
id2 +
"' value = '+'><input type='button' id='" +
id3 +
"' value = '-'><input type='button' value='?' id = '" +
id4 +
"'>";
});
document.getElementById("viewportButtons").innerHTML = HTML;
["set", "add", "rec", "help"].forEach(function (e) {
heroStatus.forEach(function (status) {
editor.dom[status + e] = document.getElementById(status + e);
});
});
var _hasItem = core.items.hasItem;
core.items.hasItem = function (itemId) {
if (itemId == "book" && main.mode == "editor") return true;
return _hasItem.call(core.items, itemId);
};
if (main.mode == "editor") {
var applyList = [
"getDamageString",
"nextCriticals",
"getEnemyInfo",
"getEnemyValue",
];
applyList.forEach(function (name) {
var func = core.enemys[name];
core.enemys[name] = function () {
var args =
arguments.length === 1
? [arguments[0]]
: Array.apply(null, arguments);
if (typeof args[0] == "string") args[0] = core.enemys.enemys[args[0]];
return func.apply(core.enemys, args);
};
});
}
//if (heroStatus.length >= 4 && !editor.isMobile) editor.dom.mid2.style.top = 650 + 30 * (heroStatus.length - 3) + 'px';
heroStatus.forEach(function (status) {
var id = status + "set",
id2 = status + "add",
id3 = status + "rec",
id4 = status + "help";
HTML +=
"<br/><input type='text' size='15' id='" +
id +
"'><input type='button' id='" +
id2 +
"' value = '+'><input type='button' id='" +
id3 +
"' value = '-'><input type='button' value='?' id = '" +
id4 +
"'>";
});
document.getElementById("viewportButtons").innerHTML = HTML;
["set", "add", "rec", "help"].forEach(function (e) {
heroStatus.forEach(function (status) {
editor.dom[status + e] = document.getElementById(status + e);
});
});
var _hasItem = core.items.hasItem;
core.items.hasItem = function (itemId) {
if (itemId == "book" && main.mode == "editor") return true;
return _hasItem.call(core.items, itemId);
};
if (main.mode == "editor") {
var applyList = [
"getDamageString",
"nextCriticals",
"getEnemyInfo",
"getEnemyValue",
];
applyList.forEach(function (name) {
var func = core.enemys[name];
core.enemys[name] = function () {
var args =
arguments.length === 1 ?
[arguments[0]] :
Array.apply(null, arguments);
if (typeof args[0] == "string") args[0] = core.enemys.enemys[args[0]];
return func.apply(core.enemys, args);
};
});
}
////// 获得勇士属性 //////
core.control.getStatus = function (name) {
if (!core.status.hero) return null;
if (name == "x" || name == "y" || name == "direction")
return this.getHeroLoc(name);
/*if ( main.mode == 'editor' && !core.hasFlag('__statistics__')) {
////// 获得勇士属性 //////
core.control.getStatus = function (name) {
if (!core.status.hero) return null;
if (name == "x" || name == "y" || name == "direction")
return this.getHeroLoc(name);
/*if ( main.mode == 'editor' && !core.hasFlag('__statistics__')) {
return data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d.firstData.hero[name];
}*/
return core.status.hero[name];
};
return core.status.hero[name];
};
core.control.updateDamage = function (floorId, ctx) {
floorId = floorId || core.status.floorId;
if (!floorId || core.status.gameOver) return;
var onMap = ctx == null;
if (main.mode == "editor") {
ctx = core.canvas.damage;
core.updateCheckBlock();
core.clearMap(ctx);
if (editor.uivalues.bigmap) return;
}
core.control.updateDamage = function (floorId, ctx) {
floorId = floorId || core.status.floorId;
if (!floorId || core.status.gameOver) return;
var onMap = ctx == null;
if (main.mode == "editor") {
ctx = core.canvas.damage;
core.updateCheckBlock();
core.clearMap(ctx);
if (editor.uivalues.bigmap) return;
}
// 没有怪物手册
if (!core.hasItem("book")) return;
core.status.damage.posX = core.bigmap.posX;
core.status.damage.posY = core.bigmap.posY;
if (!onMap) {
var width = core.floors[floorId].width,
height = core.floors[floorId].height;
// 地图过大的缩略图不绘制显伤
if (width * height > core.bigmap.threshold) return;
}
this._updateDamage_damage(floorId, onMap);
this._updateDamage_extraDamage(floorId, onMap);
this.drawDamage(ctx);
};
// 没有怪物手册
if (!core.hasItem("book")) return;
core.status.damage.posX = core.bigmap.posX;
core.status.damage.posY = core.bigmap.posY;
if (!onMap) {
var width = core.floors[floorId].width,
height = core.floors[floorId].height;
// 地图过大的缩略图不绘制显伤
if (width * height > core.bigmap.threshold) return;
}
this._updateDamage_damage(floorId, onMap);
this._updateDamage_extraDamage(floorId, onMap);
this.drawDamage(ctx);
};
core.control.drawDamage = function (ctx) {
if (
core.status.gameOver ||
!core.status.damage /* || main.mode != 'play'*/
)
return;
var onMap = false;
if (ctx == null) {
ctx = core.canvas.damage;
core.clearMap("damage");
onMap = true;
}
core.control.drawDamage = function (ctx) {
if (
core.status.gameOver ||
!core.status.damage /* || main.mode != 'play'*/
)
return;
var onMap = false;
if (ctx == null) {
ctx = core.canvas.damage;
core.clearMap("damage");
onMap = true;
}
if (onMap && core.bigmap.v2) {
// 检查是否需要重算...
if (
Math.abs(core.bigmap.posX - core.status.damage.posX) >=
core.bigmap.extend - 1 ||
Math.abs(core.bigmap.posY - core.status.damage.posY) >=
core.bigmap.extend - 1
) {
return this.updateDamage();
}
}
return this._drawDamage_draw(ctx, onMap);
};
if (onMap && core.bigmap.v2) {
// 检查是否需要重算...
if (
Math.abs(core.bigmap.posX - core.status.damage.posX) >=
core.bigmap.extend - 1 ||
Math.abs(core.bigmap.posY - core.status.damage.posY) >=
core.bigmap.extend - 1
) {
return this.updateDamage();
}
}
return this._drawDamage_draw(ctx, onMap);
};
////// 以x,y的形式返回每个点的事件 //////
core.maps.getMapBlocksObj = function (floorId, noCache) {
floorId = floorId || core.status.floorId;
if (
core.status.mapBlockObjs[floorId] &&
!noCache &&
main.mode != "editor"
)
return core.status.mapBlockObjs[floorId];
////// 以x,y的形式返回每个点的事件 //////
core.maps.getMapBlocksObj = function (floorId, noCache) {
floorId = floorId || core.status.floorId;
if (
core.status.mapBlockObjs[floorId] &&
!noCache &&
main.mode != "editor"
)
return core.status.mapBlockObjs[floorId];
var obj = {};
core.extractBlocks(floorId);
core.status.maps[floorId].blocks.forEach(function (block) {
obj[block.x + "," + block.y] = block;
});
core.status.mapBlockObjs[floorId] = obj;
return obj;
};
var obj = {};
core.extractBlocks(floorId);
core.status.maps[floorId].blocks.forEach(function (block) {
obj[block.x + "," + block.y] = block;
});
core.status.mapBlockObjs[floorId] = obj;
return obj;
};
this.bignum = function (num, defaultValue) {
if (num == null || num == "") return defaultValue;
num = num + "";
var list = {
w: 1e4,
e: 1e8,
z: 1e12,
j: 1e16,
g: 1e20,
};
// 浮点数问题
function checkFloat(num) {
if (!core.isset(num)) return 0;
num = num + "";
var index = num.indexOf(".");
if (index < 0) return 0;
else return num.slice(index + 1).length;
}
var index = num.search(/w|e|z|j|g/);
if (index <= 0) {
num = parseInt(num);
if (core.isset(num)) return num;
else {
alert("不正确的输入");
return defaultValue;
}
}
for (; index > 0; index = num.search(/w|e|z|j|g/)) {
var p = num[index],
q = list[p],
n = num.slice(0, index),
m = Math.pow(10, checkFloat(n));
num = (n * m * q) / m + num.slice(index + 1);
}
return parseInt(num);
};
this.bignum = function (num, defaultValue) {
if (num == null || num == "") return defaultValue;
num = num + "";
var list = {
w: 1e4,
e: 1e8,
z: 1e12,
j: 1e16,
g: 1e20,
};
// 浮点数问题
function checkFloat(num) {
if (!core.isset(num)) return 0;
num = num + "";
var index = num.indexOf(".");
if (index < 0) return 0;
else return num.slice(index + 1).length;
}
var index = num.search(/w|e|z|j|g/);
if (index <= 0) {
num = parseInt(num);
if (core.isset(num)) return num;
else {
alert("不正确的输入");
return defaultValue;
}
}
for (; index > 0; index = num.search(/w|e|z|j|g/)) {
var p = num[index],
q = list[p],
n = num.slice(0, index),
m = Math.pow(10, checkFloat(n));
num = (n * m * q) / m + num.slice(index + 1);
}
return parseInt(num);
};
this.updateEditorDamage = function (noSave) {
core.updateDamage();
heroStatus.forEach(function (status) {
editor.dom[status + "set"].value = core.status.hero[status];
});
if (!noSave && editor.saveHero)
core.setLocalStorage("editorHero", core.status.hero);
};
this.updateEditorDamage = function (noSave) {
core.updateDamage();
heroStatus.forEach(function (status) {
editor.dom[status + "set"].value = core.status.hero[status];
});
if (!noSave && editor.saveHero)
core.setLocalStorage("editorHero", core.status.hero);
};
var _resizeMap = core.maps.resizeMap;
core.maps.resizeMap = function (floorId) {
_resizeMap.call(core.maps, floorId);
if (!core.plugin.initEditorDamage && main.mode == "editor") {
core.plugin.initEditorDamage = true;
var editorHero = core.getLocalStorage("editorHero");
if (editorHero && saveHero) core.status.hero = editorHero;
else core.removeLocalStorage("editorHero");
editor._heroStatus.forEach(function (e) {
editor.dom[e + "set"].onchange = function () {
var status = this.id.slice(0, -3);
core.status.hero[status] = core.bignum(
this.value,
core.status.hero[status]
);
core.updateEditorDamage();
};
editor.dom[e + "add"].onclick = function () {
var status = this.id.slice(0, -3);
core.status.hero[status] += editor.statusRatio;
core.updateEditorDamage();
};
editor.dom[e + "rec"].onclick = function () {
var status = this.id.slice(0, -3);
core.status.hero[status] -= editor.statusRatio;
core.updateEditorDamage();
};
editor.dom[e + "help"].onclick = function () {
var status = this.id.slice(0, -4),
name = core.getStatusLabel(status);
var ratio = parseInt(
prompt(
"当前属性:" +
name +
"\n现在的点击按钮变化值:" +
editor.statusRatio +
",请输入按下一次+/-按钮的属性变化量,可以写4w 10.2e这种字母缩写"
)
);
if (!core.isset(ratio)) {
printe("不合法的输入");
return;
}
editor.statusRatio = ratio;
core.setLocalStorage("statusRatio", ratio);
};
});
var _updateMap = editor.updateMap;
editor.updateMap = function () {
_updateMap.call(editor);
core.updateEditorDamage(true);
};
editor.mode.onmode = function (mode, callback) {
if (editor_mode.mode != mode) {
if (mode === "save") {
editor_mode.doActionList(
editor_mode.mode,
editor_mode.actionList,
function () {
if (callback) callback();
core.updateEditorDamage();
}
);
}
if (editor_mode.mode === "nextChange" && mode)
editor_mode.showMode(mode);
if (mode !== "save") editor_mode.mode = mode;
editor_mode.actionList = [];
}
};
}
};
},
var _resizeMap = core.maps.resizeMap;
core.maps.resizeMap = function (floorId) {
_resizeMap.call(core.maps, floorId);
if (!core.plugin.initEditorDamage && main.mode == "editor") {
core.plugin.initEditorDamage = true;
var editorHero = core.getLocalStorage("editorHero");
if (editorHero && saveHero) core.status.hero = editorHero;
else core.removeLocalStorage("editorHero");
editor._heroStatus.forEach(function (e) {
editor.dom[e + "set"].onchange = function () {
var status = this.id.slice(0, -3);
core.status.hero[status] = core.bignum(
this.value,
core.status.hero[status]
);
core.updateEditorDamage();
};
editor.dom[e + "add"].onclick = function () {
var status = this.id.slice(0, -3);
core.status.hero[status] += editor.statusRatio;
core.updateEditorDamage();
};
editor.dom[e + "rec"].onclick = function () {
var status = this.id.slice(0, -3);
core.status.hero[status] -= editor.statusRatio;
core.updateEditorDamage();
};
editor.dom[e + "help"].onclick = function () {
var status = this.id.slice(0, -4),
name = core.getStatusLabel(status);
var ratio = parseInt(
prompt(
"当前属性:" +
name +
"\n现在的点击按钮变化值:" +
editor.statusRatio +
",请输入按下一次+/-按钮的属性变化量,可以写4w 10.2e这种字母缩写"
)
);
if (!core.isset(ratio)) {
printe("不合法的输入");
return;
}
editor.statusRatio = ratio;
core.setLocalStorage("statusRatio", ratio);
};
});
var _updateMap = editor.updateMap;
editor.updateMap = function () {
_updateMap.call(editor);
core.updateEditorDamage(true);
};
editor.mode.onmode = function (mode, callback) {
if (editor_mode.mode != mode) {
if (mode === "save") {
editor_mode.doActionList(
editor_mode.mode,
editor_mode.actionList,
function () {
if (callback) callback();
core.updateEditorDamage();
}
);
}
if (editor_mode.mode === "nextChange" && mode)
editor_mode.showMode(mode);
if (mode !== "save") editor_mode.mode = mode;
editor_mode.actionList = [];
}
};
}
};
},
"手册区分特殊属性": function () {
// 在此增加新插件
this.arrsame = function (Arraya, Arrayb) {