Beispiel #1
0
 /// <summary>OnClick function for DigiDGeneral screen. Redirects to Allowances screen.</summary>
 public void AllowancesButtonClicked()
 {
     MainCanvasManager.Instance.OpenCellPhoneScreen(CellPhoneScreen.DigiDAllowances);
     if (digidBekijkenQuest.IsUpdatable)
     {
         DoOnceTask watchAllowancesTask = digidBekijkenQuest.GetTask <DoOnceTask>("1KeerToeslagenBekijken");
         watchAllowancesTask.SetDoneOnce();
         happiness.AddValue(happinessOnCompletion);
     }
 }
 private void AddGrocery()
 {
     /// <summary>Finish grocery fetching task.</summary>
     if (boodschappenPakkenQuest.IsUpdatable && !boodschappenPakkenQuest.IsCompleted)
     {
         DoOnceTask grabGrocery = boodschappenPakkenQuest.GetTask <DoOnceTask>("1KeerBoodschappenPakken");
         grabGrocery.SetDoneOnce();
     }
     grocerySupermarketProperty.AddGrocery(groceryType);
     gameObject.SetActive(false);
     shoppingTrolley.FillShoppingTrolley();
 }
Beispiel #3
0
        private void OnCreateAccountDialogueFinished()
        {
            mailProperty.AddMail(MailType.Bank);

            MainCanvasManager.Instance.AddNotification(GameNotificationType.Mail);

            if (createbankAccountQuest.IsUpdatable)
            {
                DoOnceTask holdBankAccountDialogue = createbankAccountQuest.GetTask <DoOnceTask>("BankAccountGesprek");
                holdBankAccountDialogue.SetDoneOnce();
            }

            PlayerPropertyManager.Instance.GetProperty <BooleanProperty>("Heeft Bankrekening").UpdateValue(true, false);
        }
        ///<summary> Shows positive or negative feedback depending on the players succes. </summary>
        private void ShowFeedback(bool isInTime)
        {
            if (isInTime)
            {
                resultFeedback.SetActive(true);
                winEffects.SetActive(true);
                MusicPlayer.Instance.PlaySFXSound(SFXSound.MinigameCorrect);

                if (!setting.MinigameMode)
                {
                    happiness.AddValue(happinessOnCompletion);
                    playerMoneyProperty.RemoveMoney(moneyToRemove);

                    //Add bronze reward since in normal mode
                    rewardCollection.AddReward(rewardName, RewardType.Bronze);
                }
                else
                {
                    //add reward according to minigame difficulty
                    rewardCollection.AddRewardThroughDifficulty(rewardName, setting.Difficulty);
                }
            }
            else
            {
                feedbackHeader.text  = "Helaas...";
                feedbackMessage.text = "Niet goed ingevuld.";
                resultFeedback.SetActive(true);
                MusicPlayer.Instance.PlaySFXSound(SFXSound.MinigameFailed);
            }

            if (setting.MinigameMode)
            {
                // set difficulty played as completed.
                setting.SetCurrentDifficultyCompleted();
            }
            else
            {
                // if the game was not played in the game hall, update properties and mark it as played in store mode.
                setting.SetIsCompletedInStoryMode();
            }

            // sets the quest "FactuurBetalen" to done.
            if (payInvoiceQuest.IsUpdatable)
            {
                DoOnceTask payInvoiceTask = payInvoiceQuest.GetTask <DoOnceTask>("FactuurBetalen");
                payInvoiceTask.SetDoneOnce();
            }
        }
        public void MakeAppointment()
        {
            SetAppointmentState(true);

            if (createbankAccountQuest.IsUpdatable)
            {
                //update player property and task related to action
                appointmentProperty.UpdateAppointment(BankAppointmentType.CreateAccount);

                DoOnceTask orderMailTask = createbankAccountQuest.GetTask <DoOnceTask>("BankAfspraak");
                orderMailTask.SetDoneOnce();
            }
            MainCanvasManager.Instance.OpenCellPhoneScreen(CellPhoneScreen.BankAppointmentSet);
            documentTransform.sizeDelta        = new Vector2();
            documentTransform.anchoredPosition = new Vector2();
            magnifierGameObjectZoom.SetActive(true);
        }
Beispiel #6
0
        /// <summary>Called when the payment process has been completed to give feedback and start the end process</summary>
        private void OnProcessCompleted()
        {
            MusicPlayer.Instance.PlaySFXSound(SFXSound.PinTransitionEnd);

            if (setting.MinigameMode)
            {
                //set difficulty played as completed
                setting.SetCurrentDifficultyCompleted();

                //add reward according to minigame difficulty
                rewardCollection.AddRewardThroughDifficulty(rewardName, setting.Difficulty);

                SceneTransitionSystem.Instance.Transition(SceneTransitionSystem.DefaultTransition, NavigationSystem.NameOfGameHall, UnityEngine.SceneManagement.LoadSceneMode.Additive);
            }
            else
            {
                Action gameHallIntro = null;

                //if not in minigame mode, add property values
                happiness.AddValue(HappinessOnCompletion);
                ownedGroceryProperty.AddGroceries(supermarketGroceryProperty.Groceries.ToArray());

                //mark game as available in minigame mode
                setting.SetIsCompletedInStoryMode();

                //update quests
                if (contactlessPaymentQuest.IsUpdatable)
                {
                    DoOnceTask payContactlessOnceTask = contactlessPaymentQuest.GetTask <DoOnceTask>("1KeerContactloosBetalen");
                    payContactlessOnceTask.SetDoneOnce();
                    gameHallIntro = () => gameHallIntroduction.Start();
                }

                //Add bronze reward since in normal mode
                rewardCollection.AddReward(rewardName, RewardType.Bronze);

                //and start dialogue with cassiere to transition back home
                MainCanvasManager.Instance.StartDialogue(finishDialogue, () =>
                {
                    SceneTransitionSystem.Instance.Transition(SceneTransitionSystem.DefaultTransition, sceneToLoadOnComplete, UnityEngine.SceneManagement.LoadSceneMode.Additive, gameHallIntro);
                });
            }
        }
Beispiel #7
0
        private void OnPlacement(PlacementResult result)
        {
            feedbackObject.SetActive(true);
            txtHeader.text = result.succesfull ? succesHead : failHead;
            txtMessage.text = result.message;

            MusicPlayer.Instance.PlaySFXSound(result.succesfull ? SFXSound.MinigameCorrect : SFXSound.MinigameFailed);

            if (animator.Setting.MinigameMode)
            {
                //set difficulty played as completed
                animator.Setting.SetCurrentDifficultyCompleted();

                //add reward according to minigame difficulty if the player succeded the game
                if (result.succesfull) rewardCollection.AddRewardThroughDifficulty(rewardName, setting.Difficulty);
            }
            else
            {
                //if not in minigame mode update properties
                mailProperty.OrdenMail(MailPlacing);

                //Add bronze reward since in normal mode
                rewardCollection.AddReward(rewardName, RewardType.Bronze);

                if (result.succesfull)
                {
                    happiness.AddValue(happinessOnSucces);
                }

                //mark game as available in minigame mode
                animator.Setting.SetIsCompletedInStoryMode();

                // and update quests
                if (createbankAccountQuest.IsUpdatable)
                {
                    DoOnceTask orderMailTask = createbankAccountQuest.GetTask<DoOnceTask>("BankPostOrdering");
                    orderMailTask.SetDoneOnce();
                    PlayerPropertyManager.Instance.GetProperty<DigiDProperty>("DigiD").UpdateAccountValue(true, false);
                }
            }
        }