public override bool Matches(IAction action) { if (action.Action != Activity.StudyVis) { return(false); } VisStudying study = (VisStudying)action; return(study.Art == this.Art); }
private void HandleVisUse(Magus mage, CharacterAbilityBase charAbility, double remainingTotal, double desire, ConsideredActions alreadyConsidered, IList<string> log ) { // see if the mage has enough vis of this type double stockpile = mage.GetVisCount(charAbility.Ability); double visNeed = 0.5 + (charAbility.Value / 10.0); double baseDesire = desire * charAbility.GetValueGain(mage.VisStudyRate) / remainingTotal; // if so, assume vis will return an average of 6XP + aura if (stockpile > visNeed) { log.Add("Studying vis for " + charAbility.Ability.AbilityName + " worth " + baseDesire.ToString("0.00")); VisStudying visStudy = new VisStudying(charAbility.Ability, baseDesire); alreadyConsidered.Add(visStudy); // TODO: how do we decrement the cost of the vis? } else if(baseDesire > 0.01 && (DueDate == null || DueDate > 1)) { // only try to extract the vis now if there's sufficient time to do so List<Ability> visType = new List<Ability>(); visType.Add(charAbility.Ability); VisCondition visCondition = new VisCondition(visType, visNeed - stockpile, baseDesire, (byte)(Tier + 1), DueDate == null ? null : DueDate - 1); visCondition.ModifyActionList(mage, alreadyConsidered, log); if(baseDesire > 0.04 && (DueDate == null || DueDate > 4)) { // we have enough time and interest to consider finding a new aura and building a new lab in it } } }