Deploying to gh-pages from @ ae3d62211e 🚀

This commit is contained in:
unanmed committed 2023-01-04 08:25:31 +00:00
1 parent 13f055451d
commit 9fe9888e13
18 files changed
+650 -965

No files matched your search

+8 -2
View File
@@ -139,6 +139,12 @@ main.floors.tower1=
],
"time": 500
}
],
"13,1": [
{
"type": "function",
"function": "function(){\nconsole.trace()\n}"
}
]
},
"afterBattle": {},
@@ -220,14 +226,14 @@ main.floors.tower1=
"0,7": {
"floorId": "tower6",
"loc": [
18,
24,
58
]
},
"14,7": {
"floorId": "tower6",
"loc": [
6,
12,
58
]
},
+1 -1
View File
@@ -72,7 +72,7 @@ main.floors.tower2=
"7,14": {
"floorId": "tower6",
"loc": [
12,
18,
42
]
},
+81 -69
View File
@@ -1,74 +1,86 @@
main.floors.tower4 = {
floorId: 'tower4',
title: '智慧之塔',
name: '4',
width: 15,
height: 15,
canFlyTo: true,
canFlyFrom: true,
canUseQuickShop: true,
cannotViewMap: false,
images: [],
ratio: 2,
defaultGround: 'T526',
bgm: 'tower.mp3',
firstArrive: [],
eachArrive: [],
parallelDo: '',
events: {},
afterBattle: {},
afterGetItem: {},
afterOpenDoor: {},
autoEvent: {},
cannotMove: {},
map: [
[
527, 527, 527, 527, 527, 527, 527, 543, 527, 527, 527, 527, 527,
527, 527
],
[527, 31, 31, 536, 0, 528, 0, 547, 0, 31, 0, 544, 0, 381, 527],
[527, 31, 31, 528, 28, 492, 29, 528, 528, 0, 28, 528, 0, 528, 527],
[527, 528, 528, 528, 0, 528, 28, 34, 492, 492, 528, 528, 547, 0, 527],
[527, 381, 0, 550, 0, 528, 528, 528, 528, 0, 31, 528, 0, 528, 527],
[527, 0, 528, 0, 528, 528, 31, 0, 536, 27, 0, 556, 381, 378, 527],
[527, 0, 528, 27, 0, 544, 0, 403, 0, 528, 528, 0, 528, 528, 527],
[
527, 550, 528, 528, 528, 528, 492, 528, 550, 528, 34, 381, 556, 376,
527
],
[527, 0, 0, 31, 492, 88, 403, 528, 31, 528, 27, 32, 528, 0, 527],
[527, 528, 528, 0, 528, 403, 34, 547, 0, 492, 492, 528, 528, 556, 527],
[527, 0, 528, 546, 528, 528, 546, 528, 528, 528, 0, 28, 0, 0, 527],
[527, 0, 544, 32, 0, 536, 32, 528, 32, 0, 536, 528, 528, 556, 527],
[527, 27, 492, 0, 27, 528, 27, 492, 0, 528, 528, 528, 0, 0, 527],
[527, 31, 528, 32, 0, 528, 32, 546, 0, 494, 87, 381, 28, 0, 527],
[
527, 527, 527, 527, 527, 527, 527, 540, 527, 527, 527, 527, 527,
527, 527
]
],
beforeBattle: {},
bgmap: [],
fgmap: [],
bg2map: [],
fg2map: [],
cannotMoveIn: {},
changeFloor: {
'5,8': {
floorId: 'tower3',
loc: [5, 8]
main.floors.tower4=
{
"floorId": "tower4",
"title": "智慧之塔",
"name": "4",
"width": 15,
"height": 15,
"canFlyTo": true,
"canFlyFrom": true,
"canUseQuickShop": true,
"cannotViewMap": false,
"images": [],
"ratio": 2,
"defaultGround": "T526",
"bgm": "tower.mp3",
"firstArrive": [],
"eachArrive": [],
"parallelDo": "",
"events": {},
"afterBattle": {},
"afterGetItem": {},
"afterOpenDoor": {},
"autoEvent": {},
"cannotMove": {},
"map": [
[527,527,527,527,527,527,527,543,527,527,527,527,527,527,527],
[527, 31, 31,536, 0,528, 0,547, 0, 31, 0,544, 0,381,527],
[527, 31, 31,528, 28,492, 29,528,528, 0, 28,528, 0,528,527],
[527,528,528,528, 0,528, 28, 34,492,492,528,528,547, 0,527],
[527,381, 0,550, 0,528,528,528,528, 0, 31,528, 0,528,527],
[527, 0,528, 0,528,528, 31, 0,536, 27, 0,556,381,378,527],
[527, 0,528, 27, 0,544, 0,403, 0,528,528, 0,528,528,527],
[527,550,528,528,528,528,492,528,550,528, 34,381,556,376,527],
[527, 0, 0, 31,492, 88,403,528, 31,528, 27, 32,528, 0,527],
[527,528,528, 0,528,403, 34,547, 0,492,492,528,528,556,527],
[527, 0,528,546,528,528,546,528,528,528, 0, 28, 0, 0,527],
[527, 0,544, 32, 0,536, 32,528, 32, 0,536,528,528,556,527],
[527, 27,492, 0, 27,528, 27,492, 0,528,528,528, 0, 0,527],
[527, 31,528, 32, 0,528, 32,546, 0,494, 87,381, 28, 0,527],
[527,527,527,527,527,527,527,540,527,527,527,527,527,527,527]
],
"beforeBattle": {},
"bgmap": [
],
"fgmap": [
],
"bg2map": [
],
"fg2map": [
],
"cannotMoveIn": {},
"changeFloor": {
"5,8": {
"floorId": "tower3",
"loc": [
5,
8
]
},
'7,0': {
floorId: 'tower6',
loc: [1, 15]
"7,0": {
"floorId": "tower6",
"loc": [
7,
15
]
},
'7,14': {
floorId: 'tower6',
loc: [12, 15]
"7,14": {
"floorId": "tower6",
"loc": [
18,
15
]
},
'10,13': {
floorId: 'tower5',
loc: [10, 13]
"10,13": {
"floorId": "tower5",
"loc": [
10,
13
]
}
}
};
}
+1 -1
View File
@@ -79,7 +79,7 @@ main.floors.tower5=
"14,7": {
"floorId": "tower6",
"loc": [
18,
24,
2
]
},
+263 -846
View File
File diff suppressed because it is too large. Load diff
+7 -13
View File
@@ -148,9 +148,9 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
heroLoc.direction = core.turnDirection(heroLoc.direction);
core.status.hero.loc = heroLoc;
// tower6
if (floorId == 'tower6') {
core.relocateLoopMap(floorId, heroLoc);
}
// if (floorId == 'tower6') {
// core.relocateLoopMap(floorId, heroLoc);
// }
// 检查重生怪并重置
if (!fromLoad) {
core.extractBlocks(floorId);
@@ -174,11 +174,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
// ---------- 重绘新地图;这一步将会设置core.status.floorId ---------- //
core.drawMap(floorId);
if (floorId == 'tower6') core.backgroundImage('tower6.jpeg');
else {
core.deleteCanvas('bImage');
core.deleteCanvas('eImage');
}
// 切换楼层BGM
if (core.status.maps[floorId].bgm) {
@@ -186,9 +181,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
if (bgm instanceof Array) bgm = bgm[0];
if (!core.hasFlag('__bgm__')) core.playBgm(bgm);
}
// if (flags.chase && fromLoad) {
// core.startChase();
// }
// 更改画面色调
var color = core.getFlag('__color__', null);
if (!color && core.status.maps[floorId].color)
@@ -200,8 +192,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
'curtain',
0,
0,
core.__PIXELS__,
core.__PIXELS__,
core._PX_,
core._PY_,
core.arrayToRGBA(color)
);
// 更改天气
@@ -1773,6 +1765,8 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
);
}
core.checkLoopMap();
// 追猎
if (core.status.checkBlock.haveHunt) {
var x = core.status.hero.loc.x,
+251
View File
@@ -3684,6 +3684,7 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
};
control.prototype.updateStatusBar_update = function () {
core.control.updateNextFrame = false;
if (!core.isPlaying() || core.hasFlag('__statistics__')) return;
core.control.controldata.updateStatusBar();
if (!core.control.noAutoEvents) core.checkAutoEvents();
@@ -4028,5 +4029,255 @@ var plugins_bb40132b_638b_4a9f_b028_d3fe47acc8d1 = {
this.loadSkillTree = function (data) {
levels = data ?? [];
};
},
loopMap: function () {
const list = (this.loopMapList = ['tower6']);
/**
* 设置循环地图的偏移量
* @param {number} offset 横向偏移量
* @param {FloorIds} floorId
*/
this.setLoopMap = function (offset, floorId) {
const floor = core.status.maps[floorId];
if (offset < 9) {
moveMap(floor.width - 17, floorId);
}
if (offset > floor.width - 9) {
moveMap(17 - floor.width, floorId);
}
};
/**
* 当勇士移动时自动设置循环地图
* @param {FloorIds} floorId
*/
this.autoSetLoopMap = function (floorId) {
this.setLoopMap(core.status.hero.loc.x, floorId);
};
this.checkLoopMap = function () {
if (isLoopMap(core.status.floorId)) {
this.autoSetLoopMap(core.status.floorId);
}
};
/**
* 滑动数组
* @param {any[]} arr
* @param {number} delta
*/
this.slide = function (arr, delta) {
if (delta === 0) return arr;
if (delta > 0) {
arr.unshift(...arr.splice(arr.length - delta, delta));
return arr;
}
if (delta < 0) {
arr.push(...arr.splice(0, -delta));
return arr;
}
};
/**
* 移动地图
* @param {number} delta
* @param {FloorIds} floorId
*/
function moveMap(delta, floorId) {
core.extractBlocks(floorId);
const floor = core.status.maps[floorId];
core.setHeroLoc('x', core.status.hero.loc.x + delta);
flags[`loop_${floorId}`] += delta;
flags[`loop_${floorId}`] %= floor.width;
const origin = floor.blocks.slice();
for (let i = 0; i < origin.length; i++) {
core.removeBlockByIndex(0, floorId);
core.removeGlobalAnimate(origin[i].x, origin[i].y);
}
origin.forEach(v => {
let to = v.x + delta;
if (to >= floor.width) to -= floor.width;
if (to < 0) to += floor.width;
core.setBlock(v.id, to, v.y, floorId, true);
core.setMapBlockDisabled(floorId, to, v.y, false);
});
core.drawMap();
core.drawHero();
}
function isLoopMap(floorId) {
return list.includes(floorId);
}
events.prototype._sys_changeFloor = function (data, callback) {
data = data.event.data;
let heroLoc = {};
if (isLoopMap(data.floorId)) {
const floor = core.status.maps[data.floorId];
flags[`loop_${data.floorId}`] ??= 0;
let tx = data.loc[0] + flags[`loop_${data.floorId}`];
tx %= floor.width;
if (tx < 0) tx += floor.width;
console.log(data.loc[0], tx);
heroLoc = {
x: tx,
y: data.loc[1]
};
} else if (data.loc) heroLoc = { x: data.loc[0], y: data.loc[1] };
if (data.direction) heroLoc.direction = data.direction;
if (core.status.event.id != 'action') core.status.event.id = null;
core.changeFloor(
data.floorId,
data.stair,
heroLoc,
data.time,
function () {
core.replay();
if (callback) callback();
}
);
};
events.prototype.trigger = function (x, y, callback) {
var _executeCallback = function () {
// 因为trigger之后还有可能触发其他同步脚本(比如阻激夹域检测)
// 所以这里强制callback被异步触发
if (callback) {
setTimeout(callback, 1); // +1是为了录像检测系统
}
return;
};
if (core.status.gameOver) return _executeCallback();
if (core.status.event.id == 'action') {
core.insertAction(
{
type: 'function',
function:
'function () { core.events._trigger_inAction(' +
x +
',' +
y +
'); }',
async: true
},
null,
null,
null,
true
);
return _executeCallback();
}
if (core.status.event.id) return _executeCallback();
let block = core.getBlock(x, y);
const id = core.status.floorId;
const loop = isLoopMap(id);
if (loop) {
if (block && block.event.trigger === 'changeFloor') {
delete block.event.trigger;
core.maps._addInfo(block);
} else {
const floor = core.status.maps[id];
let tx = x - flags[`loop_${id}`];
tx %= floor.width;
if (tx < 0) tx += floor.width;
const c = core.floors[id].changeFloor[`${tx},${y}`];
if (c) {
const b = { event: {}, x: tx, y };
b.event.data = c;
b.event.trigger = 'changeFloor';
block = b;
}
}
}
if (block == null) return _executeCallback();
// 执行该点的脚本
if (block.event.script) {
core.clearRouteFolding();
try {
eval(block.event.script);
} catch (ee) {
console.error(ee);
}
}
// 碰触事件
if (block.event.event) {
core.clearRouteFolding();
core.insertAction(block.event.event, block.x, block.y);
// 不再执行该点的系统事件
return _executeCallback();
}
if (block.event.trigger && block.event.trigger != 'null') {
var noPass = block.event.noPass,
trigger = block.event.trigger;
if (noPass) core.clearAutomaticRouteNode(x, y);
// 转换楼层能否穿透
if (
trigger == 'changeFloor' &&
!noPass &&
this._trigger_ignoreChangeFloor(block) &&
!loop
)
return _executeCallback();
core.status.automaticRoute.moveDirectly = false;
this.doSystemEvent(trigger, block);
}
return _executeCallback();
};
maps.prototype._getBgFgMapArray = function (name, floorId, noCache) {
floorId = floorId || core.status.floorId;
if (!floorId) return [];
var width = core.floors[floorId].width;
var height = core.floors[floorId].height;
if (!noCache && core.status[name + 'maps'][floorId])
return core.status[name + 'maps'][floorId];
var arr =
main.mode == 'editor' &&
!(window.editor && editor.uievent && editor.uievent.isOpen)
? core.cloneArray(editor[name + 'map'])
: null;
if (arr == null)
arr = core.cloneArray(core.floors[floorId][name + 'map'] || []);
if (isLoopMap(floorId) && window.flags) {
flags[`loop_${floorId}`] ??= 0;
arr.forEach(v => {
core.slide(v, flags[`loop_${floorId}`] % width);
});
}
for (var y = 0; y < height; ++y) {
if (arr[y] == null) arr[y] = Array(width).fill(0);
}
(core.getFlag('__' + name + 'v__', {})[floorId] || []).forEach(
function (one) {
arr[one[1]][one[0]] = one[2] || 0;
}
);
(core.getFlag('__' + name + 'd__', {})[floorId] || []).forEach(
function (one) {
arr[one[1]][one[0]] = 0;
}
);
if (main.mode == 'editor') {
for (var x = 0; x < width; x++) {
for (var y = 0; y < height; y++) {
arr[y][x] = arr[y][x].idnum || arr[y][x] || 0;
}
}
}
if (core.status[name + 'maps'])
core.status[name + 'maps'][floorId] = arr;
return arr;
};
}
};