Add reusable content sets publication previews and focused input handling

This commit is contained in:
dingo
2026-09-08 13:02:20 -04:00
parent 34ab668531
commit 0c8b695483
20 changed files with 1030 additions and 149 deletions
+97 -20
View File
@@ -2,8 +2,103 @@
package protocol
type Protocol struct {
Intent Intent `json:"intent"`
Snapshot Snapshot `json:"snapshot"`
Catalog *ContentCatalog `json:"catalog,omitempty"`
CatalogChange *ContentChange `json:"catalogChange,omitempty"`
CatalogPreview *ContentPreview `json:"catalogPreview,omitempty"`
Intent Intent `json:"intent"`
Snapshot Snapshot `json:"snapshot"`
}
type ContentCatalog struct {
EffectSets []EffectSet `json:"effectSets,omitempty"`
Items []ItemDefinition `json:"items"`
RequirementSets []RequirementSet `json:"requirementSets,omitempty"`
Stats ContentStatsRules `json:"stats"`
Titles []TitleDefinition `json:"titles"`
Version int64 `json:"version"`
}
type EffectSet struct {
Description string `json:"description"`
ID string `json:"id"`
Modifiers []StatModifier `json:"modifiers"`
Name string `json:"name"`
}
type StatModifier struct {
Flat float64 `json:"flat"`
Percent float64 `json:"percent"`
Stat string `json:"stat"`
}
type ItemDefinition struct {
Description string `json:"description"`
DropChance float64 `json:"dropChance"`
ID string `json:"id"`
Modifiers []StatModifier `json:"modifiers"`
Name string `json:"name"`
Requirements ItemRequirements `json:"requirements"`
Slot string `json:"slot"`
Weight float64 `json:"weight"`
}
type ItemRequirements struct {
Level int64 `json:"level"`
Stats map[string]float64 `json:"stats"`
Titles []string `json:"titles"`
}
type RequirementSet struct {
Description string `json:"description"`
ID string `json:"id"`
Name string `json:"name"`
Requirements []ContentRequirement `json:"requirements"`
}
type ContentRequirement struct {
AtLeast int64 `json:"atLeast"`
Metric string `json:"metric"`
}
type ContentStatsRules struct {
Base map[string]float64 `json:"base"`
Coefficients map[string]map[string]float64 `json:"coefficients"`
Version int64 `json:"version"`
}
type TitleDefinition struct {
Description string `json:"description"`
Effects TitleEffects `json:"effects"`
ID string `json:"id"`
Name string `json:"name"`
Requirements []ContentRequirement `json:"requirements"`
Scope string `json:"scope"`
}
type TitleEffects struct {
Damage float64 `json:"damage"`
Modifiers []StatModifier `json:"modifiers"`
MoveSpeed float64 `json:"moveSpeed"`
}
type ContentChange struct {
EffectSet *EffectSet `json:"effectSet,omitempty"`
EffectSetIDS []string `json:"effectSetIds,omitempty"`
ExpectedVersion int64 `json:"expectedVersion"`
ID string `json:"id"`
Item *ItemDefinition `json:"item,omitempty"`
Op string `json:"op"`
Reason string `json:"reason"`
RequirementSet *RequirementSet `json:"requirementSet,omitempty"`
RequirementSetIDS []string `json:"requirementSetIds,omitempty"`
Stats *ContentStatsRules `json:"stats,omitempty"`
Title *TitleDefinition `json:"title,omitempty"`
}
type ContentPreview struct {
BasedOnVersion int64 `json:"basedOnVersion"`
ProposedVersion int64 `json:"proposedVersion"`
Resolved ContentChange `json:"resolved"`
}
type Intent struct {
@@ -94,18 +189,6 @@ type ItemInstance struct {
Weight float64 `json:"weight"`
}
type StatModifier struct {
Flat float64 `json:"flat"`
Percent float64 `json:"percent"`
Stat string `json:"stat"`
}
type ItemRequirements struct {
Level int64 `json:"level"`
Stats map[string]float64 `json:"stats"`
Titles []string `json:"titles"`
}
type StatValue struct {
Base float64 `json:"base"`
Final float64 `json:"final"`
@@ -123,12 +206,6 @@ type TitleAward struct {
WorldID string `json:"worldId"`
}
type TitleEffects struct {
Damage float64 `json:"damage"`
Modifiers []StatModifier `json:"modifiers"`
MoveSpeed float64 `json:"moveSpeed"`
}
type WorldInfo struct {
AgeSeconds float64 `json:"ageSeconds"`
BossHP float64 `json:"bossHp"`