This is both a test of the issue tracker and a legitimate question.
There are two ways to handle the equipped gear set (egs) structure. The
first is to define egs slots by name, as such:
egs.head
egs.shoulder
egs.chest
and so forth. Each of these would be its own structure, so that typing
egs.head.sta
would return the amount of stamina on the equipped head slot item.
This has the advantage of being very straightforward and easy to code and
remember. The downside is that if we want, for example, to pull out the
total stamina contribution from gear, we need to do it by hand:
total_sta = egs.head.sta+egs.shoulder.sta+egs.chest.sta+...
Another possibility is to store the egs structure very similarly to the idb
structure. Each slot gets an index that corresponds to the slot id
in-game. This makes egs a 1xN structure array, where N is the number of
slots on the paper doll.
The advantage here is that every slot has the same stat fields, so
calculations of total contributions are very easy. The total stam is just:
sum([egs.sta]).
I'm leaning towards the second one, even though that means we'll have to
remember all the slot IDs. We could potentially work around this by adding
a second, optional argument to the equip() function that specifies the
slot. The second argument could take numeric or string inputs so that
equip(12345,'head')
would equip item 12345 in the head slot.
Original issue reported on code.google.com by theckhd on 3 Jun 2010 at 8:09
Original issue reported on code.google.com by
theckhd
on 3 Jun 2010 at 8:09