当前位置: 首页>>代码示例>>C#>>正文


C# Character.AddHistory方法代码示例

本文整理汇总了C#中Character.AddHistory方法的典型用法代码示例。如果您正苦于以下问题:C# Character.AddHistory方法的具体用法?C# Character.AddHistory怎么用?C# Character.AddHistory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Character的用法示例。


在下文中一共展示了Character.AddHistory方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: UpdateTitle

 protected void UpdateTitle(Character character, Dice dice, CareerHistory careerHistory)
 {
     var oldTitle = character.Title;
     TitleTable(character, careerHistory, dice);
     var newTitle = careerHistory.Title;
     if (oldTitle != newTitle && newTitle != null)
     {
         character.AddHistory($"Is now a {newTitle}");
         character.Title = newTitle;
     }
 }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:11,代码来源:FullCareer.cs

示例2: Event

        internal override void Event(Character character, Dice dice)
        {
            switch (dice.D(2, 6))
            {
                case 2:
                    Mishap(character, dice);
                    character.NextTermBenefits.MusterOut = false;
                    return;
                case 3:

                    if (dice.RollHigh(character.Skills.BestSkillLevel("Investigate", "Art"), 8))
                    {
                        character.AddHistory("Invited to take part in a controversial event or exhibition that improves your social standing.");
                        character.SocialStanding += 1;
                    }
                    else
                    {
                        character.AddHistory("Invited to take part in a controversial event or exhibition that injures your social standing.");
                        character.SocialStanding += -1;
                    }
                    return;
                case 4:
                    character.AddHistory("Join homeworld’s celebrity circles");

                    {
                        var skillList = new SkillTemplateCollection();
                        skillList.Add("Carouse");
                        skillList.Add("Persuade");
                        skillList.Add("Steward");
                        skillList.RemoveOverlap(character.Skills, 1);
                        if (skillList.Count > 0)
                            character.Skills.Add(dice.Choose(skillList), 1);
                        else
                            character.AddHistory("Gain a contact");
                    }

                    return;
                case 5:
                    character.AddHistory($"Works is especially well received and popular, making you a minor celebrity");
                    character.BenefitRollDMs.Add(1);
                    return;
                case 6:
                    character.AddHistory($"Gain a patron in the arts. Gain an Ally");
                    character.CurrentTermBenefits.AdvancementDM += 2;
                    return;
                case 7:
                    LifeEvent(character, dice);
                    return;
                case 8:

                    if (dice.D(2) == 1)
                    {
                        character.AddHistory("Refused to criticise a questionable political leader on your homeworld.");
                    }
                    else
                    {
                        character.AddHistory("Criticised a questionable political leader on your homeworld, causing his downfall. Gain an Enemy");
                        dice.Choose(character.Skills).Level += 1;
                        if (!dice.RollHigh(character.Skills.BestSkillLevel("Art", "Persuade"), 8))
                            Mishap(character, dice);
                    }
                    return;
                case 9:
                    character.AddHistory($"Go on a tour of the sector, visiting several worlds. Gain {dice.D(3)} Contacts.");
                    return;
                case 10:
                    character.AddHistory("One of your pieces of art is stolen, and the investigation brings you into the criminal underworld.");
                    {
                        var skillList = new SkillTemplateCollection();
                        skillList.Add("Streetwise");
                        skillList.Add("Investigate");
                        skillList.Add("Recon");
                        skillList.Add("Stealth");
                        skillList.RemoveOverlap(character.Skills, 1);
                        if (skillList.Count > 0)
                            character.Skills.Add(dice.Choose(skillList), 1);
                    }
                    return;
                case 11:
                    //character.AddHistory("As an artist, you lead a strange and charmed life.");
                    UnusualLifeEvent(character, dice);
                    return;
                case 12:
                    character.AddHistory("Win a prestigious prize.");
                    character.CurrentTermBenefits.AdvancementDM += 100;
                    return;
            }
        }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:88,代码来源:Entertainer.cs

