Example #1
0
        static CharmLibrary()
        {
            List <Charm> Charms = Utils.LoadCharms().Charms;

            foreach (Charm c in Charms)
            {
                switch (c.Ability)
                {
                case Ability.Archery: {
                    Archery.Add(c);
                    break;
                }

                case Ability.Athletics: {
                    Athletics.Add(c);
                    break;
                }

                case Ability.Awareness: {
                    Awareness.Add(c);
                    break;
                }

                default: {
                    break;
                }
                }
            }
        }
Example #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Athleticsid,Athleticsproficiency")] Athletics athletics)
        {
            if (id != athletics.Athleticsid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(athletics);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AthleticsExists(athletics.Athleticsid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(athletics));
        }
Example #3
0
        public void ShouldReturnName()
        {
            //assign
            ISkill actualSkillBase = new Athletics();
            //act
            ITextObj name = actualSkillBase.Name();

            //assert
            name.Should().Be(new TextObj("Athletics"));
        }
Example #4
0
        public void Bonus_AthleticsSpecified_ShouldWork()
        {
            SetupCharacter();

            Skills athletics = new Athletics(true, true);

            Assert.AreEqual(-5, athletics.Bonus);
            Assert.IsTrue(athletics.Proficiency);
            Assert.IsTrue(athletics.Expertise);
        }
Example #5
0
        public void ShouldReturnWisdomAsBaseAttribute()
        {
            //arrange
            ISkill skill = new Athletics();
            ICharacterAttribute strengthAttribute = new StrengthAttribute();
            //act
            ICharacterAttribute actualAttribute = skill.BaseAttribute();

            //assert
            actualAttribute.Should().Be(strengthAttribute);
        }
Example #6
0
        public async Task <IActionResult> Create([Bind("Athleticsid,Athleticsproficiency")] Athletics athletics)
        {
            if (ModelState.IsValid)
            {
                _context.Add(athletics);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(athletics));
        }
Example #7
0
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            StrengthAttribute strengthAttribute = new StrengthAttribute(new AttributeScore(14));
            ISkill            athletics         = new Athletics(strengthAttribute);
            IAttributeScore   expectedScore     = new AttributeScore(2);
            //act
            IAttributeScore actualScore = athletics.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
Example #8
0
 public override string ToString()
 {
     return(Acrobatics.ToString() + ' ' +
            AnimalHandling.ToString() + ' ' +
            Arcana.ToString() + ' ' +
            Athletics.ToString() + ' ' +
            Deception.ToString() + ' ' +
            History.ToString() + ' ' +
            Insight.ToString() + ' ' +
            Intimidation.ToString() + ' ' +
            Investigation.ToString() + ' ' +
            Medicine.ToString() + ' ' +
            Nature.ToString() + ' ' +
            Perception.ToString() + ' ' +
            Performance.ToString() + ' ' +
            Persusion.ToString() + ' ' +
            Religion.ToString() + ' ' +
            SleightOfHand.ToString() + ' ' +
            Stealth.ToString() + ' ' +
            Survival.ToString());
 }