public static Character GenerateNewCharacter(Ability langAbility, Ability writingAbility, Ability areaAbility)
        {
            Character character = new Character(langAbility, writingAbility, areaAbility);
            NormalizeAttributes(character);

            return character;
        }
Exemple #2
0
 public static IGoal GenerateGoal(Character character, GoalType goalType, double desire)
 {
     switch (goalType)
     {
         default:
             return null;
     }
 }
Exemple #3
0
 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;
 }
Exemple #5
0
        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);
        }
Exemple #6
0
 public abstract void ModifyVisNeeds(Character character, VisDesire[] desires);
Exemple #7
0
 public IList<BookDesire> GetBookNeeds(Character character)
 {
     return _labScoreGoal.GetBookNeeds(character);
 }
Exemple #8
0
 public abstract bool IsComplete(Character character);
Exemple #9
0
 public void ModifyVisNeeds(Character character, VisDesire[] desires)
 {
     if (!_hasCovenant.IsComplete(character))
     {
         _hasCovenant.ModifyVisNeeds(character, desires);
     }
     if (!_mtCondition.IsComplete(character))
     {
         _mtCondition.ModifyVisNeeds(character, desires);
     }
 }
Exemple #10
0
 public bool IsComplete(Character character)
 {
     return ((Magus)character).Laboratory != null;
 }
Exemple #11
0
 public void ModifyVisNeeds(Character character, VisDesire[] desires)
 {
     if (!_minScore.IsComplete(character))
     {
         _minScore.ModifyVisNeeds(character, desires);
     }
 }
Exemple #12
0
 public override bool IsComplete(Character character)
 {
     return character.GetType() == typeof(Magus) && ((Magus)(character)).Apprentice != _apprentice;
 }
Exemple #13
0
 public override IList<BookDesire> GetBookNeeds(Character character)
 {
     return null;
 }
Exemple #14
0
        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
                }
            }
        }
Exemple #15
0
 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;
 }
Exemple #16
0
 public bool IsComplete(Character character)
 {
     return ((Magus)character).Covenant != null;
 }
Exemple #17
0
        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);
            }
        }
Exemple #18
0
 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));
 }
Exemple #19
0
 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;
 }
Exemple #20
0
 public override void ModifyVisNeeds(Character character, VisDesire[] desires)
 {
 }
Exemple #21
0
 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));
         }
     }
 }
Exemple #22
0
 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;
 }
Exemple #23
0
 public abstract IList<BookDesire> GetBookNeeds(Character character);
Exemple #24
0
 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;
 }
Exemple #25
0
 public abstract void ModifyActionList(Character character, ConsideredActions alreadyConsidered, IList<string> log);
Exemple #26
0
        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));
            }
        }
Exemple #27
0
 public bool IsComplete(Character character)
 {
     return ((Magus)character).SpellList.Where(s => s.Name == _spell.Name).Any();
 }
Exemple #28
0
 public void ModifyVisNeeds(Character character, VisDesire[] desires)
 {
     if (!IsComplete(character))
     {
         foreach (AbilityScoreCondition artCondition in _artRequirements)
         {
             artCondition.ModifyVisNeeds(character, desires);
         }
     }
 }
Exemple #29
0
        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);
                    }
                }
            }
        }
Exemple #30
0
 public IList<BookDesire> GetBookNeeds(Character character)
 {
     if (!_minScore.IsComplete(character))
     {
         return _minScore.GetBookNeeds(character);
     }
     return null;
 }