コード例 #1
0
ファイル: Character.cs プロジェクト: dan101201/Cyberpunk2020
        /// <summary>
        /// Generates random Character using all of the other functions in this class
        /// </summary>
        /// <returns>Character</returns>
        public static Character GenerateRandomNPC(int points)
        {
            Character res = new Character();

            res.points = points;
            Random rnd = new Random();

            res.male = rnd.Next(0, 2) != 0;
            res.name = RandomNameGenerator(res.male);
            res.role = Role.roles[Role.IntToRoleName(rnd.Next(0, 11))];
            res.style.RandomlySelectStyle();
            res.motivation = Motivation.RandomlyGenerateMotivation();
            rnd.Next(1, 10);
            //temp.role = Role.roles[Role.IntToRoleName(rnd.Next(1, 10)).ToLower()];
            //temp.stats = Stats.GenerateStatsForNpc(points, temp);
            res.NPC = true;

            res.age = 16 + rnd.Next(1, 6) + rnd.Next(1, 6);
            return(res);
        }
コード例 #2
0
        /// <summary>
        /// Randomly generates a Motivation
        /// </summary>
        /// <returns></returns>
        public static Motivation RandomlyGenerateMotivation()
        {
            Random     rnd  = new Random();
            Motivation temp = new Motivation();

            //Reads text file full of motivations
            string[] lines  = Properties.Resources.Motivation.Split('\n');
            int      random = rnd.Next(1, 10);

            temp._personalityTraits = lines[random];
            random = rnd.Next(1, 10);
            temp._mostValuedPerson = lines[random + 10];
            random                    = rnd.Next(1, 10);
            temp._mostValued          = lines[random + 20];
            random                    = rnd.Next(1, 10);
            temp._feelingAbout        = lines[random + 30];
            random                    = rnd.Next(1, 10);
            temp._mostValuedPossesion = lines[random + 40];
            return(temp);
        }