This commit is contained in:
2026-11-14 00:29:34 -03:00
parent 6c6be61dd0
commit 297d87164c
15 changed files with 593 additions and 281 deletions
+1 -5
View File
@@ -6,6 +6,7 @@
// bworld:curio_modifiers component change the wearer's attributes, like curios' attribute modifiers, and ones with
// bworld:curio_unhurt_effect give them an effect once they've gone a while without being hurt
import type { AttributeModifier, Container, ItemStack, Player, ServerContext, TagApi } from "cubi/server";
import { title } from "./shared.ts";
// where the left column of slots goes, from the inventory screen's left edge. the panel around them ends just left of it
const COLUMNS_X = -45;
@@ -169,11 +170,6 @@ function describe({ attribute, amount, operation }: WornModifier): string {
return `${sign}${value} ${name}`;
}
// "bworld:regeneration" is "Regeneration", like minecraft's effect names
function title(id: string): string {
return id.split(":").at(-1)!.split("_").map((word) => word[0].toUpperCase() + word.slice(1)).join(" ");
}
function roman(level: number): string {
return ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"][level - 1] ?? `${level}`;
}