{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "ally": {
      "description": "A co-op peer. Identified by SteamID64 always; an atproto DID is included when we've resolved one for this Steam user.",
      "properties": {
        "atproto": {
          "description": "Atproto DID, when known.",
          "format": "did",
          "type": "string"
        },
        "steam": {
          "description": "SteamID64 as a decimal string.",
          "type": "string"
        }
      },
      "required": [
        "steam"
      ],
      "type": "object"
    },
    "main": {
      "description": "A single Slay the Spire 2 run.",
      "key": "tid",
      "record": {
        "properties": {
          "act": {
            "maximum": 4,
            "minimum": 1,
            "type": "integer"
          },
          "allies": {
            "description": "Other players in a multiplayer run. Each entry always carries the peer's SteamID64; when we've been able to resolve it, the atproto DID is included too.",
            "items": {
              "ref": "#ally",
              "type": "ref"
            },
            "type": "array"
          },
          "ascension": {
            "maximum": 20,
            "minimum": 0,
            "type": "integer"
          },
          "character": {
            "description": "Character class id (e.g. 'ironclad', 'silent').",
            "type": "string"
          },
          "deck": {
            "description": "Card ids in the player's deck.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "durationSeconds": {
            "minimum": 0,
            "type": "integer"
          },
          "endedAt": {
            "format": "datetime",
            "type": "string"
          },
          "floor": {
            "minimum": 0,
            "type": "integer"
          },
          "game": {
            "description": "Optional at-uri of the canonical games.gamesgamesgamesgames.actor.game record for StS2.",
            "format": "at-uri",
            "type": "string"
          },
          "gameVersion": {
            "type": "string"
          },
          "killedBy": {
            "description": "Enemy / event that ended the run, if applicable.",
            "type": "string"
          },
          "modVersion": {
            "type": "string"
          },
          "outcome": {
            "description": "How the run ended.",
            "knownValues": [
              "in_progress",
              "victory",
              "death",
              "abandoned"
            ],
            "type": "string"
          },
          "potions": {
            "description": "Potion ids currently held.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "relics": {
            "description": "Relic ids held at run end.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "score": {
            "minimum": 0,
            "type": "integer"
          },
          "seed": {
            "description": "Run seed as displayed in-game.",
            "type": "string"
          },
          "startedAt": {
            "format": "datetime",
            "type": "string"
          },
          "statsRef": {
            "description": "at-uri of the user's games.gamesgamesgamesgames.actor.stats record for StS2, updated alongside this run.",
            "format": "at-uri",
            "type": "string"
          },
          "updatedAt": {
            "format": "datetime",
            "type": "string"
          }
        },
        "required": [
          "outcome",
          "character",
          "ascension",
          "seed",
          "startedAt",
          "updatedAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "me.byjp.pesos.sts2.run",
  "lexicon": 1
}
