Ejemplo n.º 1
0
        public static Character GenerateNewCharacter(Ability langAbility, Ability writingAbility, Ability areaAbility)
        {
            Character character = new Character(langAbility, writingAbility, areaAbility);
            NormalizeAttributes(character);

            return character;
        }
Ejemplo n.º 2
0
 public static IGoal GenerateGoal(Character character, GoalType goalType, double desire)
 {
     switch (goalType)
     {
         default:
             return null;
     }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 4
0
 public CharacterSheet(Character character)
 {
     _character = character;
     InitializeComponent();
     this.Text = _character.ToString() + " Character Sheet";
     DisplayCharacteristics();
     DisplayArts();
     DisplayAbilities();
     DisplayBooks();
     DisplayVis();
     DisplayMisc();
     lstLog.DataSource = _character.Log;
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 6
0
 public abstract void ModifyVisNeeds(Character character, VisDesire[] desires);
Ejemplo n.º 7
0
 public IList<BookDesire> GetBookNeeds(Character character)
 {
     return _labScoreGoal.GetBookNeeds(character);
 }
Ejemplo n.º 8
0
 public abstract bool IsComplete(Character character);
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 10
0
 public bool IsComplete(Character character)
 {
     return ((Magus)character).Laboratory != null;
 }
Ejemplo n.º 11
0
 public void ModifyVisNeeds(Character character, VisDesire[] desires)
 {
     if (!_minScore.IsComplete(character))
     {
         _minScore.ModifyVisNeeds(character, desires);
     }
 }
Ejemplo n.º 12
0
 public override bool IsComplete(Character character)
 {
     return character.GetType() == typeof(Magus) && ((Magus)(character)).Apprentice != _apprentice;
 }
Ejemplo n.º 13
0
 public override IList<BookDesire> GetBookNeeds(Character character)
 {
     return null;
 }
Ejemplo n.º 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
                }
            }
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 16
0
 public bool IsComplete(Character character)
 {
     return ((Magus)character).Covenant != null;
 }
Ejemplo n.º 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);
            }
        }
Ejemplo n.º 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));
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 20
0
 public override void ModifyVisNeeds(Character character, VisDesire[] desires)
 {
 }
Ejemplo n.º 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));
         }
     }
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 23
0
 public abstract IList<BookDesire> GetBookNeeds(Character character);
Ejemplo n.º 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;
 }
Ejemplo n.º 25
0
 public abstract void ModifyActionList(Character character, ConsideredActions alreadyConsidered, IList<string> log);
Ejemplo n.º 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));
            }
        }
Ejemplo n.º 27
0
 public bool IsComplete(Character character)
 {
     return ((Magus)character).SpellList.Where(s => s.Name == _spell.Name).Any();
 }
Ejemplo n.º 28
0
 public void ModifyVisNeeds(Character character, VisDesire[] desires)
 {
     if (!IsComplete(character))
     {
         foreach (AbilityScoreCondition artCondition in _artRequirements)
         {
             artCondition.ModifyVisNeeds(character, desires);
         }
     }
 }
Ejemplo n.º 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);
                    }
                }
            }
        }
Ejemplo n.º 30
0
 public IList<BookDesire> GetBookNeeds(Character character)
 {
     if (!_minScore.IsComplete(character))
     {
         return _minScore.GetBookNeeds(character);
     }
     return null;
 }