Exemple #1
0
 public frmItemEditor(DataTypes.itemInfo ThisItem, string ItemClass)
 {
     InitializeComponent();
     ChangeMade = false;
     Item       = ThisItem;
     PopulateItem(ItemClass);
 }
Exemple #2
0
        private void lstItems_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (lstItems.SelectedIndex > -1)
            {
                DataTypes.itemInfo EditItem = new DataTypes.itemInfo();
                EditItem = Event.Items[lstItems.SelectedIndex];
                frmItemEditor NewForm = new frmItemEditor(EditItem, string.Empty);
                NewForm.ShowDialog();

                EditItem = NewForm.Item;
                Event.Items[lstItems.SelectedIndex] = EditItem;
                GetAllItems();
            }
        }
        private void lstInventory_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (lstInventory.SelectedIndex > -1)
            {
                DataTypes.itemInfo EditItem = new DataTypes.itemInfo();
                EditItem = Player.inventory[lstInventory.SelectedIndex];
                frmItemEditor NewForm = new frmItemEditor(EditItem, string.Empty);
                NewForm.ShowDialog();

                EditItem = NewForm.Item;
                Player.inventory[lstInventory.SelectedIndex] = EditItem;
                PopulateInventory();
            }
        }
Exemple #4
0
        private void lstInventory_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (lstInventory.SelectedIndex > -1)
            {
                DataTypes.itemInfo EditItem = new DataTypes.itemInfo();
                EditItem = NPC.inventory[lstInventory.SelectedIndex];
                frmItemEditor NewForm = new frmItemEditor(EditItem, string.Empty);
                NewForm.ShowDialog();

                if (NewForm.ChangeMade == true)
                {
                    EditItem = NewForm.Item;
                    NPC.inventory[lstInventory.SelectedIndex] = EditItem;
                    GetAllItems();
                }
            }
        }
Exemple #5
0
        private void cmdAddItem_Click(object sender, EventArgs e)
        {
            DataTypes.itemInfo NewItem = new DataTypes.itemInfo();
            frmItemEditor      NewForm = new frmItemEditor(NewItem, string.Empty);

            NewForm.ShowDialog();

            if (NewForm.ChangeMade == true)
            {
                NewItem = NewForm.Item;
                if (NPC.inventory == null)
                {
                    NPC.inventory = new List <DataTypes.itemInfo>();
                }
                NPC.inventory.Add(NewItem);
            }
            GetAllItems();
        }
Exemple #6
0
        private void cmdAddItem_Click(object sender, EventArgs e)
        {
            DataTypes.itemInfo NewItem = new DataTypes.itemInfo();
            frmItemEditor      NewForm = new frmItemEditor(NewItem, string.Empty);

            NewForm.ShowDialog();

            NewItem = NewForm.Item;
            if (NewItem.Name != null)
            {
                if (Event.Items == null)
                {
                    Event.Items = new List <DataTypes.itemInfo>();
                }
                Event.Items.Add(NewItem);
            }
            GetAllItems();
        }
Exemple #7
0
        private void cmdItemInspect_Click(object sender, EventArgs e)
        {
            DataTypes.itemInfo NewItem = new DataTypes.itemInfo();
            NewItem = Enemy.Weapon;
            frmItemEditor NewForm = new frmItemEditor(NewItem, "Weapon");

            NewForm.ShowDialog();
            NewItem = NewForm.Item;

            if (NewForm.ChangeMade == true)
            {
                if (Enemy.Weapon.Name != null)
                {
                    Enemy.Weapon = new DataTypes.itemInfo();
                }
                Enemy.Weapon   = NewItem;
                txtWeapon.Text = Enemy.Weapon.Name;
            }
        }
        private void cmdAddItem_Click(object sender, EventArgs e)
        {
            if (Player.invspace > 0)
            {
                DataTypes.itemInfo NewItem = new DataTypes.itemInfo();
                frmItemEditor      NewForm = new frmItemEditor(NewItem, string.Empty);
                NewForm.ShowDialog();

                if (NewForm.ChangeMade == true)
                {
                    Player.inventory.Add(NewForm.Item);
                    Player.invspace = Player.invspace - 1;
                    lblInv.Text     = "Inventory " + (Player.MaxItems - Player.invspace) + "/";
                }
            }
            else
            {
                MessageBox.Show("The player inventory is full, you cannot add more items");
            }
            PopulateInventory();
        }
        private bool Equiptment(int Position)
        {
            DataTypes.itemInfo EditItem = new DataTypes.itemInfo();
            if (Position == 5)
            {
                Player.ArmorBonus = Player.ArmorBonus - Player.WeaponHeld.DefenseMod;
            }
            else
            {
                Player.ArmorBonus = Player.ArmorBonus - Player.ArmorWorn[Position].DefenseMod;
            }
            if (Position == 5)
            {
                if (Player.WeaponHeld.Name != null)
                {
                    EditItem = Player.WeaponHeld;
                }
            }
            else if (Player.ArmorWorn[Position].Name != null)
            {
                EditItem = Player.ArmorWorn[Position];
            }

            string ItemClass = "Unknown";

            switch (Position)
            {
            case 0: ItemClass = "Armor-Helmet"; break;

            case 1: ItemClass = "Armor-Chest"; break;

            case 2: ItemClass = "Armor-Gloves"; break;

            case 3: ItemClass = "Armor-Legs"; break;

            case 4: ItemClass = "Armor-Boots"; break;

            case 5: ItemClass = "Weapon"; break;
            }


            frmItemEditor NewForm = new frmItemEditor(EditItem, ItemClass);

            NewForm.ShowDialog();

            if (NewForm.ChangeMade == true)
            {
                EditItem = NewForm.Item;
                if (Position == 5)
                {
                    Player.WeaponHeld = EditItem;
                }
                else
                {
                    if (Player.ArmorWorn == null)
                    {
                        Player.ArmorWorn = new DataTypes.itemInfo[5];
                    }
                    Player.ArmorWorn[Position] = EditItem;
                }
                Player.ArmorBonus = Player.ArmorBonus + EditItem.DefenseMod;
                return(true);
            }
            else
            {
                return(false);
            }
        }
        private void lstItems_MouseDoubleClick(object sender, MouseEventArgs e)
        {
            if (lstItems.SelectedIndex > -1)
            {
                DataTypes.itemInfo EditItem = new DataTypes.itemInfo();
                EditItem = Room.items[lstItems.SelectedIndex];
                frmItemEditor NewForm = new frmItemEditor(EditItem,string.Empty);
                NewForm.ShowDialog();

                EditItem = NewForm.Item;
                Room.items[lstItems.SelectedIndex] = EditItem;
                GetAllItems();
            }
        }
        private void cmdAddItem_Click(object sender, EventArgs e)
        {
            DataTypes.itemInfo NewItem = new DataTypes.itemInfo();
            frmItemEditor NewForm = new frmItemEditor(NewItem, string.Empty);
            NewForm.ShowDialog();

            NewItem = NewForm.Item;
            if (NewItem.Name != null)
            {
                if (Room.items == null) Room.items = new List<DataTypes.itemInfo>();
                Room.items.Add(NewItem);
            }
            GetAllItems();
        }