Files
sacred_k/src/mods/skillslots.h
T
khallaandClaude Opus 5.5 998e315d98 Inventories: data for slots 6-7, JSON in save files
Weapon sets and combat-art slots 6-7 live in a shadow inventory per
inventory; the slot methods run the original code on it for slots >= 5,
so item references, icon resources and selection events stay the
game's own. Save games (cInventoryManager::Serialize) and hero files
(saveHero / loadHero) store inventories as JSON ("SRIJ" + length);
vanilla blocks are still read, which migrates old saves. Multiplayer
transfers keep the binary format. nlohmann/json fetched via git.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-15 00:26:35 +02:00

28 lines
994 B
C++

#pragma once
#include <cstddef>
#include <cstdint>
namespace mods::skillslots {
// Weapon sets and combat-art slots per inventory: the game's 5 plus 2 kept in
// a shadow inventory (see skillslots.cpp).
constexpr unsigned kSlots = 7;
constexpr unsigned kGameSlots = 5;
// cInventoryEntry layout (docs/skill-slots.md).
constexpr size_t kInventorySize = 0x1180;
constexpr size_t kWeaponSets = 0xc18; // kGameSlots x 2 hands x {item id, 2 dwords}
constexpr size_t kWeaponSetSize = 0x18;
constexpr size_t kWeaponHandSize = 0xc;
constexpr size_t kArtSlots = 0xc90; // kGameSlots x 2 variants x {u16 type, u16 data, 4 dwords}
constexpr size_t kArtSlotSize = 0x28;
constexpr size_t kArtEntrySize = 0x14;
constexpr size_t kSelected = 0xd58; // u16 [0] weapon set, [1] art slot
// The shadow inventory holding slots 6-7 (at indices 0-1) of `inventory`, or
// null if it has none yet and `create` is false.
uint8_t* ShadowFor(const void* inventory, bool create);
} // namespace mods::skillslots