Add item actions, targeting, bindings, and encumbrance

This commit is contained in:
dingo
2026-09-10 20:57:36 -04:00
parent 32955eca09
commit 9b01ee38e3
38 changed files with 1297 additions and 77 deletions
+50 -14
View File
@@ -2,16 +2,18 @@
package protocol
type Protocol struct {
Catalog *ContentCatalog `json:"catalog,omitempty"`
CatalogChange *ContentChange `json:"catalogChange,omitempty"`
CatalogPreview *ContentPreview `json:"catalogPreview,omitempty"`
CatalogResult *ContentResult `json:"catalogResult,omitempty"`
CraftRequest *CraftRequest `json:"craftRequest,omitempty"`
CraftResult *CraftResult `json:"craftResult,omitempty"`
HouseRequest *HouseRequest `json:"houseRequest,omitempty"`
HouseState *HouseState `json:"houseState,omitempty"`
Intent Intent `json:"intent"`
Snapshot Snapshot `json:"snapshot"`
Catalog *ContentCatalog `json:"catalog,omitempty"`
CatalogChange *ContentChange `json:"catalogChange,omitempty"`
CatalogPreview *ContentPreview `json:"catalogPreview,omitempty"`
CatalogResult *ContentResult `json:"catalogResult,omitempty"`
CraftRequest *CraftRequest `json:"craftRequest,omitempty"`
CraftResult *CraftResult `json:"craftResult,omitempty"`
HouseRequest *HouseRequest `json:"houseRequest,omitempty"`
HouseState *HouseState `json:"houseState,omitempty"`
Intent Intent `json:"intent"`
ItemActionRequest *ItemActionRequest `json:"itemActionRequest,omitempty"`
ItemActionResult *ItemActionResult `json:"itemActionResult,omitempty"`
Snapshot Snapshot `json:"snapshot"`
}
type ContentCatalog struct {
@@ -125,10 +127,11 @@ type MobSpawn struct {
}
type CraftingContent struct {
Materials []CraftMaterial `json:"materials"`
Professions []GatheringSkill `json:"professions"`
Recipes []CraftRecipe `json:"recipes"`
Rules CraftRules `json:"rules"`
Materials []CraftMaterial `json:"materials"`
Professions []GatheringSkill `json:"professions"`
RecipeHistory []CraftRecipe `json:"recipeHistory,omitempty"`
Recipes []CraftRecipe `json:"recipes"`
Rules CraftRules `json:"rules"`
}
type CraftMaterial struct {
@@ -212,6 +215,12 @@ type GatheringConsumable struct {
Modifiers []StatModifier `json:"modifiers"`
Name string `json:"name"`
Seconds float64 `json:"seconds"`
UseEffect *ItemUseEffect `json:"useEffect,omitempty"`
}
type ItemUseEffect struct {
Amount float64 `json:"amount"`
Kind string `json:"kind"`
}
type ResourceDefinition struct {
@@ -409,6 +418,7 @@ type GatheringConsumableDraft struct {
Modifiers []StatModifier `json:"modifiers"`
Name string `json:"name"`
Seconds float64 `json:"seconds"`
UseEffect *ItemUseEffect `json:"useEffect,omitempty"`
}
type CraftMaterialDraft struct {
@@ -688,6 +698,7 @@ type CraftProvenance struct {
type ItemInstance struct {
Attack *CombatAttack `json:"attack,omitempty"`
Coating *WeaponCoating `json:"coating,omitempty"`
DefinitionID string `json:"definitionId"`
Description string `json:"description"`
Equippable bool `json:"equippable"`
@@ -704,6 +715,13 @@ type ItemInstance struct {
Weight float64 `json:"weight"`
}
type WeaponCoating struct {
Damage float64 `json:"damage"`
ExpiresAt float64 `json:"expiresAt"`
Name string `json:"name"`
Source string `json:"source"`
}
type HouseFurniture struct {
Contents HouseInventory `json:"contents"`
Item ItemInstance `json:"item"`
@@ -720,6 +738,23 @@ type Intent struct {
Z float64 `json:"z"`
}
type ItemActionRequest struct {
CharacterID string `json:"characterId"`
ID string `json:"id"`
Item string `json:"item"`
Op string `json:"op"`
Quantity int64 `json:"quantity"`
Slot string `json:"slot"`
Target string `json:"target"`
}
type ItemActionResult struct {
ID string `json:"id"`
Message string `json:"message"`
Recipe *KnownRecipe `json:"recipe,omitempty"`
Returned map[string]int64 `json:"returned"`
}
type Snapshot struct {
ChunkKeys []string `json:"chunkKeys"`
Chunks []Chunk `json:"chunks"`
@@ -815,6 +850,7 @@ type Character struct {
Level int64 `json:"level"`
Mana float64 `json:"mana"`
ManaChoices int64 `json:"manaChoices"`
MovementFactor *float64 `json:"movementFactor,omitempty"`
PendingVitalChoices int64 `json:"pendingVitalChoices"`
PlayedSeconds float64 `json:"playedSeconds"`
Powers map[string]LearnedPower `json:"powers,omitempty"`