Fix Replay Time

This commit is contained in:
oc 2018-01-25 02:29:29 +08:00
parent 32c9d58b65
commit 875fdc8be8
2 changed files with 18 additions and 12 deletions

View File

@ -3603,7 +3603,7 @@ core.prototype.replay = function () {
core.useItem(itemId, function () { core.useItem(itemId, function () {
core.replay(); core.replay();
}); });
}, 500); }, 1000);
} }
return; return;
} }
@ -3621,7 +3621,7 @@ core.prototype.replay = function () {
core.changeFloor(floorId, stair, null, null, function () { core.changeFloor(floorId, stair, null, null, function () {
core.replay(); core.replay();
}); });
}, 500); }, 1000);
return; return;
} }
} }
@ -3634,22 +3634,27 @@ core.prototype.replay = function () {
if (core.isset(shop) && shop.visited) { // 商店可用 if (core.isset(shop) && shop.visited) { // 商店可用
var choices = shop.choices; var choices = shop.choices;
var topIndex = 6 - parseInt(choices.length / 2); var topIndex = 6 - parseInt(choices.length / 2);
core.status.event.selection = parseInt(selections.shift());
core.events.openShop(shopId, false); core.events.openShop(shopId, false);
var shopInterval = setInterval(function () { var shopInterval = setInterval(function () {
if (!core.events.clickShop(6, topIndex+core.status.event.selection)) {
clearInterval(shopInterval);
core.stopReplay();
core.drawTip("录像文件出错");
return;
}
if (selections.length==0) { if (selections.length==0) {
clearInterval(shopInterval); clearInterval(shopInterval);
core.events.clickShop(6, topIndex+choices.length); core.events.clickShop(6, topIndex+choices.length);
core.replay(); core.replay();
return; return;
} }
var selection = parseInt(selections.shift()); core.status.event.selection = parseInt(selections.shift());
if (isNaN(selection) || selection<0 || selection>=choices.length || !core.events.clickShop(6, topIndex+selection)) { core.events.openShop(shopId, false);
clearInterval(shopInterval);
core.stopReplay(); }, 1000);
core.drawTip("录像文件出错");
return;
}
}, 500);
return; return;
} }
} }

View File

@ -286,7 +286,7 @@ events.prototype.doAction = function() {
core.status.event.data.type=data.type; core.status.event.data.type=data.type;
switch (data.type) { switch (data.type) {
case "text": // 文字/对话 case "text": // 文字/对话
if (core.status.replay.isreplaying) if (core.status.replay.replaying)
core.events.doAction(); core.events.doAction();
else else
core.ui.drawTextBox(data.data); core.ui.drawTextBox(data.data);
@ -377,6 +377,7 @@ events.prototype.doAction = function() {
case "openShop": // 打开一个全局商店 case "openShop": // 打开一个全局商店
if (core.status.replay.replaying) { // 正在播放录像简单将visited置为true if (core.status.replay.replaying) { // 正在播放录像简单将visited置为true
core.status.shops[data.id].visited=true; core.status.shops[data.id].visited=true;
core.status.event.data.list = [];
this.doAction(); this.doAction();
} }
else else
@ -477,7 +478,7 @@ events.prototype.doAction = function() {
core.status.route.push("choices:"+index); core.status.route.push("choices:"+index);
core.events.insertAction(data.choices[index].action); core.events.insertAction(data.choices[index].action);
core.events.doAction(); core.events.doAction();
}, 500) }, 1000)
} }
else { else {
core.stopReplay(); core.stopReplay();