示例3: PickNextCareer

        Career PickNextCareer(CharacterBuilderOptions options, Character character, Dice dice)
        {
            var careers = new List<Career>();

            //Forced picks (e.g. Draft)
            if (character.NextTermBenefits.MustEnroll != null)
            {
                foreach (var career in m_Careers)
                {
                    if (string.Equals(character.NextTermBenefits.MustEnroll, career.Name, StringComparison.OrdinalIgnoreCase) || string.Equals(character.NextTermBenefits.MustEnroll, career.Assignment, StringComparison.OrdinalIgnoreCase))
                    {
                        careers.Add(career);
                    }
                }
            }

            if (!character.NextTermBenefits.MusterOut && careers.Count == 0 && character.LastCareer != null)
            {
                if (dice.D(10) > 1) //continue career
                {
                    foreach (var career in m_Careers)
                    {
                        if (character.LastCareer.Name == career.Name && character.LastCareer.Assignment == career.Assignment)
                        {
                            careers.Add(career);
                        }
                    }
                }
                else
                {
                    character.NextTermBenefits.MusterOut = true;
                    character.AddHistory("Voluntarily left " + character.LastCareer.ShortName);
                }
            }

            //Random picks
            if (careers.Count == 0)
            {
                foreach (var career in m_Careers)
                {
                    if (character.NextTermBenefits.MusterOut && character.LastCareer.Name == career.Name && character.LastCareer.Assignment == career.Assignment)
                        continue;

                    if (career.Qualify(character, dice))
                    {
                        careers.Add(career);
                        character.Trace.Add("Qualified for " + career.Name + " at age " + character.Age);
                    }
                }
            }

            var result = dice.Choose(careers);
            character.Trace.Add("Selected " + result.Name + " at age " + character.Age);
            return result;
        }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:55,代码来源:CharacterBuilder.cs

示例4: AgingRoll


//.........这里部分代码省略.........
                        character.Endurance += -1;
                        break;
                    case 2:
                        character.Strength += -1;
                        character.Dexterity += -2;
                        character.Endurance += -2;
                        break;
                    case 3:
                        character.Strength += -2;
                        character.Dexterity += -1;
                        character.Endurance += -2;
                        break;
                }
            }
            else if (roll == -3)
            {
                switch (dice.D(3))
                {
                    case 1:
                        character.Strength += -2;
                        character.Dexterity += -1;
                        character.Endurance += -1;
                        break;
                    case 2:
                        character.Strength += -1;
                        character.Dexterity += -2;
                        character.Endurance += -1;
                        break;
                    case 3:
                        character.Strength += -1;
                        character.Dexterity += -1;
                        character.Endurance += -2;
                        break;
                }
            }
            else if (roll == -2)
            {
                character.Strength += -1;
                character.Dexterity += -1;
                character.Endurance += -1;
            }
            else if (roll == -1)
            {
                switch (dice.D(3))
                {
                    case 1:
                        character.Strength += -1;
                        character.Dexterity += -1;
                        break;
                    case 2:
                        character.Strength += -1;
                        character.Endurance += -1;
                        break;
                    case 3:
                        character.Dexterity += -1;
                        character.Endurance += -1;
                        break;
                }
            }
            else if (roll == 0)
            {
                switch (dice.D(3))
                {
                    case 1:
                        character.Strength += -1;
                        break;
                    case 2:
                        character.Dexterity += -1;
                        break;
                    case 3:
                        character.Endurance += -1;
                        break;
                }
            }
            else
            {
                return; //no again crisis possible.
            }

            if (character.Strength <= 0 ||
                    character.Dexterity <= 0 ||
                    character.Endurance <= 0 ||
                    character.Intellect <= 0 ||
                    character.Education <= 0 ||
                    character.SocialStanding <= 0)
            {
                var bills = dice.D(6) * 10000;
                character.Debt += bills;
                character.AddHistory($"Aging Crisis. Owe {bills:N0} for medical bills.");

                if (character.Strength < 1) character.Strength = 1;
                if (character.Dexterity < 1) character.Dexterity = 1;
                if (character.Endurance < 1) character.Endurance = 1;
                if (character.Intellect < 1) character.Intellect = 1;
                if (character.Education < 1) character.Education = 1;
                if (character.SocialStanding < 1) character.SocialStanding = 1;
                character.LongTermBenefits.QualificationDM = -100;
                character.LongTermBenefits.Retired = true;
            }
        }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:101,代码来源:CharacterBuilder.cs

