Ejemplo n.º 1
0
 public void Debug_AddAllIngredients()
 {
     for (int i = 0; i < _allIngredients.Count; i++)
     {
         FlowerLibrary.IncrementFlower(_allIngredients[i].GetFlowerName(), 50);
     }
     UpdateIngredients();
 }
Ejemplo n.º 2
0
    public bool Interact(Transform interactor)
    {
        if (_enabled && (isUnderwater == false || !FPSMovement.IsSwimming()))
        {
            if (FlowerLibrary.GetFlowerDiscoverAmount(_flowerData.itemName) == 0)
            {
                BookManager.SetPickedFlower(_flowerData);
                if (onPickUpEvent != null)
                {
                    onPickUpEvent.Invoke(" " + _flowerData.itemName, _flowerData.itemIcon);
                }
            }
            //Pickup save system
            PickUp();
            //NotificationObject.name = _flowerData.itemName; // For notification system(not needed anymore, but leave it?)
            //NotificationObject.sprite = _flowerData.itemIcon; // For notification system(not needed anymore, but leave it?)

            Play_PickupSound(_flowerData.itemName);
            FlowerLibrary.IncrementFlower(_flowerData.itemName, _flowersReturned);
            if (_gameobjectOverload.Length == 0)
            {
                if (_pickupAlpha != null)
                {
                    GetComponent <MeshRenderer>().material.SetTexture("_Alpha", _pickupAlpha);
                    GetComponent <Collider>().enabled = false; //This may not work since there are multiple colliders
                }
                else
                {
                    Destroy(this.gameObject);
                }
            }
            else
            {
                foreach (GameObject gObject in _gameobjectOverload)
                {
                    if (_pickupAlpha != null)
                    {
                        gObject.GetComponent <MeshRenderer>().material.SetTexture("_Alpha", _pickupAlpha);
                    }
                    else
                    {
                        Destroy(gObject);
                    }
                }
                GetComponent <Collider>().enabled = false;//This may not work since there are multiple colliders
            }
            StartCoroutine(ShakeFlower(interactor, _pickupAnimationTime, _pickupAnimationForce));
            _pickupAction.Invoke();
            AlchemyOrganizer_2.DiscoverRecipes(_flowerData);
            if (_dissableTriggerafterPickup)
            {
                GetComponent <Collider>().enabled = false;
            }
            return(true); //Doesn't really have a purpose for this
        }
        return(false);
    }
Ejemplo n.º 3
0
    public void AddPotion()
    {
        FlowerLibrary.IncrementPotion(_item.itemName, 1);
        Debug.Log("Adding one more " + _item.itemName + ", now there are " + FlowerLibrary.GetPotionAmount(_item.itemName));

        for (int i = 0; i < recipe.Count; i++)
        {
            FlowerLibrary.IncrementFlower(recipe[i].ingredient.itemName, -recipe[i].amount);
        }
        UpdateUI();
    }
Ejemplo n.º 4
0
    public void Debug_AddAllIngredients()
    {
        //List<string> allFlowers = new List<string>();
        for (int i = 0; i < _recipieList.Count; i++)
        {
            UpdateRecipeToState(_recipieList[i], RecipeState.Available);
        }
        for (int i = 0; i < _allIngredients.Count; i++)
        {
            if (!_discoveredFlowers.Contains(_allIngredients[i]))
            {
                _discoveredFlowers.Add(_allIngredients[i]);
            }
            Debug.LogFormat("Adding flower {0}", _allIngredients[i]);
            FlowerLibrary.IncrementFlower(_allIngredients[i].itemName, 50);
        }

        //Debug.LogFormat("FLÖWERS: {0}", allFlowers.Count);

        //UpdateIngredients();
        UpdateUI();
    }