Example #1
0
        public void LifeEvent(Character character, Dice dice, Careers.CareerBase career)
        {
            switch (dice.D(2, 6))
            {
            case 2:
                Injury(character, dice, career);
                return;

            case 3:
                character.AddHistory("Birth or Death involving a family member or close friend.");
                return;

            case 4:
                character.AddHistory("A romantic relationship ends badly. Gain a Rival or Enemy.");
                return;

            case 5:
                character.AddHistory("A romantic relationship deepens, possibly leading to marriage. Gain an Ally.");
                return;

            case 6:
                character.AddHistory("A new romantic starts. Gain an Ally.");
                return;

            case 7:
                character.AddHistory("Gained a contact.");
                return;

            case 8:
                character.AddHistory("Betrayal. Convert an Ally into a Rival or Enemy.");
                return;

            case 9:
                character.AddHistory("Moved to a new world.");
                character.NextTermBenefits.QualificationDM += 1;
                return;

            case 10:
                character.AddHistory("Good fortune");
                character.BenefitRollDMs.Add(2);
                return;

            case 11:
                if (dice.D(2) == 1)
                {
                    character.BenefitRolls -= 1;
                    character.AddHistory("Victim of a crime");
                }
                else
                {
                    character.AddHistory("Accused of a crime");
                    character.NextTermBenefits.MustEnroll = "Prisoner";
                }
                return;

            case 12:
                UnusualLifeEvent(character, dice);
                return;
            }
        }
Example #2
0
        public static void Injury(Character character, Dice dice, Careers.CareerBase career, bool severe = false)
        {
            //TODO: Add medical bills support. Page 47

            var medCovered      = career.MedicalPaymentPercentage(character, dice);
            var medCostPerPoint = (1.0M - medCovered) * 5000;

            var roll = dice.D(6);

            if (severe)
            {
                roll = Math.Min(roll, dice.D(6));
            }

            int    strengthPoints      = 0;
            int    dexterityPoints     = 0;
            int    endurancePoints     = 0;
            int    strengthPointsLost  = 0;
            int    dexterityPointsLost = 0;
            int    endurancePointsLost = 0;
            string logMessage          = "";

            switch (roll)
            {
            case 1:
                logMessage = "Nearly killed.";
                switch (dice.D(3))
                {
                case 1:
                    strengthPoints  = dice.D(6);
                    dexterityPoints = 2;
                    endurancePoints = 2;
                    break;

                case 2:
                    strengthPoints  = 2;
                    dexterityPoints = dice.D(6);
                    endurancePoints = 2;
                    break;

                case 3:
                    strengthPoints  = 2;
                    dexterityPoints = 2;
                    endurancePoints = dice.D(6);
                    break;
                }
                break;

            case 2:
                logMessage = "Severely injured.";
                switch (dice.D(3))
                {
                case 1:
                    strengthPoints = dice.D(6);
                    break;

                case 2:
                    dexterityPoints = dice.D(6);
                    break;

                case 3:
                    endurancePoints = dice.D(6);
                    break;
                }
                break;

            case 3:
                logMessage = "Lost eye or limb.";
                switch (dice.D(2))
                {
                case 1:
                    strengthPoints = 2;
                    break;

                case 2:
                    dexterityPoints = 2;
                    break;
                }
                break;

            case 4:
                logMessage = "Scarred.";
                switch (dice.D(3))
                {
                case 1:
                    strengthPoints = 2;
                    break;

                case 2:
                    dexterityPoints = 2;
                    break;

                case 3:
                    endurancePoints = 2;
                    break;
                }
                break;

            case 5:
                logMessage = "Injured.";
                switch (dice.D(3))
                {
                case 1:
                    strengthPoints = 1;
                    break;

                case 2:
                    dexterityPoints = 1;
                    break;

                case 3:
                    endurancePoints = 1;
                    break;
                }
                break;

            case 6:
                logMessage = "Lightly injured, no permanent damage.";
                break;
            }

            var medicalBills = 0M;

            for (int i = 0; i < strengthPoints; i++)
            {
                if (dice.D(10) > 1) //90% chance of healing
                {
                    medicalBills += medCostPerPoint;
                }
                else
                {
                    character.Strength -= 1;
                    strengthPointsLost += 1;
                }
            }
            for (int i = 0; i < dexterityPoints; i++)
            {
                if (dice.D(10) > 1) //90% chance of healing
                {
                    medicalBills += medCostPerPoint;
                }
                else
                {
                    character.Dexterity -= 1;
                    dexterityPointsLost += 1;
                }
            }
            for (int i = 0; i < endurancePoints; i++)
            {
                if (dice.D(10) > 1) //90% chance of healing
                {
                    medicalBills += medCostPerPoint;
                }
                else
                {
                    character.Endurance -= 1;
                    endurancePointsLost += 1;
                }
            }

            if (strengthPointsLost == 0 && dexterityPointsLost == 0 && endurancePointsLost == 0)
            {
                logMessage += " Fully recovered.";
            }

            if (medicalBills > 0)
            {
                logMessage += $" Owe {medicalBills.ToString("N0")} for medical bills.";
            }

            character.AddHistory(logMessage);
        }
