Ejemplo n.º 1
0
    private void DoDrink(BaseEntity.RPCMessage msg)
    {
        if (!msg.player.CanInteract())
        {
            return;
        }
        Item item = this.GetItem();

        if (item == null)
        {
            return;
        }
        if (item.contents == null)
        {
            return;
        }
        if (!msg.player.metabolism.CanConsume())
        {
            return;
        }
        foreach (Item content in item.contents.itemList)
        {
            ItemModConsume component = content.info.GetComponent <ItemModConsume>();
            if (component == null || !component.CanDoAction(content, msg.player))
            {
                continue;
            }
            component.DoAction(content, msg.player);
            return;
        }
    }
Ejemplo n.º 2
0
 public override void DoAction(Item item, BasePlayer player)
 {
     foreach (Item obj in item.contents.itemList)
     {
         ItemModConsume component = (ItemModConsume)((Component)obj.info).GetComponent <ItemModConsume>();
         if (!Object.op_Equality((Object)component, (Object)null) && component.CanDoAction(obj, player))
         {
             component.DoAction(obj, player);
             break;
         }
     }
 }
Ejemplo n.º 3
0
 public override void DoAction(Item item, BasePlayer player)
 {
     foreach (Item item2 in item.contents.itemList)
     {
         ItemModConsume component = item2.info.GetComponent <ItemModConsume>();
         if (!(component == null) && component.CanDoAction(item2, player))
         {
             component.DoAction(item2, player);
             break;
         }
     }
 }
Ejemplo n.º 4
0
 public override void DoAction(Item item, BasePlayer player)
 {
     foreach (Item content in item.contents.itemList)
     {
         ItemModConsume component = content.info.GetComponent <ItemModConsume>();
         if (component == null || !component.CanDoAction(content, player))
         {
             continue;
         }
         component.DoAction(content, player);
         return;
     }
 }
Ejemplo n.º 5
0
 public void SVDrink(BaseEntity.RPCMessage rpc)
 {
     if (!rpc.player.metabolism.CanConsume())
     {
         return;
     }
     foreach (Item obj in this.inventory.itemList)
     {
         ItemModConsume component = (ItemModConsume)((Component)obj.info).GetComponent <ItemModConsume>();
         if (!Object.op_Equality((Object)component, (Object)null) && component.CanDoAction(obj, rpc.player))
         {
             component.DoAction(obj, rpc.player);
             break;
         }
     }
 }
Ejemplo n.º 6
0
 public void SVDrink(RPCMessage rpc)
 {
     if (!rpc.player.metabolism.CanConsume())
     {
         return;
     }
     foreach (Item item in base.inventory.itemList)
     {
         ItemModConsume component = item.info.GetComponent <ItemModConsume>();
         if (!(component == null) && component.CanDoAction(item, rpc.player))
         {
             component.DoAction(item, rpc.player);
             break;
         }
     }
 }
 public void SVDrink(BaseEntity.RPCMessage rpc)
 {
     if (!rpc.player.metabolism.CanConsume())
     {
         return;
     }
     foreach (Item item in this.inventory.itemList)
     {
         ItemModConsume component = item.info.GetComponent <ItemModConsume>();
         if (component == null || !component.CanDoAction(item, rpc.player))
         {
             continue;
         }
         component.DoAction(item, rpc.player);
         return;
     }
 }
Ejemplo n.º 8
0
    private void DoDrink(RPCMessage msg)
    {
        if (!msg.player.CanInteract())
        {
            return;
        }
        Item item = GetItem();

        if (item == null || item.contents == null || !msg.player.metabolism.CanConsume())
        {
            return;
        }
        foreach (Item item2 in item.contents.itemList)
        {
            ItemModConsume component = item2.info.GetComponent <ItemModConsume>();
            if (!(component == null) && component.CanDoAction(item2, msg.player))
            {
                component.DoAction(item2, msg.player);
                break;
            }
        }
    }
Ejemplo n.º 9
0
    private void DoDrink(BaseEntity.RPCMessage msg)
    {
        if (!msg.player.CanInteract())
        {
            return;
        }
        Item obj1 = this.GetItem();

        if (obj1 == null || obj1.contents == null || !msg.player.metabolism.CanConsume())
        {
            return;
        }
        foreach (Item obj2 in obj1.contents.itemList)
        {
            ItemModConsume component = (ItemModConsume)((Component)obj2.info).GetComponent <ItemModConsume>();
            if (!Object.op_Equality((Object)component, (Object)null) && component.CanDoAction(obj2, msg.player))
            {
                component.DoAction(obj2, msg.player);
                break;
            }
        }
    }