コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Sleightofhandid,Sleightprof")] SleightOfHand sleightOfHand)
        {
            if (id != sleightOfHand.Sleightofhandid)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(sleightOfHand);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!SleightOfHandExists(sleightOfHand.Sleightofhandid))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(sleightOfHand));
        }
コード例 #2
0
        public void ShouldReturnName()
        {
            //assign
            ISkill actualSkillBase = new SleightOfHand();
            //act
            ITextObj name = actualSkillBase.Name();

            //assert
            name.Should().Be(new TextObj("Sleight Of Hand"));
        }
コード例 #3
0
        public void Bonus_SlightOfHandSpecified_ShouldWork()
        {
            SetupCharacter();

            Skills sleightOfHand = new SleightOfHand(true, true);

            Assert.AreEqual(-5, sleightOfHand.Bonus);
            Assert.IsTrue(sleightOfHand.Proficiency);
            Assert.IsTrue(sleightOfHand.Expertise);
        }
コード例 #4
0
        public async Task <IActionResult> Create([Bind("Sleightofhandid,Sleightprof")] SleightOfHand sleightOfHand)
        {
            if (ModelState.IsValid)
            {
                _context.Add(sleightOfHand);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(sleightOfHand));
        }
コード例 #5
0
        public void ShouldReturnBaseAttribute()
        {
            //arrange
            ISkill skill = new SleightOfHand();
            ICharacterAttribute dexterityAttribute = new DexterityAttribute();
            //act
            ICharacterAttribute actualAttribute = skill.BaseAttribute();

            //assert
            actualAttribute.Should().Be(dexterityAttribute);
        }
コード例 #6
0
        public void ShouldReturnBonusOfBaseAttribute()
        {
            //arrange
            DexterityAttribute dexterityAttribute = new DexterityAttribute(new AttributeScore(14));
            ISkill             sleightOfHand      = new SleightOfHand(dexterityAttribute);
            IAttributeScore    expectedScore      = new AttributeScore(2);
            //act
            IAttributeScore actualScore = sleightOfHand.SkillBonus();

            //assert
            actualScore.Should().Be(expectedScore);
        }
コード例 #7
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));
        }
コード例 #8
0
ファイル: Stats.cs プロジェクト: Monaghar/ToonWorld
 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());
 }
コード例 #9
0
        public override JSONObject Serialize()
        {
            JSONObject obj = new JSONObject();

            obj.Add(cAppraise, Appraise.Serialize());
            obj.Add(cBalance, Balance.Serialize());
            obj.Add(cBluff, Bluff.Serialize());
            obj.Add(cClimb, Climb.Serialize());
            obj.Add(cConcentration, Concentration.Serialize());
            obj.Add(cDecipherScript, DecipherScript.Serialize());
            obj.Add(cDiplomacy, Diplomacy.Serialize());
            obj.Add(cDisableDevice, DisableDevice.Serialize());
            obj.Add(cDisguise, Disguise.Serialize());
            obj.Add(cEscapeArtist, EscapeArtist.Serialize());
            obj.Add(cForgery, Forgery.Serialize());
            obj.Add(cGatherInformation, GatherInformation.Serialize());
            obj.Add(cHandleAnimal, HandleAnimal.Serialize());
            obj.Add(cHeal, Heal.Serialize());
            obj.Add(cHide, Hide.Serialize());
            obj.Add(cIntimidate, Intimidate.Serialize());
            obj.Add(cJump, Jump.Serialize());
            obj.Add(cListen, Listen.Serialize());
            obj.Add(cMoveSilently, MoveSilently.Serialize());
            obj.Add(cOpenLock, OpenLock.Serialize());
            obj.Add(cRide, Ride.Serialize());
            obj.Add(cSearch, Search.Serialize());
            obj.Add(cSenseMotive, SenseMotive.Serialize());
            obj.Add(cSleightOfHand, SleightOfHand.Serialize());
            obj.Add(cSpellCraft, SpellCraft.Serialize());
            obj.Add(cSpot, Spot.Serialize());
            obj.Add(cSurvival, Survival.Serialize());
            obj.Add(cSwim, Swim.Serialize());
            obj.Add(cTumble, Tumble.Serialize());
            obj.Add(cUseMagicDevice, UseMagicDevice.Serialize());
            obj.Add(cUseRope, UseRope.Serialize());
            return(obj);
        }