Exemple #1
0
 /// <summary>
 /// Resets the attribute with the given source
 /// </summary>
 /// <param name="src"></param>
 internal void Reset(ICharacterAttribute src, float learningFactor)
 {
     m_base            = src.Base;
     m_implantBonus    = src.ImplantBonus;
     m_lowerSkillBonus = src.LowerSkillBonus;
     m_upperSkillBonus = src.UpperSkillBonus;
     Update(learningFactor);
 }
        public void ShouldMatchName()
        {
            //assign
            ICharacterAttribute expectedAttribute = new StrengthAttribute(new AttributeScore(18));
            //act
            ICharacterAttribute actualAttribute = _attributeSet.MatchesName(CharacterAttributeName.Strength);

            //assert
            actualAttribute.Should().Be(expectedAttribute);
        }
Exemple #3
0
        public void ShouldReturnBaseAttribute()
        {
            //arrange
            ISkill skill = new AnimalHandling();
            ICharacterAttribute wisdomAttribute = new WisdomAttribute();
            //act
            ICharacterAttribute actualAttribute = skill.BaseAttribute();

            //assert
            actualAttribute.Should().Be(wisdomAttribute);
        }
Exemple #4
0
        public void ShouldEquateAttributes()
        {
            //assign
            _characterSheet = new CharacterSheet(new Fighter(), new WoodElf(), _attributeSet);

            //act
            ICharacterAttribute actualAttribute = _characterSheet.Attribute(CharacterAttributeName.Dexterity);

            //assert
            actualAttribute.Should().Be(new DexterityAttribute());
        }
Exemple #5
0
        public void ShouldReturnWisdomAsBaseAttribute()
        {
            //arrange
            ISkill skill = new Insight();
            ICharacterAttribute wisdomAttribute = new WisdomAttribute();
            //act
            ICharacterAttribute actualAttribute = skill.BaseAttribute();

            //assert
            actualAttribute.Should().Be(wisdomAttribute);
        }
        public void ShouldReturnBaseAttribute()
        {
            //arrange
            ISkill skill = new Intimidation();
            ICharacterAttribute charismaAttribute = new CharismaAttribute();
            //act
            ICharacterAttribute actualAttribute = skill.BaseAttribute();

            //assert
            actualAttribute.Should().Be(charismaAttribute);
        }
Exemple #7
0
        public void ShouldReturnBaseAttribute()
        {
            //arrange
            ISkill skill = new SleightOfHand();
            ICharacterAttribute dexterityAttribute = new DexterityAttribute();
            //act
            ICharacterAttribute actualAttribute = skill.BaseAttribute();

            //assert
            actualAttribute.Should().Be(dexterityAttribute);
        }
Exemple #8
0
        public void ShouldReturnWisdomAsBaseAttribute()
        {
            //arrange
            ISkill skill = new Athletics();
            ICharacterAttribute strengthAttribute = new StrengthAttribute();
            //act
            ICharacterAttribute actualAttribute = skill.BaseAttribute();

            //assert
            actualAttribute.Should().Be(strengthAttribute);
        }
Exemple #9
0
        public void ShouldReturnBaseAttribute()
        {
            //arrange
            ISkill acrobatics = new Acrobatics();
            ICharacterAttribute dexterityAttribute = new DexterityAttribute();
            //act
            ICharacterAttribute actualAttribute = acrobatics.BaseAttribute();

            //assert
            actualAttribute.Should().Be(dexterityAttribute);
        }
        public void ShouldReturnWisdomAsBaseAttribute()
        {
            //arrange
            ISkill skill = new History();
            ICharacterAttribute intellegenceAttribute = new IntellegenceAttribute();
            //act
            ICharacterAttribute actualAttribute = skill.BaseAttribute();

            //assert
            actualAttribute.Should().Be(intellegenceAttribute);
        }
        /// <summary>
        /// When the user hovers over one of the attribute label, we display a tooltip such as :
        /// 19.8 (7 base + 7 remap points + 4 implants)
        /// </summary>
        /// <param name="sender">The source of the event.</param>
        /// <param name="e">The <see cref="System.EventArgs"/> instance containing the event data.</param>
        private void AttributeLabel_MouseHover(object sender, EventArgs e)
        {
            // Retrieve the attribute from the sender
            Label        attributeLabel = (Label)sender;
            EveAttribute eveAttribute   = (EveAttribute)attributeLabel.Tag;

            // Format the values for the tooltip
            ICharacterAttribute attribute = m_character[eveAttribute];
            string toolTip = attribute.ToString("%e (%B base + %r remap points + %i implants)");

            ToolTip.SetToolTip(attributeLabel, toolTip);
        }
Exemple #12
0
        public void ShouldReturnActivatedAndNonActiveSkillsForHumanWizard()
        {
            //arrange
            _characterSheet = new CharacterSheet(new Wizard(), new Human(), new FakeWizardAttributeSet());
            ICharacterAttribute attribute    = _characterSheet.Attribute(CharacterAttributeName.Dexterity);
            SleightOfHand       slightOfHand = new SleightOfHand((DexterityAttribute)attribute, true);

            //act
            _characterSheet.ActivateSkill(slightOfHand);
            //assert
            List <ISkill> actualSkills = _characterSheet.Skills();

            actualSkills.First(item => item.Name().Equals(new TextObj("Sleight Of Hand"))).SkillBonus().Should().Be(new AttributeScore(1));
            actualSkills.First(item => item.Name().Equals(new TextObj("Acrobatics"))).SkillBonus().Should().Be(new AttributeScore(-1));
        }
