二区的二区

This commit is contained in:
AncTe committed 2023-01-15 20:09:02 +08:00
1 parent cb0e6cb98e
commit 5f48eef6af
60 files changed
+2739 -1418

No files matched your search

+2 -1
View File
@@ -373,7 +373,8 @@
"<br>",
"<br>",
"对于电脑端,最右侧是当前选中的地图的缩略图,手机则在下方,点击缩略图也可以传送。缩略图的下方是当前选中的地图名,",
"左右各有两个按钮,表示后退10层、后退1层、前进1层、前进10层,与样板的楼传的按钮功能类似。",
"左右各有两个按钮,表示后退10层、后退1层、前进1层、前进10层,与样板的楼传的按钮功能类似,对于小地图无法显示的单层,",
"可以使用该功能到达。",
"<br>",
"<br>",
"最下方是设置按钮,可以切换无边框模式,电脑端还可以切换传统按键模式,传统按键模式下按键遵循样板的楼传按键方式。",
-64
View File
@@ -204,67 +204,3 @@ export function getMapData(
return (bfsCache[floorId] = res);
}
/**
* 绘制小地图
* @param ctx 画布
* @param floorId 中心楼层
* @param interval 楼层间距
* @param border 边框粗细
* @param noCache 是否不使用缓存
*/
export function drawFlyMap(
ctx: CanvasRenderingContext2D,
floorId: FloorIds,
offset: [number, number],
size: [number, number],
scale: number = 3,
interval: number = 5,
border: number = 1,
noCache: boolean = false
) {
const data = getMapDrawData(floorId, interval, border, noCache);
const [ox, oy] = offset;
const [width, height] = size;
const canvas = ctx.canvas;
canvas.width = data.width * devicePixelRatio * scale;
canvas.height = data.height * devicePixelRatio * scale;
ctx.lineWidth = border * devicePixelRatio * scale;
ctx.strokeStyle = '#fff';
ctx.scale(scale, scale);
// 绘制连线
data.line.forEach(([x1, y1, x2, y2]) => {
ctx.beginPath();
ctx.moveTo(x1, y1);
ctx.lineTo(x2, y2);
ctx.stroke();
});
for (const [id, [x, y]] of Object.entries(data.locs) as [
FloorIds,
LocArr
][]) {
drawThumbnail(ctx, id, scale, [x, y], offset, size);
}
}
function drawThumbnail(
ctx: CanvasRenderingContext2D,
floorId: FloorIds,
scale: number,
pos: [number, number],
offset: [number, number],
size: [number, number]
) {
const [x, y] = pos;
const [ox, oy] = offset;
const [width, height] = size;
const map = core.status.maps[floorId];
if (
ox + x * scale + (map.width * scale) / 2 < 0 ||
ox + x * scale - (map.width * scale) / 2 > width ||
oy + y * scale + (map.height * scale) / 2 < 0 ||
oy + y * scale - (map.height * scale) / 2 > height
) {
return;
}
}
+1
View File
@@ -80,6 +80,7 @@ export default function init() {
async function showApp() {
core.lockControl();
if (transition.value) {
app.style.transition = 'all 0.6s linear';
} else {
+10
View File
@@ -153,3 +153,13 @@ export function splitText(str: string[]) {
})
.join('');
}
/**
* 在下一帧执行某个函数
* @param cb 执行的函数
*/
export function nextFrame(cb: (time: number) => void) {
requestAnimationFrame(() => {
requestAnimationFrame(cb);
});
}
+48
View File
@@ -117,6 +117,7 @@ interface IdToCls {
autotile8: 'autotile';
autotile9: 'autotile';
autotile10: 'autotile';
autotile11: 'autotile';
autotile1: 'autotile';
autotile2: 'autotile';
autotile3: 'autotile';
@@ -541,11 +542,47 @@ interface IdToCls {
E612: 'enemys';
E613: 'enemys';
E614: 'enemys';
E615: 'enemys';
E616: 'enemys';
E617: 'enemys';
E618: 'enemys';
N619: 'npcs';
N620: 'npcs';
N621: 'npcs';
N622: 'npcs';
N623: 'npcs';
N624: 'npcs';
N625: 'npcs';
N626: 'npcs';
T627: 'terrains';
T628: 'terrains';
T629: 'terrains';
N630: 'npc48';
N631: 'npc48';
N632: 'npc48';
N633: 'npc48';
N634: 'npc48';
N635: 'npc48';
N636: 'npc48';
N637: 'npc48';
N638: 'npc48';
N639: 'npc48';
T640: 'terrains';
I641: 'items';
X20032: 'tileset';
X20033: 'tileset';
X20034: 'tileset';
X20037: 'tileset';
X20038: 'tileset';
X20039: 'tileset';
X20040: 'tileset';
X20041: 'tileset';
X20042: 'tileset';
X20045: 'tileset';
X20047: 'tileset';
X20048: 'tileset';
X20049: 'tileset';
X20050: 'tileset';
X20053: 'tileset';
X20054: 'tileset';
X20055: 'tileset';
@@ -572,6 +609,7 @@ interface IdToCls {
X30121: 'tileset';
X30196: 'tileset';
X30204: 'tileset';
X70019: 'tileset';
X70048: 'tileset';
X70049: 'tileset';
X70050: 'tileset';
@@ -580,8 +618,15 @@ interface IdToCls {
X70064: 'tileset';
X70065: 'tileset';
X70066: 'tileset';
X70072: 'tileset';
X70073: 'tileset';
X70074: 'tileset';
X70080: 'tileset';
X70081: 'tileset';
X70082: 'tileset';
X70112: 'tileset';
X70114: 'tileset';
X70116: 'tileset';
X70120: 'tileset';
X70122: 'tileset';
X70128: 'tileset';
@@ -592,4 +637,7 @@ interface IdToCls {
X70200: 'tileset';
X70201: 'tileset';
X70202: 'tileset';
X90153: 'tileset';
X90154: 'tileset';
X90155: 'tileset';
}
+8
View File
@@ -54,6 +54,13 @@ type FloorIds =
| 'MT43'
| 'MT44'
| 'MT45'
| 'snowTown'
| 'snowShop'
| 'MT46'
| 'MT47'
| 'MT48'
| 'MT49'
| 'MT50'
type ImageIds =
| 'IQ.png'
@@ -136,6 +143,7 @@ type SoundIds =
| 'cursor.mp3'
| 'danger.mp3'
| 'door.mp3'
| 'drink.mp3'
| 'electron.mp3'
| 'equip.mp3'
| 'error.mp3'
+1
View File
@@ -185,4 +185,5 @@ interface ItemDeclaration {
I574: 'items';
I575: 'equips';
I589: 'equips';
I641: 'equips';
}
+96
View File
@@ -117,6 +117,7 @@ interface IdToNumber {
autotile8: 145;
autotile9: 146;
autotile10: 147;
autotile11: 148;
autotile1: 151;
autotile2: 152;
autotile3: 153;
@@ -541,11 +542,47 @@ interface IdToNumber {
E612: 612;
E613: 613;
E614: 614;
E615: 615;
E616: 616;
E617: 617;
E618: 618;
N619: 619;
N620: 620;
N621: 621;
N622: 622;
N623: 623;
N624: 624;
N625: 625;
N626: 626;
T627: 627;
T628: 628;
T629: 629;
N630: 630;
N631: 631;
N632: 632;
N633: 633;
N634: 634;
N635: 635;
N636: 636;
N637: 637;
N638: 638;
N639: 639;
T640: 640;
I641: 641;
X20032: 20032;
X20033: 20033;
X20034: 20034;
X20037: 20037;
X20038: 20038;
X20039: 20039;
X20040: 20040;
X20041: 20041;
X20042: 20042;
X20045: 20045;
X20047: 20047;
X20048: 20048;
X20049: 20049;
X20050: 20050;
X20053: 20053;
X20054: 20054;
X20055: 20055;
@@ -572,6 +609,7 @@ interface IdToNumber {
X30121: 30121;
X30196: 30196;
X30204: 30204;
X70019: 70019;
X70048: 70048;
X70049: 70049;
X70050: 70050;
@@ -580,8 +618,15 @@ interface IdToNumber {
X70064: 70064;
X70065: 70065;
X70066: 70066;
X70072: 70072;
X70073: 70073;
X70074: 70074;
X70080: 70080;
X70081: 70081;
X70082: 70082;
X70112: 70112;
X70114: 70114;
X70116: 70116;
X70120: 70120;
X70122: 70122;
X70128: 70128;
@@ -592,6 +637,9 @@ interface IdToNumber {
X70200: 70200;
X70201: 70201;
X70202: 70202;
X90153: 90153;
X90154: 90154;
X90155: 90155;
}
interface NumberToId {
1: 'yellowWall';
@@ -712,6 +760,7 @@ interface NumberToId {
145: 'autotile8';
146: 'autotile9';
147: 'autotile10';
148: 'autotile11';
151: 'autotile1';
152: 'autotile2';
153: 'autotile3';
@@ -1136,11 +1185,47 @@ interface NumberToId {
612: 'E612';
613: 'E613';
614: 'E614';
615: 'E615';
616: 'E616';
617: 'E617';
618: 'E618';
619: 'N619';
620: 'N620';
621: 'N621';
622: 'N622';
623: 'N623';
624: 'N624';
625: 'N625';
626: 'N626';
627: 'T627';
628: 'T628';
629: 'T629';
630: 'N630';
631: 'N631';
632: 'N632';
633: 'N633';
634: 'N634';
635: 'N635';
636: 'N636';
637: 'N637';
638: 'N638';
639: 'N639';
640: 'T640';
641: 'I641';
20032: 'X20032';
20033: 'X20033';
20034: 'X20034';
20037: 'X20037';
20038: 'X20038';
20039: 'X20039';
20040: 'X20040';
20041: 'X20041';
20042: 'X20042';
20045: 'X20045';
20047: 'X20047';
20048: 'X20048';
20049: 'X20049';
20050: 'X20050';
20053: 'X20053';
20054: 'X20054';
20055: 'X20055';
@@ -1167,6 +1252,7 @@ interface NumberToId {
30121: 'X30121';
30196: 'X30196';
30204: 'X30204';
70019: 'X70019';
70048: 'X70048';
70049: 'X70049';
70050: 'X70050';
@@ -1175,8 +1261,15 @@ interface NumberToId {
70064: 'X70064';
70065: 'X70065';
70066: 'X70066';
70072: 'X70072';
70073: 'X70073';
70074: 'X70074';
70080: 'X70080';
70081: 'X70081';
70082: 'X70082';
70112: 'X70112';
70114: 'X70114';
70116: 'X70116';
70120: 'X70120';
70122: 'X70122';
70128: 'X70128';
@@ -1187,4 +1280,7 @@ interface NumberToId {
70200: 'X70200';
70201: 'X70201';
70202: 'X70202';
90153: 'X90153';
90154: 'X90154';
90155: 'X90155';
}
+6 -2
View File
@@ -26,7 +26,7 @@
<span
class="attr-value"
:style="{ color: attrColor[i] }"
>{{ enemy[a] }}</span
>{{ format(enemy[a] as number) }}</span
>
</div>
</div>
@@ -40,10 +40,14 @@ import { onMounted, onUpdated, ref, watch } from 'vue';
import Box from '../components/box.vue';
import { showFixed } from '../plugin/ui/fixed';
watch(showFixed, calHeight);
watch(showFixed, n => {
if (n) calHeight();
});
let main: HTMLDivElement;
const format = core.formatBigNumber;
const toShowAttrs: (keyof DetailedEnemy)[] = [
'hp',
'atk',
+1 -9
View File
@@ -445,6 +445,7 @@ function changeFloorByDelta(delta: number) {
while (to !== now) {
to += Math.sign(delta);
const floor = core.status.maps[core.floorIds[to]];
if (floor.cannotViewMap) continue;
if (!floor.deleted && !floor.forceDelete) break;
if (to < 0 || to >= core.floorIds.length) break;
}
@@ -546,8 +547,6 @@ onMounted(async () => {
thumb = document.getElementById('fly-thumbnail') as HTMLCanvasElement;
thumbCtx = thumb.getContext('2d')!;
const antiAliasing = core.getLocalStorage('antiAliasing', true);
const mapStyle = getComputedStyle(map);
const thumbStyle = getComputedStyle(thumb);
map.width = parseFloat(mapStyle.width) * devicePixelRatio;
@@ -555,13 +554,6 @@ onMounted(async () => {
thumb.width = parseFloat(thumbStyle.width) * devicePixelRatio;
thumb.height = parseFloat(thumbStyle.width) * devicePixelRatio;
if (!antiAliasing) {
requestAnimationFrame(() => {
thumb.classList.add('no-anti-aliasing');
thumbCtx.imageSmoothingEnabled = false;
});
}
Array.from(document.getElementsByClassName('fly-settings')).forEach(v => {
v.addEventListener('click', e => (v as HTMLElement).blur());
});
+13 -19
View File
@@ -108,6 +108,18 @@ const descText = computed(() => {
return splitText(settingInfo[selected.value].desc);
});
const settings: Record<keyof Settings, Ref<boolean>> = {
transition,
itemDetail,
autoSkill,
autoScale,
showHalo,
showStudied,
useFixed,
autoLocate,
antiAliasing
};
function exit() {
core.plugin.settingsOpened.value = false;
}
@@ -117,25 +129,7 @@ function click(id: keyof Settings) {
selected.value = id;
return;
}
if (id === 'transition') {
transition.value = !transition.value;
} else if (id === 'itemDetail') {
itemDetail.value = !itemDetail.value;
} else if (id === 'autoSkill') {
autoSkill.value = !autoSkill.value;
} else if (id === 'autoScale') {
autoScale.value = !autoScale.value;
} else if (id === 'showHalo') {
showHalo.value = !showHalo.value;
} else if (id === 'showStudied') {
showStudied.value = !showStudied.value;
} else if (id === 'useFixed') {
useFixed.value = !useFixed.value;
} else if (id === 'autoLocate') {
autoLocate.value = !autoLocate.value;
} else if (id === 'antiAliasing') {
antiAliasing.value = !antiAliasing.value;
}
settings[id].value = !settings[id].value;
}
</script>
+4 -8
View File
@@ -111,10 +111,10 @@
</div>
<div v-if="studyOpened" class="status-item">
<span
id="status-skill"
id="status-study"
class="button-text"
@click.stop="openStudy"
>查看技能</span
>学习</span
>
</div>
</div>
@@ -181,12 +181,8 @@ function update() {
lvName.value = core.getLvName(hero.lv);
if (flags.blade && flags.bladeOn) {
skill.value = '断灭之刃';
hero.atk! *= 1 + core.getSkillLevel(2) / 10;
hero.def! *= 1 - core.getSkillLevel(2) / 10;
} else if (flags.shield && flags.shieldOn) {
skill.value = '铸剑为盾';
hero.def! *= 1 + core.getSkillLevel(10) / 10;
hero.atk! *= 1 - core.getSkillLevel(10) / 10;
} else {
skill.value = '无';
}
@@ -282,12 +278,12 @@ function openStudy() {}
}
#status-mana {
line-height: 1;
line-height: 0;
color: rgb(255, 211, 211);
}
#status-hpmax {
line-height: 1;
line-height: 0;
color: rgb(167, 255, 167);
}