Hurray weather being crappy. Been staring at this code some more, and I’m thinking a heirarchy of inventories just wont work out.
I tried mapping out some test items for some fun with ConfigReader to get it to recursively run through a .cfg file and spit out a value dependent upon the path taken, but adding in every single item into this is just going to get too massive with a lot of copypasta.
Currently I’m thinking of just armor–there’s Light and Heavy armor, 2 types right there. Those split into 3 subtypes each (Say, Leather/Bone/Mail and Iron/Steel/Plate), and each of those split into their own armor sets for Head/Hands/Legs/Chest/Feet, giving-just of those ones-40 total items to type into a cfg thing. There’s a bit too much gruntwork for inputting by hand the stats for Leather Cuirass, Steel Cuirass, etc, let alone modifiers for some randomization (worn, good, great, etc) and on top of that some other things I’m thinking up will make this just too complicated.
So, obviously I need an alternative way that makes Python and the game do the work for me.
Breaking it down into components, there’s only 8 armor types, and 5 armor locations. If I write up a system that has base values fro armor in a given location, and work with just modifiers (IE, fill hand slots with something and you’ve got +2 defense, if it’s leather +4, worn leather its +3, etc), I can assign base qualities for each place and modifier.
The stats (at minimum) that would need to be tracked are: Picture location on the spritesheet, armor rating, armor type, weight, value, and a description of the object. The only tricky thing would be sprite coords, but if I can rearrange the Player.png file so that the modifiers each have patterns that affect tilelocs, then that shouldnt be too much of a worry.
Plus I can test this out with plain old Python and not even worry about integrating it with pyGame and SDL!