示例#1
0
        protected Character SpawnBase(Team team, IMobSpawnMap map)
        {
            MonsterID   formData = BaseForm;
            MonsterData dex      = DataManager.Instance.GetMonster(formData.Species);

            if (formData.Form == -1)
            {
                int form = map.Rand.Next(dex.Forms.Count);
                formData.Form = form;
            }

            BaseMonsterForm formEntry = dex.Forms[formData.Form];

            if (formData.Gender == Gender.Unknown)
            {
                formData.Gender = formEntry.RollGender(map.Rand);
            }

            if (formData.Skin == -1)
            {
                formData.Skin = formEntry.RollSkin(map.Rand);
            }

            CharData character = new CharData();

            character.BaseForm = formData;
            character.Level    = Level.Pick(map.Rand);

            List <int> final_skills = formEntry.RollLatestSkills(character.Level, SpecifiedSkills);

            for (int ii = 0; ii < final_skills.Count; ii++)
            {
                character.BaseSkills[ii] = new SlotSkill(final_skills[ii]);
            }

            if (Intrinsic == -1)
            {
                character.BaseIntrinsics[0] = formEntry.RollIntrinsic(map.Rand, 2);
            }
            else
            {
                character.BaseIntrinsics[0] = Intrinsic;
            }

            character.Discriminator = map.Rand.Next();

            Character new_mob = new Character(character, team);

            team.Players.Add(new_mob);

            return(new_mob);
        }
示例#2
0
        public Character CreatePlayer(ReRandom rand, MonsterID form, int level, int intrinsic, int personality)
        {
            MonsterID   formData = form;
            MonsterData dex      = DataManager.Instance.GetMonster(formData.Species);

            CharData character = new CharData();

            character.BaseForm = formData;
            character.Level    = level;

            BaseMonsterForm formEntry = dex.Forms[formData.Form];

            List <int> final_skills = formEntry.RollLatestSkills(character.Level, new List <int>());

            for (int ii = 0; ii < final_skills.Count; ii++)
            {
                character.BaseSkills[ii] = new SlotSkill(final_skills[ii]);
            }

            if (form.Gender == Gender.Unknown)
            {
                character.BaseForm.Gender = dex.Forms[formData.Form].RollGender(rand);
            }

            if (intrinsic == -1)
            {
                character.BaseIntrinsics[0] = formEntry.RollIntrinsic(rand, 2);
            }
            else
            {
                character.BaseIntrinsics[0] = intrinsic;
            }

            if (personality == -1)
            {
                character.Discriminator = rand.Next();
            }
            else
            {
                character.Discriminator = personality;
            }


            character.OriginalUUID = DataManager.Instance.Save.UUID;
            character.OriginalTeam = DataManager.Instance.Save.ActiveTeam.Name;
            character.MetAt        = Text.FormatKey("MET_AT_START");

            return(CreatePlayer(character));
        }
示例#3
0
        private void btnRollSkill_Click(object sender, EventArgs e)
        {
            if (DungeonScene.Instance.ActiveTeam.Players.Count > 0 && Dungeon.DungeonScene.Instance.FocusedCharacter != null)
            {
                Character       character = DungeonScene.Instance.FocusedCharacter;
                BaseMonsterForm form      = DataManager.Instance.GetMonster(character.BaseForm.Species).Forms[character.BaseForm.Form];

                while (character.BaseSkills[0].SkillNum > -1)
                {
                    character.DeleteSkill(0);
                }
                List <int> final_skills = form.RollLatestSkills(character.Level, new List <int>());
                foreach (int skill in final_skills)
                {
                    character.LearnSkill(skill, true);
                }

                DungeonScene.Instance.LogMsg(String.Format("Skills reloaded"), false, true);
            }
        }