示例#1
0
 // upper attack
 // example call UpperAttack()
 private void UpperAttack()
 {
     if (HeroWithinRange("hero on scorpion") && !duringAttackMode)
     {
         duringAttackMode = true;
         if (direction == "right")
         {
             anim.SetTrigger("ScorpionRightUpperAttack");
         }
         else
         {
             anim.SetTrigger("ScorpionLeftUpperAttack");
         }
         heroManager.TakeHealth(3 * attackPoint);
         heroManager.TakeSpecialDamage("paralysys", 0.6f);
         movingControl.Move(ref horizontalHit, ref verticallHit, ref direction);
         StartCoroutine(ExecuteActionAfterTime(1.4f, () => { duringAttackMode = false; }));
     }
 }
        public void ReturnUpdatedCoordinates_WhenCorrectCommand(char command, string direction, int startingX,
                                                                int startingY, int expectedX, int expectedY)
        {
            var expectedResult = new Coordinates
            {
                X = expectedX,
                Y = expectedY
            };

            var startingCoordinates = new Coordinates
            {
                X = startingX,
                Y = startingY
            };

            var movingControl = new MovingControl();
            var actualResult  = movingControl.Move(command, direction, startingCoordinates);

            actualResult.Should().BeEquivalentTo(expectedResult);
        }