示例#1
0
        public void UpdateExtraInfo()
        {
            int totalChoice = CurrentPage * SpacesPerPage + CurrentChoice;

            if (totalChoice > 0)
            {
                int         species     = startChars[totalChoice - 1];
                MonsterData monsterData = DataManager.Instance.GetMonster(species);
                int         formSlot    = FormSetting;
                List <int>  forms       = CharaDetailMenu.GetPossibleForms(monsterData);
                if (formSlot > forms.Count)
                {
                    formSlot = forms.Count - 1;
                }
                int    formIndex          = formSlot > -1 ? forms[formSlot] : -1;
                int    genderFormIndex    = CharaDetailMenu.GetGenderFormIndex(monsterData, formSlot, forms);
                Gender gender             = CharaDetailMenu.LimitGender(monsterData, genderFormIndex, GenderSetting);
                int    intrinsicFormIndex = CharaDetailMenu.GetIntrinsicFormIndex(monsterData, formSlot, forms);
                int    intrinsic          = CharaDetailMenu.LimitIntrinsic(monsterData, intrinsicFormIndex, IntrinsicSetting);

                Portrait.Speaker = new MonsterID(startChars[totalChoice - 1], formIndex > -1 ? formIndex : 0, SkinSetting, gender);

                string formString = "";
                if (formIndex > -1)
                {
                    formString = monsterData.Forms[formIndex].FormName.ToLocal();
                }

                string intrinsicString = "";
                if (intrinsic > -1)
                {
                    if (intrinsicFormIndex == -1)
                    {
                        intrinsicString = Text.FormatKey("MENU_CHARA_INTRINSIC", intrinsic);
                    }
                    else
                    {
                        if (intrinsic == 0)
                        {
                            intrinsicString = DataManager.Instance.GetIntrinsic(monsterData.Forms[intrinsicFormIndex].Intrinsic1).Name.ToLocal();
                        }
                        else if (intrinsic == 1)
                        {
                            intrinsicString = DataManager.Instance.GetIntrinsic(monsterData.Forms[intrinsicFormIndex].Intrinsic2).Name.ToLocal();
                        }
                        else
                        {
                            intrinsicString = DataManager.Instance.GetIntrinsic(monsterData.Forms[intrinsicFormIndex].Intrinsic3).Name.ToLocal();
                        }
                    }
                }
                infoMenu.SetDetails(formString, SkinSetting, gender, intrinsicString);
            }
            else
            {
                Portrait.Speaker = new MonsterID();
                infoMenu.SetDetails("", -1, Gender.Unknown, "");
            }
        }
示例#2
0
        public IEnumerator <YieldInstruction> Begin(int choice, string name)
        {
            GameManager.Instance.BGM("", true);
            yield return(CoroutineManager.Instance.StartCoroutine(GameManager.Instance.FadeOut(false)));

            GameProgress save = new RogueProgress(seed.HasValue ? seed.Value : MathUtils.Rand.NextUInt64(), Guid.NewGuid().ToString().ToUpper(), seed.HasValue);

            for (int ii = 0; ii < DataManager.Instance.DataIndices[DataManager.DataType.Zone].Count; ii++)
            {
                save.DungeonUnlocks[ii] = DataManager.Instance.Save.DungeonUnlocks[ii];
            }
            DataManager.Instance.SetProgress(save);
            DataManager.Instance.Save.ActiveTeam = new ExplorerTeam();
            DataManager.Instance.Save.ActiveTeam.SetRank(0);
            DataManager.Instance.Save.ActiveTeam.Name = team;
            MonsterData monsterData = DataManager.Instance.GetMonster(choice);

            int        formSlot = FormSetting;
            List <int> forms    = CharaDetailMenu.GetPossibleForms(monsterData);

            if (formSlot >= forms.Count)
            {
                formSlot = forms.Count - 1;
            }
            if (formSlot == -1)
            {
                formSlot = MathUtils.Rand.Next(forms.Count);
            }

            int formIndex = forms[formSlot];

            Gender gender = CharaDetailMenu.LimitGender(monsterData, formIndex, GenderSetting);

            if (gender == Gender.Unknown)
            {
                gender = monsterData.Forms[formIndex].RollGender(MathUtils.Rand);
            }

            int intrinsicSlot = CharaDetailMenu.LimitIntrinsic(monsterData, formIndex, IntrinsicSetting);
            int intrinsic     = 0;

            if (intrinsicSlot == -1)
            {
                intrinsic = monsterData.Forms[formIndex].RollIntrinsic(MathUtils.Rand, 3);
            }
            else if (intrinsicSlot == 0)
            {
                intrinsic = monsterData.Forms[formIndex].Intrinsic1;
            }
            else if (intrinsicSlot == 1)
            {
                intrinsic = monsterData.Forms[formIndex].Intrinsic2;
            }
            else
            {
                intrinsic = monsterData.Forms[formIndex].Intrinsic3;
            }

            Character newChar = DataManager.Instance.Save.ActiveTeam.CreatePlayer(MathUtils.Rand, new MonsterID(choice, formIndex, SkinSetting, gender), DataManager.Instance.StartLevel, intrinsic, DataManager.Instance.StartPersonality);

            newChar.Nickname = name;
            DataManager.Instance.Save.ActiveTeam.Players.Add(newChar);

            DataManager.Instance.Save.RegisterMonster(DataManager.Instance.Save.ActiveTeam.Players[0].BaseForm.Species);
            DataManager.Instance.Save.StartDate = String.Format("{0:yyyy-MM-dd_HH-mm-ss}", DateTime.Now);

            DataManager.Instance.MsgLog.Clear();

            yield return(CoroutineManager.Instance.StartCoroutine(GameManager.Instance.BeginGameInSegment(new ZoneLoc(chosenDest, new SegLoc()), GameProgress.DungeonStakes.Risk, true, false)));
        }