packages: the editor's schema attributes on every .lres-bound record (@Ref, @OneOf, @Asset, @Unit, @Range, @Color, @Text, @Derived, @Key; @AppendOnly/@ByKey) - annotation only
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
48bf705ca4
commit
5197cf4cb8
11 changed files with 56 additions and 49 deletions
|
|
@ -6,19 +6,20 @@ export const CRAFT_HANDS: int = 0
|
|||
# (0 is made at once) and `hold` seconds of holding the button (0 is a click)
|
||||
export property CraftRecipe {
|
||||
key: string = ""
|
||||
out: int = 0
|
||||
@Ref(Items) out: int = 0
|
||||
n: int = 1
|
||||
ins: []int = null
|
||||
@Ref(Items) ins: []int = null
|
||||
ns: []int = null
|
||||
station: int = 0
|
||||
@Ref(Stations) station: int = 0
|
||||
minutes: int = 0
|
||||
hold: float = 0.0
|
||||
group: int = 0
|
||||
@Ref(CraftGroups) group: int = 0
|
||||
learned: bool = true
|
||||
}
|
||||
|
||||
# the game fills it: `def CraftRecipes torch { out: IT_TORCH, ins: [IT_WOOD], ns: [1] }`. A
|
||||
# station holds a recipe by its index, so a game that saves that appends, never inserts.
|
||||
@AppendOnly
|
||||
export open registry CraftRecipes of CraftRecipe as CRAFT
|
||||
|
||||
# a recipe was made: handed over (`queued` false) or put into its station (`queued` true)
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ export property FishKind {
|
|||
chance_deep: float = 0.35 # ... and in deep water
|
||||
need: int = 3 # crossings to land it
|
||||
runs: int = 0 # runs it makes, when the only right answer is to leave the line
|
||||
fight: float = 12.0 # seconds before the line goes slack
|
||||
@Unit("s") fight: float = 12.0 # seconds before the line goes slack
|
||||
speed: float = 0.9 # the marker's sweep, and how much faster each crossing won
|
||||
speed_per_hit: float = 0.0
|
||||
closes: float = 0.0 # the window narrows this much a crossing, down to `floor` of it
|
||||
|
|
@ -19,6 +19,7 @@ export property FishKind {
|
|||
}
|
||||
|
||||
# the game fills it: `def FishSpecies brook { weight: 0.25 }`, and one legend
|
||||
@AppendOnly
|
||||
export open registry FishSpecies of FishKind as FISH
|
||||
|
||||
# what happened on the line
|
||||
|
|
|
|||
|
|
@ -4,26 +4,27 @@
|
|||
# `mult` is per level from 0 (unowned), for the one number a kind scales.
|
||||
export property GearKind {
|
||||
key: string = ""
|
||||
vendor: int = 0
|
||||
@Ref(Vendors) vendor: int = 0
|
||||
icon: string = ""
|
||||
tiers: int = 0
|
||||
blurb: string = ""
|
||||
howto: string = ""
|
||||
@Text @Multiline blurb: string = ""
|
||||
@Text @Multiline howto: string = ""
|
||||
names: []string = null
|
||||
cost: []int = null
|
||||
rep: []int = null
|
||||
item: int = -1
|
||||
@Ref(Items) item: int = -1
|
||||
start: int = 0 # the level a new trip begins at
|
||||
mult: []float = null
|
||||
}
|
||||
|
||||
# saved by key, so order is free
|
||||
@ByKey
|
||||
export open registry GearKinds of GearKind as GEAR
|
||||
|
||||
# a number a kind's tier decides: `at` per level from 0, the last one holding past its end
|
||||
export property GearValue {
|
||||
key: string = ""
|
||||
gear: int = 0
|
||||
@Ref(GearKinds) gear: int = 0
|
||||
at: []float = null
|
||||
}
|
||||
|
||||
|
|
@ -33,10 +34,10 @@ export open registry GearValues of GearValue as GV
|
|||
# `rate` (-1: per_hour) - a flashlight's drain is its tier's. `hand` runs only while held.
|
||||
export property GearCharge {
|
||||
key: string = ""
|
||||
item: int = -1
|
||||
@Ref(Items) item: int = -1
|
||||
full: float = 100.0
|
||||
per_hour: float = 0.0
|
||||
rate: int = -1
|
||||
@Ref(GearValues) rate: int = -1
|
||||
hand: bool = true
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,24 +8,25 @@ export const HINTS_URGENT: int = 3 # do it or lose the day
|
|||
# the game's: `icon` / `picN` name a glyph, `item` / `itemN` a thing's picture instead (-1: none).
|
||||
export property HintCard {
|
||||
key: string = ""
|
||||
urgency: int = HINTS_TIP
|
||||
@OneOf(HINTS_TIP, HINTS_NOTE, HINTS_WARN, HINTS_URGENT) urgency: int = HINTS_TIP
|
||||
icon: string = ""
|
||||
item: int = -1
|
||||
line: string = "" # the chip on the rail: five or six words
|
||||
title: string = "" # the card's heading
|
||||
s1: string = "" # three steps, each with a picture
|
||||
s2: string = ""
|
||||
s3: string = ""
|
||||
@Ref(Items) item: int = -1
|
||||
@Text line: string = "" # the chip on the rail: five or six words
|
||||
@Text title: string = "" # the card's heading
|
||||
@Text s1: string = "" # three steps, each with a picture
|
||||
@Text s2: string = ""
|
||||
@Text s3: string = ""
|
||||
pic1: string = ""
|
||||
pic2: string = ""
|
||||
pic3: string = ""
|
||||
item1: int = -1
|
||||
item2: int = -1
|
||||
item3: int = -1
|
||||
later: string = "" # how not to be here next time
|
||||
@Ref(Items) item1: int = -1
|
||||
@Ref(Items) item2: int = -1
|
||||
@Ref(Items) item3: int = -1
|
||||
@Text @Multiline later: string = "" # how not to be here next time
|
||||
}
|
||||
|
||||
# the game's cards; a card's mute is kept by its key, so their order is free
|
||||
@ByKey
|
||||
export open registry Hints of HintCard as HINT
|
||||
|
||||
export const HINTS_F_OPENED: int = 0 # a card was opened, or the arrows moved to another
|
||||
|
|
|
|||
|
|
@ -13,23 +13,24 @@ export const JOBS_GROUPS: int = 8 # the game's lists (a board of notices, a
|
|||
# narrows it (-1 any), `need` 0 is never ready by counting. Money and rep are paid through JobsPay.
|
||||
export property JobDef {
|
||||
key: string = ""
|
||||
group: int = 0
|
||||
vendor: int = 0
|
||||
kind: int = -1
|
||||
param: int = -1
|
||||
@OneOf(JG_) group: int = 0
|
||||
@Ref(Vendors) vendor: int = 0
|
||||
@Ref(JobKinds) kind: int = -1
|
||||
@Ref(Species) param: int = -1
|
||||
need: int = 1
|
||||
money: int = 0
|
||||
rep: int = 0
|
||||
minrep: int = 0 # standing in its scope before it is offered
|
||||
minstage: int = 0 # how far the game's story must be
|
||||
scope: int = JOBS_SELF
|
||||
title: string = ""
|
||||
text: string = ""
|
||||
how: string = ""
|
||||
@OneOf(JOBS_SELF, JOBS_PARTY, JOBS_OFFERED, JOBS_ACTIVE, JOBS_DONE, JOBS_READY, JOBS_GROUPS) scope: int = JOBS_SELF
|
||||
@Text title: string = ""
|
||||
@Text @Multiline text: string = ""
|
||||
@Text @Multiline how: string = ""
|
||||
icon: string = ""
|
||||
}
|
||||
|
||||
# the game's jobs; saved by key, so order is free
|
||||
@ByKey
|
||||
export open registry Jobs of JobDef as JOB
|
||||
|
||||
# a board of posts rolled by the game (JobsWorld.roll): `keep` days a post stays up, `auto` pays
|
||||
|
|
@ -40,7 +41,7 @@ export property JobBoard {
|
|||
keep: int = 1
|
||||
auto: bool = false
|
||||
refill: bool = true
|
||||
scope: int = JOBS_SELF
|
||||
@OneOf(JOBS_SELF, JOBS_PARTY, JOBS_OFFERED, JOBS_ACTIVE, JOBS_DONE, JOBS_READY, JOBS_GROUPS) scope: int = JOBS_SELF
|
||||
}
|
||||
|
||||
export open registry JobBoards of JobBoard as BOARD
|
||||
|
|
|
|||
|
|
@ -76,8 +76,8 @@ export property NpcStep {
|
|||
from: float = 0.0
|
||||
to: float = 24.0
|
||||
weight: int = 1
|
||||
spot: int = 0
|
||||
act: int = 1
|
||||
@Ref(NpcSpots) spot: int = 0
|
||||
@Ref(NpcActs) act: int = 1
|
||||
lo: int = 10
|
||||
hi: int = 30
|
||||
near: float = 0.0
|
||||
|
|
@ -120,13 +120,14 @@ export property NpcAct {
|
|||
tick: fn(NpcPerson, float) -> bool = null
|
||||
}
|
||||
|
||||
@AppendOnly
|
||||
export open registry NpcActs of NpcAct as NPCA
|
||||
def NpcActs from "acts.lres"
|
||||
|
||||
# a name somebody can have; `body` the game's (a pool per model), so a Nora is drawn as a woman
|
||||
export property NpcName {
|
||||
key: string = ""
|
||||
name: string = ""
|
||||
@Text name: string = ""
|
||||
body: int = 0
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,18 +2,18 @@
|
|||
# anything to say winning, each line in its turn given its `chance`; a line's words are its `text`,
|
||||
# or the story's (NpcTalk.say) when it `fill`s; a line may offer choices, each answered by a line
|
||||
export property NpcChoice {
|
||||
text: string = ""
|
||||
line: string = "" # the key of the line that answers it ("" ends the talk)
|
||||
@Text text: string = ""
|
||||
@Text line: string = "" # the key of the line that answers it ("" ends the talk)
|
||||
code: int = -1 # the game's, carried by the Talked fact
|
||||
}
|
||||
|
||||
export property NpcLine {
|
||||
key: string = ""
|
||||
kind: int = -1 # NPCK_* (-1: anyone)
|
||||
act: int = -1 # NPCA_* (-1: whatever they are doing)
|
||||
@Ref(NpcKinds) kind: int = -1 # NPCK_* (-1: anyone)
|
||||
@Ref(NpcActs) act: int = -1 # NPCA_* (-1: whatever they are doing)
|
||||
prio: int = 0
|
||||
chance: int = 100 # percent: how often this line is even considered
|
||||
text: string = ""
|
||||
@Text text: string = ""
|
||||
fill: bool = false
|
||||
choices: []NpcChoice = null
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,9 +7,9 @@ export const SETTING_TEXT: int = 3
|
|||
|
||||
export property SettingDef {
|
||||
key: string = "" # its name in the file; a registry fills it with the entry's own name
|
||||
kind: int = 0 # SETTING_*
|
||||
@OneOf(SETTING_) kind: int = 0 # SETTING_*
|
||||
num: float = 0.0 # the default: 0 or 1 for a switch, a whole number, a float
|
||||
text: string = "" # the default of a text setting
|
||||
@Text text: string = "" # the default of a text setting
|
||||
lo: float = 0.0 # the range, inclusive; a value outside it is the default again
|
||||
hi: float = -1.0 # hi below lo: any value
|
||||
rescue: bool = false # a rescue start puts it back to its default
|
||||
|
|
|
|||
|
|
@ -31,8 +31,8 @@ export const STEPS_PER_CHAPTER: int = 6
|
|||
|
||||
export property StepsKind {
|
||||
key: string = ""
|
||||
shape: int = STEPS_SHAPE_YES
|
||||
pool: int = STEPS_POOL_WORLD
|
||||
@OneOf(STEPS_SHAPE_) shape: int = STEPS_SHAPE_YES
|
||||
@OneOf(STEPS_POOL_) pool: int = STEPS_POOL_WORLD
|
||||
shows: bool = false # a panel shows its count against what it wants
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export property Thing {
|
|||
|
||||
export property ThingKind {
|
||||
key: string = "" # the entry's own name: what the save calls the kind
|
||||
name: string = "" # what it is called when nothing about the one in front of you changes it
|
||||
@Text name: string = "" # what it is called when nothing about the one in front of you changes it
|
||||
reach: float = 2.2 # how close it is used from, when the Thing does not say
|
||||
personal: bool = false # one belongs to whoever put it down
|
||||
saved: bool = false # the save's section keeps a placed one (the port has the last word)
|
||||
|
|
@ -39,6 +39,7 @@ export property ThingKind {
|
|||
}
|
||||
|
||||
# the game fills it: `def ThingKinds tent { name: "The tent", use: fn tent_use }`
|
||||
@ByKey
|
||||
export open registry ThingKinds of ThingKind as TH
|
||||
|
||||
export const THING_PLACED: int = 0
|
||||
|
|
|
|||
|
|
@ -28,16 +28,16 @@ export const WEATHER_WANT_CLEAR: int = 3 # clear the sky and keep it clear
|
|||
|
||||
# one kind of weather; its place in the list the game hands in is its number
|
||||
export property WeatherKind {
|
||||
name: string = ""
|
||||
@Text name: string = ""
|
||||
clear: bool = false # the kind a sky eases out to: nothing falls, amount goes to 0
|
||||
wet: bool = false # rain or snow is falling (weather_wet)
|
||||
soak: float = 0.0 # how wet the ground gets under it, 0..1
|
||||
@Range(0, 1) soak: float = 0.0 # how wet the ground gets under it, 0..1
|
||||
overcast: float = 0.0
|
||||
cold: float = 0.0 # extra cold per game hour, in the game's units
|
||||
wind: float = 0.2 # the strength the wind builds toward, 0..1
|
||||
@Range(0, 1) wind: float = 0.2 # the strength the wind builds toward, 0..1
|
||||
wind_dir: float = -1.0 # radians the wind blows toward; below 0, the valley's daily turn
|
||||
thunder: bool = false
|
||||
spell_lo: float = 2.0 # game hours a spell lasts, drawn in [lo, hi)
|
||||
@Unit("h") spell_lo: float = 2.0 # game hours a spell lasts, drawn in [lo, hi)
|
||||
spell_hi: float = 8.0
|
||||
odds: []float = null # weights for the next spell, per kind
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue