Hi, I'm currently working on an inventory system for my RPG, it's a Text RPG, so not too much data is required, however, I was wondering, how (If at all possible) I could create an array of say, 100 items, and each item has a string and 5 integers assigned to it, so for example, if items(1) is a sword, it would be the following:
DIM items(100)
items(1)[name$,hpmod,mpmod,atkmod,defmod,magmod]
I'm aware that may not be the correct code to do that, but it shows what I mean, so then a sword would be:
["Sword",0,0,2,0,0]
the 5 mod ints are added to their respective stats while the item is equipped, for example, if some cursed armour has:
["Cursed Armour",-10,0,0,5,0]
then wearing it would decrease your max hp by 10, but increase Defence by 5
The reason I want to use an array is because the only other way I can think of doing it would be with a function sort of like this:
FUNCTION getitem(ID)
if ID = 1
itemname$ = "Sword"
hpmod = 0
mpmod = 0
atkmod = 2
defmod = 0
magmod = 0
endif
if ID = 2
itemname$ = "Spear"
hpmod = 0
mpmod = 0
atkmod = 1
defmod = 1
magmod = 0
endif
And adding an 8 line if statement for every single item.
Thanks in advance for any help.