diff --git a/libs/actions.js b/libs/actions.js
index eb98a683..0bf91aa6 100644
--- a/libs/actions.js
+++ b/libs/actions.js
@@ -13,7 +13,7 @@ actions.prototype.init = function () {
////// 按下某个键时 //////
actions.prototype.onkeyDown = function (e) {
- if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
+ if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
if (!core.isset(core.status.holdingKeys))core.status.holdingKeys=[];
var isArrow={37:true,38:true,39:true,40:true}[e.keyCode]
if(isArrow && !core.status.lockControl){
@@ -31,7 +31,7 @@ actions.prototype.onkeyDown = function (e) {
////// 放开某个键时 //////
actions.prototype.onkeyUp = function(e) {
- if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') {
+ if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) {
if (e.keyCode==27) // ESCAPE
core.stopReplay();
else if (e.keyCode==90) // Z
@@ -44,6 +44,8 @@ actions.prototype.onkeyUp = function(e) {
core.rewindReplay();
else if (e.keyCode==83)
core.saveReplay();
+ else if (e.keyCode==67)
+ core.bookReplay();
return;
}
@@ -64,7 +66,7 @@ actions.prototype.onkeyUp = function(e) {
////// 按住某个键时 //////
actions.prototype.pressKey = function (keyCode) {
- if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
+ if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
if (keyCode === core.status.holdingKeys.slice(-1)[0]) {
this.keyDown(keyCode);
window.setTimeout(function(){core.pressKey(keyCode);},30);
@@ -73,7 +75,7 @@ actions.prototype.pressKey = function (keyCode) {
////// 根据按下键的code来执行一系列操作 //////
actions.prototype.keyDown = function(keyCode) {
- if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
+ if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
if (core.status.lockControl) {
// Ctrl跳过对话
if (keyCode==17) {
@@ -193,7 +195,8 @@ actions.prototype.keyDown = function(keyCode) {
////// 根据放开键的code来执行一系列操作 //////
actions.prototype.keyUp = function(keyCode, fromReplay) {
- if (!fromReplay&&core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
+ if (!fromReplay&&core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0)
+ return;
if (core.status.lockControl) {
core.status.holdingKeys = [];
@@ -399,7 +402,7 @@ actions.prototype.keyUp = function(keyCode, fromReplay) {
////// 点击(触摸)事件按下时 //////
actions.prototype.ondown = function (x ,y) {
- if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
+ if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
if (!core.status.played || core.status.lockControl) {
this.onclick(x, y, []);
if (core.timeout.onDownTimeout==null) {
@@ -427,7 +430,7 @@ actions.prototype.ondown = function (x ,y) {
////// 当在触摸屏上滑动时 //////
actions.prototype.onmove = function (x ,y) {
- if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
+ if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
// if (core.status.holdingPath==0){return;}
//core.status.mouseOutCheck =1;
var pos={'x':x,'y':y};
@@ -451,7 +454,7 @@ actions.prototype.onmove = function (x ,y) {
////// 当点击(触摸)事件放开时 //////
actions.prototype.onup = function () {
- if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
+ if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
clearTimeout(core.timeout.onDownTimeout);
core.timeout.onDownTimeout = null;
@@ -517,7 +520,7 @@ actions.prototype.getClickLoc = function (x, y) {
////// 具体点击屏幕上(x,y)点时,执行的操作 //////
actions.prototype.onclick = function (x, y, stepPostfix) {
- if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
+ if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
// console.log("Click: (" + x + "," + y + ")");
stepPostfix=stepPostfix||[];
@@ -671,7 +674,7 @@ actions.prototype.onclick = function (x, y, stepPostfix) {
////// 滑动鼠标滚轮时的操作 //////
actions.prototype.onmousewheel = function (direct) {
- if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save') return;
+ if (core.isset(core.status.replay)&&core.status.replay.replaying&&core.status.event.id!='save'&&(core.status.event.id||"").indexOf('book')!=0) return;
// 向下滚动是 -1 ,向上是 1
// 楼层飞行器
@@ -712,7 +715,7 @@ actions.prototype.longClick = function () {
core.drawText();
return true;
}
- if (core.status.event.id=='action' && core.status.event.data.type=='text') {
+ if (core.status.event.id=='action' && (core.status.event.data.type=='text' || core.status.event.data.type=='wait')) {
core.doAction();
return true;
}
@@ -725,7 +728,7 @@ actions.prototype.keyDownCtrl = function () {
core.drawText();
return;
}
- if (core.status.event.id=='action' && core.status.event.data.type=='text') {
+ if (core.status.event.id=='action' && (core.status.event.data.type=='text' || core.status.event.data.type=='wait')) {
core.doAction();
return;
}
@@ -766,7 +769,7 @@ actions.prototype.keyUpConfirmBox = function (keycode) {
////// 自定义事件时的点击操作 //////
actions.prototype.clickAction = function (x,y) {
- if (core.status.event.data.type=='text') {
+ if (core.status.event.data.type=='text' || core.status.event.data.type=='wait') {
// 文字
core.doAction();
return;
@@ -808,7 +811,7 @@ actions.prototype.keyDownAction = function (keycode) {
////// 自定义事件时,放开某个键的操作 //////
actions.prototype.keyUpAction = function (keycode) {
- if (core.status.event.data.type=='text' && (keycode==13 || keycode==32 || keycode==67)) {
+ if ((core.status.event.data.type=='text' || core.status.event.data.type=='wait') && (keycode==13 || keycode==32 || keycode==67)) {
core.doAction();
return;
}
@@ -1655,7 +1658,7 @@ actions.prototype.clickSyncSave = function (x,y) {
if (data instanceof Array) {
core.ui.drawConfirmBox("所有本地存档都将被覆盖,确认?", function () {
- for (var i=1;i<=150;i++) {
+ for (var i=1;i<=5*(main.savePages||30);i++) {
if (i<=data.length) {
core.setLocalStorage("save"+i, data[i-1]);
}
@@ -1670,8 +1673,8 @@ actions.prototype.clickSyncSave = function (x,y) {
})
}
else {
- var index=150;
- for (var i=150;i>=1;i--) {
+ var index=5*(main.savePages||30);
+ for (var i=5*(main.savePages||30);i>=1;i--) {
if (core.getLocalStorage("save"+i, null)==null)
index=i;
else break;
@@ -1687,6 +1690,7 @@ actions.prototype.clickSyncSave = function (x,y) {
core.download(core.firstData.name+"_"+core.formatDate2(new Date())+".h5route", JSON.stringify({
'name': core.firstData.name,
'hard': core.status.hard,
+ 'seed': core.getFlag('seed'),
'route': core.encodeRoute(core.status.route)
}));
break;
@@ -1793,7 +1797,7 @@ actions.prototype.clickLocalSaveSelect = function (x,y) {
switch (selection) {
case 0:
saves=[];
- for (var i=1;i<=150;i++) {
+ for (var i=1;i<=5*(main.savePages||30);i++) {
var data = core.getLocalStorage("save"+i, null);
if (core.isset(data)) {
saves.push(data);
@@ -1801,7 +1805,7 @@ actions.prototype.clickLocalSaveSelect = function (x,y) {
}
break;
case 1:
- for (var i=150;i>=1;i--) {
+ for (var i=5*(main.savePages||30);i>=1;i--) {
saves=core.getLocalStorage("save"+i, null);
if (core.isset(saves)) {
break;
@@ -1865,7 +1869,7 @@ actions.prototype.clickStorageRemove = function (x, y) {
core.drawText("\t[操作成功]你的所有存档已被清空。");
break;
case 1:
- for (var i=1;i<=150;i++) {
+ for (var i=1;i<=5*(main.savePages||30);i++) {
core.removeLocalStorage("save"+i);
}
core.drawText("\t[操作成功]当前塔的存档已被清空。");
@@ -1919,8 +1923,11 @@ actions.prototype.clickReplay = function (x, y) {
{
core.ui.closePanel();
var hard=core.status.hard, route=core.clone(core.status.route);
+ var seed = core.getFlag('seed');
core.resetStatus(core.firstData.hero, hard, core.firstData.floorId, null, core.initStatus.maps);
core.events.setInitData(hard);
+ core.setFlag('seed', seed);
+ core.setFlag('rand', seed);
core.changeFloor(core.status.floorId, null, core.firstData.hero.loc, null, function() {
core.startReplay(route);
}, true);
diff --git a/libs/control.js b/libs/control.js
index 900441ad..a7047e7a 100644
--- a/libs/control.js
+++ b/libs/control.js
@@ -583,9 +583,14 @@ control.prototype.setHeroMoveInterval = function (direction, x, y, callback) {
'down': {'x': 0, 'y': 1},
'right': {'x': 1, 'y': 0}
};
+
+ var toAdd = 1;
+ if (core.status.replay.speed>3)
+ toAdd = 2;
+
core.interval.heroMoveInterval = window.setInterval(function () {
- core.status.heroMoving++;
- if (core.status.heroMoving==8) {
+ core.status.heroMoving+=toAdd;
+ if (core.status.heroMoving>=8) {
core.setHeroLoc('x', x+scan[direction].x);
core.setHeroLoc('y', y+scan[direction].y);
core.moveOneStep();
@@ -595,7 +600,7 @@ control.prototype.setHeroMoveInterval = function (direction, x, y, callback) {
core.status.heroMoving = 0;
if (core.isset(callback)) callback();
}
- }, 12.5 / core.status.replay.speed);
+ }, 12.5 * toAdd / core.status.replay.speed);
}
////// 实际每一步的行走过程 //////
@@ -1428,8 +1433,9 @@ control.prototype.resumeReplay = function () {
control.prototype.speedUpReplay = function () {
if (core.status.event.id=='save') return;
if (!core.status.replay.replaying) return;
- core.status.replay.speed = parseInt(10*core.status.replay.speed + 1)/10;
- if (core.status.replay.speed>3.0) core.status.replay.speed=3.0;
+ var toAdd = core.status.replay.speed>=3?3:core.status.replay.speed>=2?2:1;
+ core.status.replay.speed = parseInt(10*core.status.replay.speed + toAdd)/10;
+ if (core.status.replay.speed>6.0) core.status.replay.speed=6.0;
core.drawTip("x"+core.status.replay.speed+"倍");
}
@@ -1437,7 +1443,8 @@ control.prototype.speedUpReplay = function () {
control.prototype.speedDownReplay = function () {
if (core.status.event.id=='save') return;
if (!core.status.replay.replaying) return;
- core.status.replay.speed = parseInt(10*core.status.replay.speed - 1)/10;
+ var toAdd = core.status.replay.speed>3?3:core.status.replay.speed>2?2:1;
+ core.status.replay.speed = parseInt(10*core.status.replay.speed - toAdd)/10;
if (core.status.replay.speed<0.3) core.status.replay.speed=0.3;
core.drawTip("x"+core.status.replay.speed+"倍");
}
@@ -1512,6 +1519,23 @@ control.prototype.saveReplay = function () {
core.ui.drawSLPanel(10*page+offset);
}
+////// 回放时查看怪物手册 //////
+control.prototype.bookReplay = function () {
+ if (!core.status.replay.replaying) return;
+ if (!core.status.replay.pausing) {
+ core.drawTip("请先暂停录像");
+ return;
+ }
+ if (core.status.replay.animate || core.isset(core.status.event.id)) {
+ core.drawTip("请等待当前事件的处理结束");
+ return;
+ }
+
+ core.lockControl();
+ core.status.event.id='book';
+ core.useItem('book');
+}
+
////// 回放 //////
control.prototype.replay = function () {
@@ -1526,9 +1550,9 @@ control.prototype.replay = function () {
}
core.status.replay.steps++;
- if (core.status.replay.steps%20==0) {
- if (core.status.replay.save.length == 30)
- core.status.replay.save.shift();
+ if (core.status.replay.steps%50==0) {
+ //if (core.status.replay.save.length == 30)
+ // core.status.replay.save.shift();
core.status.replay.save.push({"data": core.saveData(), "replay": {
"totalList": core.clone(core.status.replay.totalList),
"toReplay": core.clone(core.status.replay.toReplay),
@@ -1541,7 +1565,9 @@ control.prototype.replay = function () {
if (action=='up' || action=='down' || action=='left' || action=='right') {
core.moveHero(action, function () {
- core.replay();
+ setTimeout(function() {
+ core.replay();
+ });
});
return;
}
@@ -1558,7 +1584,7 @@ control.prototype.replay = function () {
core.useItem(itemId, function () {
core.replay();
});
- }, 750 / Math.sqrt(core.status.replay.speed));
+ }, 750 / core.status.replay.speed);
}
return;
}
@@ -1576,7 +1602,7 @@ control.prototype.replay = function () {
core.changeFloor(floorId, stair, null, null, function () {
core.replay();
});
- }, 750 / Math.sqrt(core.status.replay.speed));
+ }, 750 / core.status.replay.speed);
return;
}
}
@@ -1609,7 +1635,7 @@ control.prototype.replay = function () {
core.status.event.selection = parseInt(selections.shift());
core.events.openShop(shopId, false);
- }, 750 / Math.sqrt(core.status.replay.speed));
+ }, 750 / core.status.replay.speed);
return;
}
}
@@ -1819,8 +1845,11 @@ control.prototype.doSL = function (id, type) {
// core.drawTip("存档版本不匹配");
if (confirm("存档版本不匹配!\n你想回放此存档的录像吗?")) {
core.dom.startPanel.style.display = 'none';
+ var seed = data.hero.flags.seed;
core.resetStatus(core.firstData.hero, data.hard, core.firstData.floorId, null, core.initStatus.maps);
core.events.setInitData(data.hard);
+ core.setFlag('seed', seed);
+ core.setFlag('rand', seed);
core.changeFloor(core.status.floorId, null, core.firstData.hero.loc, null, function() {
core.startReplay(core.decodeRoute(data.route));
}, true);
@@ -1852,7 +1881,7 @@ control.prototype.doSL = function (id, type) {
return;
}
var route = core.subarray(core.status.route, core.decodeRoute(data.route));
- if (!core.isset(route)) {
+ if (!core.isset(route) || data.hero.flags.seed!=core.getFlag('seed')) {
core.drawTip("无法从此存档回放录像");
return;
}
@@ -1869,7 +1898,7 @@ control.prototype.syncSave = function (type) {
// data
if (type=='all') {
saves=[];
- for (var i=1;i<=150;i++) {
+ for (var i=1;i<=5*(main.savePages||30);i++) {
var data = core.getLocalStorage("save"+i, null);
if (core.isset(data)) {
saves.push(data);
@@ -1877,7 +1906,7 @@ control.prototype.syncSave = function (type) {
}
}
else {
- for (var i=150;i>=1;i--) {
+ for (var i=5*(main.savePages||30);i>=1;i--) {
saves=core.getLocalStorage("save"+i, null);
if (core.isset(saves)) {
break;
@@ -1938,7 +1967,7 @@ control.prototype.syncLoad = function () {
if (data instanceof Array) {
core.status.event.selection=1;
core.ui.drawConfirmBox("所有本地存档都将被覆盖,确认?", function () {
- for (var i=1;i<=150;i++) {
+ for (var i=1;i<=5*(main.savePages||30);i++) {
if (i<=data.length) {
core.setLocalStorage("save"+i, data[i-1]);
}
@@ -1954,8 +1983,8 @@ control.prototype.syncLoad = function () {
}
else {
// 只覆盖单存档
- var index=150;
- for (var i=150;i>=1;i--) {
+ var index=5*(main.savePages||30);
+ for (var i=5*(main.savePages||30);i>=1;i--) {
if (core.getLocalStorage("save"+i, null)==null)
index=i;
else break;
@@ -2101,6 +2130,7 @@ control.prototype.playBgm = function (bgm) {
}
// 播放当前BGM
core.musicStatus.playingBgm = bgm;
+ core.material.bgms[bgm].volume = core.musicStatus.volume;
core.material.bgms[bgm].play();
core.musicStatus.isPlaying = true;
@@ -2168,7 +2198,7 @@ control.prototype.playSound = function (sound) {
if (core.musicStatus.audioContext != null) {
var source = core.musicStatus.audioContext.createBufferSource();
source.buffer = core.material.sounds[sound];
- source.connect(core.musicStatus.audioContext.destination);
+ source.connect(core.musicStatus.gainNode);
try {
source.start(0);
}
@@ -2181,11 +2211,12 @@ control.prototype.playSound = function (sound) {
}
}
else {
+ core.material.sounds[sound].volume = core.musicStatus.volume;
core.material.sounds[sound].play();
}
}
catch (eee) {
- console.log("无法播放SE "+bgm);
+ console.log("无法播放SE "+sound);
console.log(eee);
}
}
@@ -2253,18 +2284,14 @@ control.prototype.updateStatusBar = function () {
core.statusBar.image.fly.style.opacity = 1;
core.statusBar.image.toolbox.src = core.statusBar.icons.rewind.src;
- core.statusBar.image.toolbox.style.opacity = 1;
- core.statusBar.image.shop.style.opacity = 0;
+ core.statusBar.image.shop.src = core.statusBar.icons.book.src;
core.statusBar.image.save.src = core.statusBar.icons.speedDown.src;
- core.statusBar.image.save.style.opacity = 1;
core.statusBar.image.load.src = core.statusBar.icons.speedUp.src;
- core.statusBar.image.load.style.opacity = 1;
core.statusBar.image.settings.src = core.statusBar.icons.save.src;
- core.statusBar.image.settings.style.opacity = 1;
}
else {
@@ -2275,18 +2302,14 @@ control.prototype.updateStatusBar = function () {
core.statusBar.image.fly.style.opacity = core.hasItem('fly')?1:0.3;
core.statusBar.image.toolbox.src = core.statusBar.icons.toolbox.src;
- core.statusBar.image.toolbox.style.opacity = 1;
- core.statusBar.image.shop.style.opacity = 1;
+ core.statusBar.image.shop.src = core.statusBar.icons.shop.src;
core.statusBar.image.save.src = core.statusBar.icons.save.src;
- core.statusBar.image.save.style.opacity = 1;
core.statusBar.image.load.src = core.statusBar.icons.load.src;
- core.statusBar.image.load.style.opacity = 1;
core.statusBar.image.settings.src = core.statusBar.icons.settings.src;
- core.statusBar.image.settings.style.opacity = 1;
}
core.updateFg();
@@ -2321,7 +2344,7 @@ control.prototype.resize = function(clientWidth, clientHeight) {
statusWidth, statusHeight, statusMaxWidth,statusLabelsLH,
toolBarWidth, toolBarHeight, toolBarTop, toolBarBorder,
toolsWidth, toolsHeight,toolsMargin,toolsPMaxwidth,
- fontSize, toolbarFontSize, margin;
+ fontSize, toolbarFontSize, margin, statusBackground, toolsBackground;
var count = core.dom.statusBar.children.length;
if (!core.flags.enableFloor) count--;
@@ -2380,12 +2403,14 @@ control.prototype.resize = function(clientWidth, clientHeight) {
statusHeight = scale*BASE_LINEHEIGHT * .8;
statusLabelsLH = .8 * BASE_LINEHEIGHT *scale;
statusMaxWidth = scale * DEFAULT_BAR_WIDTH * .95;
+ statusBackground = main.statusTopBackground;
toolBarHeight = tempBotBarH;
toolBarTop = statusBarHeight + canvasWidth;
toolBarBorder = '3px #fff solid';
toolsHeight = scale * BASE_LINEHEIGHT;
toolsPMaxwidth = scale * DEFAULT_BAR_WIDTH * .4;
+ toolsBackground = main.toolsBackground;
borderRight = '3px #fff solid';
margin = scale * SPACE * 2;
@@ -2400,15 +2425,17 @@ control.prototype.resize = function(clientWidth, clientHeight) {
canvasTop = 0;
// canvasLeft = DEFAULT_BAR_WIDTH * scale;
toolBarWidth = statusBarWidth = DEFAULT_BAR_WIDTH * scale;
- statusBarHeight = scale * statusLineHeight * count + SPACE * 2; //一共有9行加上两个padding空隙
+ statusBarHeight = gameGroupHeight - SPACE;
statusBarBorder = '3px #fff solid';
+ statusBackground = main.statusLeftBackground;
statusHeight = scale*statusLineHeight * .8;
statusLabelsLH = .8 * statusLineHeight *scale;
- toolBarHeight = canvasWidth - statusBarHeight;
toolBarTop = scale*statusLineHeight * count + SPACE * 2;
+ toolBarHeight = canvasWidth - toolBarTop;
toolBarBorder = '3px #fff solid';
toolsHeight = scale * BASE_LINEHEIGHT;
+ toolsBackground = 'transparent';
fontSize = statusLineFontSize * scale;
toolbarFontSize = DEFAULT_FONT_SIZE * scale;
borderRight = '';
@@ -2431,12 +2458,15 @@ control.prototype.resize = function(clientWidth, clientHeight) {
// canvasLeft = DEFAULT_BAR_WIDTH;
toolBarWidth = statusBarWidth = DEFAULT_BAR_WIDTH;
- statusBarHeight = statusLineHeight * count + SPACE * 2; //一共有9行
+ // statusBarHeight = statusLineHeight * count + SPACE * 2; //一共有9行
+ statusBackground = main.statusLeftBackground;
+ statusBarHeight = gameGroupHeight - SPACE;
statusHeight = statusLineHeight * .8;
statusLabelsLH = .8 * statusLineHeight;
- toolBarHeight = DEFAULT_CANVAS_WIDTH - statusBarHeight;
toolBarTop = statusLineHeight * count + SPACE * 2;
+ toolBarHeight = DEFAULT_CANVAS_WIDTH - toolBarTop;
+ toolsBackground = 'transparent';
toolsHeight = BASE_LINEHEIGHT;
borderRight = '';
@@ -2517,7 +2547,8 @@ control.prototype.resize = function(clientWidth, clientHeight) {
borderTop: statusBarBorder,
borderLeft: statusBarBorder,
borderRight: borderRight,
- fontSize: fontSize + unit
+ fontSize: fontSize + unit,
+ background: statusBackground,
}
},
{
@@ -2547,7 +2578,8 @@ control.prototype.resize = function(clientWidth, clientHeight) {
borderBottom: toolBarBorder,
borderLeft: toolBarBorder,
borderRight: borderRight,
- fontSize: toolbarFontSize + unit
+ fontSize: toolbarFontSize + unit,
+ background: toolsBackground,
}
},
{
diff --git a/libs/core.js b/libs/core.js
index a1fe38db..525d3685 100644
--- a/libs/core.js
+++ b/libs/core.js
@@ -48,6 +48,8 @@ function core() {
'soundStatus': true, // 是否播放SE
'playingBgm': null, // 正在播放的BGM
'isPlaying': false,
+ 'gainNode': null,
+ 'volume': 1.0, // 音量
}
this.platform = {
'isOnline': true, // 是否http
@@ -187,6 +189,8 @@ core.prototype.init = function (coreData, callback) {
window.AudioContext = window.AudioContext || window.webkitAudioContext || window.mozAudioContext || window.msAudioContext;
try {
core.musicStatus.audioContext = new window.AudioContext();
+ core.musicStatus.gainNode = core.musicStatus.audioContext.createGain();
+ core.musicStatus.gainNode.connect(core.musicStatus.audioContext.destination);
} catch (e) {
console.log("该浏览器不支持AudioContext");
core.musicStatus.audioContext = null;
@@ -261,7 +265,8 @@ core.prototype.init = function (coreData, callback) {
core.setRequestAnimationFrame();
core.showStartAnimate();
- core.events.initGame();
+ if (main.mode=='play')
+ core.events.initGame();
if (core.isset(functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.plugins))
core.plugin = new functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a.plugins.plugin();
@@ -928,6 +933,10 @@ core.prototype.saveReplay = function () {
core.control.saveReplay();
}
+core.prototype.bookReplay = function () {
+ core.control.bookReplay();
+}
+
////// 回放 //////
core.prototype.replay = function () {
core.control.replay();
@@ -1077,6 +1086,16 @@ core.prototype.subarray = function (a, b) {
return core.utils.subarray(a, b);
}
+////// 生成随机数(seed方法) //////
+core.prototype.rand = function (num) {
+ return core.utils.rand(num);
+}
+
+////// 生成随机数(录像方法) //////
+core.prototype.rand2 = function (num) {
+ return core.utils.rand2(num);
+}
+
////// 读取一个本地文件内容 //////
core.prototype.readFile = function (success, error, readType) {
core.utils.readFile(success, error, readType);
diff --git a/libs/enemys.js b/libs/enemys.js
index e72ea82f..1b4158ff 100644
--- a/libs/enemys.js
+++ b/libs/enemys.js
@@ -33,8 +33,8 @@ enemys.prototype.hasSpecial = function (special, test) {
////// 获得所有特殊属性的名称 //////
enemys.prototype.getSpecialText = function (enemyId) {
- if (enemyId == undefined) return "";
- var enemy = this.enemys[enemyId];
+ var enemy = core.material.enemys[enemyId];
+ if (!core.isset(enemy)) return [];
var special = enemy.special;
var text = [];
if (this.hasSpecial(special, 1)) text.push("先攻");
diff --git a/libs/events.js b/libs/events.js
index 43fdfd49..bf0866fe 100644
--- a/libs/events.js
+++ b/libs/events.js
@@ -57,8 +57,7 @@ events.prototype.init = function () {
callback();
},
'action': function (data, core, callback) {
- core.events.doEvents(data.event.data, data.x, data.y);
- if (core.isset(callback)) callback();
+ core.events.insertAction(data.event.data, data.x, data.y, callback);
}
}
}
@@ -89,16 +88,19 @@ events.prototype.startGame = function (hard) {
core.flags.battleAnimate = true;
core.setLocalStorage('battleAnimate', true);
core.startGame(hard);
+ core.utils.__init_seed();
core.events.setInitData(hard);
}, function () {
core.flags.battleAnimate = false;
core.setLocalStorage('battleAnimate', false);
core.startGame(hard);
+ core.utils.__init_seed();
core.events.setInitData(hard);
});
}
else {
core.startGame(hard);
+ core.utils.__init_seed();
core.events.setInitData(hard);
}
});
@@ -142,6 +144,7 @@ events.prototype.gameOver = function (ending, fromReplay) {
'name': core.firstData.name,
'version': core.firstData.version,
'hard': core.status.hard,
+ 'seed': core.getFlag('seed'),
'route': core.encodeRoute(core.status.route)
}
core.download(core.firstData.name+"_"+core.formatDate2(new Date())+".h5route", JSON.stringify(obj));
@@ -163,7 +166,8 @@ events.prototype.gameOver = function (ending, fromReplay) {
}
var doUpload = function(username) {
- if (username==null) username="";
+ var hp = core.status.hero.hp;
+ if (username==undefined) hp = 1;
// upload
var formData = new FormData();
@@ -172,19 +176,23 @@ events.prototype.gameOver = function (ending, fromReplay) {
formData.append('version', core.firstData.version);
formData.append('platform', core.platform.isPC?"PC":core.platform.isAndroid?"Android":core.platform.isIOS?"iOS":"");
formData.append('hard', core.status.hard);
- formData.append('username', username);
+ formData.append('username', username||"");
formData.append('ending', ending);
formData.append('lv', core.status.hero.lv);
- formData.append('hp', core.status.hero.hp);
+ formData.append('hp', hp);
formData.append('atk', core.status.hero.atk);
formData.append('def', core.status.hero.def);
formData.append('mdef', core.status.hero.mdef);
formData.append('money', core.status.hero.money);
formData.append('experience', core.status.hero.experience);
formData.append('steps', core.status.hero.steps);
+ formData.append('seed', core.getFlag('seed'));
formData.append('route', core.encodeRoute(core.status.route));
- core.http("POST", "/games/upload.php", formData);
+ if (main.isCompetition)
+ core.http("POST", "/games/competition/upload.php", formData);
+ else
+ core.http("POST", "/games/upload.php", formData);
setTimeout(function() {
confirmDownload();
@@ -192,9 +200,17 @@ events.prototype.gameOver = function (ending, fromReplay) {
}
core.ui.drawConfirmBox("你想记录你的ID和成绩吗?", function () {
- doUpload(prompt("请输入你的ID:"));
+ if (main.isCompetition) {
+ doUpload("");
+ }
+ else {
+ doUpload(prompt("请输入你的ID:"));
+ }
}, function () {
- doUpload("");
+ if (main.isCompetition)
+ confirmDownload();
+ else
+ doUpload(undefined);
})
return;
@@ -206,7 +222,16 @@ events.prototype.gameOver = function (ending, fromReplay) {
});
}
else {
- confirmUpload();
+
+ if (core.isset(core.values.maxValidHp) && core.status.hero.hp>core.values.maxValidHp) {
+ core.drawText("作弊可耻!", function () {
+ core.restart();
+ });
+ }
+ else {
+ confirmUpload();
+ }
+
}
}
@@ -228,7 +253,9 @@ events.prototype.doEvents = function (list, x, y, callback) {
core.waitHeroToStop(function() {
core.lockControl();
core.status.event = {'id': 'action', 'data': {
- 'list': core.clone(list), 'x': x, 'y': y, 'callback': callback
+ 'list': [
+ {"todo": core.clone(list), "total": core.clone(list), "condition": "false"}
+ ], 'x': x, 'y': y, 'callback': callback
}}
core.events.doAction();
});
@@ -253,7 +280,18 @@ events.prototype.doAction = function() {
return;
}
- var data = core.status.event.data.list.shift();
+ var current = core.status.event.data.list[0];
+ if (current.todo.length == 0) { // current list is empty
+ if (core.calValue(current.condition)) { // check condition
+ current.todo = core.clone(current.total);
+ }
+ else {
+ core.status.event.data.list.shift(); // remove stackc
+ }
+ this.doAction();
+ return;
+ }
+ var data = current.todo.shift();
core.status.event.data.current = data;
var x=core.status.event.data.x, y=core.status.event.data.y;
@@ -311,8 +349,9 @@ events.prototype.doAction = function() {
core.events.doAction();
break;
case "show": // 显示
- if (typeof data.loc[0] == 'number' && typeof data.loc[1] == 'number')
- data.loc = [data.loc];
+ if ((typeof data.loc[0] == 'number' || typeof data.loc[0] == 'string')
+ && (typeof data.loc[1] == 'number' || typeof data.loc[1] == 'string'))
+ data.loc = [[core.calValue(data.loc[0]), core.calValue(data.loc[1])]];
if (core.isset(data.time) && data.time>0 && (!core.isset(data.floorId) || data.floorId==core.status.floorId)) {
core.animateBlock(data.loc,'show', data.time, function () {
data.loc.forEach(function (t) {
@@ -331,8 +370,9 @@ events.prototype.doAction = function() {
case "hide": // 消失
if (!core.isset(data.loc))
data.loc = [x,y];
- if (typeof data.loc[0] == 'number' && typeof data.loc[1] == 'number')
- data.loc = [data.loc];
+ if ((typeof data.loc[0] == 'number' || typeof data.loc[0] == 'string')
+ && (typeof data.loc[1] == 'number' || typeof data.loc[1] == 'string'))
+ data.loc = [[core.calValue(data.loc[0]), core.calValue(data.loc[1])]];
data.loc.forEach(function (t) {
core.removeBlock(t[0],t[1],data.floorId);
})
@@ -346,8 +386,8 @@ events.prototype.doAction = function() {
case "setBlock": // 设置某图块
{
if (core.isset(data.loc)) {
- x=data.loc[0];
- y=data.loc[1];
+ x=core.calValue(data.loc[0]);
+ y=core.calValue(data.loc[1]);
}
var floorId = data.floorId||core.status.floorId;
var originBlock=core.getBlock(x,y,floorId,false);
@@ -379,8 +419,8 @@ events.prototype.doAction = function() {
y=core.getHeroLoc('y');
}
else if (data.loc instanceof Array) {
- x=data.loc[0];
- y=data.loc[1];
+ x=core.calValue(data.loc[0]);
+ y=core.calValue(data.loc[1]);
}
}
core.drawAnimate(data.name, x, y, function () {
@@ -389,8 +429,8 @@ events.prototype.doAction = function() {
break;
case "move": // 移动事件
if (core.isset(data.loc)) {
- x=data.loc[0];
- y=data.loc[1];
+ x=core.calValue(data.loc[0]);
+ y=core.calValue(data.loc[1]);
}
core.moveBlock(x,y,data.steps,data.time,data.immediateHide,function() {
core.events.doAction();
@@ -403,7 +443,7 @@ events.prototype.doAction = function() {
break;
case "changeFloor": // 楼层转换
{
- var heroLoc = {"x": data.loc[0], "y": data.loc[1]};
+ var heroLoc = {"x": core.calValue(data.loc[0]), "y": core.calValue(data.loc[1])};
if (core.isset(data.direction)) heroLoc.direction=data.direction;
core.changeFloor(data.floorId||core.status.floorId, null, heroLoc, data.time, function() {
core.lockControl();
@@ -414,8 +454,8 @@ events.prototype.doAction = function() {
case "changePos": // 直接更换勇士位置,不切换楼层
core.clearMap('hero', 0, 0, 416, 416);
if (core.isset(data.loc)) {
- core.setHeroLoc('x', data.loc[0]);
- core.setHeroLoc('y', data.loc[1]);
+ core.setHeroLoc('x', core.calValue(data.loc[0]));
+ core.setHeroLoc('y', core.calValue(data.loc[1]));
}
if (core.isset(data.direction)) core.setHeroLoc('direction', data.direction);
core.drawHero();
@@ -423,7 +463,8 @@ events.prototype.doAction = function() {
break;
case "showImage": // 显示图片
if (core.isset(data.loc) && core.isset(core.material.images.images[data.name])) {
- core.canvas.animate.drawImage(core.material.images.images[data.name], data.loc[0], data.loc[1]);
+ core.canvas.animate.drawImage(core.material.images.images[data.name],
+ core.calValue(data.loc[0]), core.calValue(data.loc[1]));
}
else core.clearMap('animate', 0, 0, 416, 416);
this.doAction();
@@ -448,8 +489,8 @@ events.prototype.doAction = function() {
var gif = new Image();
gif.src = core.material.images.images[data.name].src;
gif.style.position = 'absolute';
- gif.style.left = (data.loc[0]*core.domStyle.scale)+"px";
- gif.style.top = (data.loc[1]*core.domStyle.scale)+"px";
+ gif.style.left = (core.calValue(data.loc[0])*core.domStyle.scale)+"px";
+ gif.style.top = (core.calValue(data.loc[1])*core.domStyle.scale)+"px";
core.dom.gif2.appendChild(gif);
}
else {
@@ -457,6 +498,21 @@ events.prototype.doAction = function() {
}
this.doAction();
break;
+ case "moveImage": // 图片移动
+ if (core.status.replay.replaying) { // 正在播放录像
+ this.doAction();
+ }
+ else {
+ if (core.isset(data.from) && core.isset(data.to) && core.isset(core.material.images.images[data.name])) {
+ core.events.moveImage(core.material.images.images[data.name], data.from, data.to, data.time, function() {
+ core.events.doAction();
+ });
+ }
+ else {
+ this.doAction();
+ }
+ }
+ break;
case "setFg": // 颜色渐变
core.setFg(data.color, data.time, function() {
core.events.doAction();
@@ -469,7 +525,7 @@ events.prototype.doAction = function() {
case "openDoor": // 开一个门,包括暗墙
{
var floorId=data.floorId || core.status.floorId;
- var block=core.getBlock(data.loc[0], data.loc[1], floorId);
+ var block=core.getBlock(core.calValue(data.loc[0]), core.calValue(data.loc[1]), floorId);
if (block!=null) {
if (floorId==core.status.floorId)
core.openDoor(block.block.event.id, block.block.x, block.block.y, false, function() {
@@ -504,13 +560,15 @@ events.prototype.doAction = function() {
break;
case "trigger": // 触发另一个事件;当前事件会被立刻结束。需要另一个地点的事件是有效的
{
- var toX=data.loc[0], toY=data.loc[1];
+ var toX=core.calValue(data.loc[0]), toY=core.calValue(data.loc[1]);
var block=core.getBlock(toX, toY);
if (block!=null) {
block = block.block;
if (core.isset(block.event) && block.event.trigger=='action') {
// 触发
- core.status.event.data.list = core.clone(block.event.data);
+ core.status.event.data.list = [
+ {"todo": core.clone(block.event.data), "total": core.clone(block.event.data), "condition": "false"}
+ ];
core.status.event.data.x=block.x;
core.status.event.data.y=block.y;
}
@@ -535,6 +593,17 @@ events.prototype.doAction = function() {
core.resumeBgm();
this.doAction();
break
+ case "setVolume":
+ data.value = parseInt(data.value||0);
+ if (data.value>100) data.value=100;
+ data.value = data.value / 100;
+ core.musicStatus.volume = data.value;
+ if (core.isset(core.musicStatus.playingBgm)) {
+ core.material.bgms[core.musicStatus.playingBgm].volume = data.value;
+ }
+ core.musicStatus.gainNode.gain.value = data.value;
+ this.doAction();
+ break;
case "setValue":
try {
var value=core.calValue(data.value);
@@ -592,9 +661,9 @@ events.prototype.doAction = function() {
core.drawTip("录像文件出错");
return;
}
-
}
else {
+ core.interval.onDownInterval = 'tmp';
value = prompt(core.replaceText(data.text));
}
value = Math.abs(parseInt(value)||0);
@@ -624,7 +693,7 @@ events.prototype.doAction = function() {
core.status.route.push("choices:"+index);
core.events.insertAction(data.choices[index].action);
core.events.doAction();
- }, 750 / Math.sqrt(core.status.replay.speed))
+ }, 750 / core.status.replay.speed)
}
else {
core.stopReplay();
@@ -634,6 +703,27 @@ events.prototype.doAction = function() {
}
core.ui.drawChoices(data.text, data.choices);
break;
+ case "while":
+ if (core.calValue(data.condition)) {
+ core.unshift(core.status.event.data.list,
+ {"todo": core.clone(data.data), "total": core.clone(data.data), "condition": data.condition}
+ );
+ }
+ this.doAction();
+ break;
+ case "break":
+ core.status.event.data.list.shift();
+ this.doAction();
+ break;
+ case "continue":
+ if (core.calValue(core.status.event.data.list[0].condition)) {
+ core.status.event.data.list[0].todo = core.clone(core.status.event.data.list[0].total);
+ }
+ else {
+ core.status.event.data.list.shift();
+ }
+ this.doAction();
+ break;
case "win":
core.events.win(data.reason, function () {
core.events.doAction();
@@ -670,13 +760,19 @@ events.prototype.doAction = function() {
}, data.time);
}
break;
+ case "wait":
+ if (core.status.replay.replaying)
+ core.events.doAction();
+ break;
case "revisit": // 立刻重新执行该事件
{
var block=core.getBlock(x,y); // 重新获得事件
if (block!=null) {
block = block.block;
if (core.isset(block.event) && block.event.trigger=='action') {
- core.status.event.data.list = core.clone(block.event.data);
+ core.status.event.data.list = [
+ {"todo": core.clone(block.event.data), "total": core.clone(block.event.data), "condition": "false"}
+ ];
}
}
this.doAction();
@@ -699,7 +795,7 @@ events.prototype.insertAction = function (action, x, y, callback) {
this.doEvents(action, x, y, callback);
}
else {
- core.unshift(core.status.event.data.list, action)
+ core.unshift(core.status.event.data.list[0].todo, action)
if (core.isset(x)) core.status.event.data.x=x;
if (core.isset(y)) core.status.event.data.y=y;
if (core.isset(callback)) core.status.event.data.callback=callback;
@@ -1028,7 +1124,7 @@ events.prototype.animateImage = function (type, image, loc, time, callback) {
if (type == 'hide') opacityVal = 1;
core.setOpacity('data', opacityVal);
- core.canvas.data.drawImage(image, loc[0], loc[1]);
+ core.canvas.data.drawImage(image, core.calValue(loc[0]), core.calValue(loc[1]));
core.status.replay.animate=true;
var animate = setInterval(function () {
if (type=='show') opacityVal += 0.1;
@@ -1041,7 +1137,38 @@ events.prototype.animateImage = function (type, image, loc, time, callback) {
core.status.replay.animate=false;
if (core.isset(callback)) callback();
}
- }, time / 10 / core.status.replay.speed);
+ }, time / 10);
+}
+
+////// 移动图片 //////
+events.prototype.moveImage = function (image, from, to, time, callback) {
+ time = time || 1000;
+ clearInterval(core.interval.tipAnimate);
+ core.setAlpha('data', 1);
+ core.setOpacity('data', 1);
+
+ core.status.replay.animate=true;
+ var fromX = core.calValue(from[0]), fromY = core.calValue(from[1]),
+ toX = core.calValue(to[0]), toY = core.calValue(to[1]);
+ var step = 0;
+ var drawImage = function () {
+ core.clearMap('data', 0, 0, 416, 416);
+ var nowX = parseInt(fromX + (toX-fromX)*step/64);
+ var nowY = parseInt(fromY + (toY-fromY)*step/64);
+ core.canvas.data.drawImage(image, nowX, nowY);
+ }
+
+ drawImage();
+ var animate = setInterval(function () {
+ step++;
+ drawImage();
+ if (step>=64) {
+ clearInterval(animate);
+ core.clearMap('data', 0, 0, 416, 416);
+ core.status.replay.animate=false;
+ if (core.isset(callback)) callback();
+ }
+ }, time / 64);
}
////// 打开一个全局商店 //////
@@ -1197,8 +1324,13 @@ events.prototype.passNet = function (data) {
if (data.event.id=='weakNet') { // 衰网
if (core.hasFlag('weak')) return;
core.setFlag('weak', true);
- core.status.hero.atk-=core.values.weakValue;
- core.status.hero.def-=core.values.weakValue;
+ var weakValue = core.status.weakValue;
+ var weakAtk = weakValue>=1?weakValue:Math.floor(weakValue*core.status.hero.atk);
+ var weakDef = weakValue>=1?weakValue:Math.floor(weakValue*core.status.hero.def);
+ core.setFlag('weakAtk', weakAtk);
+ core.setFlag('weakDef', weakDef);
+ core.status.hero.atk-=weakAtk;
+ core.status.hero.def-=weakDef;
}
if (data.event.id=='curseNet') { // 咒网
if (core.hasFlag('curse')) return;
diff --git a/libs/items.js b/libs/items.js
index 9f6d05b5..437c7ff4 100644
--- a/libs/items.js
+++ b/libs/items.js
@@ -32,9 +32,11 @@ items.prototype.getItemEffect = function(itemId, itemNum) {
////// “即捡即用类”道具的文字提示 //////
items.prototype.getItemEffectTip = function(itemId) {
- var ratio = parseInt(core.floors[core.status.floorId].item_ratio) || 1;
- if (itemId in this.itemEffectTip && (!this.items[itemId].isEquipment || !core.flags.equipment)) {
- return eval(this.itemEffectTip[itemId]);
+ var itemCls = core.material.items[itemId].cls;
+ // 消耗品
+ if (itemCls === 'items') {
+ var ratio = parseInt(core.floors[core.status.floorId].item_ratio) || 1;
+ if (itemId in this.itemEffectTip) return eval(this.itemEffectTip[itemId])||"";
}
return "";
}
diff --git a/libs/ui.js b/libs/ui.js
index 84ea2d28..b539d278 100644
--- a/libs/ui.js
+++ b/libs/ui.js
@@ -1513,7 +1513,7 @@ ui.prototype.drawToolbox = function(index) {
if (core.isset(selectId)) {
var item=core.material.items[selectId];
core.fillText('ui', item.name, 10, 32, '#FFD700', "bold 20px Verdana")
- core.fillText('ui', item.text, 10, 62, '#FFFFFF', '17px Verdana');
+ core.fillText('ui', item.text||"该道具暂无描述。", 10, 62, '#FFFFFF', '17px Verdana');
core.fillText('ui', '<继续点击该道具即可进行使用>', 10, 89, '#CCCCCC', '14px Verdana');
}
@@ -1571,7 +1571,8 @@ ui.prototype.drawSLPanel = function(index) {
if (index<0) index=0;
var page = parseInt(index/10), offset=index%10;
- if (page>=30) page=29;
+ var max_page = main.savePages || 30;
+ if (page>=max_page) page=max_page - 1;
if (offset>5) offset=5;
index=10*page+offset;
@@ -1617,7 +1618,7 @@ ui.prototype.drawSLPanel = function(index) {
}
}
}
- this.drawPagination(page+1, 30);
+ this.drawPagination(page+1, max_page);
if (core.status.event.selection)
core.setFillStyle('ui', '#FF6A6A');
diff --git a/libs/utils.js b/libs/utils.js
index 9d11609b..8ad8e03b 100644
--- a/libs/utils.js
+++ b/libs/utils.js
@@ -20,6 +20,12 @@ utils.prototype.replaceText = function (text) {
////// 计算表达式的值 //////
utils.prototype.calValue = function (value) {
+ if (typeof value == 'number') {
+ return value;
+ }
+ if (value instanceof Function) {
+ return value();
+ }
value=value.replace(/status:([\w\d_]+)/g, "core.getStatus('$1')");
value=value.replace(/item:([\w\d_]+)/g, "core.itemCount('$1')");
value=value.replace(/flag:([\w\d_]+)/g, "core.getFlag('$1', 0)");
@@ -164,9 +170,14 @@ utils.prototype.setTwoDigits = function (x) {
}
utils.prototype.formatBigNumber = function (x) {
- x = parseFloat(x);
+ x = Math.floor(parseFloat(x));
if (!core.isset(x)) return '???';
+ var c = x<0?"-":"";
+ x = Math.abs(x);
+
+ if (x<=999999) return c + x;
+
var all = [
{"val": 1e20, "c": "g"},
{"val": 1e16, "c": "j"},
@@ -177,13 +188,13 @@ utils.prototype.formatBigNumber = function (x) {
for (var i=0;i
=100*one.val) {
+ if (x>=10*one.val) {
var v = x/one.val;
- return v.toFixed(Math.max(0, Math.floor(4-Math.log10(v+1)))) + one.c;
+ return c + v.toFixed(Math.max(0, Math.floor(4-Math.log10(v+1)))) + one.c;
}
}
- return x;
+ return c+x;
}
////// 数组转RGB //////
@@ -233,8 +244,10 @@ utils.prototype.encodeRoute = function (route) {
ans+='N';
else if (t.indexOf('move:')==0)
ans+="M"+t.substring(5);
- else if (t=='key:')
+ else if (t.indexOf('key:')==0)
ans+='K'+t.substring(4);
+ else if (t.indexOf('random:')==0)
+ ans+='X'+t.substring(7);
}
});
if (cnt>0) {
@@ -287,6 +300,7 @@ utils.prototype.decodeRoute = function (route) {
case "N": ans.push("no"); break;
case "M": ++index; ans.push("move:"+nxt+":"+getNumber()); break;
case "K": ans.push("key:"+nxt); break;
+ case "X": ans.push("random:"+nxt); break;
}
}
return ans;
@@ -311,6 +325,54 @@ utils.prototype.subarray = function (a, b) {
return na;
}
+utils.prototype.__init_seed = function () {
+ var rand = new Date().getTime()%34834795 + 3534;
+ rand = this.__next_rand(rand);
+ rand = this.__next_rand(rand);
+ rand = this.__next_rand(rand);
+ core.setFlag('seed', rand);
+ core.setFlag('rand', rand);
+}
+
+utils.prototype.__next_rand = function (_rand) {
+ _rand=(_rand%127773)*16807-~~(_rand/127773)*2836;
+ _rand+=_rand<0?2147483647:0;
+ return _rand;
+}
+
+utils.prototype.rand = function (num) {
+ var rand = core.getFlag('rand');
+ rand = this.__next_rand(rand);
+ core.setFlag('rand', rand);
+ var ans = rand/2147483647;
+ if (core.isset(num) && num>0)
+ return Math.floor(ans*num);
+ return ans;
+}
+
+////// 生成随机数(录像方法) //////
+utils.prototype.rand2 = function (num) {
+ num = num||2147483648;
+
+ var value;
+ if (core.status.replay.replaying) {
+ var action = core.status.replay.toReplay.shift();
+ if (action.indexOf("random:")==0 ) {
+ value=parseInt(action.substring(7));
+ }
+ else {
+ core.stopReplay();
+ core.drawTip("录像文件出错");
+ return;
+ }
+ }
+ else {
+ value = Math.floor(Math.random()*num);
+ }
+ core.status.route.push("random:"+value);
+ return value;
+}
+
////// 读取一个本地文件内容 //////
utils.prototype.readFile = function (success, error, readType) {
diff --git a/main.js b/main.js
index 6cd095c0..3dddfd0d 100644
--- a/main.js
+++ b/main.js
@@ -2,7 +2,7 @@ function main() {
//------------------------ 用户修改内容 ------------------------//
- this.version = "2.1.1"; // 游戏版本号;如果更改了游戏内容建议修改此version以免造成缓存问题。
+ this.version = "2.2"; // 游戏版本号;如果更改了游戏内容建议修改此version以免造成缓存问题。
this.useCompress = false; // 是否使用压缩文件
// 当你即将发布你的塔时,请使用“JS代码压缩工具”将所有js代码进行压缩,然后将这里的useCompress改为true。
@@ -12,6 +12,10 @@ function main() {
this.bgmRemote = false; // 是否采用远程BGM
this.bgmRemoteRoot = "https://gitee.com/ckcz123/h5music/raw/master/"; // 远程BGM的根目录
+ this.isCompetition = false; // 是否是比赛模式
+
+ this.savePages = 30; // 存档页数,每页可存5个;默认为30页150个存档
+
//------------------------ 用户修改内容 END ------------------------//
this.dom = {
@@ -403,6 +407,12 @@ main.statusBar.image.toolbox.onclick = function () {
////// 点击状态栏中的快捷商店时 //////
main.statusBar.image.shop.onclick = function () {
+
+ if (core.isset(core.status.replay) && core.status.replay.replaying) {
+ core.bookReplay();
+ return;
+ }
+
if (main.core.isPlaying())
main.core.openQuickShop(true);
}
@@ -481,6 +491,8 @@ main.dom.replayGame.onclick = function () {
core.dom.startPanel.style.display = 'none';
core.resetStatus(core.firstData.hero, obj.hard, core.firstData.floorId, null, core.initStatus.maps);
core.events.setInitData(obj.hard);
+ core.setFlag('seed', obj.seed);
+ core.setFlag('rand', obj.seed);
core.changeFloor(core.status.floorId, null, core.firstData.hero.loc, null, function() {
core.startReplay(core.decodeRoute(obj.route));
}, true);
diff --git a/project/data.js b/project/data.js
index ac0361db..257d7b4f 100644
--- a/project/data.js
+++ b/project/data.js
@@ -19,11 +19,14 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
"startBackground" : "bg.jpg",
"startLogoStyle" : "color: black",
"levelChoose" : [["简单","Easy"],["普通","Normal"],["困难","Hard"],["噩梦","Hell"]],
+ "statusLeftBackground": "url(project/images/ground.png) repeat",
+ "statusTopBackground": "url(project/images/ground.png) repeat",
+ "toolsBackground": "url(project/images/ground.png) repeat"
},
"firstData" : {
"title": "魔塔样板",
"name": "template",
- "version": "Ver 2.1.1",
+ "version": "Ver 2.2",
"floorId": "sample0",
"hero": {
"name": "阳光",
@@ -129,6 +132,7 @@ data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
'counterAttack': 0.1,
'purify': 3,
'hatred': 2,
+ 'maxValidHp': null,
'animateSpeed': 300,
},
diff --git a/project/functions.js b/project/functions.js
index 0f33a232..975d9aab 100644
--- a/project/functions.js
+++ b/project/functions.js
@@ -14,19 +14,17 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
if (core.flags.bombFourDirections)
core.material.items.bomb.text = "可以炸掉勇士四周的怪物";
if (core.flags.equipment) {
- core.material.items.sword1 = {'cls': 'constants', 'name': '铁剑', 'text': '一把很普通的铁剑'};
- core.material.items.sword2 = {'cls': 'constants', 'name': '银剑', 'text': '一把很普通的银剑'};
- core.material.items.sword3 = {'cls': 'constants', 'name': '骑士剑', 'text': '一把很普通的骑士剑'};
- core.material.items.sword4 = {'cls': 'constants', 'name': '圣剑', 'text': '一把很普通的圣剑'};
- core.material.items.sword5 = {'cls': 'constants', 'name': '神圣剑', 'text': '一把很普通的神圣剑'};
- core.material.items.shield1 = {'cls': 'constants', 'name': '铁盾', 'text': '一个很普通的铁盾'};
- core.material.items.shield2 = {'cls': 'constants', 'name': '银盾', 'text': '一个很普通的银盾'};
- core.material.items.shield3 = {'cls': 'constants', 'name': '骑士盾', 'text': '一个很普通的骑士盾'};
- core.material.items.shield4 = {'cls': 'constants', 'name': '圣盾', 'text': '一个很普通的圣盾'};
- core.material.items.shield5 = {'cls': 'constants', 'name': '神圣盾', 'text': '一个很普通的神圣盾'};
+ core.material.items.sword1.cls = 'constants';
+ core.material.items.sword2.cls = 'constants';
+ core.material.items.sword3.cls = 'constants';
+ core.material.items.sword4.cls = 'constants';
+ core.material.items.sword5.cls = 'constants';
+ core.material.items.shield1.cls = 'constants';
+ core.material.items.shield2.cls = 'constants';
+ core.material.items.shield3.cls = 'constants';
+ core.material.items.shield4.cls = 'constants';
+ core.material.items.shield5.cls = 'constants';
}
-
-
},
////// 不同难度分别设置初始属性 //////
"setInitData":function (hard) {
@@ -157,8 +155,13 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
// 衰弱
if (core.enemys.hasSpecial(special, 13) && !core.hasFlag('weak')) {
core.setFlag('weak', true);
- core.status.hero.atk-=core.values.weakValue;
- core.status.hero.def-=core.values.weakValue;
+ var weakValue = core.status.weakValue;
+ var weakAtk = weakValue>=1?weakValue:Math.floor(weakValue*core.status.hero.atk);
+ var weakDef = weakValue>=1?weakValue:Math.floor(weakValue*core.status.hero.def);
+ core.setFlag('weakAtk', weakAtk);
+ core.setFlag('weakDef', weakDef);
+ core.status.hero.atk-=weakAtk;
+ core.status.hero.def-=weakDef;
}
// 诅咒
if (core.enemys.hasSpecial(special, 14) && !core.hasFlag('curse')) {
@@ -343,59 +346,38 @@ functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
console.log("插件函数执行测试");
}
+ var _useEquipment = function (itemId, name, type) {
+ if (itemId.indexOf(name)==0) {
+ var now=core.getFlag(name, name+"0");
+
+ if (typeof core.values[now] == 'number') {
+ core.status.hero[type] -= core.values[now];
+ }
+ else {
+ core.status.hero.atk -= core.values[now].atk || 0;
+ core.status.hero.def -= core.values[now].def || 0;
+ core.status.hero.mdef -= core.values[now].mdef || 0;
+ }
+
+ if (typeof core.values[itemId] == 'number') {
+ core.status.hero[type] += core.values[itemId];
+ }
+ else {
+ core.status.hero.atk += core.values[itemId].atk || 0;
+ core.status.hero.def += core.values[itemId].def || 0;
+ core.status.hero.mdef += core.values[itemId].mdef || 0;
+ }
+
+ core.setItem(now, 1);
+ core.setItem(itemId, 0);
+ core.setFlag(name, itemId);
+ core.drawTip("已装备"+core.material.items[itemId].name);
+ }
+ }
+
this.useEquipment = function (itemId) { // 使用装备
- if (itemId.indexOf("sword")==0) {
- var now=core.getFlag('sword', 'sword0'); // 当前装备剑的ID
-
- if (typeof core.values[now] == 'number') {
- core.status.hero.atk -= core.values[now];
- }
- else {
- core.status.hero.atk -= core.values[now].atk || 0;
- core.status.hero.def -= core.values[now].def || 0;
- core.status.hero.mdef -= core.values[now].mdef || 0;
- }
-
- if (typeof core.values[itemId] == 'number') {
- core.status.hero.atk += core.values[itemId];
- }
- else {
- core.status.hero.atk += core.values[itemId].atk || 0;
- core.status.hero.def += core.values[itemId].def || 0;
- core.status.hero.mdef += core.values[itemId].mdef || 0;
- }
-
- core.setItem(now, 1);
- core.setItem(itemId, 0);
- core.setFlag('sword', itemId);
- core.drawTip("已装备"+core.material.items[itemId].name);
- }
- if (itemId.indexOf("shield")==0) {
- var now=core.getFlag('shield', 'shield0');
-
- if (typeof core.values[now] == 'number') {
- core.status.hero.def -= core.values[now];
- }
- else {
- core.status.hero.atk -= core.values[now].atk || 0;
- core.status.hero.def -= core.values[now].def || 0;
- core.status.hero.mdef -= core.values[now].mdef || 0;
- }
-
- if (typeof core.values[itemId] == 'number') {
- core.status.hero.def += core.values[itemId];
- }
- else {
- core.status.hero.atk += core.values[itemId].atk || 0;
- core.status.hero.def += core.values[itemId].def || 0;
- core.status.hero.mdef += core.values[itemId].mdef || 0;
- }
-
- core.setItem(now, 1);
- core.setItem(itemId, 0);
- core.setFlag('shield', itemId);
- core.drawTip("已装备"+core.material.items[itemId].name);
- }
+ _useEquipment(itemId, "sword", "atk");
+ _useEquipment(itemId, "shield", "def");
}
// 可以在任何地方(如afterXXX或自定义脚本事件)调用函数,方法为 core.plugin.xxx();
diff --git a/project/icons.js b/project/icons.js
index cfc26a35..1d36e5e0 100644
--- a/project/icons.js
+++ b/project/icons.js
@@ -207,6 +207,7 @@ icons_4665ee12_3a1f_44a4_bea3_0fccba634dc1 =
'bluePotion': 21,
'greenPotion': 22,
'yellowPotion': 23,
+ 'lifeWand': 33,
'sword0': 60,
'sword1': 50,
'sword2': 51,
diff --git a/project/items.js b/project/items.js
index 3a7660ce..5a2788fe 100644
--- a/project/items.js
+++ b/project/items.js
@@ -1,180 +1,341 @@
items_296f5d02_12fd_4166_a7c1_b5e830c9ee3a =
{
-
-"items" : {
- // 钥匙
- 'yellowKey': {'cls': 'keys', 'name': '黄钥匙'},
- 'blueKey': {'cls': 'keys', 'name': '蓝钥匙'},
- 'redKey': {'cls': 'keys', 'name': '红钥匙'},
-
- // 宝石、血瓶
- 'redJewel': {'cls': 'items', 'name': '红宝石'},
- 'blueJewel': {'cls': 'items', 'name': '蓝宝石'},
- 'greenJewel': {'cls': 'items', 'name': '绿宝石'},
- 'yellowJewel': {'cls': 'items', 'name': '黄宝石'},
- 'redPotion': {'cls': 'items', 'name': '红血瓶'},
- 'bluePotion': {'cls': 'items', 'name': '蓝血瓶'},
- 'yellowPotion': {'cls': 'items', 'name': '黄血瓶'},
- 'greenPotion': {'cls': 'items', 'name': '绿血瓶'},
- 'sword1': {'cls': 'items', 'name': '铁剑', 'isEquipment': true},
- 'sword2': {'cls': 'items', 'name': '银剑', 'isEquipment': true},
- 'sword3': {'cls': 'items', 'name': '骑士剑', 'isEquipment': true},
- 'sword4': {'cls': 'items', 'name': '圣剑', 'isEquipment': true},
- 'sword5': {'cls': 'items', 'name': '神圣剑', 'isEquipment': true},
- 'shield1': {'cls': 'items', 'name': '铁盾', 'isEquipment': true},
- 'shield2': {'cls': 'items', 'name': '银盾', 'isEquipment': true},
- 'shield3': {'cls': 'items', 'name': '骑士盾', 'isEquipment': true},
- 'shield4': {'cls': 'items', 'name': '圣盾', 'isEquipment': true},
- 'shield5': {'cls': 'items', 'name': '神圣盾', 'isEquipment': true},
- 'superPotion': {'cls': 'items', 'name': '圣水'},
- 'moneyPocket': {'cls': 'items', 'name': '金钱袋'},
-
- // 物品
- 'sword0': {'cls': 'constants', 'name': '折断的剑', 'text': '没有任何作用的剑,相当于脱掉装备。'},
- 'shield0': {'cls': 'constants', 'name': '残破的盾', 'text': '没有任何作用的盾,相当于脱掉装备。'},
- 'book': {'cls': 'constants', 'name': '怪物手册', 'text': '可以查看当前楼层各怪物属性'},
- 'fly': {'cls': 'constants', 'name': '楼层传送器', 'text': '可以自由往来去过的楼层'},
- 'coin': {'cls': 'constants', 'name': '幸运金币', 'text': '持有时打败怪物可得双倍金币'},
- 'snow': {'cls': 'constants', 'name': '冰冻徽章', 'text': '可以将四周的熔岩变成平地'},
- 'cross': {'cls': 'constants', 'name': '十字架', 'text': '持有后无视怪物的无敌属性'},
- 'knife': {'cls': 'constants', 'name': '屠龙匕首', 'text': '该道具尚未被定义'},
- 'shoes': {'cls': 'constants', 'name': '绿鞋', 'text': '持有时无视负面地形'},
-
- // 道具
- 'bigKey': {'cls': 'tools', 'name': '大黄门钥匙', 'text': '可以开启当前层所有黄门'},
- 'greenKey': {'cls': 'tools', 'name': '绿钥匙', 'text': '可以打开一扇绿门'},
- 'steelKey': {'cls': 'tools', 'name': '铁门钥匙', 'text': '可以打开一扇铁门'},
- 'pickaxe': {'cls': 'tools', 'name': '破墙镐', 'text': '可以破坏勇士面前的墙'},
- 'icePickaxe': {'cls': 'tools', 'name': '破冰镐', 'text': '可以破坏勇士面前的一堵冰墙'},
- 'bomb': {'cls': 'tools', 'name': '炸弹', 'text': '可以炸掉勇士面前的怪物'},
- 'centerFly': {'cls': 'tools', 'name': '中心对称飞行器', 'text': '可以飞向当前楼层中心对称的位置'},
- 'upFly': {'cls': 'tools', 'name': '上楼器', 'text': '可以飞往楼上的相同位置'},
- 'downFly': {'cls': 'tools', 'name': '下楼器', 'text': '可以飞往楼下的相同位置'},
- 'earthquake': {'cls': 'tools', 'name': '地震卷轴', 'text': '可以破坏当前层的所有墙'},
- 'poisonWine': {'cls': 'tools', 'name': '解毒药水', 'text': '可以解除中毒状态'},
- 'weakWine': {'cls': 'tools', 'name': '解衰药水', 'text': '可以解除衰弱状态'},
- 'curseWine': {'cls': 'tools', 'name': '解咒药水', 'text': '可以解除诅咒状态'},
- 'superWine': {'cls': 'tools', 'name': '万能药水', 'text': '可以解除所有不良状态'},
- 'hammer': {'cls': 'tools', 'name': '圣锤', 'text': '可以炸掉勇士面前的怪物'}
-},
-
-
-
-
-"itemEffect" : {
- "redJewel":"core.status.hero.atk += core.values.redJewel * ratio",
- "blueJewel":"core.status.hero.def += core.values.blueJewel * ratio",
- "greenJewel":"core.status.hero.mdef += core.values.greenJewel * ratio",
-
- "yellowJewel":"core.status.hero.hp+=1000;core.status.hero.atk+=6;core.status.hero.def+=6;core.status.hero.mdef+=10;",
- // 黄宝石属性:需自己定义
- "redPotion":"core.status.hero.hp += core.values.redPotion * ratio",
- "bluePotion":"core.status.hero.hp += core.values.bluePotion * ratio",
- "yellowPotion":"core.status.hero.hp += core.values.yellowPotion * ratio",
- "greenPotion":"core.status.hero.hp += core.values.greenPotion * ratio",
- "sword1":"core.status.hero.atk += core.values.sword1",
- "sword2":"core.status.hero.atk += core.values.sword2",
- "sword3":"core.status.hero.atk += core.values.sword3",
- "sword4":"core.status.hero.atk += core.values.sword4",
- "sword5":"core.status.hero.atk += core.values.sword5",
- "shield1":"core.status.hero.def += core.values.shield1",
- "shield2":"core.status.hero.def += core.values.shield2",
- "shield3":"core.status.hero.def += core.values.shield3",
- "shield4":"core.status.hero.def += core.values.shield4",
- "shield5":"core.status.hero.def += core.values.shield5",
-
- "bigKey":"core.status.hero.items.keys.yellowKey++;core.status.hero.items.keys.blueKey++;core.status.hero.items.keys.redKey++;",
- // 只有是钥匙盒才会执行这一步
- "superPotion":"core.status.hero.hp *= 2",
- "moneyPocket":"core.status.hero.money += core.values.moneyPocket",
-},
-
-
-"itemEffectTip" : {
- "redJewel":"',攻击+'+core.values.redJewel * ratio",
- "blueJewel":"',防御+'+core.values.blueJewel * ratio",
- "greenJewel":"',魔防+'+core.values.greenJewel * ratio",
- "yellowJewel":"',全属性提升'",
- "redPotion":"',生命+'+core.values.redPotion * ratio",
- "bluePotion":"',生命+'+core.values.bluePotion * ratio",
- "yellowPotion":"',生命+'+core.values.yellowPotion * ratio",
- "greenPotion":"',生命+'+core.values.greenPotion * ratio",
- "sword1":"',攻击+'+core.values.sword1",
- "sword2":"',攻击+'+core.values.sword2",
- "sword3":"',攻击+'+core.values.sword3",
- "sword4":"',攻击+'+core.values.sword4",
- "sword5":"',攻击+'+core.values.sword5",
- "shield1":"',防御+'+core.values.shield1",
- "shield2":"',防御+'+core.values.shield2",
- "shield3":"',防御+'+core.values.shield3",
- "shield4":"',防御+'+core.values.shield4",
- "shield5":"',防御+'+core.values.shield5",
- "bigKey":"',全钥匙+1'",
- "superPotion":"',生命值翻倍'",
- "moneyPocket":"',金币+'+core.values.moneyPocket",
-},
-
-"useItemEffect": {
- "book": "core.ui.drawBook(0);",
- "fly": "core.ui.drawFly(core.status.hero.flyRange.indexOf(core.status.floorId));",
- "earthquake": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n});",
- "pickaxe": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n});",
- "icePickaxe": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero(), 'stop');\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n});",
- "snow": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n});",
- "bigKey": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n});",
- "bomb": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n core.events.afterUseBomb();\n});",
- "hammer": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n core.events.afterUseBomb();\n});",
- "centerFly": "core.clearMap('hero', 0, 0, 416, 416);\ncore.setHeroLoc('x', core.status.event.data.x);\ncore.setHeroLoc('y', core.status.event.data.y);\ncore.drawHero();\ncore.drawTip(core.material.items[itemId].name + '使用成功');",
- "upFly": "var loc = {'direction': core.status.hero.loc.direction, 'x': core.status.event.data.x, 'y': core.status.event.data.y};\ncore.changeFloor(core.status.event.data.id, null, loc, null, function (){\n core.drawTip(core.material.items[itemId].name + '使用成功');\n core.replay();\n});",
- "downFly": "var loc = {'direction': core.status.hero.loc.direction, 'x': core.status.event.data.x, 'y': core.status.event.data.y};\ncore.changeFloor(core.status.event.data.id, null, loc, null, function (){\n core.drawTip(core.material.items[itemId].name + '使用成功');\n core.replay();\n});",
- "poisonWine": "core.setFlag('poison', false);",
- "weakWine": "core.setFlag('weak', false);\ncore.status.hero.atk += core.values.weakValue;\ncore.status.hero.def += core.values.weakValue;",
- "curseWine": "core.setFlag('curse', false);",
- "superWine": "core.setFlag('poison', false);\nif (core.hasFlag('weak')) {\n core.setFlag('weak', false);\n core.status.hero.atk += core.values.weakValue;\n core.status.hero.def += core.values.weakValue;\n}\ncore.setFlag('curse', false);",
- "sword0": "core.plugin.useEquipment(itemId)",
- "sword1": "core.plugin.useEquipment(itemId)",
- "sword2": "core.plugin.useEquipment(itemId)",
- "sword3": "core.plugin.useEquipment(itemId)",
- "sword4": "core.plugin.useEquipment(itemId)",
- "sword5": "core.plugin.useEquipment(itemId)",
- "shield0": "core.plugin.useEquipment(itemId)",
- "shield1": "core.plugin.useEquipment(itemId)",
- "shield2": "core.plugin.useEquipment(itemId)",
- "shield3": "core.plugin.useEquipment(itemId)",
- "shield4": "core.plugin.useEquipment(itemId)",
- "shield5": "core.plugin.useEquipment(itemId)",
-},
-
-"canUseItemEffect": {
- "book": "true",
- "fly": "core.status.hero.flyRange.indexOf(core.status.floorId)>=0",
- "pickaxe": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) &&\n (block.event.id == 'yellowWall' || block.event.id=='whiteWall' || block.event.id=='blueWall')) // 能破哪些墙\n {\n // 四个方向\n if (core.flags.pickaxeFourDirections) {\n if (Math.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1) {\n ids.push(i);\n }\n }\n else {\n if (block.x == core.nextX() && block.y == core.nextY()) {\n ids.push(i);\n }\n }\n }\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable",
- "icePickaxe": "var able=false;\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) && block.x==core.nextX() && block.y==core.nextY() && block.event.id=='ice') {\n core.status.event.data = [i];\n able=true;\n }\n}\nable",
- "bomb": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) && block.event.cls.indexOf('enemy')==0 && Math.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1) {\n var enemy = core.material.enemys[block.event.id];\n if ((core.isset(enemy.bomb) && !enemy.bomb) || (core.isset(enemy.notBomb) && enemy.notBomb)) continue;\n if (core.flags.bombFourDirections || (block.x==core.nextX() && block.y==core.nextY()))\n ids.push(i);\n }\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable",
- "hammer": "var able=false;\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) && block.event.cls.indexOf('enemy')==0 && block.x==core.nextX() && block.y==core.nextY()) {\n var enemy = core.material.enemys[block.event.id];\n ((core.isset(enemy.bomb) && !enemy.bomb) || (core.isset(enemy.notBomb) && enemy.notBomb)) continue;\n core.status.event.data = [i];\n able=true;\n }\n}\nable",
- "earthquake": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) && (block.event.id == 'yellowWall' || block.event.id == 'blueWall' || block.event.id == 'whiteWall')) // 能炸的墙壁\n ids.push(i);\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable",
- "centerFly": "var able=false;\nvar toX = 12 - core.getHeroLoc('x'), toY = 12-core.getHeroLoc('y');\nvar block = core.getBlock(toX, toY);\nif (block==null) {\n core.status.event.data = {'x': toX, 'y': toY};\n able = true;\n}\nable",
- "upFly": "var able=false;\nvar floorId = core.status.floorId, index = core.floorIds.indexOf(floorId);\nif (index0) {\n\tvar toId = core.floorIds[index-1], toX = core.getHeroLoc('x'), toY = core.getHeroLoc('y');\n\tif (core.getBlock(toX, toY, toId)==null) {\n\t\tcore.status.event.data = {'id': toId, 'x': toX, 'y': toY};\n\t\table=true;\n\t}\n}\nable",
- "snow": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) && block.event.id == 'lava' && Math.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1) {\n ids.push(i);\n }\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable",
- "bigKey": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) && block.event.id == 'yellowDoor') {\n ids.push(i);\n }\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable",
- "poisonWine": "core.hasFlag('poison')",
- "weakWine": "core.hasFlag('weak')",
- "curseWine": "core.hasFlag('curse')",
- "superWine": "core.hasFlag('poison') || core.hasFlag('weak') || core.hasFlag('curse')",
- "sword0": "true",
- "sword1": "true",
- "sword2": "true",
- "sword3": "true",
- "sword4": "true",
- "sword5": "true",
- "shield0": "true",
- "shield1": "true",
- "shield2": "true",
- "shield3": "true",
- "shield4": "true",
- "shiled5": "true",
-
-}
-
+ "items": {
+ "yellowKey": {
+ "cls": "keys",
+ "name": "黄钥匙"
+ },
+ "blueKey": {
+ "cls": "keys",
+ "name": "蓝钥匙"
+ },
+ "redKey": {
+ "cls": "keys",
+ "name": "红钥匙"
+ },
+ "redJewel": {
+ "cls": "items",
+ "name": "红宝石"
+ },
+ "blueJewel": {
+ "cls": "items",
+ "name": "蓝宝石"
+ },
+ "greenJewel": {
+ "cls": "items",
+ "name": "绿宝石"
+ },
+ "yellowJewel": {
+ "cls": "items",
+ "name": "黄宝石"
+ },
+ "redPotion": {
+ "cls": "items",
+ "name": "红血瓶"
+ },
+ "bluePotion": {
+ "cls": "items",
+ "name": "蓝血瓶"
+ },
+ "yellowPotion": {
+ "cls": "items",
+ "name": "黄血瓶"
+ },
+ "greenPotion": {
+ "cls": "items",
+ "name": "绿血瓶"
+ },
+ "sword1": {
+ "cls": "items",
+ "name": "铁剑",
+ "text": "一把很普通的铁剑"
+ },
+ "sword2": {
+ "cls": "items",
+ "name": "银剑",
+ "text": "一把很普通的银剑"
+ },
+ "sword3": {
+ "cls": "items",
+ "name": "骑士剑",
+ "text": "一把很普通的骑士剑"
+ },
+ "sword4": {
+ "cls": "items",
+ "name": "圣剑",
+ "text": "一把很普通的圣剑"
+ },
+ "sword5": {
+ "cls": "items",
+ "name": "神圣剑",
+ "text": "一把很普通的神圣剑"
+ },
+ "shield1": {
+ "cls": "items",
+ "name": "铁盾",
+ "text": "一个很普通的铁盾"
+ },
+ "shield2": {
+ "cls": "items",
+ "name": "银盾",
+ "text": "一个很普通的银盾"
+ },
+ "shield3": {
+ "cls": "items",
+ "name": "骑士盾",
+ "text": "一个很普通的骑士盾"
+ },
+ "shield4": {
+ "cls": "items",
+ "name": "圣盾",
+ "text": "一个很普通的圣盾"
+ },
+ "shield5": {
+ "cls": "items",
+ "name": "神圣盾",
+ "text": "一个很普通的神圣盾"
+ },
+ "superPotion": {
+ "cls": "items",
+ "name": "圣水"
+ },
+ "moneyPocket": {
+ "cls": "items",
+ "name": "金钱袋"
+ },
+ "sword0": {
+ "cls": "constants",
+ "name": "折断的剑",
+ "text": "没有任何作用的剑,相当于脱掉装备。"
+ },
+ "shield0": {
+ "cls": "constants",
+ "name": "残破的盾",
+ "text": "没有任何作用的盾,相当于脱掉装备。"
+ },
+ "book": {
+ "cls": "constants",
+ "name": "怪物手册",
+ "text": "可以查看当前楼层各怪物属性"
+ },
+ "fly": {
+ "cls": "constants",
+ "name": "楼层传送器",
+ "text": "可以自由往来去过的楼层"
+ },
+ "coin": {
+ "cls": "constants",
+ "name": "幸运金币",
+ "text": "持有时打败怪物可得双倍金币"
+ },
+ "snow": {
+ "cls": "constants",
+ "name": "冰冻徽章",
+ "text": "可以将四周的熔岩变成平地"
+ },
+ "cross": {
+ "cls": "constants",
+ "name": "十字架",
+ "text": "持有后无视怪物的无敌属性"
+ },
+ "knife": {
+ "cls": "constants",
+ "name": "屠龙匕首",
+ "text": "该道具尚未被定义"
+ },
+ "shoes": {
+ "cls": "constants",
+ "name": "绿鞋",
+ "text": "持有时无视负面地形"
+ },
+ "bigKey": {
+ "cls": "tools",
+ "name": "大黄门钥匙",
+ "text": "可以开启当前层所有黄门"
+ },
+ "greenKey": {
+ "cls": "tools",
+ "name": "绿钥匙",
+ "text": "可以打开一扇绿门"
+ },
+ "steelKey": {
+ "cls": "tools",
+ "name": "铁门钥匙",
+ "text": "可以打开一扇铁门"
+ },
+ "pickaxe": {
+ "cls": "tools",
+ "name": "破墙镐",
+ "text": "可以破坏勇士面前的墙"
+ },
+ "icePickaxe": {
+ "cls": "tools",
+ "name": "破冰镐",
+ "text": "可以破坏勇士面前的一堵冰墙"
+ },
+ "bomb": {
+ "cls": "tools",
+ "name": "炸弹",
+ "text": "可以炸掉勇士面前的怪物"
+ },
+ "centerFly": {
+ "cls": "tools",
+ "name": "中心对称飞行器",
+ "text": "可以飞向当前楼层中心对称的位置"
+ },
+ "upFly": {
+ "cls": "tools",
+ "name": "上楼器",
+ "text": "可以飞往楼上的相同位置"
+ },
+ "downFly": {
+ "cls": "tools",
+ "name": "下楼器",
+ "text": "可以飞往楼下的相同位置"
+ },
+ "earthquake": {
+ "cls": "tools",
+ "name": "地震卷轴",
+ "text": "可以破坏当前层的所有墙"
+ },
+ "poisonWine": {
+ "cls": "tools",
+ "name": "解毒药水",
+ "text": "可以解除中毒状态"
+ },
+ "weakWine": {
+ "cls": "tools",
+ "name": "解衰药水",
+ "text": "可以解除衰弱状态"
+ },
+ "curseWine": {
+ "cls": "tools",
+ "name": "解咒药水",
+ "text": "可以解除诅咒状态"
+ },
+ "superWine": {
+ "cls": "tools",
+ "name": "万能药水",
+ "text": "可以解除所有不良状态"
+ },
+ "hammer": {
+ "cls": "tools",
+ "name": "圣锤",
+ "text": "可以炸掉勇士面前的怪物"
+ },
+ "lifeWand": {
+ "cls": "tools",
+ "name": "生命魔杖",
+ "text": "可以恢复100点生命值"
+ }
+ },
+ "itemEffect": {
+ "redJewel": "core.status.hero.atk += core.values.redJewel * ratio",
+ "blueJewel": "core.status.hero.def += core.values.blueJewel * ratio",
+ "greenJewel": "core.status.hero.mdef += core.values.greenJewel * ratio",
+ "yellowJewel": "core.status.hero.hp+=1000;core.status.hero.atk+=6;core.status.hero.def+=6;core.status.hero.mdef+=10;",
+ "redPotion": "core.status.hero.hp += core.values.redPotion * ratio",
+ "bluePotion": "core.status.hero.hp += core.values.bluePotion * ratio",
+ "yellowPotion": "core.status.hero.hp += core.values.yellowPotion * ratio",
+ "greenPotion": "core.status.hero.hp += core.values.greenPotion * ratio",
+ "sword1": "core.status.hero.atk += core.values.sword1",
+ "sword2": "core.status.hero.atk += core.values.sword2",
+ "sword3": "core.status.hero.atk += core.values.sword3",
+ "sword4": "core.status.hero.atk += core.values.sword4",
+ "sword5": "core.status.hero.atk += core.values.sword5",
+ "shield1": "core.status.hero.def += core.values.shield1",
+ "shield2": "core.status.hero.def += core.values.shield2",
+ "shield3": "core.status.hero.def += core.values.shield3",
+ "shield4": "core.status.hero.def += core.values.shield4",
+ "shield5": "core.status.hero.def += core.values.shield5",
+ "bigKey": "core.status.hero.items.keys.yellowKey++;core.status.hero.items.keys.blueKey++;core.status.hero.items.keys.redKey++;",
+ "superPotion": "core.status.hero.hp *= 2",
+ "moneyPocket": "core.status.hero.money += core.values.moneyPocket"
+ },
+ "itemEffectTip": {
+ "redJewel": "',攻击+'+core.values.redJewel * ratio",
+ "blueJewel": "',防御+'+core.values.blueJewel * ratio",
+ "greenJewel": "',魔防+'+core.values.greenJewel * ratio",
+ "yellowJewel": "',全属性提升'",
+ "redPotion": "',生命+'+core.values.redPotion * ratio",
+ "bluePotion": "',生命+'+core.values.bluePotion * ratio",
+ "yellowPotion": "',生命+'+core.values.yellowPotion * ratio",
+ "greenPotion": "',生命+'+core.values.greenPotion * ratio",
+ "sword1": "',攻击+'+core.values.sword1",
+ "sword2": "',攻击+'+core.values.sword2",
+ "sword3": "',攻击+'+core.values.sword3",
+ "sword4": "',攻击+'+core.values.sword4",
+ "sword5": "',攻击+'+core.values.sword5",
+ "shield1": "',防御+'+core.values.shield1",
+ "shield2": "',防御+'+core.values.shield2",
+ "shield3": "',防御+'+core.values.shield3",
+ "shield4": "',防御+'+core.values.shield4",
+ "shield5": "',防御+'+core.values.shield5",
+ "bigKey": "',全钥匙+1'",
+ "superPotion": "',生命值翻倍'",
+ "moneyPocket": "',金币+'+core.values.moneyPocket"
+ },
+ "useItemEffect": {
+ "book": "core.ui.drawBook(0);",
+ "fly": "core.ui.drawFly(core.status.hero.flyRange.indexOf(core.status.floorId));",
+ "earthquake": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n});",
+ "pickaxe": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n});",
+ "icePickaxe": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero(), 'stop');\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n});",
+ "snow": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n});",
+ "bigKey": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n});",
+ "bomb": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n core.events.afterUseBomb();\n});",
+ "hammer": "core.removeBlockByIds(core.status.floorId, core.status.event.data);\ncore.drawMap(core.status.floorId, function () {\n core.drawHero();\n core.updateFg();\n core.drawTip(core.material.items[itemId].name + '使用成功');\n core.events.afterUseBomb();\n});",
+ "centerFly": "core.clearMap('hero', 0, 0, 416, 416);\ncore.setHeroLoc('x', core.status.event.data.x);\ncore.setHeroLoc('y', core.status.event.data.y);\ncore.drawHero();\ncore.drawTip(core.material.items[itemId].name + '使用成功');",
+ "upFly": "var loc = {'direction': core.status.hero.loc.direction, 'x': core.status.event.data.x, 'y': core.status.event.data.y};\ncore.changeFloor(core.status.event.data.id, null, loc, null, function (){\n core.drawTip(core.material.items[itemId].name + '使用成功');\n core.replay();\n});",
+ "downFly": "var loc = {'direction': core.status.hero.loc.direction, 'x': core.status.event.data.x, 'y': core.status.event.data.y};\ncore.changeFloor(core.status.event.data.id, null, loc, null, function (){\n core.drawTip(core.material.items[itemId].name + '使用成功');\n core.replay();\n});",
+ "poisonWine": "core.setFlag('poison', false);",
+ "weakWine": "core.setFlag('weak', false);\ncore.status.hero.atk += core.getFlag('weakAtk', core.values.weakValue);\ncore.status.hero.def += core.getFlag('weakDef', core.values.weakValue);",
+ "curseWine": "core.setFlag('curse', false);",
+ "superWine": "core.setFlag('poison', false);\nif (core.hasFlag('weak')) {\n core.setFlag('weak', false);\n core.status.hero.atk += core.getFlag('weakAtk', core.values.weakValue);\n core.status.hero.def += core.getFlag('weakDef', core.values.weakValue);\n}\ncore.setFlag('curse', false);",
+ "sword0": "core.plugin.useEquipment(itemId)",
+ "sword1": "core.plugin.useEquipment(itemId)",
+ "sword2": "core.plugin.useEquipment(itemId)",
+ "sword3": "core.plugin.useEquipment(itemId)",
+ "sword4": "core.plugin.useEquipment(itemId)",
+ "sword5": "core.plugin.useEquipment(itemId)",
+ "shield0": "core.plugin.useEquipment(itemId)",
+ "shield1": "core.plugin.useEquipment(itemId)",
+ "shield2": "core.plugin.useEquipment(itemId)",
+ "shield3": "core.plugin.useEquipment(itemId)",
+ "shield4": "core.plugin.useEquipment(itemId)",
+ "shield5": "core.plugin.useEquipment(itemId)",
+ "lifeWand": "core.insertAction([\n\t{\"type\": \"input\", \"text\": \"请输入生命魔杖使用次数:(0-${item:lifeWand})\"},\n\t{\"type\": \"if\", \"condition\": \"flag:input<=item:lifeWand\",\n\t\t\"true\": [\n\t\t\t{\"type\": \"setValue\", \"name\": \"item:lifeWand\", \"value\": \"item:lifeWand-flag:input\"},\n\t\t\t{\"type\": \"setValue\", \"name\": \"status:hp\", \"value\": \"status:hp+flag:input*100\"},\n\t\t\t\"成功使用${flag:input}次生命魔杖,恢复${flag:input*100}点生命。\"\n\t\t],\n\t\t\"false\": [\"输入不合法!\"]\n\t},\n]);\ncore.setItem('lifeWand', core.itemCount('lifeWand')+1);"
+ },
+ "canUseItemEffect": {
+ "book": "true",
+ "fly": "core.status.hero.flyRange.indexOf(core.status.floorId)>=0",
+ "pickaxe": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) &&\n (block.event.id == 'yellowWall' || block.event.id=='whiteWall' || block.event.id=='blueWall')) // 能破哪些墙\n {\n // 四个方向\n if (core.flags.pickaxeFourDirections) {\n if (Math.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1) {\n ids.push(i);\n }\n }\n else {\n if (block.x == core.nextX() && block.y == core.nextY()) {\n ids.push(i);\n }\n }\n }\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable",
+ "icePickaxe": "var able=false;\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) && block.x==core.nextX() && block.y==core.nextY() && block.event.id=='ice') {\n core.status.event.data = [i];\n able=true;\n }\n}\nable",
+ "bomb": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) && block.event.cls.indexOf('enemy')==0 && Math.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1) {\n var enemy = core.material.enemys[block.event.id];\n if ((core.isset(enemy.bomb) && !enemy.bomb) || (core.isset(enemy.notBomb) && enemy.notBomb)) continue;\n if (core.flags.bombFourDirections || (block.x==core.nextX() && block.y==core.nextY()))\n ids.push(i);\n }\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable",
+ "hammer": "var able=false;\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) && block.event.cls.indexOf('enemy')==0 && block.x==core.nextX() && block.y==core.nextY()) {\n var enemy = core.material.enemys[block.event.id];\n ((core.isset(enemy.bomb) && !enemy.bomb) || (core.isset(enemy.notBomb) && enemy.notBomb)) continue;\n core.status.event.data = [i];\n able=true;\n }\n}\nable",
+ "earthquake": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) && (block.event.id == 'yellowWall' || block.event.id == 'blueWall' || block.event.id == 'whiteWall')) // 能炸的墙壁\n ids.push(i);\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable",
+ "centerFly": "var able=false;\nvar toX = 12 - core.getHeroLoc('x'), toY = 12-core.getHeroLoc('y');\nvar block = core.getBlock(toX, toY);\nif (block==null) {\n core.status.event.data = {'x': toX, 'y': toY};\n able = true;\n}\nable",
+ "upFly": "var able=false;\nvar floorId = core.status.floorId, index = core.floorIds.indexOf(floorId);\nif (index0) {\n\tvar toId = core.floorIds[index-1], toX = core.getHeroLoc('x'), toY = core.getHeroLoc('y');\n\tif (core.getBlock(toX, toY, toId)==null) {\n\t\tcore.status.event.data = {'id': toId, 'x': toX, 'y': toY};\n\t\table=true;\n\t}\n}\nable",
+ "snow": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) && block.event.id == 'lava' && Math.abs(block.x-core.status.hero.loc.x)+Math.abs(block.y-core.status.hero.loc.y)<=1) {\n ids.push(i);\n }\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable",
+ "bigKey": "var able=false;\nvar ids = [];\nfor (var i in core.status.thisMap.blocks) {\n var block = core.status.thisMap.blocks[i];\n if (core.isset(block.event) && !(core.isset(block.enable) && !block.enable) && block.event.id == 'yellowDoor') {\n ids.push(i);\n }\n}\nif (ids.length>0) {\n core.status.event.data = ids;\n able=true;\n}\nable",
+ "poisonWine": "core.hasFlag('poison')",
+ "weakWine": "core.hasFlag('weak')",
+ "curseWine": "core.hasFlag('curse')",
+ "superWine": "core.hasFlag('poison') || core.hasFlag('weak') || core.hasFlag('curse')",
+ "sword0": "true",
+ "sword1": "true",
+ "sword2": "true",
+ "sword3": "true",
+ "sword4": "true",
+ "sword5": "true",
+ "shield0": "true",
+ "shield1": "true",
+ "shield2": "true",
+ "shield3": "true",
+ "shield4": "true",
+ "shiled5": "true",
+ "shield5": "true",
+ "lifeWand": "true"
+ }
}
\ No newline at end of file
diff --git a/project/maps.js b/project/maps.js
index 07484df7..815c0ca9 100644
--- a/project/maps.js
+++ b/project/maps.js
@@ -76,6 +76,7 @@ maps_90f36752_8815_4be8_b32b_d7fad1d0542e =
'63':{'cls': 'items', 'id': 'moneyPocket'}, // 金钱袋
'64':{'cls': 'items', 'id': 'shoes'}, // 绿鞋
'65':{'cls': 'items', 'id': 'hammer'}, // 圣锤
+ '66':{'cls': 'items', 'id': 'lifeWand'}, // 生命魔杖
////////////////////////// 门、楼梯、传送点部分 //////////////////////////
diff --git a/styles.css b/styles.css
index 511f28c1..2021c874 100644
--- a/styles.css
+++ b/styles.css
@@ -106,7 +106,7 @@
background-color: #000;
opacity: 0.85;
display: none;
- z-index: 220;
+ z-index: 260;
bottom: 0;
margin-bottom: 7%;
}
@@ -170,7 +170,7 @@
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
background: url(project/images/ground.png) repeat;
- z-index: 160;
+ z-index: 150;
display: none;
}
#statusBar .status{
@@ -199,7 +199,7 @@
#toolBar {
position: absolute;
background: url(project/images/ground.png) repeat;
- z-index: 150;
+ z-index: 160;
box-sizing: border-box;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
diff --git a/常用工具/便捷PS工具.exe b/常用工具/便捷PS工具.exe
index 605b18a2..78a9c25e 100644
Binary files a/常用工具/便捷PS工具.exe and b/常用工具/便捷PS工具.exe differ
diff --git a/更新说明.txt b/更新说明.txt
index a2ed95eb..ee9e4b6b 100644
--- a/更新说明.txt
+++ b/更新说明.txt
@@ -1,4 +1,25 @@
-HTML5魔塔样板V2.1.1
+HTML5魔塔样板V2.2
+
+事件坐标可用变量指定("loc": ["flag:x", "flag:y"])
+全局商店也可以使用图块编辑
+高亮显示有事件的格子
+对于道具和怪物自动注册该列所有未注册的素材
+便捷PS工具对于白底图片可自动调整为透明背景
+事件:等待用户点击(type:wait)
+事件:图片移动事件(type:moveImage)
+事件:设置BGM音量(type:setVolume)
+提供core.rand()和core.rand2()两个随机数函数
+作弊处理(最大有效生命值、匿名则最低成绩上传)
+自定义状态栏绘制
+最高六倍速播放
+播放录像时可以C键查看怪物手册
+修复标题文字太长导致无法开始游戏的问题
+新增纯新手简易造塔流程
+部分效果和性能的优化
+
+-----------------------------------------------------------------------
+
+HTML5魔塔样板V2.1.1
新增事件:改变勇士行走图
楼传器落点设置