public static int LifepathGeneralPoints(Character character)
        {
            int             count        = 0;
            List <Lifepath> ProcessedLPs = new List <Lifepath>();

            foreach (Lifepath lp in character.LifepathList)
            {
                int duplicateCount = 0;
                foreach (Lifepath lpTest in ProcessedLPs)
                {
                    if (LifepathIndex.AreEquivalent(lp, lpTest))
                    {
                        duplicateCount++;
                    }
                }
                if (duplicateCount < 2)
                {
                    count += lp.GeneralSkillPoints;
                }
                if (duplicateCount == 2)
                {
                    count += lp.GeneralSkillPoints / 2;
                }
                if (duplicateCount > 2)
                {
                    count += 0;
                }

                ProcessedLPs.Add(lp);
            }
            return(count);
        }
        public static int LifepathSkillPoints(Character character)
        {
            int             count        = 0;
            List <Lifepath> ProcessedLPs = new List <Lifepath>();

            foreach (Lifepath lp in character.LifepathList)
            {
                int duplicateCount = 0;
                foreach (Lifepath lpTest in ProcessedLPs)
                {
                    if (LifepathIndex.AreEquivalent(lp, lpTest))
                    {
                        duplicateCount++;
                    }
                }
                //dupeCt is one less than the number of times the lifepath is taken
                if (duplicateCount < 2)
                {
                    count += lp.SkillPoints;
                }
                if (duplicateCount == 2)
                {
                    count += lp.SkillPoints / 2;
                }
                if (duplicateCount > 2)
                {
                    count += 0;
                }

                ProcessedLPs.Add(lp);
            }
            return(count);
        }
        public static int LifepathTraitPoints(Character character)
        {
            int             count        = 0;
            List <Lifepath> ProcessedLPs = new List <Lifepath>();

            foreach (Lifepath lp in character.LifepathList)
            {
                int duplicateCount = 0;
                foreach (Lifepath lpTest in ProcessedLPs)
                {
                    if (LifepathIndex.AreEquivalent(lp, lpTest))
                    {
                        duplicateCount++;
                    }
                }
                if (duplicateCount == 0)
                {
                    count += lp.TraitPoints;
                }
                //This ternary statement checks the existence of a second trait.
                //If a second trait exists, then one less trait point is given the second time.
                if (duplicateCount == 1)
                {
                    count += lp.TraitPoints - (lp.Traits.Count >= duplicateCount + 1 ? 0 : 1);
                }
                ProcessedLPs.Add(lp);
            }
            return(count);
        }
Esempio n. 4
0
 static void Main(string[] args)
 {
     //Todo: change the enum for MP to [Flags]
     TraitIndex.getTraitByName("Veneer of Obedience");
     SkillIndex.getSkillByName("Ship-wise");
     LifepathIndex.getLifepathByNameSetting("Boy", "Human_Seafaring");
 }
        public static int LifepathPhysicalPoints(Character character)
        {
            int             count        = 0;
            List <Lifepath> ProcessedLPs = new List <Lifepath>();

            foreach (Lifepath lp in character.LifepathList)
            {
                int duplicateCount = 0;
                foreach (Lifepath lpTest in ProcessedLPs)
                {
                    if (LifepathIndex.AreEquivalent(lp, lpTest))
                    {
                        duplicateCount++;
                    }
                }
                if (duplicateCount <= 1) //No stat points for >2 walks
                {
                    if (lp.MentalPhysical.Equals(MPPoint.Neg_P))
                    {
                        count -= 1;
                    }
                    if (lp.MentalPhysical.Equals(MPPoint.Neg_MP))
                    {
                        count -= 1;
                    }
                    if (lp.MentalPhysical.Equals(MPPoint.Pos_P))
                    {
                        count += 1;
                    }
                    if (lp.MentalPhysical.Equals(MPPoint.Pos_MP))
                    {
                        count += 1;
                    }
                }

                ProcessedLPs.Add(lp);
            }

            return(count);
        }