Example #3
0
        public void PreCareerEvents(Character character, Dice dice, Careers.CareerBase career, params string[] skills)
        {
            switch (dice.D(2, 6))
            {
            case 2:
                character.AddHistory("Contacted by an underground psionic group");
                character.LongTermBenefits.MayTestPsi = true;
                return;

            case 3:
                character.AddHistory("Suffered a deep tragedy.");
                character.CurrentTermBenefits.GraduationDM = -100;
                return;

            case 4:
                character.AddHistory("A prank goes horribly wrong.");
                var roll = dice.D(2, 6) + character.SocialStandingDM;

                if (roll >= 8)
                {
                    character.AddHistory("Gain a Rival.");
                }
                else if (roll > 2)
                {
                    character.AddHistory("Gain an Enemy.");
                }
                else
                {
                    character.NextTermBenefits.MustEnroll = "Prisoner";
                }
                return;

            case 5:
                character.AddHistory("Spent the college years partying.");
                character.Skills.Add("Carouse", 1);
                return;

            case 6:
                character.AddHistory($"Made lifelong friends. Gain {dice.D(3)} Allies.");
                return;

            case 7:
                LifeEvent(character, dice, career);
                return;

            case 8:
                if (dice.RollHigh(character.SocialStandingDM, 8))
                {
                    character.AddHistory("Become leader in social movement.");
                    character.AddHistory("Gain an Ally and an Enemy.");
                }
                else
                {
                    character.AddHistory("Join a social movement.");
                }
                return;

            case 9:
            {
                var skillList = new SkillTemplateCollection(RandomSkills);
                skillList.RemoveOverlap(character.Skills, 0);

                if (skillList.Count > 0)
                {
                    var skill = dice.Choose(skillList);
                    character.Skills.Add(skill);
                    character.AddHistory($"Study {skill} as a hobby.");
                }
            }
                return;

            case 10:

                if (dice.RollHigh(9))
                {
                    var skill = dice.Choose(skills);
                    character.Skills.Increase(skill, 1);
                    character.AddHistory($"Expand the field of {skill}, but gain a Rival in your former tutor.");
                }
                return;

            case 11:
                character.AddHistory("War breaks out, triggering a mandatory draft.");
                if (dice.RollHigh(character.SocialStandingDM, 9))
                {
                    character.AddHistory("Used social standing to avoid the draft.");
                }
                else
                {
                    character.CurrentTermBenefits.GraduationDM -= 100;
                    if (dice.D(2) == 1)
                    {
                        character.AddHistory("Fled from the draft.");
                        character.NextTermBenefits.MustEnroll = "Drifter";
                    }
                    else
                    {
                        var roll2 = dice.D(6);
                        if (roll2 <= 3)
                        {
                            character.NextTermBenefits.MustEnroll = "Army";
                        }
                        else if (roll2 <= 5)
                        {
                            character.NextTermBenefits.MustEnroll = "Marine";
                        }
                        else
                        {
                            character.NextTermBenefits.MustEnroll = "Navy";
                        }
                    }
                }
                return;

            case 12:
                character.AddHistory("Widely recognized.");
                character.SocialStanding += 1;
                return;
            }
        }