完善定点查看

This commit is contained in:
unanmed 2023-01-08 22:59:39 +08:00
parent 5379dc99e6
commit 1911caa9c4
15 changed files with 132 additions and 59 deletions

View File

@ -2,6 +2,7 @@ var data_a1e2fb4a_e986_4524_b0da_9b7ba7c0874d =
{
"main": {
"floorIds": [
"empty",
"MT0",
"MT1",
"MT2",

View File

@ -141,7 +141,7 @@ var enemys_fcae963b_31c9_42b4_b48c_bb48d09f3f80 =
"E579": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E590": {"name":"冰封史莱姆","hp":7500,"atk":1750,"def":1000,"money":2,"exp":75,"point":0,"special":[20],"ice":25},
"E591": {"name":"新敌人","hp":10000,"atk":2000,"def":1000,"money":0,"exp":0,"point":0,"special":[]},
"E592": {"name":"冰封巨兽","hp":6000,"atk":1750,"def":1000,"money":2,"exp":85,"point":0,"special":[20,21],"iceHalo":20,"ice":50},
"E592": {"name":"冰封巨兽","hp":10000,"atk":2000,"def":1000,"money":2,"exp":85,"point":0,"special":[20,21],"iceHalo":20,"ice":50},
"E593": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E594": {"name":"新敌人","hp":0,"atk":0,"def":0,"money":0,"exp":0,"point":0,"special":[]},
"E595": {"name":"寒冰兽人","hp":12500,"atk":1800,"def":800,"money":2,"exp":100,"point":0,"special":[7],"hungry":25},

View File

@ -22,16 +22,7 @@ main.floors.MT1=
"type": "if",
"condition": "(flag:hard===1)",
"true": [
{
"type": "confirm",
"text": "是否阅读魔塔基本游戏规则(教程)",
"yes": [
"魔塔遵循你打我一下,我打你一下的原则,每次造成的伤害为己方攻击减去对方防御\n红宝石可以增加攻击蓝宝石可以增加防御血瓶增加血量\n打怪物可以获得经验和金币经验可用于升级金币可用于购物\n以上就是基本规则祝您游戏愉快"
],
"no": [
"祝您游戏愉快"
]
}
"游戏的基础玩法可以在百科全书中查看你可以按H或者在道具栏打开。"
]
}
],

View File

@ -34,24 +34,8 @@ main.floors.MT10=
}
},
"afterBattle": {},
"afterGetItem": {
"4,6": [
"\t[原始人]\b[up,hero]这是什么?",
"\t[原始人]\b[up,hero]好像有什么形状",
"\t[原始人]\b[up,hero]难道是什么钥匙吗",
"\t[原始人]\b[up,hero]黄色的,好像和家里面的那些巨石有些关系"
]
},
"afterOpenDoor": {
"1,4": [
{
"type": "animate",
"name": "emm",
"loc": "hero"
},
"\t[原始人]\b[down,hero]原来如此"
]
},
"afterGetItem": {},
"afterOpenDoor": {},
"autoEvent": {},
"cannotMove": {},
"map": [

View File

@ -39,7 +39,7 @@ main.floors.MT32=
"衣服是个装备,记得穿上",
"光环会在地图上显示,如果不想要可以在背包里面的系统设置里面关闭",
"每张地图会保证极昼怪的数量与永夜怪的数量相同",
"注意打过永夜怪或者极昼怪之后怪物标记可能与当前地图不符,因为标记怪物是标记的某一类怪物而不是某一点的怪物"
"注意打过永夜怪或者极昼怪之后或者有光环的时候,怪物标记可能与当前地图不符,因为标记怪物是标记的某一类怪物而不是某一点的怪物"
]
},
"changeFloor": {

View File

@ -0,0 +1,61 @@
main.floors.empty=
{
"floorId": "empty",
"title": "山脚",
"name": "13",
"width": 15,
"height": 15,
"canFlyTo": true,
"canFlyFrom": true,
"canUseQuickShop": true,
"cannotViewMap": false,
"images": [],
"ratio": 1,
"defaultGround": "grass",
"bgm": "mount.mp3",
"weather": [
"sun",
8
],
"firstArrive": [],
"eachArrive": [],
"parallelDo": "",
"events": {},
"changeFloor": {},
"beforeBattle": {},
"afterBattle": {},
"afterGetItem": {},
"afterOpenDoor": {},
"autoEvent": {},
"cannotMove": {},
"cannotMoveIn": {},
"map": [
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
[ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
],
"bgmap": [
],
"fgmap": [
],
"bg2map": [
],
"fg2map": [
]
}

View File

@ -1220,9 +1220,6 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
case 68: // D读档
core.load(true);
break;
case 69: // E打开光标
core.ui._drawCursor();
break;
case 84: // T打开道具栏
core.openToolbox(true);
break;
@ -1251,8 +1248,16 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
case 72: // H打开帮助页面
core.useItem('I560', true);
break;
case 75: // J定点查看
case 67: // C怪物临界
if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
core.plugin.fixedDetailPanel = 'critical';
core.plugin.showFixed.value = false;
core.plugin.fixedDetailOpened.value = true;
}
break;
case 69: // E怪物属性
if (core.getBlockCls(mx, my)?.startsWith('enemy')) {
core.plugin.fixedDetailPanel = 'special';
core.plugin.showFixed.value = false;
core.plugin.fixedDetailOpened.value = true;
}
@ -1489,7 +1494,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
if (!floorId || !core.status.maps) return;
const haloMap = {
21: 'square:7:cyan'
21: ['square:7:cyan']
};
var width = core.floors[floorId].width,
@ -1737,7 +1742,7 @@ var functions_d6ad677b_427a_4623_b50f_a445a3b0ef8a = {
for (const num of enemy.special) {
if (num in haloMap) {
halo[loc] ??= [];
halo[loc].push(haloMap[num]);
halo[loc].push(...haloMap[num]);
}
}
}

View File

@ -139,7 +139,7 @@
"condition": "true",
"desc": [
"这里包含本塔中所有的快捷键。对于手机端,可以点击工具栏的难度的位置切换工具栏至数字键。",
"下面会分为样板快捷键和本塔快捷键两类。",
"下面会分为样板快捷键和本塔快捷键两类分别说明。",
"<br>",
"<br>",
"下面是样板中的所有快捷键:",
@ -189,7 +189,9 @@
"<br>",
"<span style=\"color: gold\">H</span>:打开百科全书",
"<br>",
"<span style=\"color: gold\">K</span>:查看鼠标位置怪物的详细信息"
"<span style=\"color: gold\">E</span>:查看鼠标位置怪物的特殊属性信息",
"<br>",
"<span style=\"color: gold\">C</span>:查看鼠标位置怪物的详细临界信息"
]
},
"extraAttr": {
@ -243,6 +245,7 @@
"本塔的状态栏的布局较为灵活。它是横向的布局,在状态栏较宽时可以看到,属性会横向依次显示。按照显示顺序,",
"状态栏显示项依次为:",
"<br>",
"<br>",
"1. 楼层名,点击后进入浏览地图界面",
"<br>",
"2. 勇士等级",
@ -310,8 +313,10 @@
"本塔的怪物手册功能很多,下面一一介绍。",
"<br>",
"<br>",
"首先你可以按X打开怪物手册。将鼠标移动到一个怪物上按下<span style=\"color: gold\">",
"K键</span>,也可以定点查看某个怪物的详细属性。将鼠标移动到怪物上也可以定点查看怪物的粗略信息。",
"首先你可以按X打开怪物手册。除此之外将鼠标移动到怪物上也可以定点查看怪物的粗略信息。",
"将鼠标移动到一个怪物上,按下<span style=\"color: gold\">",
"E键</span>,可以查看该怪物的特殊属性信息。按下<span style=\"color: gold\">",
"C键</span>,可以查看该怪物的详细临界信息。",
"<br>",
"<br>",
"怪物手册打开的时候有一个0.6秒的动画,如果不想要可以在开头捡的系统设置里面关闭(默认关闭)。",

View File

@ -4,15 +4,15 @@ import { getDamageColor } from '../utils';
export const showFixed = ref(false);
const show = debounce((ev: MouseEvent) => {
let lastId: EnemyIds;
const show = debounce((ev: MouseEvent, mx: number, my: number, e: AllIds) => {
if (!window.flags) return;
if (!flags.mouseLoc) return;
flags.clientLoc = [ev.clientX, ev.clientY];
const [x, y] = flags.mouseLoc;
const mx = Math.round(x + core.bigmap.offsetX / 32);
const my = Math.round(y + core.bigmap.offsetY / 32);
const e = core.getBlockId(mx, my);
if (e !== lastId) showFixed.value = false;
if (!e || !core.getClsFromId(e)?.startsWith('enemy')) return;
lastId = e as EnemyIds;
const enemy = core.material.enemys[e as EnemyIds];
const detail = getDetailedEnemy(enemy, mx, my);
core.plugin.bookDetailEnemy = detail;
@ -22,8 +22,14 @@ const show = debounce((ev: MouseEvent) => {
export default function init() {
const data = core.canvas.data.canvas;
data.addEventListener('mousemove', ev => {
showFixed.value = false;
show(ev);
if (!core.isPlaying()) return;
const [x, y] = flags.mouseLoc;
const mx = Math.round(x + core.bigmap.offsetX / 32);
const my = Math.round(y + core.bigmap.offsetY / 32);
const e = core.getBlockId(mx, my);
if (e !== lastId) showFixed.value = false;
if (!e) return;
show(ev, mx, my, e);
});
return {

View File

@ -1,5 +1,6 @@
type FloorIds =
| 'empty'
| 'MT0'
| 'MT1'
| 'MT2'

View File

@ -136,6 +136,9 @@ interface PluginUis {
/** 怪物手册详细信息展示的怪物 */
bookDetailEnemy: DetailedEnemy;
/** 定点查看的界面,特殊属性还是临界 */
fixedDetailPanel: 'special' | 'critical';
/** ui是否使用渐变 */
readonly transition: Ref<boolean>;

View File

@ -81,16 +81,17 @@ import { keycode } from '../plugin/utils';
import { sleep } from 'mutate-animate';
import EnemyTarget from '../panel/enemyTarget.vue';
const enemy = core.plugin.bookDetailEnemy;
const top = ref(core.plugin.bookDetailPos);
const panel = ref('special');
let detail: HTMLDivElement;
const props = defineProps<{
fromBook?: boolean;
defaultPanel?: 'special' | 'critical' | 'target';
}>();
const enemy = core.plugin.bookDetailEnemy;
const top = ref(core.plugin.bookDetailPos);
const panel = ref<string>(props.defaultPanel ?? 'special');
let detail: HTMLDivElement;
const emits = defineEmits<{
(e: 'close'): void;
}>();

View File

@ -80,6 +80,9 @@ async function calHeight() {
vw = window.innerWidth;
width.value = vh * 0.28;
await new Promise(res => requestAnimationFrame(res));
if (core.plugin.fixedDetailOpened.value) {
showFixed.value = false;
}
main = document.getElementById('enemy-fixed') as HTMLDivElement;
if (!main) return;
const style = getComputedStyle(main);

View File

@ -1,6 +1,10 @@
<template>
<div id="fixed-detail">
<BookDetail :from-book="false" @close="close"></BookDetail>
<BookDetail
:from-book="false"
:default-panel="panel"
@close="close"
></BookDetail>
</div>
</template>
@ -9,6 +13,8 @@ import { onMounted, ref } from 'vue';
import { getDetailedEnemy } from '../plugin/ui/fixed';
import BookDetail from './bookDetail.vue';
const panel = core.plugin.fixedDetailPanel ?? 'special';
core.plugin.bookDetailPos = 0;
const [x, y] = flags.mouseLoc;

View File

@ -102,19 +102,25 @@ function getName(id: EnemyIds) {
}
function getDamage(id: EnemyIds) {
return core.formatBigNumber(core.getDamageInfo(id)?.damage) ?? '???';
return (
core.formatBigNumber(
core.getDamageInfo(id, void 0, void 0, void 0, 'empty')?.damage
) ?? '???'
);
}
function getCritical(id: EnemyIds) {
return (
core.nextCriticals(id, 1)[0]?.map(v => core.formatBigNumber(v)) ?? [
0, 0
]
core
.nextCriticals(id, 1, void 0, void 0, 'empty')[0]
?.map(v => core.formatBigNumber(v)) ?? [0, 0]
);
}
function getDefDamage(id: EnemyIds) {
return core.formatBigNumber(core.getDefDamage(id, ratio));
return core.formatBigNumber(
core.getDefDamage(id, ratio, void 0, void 0, 'empty')
);
}
</script>