Example #1
0
        private void ReloadDieNextLevel()
        {
            if (progress.IsWin())
            {
                return;
            }

            if (FindObjects.PC.GetComponent <HP>().CurrentHP < 1)
            {
                SceneManager.LoadSceneAsync(0);
            }
            // progress.LevelCleared() is a sub condition of progress.IsWin().
            else if (progress.LevelCleared())
            {
                progressData.GotoNextLevel();

                Stack <IDataTemplate> dt = new Stack <IDataTemplate>();
                saveLoad.SaveDungeonLevel(new SaveEventArgs(dt));
                SceneManager.LoadSceneAsync(0);
            }
        }
Example #2
0
        public void DefeatTarget(GameObject target)
        {
            SubObjectTag tag         = target.GetComponent <MetaInfo>().SubTag;
            int          potion      = actorData.GetIntData(tag, DataTag.Potion);
            int          bonusPotion = target.GetComponent <Infection>().HasInfection(
                InfectionTag.Mutated) ? potionData.BonusPotion : 0;
            string victory;

            GetComponent <Potion>().GainPotion(potion + bonusPotion);

            progress.CountKill(target);
            if (progress.IsWin())
            {
                BurySelf();
                color.ChangeObjectColor(getActor(SubObjectTag.Guide),
                                        ColorName.Orange);

                if (progressData.IsRushMode)
                {
                    victory = text.GetStringData(node, "WinRush");
                }
                else
                {
                    victory = text.GetStringData(node, "WinNormal");
                }
                victory = color.GetColorfulText(victory, ColorName.Green);
                message.StoreText(victory);
                modeline.PrintStaticText(text.GetStringData(node, "ReloadWin"));
            }
            else if (progress.LevelCleared())
            {
                BurySelf();
                color.ChangeObjectColor(getActor(SubObjectTag.Guide),
                                        ColorName.Orange);

                victory = text.GetStringData(node, "Level");
                victory = color.GetColorfulText(victory, ColorName.Green);
                message.StoreText(victory);
                modeline.PrintStaticText(text.GetStringData(node, "Continue"));
            }
        }