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); }
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); } } }
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); } }
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); } } } } }
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); } } } } }
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); } } } }
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); }