Signal "out of blood" in HUD and on map
This commit is contained in:
parent
c84affb8c2
commit
258795d76c
@ -5,6 +5,7 @@ export const BG_WALL_OR_UNREVEALED = Color.parseHexCode("#143464");
|
||||
export const BG_INSET = Color.parseHexCode("#242234");
|
||||
export const FG_TEXT = Color.parseHexCode("#c0c0c0");
|
||||
export const FG_TEXT_DISABLED = Color.parseHexCode("#808080");
|
||||
export const FG_TOO_EXPENSIVE = Color.parseHexCode("#ff8080");
|
||||
export const FG_BOLD = Color.parseHexCode("#ffffff");
|
||||
export const BG_CEILING = Color.parseHexCode("#143464");
|
||||
export const FG_MOULDING = FG_TEXT;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { D } from "./engine/public.ts";
|
||||
import { Point, Size } from "./engine/datatypes.ts";
|
||||
import { BG_OUTER, FG_BOLD, FG_TEXT } from "./colors.ts";
|
||||
import {BG_OUTER, FG_BOLD, FG_TEXT, FG_TOO_EXPENSIVE} from "./colors.ts";
|
||||
import { ALL_STATS } from "./datatypes.ts";
|
||||
import { getPlayerProgress } from "./playerprogress.ts";
|
||||
import { getHuntMode } from "./huntmode.ts";
|
||||
@ -40,7 +40,10 @@ export class Hud {
|
||||
D.drawText("EXP", new Point(0, 144), FG_BOLD);
|
||||
D.drawText(`${prog.getExperience()}`, new Point(32, 144), FG_TEXT);
|
||||
D.drawText("BLD", new Point(0, 160), FG_BOLD);
|
||||
D.drawText(`${prog.getBlood()}cc`, new Point(32, 160), FG_TEXT);
|
||||
let bloodAmount = prog.getBlood();
|
||||
let bloodColor = FG_TEXT;
|
||||
if (bloodAmount < 100) { bloodColor = FG_TOO_EXPENSIVE; }
|
||||
D.drawText(`${prog.getBlood()}cc`, new Point(32, 160), bloodColor);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@ import {
|
||||
BG_WALL_OR_UNREVEALED,
|
||||
FG_BOLD,
|
||||
FG_MOULDING,
|
||||
FG_TEXT,
|
||||
FG_TEXT, FG_TOO_EXPENSIVE,
|
||||
} from "./colors.ts";
|
||||
import { getPlayerProgress } from "./playerprogress.ts";
|
||||
import { Architecture, LoadedNewMap } from "./newmap.ts";
|
||||
@ -171,19 +171,33 @@ export class HuntMode {
|
||||
|
||||
// draw inset zone
|
||||
let cost = this.#computeCostToClick(mapPosition);
|
||||
let tooExpensive = cost != null && (cost > getPlayerProgress().getBlood());
|
||||
this.drawpile.addClickable(
|
||||
OFFSET_FLOOR,
|
||||
(hover: boolean) => {
|
||||
let highlighted = hover;
|
||||
if (cost == null) {
|
||||
highlighted = false;
|
||||
}
|
||||
if (!(pickup?.advertisesClickable() ?? true)) {
|
||||
highlighted = false;
|
||||
}
|
||||
gridArt.drawFloor(highlighted ? FG_TEXT : BG_INSET);
|
||||
|
||||
let color = BG_INSET;
|
||||
if (highlighted) {
|
||||
color = FG_TEXT;
|
||||
if (tooExpensive) {
|
||||
color = FG_TOO_EXPENSIVE;
|
||||
}
|
||||
}
|
||||
|
||||
gridArt.drawFloor(color);
|
||||
pickup?.drawFloor(gridArt);
|
||||
},
|
||||
gridArt.floorRect,
|
||||
cost != null && cost <= getPlayerProgress().getBlood(),
|
||||
true,
|
||||
() => {
|
||||
if (cost == null || tooExpensive) { return; }
|
||||
if (pickup?.onClick(cellData)) {
|
||||
return;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user