Exemple #1
0
    public ItemDrop(int itemId, int amount)
    {
        int  cap  = Math.Max(amount, 0);
        Item item = ItemDataManager.GetItemById(itemId);

        itemDropData = new ItemListing(item, cap);
    }
Exemple #2
0
    private void PrintRecipe(Recipe r)
    {
        CustomerOrderManager.EvaluateRecipeBasedOnCustomerOrder(r);
        string itemName = ItemDataManager.GetItemById(r.outputId).DisplayName;

        Debug.Log($"{itemName}:{r.recipeDescription}");
    }
Exemple #3
0
    private ItemListing GetItemListingForId(bool createNewListing, int id, int amount = 0)
    {
        if (createNewListing)
        {
            var itemListing = new ItemListing(ItemDataManager.GetItemById(id), amount);
            inventoryListingsByItemId.Add(id, itemListing);
        }

        return(inventoryListingsByItemId[id]);
    }
Exemple #4
0
    public void AddCraftedRecipeOutputToInventory(Recipe crafted, int amt = 1)
    {
        Item recipeOutput = ItemDataManager.GetItemById(crafted.outputId);

        AddItemToInventory(recipeOutput, amt);

        foreach (RecipeIngredient ingredient in crafted.ingredients)
        {
            RemoveFromInventory(ingredient.id, ingredient.amount * amt);
        }
    }
    public virtual void OnCollected(int amnt = 1)
    {
        if (CollectItem != null)
        {
            ItemEventArgs args = new ItemEventArgs
            {
                ItemToPass   = ItemDataManager.GetItemById(itemId),
                AmountToPass = Math.Max(0, amnt)
            };

            CollectItem(this, args);
        }
    }
 public void SetItemFromId(int id)
 {
     Item = ItemDataManager.GetItemById(id);
 }