Exemple #13
0
        /// <summary>
        /// Resets the scratchpad from the <see cref="BaseCharacter"/> it was built upon.
        /// </summary>
        private void ResetFromCharacter()
        {
            TrainingTime = TimeSpan.Zero;
            TrainedSkills.Clear();

            // Initialize attributes-related stuff
            for (int i = 0; i < m_attributes.Length; i++)
            {
                ICharacterAttribute attrib = m_character[(EveAttribute)i];
                m_attributes[i].Reset(attrib.Base, attrib.ImplantBonus);
            }

            // Initialize skills
            m_skillPoints = 0;
            foreach (StaticSkill skill in StaticSkills.AllSkills)
            {
                long sp    = m_character.GetSkillPoints(skill);
                long level = m_character.GetSkillLevel(skill);

                m_skillPoints += sp;
                m_skillSP[skill.ArrayIndex]     = sp;
                m_skillLevels[skill.ArrayIndex] = level;
            }
        }
Exemple #14
0
 private IAttributeScore ApplyIntellegenceBonus(ICharacterAttribute attribute) => attribute.MatchesName(CharacterAttributeName.Intelligence) ? new AttributeScore(1) : new AttributeScore(0);
Exemple #15
0
 public virtual IAttributeScore RacialAttributeAdjustment(ICharacterAttribute attribute) => ApplyConstitutionBonus(attribute);
Exemple #16
0
 public void AddAttribute(ICharacterAttribute x)
 {
     _rawAttributes.Add(x.Name, x);
 }
Exemple #17
0
 public AttributeChangedEventArgs(ICharacterAttribute characterAttribute)
 {
     CharacterAttribute = characterAttribute;
 }
Exemple #18
0
 //Let the modifier apply it's own values... off the type... yea
 //I did that on purpose ;-)
 public void Apply(ICharacterAttribute a)
 {
     a.Value = ModifierType.ApplyModifier(this, a.Value);
     Console.WriteLine("applied!");
 }
 public override IAttributeScore RacialAttributeAdjustment(ICharacterAttribute attribute) => base.RacialAttributeAdjustment(attribute).Add(GetConstitutionBonus(attribute));
Exemple #20
0
 //Let the modifier apply it's own values... off the type... yea
 //I did that on purpose ;-)
 public void Apply(ICharacterAttribute a)
 {
     a.Value = ModifierType.ApplyModifier(this, a.Value);
     Console.WriteLine("applied!");
 }
 /// <summary>
 /// Resets the attribute with the given source
 /// </summary>
 /// <param name="src"></param>
 internal void Reset(ICharacterAttribute src)
 {
     m_base = src.Base;
     m_implantBonus = src.ImplantBonus;
     UpdateEffectiveAttribute();
 }
Exemple #22
0
 public void AddAttribute(ICharacterAttribute x)
 {
     _rawAttributes.Add(x.Name, x);
 }
Exemple #23
0
 private AttributeScore ApplyDexterityBonus(ICharacterAttribute attribute) => !attribute.MatchesName(CharacterAttributeName.Dexterity) ? new AttributeScore(0) : new AttributeScore(2);
Exemple #24
0
 public virtual IAttributeScore RacialAttributeAdjustment(ICharacterAttribute attribute) => _racialAttributeAdjustment;
 protected SkillBase(ITextObj skillName, ICharacterAttribute baseAttribute, bool activateSkill)
 {
     _skillName     = skillName;
     _baseAttribute = baseAttribute;
     _activateSkill = activateSkill;
 }
Exemple #26
0
 public override IAttributeScore RacialAttributeAdjustment(ICharacterAttribute attribute) => (AttributeScore)base.RacialAttributeAdjustment(attribute).Add(ApplyWisdomBonus(attribute));
Exemple #27
0
 public RogueStat(CombatStatType type, ICharacterAttribute primaryAttribute, ICharacterAttribute secondaryAttribute)
     : base(type, primaryAttribute, secondaryAttribute)
 {
 }
Exemple #28
0
 private IAttributeScore ApplyWisdomBonus(ICharacterAttribute attribute) => !attribute.MatchesName(CharacterAttributeName.Wisdom) ? new AttributeScore(0) : new AttributeScore(1);
 private IAttributeScore GetConstitutionBonus(ICharacterAttribute attribute) => !attribute.MatchesName(CharacterAttributeName.Constitution) ? new AttributeScore(0) : new AttributeScore(1);
 public virtual IAttributeScore RacialAttributeAdjustment(ICharacterAttribute attribute) => !attribute.MatchesName(CharacterAttributeName.Dexterity) ? new AttributeScore(0) : new AttributeScore(2);
Exemple #31
0
 /// <summary>
 /// Resets the attribute with the given source
 /// </summary>
 /// <param name="src"></param>
 internal void Reset(ICharacterAttribute src)
 {
     m_base         = src.Base;
     m_implantBonus = src.ImplantBonus;
     UpdateEffectiveAttribute();
 }
Exemple #32
0
 public virtual IAttributeScore RacialAttributeAdjustment(ICharacterAttribute attribute) => ApplyDexterityBonus(attribute);
 private IAttributeScore GetCharismaBonus(ICharacterAttribute attribute) => !attribute.MatchesName(CharacterAttributeName.Charisma) ? new AttributeScore(0) : new AttributeScore(1);