public static Character GenerateNewCharacter(Ability langAbility, Ability writingAbility, Ability areaAbility) { Character character = new Character(langAbility, writingAbility, areaAbility); NormalizeAttributes(character); return character; }
public static IGoal GenerateGoal(Character character, GoalType goalType, double desire) { switch (goalType) { default: return null; } }
public AgingEventArgs(Character character, bool crisis, bool apparent, bool death, string ability, sbyte lost) { Character = character; IsCrisis = crisis; IsApparent = apparent; Died = death; AbilityName = ability; PointsLost = lost; }
public CharacterSheet(Character character) { _character = character; InitializeComponent(); this.Text = _character.ToString() + " Character Sheet"; DisplayCharacteristics(); DisplayArts(); DisplayAbilities(); DisplayBooks(); DisplayVis(); DisplayMisc(); lstLog.DataSource = _character.Log; }
public void TestAging() { uint runningTally = 0; IAction action = new Exposure(new Ability(), 0); for (int i = 0; i < 100; i++) { _character = new Character(null, null, null); while (_character.Decrepitude < 75) { _character.CommitAction(action); } Trace.WriteLine("Age at Death: " + _character.SeasonalAge); runningTally += _character.SeasonalAge; } Trace.WriteLine("Average Age at Death: " + runningTally/100); }
public abstract void ModifyVisNeeds(Character character, VisDesire[] desires);
public IList<BookDesire> GetBookNeeds(Character character) { return _labScoreGoal.GetBookNeeds(character); }
public abstract bool IsComplete(Character character);
public void ModifyVisNeeds(Character character, VisDesire[] desires) { if (!_hasCovenant.IsComplete(character)) { _hasCovenant.ModifyVisNeeds(character, desires); } if (!_mtCondition.IsComplete(character)) { _mtCondition.ModifyVisNeeds(character, desires); } }
public bool IsComplete(Character character) { return ((Magus)character).Laboratory != null; }
public void ModifyVisNeeds(Character character, VisDesire[] desires) { if (!_minScore.IsComplete(character)) { _minScore.ModifyVisNeeds(character, desires); } }
public override bool IsComplete(Character character) { return character.GetType() == typeof(Magus) && ((Magus)(character)).Apprentice != _apprentice; }
public override IList<BookDesire> GetBookNeeds(Character character) { return null; }
public override void ModifyActionList(Character character, ConsideredActions alreadyConsidered, IList<string> log) { base.ModifyActionList(character, alreadyConsidered, log); // TODO: consider Cr Co/Me spells that increase statistics foreach (AttributeType attribute in _attributes) { double currentAttribute = character.GetAttribute(attribute).Value; if (currentAttribute < 5) { ArtPair artPair; if (attribute == AttributeType.Dexterity || attribute == AttributeType.Quickness || attribute == AttributeType.Stamina || attribute == AttributeType.Strength) { artPair = MagicArtPairs.CrCo; } else { artPair = MagicArtPairs.CrMe; } double total = 30; if (currentAttribute > 0) { total = 35; } if (currentAttribute > 1) { total = 40; } if (currentAttribute > 2) { total = 45; } if (currentAttribute > 3) { total = 50; } if (currentAttribute > 4) { total = 55; } // TODO: see if the mage already knows a ritual of sufficient strength // If not, consider the value of such a ritual } } }
public override double GetRemainingTotal(Character character) { double currentTotal = 0; foreach (Ability ability in _abilities) { currentTotal += character.GetAbility(ability).Value; } foreach(AttributeType attribute in _attributes) { currentTotal += character.GetAttribute(attribute).Value; } return _total - currentTotal; }
public bool IsComplete(Character character) { return ((Magus)character).Covenant != null; }
public void ModifyActionList(Character character, ConsideredActions alreadyConsidered, IList<string> log) { double dueDateDesire = Desire / (Tier + 1); if (DueDate != null) { if (DueDate == 0) { log.Add("Has Covenant Condition failed"); return; } dueDateDesire /= (double)DueDate; } if (!_minScore.IsComplete(character) && dueDateDesire > 0.01) { _minScore.ModifyActionList(character, alreadyConsidered, log); } }
public override void ModifyActionList(Character character, ConsideredActions alreadyConsidered, IList<string> log) { double dueDateDesire = Desire / (Tier + 1); if (DueDate != null && DueDate > 0) { dueDateDesire /= (double)DueDate; } alreadyConsidered.Add(new GauntletApprentice(Abilities.MagicTheory, dueDateDesire)); }
public IList<BookDesire> GetBookNeeds(Character character) { if(!IsComplete(character)) { List<BookDesire> bookDesires = new List<BookDesire>(); IList<BookDesire> bookNeeds; if (!_hasCovenant.IsComplete(character)) { bookNeeds = _hasCovenant.GetBookNeeds(character); if (bookNeeds != null) { bookDesires.AddRange(bookNeeds); } } if (!_mtCondition.IsComplete(character)) { bookNeeds = _mtCondition.GetBookNeeds(character); if (bookNeeds != null) { bookDesires.AddRange(bookNeeds); } } return bookDesires; } return null; }
public override void ModifyVisNeeds(Character character, VisDesire[] desires) { }
public void ModifyActionList(Character character, ConsideredActions alreadyConsidered, IList<string> log) { double dueDateDesire = Desire / (Tier + 1); if (DueDate != null) { if (DueDate == 0) { log.Add("Not enough time to build lab"); return; } dueDateDesire /= (double)DueDate; } if (dueDateDesire > 0.01) { bool hasCovenant = _hasCovenant.IsComplete(character); bool hasMT = _mtCondition.IsComplete(character); if (!hasCovenant) { _hasCovenant.ModifyActionList(character, alreadyConsidered, log); } if (!hasMT) { _mtCondition.ModifyActionList(character, alreadyConsidered, log); } if (hasCovenant && hasMT) { log.Add("Setting up a lab worth " + (dueDateDesire).ToString("0.00")); alreadyConsidered.Add(new BuildLaboratory(Abilities.MagicTheory, dueDateDesire)); } } }
public IList<BookDesire> GetBookNeeds(Character character) { if (!IsComplete(character)) { List<BookDesire> bookDesires = new List<BookDesire>(); foreach (AbilityScoreCondition artCondition in _artRequirements) { var bookNeeds = artCondition.GetBookNeeds(character); if (bookNeeds != null) { bookDesires.AddRange(bookNeeds); } } return bookDesires; } return null; }
public abstract IList<BookDesire> GetBookNeeds(Character character);
public bool IsComplete(Character character) { // TODO: there's nothing preventing a character from having multiple apprentices return character.GetType() == typeof(Magus) && ((Magus)character).Apprentice != null; }
public abstract void ModifyActionList(Character character, ConsideredActions alreadyConsidered, IList<string> log);
public void ModifyActionList(Character character, ConsideredActions alreadyConsidered, IList<string> log) { bool isReady = true; foreach (AbilityScoreCondition condition in _artRequirements) { if (!condition.IsComplete(character)) { isReady = false; condition.ModifyActionList(character, alreadyConsidered, log); } } if (isReady) { double desire = Desire / (Tier + 1); if(DueDate != null) { if (DueDate == 0) { log.Add("Not enough time to find an apprentice"); return; } desire /= (double)DueDate; } alreadyConsidered.Add(new FindApprentice(MagicArts.Intellego, desire)); } }
public bool IsComplete(Character character) { return ((Magus)character).SpellList.Where(s => s.Name == _spell.Name).Any(); }
public void ModifyVisNeeds(Character character, VisDesire[] desires) { if (!IsComplete(character)) { foreach (AbilityScoreCondition artCondition in _artRequirements) { artCondition.ModifyVisNeeds(character, desires); } } }
public void ModifyActionList(Character character, ConsideredActions alreadyConsidered, IList<string> log) { double dueDateDesire = Desire / (Tier + 1); if (DueDate != null) { if (DueDate == 0) { log.Add("Not enough time to invent spell"); return; } dueDateDesire /= (double)DueDate; } if (dueDateDesire > 0.01) { if (!_labScoreGoal.IsComplete(character)) { _labScoreGoal.ModifyActionList(character, alreadyConsidered, log); } else { double level = _spell.Level; // Now we need to consider both the value of starting to invent the spell now // and the value of instead learning more before doing so. // As a first pass, value the portion of the spell inventable this season Magus mage = (Magus)character; double extraTotal = mage.GetLabTotal(_spell.BaseArts, Activity.InventSpells) - level; if (extraTotal <= 0) { // This should not happen _labScoreGoal.ModifyActionList(character, alreadyConsidered, log); } if (extraTotal >= level) { // there's no reason to consider adding to abilities for this spell // TODO: eventually, we should consider the fact that the extra learning // could allow one to learn more spells in a season log.Add("Inventing this spell worth " + dueDateDesire.ToString("0.00")); alreadyConsidered.Add(new InventSpell(_spell, Abilities.MagicTheory, dueDateDesire)); } else { // we are in the multi-season-to-invent scenario dueDateDesire = extraTotal * dueDateDesire / level; alreadyConsidered.Add(new InventSpell(_spell, Abilities.MagicTheory, dueDateDesire)); // the difference between the desire of starting now // and the desire of starting after practice // is the effective value of practicing here IncreaseLabTotalVersusEffectLevelHelper helper = new IncreaseLabTotalVersusEffectLevelHelper(_spell.BaseArts, dueDateDesire, extraTotal, level, (byte)(Tier + 1)); helper.ModifyActionList(character, alreadyConsidered, log); } } } }
public IList<BookDesire> GetBookNeeds(Character character) { if (!_minScore.IsComplete(character)) { return _minScore.GetBookNeeds(character); } return null; }