mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-27 04:14:30 +08:00
feat: 苍蓝之殿左下区域
This commit is contained in:
1 parent
23375f03f1
commit
cb72e53c3d
38 files changed
+1358
-138
No files matched your search
@@ -105,6 +105,13 @@ function touchmove(e: TouchEvent) {
|
||||
lastDis = dis;
|
||||
}
|
||||
|
||||
function afterBattle() {
|
||||
requestAnimationFrame(() => {
|
||||
drawer.drawedThumbnail = {};
|
||||
drawer.drawMap();
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
const width = props.width ?? 300;
|
||||
const height = props.height ?? 300;
|
||||
@@ -119,9 +126,13 @@ onMounted(() => {
|
||||
drawer.noBorder = props.noBorder ?? false;
|
||||
drawer.showInfo = props.showInfo ?? false;
|
||||
|
||||
if (props.autoLocate) {
|
||||
drawer.locateMap(drawer.nowFloor);
|
||||
}
|
||||
drawer.drawMap();
|
||||
|
||||
hook.on('afterChangeFloor', onChange);
|
||||
hook.on('afterBattle', afterBattle);
|
||||
|
||||
if (props.action) {
|
||||
useDrag(
|
||||
@@ -154,6 +165,7 @@ onMounted(() => {
|
||||
|
||||
onUnmounted(() => {
|
||||
hook.off('afterChangeFloor', onChange);
|
||||
hook.off('afterBattle', afterBattle);
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ const MAX_LIGHT_NUM = 5;
|
||||
const Z_INDEX = 55;
|
||||
// 我也不知道这个数怎么来的,试出来是这个,别动就行
|
||||
const FOVY = Math.PI / 2;
|
||||
const ignore: Set<AllNumbers> = new Set([660]);
|
||||
const ignore: Set<AllNumbers> = new Set([660, 661]);
|
||||
|
||||
interface LightConfig {
|
||||
decay: number;
|
||||
@@ -73,16 +73,16 @@ function addLightFromBlock(floors: FloorIds[], block: number, config: LightConfi
|
||||
Mota.require('var', 'hook').once('reset', () => {
|
||||
Shadow.init();
|
||||
addLightFromBlock(
|
||||
core.floorIds.slice(61),
|
||||
core.floorIds.slice(61, 70).concat(core.floorIds.slice(72)),
|
||||
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'],
|
||||
['MT50', 'MT60', 'MT61'],
|
||||
103,
|
||||
{ decay: 20, r: 100, color: [0.9333, 0.6, 0.333, 0.4], noShelter: true },
|
||||
{ decay: 20, r: 150, color: [0.9333, 0.6, 0.333, 0.4], noShelter: true },
|
||||
{ background: [0, 0, 0, 0.4] }
|
||||
);
|
||||
Shadow.mount();
|
||||
@@ -95,7 +95,7 @@ Mota.require('var', 'hook').once('reset', () => {
|
||||
shadow.followHero.forEach(v => {
|
||||
shadow.modifyLight(v, {
|
||||
x: core.status.heroCenter.px,
|
||||
y: core.status.heroCenter.py
|
||||
y: core.status.heroCenter.py + 8
|
||||
});
|
||||
});
|
||||
if (shadow.followHero.size > 0) shadow.requestRefresh();
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DamageEnemy, ensureFloorDamage, getSingleEnemy } from './damage';
|
||||
import { findDir, has } from '../../plugin/game/utils';
|
||||
import { loading } from '../game';
|
||||
import { hook, loading } from '../game';
|
||||
|
||||
export interface CurrentEnemy {
|
||||
enemy: DamageEnemy;
|
||||
@@ -265,6 +265,8 @@ function init() {
|
||||
// 如果已有事件正在处理中
|
||||
if (core.status.event.id == null) core.continueAutomaticRoute();
|
||||
else core.clearContinueAutomaticRoute();
|
||||
|
||||
hook.emit('afterBattle', enemy, x, y);
|
||||
};
|
||||
}
|
||||
loading.once('coreInit', init);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { EmitableEvent, EventEmitter } from '../core/common/eventEmitter';
|
||||
import { DamageEnemy } from './enemy/damage';
|
||||
|
||||
// ----- 加载事件
|
||||
interface GameLoadEvent extends EmitableEvent {
|
||||
@@ -92,6 +93,7 @@ export interface GameEvent extends EmitableEvent {
|
||||
afterOpenDoor: (doorId: AllIdsOf<'animates'>, x: number, y: number) => void;
|
||||
afterChangeFloor: (floorId: FloorIds) => void;
|
||||
moveOneStep: (x: number, y: number, floorId: FloorIds) => void;
|
||||
afterBattle: (enemy: DamageEnemy, x?: number, y?: number) => void;
|
||||
}
|
||||
|
||||
export const hook = new EventEmitter<GameEvent>();
|
||||
|
||||
@@ -28,7 +28,10 @@ export function setCanvasFilterByFloorId(
|
||||
|
||||
Mota.require('var', 'loading').once('coreInit', () => {
|
||||
filterMap.push(
|
||||
[['MT50'], 'brightness(80%)contrast(120%)'], // 童心佬的滤镜(
|
||||
[core.floorIds.slice(61), 'brightness(90%)contrast(120%)'] // 童心佬的滤镜(
|
||||
[['MT50', 'MT60', 'MT61'], 'brightness(80%)contrast(120%)'], // 童心佬的滤镜(
|
||||
[
|
||||
core.floorIds.slice(61, 70).concat(core.floorIds.slice(72)),
|
||||
'brightness(90%)contrast(120%)'
|
||||
] // 童心佬的滤镜(
|
||||
);
|
||||
});
|
||||
@@ -35,7 +35,11 @@ export const jumpIgnoreFloor: FloorIds[] = [
|
||||
'MT47',
|
||||
'MT48',
|
||||
'MT49',
|
||||
'MT50'
|
||||
'MT50',
|
||||
'MT57',
|
||||
'MT59',
|
||||
'MT60',
|
||||
'MT61'
|
||||
];
|
||||
// 跳跃
|
||||
export function jumpSkill() {
|
||||
|
||||
@@ -151,7 +151,7 @@ export const skills: Record<Chapter, Skill[]> = {
|
||||
index: 12,
|
||||
title: '聪慧',
|
||||
desc: ['使主角变得更加聪明,每级使绿宝石增加的智慧点上升5%'],
|
||||
consume: 'level > 5 ? 100 * level ** 2 : 250 * level + 1250',
|
||||
consume: 'level > 5 ? 1000 * level ** 2 : 250 * level + 1250',
|
||||
front: [
|
||||
[8, 10],
|
||||
[9, 10]
|
||||
@@ -164,7 +164,7 @@ export const skills: Record<Chapter, Skill[]> = {
|
||||
index: 13,
|
||||
title: '治愈',
|
||||
desc: ['使主角能够更好地回复生命,每级使血瓶的加血量增加2%'],
|
||||
consume: 'level > 5 ? 100 * level ** 2 : 250 * level + 1250',
|
||||
consume: 'level > 5 ? 1000 * level ** 2 : 250 * level + 1250',
|
||||
front: [[10, 3]],
|
||||
loc: [4, 5],
|
||||
max: 20,
|
||||
@@ -177,7 +177,7 @@ export const skills: Record<Chapter, Skill[]> = {
|
||||
'<span style="color: #dd4">第二章终极技能</span>,',
|
||||
'每打一个怪物,勇士在本楼层对怪物造成的伤害便增加1%'
|
||||
],
|
||||
consume: '15000',
|
||||
consume: '25000',
|
||||
front: [
|
||||
[13, 10],
|
||||
[12, 10],
|
||||
|
||||
@@ -531,7 +531,7 @@ export class MinimapDrawer {
|
||||
ctx.lineTo(x - 0.5, y + 1);
|
||||
ctx.lineTo(x + 1.5, y - 1);
|
||||
ctx.stroke();
|
||||
} else {
|
||||
} else if (enemy.length < 2) {
|
||||
const ids = [...new Set(enemy.map(v => v.id))];
|
||||
if (ids.length === 1) {
|
||||
core.drawIcon(ctx, ids[0], x - 2, y - 2, 4, 4);
|
||||
@@ -546,6 +546,11 @@ export class MinimapDrawer {
|
||||
ctx.strokeText('…', x + 4, y);
|
||||
ctx.fillText('…', x + 4, y);
|
||||
}
|
||||
} else {
|
||||
ctx.fillStyle = 'white';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.textBaseline = 'middle';
|
||||
ctx.fillText(`+${enemy.length}`, x, y);
|
||||
}
|
||||
|
||||
ctx.restore();
|
||||
|
||||
Vendored
+2
@@ -593,6 +593,8 @@ interface IdToCls {
|
||||
I663: 'items';
|
||||
I664: 'items';
|
||||
I665: 'items';
|
||||
E666: 'enemys';
|
||||
E667: 'enemys';
|
||||
X20032: 'tileset';
|
||||
X20033: 'tileset';
|
||||
X20034: 'tileset';
|
||||
|
||||
Vendored
+14
-8
@@ -69,14 +69,18 @@ type FloorIds =
|
||||
| 'MT56'
|
||||
| 'MT57'
|
||||
| 'MT58'
|
||||
| 'MT51_M'
|
||||
| 'MT52_M'
|
||||
| 'MT53_M'
|
||||
| 'MT54_M'
|
||||
| 'MT55_M'
|
||||
| 'MT56_M'
|
||||
| 'MT57_M'
|
||||
| 'MT58_M'
|
||||
| 'MT59'
|
||||
| 'MT60'
|
||||
| 'MT61'
|
||||
| 'MT62'
|
||||
| 'MT63'
|
||||
| 'MT64'
|
||||
| 'MT65'
|
||||
| 'MT66'
|
||||
| 'MT67'
|
||||
| 'MT68'
|
||||
| 'MT69'
|
||||
| 'MT71'
|
||||
|
||||
type ImageIds =
|
||||
| 'IQ.png'
|
||||
@@ -185,6 +189,8 @@ type BgmIds =
|
||||
| 'escape.mp3'
|
||||
| 'grass.mp3'
|
||||
| 'mount.mp3'
|
||||
| 'palaceNorth.mp3'
|
||||
| 'palaceSouth.mp3'
|
||||
| 'plot1.mp3'
|
||||
| 'road.mp3'
|
||||
| 'title.mp3'
|
||||
|
||||
Vendored
+4
@@ -593,6 +593,8 @@ interface IdToNumber {
|
||||
I663: 663;
|
||||
I664: 664;
|
||||
I665: 665;
|
||||
E666: 666;
|
||||
E667: 667;
|
||||
X20032: 20032;
|
||||
X20033: 20033;
|
||||
X20034: 20034;
|
||||
@@ -1271,6 +1273,8 @@ interface NumberToId {
|
||||
663: 'I663';
|
||||
664: 'I664';
|
||||
665: 'I665';
|
||||
666: 'E666';
|
||||
667: 'E667';
|
||||
20032: 'X20032';
|
||||
20033: 'X20033';
|
||||
20034: 'X20034';
|
||||
|
||||
Reference in new issue
Block a user