public override void AddActionPreferencesToList(ConsideredActions alreadyConsidered, IList <string> log) { _currentAura = Mage.Covenant == null ? 0 : Mage.Covenant.Aura.Strength; _auraCount = Mage.KnownAuras.Count; // for now _currentScore = CalculateFindAuraScore(); double probOfBetter = 1 - (_currentAura * _currentAura * (_auraCount + 1) / (5 * _currentScore)); double maxAura = Math.Sqrt(5.0 * _currentScore / (_auraCount + 1)); double averageGain = maxAura * probOfBetter / 2.0; double desire = _desireFunc(averageGain, ConditionDepth); if (desire > 0.00001) { log.Add("Finding a better aura to build a lab in worth " + desire.ToString("0.000")); alreadyConsidered.Add(new FindAura(Abilities.AreaLore, desire)); // consider the value of increasing find aura related scores //practice area lore PracticeHelper areaLorePracticeHelper = new PracticeHelper(Abilities.AreaLore, Mage, AgeToCompleteBy - 1, Desire, (ushort)(ConditionDepth + 1), CalculateScoreGainDesire); areaLorePracticeHelper.AddActionPreferencesToList(alreadyConsidered, log); // read area lore ReadingHelper readAreaLoreHelper = new ReadingHelper(Abilities.AreaLore, Mage, AgeToCompleteBy - 1, Desire, (ushort)(ConditionDepth + 1), CalculateScoreGainDesire); // consider value of increasing InVi casting total CastingTotalIncreaseHelper inViHelper = new CastingTotalIncreaseHelper(Mage, AgeToCompleteBy - 1, Desire / 10, (ushort)(ConditionDepth + 1), MagicArtPairs.InVi, _allowVimVisUse, _desireFunc); } }
public override void AddActionPreferencesToList(ConsideredActions alreadyConsidered, IList<string> log) { _currentAura = Mage.Covenant == null ? 0 : Mage.Covenant.Aura.Strength; _auraCount = Mage.KnownAuras.Count; // for now _currentScore= CalculateFindAuraScore(); double probOfBetter = 1 - (_currentAura * _currentAura * _auraCount / (5 * _currentScore)); double maxAura = Math.Sqrt(5.0 * _currentScore / _auraCount); double averageGain = maxAura * probOfBetter / 2.0; double desire = _desireFunc(averageGain, ConditionDepth); if (desire > 0.01) { log.Add("Finding a better aura to build a lab in worth " + desire.ToString("0.00")); alreadyConsidered.Add(new FindAura(Abilities.AreaLore, desire)); // consider the value of increasing find aura related scores //practice area lore PracticeHelper areaLorePracticeHelper = new PracticeHelper(Abilities.AreaLore, Mage, AgeToCompleteBy, Desire, (ushort)(ConditionDepth + 1), CalculateScoreGainDesire); areaLorePracticeHelper.AddActionPreferencesToList(alreadyConsidered, log); // read area lore ReadingHelper readAreaLoreHelper = new ReadingHelper(Abilities.AreaLore, Mage, AgeToCompleteBy, Desire, (ushort)(ConditionDepth + 1), CalculateScoreGainDesire); // consider value of increasing InVi casting total CastingTotalIncreaseHelper inViHelper = new CastingTotalIncreaseHelper(Mage, AgeToCompleteBy - 1, Desire / 10, (ushort)(ConditionDepth + 1), MagicArtPairs.InVi, _allowVimVisUse, _desireFunc); } }
public override void AddActionPreferencesToList(ConsideredActions alreadyConsidered, IList <string> log) { List <Ability> visSearchAbilities = new List <Ability>(); visSearchAbilities.Add(Abilities.MagicLore); visSearchAbilities.Add(MagicArts.Intellego); visSearchAbilities.Add(MagicArts.Vim); // we're not getting vis fast enough, so we need to find a new source // consider the value of searching for new vis sites in current auras // determine average vis source found _magicLoreTotal = Mage.GetAbility(Abilities.MagicLore).Value; _magicLoreTotal += Mage.GetAttribute(AttributeType.Perception).Value; _magicLoreTotal += Mage.GetCastingTotal(MagicArtPairs.InVi) / 5; if (Mage.KnownAuras.Any()) { Aura aura = Mage.KnownAuras.OrderByDescending(a => a.GetAverageVisSourceSize(_magicLoreTotal)).First(); double averageFind = aura.GetAverageVisSourceSize(_magicLoreTotal); if (averageFind > 0) { // originally, we modified by chance vis will be of the proper type // this feels wrong; what's probably more sensible is to scale // according to the relative value of vis // so 5 * 4 + 9 * 2 + 1 = 39/15 // that represents the relative value of a random vis source compared to vim vis double gain = (averageFind * 39 / 15); double desire = _desireFunc(gain, ConditionDepth); // TODO: modify by lifelong value of source? log.Add("Looking for vis source worth " + (desire).ToString("0.000")); alreadyConsidered.Add(new FindVisSource(aura, Abilities.MagicLore, desire)); } // consider the value of increasing the casting total first CastingTotalIncreaseHelper castingHelper = new CastingTotalIncreaseHelper(Mage, AgeToCompleteBy - 1, Desire, (ushort)(ConditionDepth + 1), MagicArtPairs.InVi, _allowVimVis, CalculateScoreGainDesire); castingHelper.AddActionPreferencesToList(alreadyConsidered, log); // consider the value of increasing Magic Lore PracticeHelper practiceHelper = new PracticeHelper(Abilities.MagicLore, Mage, AgeToCompleteBy - 1, Desire, (ushort)(ConditionDepth + 1), CalculateScoreGainDesire); practiceHelper.AddActionPreferencesToList(alreadyConsidered, log); ReadingHelper readingHelper = new ReadingHelper(Abilities.MagicLore, Mage, AgeToCompleteBy - 1, Desire, (ushort)(ConditionDepth + 1), CalculateScoreGainDesire); readingHelper.AddActionPreferencesToList(alreadyConsidered, log); // TODO: consider increasing Perception } // consider finding a whole new aura FindNewAuraHelper auraHelper = new FindNewAuraHelper(Mage, AgeToCompleteBy - 1, Desire, (ushort)(ConditionDepth + 1), !_visTypes.Contains(MagicArts.Vim), CalculateAuraGainDesire); auraHelper.AddActionPreferencesToList(alreadyConsidered, log); }
public override void AddActionPreferencesToList(ConsideredActions alreadyConsidered, IList<string> log) { base.AddActionPreferencesToList(alreadyConsidered, log); // increase Magic Theory via practice PracticeHelper practiceHelper = new PracticeHelper(Abilities.MagicTheory, Mage, AgeToCompleteBy, Desire, (ushort)(ConditionDepth + 1), _desireFunc); practiceHelper.AddActionPreferencesToList(alreadyConsidered, log); // increase Magic Theory via reading ReadingHelper readingHelper = new ReadingHelper(Abilities.MagicTheory, Mage, AgeToCompleteBy, Desire, (ushort)(ConditionDepth + 1), _desireFunc); readingHelper.AddActionPreferencesToList(alreadyConsidered, log); // increase Int // improve lab // find better aura if (AgeToCompleteBy - Mage.SeasonalAge > 2) { // a season to find the aura, and a season to build a lab in it. Doesn't take into account lab specialization FindNewAuraHelper auraHelper = new FindNewAuraHelper(Mage, AgeToCompleteBy - 1, Desire, (ushort)(ConditionDepth + 2), AllowVimVisUse, _desireFunc); } }
public override void AddActionPreferencesToList(ConsideredActions alreadyConsidered, IList <string> log) { if (AgeToCompleteBy - Mage.SeasonalAge > 0) { // increase non-vim through vis study AddVisUseToActionList(_arts.Technique, alreadyConsidered, log); if (AllowVimVisUse || _arts.Form.AbilityName != "Vim") { AddVisUseToActionList(_arts.Form, alreadyConsidered, log); } // increase either art through reading ReadingHelper techReadingHelper = new ReadingHelper(_arts.Technique, Mage, AgeToCompleteBy - 1, Desire, (ushort)(ConditionDepth + 1), _desireFunc); ReadingHelper formReadingHelper = new ReadingHelper(_arts.Form, Mage, AgeToCompleteBy - 1, Desire, (ushort)(ConditionDepth + 1), _desireFunc); techReadingHelper.AddActionPreferencesToList(alreadyConsidered, log); formReadingHelper.AddActionPreferencesToList(alreadyConsidered, log); } }
public override void AddActionPreferencesToList(ConsideredActions alreadyConsidered, IList<string> log) { List<Ability> visSearchAbilities = new List<Ability>(); visSearchAbilities.Add(Abilities.MagicLore); visSearchAbilities.Add(MagicArts.Intellego); visSearchAbilities.Add(MagicArts.Vim); // we're not getting vis fast enough, so we need to find a new source // consider the value of searching for new vis sites in current auras // determine average vis source found _magicLoreTotal = Mage.GetAbility(Abilities.MagicLore).Value; _magicLoreTotal += Mage.GetAttribute(AttributeType.Perception).Value; _magicLoreTotal += Mage.GetCastingTotal(MagicArtPairs.InVi) / 5; if (_magicLoreTotal > 0 && Mage.KnownAuras.Any()) { Aura aura = Mage.KnownAuras.OrderByDescending(a => a.GetAverageVisSourceSize(_magicLoreTotal)).First(); double averageFind = aura.GetAverageVisSourceSize(_magicLoreTotal); if (averageFind > 0) { // modify by chance vis will be of the proper type double gain = (averageFind * _visTypes.Count() / 15); double desire = _desireFunc(gain, ConditionDepth); // TODO: modify by lifelong value of source? log.Add("Looking for vis source worth " + (desire).ToString("0.00")); alreadyConsidered.Add(new FindVisSource(aura, Abilities.MagicLore, desire)); } // consider the value of increasing the casting total first CastingTotalIncreaseHelper castingHelper = new CastingTotalIncreaseHelper(Mage, AgeToCompleteBy, Desire, (ushort)(ConditionDepth + 1), MagicArtPairs.InVi, _allowVimVis, CalculateScoreGainDesire); castingHelper.AddActionPreferencesToList(alreadyConsidered, log); // consider the value of increasing Magic Lore PracticeHelper practiceHelper = new PracticeHelper(Abilities.MagicLore, Mage, AgeToCompleteBy, Desire, (ushort)(ConditionDepth + 1), CalculateScoreGainDesire); practiceHelper.AddActionPreferencesToList(alreadyConsidered, log); ReadingHelper readingHelper = new ReadingHelper(Abilities.MagicLore, Mage, AgeToCompleteBy, Desire, (ushort)(ConditionDepth + 1), CalculateScoreGainDesire); readingHelper.AddActionPreferencesToList(alreadyConsidered, log); // TODO: consider increasing Perception } // consider finding a whole new aura FindNewAuraHelper auraHelper = new FindNewAuraHelper(Mage, AgeToCompleteBy, Desire, (ushort)(ConditionDepth + 1), !_visTypes.Contains(MagicArts.Vim), CalculateAuraGainDesire); }
public override void AddActionPreferencesToList(ConsideredActions alreadyConsidered, IList <string> log) { base.AddActionPreferencesToList(alreadyConsidered, log); // increase Magic Theory via practice PracticeHelper practiceHelper = new PracticeHelper(Abilities.MagicTheory, Mage, AgeToCompleteBy - 1, Desire, (ushort)(ConditionDepth + 1), _desireFunc); practiceHelper.AddActionPreferencesToList(alreadyConsidered, log); // increase Magic Theory via reading ReadingHelper readingHelper = new ReadingHelper(Abilities.MagicTheory, Mage, AgeToCompleteBy - 1, Desire, (ushort)(ConditionDepth + 1), _desireFunc); readingHelper.AddActionPreferencesToList(alreadyConsidered, log); // increase Int // improve lab // find better aura if (AgeToCompleteBy - Mage.SeasonalAge > 2) { // a season to find the aura, and a season to build a lab in it. Doesn't take into account lab specialization FindNewAuraHelper auraHelper = new FindNewAuraHelper(Mage, AgeToCompleteBy - 2, Desire, (ushort)(ConditionDepth + 2), AllowVimVisUse, _desireFunc); } }