public string GetDescription(CharacterAttribute characterAttribute, CharacterSkill characterSkill)
        {
            var description = GameSetting.Get(index.ToString()).StringValue;

            switch (index)
            {
            case MagicEffectType.sEffectAbsorbAttribute:
            case MagicEffectType.sEffectDamageAttribute:
            case MagicEffectType.sEffectDrainAttribute:
            case MagicEffectType.sEffectFortifyAttribute:
            case MagicEffectType.sEffectRestoreAttribute:
                var attribute = GameSetting.Get(characterAttribute.ToString()).StringValue;
                description = description.Replace("Attribute", attribute);
                break;

            case MagicEffectType.sEffectAbsorbSkill:
            case MagicEffectType.sEffectDamageSkill:
            case MagicEffectType.sEffectDrainSkill:
            case MagicEffectType.sEffectFortifySkill:
            case MagicEffectType.sEffectRestoreSkill:
                var skill = GameSetting.Get(characterSkill.ToString()).StringValue;
                description = description.Replace("Skill", skill);
                break;
            }

            return(description);
        }
Beispiel #2
0
        public void SkillsCanHaveConditionalModifiers()
        {
            var skill     = new Skill("Eat", AbilityScoreTypes.Intelligence, false);
            var ability   = new AbilityScore(AbilityScoreTypes.Intelligence, 10);
            var charSkill = new CharacterSkill(skill, ability, false);
            var adj       = new ConditionalStatModifier(new ValueStatModifier("Eat", 3, "bonus"), "Celery");

            charSkill.AddModifier(adj);
            Assert.Equal(1, charSkill.ConditionalModifiers.Count());
            Assert.Equal(3, charSkill.GetConditionalValue("Celery"));
            Assert.Equal(0, charSkill.Score());
            Assert.Equal("Eat +0 (+3 Celery)", charSkill.ToString());
        }
Beispiel #3
0
        public void ConditionalModifiersAndRanksAreCountedOnlyOnce()
        {
            var skill     = new Skill("Eat", AbilityScoreTypes.Intelligence, false);
            var ability   = new AbilityScore(AbilityScoreTypes.Intelligence, 10);
            var charSkill = new CharacterSkill(skill, ability, false);

            charSkill.AddRank();
            var adj = new ConditionalStatModifier(new ValueStatModifier("Eat", 3, "bonus"), "Celery");

            charSkill.AddModifier(adj);
            Assert.Equal(1, charSkill.ConditionalModifiers.Count());
            Assert.Equal(4, charSkill.GetConditionalValue("Celery"));
            Assert.Equal(1, charSkill.Score());
            Assert.Equal("Eat +1 (+4 Celery)", charSkill.ToString());
        }