Example #1
0
 public void dropItem(int uid)
 {
     if (hands.id != "hands") //drop
     {
         ClientSenderV2.SendItemPickup(new ItemData(hands.uid, hands.position));
         hands.position = GameMain.map.WorldToGrid(_position);
         hands.drop();
         GameMain.map.items.Add(hands);
         hands = new MeleeWeapon();
         hands.Copy(EntityStore.MeleeWeapons.First((it) => { return(it.id == "hands"); }));
         hands.Init();
         GameMain.hud.initHands(hands);
     }
 }
Example #2
0
 public void interact()
 {
     if (hands.id == "hands") //Pickup
     {
         Point gridPos = GameMain.map.WorldToGrid(_position);
         var   item    = GameMain.map.items.FirstOrDefault((it) => { return(it.position == gridPos); });
         if (item != null)
         {
             GameMain.map.items.Remove(item);
             item.position = null;
             ClientSenderV2.SendItemPickup(new ItemData(item.uid, item.position));
             hands = item;
             GameMain.hud.initHands(hands);
         }
     }
 }