mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-16 20:24:31 +08:00
feat: 杀掉样板的工具栏
This commit is contained in:
1 parent
4d5f14e8a5
commit
f52f986bfa
41 files changed
+1473
-222
No files matched your search
+97
-77
@@ -312,7 +312,7 @@ interface LoadEvent<T extends keyof ResourceType> extends EmitableEvent {
|
||||
now: number,
|
||||
total: number
|
||||
) => void;
|
||||
load: (resource: ResourceMap[T]) => void | Promise<void>;
|
||||
load: (resource: ResourceMap[T]) => void | Promise<any>;
|
||||
loadStart: (resource: ResourceMap[T]) => void;
|
||||
}
|
||||
|
||||
@@ -365,7 +365,7 @@ export class LoadTask<
|
||||
* 执行加载过程,当加载完毕后,返回的Promise将会被resolve
|
||||
* @returns 加载的Promise
|
||||
*/
|
||||
load(): Promise<ResourceType[T]> {
|
||||
async load(): Promise<ResourceType[T]> {
|
||||
if (this.loadingStarted) {
|
||||
logger.warn(
|
||||
2,
|
||||
@@ -394,14 +394,13 @@ export class LoadTask<
|
||||
);
|
||||
});
|
||||
this.emit('loadStart', this.resource);
|
||||
return load.then(async value => {
|
||||
// @ts-ignore
|
||||
LoadTask.loadedTaskList.add(this);
|
||||
this.loaded = totalByte;
|
||||
LoadTask.loadedTask++;
|
||||
await Promise.all(this.emit('load', this.resource));
|
||||
return value;
|
||||
});
|
||||
const value = await load;
|
||||
// @ts-ignore
|
||||
LoadTask.loadedTaskList.add(this);
|
||||
this.loaded = totalByte;
|
||||
LoadTask.loadedTask++;
|
||||
await Promise.all(this.emit('load', this.resource));
|
||||
return await value;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -619,79 +618,100 @@ export async function loadCompressedResource() {
|
||||
res.once('load', resource => {
|
||||
const res = resource.resource;
|
||||
if (!res) return;
|
||||
list.forEach(async v => {
|
||||
const { type, name, usage } = v;
|
||||
const asyncType = types[type];
|
||||
const value = await res
|
||||
.file(`${type}/${name}`)
|
||||
?.async(asyncType);
|
||||
return Promise.all(
|
||||
list.map(async v => {
|
||||
const { type, name, usage } = v;
|
||||
const asyncType = types[type];
|
||||
const value = await res
|
||||
.file(`${type}/${name}`)
|
||||
?.async(asyncType);
|
||||
|
||||
if (!value) return;
|
||||
if (!value) return;
|
||||
|
||||
// 图片类型的资源
|
||||
if (type === 'image') {
|
||||
const img = value as Blob;
|
||||
const image = new Image();
|
||||
image.src = URL.createObjectURL(img);
|
||||
image.addEventListener('load', () => {
|
||||
image.setAttribute('_width', image.width.toString());
|
||||
image.setAttribute('_height', image.height.toString());
|
||||
});
|
||||
// 图片类型的资源
|
||||
if (type === 'image') {
|
||||
const img = value as Blob;
|
||||
const image = new Image();
|
||||
image.src = URL.createObjectURL(img);
|
||||
image.addEventListener('load', () => {
|
||||
image.setAttribute(
|
||||
'_width',
|
||||
image.width.toString()
|
||||
);
|
||||
image.setAttribute(
|
||||
'_height',
|
||||
image.height.toString()
|
||||
);
|
||||
});
|
||||
|
||||
// 图片
|
||||
if (usage === 'image') {
|
||||
core.material.images.images[name as ImageIds] = image;
|
||||
} else if (usage === 'tileset') {
|
||||
// 额外素材
|
||||
core.material.images.tilesets[name] = image;
|
||||
} else if (usage === 'autotile') {
|
||||
// 自动元件
|
||||
autotiles[name.slice(0, -4) as AllIdsOf<'autotile'>] =
|
||||
image;
|
||||
const loading = Mota.require('var', 'loading');
|
||||
loading.addAutotileLoaded();
|
||||
loading.onAutotileLoaded(autotiles);
|
||||
core.material.images.autotile[
|
||||
name.slice(0, -4) as AllIdsOf<'autotile'>
|
||||
] = image;
|
||||
// 图片
|
||||
if (usage === 'image') {
|
||||
core.material.images.images[name as ImageIds] =
|
||||
image;
|
||||
} else if (usage === 'tileset') {
|
||||
// 额外素材
|
||||
core.material.images.tilesets[name] = image;
|
||||
} else if (usage === 'autotile') {
|
||||
// 自动元件
|
||||
autotiles[
|
||||
name.slice(0, -4) as AllIdsOf<'autotile'>
|
||||
] = image;
|
||||
const loading = Mota.require('var', 'loading');
|
||||
loading.addAutotileLoaded();
|
||||
loading.onAutotileLoaded(autotiles);
|
||||
core.material.images.autotile[
|
||||
name.slice(0, -4) as AllIdsOf<'autotile'>
|
||||
] = image;
|
||||
}
|
||||
} else if (type === 'material') {
|
||||
const img = value as Blob;
|
||||
const image = new Image();
|
||||
image.src = URL.createObjectURL(img);
|
||||
image.addEventListener('load', () => {
|
||||
image.setAttribute(
|
||||
'_width',
|
||||
image.width.toString()
|
||||
);
|
||||
image.setAttribute(
|
||||
'_height',
|
||||
image.height.toString()
|
||||
);
|
||||
});
|
||||
|
||||
// material
|
||||
if (materialImages.some(v => name === v + '.png')) {
|
||||
// @ts-ignore
|
||||
core.material.images[
|
||||
name.slice(0, -4) as SelectKey<
|
||||
MaterialImages,
|
||||
HTMLImageElement
|
||||
>
|
||||
] = image;
|
||||
} else if (weathers.some(v => name === v + '.png')) {
|
||||
// @ts-ignore
|
||||
core.animateFrame.weather[v] = image;
|
||||
}
|
||||
}
|
||||
} else if (type === 'material') {
|
||||
const img = value as Blob;
|
||||
const image = new Image();
|
||||
image.src = URL.createObjectURL(img);
|
||||
image.addEventListener('load', () => {
|
||||
image.setAttribute('_width', image.width.toString());
|
||||
image.setAttribute('_height', image.height.toString());
|
||||
});
|
||||
|
||||
// material
|
||||
if (materialImages.some(v => name === v + '.png')) {
|
||||
// @ts-ignore
|
||||
core.material.images[
|
||||
name.slice(0, -4) as SelectKey<
|
||||
MaterialImages,
|
||||
HTMLImageElement
|
||||
>
|
||||
] = image;
|
||||
} else if (weathers.some(v => name === v + '.png')) {
|
||||
// @ts-ignore
|
||||
core.animateFrame.weather[v] = image;
|
||||
} else {
|
||||
if (usage === 'font') {
|
||||
const font = value as ArrayBuffer;
|
||||
document.fonts.add(
|
||||
new FontFace(name.slice(0, -4), font)
|
||||
);
|
||||
} else if (usage === 'sound') {
|
||||
const sound = value as ArrayBuffer;
|
||||
Mota.require('var', 'sound').add(
|
||||
`sounds.${name}`,
|
||||
sound
|
||||
);
|
||||
} else if (usage === 'animate') {
|
||||
const ani = value as string;
|
||||
core.material.animates[
|
||||
name.slice(0, -8) as AnimationIds
|
||||
] = core.loader._loadAnimate(ani);
|
||||
}
|
||||
}
|
||||
|
||||
if (usage === 'font') {
|
||||
const font = value as ArrayBuffer;
|
||||
document.fonts.add(new FontFace(name.slice(0, -4), font));
|
||||
} else if (usage === 'sound') {
|
||||
const sound = value as ArrayBuffer;
|
||||
Mota.require('var', 'sound').add(`sounds.${name}`, sound);
|
||||
} else if (usage === 'animate') {
|
||||
const ani = value as string;
|
||||
core.material.animates[name.slice(0, -8) as AnimationIds] =
|
||||
core.loader._loadAnimate(ani);
|
||||
}
|
||||
});
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -73,14 +73,14 @@ function addLightFromBlock(floors: FloorIds[], block: number, config: LightConfi
|
||||
Mota.require('var', 'hook').once('reset', () => {
|
||||
Shadow.init();
|
||||
addLightFromBlock(
|
||||
core.floorIds.slice(61, 70).concat(core.floorIds.slice(72)),
|
||||
core.floorIds.slice(61, 70).concat(core.floorIds.slice(72, 81)).concat(core.floorIds.slice(85, 103)),
|
||||
103,
|
||||
{ decay: 50, r: 300, color: [0.9333, 0.6, 0.333, 0.3] },
|
||||
{ background: [0, 0, 0, 0.26] },
|
||||
{ decay: 50, r: 250, color: [0, 0, 0, 0] }
|
||||
);
|
||||
addLightFromBlock(
|
||||
['MT50', 'MT60', 'MT61'],
|
||||
['MT50', 'MT60', 'MT61', 'MT72', 'MT73', 'MT74', 'MT75'],
|
||||
103,
|
||||
{ decay: 20, r: 150, color: [0.9333, 0.6, 0.333, 0.4], noShelter: true },
|
||||
{ background: [0, 0, 0, 0.4] }
|
||||
|
||||
@@ -11,7 +11,7 @@ import {
|
||||
} from '@/plugin/utils';
|
||||
import axios, { AxiosResponse, toFormData } from 'axios';
|
||||
import { Component, VNode, h, shallowReactive } from 'vue';
|
||||
/* @__PURE__ */ import { id, password } from '../../../../user';
|
||||
// /* @__PURE__ */ import { id, password } from '../../../../user';
|
||||
import { mainSetting } from '../setting';
|
||||
|
||||
type CSSObj = Partial<Record<CanParseCss, string>>;
|
||||
@@ -135,8 +135,8 @@ export class Danmaku extends EventEmitter<DanmakuEvent> {
|
||||
|
||||
this.posting = true;
|
||||
const form = toFormData(data);
|
||||
/* @__PURE__ */ form.append('userid', id);
|
||||
/* @__PURE__ */ form.append('password', password);
|
||||
// /* @__PURE__ */ form.append('userid', id);
|
||||
// /* @__PURE__ */ form.append('password', password);
|
||||
|
||||
try {
|
||||
const res = await axios.post<PostDanmakuResponse>(
|
||||
@@ -385,8 +385,8 @@ export class Danmaku extends EventEmitter<DanmakuEvent> {
|
||||
};
|
||||
|
||||
const form = toFormData(post);
|
||||
/* @__PURE__ */ form.append('userid', id);
|
||||
/* @__PURE__ */ form.append('password', password);
|
||||
// /* @__PURE__ */ form.append('userid', id);
|
||||
// /* @__PURE__ */ form.append('password', password);
|
||||
|
||||
const res = await axios.post<PostLikeResponse>(Danmaku.backend, form);
|
||||
if (res.data.code !== 0) {
|
||||
@@ -466,8 +466,8 @@ export class Danmaku extends EventEmitter<DanmakuEvent> {
|
||||
type: 1,
|
||||
towername: 'HumanBreak'
|
||||
});
|
||||
/* @__PURE__ */ form.append('userid', id);
|
||||
/* @__PURE__ */ form.append('password', password);
|
||||
// /* @__PURE__ */ form.append('userid', id);
|
||||
// /* @__PURE__ */ form.append('password', password);
|
||||
const data = await axios.post<DanmakuResponse>(Danmaku.backend, form);
|
||||
|
||||
data.data.list.forEach(v => {
|
||||
@@ -515,7 +515,9 @@ Danmaku.registerSpecContent('i', content => {
|
||||
});
|
||||
});
|
||||
|
||||
/* @__PURE__ */ Danmaku.backend = `/danmaku`;
|
||||
if (import.meta.env.DEV) {
|
||||
Danmaku.backend = `/danmaku`;
|
||||
}
|
||||
|
||||
Mota.require('var', 'hook').once('reset', () => {
|
||||
Danmaku.fetch();
|
||||
|
||||
@@ -11,6 +11,7 @@ import type {
|
||||
ToolbarItemMap,
|
||||
ToolbarItemType
|
||||
} from '../init/toolbar';
|
||||
import { isMobile } from '@/plugin/use';
|
||||
|
||||
interface CustomToolbarEvent extends EmitableEvent {
|
||||
add: (item: ValueOf<ToolbarItemMap>) => void;
|
||||
@@ -378,3 +379,51 @@ Mota.require('var', 'loading').once('coreInit', () => {
|
||||
Mota.require('var', 'hook').on('reset', () => {
|
||||
CustomToolbar.showAll();
|
||||
});
|
||||
|
||||
Mota.require('var', 'hook').once('reset', () => {
|
||||
const mainStorage = GameStorage.for(GameStorage.fromGame('main'));
|
||||
mainStorage.read();
|
||||
if (mainStorage.getValue('played', false)) {
|
||||
mainStorage.setValue('played', true);
|
||||
const defaultsTool =
|
||||
CustomToolbar.list.find(v => v.id === '@defaults') ??
|
||||
new CustomToolbar('@defaults', true);
|
||||
defaultsTool.closeAll();
|
||||
defaultsTool.items = reactive([]);
|
||||
defaultsTool.add({
|
||||
id: '@defaults_misc',
|
||||
type: 'misc',
|
||||
folded: false,
|
||||
noDefaultAction: true,
|
||||
items: [
|
||||
'book',
|
||||
'fly',
|
||||
'save',
|
||||
'load',
|
||||
'undo',
|
||||
'redo',
|
||||
'danmaku',
|
||||
'minimap',
|
||||
'toolbox',
|
||||
'equipbox',
|
||||
'shop',
|
||||
'virtualKey',
|
||||
'setting'
|
||||
]
|
||||
});
|
||||
// 计算位置
|
||||
if (isMobile) {
|
||||
// 手机端显示在最下方
|
||||
defaultsTool.setPos(25, window.innerHeight - 100);
|
||||
defaultsTool.setSize(window.innerWidth - 50, 100);
|
||||
} else {
|
||||
// 电脑显示在屏幕右方
|
||||
const x = window.innerWidth / 2 + core.domStyle.scale * 240 + 75;
|
||||
defaultsTool.setPos(x, window.innerHeight / 2 + 100);
|
||||
defaultsTool.setSize(window.innerWidth - x - 75, 200);
|
||||
}
|
||||
|
||||
defaultsTool.show();
|
||||
CustomToolbar.save();
|
||||
}
|
||||
});
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
SelectOption,
|
||||
Switch
|
||||
} from 'ant-design-vue';
|
||||
import { mainSetting } from '../setting';
|
||||
import { MotaSettingItem, mainSetting } from '../setting';
|
||||
import Minimap from '@/components/minimap.vue';
|
||||
import { gameKey } from './hotkey';
|
||||
import { FunctionalComponent, StyleValue, h } from 'vue';
|
||||
@@ -224,21 +224,13 @@ function MiscTool(props: CustomToolbarProps<'misc'>) {
|
||||
justify-content: center;
|
||||
font-size: ${18 * scale}px;
|
||||
`;
|
||||
const blockStyle = `
|
||||
min-width: ${40 * scale}px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: ${40 * scale}px;
|
||||
border: 1px solid #ddd;
|
||||
`;
|
||||
const toolStyle = `
|
||||
display: flex;
|
||||
align-items: center;
|
||||
min-width: ${40 * scale}px;
|
||||
height: ${40 * scale}px;
|
||||
border: 1px solid #ddd;
|
||||
margin-left: ${5 * scale}px;
|
||||
margin: ${5 * scale}px ${5 * scale}px ${5 * scale}px 0;
|
||||
justify-content: center;
|
||||
`;
|
||||
const toolActivedStyle = `
|
||||
@@ -247,7 +239,7 @@ function MiscTool(props: CustomToolbarProps<'misc'>) {
|
||||
min-width: ${40 * scale}px;
|
||||
height: ${40 * scale}px;
|
||||
border: 1px solid #ddd;
|
||||
margin-left: ${5 * scale}px;
|
||||
margin: ${5 * scale}px ${5 * scale}px ${5 * scale}px 0;
|
||||
justify-content: center;
|
||||
color: aqua;
|
||||
`;
|
||||
@@ -255,6 +247,7 @@ function MiscTool(props: CustomToolbarProps<'misc'>) {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 ${5 * scale}px;
|
||||
flex-wrap: wrap;
|
||||
`;
|
||||
|
||||
return (
|
||||
@@ -272,7 +265,7 @@ function MiscTool(props: CustomToolbarProps<'misc'>) {
|
||||
<span
|
||||
class="button-text"
|
||||
onClick={triggerFold}
|
||||
style={blockStyle}
|
||||
style={toolStyle}
|
||||
>
|
||||
折叠
|
||||
</span>
|
||||
@@ -753,6 +746,9 @@ Mota.require('var', 'hook').once('reset', () => {
|
||||
CustomToolbar.misc.requestRefresh('minimap');
|
||||
}
|
||||
});
|
||||
const scale = mainSetting.getSetting('ui.toolbarScale') as Readonly<
|
||||
MotaSettingItem<number>
|
||||
>;
|
||||
|
||||
CustomToolbar.misc.register(
|
||||
'danmaku',
|
||||
@@ -760,6 +756,34 @@ Mota.require('var', 'hook').once('reset', () => {
|
||||
openDanmakuPoster,
|
||||
h('span', '发弹幕')
|
||||
);
|
||||
CustomToolbar.misc.register(
|
||||
'book',
|
||||
'怪物手册',
|
||||
() => {
|
||||
core.useItem('book', true);
|
||||
},
|
||||
<img
|
||||
src={core.statusBar.icons.book.src}
|
||||
style={{
|
||||
'object-fit': 'contain',
|
||||
width: `${(scale.value / 100) * 32}px`
|
||||
}}
|
||||
></img>
|
||||
);
|
||||
CustomToolbar.misc.register(
|
||||
'fly',
|
||||
'楼层飞行器',
|
||||
() => {
|
||||
core.useItem('fly', true);
|
||||
},
|
||||
<img
|
||||
src={core.statusBar.icons.fly.src}
|
||||
style={{
|
||||
'object-fit': 'contain',
|
||||
width: `${(scale.value / 100) * 32}px`
|
||||
}}
|
||||
></img>
|
||||
);
|
||||
CustomToolbar.misc.register(
|
||||
'toolbox',
|
||||
'道具栏',
|
||||
@@ -768,7 +792,24 @@ Mota.require('var', 'hook').once('reset', () => {
|
||||
},
|
||||
<img
|
||||
src={core.statusBar.icons.toolbox.src}
|
||||
style="object-fit: contain"
|
||||
style={{
|
||||
'object-fit': 'contain',
|
||||
width: `${(scale.value / 100) * 32}px`
|
||||
}}
|
||||
></img>
|
||||
);
|
||||
CustomToolbar.misc.register(
|
||||
'equipbox',
|
||||
'装备栏',
|
||||
() => {
|
||||
mainUi.open('equipbox');
|
||||
},
|
||||
<img
|
||||
src={core.statusBar.icons.equipbox.src}
|
||||
style={{
|
||||
'object-fit': 'contain',
|
||||
width: `${(scale.value / 100) * 32}px`
|
||||
}}
|
||||
></img>
|
||||
);
|
||||
CustomToolbar.misc.register(
|
||||
@@ -779,7 +820,10 @@ Mota.require('var', 'hook').once('reset', () => {
|
||||
},
|
||||
<img
|
||||
src={core.statusBar.icons.keyboard.src}
|
||||
style="object-fit: contain"
|
||||
style={{
|
||||
'object-fit': 'contain',
|
||||
width: `${(scale.value / 100) * 32}px`
|
||||
}}
|
||||
></img>
|
||||
);
|
||||
CustomToolbar.misc.register(
|
||||
@@ -790,7 +834,10 @@ Mota.require('var', 'hook').once('reset', () => {
|
||||
},
|
||||
<img
|
||||
src={core.statusBar.icons.shop.src}
|
||||
style="object-fit: contain"
|
||||
style={{
|
||||
'object-fit': 'contain',
|
||||
width: `${(scale.value / 100) * 32}px`
|
||||
}}
|
||||
></img>
|
||||
);
|
||||
CustomToolbar.misc.register(
|
||||
@@ -801,7 +848,10 @@ Mota.require('var', 'hook').once('reset', () => {
|
||||
},
|
||||
<img
|
||||
src={core.statusBar.icons.save.src}
|
||||
style="object-fit: contain"
|
||||
style={{
|
||||
'object-fit': 'contain',
|
||||
width: `${(scale.value / 100) * 32}px`
|
||||
}}
|
||||
></img>
|
||||
);
|
||||
CustomToolbar.misc.register(
|
||||
@@ -812,11 +862,14 @@ Mota.require('var', 'hook').once('reset', () => {
|
||||
},
|
||||
<img
|
||||
src={core.statusBar.icons.load.src}
|
||||
style="object-fit: contain"
|
||||
style={{
|
||||
'object-fit': 'contain',
|
||||
width: `${(scale.value / 100) * 32}px`
|
||||
}}
|
||||
></img>
|
||||
);
|
||||
CustomToolbar.misc.register(
|
||||
'redo',
|
||||
'undo',
|
||||
'回退(自动存档)',
|
||||
() => {
|
||||
core.doSL('autoSave', 'load');
|
||||
@@ -824,7 +877,7 @@ Mota.require('var', 'hook').once('reset', () => {
|
||||
h('span', '回退')
|
||||
);
|
||||
CustomToolbar.misc.register(
|
||||
'load',
|
||||
'redo',
|
||||
'恢复(撤销自动存档)',
|
||||
() => {
|
||||
core.doSL('autoSave', 'reload');
|
||||
@@ -839,7 +892,10 @@ Mota.require('var', 'hook').once('reset', () => {
|
||||
},
|
||||
<img
|
||||
src={core.statusBar.icons.settings.src}
|
||||
style="object-fit: contain"
|
||||
style={{
|
||||
'object-fit': 'contain',
|
||||
width: `${(scale.value / 100) * 32}px`
|
||||
}}
|
||||
></img>
|
||||
);
|
||||
CustomToolbar.misc.register(
|
||||
|
||||
@@ -499,7 +499,7 @@ loading.once('coreInit', () => {
|
||||
'screen.heroDetail': !!storage.getValue('screen.heroDetail', false),
|
||||
'screen.transition': !!storage.getValue('screen.transition', false),
|
||||
'screen.antiAlias': !!storage.getValue('screen.antiAlias', false),
|
||||
'screen.fontSize': storage.getValue('screen.fontSize', 16),
|
||||
'screen.fontSize': storage.getValue('screen.fontSize', isMobile ? 9 : 16),
|
||||
'screen.smoothView': !!storage.getValue('screen.smoothView', true),
|
||||
'screen.criticalGem': !!storage.getValue('screen.criticalGem', false),
|
||||
'screen.fontSizeStatus': storage.getValue('screen.fontSizeStatus', 100),
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"是否开启抗锯齿。开启后,画面会变得不那么锐利,观感更加舒适;关闭后,可以更好地展现出像素感,同时部分像素错误也不会出现。"
|
||||
],
|
||||
"fontSize": [
|
||||
"在各种 ui 界面中显示的文字大小,范围为 8 - 28。注意,字体过大可能会引起 ui 布局发生错误"
|
||||
"在各种 ui 界面中显示的文字大小,范围为 2 - 48。注意,字体过大可能会引起 ui 布局发生错误"
|
||||
],
|
||||
"criticalGem": ["临界是否显示为在当前地图要吃的宝石数"]
|
||||
},
|
||||
|
||||
@@ -996,7 +996,7 @@ export class DamageEnemy<T extends EnemyIds = EnemyIds> {
|
||||
/**
|
||||
* 计算伤害时会用到的勇士属性,攻击防御,其余的不会有buff加成,直接从core.status.hero取
|
||||
*/
|
||||
const realStatus: (keyof HeroStatus)[] = ['atk', 'def'];
|
||||
const realStatus: (keyof HeroStatus)[] = ['atk', 'def', 'hpmax', 'mana'];
|
||||
/**
|
||||
* 主动技能列表
|
||||
*/
|
||||
@@ -1016,12 +1016,10 @@ export function calDamageWith(
|
||||
): number | null {
|
||||
const {
|
||||
hp,
|
||||
hpmax,
|
||||
mana,
|
||||
mdef,
|
||||
special: heroSpec = { num: [], last: [] }
|
||||
} = core.status.hero;
|
||||
let { atk, def } = hero as HeroStatus;
|
||||
let { atk, def, hpmax, mana } = hero as HeroStatus;
|
||||
let { hp: monHp, atk: monAtk, def: monDef, special, enemy } = info;
|
||||
|
||||
let damage = 0;
|
||||
|
||||
@@ -40,7 +40,11 @@ export const jumpIgnoreFloor: FloorIds[] = [
|
||||
'MT59',
|
||||
'MT60',
|
||||
'MT61',
|
||||
'MT71'
|
||||
'MT71',
|
||||
'MT72',
|
||||
'MT73',
|
||||
'MT74',
|
||||
'MT75'
|
||||
];
|
||||
// 跳跃
|
||||
export function jumpSkill() {
|
||||
|
||||
@@ -39,8 +39,6 @@ export function init() {
|
||||
if (!fixedUi.hasName('statusBar')) {
|
||||
fixedUi.open('statusBar');
|
||||
}
|
||||
core.dom.tools.hard.style.display = 'block';
|
||||
core.dom.toolBar.style.display = 'block';
|
||||
};
|
||||
|
||||
control.prototype.hideStatusBar = function (showToolbox) {
|
||||
@@ -61,9 +59,6 @@ export function init() {
|
||||
for (var i = 0; i < toolItems.length; ++i)
|
||||
toolItems[i].style.display = 'none';
|
||||
}
|
||||
if (!core.domStyle.isVertical && !core.flags.extendToolbar) {
|
||||
core.dom.toolBar.style.display = 'none';
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Vendored
+25
@@ -81,6 +81,28 @@ type FloorIds =
|
||||
| 'MT68'
|
||||
| 'MT69'
|
||||
| 'MT71'
|
||||
| 'MT72'
|
||||
| 'MT73'
|
||||
| 'MT74'
|
||||
| 'MT75'
|
||||
| 'MT76'
|
||||
| 'MT77'
|
||||
| 'MT78'
|
||||
| 'MT79'
|
||||
| 'MT80'
|
||||
| 'MT81'
|
||||
| 'MT82'
|
||||
| 'MT83'
|
||||
| 'MT84'
|
||||
| 'MT85'
|
||||
| 'MT86'
|
||||
| 'MT87'
|
||||
| 'MT88'
|
||||
| 'MT89'
|
||||
| 'MT90'
|
||||
| 'MT91'
|
||||
| 'MT92'
|
||||
| 'MT93'
|
||||
|
||||
type ImageIds =
|
||||
| 'IQ.png'
|
||||
@@ -187,8 +209,11 @@ type BgmIds =
|
||||
| 'beforeBoss.mp3'
|
||||
| 'cave.mp3'
|
||||
| 'escape.mp3'
|
||||
| 'escape2.mp3'
|
||||
| 'grass.mp3'
|
||||
| 'mount.mp3'
|
||||
| 'night.mp3'
|
||||
| 'palaceCenter.mp3'
|
||||
| 'palaceNorth.mp3'
|
||||
| 'palaceSouth.mp3'
|
||||
| 'plot1.mp3'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div id="danmaku-editor" @click.stop>
|
||||
<div id="danmaku-editor" @click.capture="clickInter">
|
||||
<div id="danmaku-input">
|
||||
<span
|
||||
class="danmaku-tool"
|
||||
@@ -384,9 +384,24 @@ function getAllIcons() {
|
||||
];
|
||||
}
|
||||
|
||||
let clickIn = false;
|
||||
let closed = false;
|
||||
function clickOuter() {
|
||||
if (!iconAll.value) close();
|
||||
else iconAll.value = false;
|
||||
requestAnimationFrame(() => {
|
||||
if (!clickIn) {
|
||||
if (!iconAll.value) {
|
||||
if (!closed) {
|
||||
closed = true;
|
||||
close();
|
||||
}
|
||||
} else iconAll.value = false;
|
||||
}
|
||||
clickIn = false;
|
||||
});
|
||||
}
|
||||
|
||||
function clickInter() {
|
||||
clickIn = true;
|
||||
}
|
||||
|
||||
let lockedBefore = false;
|
||||
@@ -406,7 +421,8 @@ onMounted(() => {
|
||||
if (!lockedBefore) core.unlockControl();
|
||||
});
|
||||
|
||||
document.addEventListener('click', clickOuter);
|
||||
document.addEventListener('click', clickOuter, { capture: true });
|
||||
document.addEventListener('touchend', clickOuter, { capture: true });
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
@@ -418,6 +434,7 @@ onUnmounted(() => {
|
||||
if (!lockedBefore) core.unlockControl();
|
||||
gameKey.enable();
|
||||
document.removeEventListener('click', clickOuter);
|
||||
document.removeEventListener('touchend', clickOuter);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
+66
-43
@@ -30,43 +30,47 @@
|
||||
id="divider-vertical"
|
||||
></a-divider>
|
||||
<div id="skill-upgrade-info">
|
||||
<span id="skill-level"
|
||||
>当前等级:{{ level }} / {{ skill.max }}</span
|
||||
>
|
||||
<a-divider dashed class="upgrade-divider"></a-divider>
|
||||
<span
|
||||
v-if="level < skill.max"
|
||||
id="skill-consume"
|
||||
:style="{ color: consume <= mdef ? '#fff' : '#f44' }"
|
||||
>升级花费:{{ consume }}</span
|
||||
>
|
||||
<span v-else id="skill-consume" style="color: gold"
|
||||
>已满级</span
|
||||
>
|
||||
<a-divider dashed class="upgrade-divider"></a-divider>
|
||||
<Scroll id="front-scroll" :no-scroll="true"
|
||||
><div id="skill-front">
|
||||
<span>前置技能</span>
|
||||
<span
|
||||
v-for="str of front"
|
||||
:style="{
|
||||
color: str.startsWith('a') ? '#fff' : '#f44'
|
||||
}"
|
||||
>{{ str.slice(1) }}</span
|
||||
>
|
||||
</div></Scroll
|
||||
>
|
||||
<a-divider dashed class="upgrade-divider"></a-divider>
|
||||
<div id="skill-chapter">
|
||||
<span class="button-text" @click="selectChapter(-1)"
|
||||
><LeftOutlined
|
||||
/></span>
|
||||
|
||||
<span>{{ chapterDict[chapter] }}</span>
|
||||
|
||||
<span class="button-text" @click="selectChapter(1)"
|
||||
><RightOutlined
|
||||
/></span>
|
||||
<div id="skill-upgrade-up">
|
||||
<span id="skill-level"
|
||||
>当前等级:{{ level }} / {{ skill.max }}</span
|
||||
>
|
||||
<a-divider dashed class="upgrade-divider"></a-divider>
|
||||
<span
|
||||
v-if="level < skill.max"
|
||||
id="skill-consume"
|
||||
:style="{ color: consume <= mdef ? '#fff' : '#f44' }"
|
||||
>升级花费:{{ consume }}</span
|
||||
>
|
||||
<span v-else id="skill-consume" style="color: gold"
|
||||
>已满级</span
|
||||
>
|
||||
<a-divider dashed class="upgrade-divider"></a-divider>
|
||||
<Scroll id="front-scroll" :no-scroll="true"
|
||||
><div id="skill-front">
|
||||
<span>前置技能</span>
|
||||
<span
|
||||
v-for="str of front"
|
||||
:style="{
|
||||
color: str.startsWith('a') ? '#fff' : '#f44'
|
||||
}"
|
||||
>{{ str.slice(1) }}</span
|
||||
>
|
||||
</div></Scroll
|
||||
>
|
||||
</div>
|
||||
<div id="skill-upgrade-bottom">
|
||||
<a-divider dashed class="upgrade-divider"></a-divider>
|
||||
<div id="skill-chapter">
|
||||
<span class="button-text" @click="selectChapter(-1)"
|
||||
><LeftOutlined
|
||||
/></span>
|
||||
|
||||
<span>{{ chapterDict[chapter] }}</span>
|
||||
|
||||
<span class="button-text" @click="selectChapter(1)"
|
||||
><RightOutlined
|
||||
/></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -187,9 +191,8 @@ function exit() {
|
||||
}
|
||||
|
||||
function resize() {
|
||||
const style = getComputedStyle(canvas);
|
||||
canvas.width = parseFloat(style.width) * devicePixelRatio;
|
||||
canvas.height = parseFloat(style.height) * devicePixelRatio;
|
||||
canvas.width = canvas.scrollWidth * devicePixelRatio;
|
||||
canvas.height = canvas.scrollHeight * devicePixelRatio;
|
||||
}
|
||||
|
||||
function draw() {
|
||||
@@ -283,8 +286,13 @@ gameKey
|
||||
onMounted(async () => {
|
||||
canvas = document.getElementById('skill-canvas') as HTMLCanvasElement;
|
||||
ctx = canvas.getContext('2d')!;
|
||||
resize();
|
||||
draw();
|
||||
|
||||
requestAnimationFrame(() => {
|
||||
resize();
|
||||
requestAnimationFrame(() => {
|
||||
draw();
|
||||
});
|
||||
});
|
||||
|
||||
await sleep(50);
|
||||
canvas.addEventListener('click', click);
|
||||
@@ -382,6 +390,21 @@ function selectChapter(delta: number) {
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
padding-top: 1vh;
|
||||
justify-content: space-between;
|
||||
|
||||
#skill-upgrade-up {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
#skill-upgrade-bottom {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
flex-direction: column;
|
||||
}
|
||||
}
|
||||
|
||||
.upgrade-divider {
|
||||
@@ -391,7 +414,7 @@ function selectChapter(delta: number) {
|
||||
|
||||
#front-scroll {
|
||||
width: 100%;
|
||||
height: 39vh;
|
||||
max-height: 30vh;
|
||||
}
|
||||
|
||||
#skill-front {
|
||||
|
||||
Reference in new issue
Block a user