Exemplo n.º 1
0
        private static void UpdateCharacterCreation()
        {
            var rpgPlayerData = Rm_RPGHandler.Instance.Player;

            if (rpgPlayerData.RaceDefinitions.Count == 0)
            {
                var r = new Rm_RaceDefinition {
                    Name = "Default Race", Description = ""
                };
                rpgPlayerData.RaceDefinitions.Add(r);

                var characters = rpgPlayerData.CharacterDefinitions.Where(c => string.IsNullOrEmpty(c.ApplicableRaceID)).ToList();
                foreach (var c in characters)
                {
                    c.ApplicableRaceID = r.ID;
                }
            }

            if (rpgPlayerData.SubRaceDefinitions.Count == 0)
            {
                var r = new Rm_SubRaceDefinition {
                    Name = "Default Sub-Race", Description = ""
                };
                rpgPlayerData.SubRaceDefinitions.Add(r);

                var characters = rpgPlayerData.CharacterDefinitions.Where(c => string.IsNullOrEmpty(c.ApplicableSubRaceID)).ToList();
                foreach (var c in characters)
                {
                    c.ApplicableSubRaceID = r.ID;
                }
            }

            if (rpgPlayerData.GenderDefinitions.Count == 0)
            {
                var r = new StringDefinition()
                {
                    Name = "Male"
                };
                rpgPlayerData.GenderDefinitions.Add(r);

                var characters = rpgPlayerData.CharacterDefinitions.Where(c => string.IsNullOrEmpty(c.ApplicableGenderID)).ToList();
                foreach (var c in characters)
                {
                    c.ApplicableGenderID = r.ID;
                }
            }

            if (rpgPlayerData.ClassNameDefinitions.Count == 0)
            {
                var r = new Rm_ClassNameDefinition()
                {
                    Name = "Default Class", Description = ""
                };
                rpgPlayerData.ClassNameDefinitions.Add(r);

                var characters = rpgPlayerData.CharacterDefinitions.Where(c => c.ApplicableClassIDs.Count == 0).ToList();
                foreach (var c in characters)
                {
                    c.ApplicableClassIDs.Add(new StringField()
                    {
                        ID = r.ID
                    });
                }
            }

            //Finally, check if any sub-race has no assigned race, and assign the first one
            foreach (var subRace in rpgPlayerData.SubRaceDefinitions)
            {
                if (string.IsNullOrEmpty(subRace.ApplicableRaceID))
                {
                    subRace.ApplicableRaceID = rpgPlayerData.RaceDefinitions.First().ID;
                }
            }
        }
Exemplo n.º 2
0
        public Rmh_Player()
        {
            ClassNameDefinitions = new List <Rm_ClassNameDefinition>()
            {
                new Rm_ClassNameDefinition()
                {
                    ID = "Default_Builtin_Class_10101010", Name = "Class"
                }
            };

            var raceDef = new Rm_RaceDefinition()
            {
                ID = "Default_Builtin_Race_10101010", Name = "Race"
            };

            RaceDefinitions = new List <Rm_RaceDefinition>()
            {
                raceDef
            };

            SubRaceDefinitions = new List <Rm_SubRaceDefinition>()
            {
                new Rm_SubRaceDefinition()
                {
                    ID = "Default_Builtin_SubRace_10101010", Name = "Sub-Race", ApplicableRaceID = "Default_Builtin_Race_10101010"
                }
            };

            var builtInGender = new StringDefinition()
            {
                ID = "Default_Builtin_Gender_10101010", Name = "Male"
            };

            GenderDefinitions = new List <StringDefinition>()
            {
                builtInGender,
                new StringDefinition()
                {
                    ID = Guid.NewGuid().ToString(), Name = "Female"
                }
            };

            MetaDataDefinitions = new List <Rm_MetaDataDefinition>();

            SkipCharacterCreation    = false;
            SkipRaceSelection        = false;
            SkipSubRaceSelection     = false;
            RemoveSubRaceDescription = true;
            CustomisationsEnabled    = true;

            ShownDescription = DescriptionShown.CharacterDescription;

            CharacterDefinitions          = new List <Rm_ClassDefinition>();
            PetDefinitions                = new List <Rm_PetDefinition>();
            LevelUpSound                  = new AudioContainer();
            ManualAssignAttrPerLevel      = false;
            AttributePointsEarnedPerLevel = 5;
            GiveSkillPointsPerLevel       = false;
            SkillPointsEarnedPerLevel     = 100;

            Difficulties = new List <DifficultyDefinition>()
            {
                new DifficultyDefinition("Easy", 0.5f),
                new DifficultyDefinition("Normal", 1.0f),
                new DifficultyDefinition("Hard", 2.0f),
                new DifficultyDefinition("Expert", 3.0f)
            };

            DefaultDifficultyID = Difficulties[1].ID;
        }