示例5: Mishap

        internal override void Mishap(Character character, Dice dice)
        {
            switch (dice.D(6))
            {
                case 1:
                    Injury(character, dice, true);
                    return;
                case 2:
                    character.AddHistory("A mission goes wrong; you and several others are captured and mistreated by the enemy. Gain your jailer as an Enemy.");
                    character.Strength += -1;
                    character.Dexterity += -1;
                    return;
                case 3:
                    character.AddHistory("A mission goes wrong and you are stranded behind enemy lines. Ejected from the service.");
                    {
                        var skillList = new SkillTemplateCollection();
                        skillList.Add("Stealth");
                        skillList.Add("Survival");
                        character.Skills.Increase(dice.Choose(skillList));
                    }
                    return;

                case 4:
                    if (dice.D(2) == 1)
                    {
                        character.AddHistory("Refused to take part in a black ops mission that goes against the conscience and ejected from the service.");
                    }
                    else
                    {
                        character.AddHistory("You are ordered to take part in a black ops mission that goes against your conscience. Gain the lone survivor as an Enemy.");
                        character.CurrentTermBenefits.MusterOut = false;
                    }
                    return;
                case 5:
                    character.AddHistory("You are tormented by or quarrel with an officer or fellow soldier. Gain that officer as a Rival.");
                    return;
                case 6:
                    Injury(character, dice, false);
                    return;
            }
        }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:41,代码来源:Marine.cs

示例6: Mishap

        internal override void Mishap(Character character, Dice dice)
        {
            switch (dice.D(6))
            {
                case 1:
                    Injury(character, dice, true);
                    return;
                case 2:
                    character.AddHistory("Placed in the frozen watch (cryogenically stored on board ship) and revived improperly.");
                    switch (dice.D(3))
                    {
                        case 1:
                            character.Strength -= 1;
                            return;
                        case 2:
                            character.Dexterity -= 1;
                            return;
                        case 3:
                            character.Endurance -= 1;
                            return;
                    }
                    character.NextTermBenefits.MusterOut = false;
                    return;
                case 3:
                    var checkPassed = false;

                    switch (character.LastCareer.Assignment)
                    {
                        case "Line/Crew":
                            checkPassed = (dice.RollHigh(character.Skills.BestSkillLevel("Electronics", "Gunner"), 8));
                            break;
                        case "Engineer/Gunner":
                            checkPassed = (dice.RollHigh(character.Skills.BestSkillLevel("Mechanic", "Vacc Suit"), 8));
                            break;
                        case "Flight":
                            checkPassed = (dice.RollHigh(character.Skills.BestSkillLevel("Pilot", "Tactics"), 8));
                            break;
                    }
                    if (checkPassed)
                    {
                        character.AddHistory("During a battle, defeat or victory depends on your actions. You actions lead to an honorabe discharge.");
                        character.BenefitRolls += 1;
                    }
                    else
                    {
                        character.AddHistory("During a battle, defeat or victory depends on your actions. The ship suffers severe damage and you are blamed for the disaster. You are court - martialled and discharged.");
                    }

                    return;

                case 4:
                    if (dice.D(2) == 1)
                    {
                        character.AddHistory("You are blamed for an accident that causes the death of several crew members. Your guilt drives you to excel.");

                        var skillTables = new List<SkillTable>();
                        skillTables.Add(PersonalDevelopment);
                        skillTables.Add(ServiceSkill);
                        skillTables.Add(AssignmentSkills);
                        if (character.Education >= AdvancedEductionMin)
                            skillTables.Add(AdvancedEducation);
                        if (character.LastCareer.CommissionRank > 0)
                            skillTables.Add(OfficerTraining);

                        dice.Choose(skillTables)(character, dice);
                    }
                    else
                    {
                        character.AddHistory("You are falsed accused for an accident that causes the death of several crew members. Gain the officer who blamed you as an Enemy.");
                        character.BenefitRolls += 1;
                    }
                    return;
                case 5:
                    character.AddHistory("You are tormented by or quarrel with an officer or fellow crewman. Gain that character as a Rival.");
                    return;
                case 6:
                    Injury(character, dice, false);
                    return;
            }
        }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:80,代码来源:Navy.cs

