Effect icons and tooltip !
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user