Exemple #1
0
 public void UnequipItem(Item item, UI equipment, Coordinates target)
 {
     item.Slot = null;
     item.Position = new Coordinates(target.X, target.Y);
     Players[0].UnequipItem(equipment.Name);
 }
Exemple #2
0
 public void EquipItemFromBag(Item item, UI equipment)
 {
     if (Players[0].EquippedItems.IsItemSlotEmpty(equipment.Name))
     {
         if (item.WearSlot == equipment.Name || (item.WearSlot == ItemSlot.LeftHand && equipment.Name == ItemSlot.RightHand))
         {
             item.Position = new Coordinates(equipment.Position.X, equipment.Position.Y);
             item.Slot = equipment.Name;
             item.Parent.RemoveItem(item);
             Players[0].EquipItem(item, equipment.Name);
         }
     }
 }
Exemple #3
0
 public void ThrowItemToBag(Item item, Backpack Bag, Coordinates target, UI SourceEquipment = null, Backpack Parent = null)
 {
     if (Parent != null)
     {
         Parent.RemoveItem(item);
     }
     item.Slot = null;
     item.Position = new Coordinates(target.X, target.Y);
     Bag.AddItem(item);
     if (SourceEquipment != null)
     {
         Players[0].UnequipItem(SourceEquipment.Name);
     }
 }
Exemple #4
0
        internal void EquipItem(Item item, UI equipment, UI sourceEquipment = null, bool haveToBeAdjacent = true)
        {
            // TODO: Change when adding multiplayer
            if (AdjacentToItem(Players[0], item) || haveToBeAdjacent == false)
            {
                if (Players[0].EquippedItems.IsItemSlotEmpty(equipment.Name))
                {
                    if (item.WearSlot == equipment.Name || (item.WearSlot == ItemSlot.LeftHand && equipment.Name == ItemSlot.RightHand))
                    {
                        item.Position = new Coordinates(equipment.Position.X, equipment.Position.Y);
                        item.Slot = equipment.Name;
                        item.WearingPlayerID = Players[0].ID;
                        Players[0].EquipItem(item, equipment.Name);

                        if (sourceEquipment != null)
                        {
                            Players[0].UnequipItem(sourceEquipment.Name);
                        }
                    }
                }
            }
        }
Exemple #5
0
        public void EquipItem(Item item, UI equipment, UI sourceEquipment = null, bool haveToBeAdjacent = true)
        {
            if (AdjacentToItem(Players[0], item) || haveToBeAdjacent == false)
            {
                if (Players[0].EquippedItems.IsItemSlotEmpty(equipment.Name))
                {
                    if (item.WearSlot == equipment.Name || (item.WearSlot == ItemSlot.LeftHand && equipment.Name == ItemSlot.RightHand))
                    {
                        item.Position = new Coordinates(equipment.Position.X, equipment.Position.Y);
                        item.Slot = equipment.Name;
                        Players[0].EquipItem(item, equipment.Name);

                        if (sourceEquipment != null)
                        {
                            Players[0].UnequipItem(sourceEquipment.Name);
                        }
                    }
                }
            }
        }
Exemple #6
0
 internal void ThrowItemToBag(Item item, Backpack Bag, Coordinates target, UI SourceEquipment = null, Backpack Parent = null)
 {
     if (Parent != null)
     {
         Parent.RemoveItem(item);
         item.Slot = null;
         item.WearingPlayerID = Players[0].ID;
         item.Position = new Coordinates(target.X, target.Y);
         Bag.AddItem(item);
         if (SourceEquipment != null)
         {
             Players[0].UnequipItem(SourceEquipment.Name);
         }
     }
     else
     {
         if (SourceEquipment != null)
         {
             item.Slot = null;
             item.WearingPlayerID = Players[0].ID;
             item.Position = new Coordinates(target.X, target.Y);
             Bag.AddItem(item);
             Players[0].UnequipItem(SourceEquipment.Name);
         }
         else
         {
             if (AdjacentToItem(Players[0], item))
             {
                 item.Slot = null;
                 item.WearingPlayerID = Players[0].ID;
                 item.Position = new Coordinates(target.X, target.Y);
                 Bag.AddItem(item);
             }
         }
     }
 }
Exemple #7
0
 internal void UnequipItem(Item item, UI equipment, Coordinates target)
 {
     if (IsTileThrowable(target))
     {
         item.Slot = null;
         item.WearingPlayerID = -1;
         item.Z_order = GetTopItemFromTile(target).Z_order + 1;
         item.Position = new Coordinates(target.X, target.Y, target.Z);
         Players[0].UnequipItem(equipment.Name);
     }
 }
 private void EquipItemFromAnywhere(Item item, UI targetEquipment, UI SourceEquipment = null)
 {
     if (SourceEquipment == null)
     {
         map.EquipItem(item, targetEquipment, null, false);
     }
     else
     {
         map.EquipItem(item, targetEquipment, SourceEquipment, false);
     }
 }
 private void EquipItem(UI targetEquipment, UI SourceEquipment = null)
 {
     if (SourceEquipment == null)
     {
         map.EquipItem(dragItem, targetEquipment);
     }
     else
     {
         map.EquipItem(dragItem, targetEquipment, SourceEquipment, false);
     }
 }
 private void UnequipItem(UI SourceEquipment, Coordinates target)
 {
     SourceEquipment.Sprite = GetSpriteByName(SourceEquipment.Name);
     map.UnequipItem(dragItem, SourceEquipment, target);
 }
 private void ThrowItemToBag(Backpack Bag, Coordinates Destination, UI SourceEquipment = null)
 {
     // TODO: Don't allow main bag to be thrown into any of its nested bags
     if (dragItem.Container == null || dragItem.Container.ID != Bag.ID)
     {
         if (SourceEquipment == null)
         {
             if (dragItem.Parent.IsEmpty())
             {
                 map.ThrowItemToBag(dragItem, Bag, Destination);
             }
             else
             {
                 map.ThrowItemToBag(dragItem, Bag, Destination, null, dragItem.Parent);
             }
         }
         else
         {
             SourceEquipment.Sprite = GetSpriteByName(SourceEquipment.Name);
             map.ThrowItemToBag(dragItem, Bag, Destination, SourceEquipment);
         }
     }
 }
 private void EquipItemFromBag(UI targetEquipment)
 {
     map.EquipItemFromBag(dragItem, targetEquipment);
 }