示例7: Mishap

        internal override void Mishap(Character character, Dice dice)
        {
            switch (dice.D(6))
            {
                case 1:
                    Injury(character, dice, true);
                    return;
                case 2:
                    character.AddHistory("Life ruined by a criminal gang. Gain the gang as an Enemy");
                    return;
                case 3:
                    character.AddHistory("Hard times caused by a lack of interstellar trade costs you your job.");
                    character.SocialStanding += -1;
                    return;

                case 4:
                    if (dice.D(2) == 1)
                    {
                        character.AddHistory("Accepted a deal with criminal or other figure under investigation.");
                    }
                    else
                    {
                        character.AddHistory("Refused a deal with criminal or other figure under investigation. Gain an Enemy");
                        character.Skills.Increase(dice.Choose(RandomSkills));
                    }
                    return;
                case 5:
                    character.AddHistory("Your work ends up coming home with you, and someone gets hurt. Contact or ally takes the worst of 2 injury rolls.");
                    return;
                case 6:
                    Injury(character, dice, false);
                    return;
            }
        }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:34,代码来源:Agent.cs

示例8: Run

        internal override void Run(Character character, Dice dice)
        {
            CareerHistory careerHistory;
            if (!character.CareerHistory.Any(pc => pc.Name == Name))
            {
                character.AddHistory($"Became a {Assignment} at age {character.Age}");
                BasicTraining(character, dice, character.CareerHistory.Count == 0);

                careerHistory = new CareerHistory(Name, Assignment, 0);
                character.CareerHistory.Add(careerHistory);

                UpdateTitle(character, dice, careerHistory);
            }
            else
            {
                if (!character.CareerHistory.Any(pc => pc.Assignment == Assignment))
                {
                    character.AddHistory($"Switched to {Assignment} at age {character.Age}");
                    careerHistory = new CareerHistory(Name, Assignment, 0);
                    character.CareerHistory.Add(careerHistory);
                }
                else if (character.LastCareer?.Assignment == Assignment)
                {
                    character.AddHistory($"Continued as {Assignment} at age {character.Age}");
                    careerHistory = character.CareerHistory.Single(pc => pc.Assignment == Assignment);
                }
                else
                {
                    character.AddHistory($"Returned to {Assignment} at age {character.Age}");
                    careerHistory = character.CareerHistory.Single(pc => pc.Assignment == Assignment);
                }

                var skillTables = new List<SkillTable>();
                skillTables.Add(PersonalDevelopment);
                skillTables.Add(ServiceSkill);
                skillTables.Add(AssignmentSkills);
                if (character.Education >= AdvancedEductionMin)
                    skillTables.Add(AdvancedEducation);
                if (careerHistory.CommissionRank > 0)
                    skillTables.Add(OfficerTraining);

                dice.Choose(skillTables)(character, dice);
            }
            careerHistory.Terms += 1;
            character.LastCareer = careerHistory;

            //rank carry-over
            careerHistory.Rank = character.CareerHistory.Where(c => c.Name == Name).Max(c => c.Rank);
            careerHistory.CommissionRank = character.CareerHistory.Where(c => c.Name == Name).Max(c => c.CommissionRank);

            //Early commission, possibly from military academy.
            if (careerHistory.CommissionRank == 0 && character.CurrentTermBenefits.FreeCommissionRoll)
            {
                AttemptCommission(character, dice, careerHistory);
            }

            var survived = dice.RollHigh(character.GetDM(SurvivalAttribute) + character.NextTermBenefits.SurvivalDM, SurvivalTarget);
            if (survived)
            {
                character.BenefitRolls += 1;

                Event(character, dice);

                var totalTermsInCareer = character.CareerHistory.Where(pc => pc.Name == Name).Sum(c => c.Terms);

                //Not all people will attempt a commission even when possible
                var attemptCommission = (totalTermsInCareer == 1 || character.SocialStanding >= 9) && dice.D(100) < Book.OddsOfSuccess(character, "Soc", 8 - character.CurrentTermBenefits.CommissionDM);

                var commissionEarned = false;

                if (careerHistory.CommissionRank == 0 && (attemptCommission || character.CurrentTermBenefits.FreeCommissionRoll))
                    commissionEarned = AttemptCommission(character, dice, careerHistory);

                if (!commissionEarned)
                {
                    //try for advancement only if failed to earn a commission.
                    var advancementRoll = dice.D(2, 6);
                    if (advancementRoll == 12)
                    {
                        character.AddHistory("Forced to continue current assignment");
                        character.NextTermBenefits.MustEnroll = Assignment;
                    }
                    advancementRoll += character.GetDM(AdvancementAttribute) + character.CurrentTermBenefits.AdvancementDM;

                    if (advancementRoll <= careerHistory.Terms)
                    {
                        character.AddHistory("Forced to muster out.");
                        character.NextTermBenefits.MusterOut = true;
                    }
                    if (advancementRoll > AdvancementTarget)
                    {
                        if (careerHistory.CommissionRank > 0)
                        {
                            careerHistory.CommissionRank += 1;
                            character.AddHistory($"Promoted to officer rank {careerHistory.CommissionRank}");
                        }
                        else
                        {
                            careerHistory.Rank += 1;
                            character.AddHistory($"Promoted to rank {careerHistory.Rank}");
//.........这里部分代码省略.........
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:101,代码来源:MilitaryCareer.cs

示例9: PreCareerEvents

        public void PreCareerEvents(Character character, Dice dice, 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);
                    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(m_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;
            }
        }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:94,代码来源:Book.cs

示例10: LifeEvent

 public void LifeEvent(Character character, Dice dice)
 {
     switch (dice.D(2, 6))
     {
         case 2:
             Injury(character, dice);
             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;
     }
 }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:50,代码来源:Book.cs

示例11: Event

        internal override void Event(Character character, Dice dice)
        {
            switch (dice.D(2, 6))
            {
                case 2:
                    Mishap(character, dice);
                    character.NextTermBenefits.MusterOut = false;
                    return;
                case 3:
                    character.AddHistory("Arrested and charged.");
                    switch (dice.D(2))
                    {
                        case 1:
                            if (dice.RollHigh(character.Skills.GetLevel("Advocate"), 8))
                            {
                                character.AddHistory("Successfully defended self.");
                            }
                            else
                            {
                                character.AddHistory("Failed to defend self. Gain an Enemy and go to prison.");
                                character.NextTermBenefits.MustEnroll = "Prisoner";
                            }
                            return;
                        case 2:
                            character.AddHistory("Hired a lawyer to beat the charges.");
                            character.BenefitRolls += -1;
                            return;
                    }
                    return;
                case 4:
                    character.AddHistory("Involved in the planning of an impressive heist.");
                    {
                        var skillList = new SkillTemplateCollection();
                        skillList.AddRange(SpecialtiesFor("Electronics"));
                        skillList.Add("Mechanic");
                        skillList.RemoveOverlap(character.Skills, 1);
                        if (skillList.Count > 0)
                            character.Skills.Add(dice.Choose(skillList), 1);
                    }

                    return;
                case 5:
                    character.AddHistory("Crime pays off. Gain victim as Enemy.");
                    character.BenefitRollDMs.Add(2);
                    return;
                case 6:
                    switch (dice.D(2))
                    {
                        case 1:
                            character.AddHistory("Backstab a fellow rogue for personal gain.");
                            character.CurrentTermBenefits.AdvancementDM += 4;
                            return;
                        case 2:
                            character.AddHistory("Refuse to backstab a fellow rogue for personal gain. Gain an Ally");
                            return;
                    }
                    return;
                case 7:
                    LifeEvent(character, dice);
                    return;
                case 8:
                    character.AddHistory("You spend months in the dangerous criminal underworld.");
                    {
                        var skillList = new SkillTemplateCollection();
                        skillList.Add("Streetwise");
                        skillList.Add("Stealth");
                        skillList.AddRange(SpecialtiesFor("Melee"));
                        skillList.AddRange(SpecialtiesFor("Gun Combat"));
                        skillList.RemoveOverlap(character.Skills, 1);
                        if (skillList.Count > 0)
                            character.Skills.Add(dice.Choose(skillList), 1);
                    }
                    return;
                case 9:
                    character.AddHistory("Involved in a feud with a rival criminal organization.");
                    if (dice.RollHigh(character.Skills.BestSkillLevel("Stealth", "Gun Combat"), 8))
                        character.BenefitRolls += 1;
                    else
                        Injury(character, dice);
                    return;
                case 10:
                    character.AddHistory("Involved in a gambling ring. ");
                    character.Skills.Add("Gambler", 1);
                    if (character.BenefitRolls > 0)
                    {
                        if (dice.RollHigh(character.Skills.GetLevel("Gambler"), 8))
                            character.BenefitRolls = (int)Math.Ceiling(1.5 * character.BenefitRolls);
                        else
                            character.BenefitRolls = 0;
                    }
                    return;
                case 11:
                    character.AddHistory("A crime lord considers you his protégé.");
                    switch (dice.D(2))
                    {
                        case 1:
                            character.Skills.Add("Tactics", "Military", 1);
                            return;
                        case 2:
                            character.CurrentTermBenefits.AdvancementDM += 4;
//.........这里部分代码省略.........
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:101,代码来源:Rogue.cs

示例12: Mishap

        internal override void Mishap(Character character, Dice dice)
        {
            switch (dice.D(6))
            {
                case 1:
                    Injury(character, dice, true);
                    return;
                case 2:
                    character.AddHistory("Arrested");
                    character.NextTermBenefits.MustEnroll = "Prisoner";
                    return;
                case 3:
                    character.AddHistory("Betrayed by a friend. One of your Contacts or Allies betrays you, ending your career. That Contact or Ally becomes a Rival or Enemy.");
                    if (dice.D(2, 6) == 2)
                    {
                        character.NextTermBenefits.MustEnroll = "Prisoner";
                    }
                    return;

                case 4:
                    character.AddHistory("A job goes wrong, forcing you to flee off-planet. ");
                    {
                        var skillList = new SkillTemplateCollection();
                        skillList.Add("Deception");
                        skillList.Add("Pilot", "Small Craft");
                        skillList.Add("Pilot", "Spacecraft");
                        skillList.Add("Athletics", "Dexterity");
                        skillList.AddRange(SpecialtiesFor("Gunner"));
                        skillList.RemoveOverlap(character.Skills, 1);
                        if (skillList.Count > 0)
                            character.Skills.Add(dice.Choose(skillList), 1);
                    }

                    return;
                case 5:
                    character.AddHistory("A police detective or rival criminal forces you to flee and vows to hunt you down. Gain an Enemy.");
                    return;
                case 6:
                    Injury(character, dice, false);
                    return;
            }
        }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:42,代码来源:Rogue.cs

示例13: Event

        internal override void Event(Character character, Dice dice)
        {
            switch (dice.D(2, 6))
            {
                case 2:
                    Mishap(character, dice);
                    character.NextTermBenefits.MusterOut = false;
                    return;
                case 3:
                    if (dice.D(2) == 1)
                    {
                        character.AddHistory("Refused to perform research that goes against your conscience.");
                    }
                    else
                    {
                        character.AddHistory($"Agreed to perform research that goes against your conscience. Gain {dice.D(3)} Enemies.");
                        character.BenefitRolls += 1;

                        var skillList = new SkillTemplateCollection(SpecialtiesFor("Science"));
                        character.Skills.Increase(dice.Pick(skillList));
                        character.Skills.Increase(dice.Pick(skillList)); //pick 2

                    }
                    return;
                case 4:
                    character.AddHistory("Assigned to work on a secret project for a patron or organisation.");
                    {
                        var skillList = new SkillTemplateCollection();
                        skillList.Add("Medic");
                        skillList.AddRange(SpecialtiesFor("Science"));
                        skillList.AddRange(SpecialtiesFor("Engineer"));
                        skillList.AddRange(SpecialtiesFor("Electronics"));
                        skillList.Add("Investigate");
                        skillList.RemoveOverlap(character.Skills, 1);
                        if (skillList.Count > 0)
                            character.Skills.Add(dice.Choose(skillList), 1);
                    }
                    return;
                case 5:
                    character.AddHistory($"Win a prestigious prize for your work.");
                    character.BenefitRollDMs.Add(1);
                    return;
                case 6:
                    character.AddHistory("Advanced training in a specialist field.");
                    if (dice.RollHigh(character.EducationDM, 8))
                    {
                        var skillList = new SkillTemplateCollection(RandomSkills);
                        skillList.RemoveOverlap(character.Skills, 1);
                        if (skillList.Count > 0)
                            character.Skills.Add(dice.Choose(skillList), 1);
                    }

                    return;
                case 7:
                    LifeEvent(character, dice);
                    return;
                case 8:
                    {
                        if (dice.D(2) == 1)
                        {
                            if (dice.RollHigh(character.Skills.BestSkillLevel("Deception", "Admin"), 8))
                            {
                                character.AddHistory("Cheated in some fashion, advancing your career and research by stealing another’s work, using an alien device, taking a shortcut and so forth.");
                                character.BenefitRollDMs.Add(2);
                                dice.Choose(character.Skills).Level += 1;
                            }
                            else
                            {
                                character.AddHistory("Caught cheating in some fashion, advancing your career and research by stealing another’s work, using an alien device, taking a shortcut and so forth.");
                                character.BenefitRolls += -1;
                                Mishap(character, dice);
                            }
                            character.AddHistory("Gain an Enemy");
                        }
                        else
                        {
                            character.AddHistory("Refuse to join a cheat in some fashion.");
                        }

                    }
                    return;
                case 9:
                    character.AddHistory("Make a breakthrough in your field.");
                    character.CurrentTermBenefits.AdvancementDM += 2;
                    return;
                case 10:
                    character.AddHistory("Entangled in a bureaucratic or legal morass that distracts you from your work.");
                    {
                        var skillList = new SkillTemplateCollection();
                        skillList.Add("Admin");
                        skillList.Add("Advocate");
                        skillList.Add("Persuade");
                        skillList.Add("Diplomat");
                        skillList.RemoveOverlap(character.Skills, 1);
                        if (skillList.Count > 0)
                            character.Skills.Add(dice.Choose(skillList), 1);
                    }
                    return;
                case 11:
                    character.AddHistory("Work for an eccentric but brilliant mentor, who becomes an Ally.");
//.........这里部分代码省略.........
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:101,代码来源:Scholar.cs

示例14: Mishap

        internal override void Mishap(Character character, Dice dice)
        {
            switch (dice.D(6))
            {
                case 1:
                    Injury(character, dice, true);
                    return;
                case 2:
                    character.AddHistory("A disaster leaves several injured, and others blame you, forcing you to leave your career. Gain a Rival.");
                    Injury(character, dice);
                    return;
                case 3:
                    character.AddHistory("A disaster or war strikes.");
                    if (!dice.RollHigh(character.Skills.BestSkillLevel("Stealth", "Deception"), 8))
                        Injury(character, dice);

                    if (dice.D(2) == 1)
                    {
                        character.AddHistory("The planetary government interferes with your research for political or religious reasons. You continue working secretely.");
                        character.SocialStanding += -2;
                    }
                    else
                    {
                        character.AddHistory("The planetary government interferes with your research for political or religious reasons. You continue working openly and gain an Enemy.");
                    }
                    character.Skills.Increase(dice.Choose(SpecialtiesFor("Science")));
                    character.NextTermBenefits.MusterOut = false;
                    return;

                case 4:
                    character.AddHistory("An expedition or voyage goes wrong, leaving you stranded in the wilderness.");
                    {
                        var skillList = new SkillTemplateCollection();
                        skillList.Add("Survival");
                        skillList.Add("Athletics", "Dexterity");
                        skillList.Add("Athletics", "Endurance");
                        skillList.RemoveOverlap(character.Skills, 1);
                        if (skillList.Count > 0)
                            character.Skills.Add(dice.Choose(skillList), 1);
                    }
                    return;
                case 5:
                    if (dice.D(2) == 1)
                    {
                        character.AddHistory("Your work is sabotaged by unknown parties. You may salvage what you can and give up.");
                        character.BenefitRolls += 1;
                    }
                    else
                    {
                        character.AddHistory("Your work is sabotaged by unknown parties. You start again from scratch.");
                        character.BenefitRolls = 0;
                        character.NextTermBenefits.MusterOut = false;
                    }
                    return;
                case 6:
                    character.AddHistory("A rival researcher blackens your name or steals your research. Gain a Rival.");
                    character.NextTermBenefits.MusterOut = false;
                    return;
            }
        }
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:60,代码来源:Scholar.cs

示例15: Run

        internal override void Run(Character character, Dice dice)
        {
            CareerHistory careerHistory;
            if (!character.CareerHistory.Any(pc => pc.Name == Name))
            {
                character.AddHistory($"Became a {Assignment} at age {character.Age}");
                BasicTrainingSkills(character, dice, character.CareerHistory.Count == 0);

                careerHistory = new CareerHistory(Name, Assignment, 0);
                character.CareerHistory.Add(careerHistory);
                UpdateTitle(character, dice, careerHistory);
            }
            else
            {
                if (!character.CareerHistory.Any(pc => pc.Assignment == Assignment))
                {
                    character.AddHistory($"Switched to {Assignment} at age {character.Age}");
                    careerHistory = new CareerHistory(Name, Assignment, 0);
                    character.CareerHistory.Add(careerHistory);

                    if (!RankCarryover) //then this is a new career
                    {
                        UpdateTitle(character, dice, careerHistory);
                        BasicTrainingSkills(character, dice, false);
                    }

                }
                else if (character.LastCareer?.Assignment == Assignment)
                {
                    character.AddHistory($"Continued as {Assignment} at age {character.Age}");
                    careerHistory = character.CareerHistory.Single(pc => pc.Assignment == Assignment);
                }
                else
                {
                    character.AddHistory($"Returned to {Assignment} at age {character.Age}");
                    careerHistory = character.CareerHistory.Single(pc => pc.Assignment == Assignment);
                }

                var skillTables = new List<SkillTable>();
                skillTables.Add(PersonalDevelopment);
                skillTables.Add(ServiceSkill);
                skillTables.Add(AssignmentSkills);
                if (character.Education >= AdvancedEductionMin)
                    skillTables.Add(AdvancedEducation);

                dice.Choose(skillTables)(character, dice);
            }
            careerHistory.Terms += 1;

            if (RankCarryover)
            {
                careerHistory.Rank = character.CareerHistory.Where(c => c.Name == Name).Max(c => c.Rank);
                careerHistory.CommissionRank = character.CareerHistory.Where(c => c.Name == Name).Max(c => c.CommissionRank);
            }

            var survived = dice.RollHigh(character.GetDM(SurvivalAttribute) + character.NextTermBenefits.SurvivalDM, SurvivalTarget);
            if (survived)
            {
                character.BenefitRolls += 1;

                Event(character, dice);

                var advancementRoll = dice.D(2, 6);
                if (advancementRoll == 12)
                {
                    character.AddHistory("Forced to continue current assignment");
                    character.NextTermBenefits.MustEnroll = Assignment;
                }
                advancementRoll += character.GetDM(AdvancementAttribute) + character.CurrentTermBenefits.AdvancementDM;

                if (advancementRoll <= careerHistory.Terms)
                {
                    character.AddHistory("Forced to muster out.");
                    character.NextTermBenefits.MusterOut = true;
                }
                if (advancementRoll > AdvancementTarget)
                {

                    careerHistory.Rank += 1;
                    character.AddHistory($"Promoted to rank {careerHistory.Rank}");

                    UpdateTitle(character, dice, careerHistory);

                    //advancement skill
                    var skillTables = new List<SkillTable>();
                    skillTables.Add(PersonalDevelopment);
                    skillTables.Add(ServiceSkill);
                    skillTables.Add(AssignmentSkills);
                    if (character.Education >= AdvancedEductionMin)
                        skillTables.Add(AdvancedEducation);
                    dice.Choose(skillTables)(character, dice);
                }
            }
            else
            {
                character.NextTermBenefits.MusterOut = true;
                Mishap(character, dice);
            }

            character.LastCareer = careerHistory;
//.........这里部分代码省略.........
开发者ID:Grauenwolf,项目名称:TravellerTools,代码行数:101,代码来源:NormalCareer.cs


注:本文中的Character.AddHistory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。