void OnHoldInstructionUpdate(FoodItemTag food)
    {
        foreach (var item in _requiredMenus)
        {
            if (item == food)
            {
                rdUIManager.UpdateStationPopups(this.gameObject, food);
                break;
            }
        }

        //List<FoodItemTag> fds = new List<FoodItemTag>();
        //foreach (RecipeInstruction item in RecipeMenu) {
        //    fds.Add(item.Result);
        //}

        ////to be updated later XD
        //foreach (RecipeInstruction rcp in RecipeMenu) {
        //    foreach (FoodItemTag correctFood in rcp.Ingredients) {
        //        if (food == correctFood) {
        //            rdUIManager.UpdateStationPopups(this.gameObject, correctFood);
        //            break;
        //        }
        //    }
        //}
    }
Exemple #2
0
    //List<FoodItemTag> _currentRecipeIngredients = new List<FoodItemTag>();

    //interact only true if the player is need to be working
    public override bool Interact(FoodItemTag item, rdEntity user)
    {
        if (user.ItemOnHand != FoodItemTag.None)
        {
            return(false);
        }
        //TODO player will manually picked what item
        user.ItemOnHand = IngredientsToPickedUp[0];
        IngredientsToPickedUp.RemoveAt(0);
        if (IngredientsToPickedUp.Count <= 0)
        {
            Status = StationStatus.Inactive;
        }

        if (IngredientsToPickedUp.Count <= 0)
        {
            rdUIManager.UpdateStationPopups(gameObject);
        }
        else
        {
            rdUIManager.UpdateStationPopups(gameObject, IngredientsToPickedUp);
        }
        rdUIManager.UpdateOnHandItem(user.ItemOnHand, user);

        rdRecipeManager.UpdateInstruction(user.ItemOnHand);
        return(false);
    }
Exemple #3
0
 public static void UpdateOnHandItem(FoodItemTag type, rdEntity entity)
 {
     if (Seele._foodBags.TryGetValue(type, out rdUIFoodBags fdbag))
     {
         entity.ItemOnHandSprite.sprite = fdbag.Sprite;
     }
     else
     {
         entity.ItemOnHandSprite.sprite = null;
     }
 }
Exemple #4
0
 public bool CollectItem(FoodItemTag item)
 {
     if (ItemOnHand == FoodItemTag.None)
     {
         ItemOnHand = item;
         return(true);
     }
     else
     {
         return(false);
     }
 }
    //interact only true if the player is need to be working
    public override bool Interact(FoodItemTag item, rdEntity user)
    {
        switch (Status)
        {
        case StationStatus.Ready:
            foreach (RecipeInstruction rm in RecipeMenu)
            {
                foreach (FoodItemTag igts in rm.Ingredients)
                {
                    if (igts == item)
                    {
                        user.DropOffItem();
                        CurrentInstruction = rm;
                        rdUIManager.UpdateOnHandItem(user.ItemOnHand, user);
                        rdUIManager.UpdateStationPopups(this.gameObject);
                        //TODO multiple cooks
                        CurrentHoldItems.Add(igts);
                        FoodItemTag[] reqs         = CurrentInstruction.Ingredients;
                        bool          startCooking = CurrentHoldItems.OrderBy(x => x).SequenceEqual(reqs.OrderBy(x => x));
                        if (startCooking)
                        {
                            StartTask(user);
                        }
                        return(CurrentInstruction.Type == TaskType.Active);
                    }
                }
            }
            break;

        case StationStatus.Collect:
            if (user.CollectItem(CurrentInstruction.Result))
            {
                Status = StationStatus.Ready;
            }

            RecipeMenu.Remove(CurrentInstruction);
            CurrentHoldItems.Clear();
            //OnHoldInstructionUpdate();
            rdUIManager.UpdateOnHandItem(user.ItemOnHand, user);
            rdUIManager.UpdateStationPopups(this.gameObject);
            rdRecipeManager.UpdateInstruction(user.ItemOnHand);
            break;

        default:
            return(false);
        }
        return(false);
    }
    public override bool Interact(FoodItemTag item, rdEntity user)
    {
        if (item == rdRecipeManager.Seele._currentRecipe.DishName)
        {
            rdRecipeManager.Seele.OrderServed();
            Debug.Log(item + "served");
            BellSound.PlayAtPoint(transform.position);
            user.ItemOnHand = FoodItemTag.None;
            rdUIManager.UpdateOnHandItem(user.ItemOnHand, user);

            rdScoreSystem.Seele.OrderServed();
        }
        else
        {
            //random chat thingyy
            ChatData[] chats = rdRecipeManager.Seele._currentChatdatas;
            rdUIManager.ShowRandomChatText(chats);
            return(false);
        }
        return(false);
    }
    //TODO, restrict to put anything on unecessary on plates
    public override bool Interact(FoodItemTag item, rdEntity user)
    {
        switch (Status)
        {
        case StationStatus.Inactive:
            if (user.ItemOnHand == FoodItemTag.None)
            {
                return(false);
            }
            CurrentlyHolding.Add(user.ItemOnHand);
            user.DropOffItem();
            bool correctDish = CurrentlyHolding.OrderBy(x => x).SequenceEqual(_requiredMenus.OrderBy(x => x));
            //need to be checked again XD
            if (correctDish)
            {
                Status       = StationStatus.Collect;
                FinalPlating = rdRecipeManager.Seele._currentRecipe.DishName;
                rdUIManager.UpdateStationPopups(this.gameObject, FinalPlating);
                rdUIManager.UpdateOnHandItem(user.ItemOnHand, user);
                return(false);
            }
            rdUIManager.UpdateStationPopups(gameObject);
            rdUIManager.UpdateOnHandItem(user.ItemOnHand, user);
            break;

        case StationStatus.Collect:
            CurrentlyHolding.Clear();
            user.ItemOnHand = FinalPlating;
            ReadySound.PlayAtPoint(transform.position);
            Status = StationStatus.Inactive;
            rdUIManager.UpdateStationPopups(gameObject);
            rdUIManager.UpdateOnHandItem(user.ItemOnHand, user);
            break;

        default:
            break;
        }
        return(false);
    }
    void OnHoldInstructionUpdate(FoodItemTag food)
    {
        List <FoodItemTag> fds = new List <FoodItemTag>();

        foreach (RecipeInstruction item in RecipeMenu)
        {
            fds.Add(item.Result);
        }

        //to be updated later XD
        foreach (RecipeInstruction rcp in RecipeMenu)
        {
            foreach (FoodItemTag correctFood in rcp.Ingredients)
            {
                if (food == correctFood)
                {
                    rdUIManager.UpdateStationPopups(this.gameObject, correctFood);
                    break;
                }
            }
        }
    }
Exemple #9
0
 public void DropOffItem()
 {
     ItemOnHand = FoodItemTag.None;
 }
Exemple #10
0
 public static void UpdateStationPopups(GameObject station, FoodItemTag req)
 {
     FoodItemTag[] reqToArray = new FoodItemTag[] { req };
     UpdateStationPopups(station, reqToArray);
 }
Exemple #11
0
 public abstract bool Interact(FoodItemTag item, rdEntity user);
Exemple #12
0
 public static void UpdateInstruction(FoodItemTag foodInstruction)
 {
     Seele.OnHoldInstructionUpdate?.Invoke(foodInstruction);
 }