[quote name='ApochPiQ' timestamp='1310253763' post='4833188']
You need to have a separate instance of Weapon for each actual "physical" weapon item in the game. Then, store a container of Items that are equipped per player. When a player equips a specific item, move the corresponding instance into the container. When unequipping, move back out and into a "on the ground" or "shared among the party" container, or something like that.
Thanks for the reply!
I can picture this, for my weapon constructor i've done that, for each seperate equippable weapon in the game I construct the weapon like so...
//somewhat pseudo code;
Weapon Dagger = new Weapon([i]arguments);
[/i]Weapon Slingshot = new Weapon([i]arguments[/i]);
Inventory.addItem(Slingshot); //Let's say the character's inventory class contains a Dagger, and a Slingshot already
for(Item i : Game.n.inv.userTotalItems) //Item are abstract classes that include Weapons/Items/Armor/Key Items etc with Constructors for each different type
//So for each item that is in the userTotalItem(ArrayList of total items by the user), of the inventory class(inv), which is located in my (equipmentMenu), in the game
if(i.slotType == selectedSlot.slotType && !i.equipped) (if the slot type of the equippable item matches the actual slot's slot type and it is equipped)
else if(i.slotType == selectedSlot.slotType && i.equipped) (if the slot type of the equippable item matches the actual slot's slot type and it isn't equipped)
System.out.println(listNum+". "+i.name+" ("+i.slotType+") ("+i.owner.name+")");
I think im having problems first off with this block of cde, it only lists the inventory as having one item in the inventory ...
Blagh, I guess what I'm trying to figure out is how to instantiate objects in java?