融化怪的光环显示

This commit is contained in:
unanmed 2023-07-28 12:02:33 +08:00
parent 9b69639c40
commit 26f74f9415
3 changed files with 22 additions and 11 deletions

View File

@ -1,4 +1,4 @@
import { boundary, equal } from './utils'; import { equal } from './utils';
import { getHeroStatusOf, getHeroStatusOn } from './hero'; import { getHeroStatusOf, getHeroStatusOn } from './hero';
import { Range, RangeCollection } from './range'; import { Range, RangeCollection } from './range';
import { import {
@ -53,8 +53,8 @@ interface MapDamage {
interface HaloData<T extends keyof HaloType = keyof HaloType> { interface HaloData<T extends keyof HaloType = keyof HaloType> {
type: T; type: T;
data: HaloType[T]; data: HaloType[T];
from: DamageEnemy;
special: number; special: number;
from?: DamageEnemy;
} }
interface DamageDelta { interface DamageDelta {
@ -1110,7 +1110,6 @@ declare global {
damage: { damage: {
Enemy: typeof DamageEnemy; Enemy: typeof DamageEnemy;
Collection: typeof EnemyCollection; Collection: typeof EnemyCollection;
ensureFloorDamage: typeof ensureFloorDamage;
}; };
} }
@ -1121,6 +1120,5 @@ declare global {
core.plugin.damage = { core.plugin.damage = {
Enemy: DamageEnemy, Enemy: DamageEnemy,
Collection: EnemyCollection, Collection: EnemyCollection
ensureFloorDamage
}; };

View File

@ -1,5 +1,6 @@
const haloColor: Record<number, string[]> = { const haloColor: Record<number, string[]> = {
21: ['cyan'], 21: ['cyan'],
25: ['purple'],
26: ['blue'], 26: ['blue'],
27: ['red'] 27: ['red']
}; };
@ -11,7 +12,20 @@ export function drawHalo(
) { ) {
if (main.replayChecking) return; if (main.replayChecking) return;
if (!core.getLocalStorage('showHalo', true)) return; if (!core.getLocalStorage('showHalo', true)) return;
const list = core.status.maps[floorId].enemy.haloList; const list = core.status.maps[floorId].enemy.haloList.concat(
Object.keys(flags[`melt_${floorId}`] ?? {}).map(v => {
const [x, y] = v.split(',').map(v => parseInt(v));
return {
type: 'square',
data: {
x,
y,
d: 3
},
special: 25
};
})
);
ctx.save(); ctx.save();
for (const halo of list) { for (const halo of list) {
if (halo.type === 'square') { if (halo.type === 'square') {

View File

@ -4,12 +4,11 @@ import { drawHalo } from './halo';
// 伤害弹出 // 伤害弹出
// 复写阻激夹域检测 // 复写阻激夹域检测
control.prototype.checkBlock = function (forceMockery: boolean = false) { control.prototype.checkBlock = function (forceMockery: boolean = false) {
var x = core.getHeroLoc('x'), const x = core.getHeroLoc('x'),
y = core.getHeroLoc('y'), y = core.getHeroLoc('y'),
loc = x + ',' + y; loc = x + ',' + y;
const floor = core.status.floorId; const info = core.status.thisMap.enemy.mapDamage[loc];
const info = core.status.maps[floor].enemy.mapDamage[loc]; const damage = info?.damage;
var damage = info.damage;
if (damage) { if (damage) {
if (!main.replayChecking) { if (!main.replayChecking) {
core.addPop( core.addPop(
@ -20,7 +19,7 @@ control.prototype.checkBlock = function (forceMockery: boolean = false) {
} }
core.status.hero.hp -= damage; core.status.hero.hp -= damage;
const type = Array.from(info.type.keys()); const type = Array.from(info.type.keys());
var text = type.join('') || '伤害'; const text = type.join('') || '伤害';
core.drawTip('受到' + text + damage + '点'); core.drawTip('受到' + text + damage + '点');
core.drawHeroAnimate('zone'); core.drawHeroAnimate('zone');
this._checkBlock_disableQuickShop(); this._checkBlock_disableQuickShop();