Effect icons and tooltip !

This commit is contained in:
2026-10-02 13:16:50 -03:00
parent e560cb3928
commit f749f6be79
22 changed files with 131 additions and 19 deletions
+3
View File
@@ -140,6 +140,8 @@ export interface EffectJson {
category?: EffectCategory;
// happens once when added instead of lasting, like instant health. its components' on_tick runs once
instant?: boolean;
// a texture, shown at the top of the inventory screen while the player has it
icon?: string;
// attribute modifiers while it's on, for level 1. each level adds that much again, like minecraft's speed
modifiers?: { attribute: string; amount: number; operation: EffectModifierOperation }[];
components?: Record<string, unknown>;
@@ -809,6 +811,7 @@ export function validate_effect(json: unknown): Problems {
problems.push('category must be "beneficial", "harmful" or "neutral"');
}
if (json.instant !== undefined && typeof json.instant !== "boolean") problems.push("instant must be true or false");
if (json.icon !== undefined) problems.push(...validate_id(json.icon, "icon"));
if (json.modifiers !== undefined) {
if (!Array.isArray(json.modifiers)) {
problems.push("modifiers must be a list");