xyvera/content/schema/resource.yaml

97 lines
2.7 KiB
YAML
Raw Permalink Normal View History

# resource.yaml — schema definition for resource/currency type definitions
#
# Defines what each resource is, how it behaves, and display metadata.
# The economy starts with seven core resources as specified in the concept doc.
$schema: "xyvera/content-schema/resource/v1"
type: object
required:
- id
- name
- category
- description
properties:
id:
type: string
pattern: "^[a-z][a-z0-9_]*$"
description: "Matches the wallet key and all internal references."
example: "wood"
name:
type: string
example: "Wood"
description:
type: string
example: "Basic construction material harvested from forested areas."
category:
type: string
enum:
- soft_currency # gold, wood, stone — general economy resources
- knowledge # research and skill upgrade material
- stamina # action budget (not in core 7, reserved for future)
- premium # diamond — sparse, monetisation-adjacent
- ascension # character ascension materials
- event # event-specific temporary currencies
- guild # guild and territory tokens
description: "Resource family used to group items in UI and apply economy rules."
is_spendable:
type: boolean
default: true
description: "Can this resource be directly spent by the player? False for passive trackers."
is_capped:
type: boolean
default: false
description: "Whether this resource has a maximum carry limit."
carry_cap:
type: integer
minimum: 1
description: "Maximum held quantity. Only meaningful when is_capped is true."
decay_rate:
type: number
minimum: 0.0
default: 0.0
description: "Fraction lost per hour (0 = no decay). Reserved for future scarcity mechanics."
icon:
type: string
description: "Path to the icon asset relative to godot/assets/."
example: "icons/resources/wood.png"
color_hex:
type: string
pattern: "^#[0-9a-fA-F]{6}$"
description: "UI accent color for this resource."
example: "#8B5E3C"
sources:
type: array
description: >
Informational list of where this resource comes from.
Used to power the inventory help tooltip so players always know
how to get more of it. (Economy Rule 4: inventory confusion is an economy bug.)
items:
type: string
example:
- "Lumber Camp passive output"
- "Manual wood-chopping action"
- "Event shop purchase"
sinks:
type: array
description: "Informational list of what this resource is spent on."
items:
type: string
example:
- "Building upgrades"
- "Character ascension materials"
- "Construction job slot unlocks"