mirror of
https://github.com/unanmed/HumanBreak.git
synced 2026-11-02 09:15:05 +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 };
|
||||
Reference in new issue
Block a user