commit
80f29f8a00
@ -1954,15 +1954,9 @@ control.prototype.replay = function () {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else if (action=='getNext') {
|
else if (action=='getNext') {
|
||||||
if (core.flags.enableGentleClick && core.getBlock(core.nextX(), core.nextY())!=null) {
|
if (core.getNextItem()) {
|
||||||
var nextX = core.nextX(), nextY = core.nextY();
|
core.replay();
|
||||||
var block = core.getBlock(nextX, nextY);
|
return;
|
||||||
if (block!=null && block.block.event.trigger=='getItem') {
|
|
||||||
core.getItem(block.block.event.id, 1, nextX, nextY);
|
|
||||||
core.status.route.push("getNext");
|
|
||||||
core.replay();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (action.indexOf('move:')==0) {
|
else if (action.indexOf('move:')==0) {
|
||||||
@ -2862,7 +2856,7 @@ control.prototype.resize = function(clientWidth, clientHeight) {
|
|||||||
height:(canvasWidth - SPACE*2) + unit,
|
height:(canvasWidth - SPACE*2) + unit,
|
||||||
top: canvasTop + unit,
|
top: canvasTop + unit,
|
||||||
right: 0,
|
right: 0,
|
||||||
border: '3px #fff solid'
|
border: statusBarBorder
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -885,7 +885,7 @@ core.prototype.addItem = function (itemId, itemNum) {
|
|||||||
|
|
||||||
////// 获得面前的物品(轻按) //////
|
////// 获得面前的物品(轻按) //////
|
||||||
core.prototype.getNextItem = function() {
|
core.prototype.getNextItem = function() {
|
||||||
core.events.getNextItem();
|
return core.events.getNextItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 获得某个物品 //////
|
////// 获得某个物品 //////
|
||||||
|
|||||||
@ -1002,14 +1002,24 @@ events.prototype.insertAction = function (action, x, y, callback) {
|
|||||||
|
|
||||||
////// 获得面前的物品(轻按) //////
|
////// 获得面前的物品(轻按) //////
|
||||||
events.prototype.getNextItem = function() {
|
events.prototype.getNextItem = function() {
|
||||||
if (!core.status.heroStop || !core.flags.enableGentleClick) return;
|
if (!core.status.heroStop || !core.flags.enableGentleClick) return false;
|
||||||
|
// 检查cannotMove
|
||||||
|
var x = core.getHeroLoc('x'), y=core.getHeroLoc('y'), direction=core.getHeroLoc('direction');
|
||||||
|
if (core.isset(core.floors[core.status.floorId].cannotMove)) {
|
||||||
|
var cannotMove = core.floors[core.status.floorId].cannotMove[x+","+y];
|
||||||
|
if (core.isset(cannotMove) && cannotMove instanceof Array && cannotMove.indexOf(direction)>=0)
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
var nextX = core.nextX(), nextY = core.nextY();
|
var nextX = core.nextX(), nextY = core.nextY();
|
||||||
var block = core.getBlock(nextX, nextY);
|
var block = core.getBlock(nextX, nextY);
|
||||||
if (block==null) return;
|
if (block==null) return false;
|
||||||
if (block.block.event.trigger=='getItem') {
|
if (block.block.event.trigger=='getItem') {
|
||||||
core.getItem(block.block.event.id, 1, nextX, nextY);
|
core.getItem(block.block.event.id, 1, nextX, nextY);
|
||||||
core.status.route.push("getNext");
|
core.status.route.push("getNext");
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
////// 获得某个物品 //////
|
////// 获得某个物品 //////
|
||||||
|
|||||||
@ -310,11 +310,17 @@ maps.prototype.canMoveDirectly = function (destX,destY) {
|
|||||||
visited[fromX+core.bigmap.width*fromY]=0;
|
visited[fromX+core.bigmap.width*fromY]=0;
|
||||||
queue.push(fromX+core.bigmap.width*fromY);
|
queue.push(fromX+core.bigmap.width*fromY);
|
||||||
|
|
||||||
var directions = [[-1,0],[1,0],[0,1],[0,-1]];
|
var directions = {
|
||||||
|
"left": [-1,0],
|
||||||
|
"up": [0,-1],
|
||||||
|
"right": [1,0],
|
||||||
|
"down": [0,1]
|
||||||
|
}
|
||||||
while (queue.length>0) {
|
while (queue.length>0) {
|
||||||
var now=queue.shift(), nowX=parseInt(now%core.bigmap.width), nowY=parseInt(now/core.bigmap.width);
|
var now=queue.shift(), nowX=parseInt(now%core.bigmap.width), nowY=parseInt(now/core.bigmap.width);
|
||||||
|
|
||||||
for (var dir in directions) {
|
for (var dir in directions) {
|
||||||
|
if (!core.canMoveHero(nowX, nowY, dir)) continue;
|
||||||
var nx=nowX+directions[dir][0], ny=nowY+directions[dir][1];
|
var nx=nowX+directions[dir][0], ny=nowY+directions[dir][1];
|
||||||
if (nx<0||nx>=core.bigmap.width||ny<0||ny>=core.bigmap.height||visited[nx+core.bigmap.width*ny]||core.getBlock(nx,ny)!=null||core.status.checkBlock.damage[nx+core.bigmap.width*ny]>0) continue;
|
if (nx<0||nx>=core.bigmap.width||ny<0||ny>=core.bigmap.height||visited[nx+core.bigmap.width*ny]||core.getBlock(nx,ny)!=null||core.status.checkBlock.damage[nx+core.bigmap.width*ny]>0) continue;
|
||||||
visited[nx+core.bigmap.width*ny]=visited[nowX+core.bigmap.width*nowY]+1;
|
visited[nx+core.bigmap.width*ny]=visited[nowX+core.bigmap.width*nowY]+1;
|
||||||
|
|||||||
@ -1459,7 +1459,7 @@ ui.prototype.drawBookDetail = function (index) {
|
|||||||
core.setAlpha('data', 0.9);
|
core.setAlpha('data', 0.9);
|
||||||
core.fillRect('data', left, top, right, bottom, '#000000');
|
core.fillRect('data', left, top, right, bottom, '#000000');
|
||||||
core.setAlpha('data', 1);
|
core.setAlpha('data', 1);
|
||||||
core.strokeRect('data', left - 1, top - 1, right + 1, bottom + 1, '#FFFFFF', 2);
|
core.strokeRect('data', left - 1, top - 1, right + 1, bottom + 1, main.borderColor||"#FFFFFF", 2);
|
||||||
|
|
||||||
// 名称
|
// 名称
|
||||||
core.canvas.data.textAlign = "left";
|
core.canvas.data.textAlign = "left";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user