Exemple #1
0
 private void DoTellStories(ToldStoriesTo village)
 {
     if (village._battleStoriesTold < _notableBattlesWon)
     {
         float _renownToGive = CalculateRenownToGive();
         GainRenownAction.Apply(Hero.MainHero, _renownToGive, true);
         InformationManager.DisplayMessage(new InformationMessage("You told the villagers a story about a notable battle, gained " + _renownToGive + " renown."));
         village._daysToResetStories = CampaignTime.DaysFromNow(RandomizeDays());
         village._hasToldStories     = true;
         village._battleStoriesTold++;
         Hero.MainHero.AddSkillXp(DefaultSkills.Charm, MBRandom.RandomInt(1, 3));
         if (_renownToGive >= 0.9)
         {
             if (Settlement.CurrentSettlement.Notables.Count >= 1)
             {
                 InformationManager.DisplayMessage(new InformationMessage("Notable people in village were impressed by your feats and like you more."));
                 foreach (Hero notablePerson in Settlement.CurrentSettlement.Notables)
                 {
                     ChangeRelationAction.ApplyPlayerRelation(notablePerson, +1, false, true);
                 }
             }
         }
     }
     else
     {
         InformationManager.DisplayMessage(new InformationMessage("You do not have new stories to tell to these villagers."));
     }
 }
 private void DoTellStories(ToldStoriesTo village)
 {
     if (village._battleStoriesTold < _notableBattlesWon)
     {
         SkillObject skill;
         int         num;
         skill = SkillObject.FindFirst((x) => { return(x.StringId == "Charm"); });
         num   = (int)Math.Ceiling(MobileParty.MainParty.LeaderHero.GetSkillValue(skill) * 0.03f);
         float _renownToGive = CalculateRenownToGive(num);
         GainRenownAction.Apply(Hero.MainHero, _renownToGive, true);
         if ((double)_renownToGive <= 0.2)
         {
             village._daysToResetStories = CampaignTime.DaysFromNow(this.RandomizeDays());
             village._hasToldStories     = true;
             ++village._battleStoriesTold;
             Hero.MainHero.AddSkillXp(DefaultSkills.Charm, 1);
             InformationManager.DisplayMessage(new InformationMessage("Your story failed to inspire the villagers."));
             return;
         }
         InformationManager.DisplayMessage(new InformationMessage("You told the villagers a story about a notable battle, gained " + _renownToGive + " renown."));
         village._daysToResetStories = CampaignTime.DaysFromNow(RandomizeDays());
         village._hasToldStories     = true;
         village._battleStoriesTold++;
         Hero.MainHero.AddSkillXp(DefaultSkills.Charm, MBRandom.RandomInt(1, 3));
         if (_renownToGive >= 2.0)
         {
             if (Settlement.CurrentSettlement.Notables.Count >= 1)
             {
                 InformationManager.DisplayMessage(new InformationMessage("Notable people in village were impressed by your feats and like you more."));
                 foreach (Hero notablePerson in Settlement.CurrentSettlement.Notables)
                 {
                     int _relationToGive = CalculateRelationToGive(_renownToGive);
                     ChangeRelationAction.ApplyPlayerRelation(notablePerson, _relationToGive, false, true);
                 }
             }
         }
     }
     else
     {
         InformationManager.DisplayMessage(new InformationMessage("You do not have new stories to tell to these villagers."));
     }
 }