// OrcStronghold.c
#include "Player.c"
...
Item* inv_slots[13];
inv_slots = new(Item);
...
function main()
{
...
// Creating equipment items to be used in inventory bag (.pcx images to click
// and drag among slots in inventory bag)
item_shield = inv_create_item(1,0,"shield.pcx","shield.pcx");
item_apple = inv_create_item(1,0,"apple.pcx","apple.pcx");
item_sword = inv_create_item(0,1,"steel_sword.pcx","steel_sword.pcx");
item_mace = inv_create_item(0,1,"mace.pcx","mace.pcx");
item_gold = inv_create_item(1,0,"gold_coins.pcx","gold_coins.pcx");
bag = inv_create_bag(1,"leather_seam.pcx"); // <---- added this line
// START OF INVENTORY BAG
// ACTIVE ITEM SLOT
inv_slots[0] = inv_add_slot_to_bag(bag,0,1,"leather_texture.pcx",9,60);
// Active Weapon slot
// EACH ROW OF INVENTORY BAG IS SPACED OUT BY 64 HEIGHT
// FIRST ROW OF INVENTORY BAG
inv_slots[1] = inv_add_slot_to_bag(bag,1,0,"leather_texture.pcx",9,150);
inv_slots[2] = inv_add_slot_to_bag(bag,2,0,"leather_texture.pcx",70,150);
inv_slots[3] = inv_add_slot_to_bag(bag,3,0,"leather_texture.pcx",130,150);
inv_slots[4] = inv_add_slot_to_bag(bag,4,0,"leather_texture.pcx",190,150);
// SECOND ROW OF INVENTORY BAG
inv_slots[5] = inv_add_slot_to_bag(bag,5,0,"leather_texture.pcx",9,214);
inv_slots[6] = inv_add_slot_to_bag(bag,6,0,"leather_texture.pcx",70,214);
inv_slots[7] = inv_add_slot_to_bag(bag,7,0,"leather_texture.pcx",130,214);
inv_slots[8] = inv_add_slot_to_bag(bag,8,0,"leather_texture.pcx",190,214);
// THIRD ROW OF INVENTORY BAG
inv_slots[9] = inv_add_slot_to_bag(bag,9,0,"leather_texture.pcx",9,278);
inv_slots[10] = inv_add_slot_to_bag(bag,10,0,"leather_texture.pcx",70,278);
inv_slots[11] = inv_add_slot_to_bag(bag,11,0,"leather_texture.pcx",130,278);
inv_slots[12] = inv_add_slot_to_bag(bag,12,0,"leather_texture.pcx",190,278);
if(str_cmp(inv_slots[0].floating_icon, "steel_sword.pcx"))
{
active_sword = ent_create ("sword.mdl", my.x, attach_weapon);
}
else
{
ent_remove(active_sword);
}
...
}