0层楼传落点修改
MT5剧情法师移动采用复原RMbug
This commit is contained in:
parent
480bb33636
commit
17dccc8247
@ -1472,8 +1472,8 @@ main.floors.MT0=
|
|||||||
"autoEvent": {},
|
"autoEvent": {},
|
||||||
"canFlyFrom": true,
|
"canFlyFrom": true,
|
||||||
"flyPoint": [
|
"flyPoint": [
|
||||||
7,
|
6,
|
||||||
11
|
2
|
||||||
],
|
],
|
||||||
"downFloor": [
|
"downFloor": [
|
||||||
6,
|
6,
|
||||||
|
@ -94,75 +94,80 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a =
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
"changingFloor": function (floorId, heroLoc) {
|
"changingFloor": function (floorId, heroLoc) {
|
||||||
// 正在切换楼层过程中执行的操作;此函数的执行时间是“屏幕完全变黑“的那一刻
|
// 正在切换楼层过程中执行的操作;此函数的执行时间是“屏幕完全变黑“的那一刻
|
||||||
// floorId为要切换到的楼层ID;heroLoc表示勇士切换到的位置
|
// floorId为要切换到的楼层ID;heroLoc表示勇士切换到的位置
|
||||||
|
|
||||||
// ---------- 此时还没有进行切换,当前floorId还是原来的 ---------- //
|
// ---------- 此时还没有进行切换,当前floorId还是原来的 ---------- //
|
||||||
var currentId = core.status.floorId || null; // 获得当前的floorId,可能为null
|
var currentId = core.status.floorId || null; // 获得当前的floorId,可能为null
|
||||||
var fromLoad = core.hasFlag('__fromLoad__'); // 是否是读档造成的切换
|
var fromLoad = core.hasFlag('__fromLoad__'); // 是否是读档造成的切换
|
||||||
var isFlying = core.hasFlag('__isFlying__'); // 是否是楼传造成的切换
|
var isFlying = core.hasFlag('__isFlying__'); // 是否是楼传造成的切换
|
||||||
if (!fromLoad && !(isFlying && currentId == floorId)) {
|
if (!fromLoad && !(isFlying && currentId == floorId)) {
|
||||||
if (!core.hasFlag("__leaveLoc__")) core.setFlag("__leaveLoc__", {});
|
if (!core.hasFlag("__leaveLoc__")) core.setFlag("__leaveLoc__", {});
|
||||||
if (currentId != null) core.getFlag("__leaveLoc__")[currentId] = core.clone(core.status.hero.loc);
|
if (currentId != null) core.getFlag("__leaveLoc__")[currentId] = core.clone(core.status.hero.loc);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 可以对currentId进行判定,比如删除某些自定义图层等
|
||||||
|
// if (currentId == 'MT0') {
|
||||||
|
// core.deleteAllCanvas();
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 根据分区信息自动砍层与恢复
|
||||||
|
if (core.autoRemoveMaps) core.autoRemoveMaps(floorId);
|
||||||
|
|
||||||
|
// 重置画布尺寸
|
||||||
|
core.maps.resizeMap(floorId);
|
||||||
|
// 设置勇士的位置
|
||||||
|
heroLoc.direction = core.turnDirection(heroLoc.direction);
|
||||||
|
core.status.hero.loc = heroLoc;
|
||||||
|
if (!fromLoad && null == core.getBlock(heroLoc.x, heroLoc.y, floorId))
|
||||||
|
core.setHeroLoc('direction', core.turnDirection('down'), true);
|
||||||
|
// 检查重生怪并重置
|
||||||
|
if (!fromLoad) {
|
||||||
|
core.extractBlocks(floorId);
|
||||||
|
core.status.maps[floorId].blocks.forEach(function (block) {
|
||||||
|
if (block.disable && core.enemys.hasSpecial(block.event.id, 23)) {
|
||||||
|
block.disable = false;
|
||||||
|
core.setMapBlockDisabled(floorId, block.x, block.y, false);
|
||||||
|
core.maps._updateMapArray(floorId, block.x, block.y);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
core.control.gatherFollowers();
|
||||||
|
}
|
||||||
|
|
||||||
// 可以对currentId进行判定,比如删除某些自定义图层等
|
// ---------- 重绘新地图;这一步将会设置core.status.floorId ---------- //
|
||||||
// if (currentId == 'MT0') {
|
core.drawMap(floorId);
|
||||||
// core.deleteAllCanvas();
|
|
||||||
// }
|
|
||||||
|
|
||||||
// 根据分区信息自动砍层与恢复
|
// 切换楼层BGM
|
||||||
if (core.autoRemoveMaps) core.autoRemoveMaps(floorId);
|
if (core.status.maps[floorId].bgm) {
|
||||||
|
var bgm = core.status.maps[floorId].bgm;
|
||||||
|
if (bgm instanceof Array) bgm = bgm[Math.floor(Math.random() * bgm.length)]; // 多个bgm则随机播放一个
|
||||||
|
if (!core.hasFlag("__bgm__")) core.playBgm(bgm);
|
||||||
|
} else if (fromLoad && !core.hasFlag("__bgm__")) {
|
||||||
|
core.pauseBgm();
|
||||||
|
}
|
||||||
|
// 更改画面色调
|
||||||
|
var color = core.getFlag('__color__', null);
|
||||||
|
if (!color && core.status.maps[floorId].color)
|
||||||
|
color = core.status.maps[floorId].color;
|
||||||
|
core.clearMap('curtain');
|
||||||
|
core.status.curtainColor = color;
|
||||||
|
if (color) core.fillRect('curtain', 0, 0, core._PX_ || core.__PIXELS__, core._PY_ || core.__PIXELS__, core.arrayToRGBA(color));
|
||||||
|
// 更改天气
|
||||||
|
var weather = core.getFlag('__weather__', null);
|
||||||
|
if (!weather && core.status.maps[floorId].weather)
|
||||||
|
weather = core.status.maps[floorId].weather;
|
||||||
|
if (weather)
|
||||||
|
core.setWeather(weather[0], weather[1]);
|
||||||
|
else core.setWeather();
|
||||||
|
|
||||||
// 重置画布尺寸
|
// ...可以新增一些其他内容,比如创建个画布在右上角显示什么内容等等
|
||||||
core.maps.resizeMap(floorId);
|
|
||||||
// 设置勇士的位置
|
|
||||||
heroLoc.direction = core.turnDirection(heroLoc.direction);
|
|
||||||
core.status.hero.loc = heroLoc;
|
|
||||||
if (!fromLoad && null == core.getBlock(heroLoc.x, heroLoc.y, floorId))
|
|
||||||
core.setHeroLoc('direction', core.turnDirection('down'), true);
|
|
||||||
// 检查重生怪并重置
|
|
||||||
if (!fromLoad) {
|
|
||||||
core.extractBlocks(floorId);
|
|
||||||
core.status.maps[floorId].blocks.forEach(function (block) {
|
|
||||||
if (block.disable && core.enemys.hasSpecial(block.event.id, 23)) {
|
|
||||||
block.disable = false;
|
|
||||||
core.setMapBlockDisabled(floorId, block.x, block.y, false);
|
|
||||||
core.maps._updateMapArray(floorId, block.x, block.y);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
core.control.gatherFollowers();
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------- 重绘新地图;这一步将会设置core.status.floorId ---------- //
|
////复现RMbug,若5层法师移动且存在,则切换楼层后变回原位置
|
||||||
core.drawMap(floorId);
|
if (core.getBlockId(5, 1, 'MT5') === 'bluePriest') {
|
||||||
|
core.setBlock(217, 6, 1, 'MT5');
|
||||||
// 切换楼层BGM
|
core.setBlock(0, 5, 1, 'MT5')
|
||||||
if (core.status.maps[floorId].bgm) {
|
}
|
||||||
var bgm = core.status.maps[floorId].bgm;
|
},
|
||||||
if (bgm instanceof Array) bgm = bgm[Math.floor(Math.random() * bgm.length)]; // 多个bgm则随机播放一个
|
|
||||||
if (!core.hasFlag("__bgm__")) core.playBgm(bgm);
|
|
||||||
} else if (fromLoad && !core.hasFlag("__bgm__")) {
|
|
||||||
core.pauseBgm();
|
|
||||||
}
|
|
||||||
// 更改画面色调
|
|
||||||
var color = core.getFlag('__color__', null);
|
|
||||||
if (!color && core.status.maps[floorId].color)
|
|
||||||
color = core.status.maps[floorId].color;
|
|
||||||
core.clearMap('curtain');
|
|
||||||
core.status.curtainColor = color;
|
|
||||||
if (color) core.fillRect('curtain', 0, 0, core._PX_ || core.__PIXELS__, core._PY_ || core.__PIXELS__, core.arrayToRGBA(color));
|
|
||||||
// 更改天气
|
|
||||||
var weather = core.getFlag('__weather__', null);
|
|
||||||
if (!weather && core.status.maps[floorId].weather)
|
|
||||||
weather = core.status.maps[floorId].weather;
|
|
||||||
if (weather)
|
|
||||||
core.setWeather(weather[0], weather[1]);
|
|
||||||
else core.setWeather();
|
|
||||||
|
|
||||||
// ...可以新增一些其他内容,比如创建个画布在右上角显示什么内容等等
|
|
||||||
|
|
||||||
},
|
|
||||||
"afterChangeFloor": function (floorId) {
|
"afterChangeFloor": function (floorId) {
|
||||||
// 转换楼层结束的事件;此函数会在整个楼层切换完全结束后再执行
|
// 转换楼层结束的事件;此函数会在整个楼层切换完全结束后再执行
|
||||||
// floorId是切换到的楼层
|
// floorId是切换到的楼层
|
||||||
|
Loading…
Reference in New Issue
Block a user