This commit is contained in:
oc 2019-03-23 01:15:13 +08:00
parent 4c76c467b3
commit 3b5f4c7c41
4 changed files with 9 additions and 35 deletions

View File

@ -625,8 +625,6 @@ control.prototype.moveAction = function (callback) {
} }
control.prototype._moveAction_noPass = function (canMove, callback) { control.prototype._moveAction_noPass = function (canMove, callback) {
if (core.status.event.id!='ski')
core.status.route.push(core.getHeroLoc('direction'));
core.status.automaticRoute.moveStepBeforeStop = []; core.status.automaticRoute.moveStepBeforeStop = [];
core.status.automaticRoute.lastDirection = core.getHeroLoc('direction'); core.status.automaticRoute.lastDirection = core.getHeroLoc('direction');
if (canMove) core.events._trigger(core.nextX(), core.nextY()); if (canMove) core.events._trigger(core.nextX(), core.nextY());
@ -643,8 +641,6 @@ control.prototype._moveAction_moving = function (callback) {
core.setHeroMoveInterval(function () { core.setHeroMoveInterval(function () {
var direction = core.getHeroLoc('direction'); var direction = core.getHeroLoc('direction');
core.control._moveAction_popAutomaticRoute(); core.control._moveAction_popAutomaticRoute();
if (core.status.event.id!='ski')
core.status.route.push(direction);
// 无事件的道具(如血瓶)需要优先于阻激夹域判定 // 无事件的道具(如血瓶)需要优先于阻激夹域判定
var nowx = core.getHeroLoc('x'), nowy = core.getHeroLoc('y'); var nowx = core.getHeroLoc('x'), nowy = core.getHeroLoc('y');
@ -665,7 +661,7 @@ control.prototype._moveAction_moving = function (callback) {
// 检查该点是否是滑冰 // 检查该点是否是滑冰
if (core.getBgFgNumber('bg') == 167) { if (core.getBgFgNumber('bg') == 167) {
core.insertAction("滑冰事件"); core.insertAction("滑冰事件", null, null, null, true);
} }
if (callback) callback(); if (callback) callback();

View File

@ -194,7 +194,6 @@ function core() {
}, },
'curtainColor': null, 'curtainColor': null,
'openingDoor': null, 'openingDoor': null,
'isSkiing': false,
// 动画 // 动画
'globalAnimateObjs': [], 'globalAnimateObjs': [],

View File

@ -264,14 +264,12 @@ events.prototype._trigger = function (x, y) {
// 如果已经死亡,或正处于某事件中,则忽略 // 如果已经死亡,或正处于某事件中,则忽略
if (core.status.gameOver || core.status.event.id) return; if (core.status.gameOver || core.status.event.id) return;
core.status.isSkiing = false;
var block = core.getBlock(x, y); var block = core.getBlock(x, y);
if (block == null) return; if (block == null) return;
block = block.block; block = block.block;
if (block.event.trigger) { if (block.event.trigger) {
var noPass = block.event.noPass, trigger = block.event.trigger; var noPass = block.event.noPass, trigger = block.event.trigger;
if (noPass) core.clearAutomaticRouteNode(x, y); if (noPass) core.clearAutomaticRouteNode(x, y);
if (trigger == 'ski') core.status.isSkiing = true;
// 转换楼层能否穿透 // 转换楼层能否穿透
if (trigger == 'changeFloor' && !noPass && this._trigger_ignoreChangeFloor(block)) if (trigger == 'changeFloor' && !noPass && this._trigger_ignoreChangeFloor(block))
@ -668,29 +666,7 @@ events.prototype.afterChangeLight = function (x, y) {
} }
events.prototype._sys_ski = function (data, callback) { events.prototype._sys_ski = function (data, callback) {
this.ski(); core.insertAction(["V2.6后,请将滑冰放在背景层!"], data.x, data.y, callback);
if (callback) callback();
}
////// 滑冰 //////
events.prototype.ski = function (direction) {
if (!direction)
direction = core.status.automaticRoute.lastDirection || core.getHeroLoc('direction');
if (core.status.event.id != 'ski') {
core.waitHeroToStop(function () {
core.status.event.id = 'ski';
core.events.ski(direction);
});
}
else {
core.moveHero(direction, function () {
if (core.status.event.id == 'ski' && !core.status.isSkiing) {
core.status.event.id = null;
core.unLockControl();
core.replay();
}
})
}
} }
events.prototype._sys_action = function (data, callback) { events.prototype._sys_action = function (data, callback) {
@ -815,7 +791,7 @@ events.prototype._popEvents = function (current, prefix) {
} }
////// 往当前事件列表之前添加一个或多个事件 ////// ////// 往当前事件列表之前添加一个或多个事件 //////
events.prototype.insertAction = function (action, x, y, callback) { events.prototype.insertAction = function (action, x, y, callback, addToLast) {
if (core.hasFlag("__statistics__")) return; if (core.hasFlag("__statistics__")) return;
if (core.status.gameOver) return; if (core.status.gameOver) return;
@ -828,6 +804,9 @@ events.prototype.insertAction = function (action, x, y, callback) {
this.doEvents(action, x, y, callback); this.doEvents(action, x, y, callback);
} }
else { else {
if (addToLast)
core.push(core.status.event.data.list[0].todo, action)
else
core.unshift(core.status.event.data.list[0].todo, action); core.unshift(core.status.event.data.list[0].todo, action);
this.setEvents(null, x, y, callback); this.setEvents(null, x, y, callback);
} }

View File

@ -226,8 +226,8 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 =
"condition": "core.getBgFgNumber('bg') == 167", "condition": "core.getBgFgNumber('bg') == 167",
"true": [ "true": [
{ {
"type": "insert", "type": "function",
"name": "滑冰事件" "function": "function(){\ncore.insertAction(\"滑冰事件\",null,null,null,true)\n}"
} }
], ],
"false": [] "false": []