fix: 细节bug

This commit is contained in:
AncTe committed 2024-04-27 11:54:59 +08:00
1 parent 8cea9ba7f4
commit c5492e1e77
25 files changed
+328 -87

No files matched your search

+1 -1
View File
@@ -67,7 +67,7 @@ export class BgmController
* @param when 切换至的歌从什么时候开始播放,默认-1,表示不改变,整数表示设置为目标值
*/
changeTo(id: BgmIds, when: number = -1, noStack: boolean = false) {
if (id === this.now) return;
if (id === this.now) return this.resume();
let prevent = false;
const preventDefault = () => {
prevent = true;
+58 -1
View File
@@ -1,6 +1,11 @@
import { KeyCode } from '@/plugin/keyCodes';
import { Hotkey, HotkeyJSON } from '../custom/hotkey';
import { generateBinary, keycode, openDanmakuPoster } from '@/plugin/utils';
import {
generateBinary,
keycode,
openDanmakuPoster,
tip
} from '@/plugin/utils';
import { hovered } from './fixed';
import { hasMarkedEnemy, markEnemy, unmarkEnemy } from '@/plugin/mark';
import { mainUi } from './ui';
@@ -203,6 +208,23 @@ gameKey
alt: true
})
// --------------------
.group('skill', '技能按键')
.register({
id: 'skill1',
name: '断灭之刃',
defaults: KeyCode.Digit1
})
.register({
id: 'skill2',
name: '跳跃',
defaults: KeyCode.Digit2
})
.register({
id: 'skill3',
name: '铸剑为盾',
defaults: KeyCode.Digit3
})
// --------------------
.group('system', '系统按键')
.register({
id: 'restart',
@@ -500,6 +522,41 @@ gameKey
})
.realize('comment', () => {
core.actions._clickGameInfo_openComments();
})
.realize('skill1', () => {
if (!flags.bladeOn) return;
if (flags.autoSkill) {
tip('error', '已开启自动切换技能!');
return;
}
core.playSound('光标移动');
if (flags.blade) flags.blade = false;
else flags.blade = true;
core.updateStatusBar();
})
.realize('skill2', () => {
if (
!flags.chase &&
!core.status.floorId.startsWith('tower') &&
flags.skill2
) {
Mota.Plugin.require('skill_g').jumpSkill();
} else {
if (core.hasItem('pickaxe')) {
core.useItem('pickaxe');
}
}
})
.realize('skill3', () => {
if (!flags.shieldOn) return;
if (flags.autoSkill) {
tip('error', '已开启自动切换技能!');
return;
}
core.playSound('光标移动');
if (flags.shield) flags.shield = false;
else flags.shield = true;
core.updateStatusBar();
});
// ----- Storage
+7 -4
View File
@@ -12,10 +12,7 @@ export function setGameCanvasFilter(filter: string) {
});
}
const filterMap: [FloorIds[], string][] = [
[['MT50'], 'brightness(80%)contrast(120%)'], // 童心佬的滤镜(
[['MT51'], 'brightness(90%)contrast(120%)'] // 童心佬的滤镜(
];
const filterMap: [FloorIds[], string][] = [];
export function getCanvasFilterByFloorId(
floorId: FloorIds = core.status.floorId
@@ -28,3 +25,9 @@ export function setCanvasFilterByFloorId(
) {
setGameCanvasFilter(getCanvasFilterByFloorId(floorId));
}
Mota.require('var', 'loading').once('coreInit', () => {
filterMap.push(
[core.floorIds.slice(60), 'brightness(80%)contrast(120%)'] // 童心佬的滤镜(
);
});
+2
View File
@@ -116,6 +116,7 @@ function checkMockery(loc: string, force: boolean = false) {
const dir = x > tx ? 'left' : x < tx ? 'right' : y > ty ? 'up' : 'down';
const { x: dx, y: dy } = core.utils.scan[dir];
action.push({ type: 'forbidSave', forbid: true });
action.push({ type: 'changePos', direction: dir });
const blocks = core.getMapBlocksObj();
while (1) {
@@ -164,6 +165,7 @@ function checkMockery(loc: string, force: boolean = false) {
function: `function() { core.checkBlock(true); }`
});
action.push({ type: 'stopAsync' });
action.push({ type: 'forbidSave' });
core.insertAction(action);
}
}
+1 -1
View File
@@ -3,7 +3,7 @@ const haloColor: Record<number, string[]> = {
25: ['purple'],
26: ['blue'],
27: ['red'],
29: ['#BD0D0D']
29: ['#C3D100']
};
export function drawHalo(
+2
View File
@@ -105,6 +105,7 @@ function drawItemDetail(diff: any, x: number, y: number) {
if (typeof diff[name] === 'number')
content = core.formatBigNumber(diff[name], true);
else content = diff[name];
switch (name) {
case 'atk':
case 'atkper':
@@ -125,6 +126,7 @@ function drawItemDetail(diff: any, x: number, y: number) {
case 'hpmaxper':
color = '#F9FF00';
break;
case 'manaper':
case 'mana':
color = '#c66';
break;
+28
View File
@@ -116,4 +116,32 @@ export function init() {
core.replay();
return true;
});
core.registerReplayAction('skill', name => {
if (!name.startsWith('skill:')) return false;
const [type, skill] = name.split(':');
if (skill === '1') {
if (flags.autoSkill || !flags.bladeOn) return true;
if (flags.blade) flags.blade = false;
else flags.blade = true;
} else if (skill === '2') {
if (
!flags.chase &&
!core.status.floorId.startsWith('tower') &&
flags.skill2
) {
Mota.Plugin.require('skill_g').jumpSkill();
} else {
if (core.hasItem('pickaxe')) {
core.useItem('pickaxe');
}
}
} else if (skill === '3') {
if (flags.autoSkill || !flags.shieldOn) return true;
if (flags.shield) flags.shield = false;
else flags.shield = true;
}
core.updateStatusBar();
return true;
});
}
+13 -1
View File
@@ -95,11 +95,23 @@ const shadowInfo: Partial<Record<FloorIds, Light[]>> = {
color: 'transparent',
followHero: true
}
],
MT52: [
{
id: 'mt52_hero',
x: 0,
y: 0,
decay: 50,
r: 250,
color: 'transparent',
followHero: true
}
]
};
const backgroundInfo: Partial<Record<FloorIds, Color>> = {
MT50: pColor('#0006'),
MT51: pColor('#0004')
MT51: pColor('#0004'),
MT52: pColor('#0004')
};
const blurInfo: Partial<Record<FloorIds, number>> = {};
const immersionInfo: Partial<Record<FloorIds, number>> = {};
+1
View File
@@ -68,6 +68,7 @@ export function initShadowCanvas() {
const h = core._PY_ ?? core.__PIXELS__;
ctx = core.createCanvas('shadow', -32, -32, w + 64, h + 64, 55);
canvas = ctx.canvas;
const s = core.domStyle.scale * devicePixelRatio;
temp1.width = (w + 64) * s;
temp1.height = (h + 64) * s;
+4
View File
@@ -589,6 +589,10 @@ interface IdToCls {
E659: 'enemys';
T660: 'terrains';
T661: 'terrains';
I662: 'items';
I663: 'items';
I664: 'items';
I665: 'items';
X20032: 'tileset';
X20033: 'tileset';
X20034: 'tileset';
+4
View File
@@ -187,4 +187,8 @@ interface ItemDeclaration {
I589: 'equips';
I641: 'equips';
I642: 'constants';
I662: 'equips';
I663: 'items';
I664: 'items';
I665: 'items';
}
+8
View File
@@ -589,6 +589,10 @@ interface IdToNumber {
E659: 659;
T660: 660;
T661: 661;
I662: 662;
I663: 663;
I664: 664;
I665: 665;
X20032: 20032;
X20033: 20033;
X20034: 20034;
@@ -1263,6 +1267,10 @@ interface NumberToId {
659: 'E659';
660: 'T660';
661: 'T661';
662: 'I662';
663: 'I663';
664: 'I664';
665: 'I665';
20032: 'X20032';
20033: 'X20033';
20034: 'X20034';
+16 -2
View File
@@ -208,10 +208,9 @@ gameKey
});
function bgm() {
core.triggerBgm();
// core.triggerBgm();
soundChecked.value = !soundChecked.value;
mainSetting.setValue('audio.bgmEnabled', soundChecked.value);
console.log(mainSetting.getValue('audio.bgmEnabled'));
}
async function setFullscreen() {
@@ -642,4 +641,19 @@ onUnmounted(() => {
transform: translateX(-20px);
opacity: 0;
}
@media screen and (max-width: 600px) {
#buttons {
font-size: 250%;
}
#start-main {
#title {
font-size: 700%;
}
#settings {
font-size: 400%;
}
}
}
</style>