Beispiel #1
0
 public void CreateActiveItem(string itmType)
 {
     //shared item creation
     activeHeldItem       = (VBItem)Entities.Instance.Create(itmType, Parent);
     activeHeldItem.Owner = this;
     activeHeldItem.PostCreate();
 }
Beispiel #2
0
        public virtual VBItem DropItem(InventoryObjectItem i)
        {
            Inventory.Remove(i);

            if (i.Juice == 0)
            {
                return(null);
            }

            VBItem tmp = Entities.Instance.Create(i.ItemType, Map.Instance) as VBItem;

            tmp.Position = Position;

            MultipleActionItem matmp = tmp as MultipleActionItem;

            if (matmp != null)
            {
                matmp.ActionMode = i.ActionMode;

                ConsumableItem ctmp = tmp as ConsumableItem;
                if (ctmp != null)
                {
                    ctmp.Juice = i.Juice;
                }
            }

            tmp.PostCreate();
            tmp.PhysicsModel.Bodies[0].ClearForces();

            return(tmp);
        }