mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-03 18:24:30 +08:00
feat: 勇士显伤
This commit is contained in:
1 parent
c242018ee8
commit
b3e3ae5f8e
3 files changed
+47
No files matched your search
@@ -0,0 +1,33 @@
|
||||
function drawHeroDetail(px: number, py: number) {
|
||||
if (!core.getLocalStorage('heroDetail', false)) return;
|
||||
const { hp, atk, def } = core.status.hero;
|
||||
const toDraw = {
|
||||
atk: {
|
||||
value: atk,
|
||||
color: '#FF7A7A'
|
||||
},
|
||||
def: {
|
||||
value: def,
|
||||
color: '#00E6F1'
|
||||
},
|
||||
hp: {
|
||||
value: hp,
|
||||
color: '#F9FFFF0'
|
||||
}
|
||||
};
|
||||
|
||||
let i = 0;
|
||||
for (const [key, value] of Object.entries(toDraw)) {
|
||||
const ctx = core.canvas['hero'].canvas;
|
||||
core.fillBoldText(
|
||||
ctx,
|
||||
value.value.toString(),
|
||||
px,
|
||||
py - 10 * i,
|
||||
value.color as string
|
||||
);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
export { drawHeroDetail };
|
||||
@@ -13,11 +13,17 @@ import {
|
||||
setShadowNodes
|
||||
} from './shadow';
|
||||
import { pColor } from '../utils';
|
||||
import { drawHeroDetail } from '../game/fx/heroDetail';
|
||||
|
||||
export default function init() {
|
||||
const origin4 = control.prototype.drawHero;
|
||||
control.prototype.drawHero = function () {
|
||||
origin4.apply(core.control, arguments);
|
||||
drawHeroDetail(
|
||||
core.status.heroCenter.px - 16,
|
||||
core.status.heroCenter.py + 20
|
||||
);
|
||||
|
||||
if (core.getFlag('__heroOpacity__') !== 0) {
|
||||
getAllLights().forEach(v => {
|
||||
if (!v.followHero) return;
|
||||
|
||||
Reference in new issue
Block a user