saveIndex2 -> saveIndex
This commit is contained in:
parent
c9fe2f6177
commit
68c8ef12bc
@ -2243,14 +2243,14 @@ actions.prototype.clickStorageRemove = function (x, y) {
|
|||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.drawText("\t[操作成功]你的所有存档已被清空。");
|
core.drawText("\t[操作成功]你的所有存档已被清空。");
|
||||||
core.status.saveIndex = 1;
|
core.status.saveIndex = 1;
|
||||||
core.setLocalStorage('saveIndex2', 1);
|
core.removeLocalStorage('saveIndex');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
localStorage.clear();
|
localStorage.clear();
|
||||||
core.drawText("\t[操作成功]你的所有存档已被清空。");
|
core.drawText("\t[操作成功]你的所有存档已被清空。");
|
||||||
core.status.saveIndex = 1;
|
core.status.saveIndex = 1;
|
||||||
core.setLocalStorage('saveIndex2', 1);
|
core.removeLocalStorage('saveIndex');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
@ -2264,7 +2264,7 @@ actions.prototype.clickStorageRemove = function (x, y) {
|
|||||||
core.ui.closePanel();
|
core.ui.closePanel();
|
||||||
core.drawText("\t[操作成功]当前塔的存档已被清空。");
|
core.drawText("\t[操作成功]当前塔的存档已被清空。");
|
||||||
core.status.saveIndex = 1;
|
core.status.saveIndex = 1;
|
||||||
core.setLocalStorage('saveIndex2', 1);
|
core.removeLocalStorage('saveIndex');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -2275,7 +2275,7 @@ actions.prototype.clickStorageRemove = function (x, y) {
|
|||||||
core.removeLocalStorage("autoSave");
|
core.removeLocalStorage("autoSave");
|
||||||
core.drawText("\t[操作成功]当前塔的存档已被清空。");
|
core.drawText("\t[操作成功]当前塔的存档已被清空。");
|
||||||
core.status.saveIndex = 1;
|
core.status.saveIndex = 1;
|
||||||
core.setLocalStorage('saveIndex2', 1);
|
core.removeLocalStorage('saveIndex');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
|
|||||||
@ -350,7 +350,7 @@ control.prototype.resetStatus = function(hero, hard, floorId, route, maps, value
|
|||||||
if (core.isset(route))
|
if (core.isset(route))
|
||||||
core.status.route = route;
|
core.status.route = route;
|
||||||
// 保存的Index
|
// 保存的Index
|
||||||
core.status.saveIndex = core.getLocalStorage('saveIndex2', 1);
|
core.status.saveIndex = core.getLocalStorage('saveIndex', 1);
|
||||||
|
|
||||||
if (core.isset(values))
|
if (core.isset(values))
|
||||||
core.values = core.clone(values);
|
core.values = core.clone(values);
|
||||||
@ -2199,7 +2199,7 @@ control.prototype.save = function(need) {
|
|||||||
control.prototype.load = function (need) {
|
control.prototype.load = function (need) {
|
||||||
if (core.isset(core.status.replay)&&core.status.replay.replaying) return;
|
if (core.isset(core.status.replay)&&core.status.replay.replaying) return;
|
||||||
|
|
||||||
var saveIndex = core.getLocalStorage('saveIndex2', 1);
|
var saveIndex = core.getLocalStorage('saveIndex', 1);
|
||||||
var page=parseInt((saveIndex-1)/5), offset=saveIndex-5*page;
|
var page=parseInt((saveIndex-1)/5), offset=saveIndex-5*page;
|
||||||
|
|
||||||
// 游戏开始前读档
|
// 游戏开始前读档
|
||||||
@ -2251,7 +2251,7 @@ control.prototype.doSL = function (id, type) {
|
|||||||
core.drawTip('存档成功!');
|
core.drawTip('存档成功!');
|
||||||
if (id!="autoSave") {
|
if (id!="autoSave") {
|
||||||
core.status.saveIndex=id;
|
core.status.saveIndex=id;
|
||||||
core.setLocalStorage('saveIndex2', core.status.saveIndex);
|
core.setLocalStorage('saveIndex', core.status.saveIndex);
|
||||||
}
|
}
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
console.info(err);
|
console.info(err);
|
||||||
@ -2288,7 +2288,7 @@ control.prototype.doSL = function (id, type) {
|
|||||||
core.drawTip("读档成功");
|
core.drawTip("读档成功");
|
||||||
if (id!="autoSave") {
|
if (id!="autoSave") {
|
||||||
core.status.saveIndex=id;
|
core.status.saveIndex=id;
|
||||||
core.setLocalStorage('saveIndex2', core.status.saveIndex);
|
core.setLocalStorage('saveIndex', core.status.saveIndex);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
|
|||||||
@ -72,7 +72,12 @@ items.prototype.useItem = function (itemId, callback) {
|
|||||||
var itemCls = core.material.items[itemId].cls;
|
var itemCls = core.material.items[itemId].cls;
|
||||||
|
|
||||||
if (itemId in this.useItemEffect) {
|
if (itemId in this.useItemEffect) {
|
||||||
eval(this.useItemEffect[itemId]);
|
try {
|
||||||
|
eval(this.useItemEffect[itemId]);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// 记录路线
|
// 记录路线
|
||||||
if (itemId!='book' && itemId!='fly') {
|
if (itemId!='book' && itemId!='fly') {
|
||||||
@ -96,7 +101,12 @@ items.prototype.canUseItem = function (itemId) {
|
|||||||
if (!core.hasItem(itemId)) return false;
|
if (!core.hasItem(itemId)) return false;
|
||||||
|
|
||||||
if (itemId in this.canUseItemEffect) {
|
if (itemId in this.canUseItemEffect) {
|
||||||
return eval(this.canUseItemEffect[itemId]);
|
try {
|
||||||
|
return eval(this.canUseItemEffect[itemId]);
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
@ -121,7 +131,7 @@ items.prototype.hasEquip = function (itemId) {
|
|||||||
if (!core.isset(itemId)) return null;
|
if (!core.isset(itemId)) return null;
|
||||||
if (!core.isset((core.material.items[itemId]||{}).equip)) return null;
|
if (!core.isset((core.material.items[itemId]||{}).equip)) return null;
|
||||||
|
|
||||||
return itemId == this.getEquip(core.material.items[itemId].equip.type);
|
return this.getEquip(core.material.items[itemId].equip.type) == itemId;
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 获得某个装备类型的当前装备 //////
|
////// 获得某个装备类型的当前装备 //////
|
||||||
@ -132,14 +142,13 @@ items.prototype.getEquip = function (equipType) {
|
|||||||
////// 设置某个物品的个数 //////
|
////// 设置某个物品的个数 //////
|
||||||
items.prototype.setItem = function (itemId, itemNum) {
|
items.prototype.setItem = function (itemId, itemNum) {
|
||||||
itemNum = itemNum || 0;
|
itemNum = itemNum || 0;
|
||||||
if (itemNum<=0) itemNum = 0;
|
|
||||||
var itemCls = core.material.items[itemId].cls;
|
var itemCls = core.material.items[itemId].cls;
|
||||||
if (itemCls == 'items') return;
|
if (itemCls == 'items') return;
|
||||||
if (!core.isset(core.status.hero.items[itemCls])) {
|
if (!core.isset(core.status.hero.items[itemCls])) {
|
||||||
core.status.hero.items[itemCls] = {};
|
core.status.hero.items[itemCls] = {};
|
||||||
}
|
}
|
||||||
core.status.hero.items[itemCls][itemId] = itemNum;
|
core.status.hero.items[itemCls][itemId] = itemNum;
|
||||||
if (itemCls!='keys' && itemNum==0) {
|
if (itemCls!='keys' && itemNum<=0) {
|
||||||
delete core.status.hero.items[itemCls][itemId];
|
delete core.status.hero.items[itemCls][itemId];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -189,10 +198,17 @@ items.prototype.loadEquip = function (equipId, callback) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var can = this.canEquip[equipId];
|
var can = this.canEquip[equipId];
|
||||||
if (core.isset(can) && !eval(can)) {
|
if (core.isset(can)) {
|
||||||
core.drawTip("当前不可换上"+loadEquip.name);
|
try {
|
||||||
if (core.isset(callback)) callback();
|
if (!eval(can)) {
|
||||||
return;
|
core.drawTip("当前不可换上"+loadEquip.name);
|
||||||
|
if (core.isset(callback)) callback();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (e) {
|
||||||
|
console.log(e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
core.playSound('equip.mp3');
|
core.playSound('equip.mp3');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user