Ski
This commit is contained in:
parent
4c76c467b3
commit
3b5f4c7c41
@ -625,8 +625,6 @@ control.prototype.moveAction = function (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.lastDirection = core.getHeroLoc('direction');
|
||||
if (canMove) core.events._trigger(core.nextX(), core.nextY());
|
||||
@ -643,8 +641,6 @@ control.prototype._moveAction_moving = function (callback) {
|
||||
core.setHeroMoveInterval(function () {
|
||||
var direction = core.getHeroLoc('direction');
|
||||
core.control._moveAction_popAutomaticRoute();
|
||||
if (core.status.event.id!='ski')
|
||||
core.status.route.push(direction);
|
||||
|
||||
// 无事件的道具(如血瓶)需要优先于阻激夹域判定
|
||||
var nowx = core.getHeroLoc('x'), nowy = core.getHeroLoc('y');
|
||||
@ -665,7 +661,7 @@ control.prototype._moveAction_moving = function (callback) {
|
||||
|
||||
// 检查该点是否是滑冰
|
||||
if (core.getBgFgNumber('bg') == 167) {
|
||||
core.insertAction("滑冰事件");
|
||||
core.insertAction("滑冰事件", null, null, null, true);
|
||||
}
|
||||
|
||||
if (callback) callback();
|
||||
|
||||
@ -194,7 +194,6 @@ function core() {
|
||||
},
|
||||
'curtainColor': null,
|
||||
'openingDoor': null,
|
||||
'isSkiing': false,
|
||||
|
||||
// 动画
|
||||
'globalAnimateObjs': [],
|
||||
|
||||
@ -264,14 +264,12 @@ events.prototype._trigger = function (x, y) {
|
||||
// 如果已经死亡,或正处于某事件中,则忽略
|
||||
if (core.status.gameOver || core.status.event.id) return;
|
||||
|
||||
core.status.isSkiing = false;
|
||||
var block = core.getBlock(x, y);
|
||||
if (block == null) return;
|
||||
block = block.block;
|
||||
if (block.event.trigger) {
|
||||
var noPass = block.event.noPass, trigger = block.event.trigger;
|
||||
if (noPass) core.clearAutomaticRouteNode(x, y);
|
||||
if (trigger == 'ski') core.status.isSkiing = true;
|
||||
|
||||
// 转换楼层能否穿透
|
||||
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) {
|
||||
this.ski();
|
||||
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();
|
||||
}
|
||||
})
|
||||
}
|
||||
core.insertAction(["V2.6后,请将滑冰放在背景层!"], data.x, data.y, 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.status.gameOver) return;
|
||||
|
||||
@ -828,7 +804,10 @@ events.prototype.insertAction = function (action, x, y, callback) {
|
||||
this.doEvents(action, x, y, callback);
|
||||
}
|
||||
else {
|
||||
core.unshift(core.status.event.data.list[0].todo, action);
|
||||
if (addToLast)
|
||||
core.push(core.status.event.data.list[0].todo, action)
|
||||
else
|
||||
core.unshift(core.status.event.data.list[0].todo, action);
|
||||
this.setEvents(null, x, y, callback);
|
||||
}
|
||||
}
|
||||
|
||||
@ -226,8 +226,8 @@ var events_c12a15a8_c380_4b28_8144_256cba95f760 =
|
||||
"condition": "core.getBgFgNumber('bg') == 167",
|
||||
"true": [
|
||||
{
|
||||
"type": "insert",
|
||||
"name": "滑冰事件"
|
||||
"type": "function",
|
||||
"function": "function(){\ncore.insertAction(\"滑冰事件\",null,null,null,true)\n}"
|
||||
}
|
||||
],
|
||||
"false": []
|
||||
|
||||
Loading…
Reference in New Issue
Block a user