コード例 #1
0
 private void keyUp(object sender, KeyEventArgs e)
 {
     if (e.Key == Key.Up)
     {
         if (battle.ActionMenu.SelectedIndex != 0)
         {
             actionMenu.MoveTargetUp();
             battle.ActionMenu.MoveTargetUp();
         }
     }
     if (e.Key == Key.Left)
     {
         if (battle.TargetSystem.SelectedIndex != 0)
         {
             battle.TargetSystem.MoveTargetLeft();
             targetingView.DrawAll();
         }
     }
     if (e.Key == Key.Right)
     {
         if (battle.TargetSystem.SelectedIndex != battle.Enemies.Count() - 1)
         {
             battle.TargetSystem.MoveTargetRight();
             targetingView.DrawAll();
         }
     }
     if (e.Key == Key.Enter || e.Key == Key.Space)
     {
         battle.Execute();
     }
     if (e.Key == Key.Delete || e.Key == Key.Back)
     {
         battle.Cancel();
     }
     if (e.Key == Key.Down)
     {
         if (battle.ActionMenu.SelectedIndex != battle.ActionMenu.Items.Count() - 1)
         {
             actionMenu.MoveTargetDown();
             battle.ActionMenu.MoveTargetDown();
         }
     }
     //battle.ActionMenu.MoveTargetUp();
 }
コード例 #2
0
        public void boss_battle_fuzzies_1()
        {
            Assert.IsTrue(!battle.IsStarted(), $"battle state = {battle.State.ToString()}");
            Assert.IsTrue(!battle.ActionMenu.Showing);
            Assert.IsTrue(!battle.OptionsListMenu.Showing);
            Assert.IsTrue(battle.OptionsListMenu.Active == null);
            Assert.IsTrue(battle.TurnSystem.Active == Mario);
            //0:10
            battle.Start();
            Assert.IsTrue(!battle.TextBubbleSystem.Showing);
            //menu is shown with jump selected
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Jump");
            Assert.IsTrue(battle.TargetSystem.Actives == null);
            battle.MoveTargetUp();
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Items");
            battle.MoveTargetDown();
            battle.Execute();
            Assert.IsTrue(battle.OptionsListMenu.Showing);
            //0:11 jump option is chosen, and ablities are shown. Jump and power jump are shown
            Assert.IsTrue(battle.ActiveOptionName == "Jump");

            Assert.IsTrue(battle.TargetSystem.Actives == null);
            battle.Execute();
            //0:12 targeting system is shown with magikoop selected
            Assert.IsTrue(battle.TargetSystem.Actives[0] == FuzzieA);
            //0:14 cancel is pressed
            battle.Cancel();
            battle.MoveTargetDown();
            battle.MoveTargetUp();
            battle.MoveTargetDown();
            Assert.IsTrue(battle.ActiveOptionName == "Power Jump", $"{battle.ActiveOptionName}");
            //0:20
            battle.Cancel();
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Jump");
            battle.MoveTargetUp();
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Items");
            battle.MoveTargetUp();
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Strategies", $"should of been Strategies, {battle.ActionMenu.ActiveAction.Name}");
            battle.Execute();
            Assert.IsTrue(battle.ActiveOptionName == "Change Member", $"active name = {battle.ActiveOptionName}");
            battle.MoveTargetDown();
            Assert.IsTrue(battle.ActiveOptionName == "Do Nothing");
            battle.MoveTargetUp();
            Assert.IsTrue(battle.ActiveOptionName == "Change Member");
            battle.Execute();
            Assert.IsTrue(battle.SubOptionsListMenu.Active.Name == "Goombario");
            battle.Execute();
            Assert.IsTrue(!battle.SubOptionsListMenu.Showing);
            Assert.IsTrue(battle.Heroes[1] is Goombario, battle.Heroes[1].ToString());
            Assert.IsTrue(battle.TurnSystem.Active is Goombario, battle.TurnSystem.Active.ToString());
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Abilities", battle.ActionMenu.ActiveAction.Name);
            battle.Execute();
            battle.MoveTargetDown();
            Assert.IsTrue(battle.ActiveOptionName == "Tattle");

            battle.Execute();
            battle.Execute();
            Assert.IsTrue(battle.TextBubbleSystem.Showing);
            battle.Execute();
            battle.Execute();
            battle.Execute();
            battle.Execute();
            Assert.IsTrue(battle.TurnSystem.LastActive == "Fuzzie", $"{battle.TurnSystem.LastActive}");
            //1:05 the third fuzzie gets their attacked blocked by mario
            Assert.IsTrue(Mario.Health.CurrentValue == 6);
            //Flag is shwn when it returns back to marios turn;
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Strategies", $"should of been Strategies, {battle.ActionMenu.ActiveAction.Name}");
            //108 mario swaps out goombario for kooper
            battle.Execute();
            battle.Execute();
            battle.MoveTargetDown();
            Assert.IsTrue(battle.SubOptionsListMenu.Active.Name == "Kooper", battle.SubOptionsListMenu.Active.Name);
            //then its koopers turn
            battle.Execute();
            //1:10 action menu is showing abilites
            Assert.IsTrue(battle.TurnSystem.Active is Kooper, battle.TurnSystem.Active.ToString());
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Abilities", battle.ActionMenu.ActiveAction.Name);
            //kooper uses power shell and its every fuzzie for 2
            battle.Execute();
            battle.MoveTargetDown();
            Assert.IsTrue(battle.OptionsListMenu.Active.Name == "Power Shell", battle.OptionsListMenu.Active.Name);
            Assert.IsTrue(battle.TargetSystem.Actives.ToList().ContainsAllItems(battle.Enemies));
            //then its the fuzzies' turn the first one hits mario and heals 1
            //1:24 the second fuzzie attacks mario and gets its attack blocked, keeping it at 1 hp
            //third one gets blocked too
            //4th onehits mario and heals itsel for 1hp, so now fuziea = 2, and fuzzie b = 1, c =1, and fuzzie d = 2 hp
            //1:33 its mario's turn again and its showing flag/strategies
            //mario scrolls down to hammer and gits the first fuzzie, it dies
            //1:53 kiooper then shell toss's the second fuzzie for 2, killing it
            //fuzzie c heal attacks mario for 1,
            //fuzzie d tries to attack mario for 1 but gets blocked\
            //mario hammers the fuzzie c, it dies
            //kooper shell tosses fuzzie d and it dies
            //gg
        }
コード例 #3
0
        public void magikoopa_1()
        {
            Assert.IsTrue(!battle.IsStarted(), $"battle state = {battle.State.ToString()}");
            Assert.IsTrue(!battle.ActionMenu.Showing);
            Assert.IsTrue(!battle.OptionsListMenu.Showing);
            Assert.IsTrue(battle.OptionsListMenu.Active == null);
            Assert.IsTrue(battle.TurnSystem.Active == Mario);
            //0:10
            battle.Start();
            Assert.IsTrue(!battle.TextBubbleSystem.Showing);
            //menu is shown with jump selected
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Jump");
            Assert.IsTrue(battle.TargetSystem.Actives == null);
            battle.Execute();
            Assert.IsTrue(battle.OptionsListMenu.Showing);
            //0:11 jump option is chosen, and ablities are shown. Jump and power jump are shown
            Assert.IsTrue(battle.ActiveOptionName == "Jump");

            Assert.IsTrue(battle.TargetSystem.Actives == null);
            battle.Execute();
            //0:12 targeting system is shown with magikoop selected
            Assert.IsTrue(battle.TargetSystem.Actives[0] == Magikoopa);
            //0:14 cancel is pressed
            battle.Cancel();
            //battle.Cancel();
            Assert.IsTrue(battle.OptionsListMenu.Showing);
            Assert.IsTrue(battle.ActiveOptionName == "Jump");
            Assert.IsTrue(battle.TargetSystem.Actives == null);
            //0:14 ablities are reshown. Jump and power jump are shown
            //0:14 cancel is pressed
            battle.Cancel();
            //0:14 menu are reshown. Jump is selected
            Assert.IsTrue(!battle.OptionsListMenu.Showing);
            Assert.IsTrue(battle.ActionMenu.Showing);
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Jump");
            //0:16 partner swap
            battle.TurnSystem.Swap();
            //0:16 goombario is active
            Assert.IsTrue(battle.TurnSystem.Active == Goombario);
            //0:16 ablities is highlighted
            Assert.IsTrue(battle.ActionMenu.Showing);
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Abilities");
            //0:17 press a
            Assert.IsTrue(!battle.OptionsListMenu.Showing);
            battle.Execute();
            Assert.IsTrue(battle.OptionsListMenu.Showing);
            //0:17 ablities are shown. headbonk and tattle are shown
            Assert.IsTrue(battle.ActiveOptionName == "Headbonk");
            battle.MoveTargetDown();
            Assert.IsTrue(battle.ActiveOptionName == "Tattle");
            battle.Execute();
            Assert.IsTrue(!battle.OptionsListMenu.Showing);
            Assert.IsTrue(!battle.ActionMenu.Showing);
            Assert.IsTrue(battle.TargetSystem.Showing);
            Assert.IsTrue(battle.TargetSystem.Actives[0] == Magikoopa, $"{battle.TargetSystem.Actives[0]}");
            //0:20 text bubble showing
            battle.Execute();
            Assert.IsTrue(!battle.OptionsListMenu.Showing);
            Assert.IsTrue(!battle.ActionMenu.Showing);
            Assert.IsTrue(!battle.TargetSystem.Showing);
            Assert.IsTrue(battle.TextBubbleSystem.Showing);
            //0:23 press a
            battle.Execute();
            //0:25 press a
            battle.Execute();
            //0:29 press a
            battle.Execute();
            //0:31 now mario is active
            Assert.IsTrue(!battle.TextBubbleSystem.Showing);
            //0:31 jump action is selected
            Assert.IsTrue(battle.TurnSystem.Active == Mario);
            //0:32 press a
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Jump");
            Assert.IsTrue(battle.ActionMenu.Showing);
            battle.Execute();
            Assert.IsTrue(!battle.ActionMenu.Showing);
            Assert.IsTrue(battle.ActiveOptionName == "Jump");
            //0:32 jump option is chosen, and ablities are shown. Jump and power jump are shown
            //down press
            battle.MoveTargetDown();
            //0:32 power jump is highlighted
            Assert.IsTrue(battle.ActiveOptionName == "Power Jump");
            //0:32 press a
            battle.Execute();
            //0:32 targeting system is shown with magikoop selected
            Assert.IsTrue(battle.TargetSystem.Actives[0] == Magikoopa, $"{battle.TargetSystem.Actives[0]}");
            //0:33 press a
            battle.ActionCommandCenter.AddSuccessfulPress();
            battle.ActionCommandCenter.AddSuccessfulPress();
            Assert.IsTrue(Magikoopa.IsFlying);
            battle.Execute();
            //0:34 a is prssedat correct time for bonus! Nice
            Assert.IsTrue(Magikoopa.Health.CurrentValue == 4, $"Magikoop hp = {Magikoopa.Health.CurrentValue}");
            //0:35 damage is dealt
            Assert.IsTrue(!Magikoopa.IsFlying);
            //0:36 after damage event added, magikoopa falls off broomstick, she is now on the ground
            //0:38 magikoopa's turn. she shoots mario with a shape blast
            Assert.IsTrue(Mario.Health.CurrentValue == 8);
            //0:40 press a, mario blocks
            //0:40 mario takes 2 damage
            //0:42 menu is shown with jump selected
            //0:42 move down
            battle.MoveTargetDown();
            Assert.IsTrue(battle.ActionMenu.Showing);
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Hammer");
            //0:42 hammer action is selected
            //0:43 press a to go to hammer options
            battle.Execute();

            Assert.IsTrue(battle.OptionsListMenu.Showing);
            Assert.IsTrue(battle.OptionsListMenu.Items.Count() == 2);
            Assert.IsTrue(battle.GetActiveOptionName() == "Hammer", $"ActiveOptionName == {battle.GetActiveOptionName()}");
            //0:44 move down to hammer throw
            battle.MoveTargetDown();
            Assert.IsTrue(battle.GetActiveOptionName() == "Hammer Throw", $"ActiveOptionName == {battle.GetActiveOptionName()}");
            //0:46 press a
            battle.Execute();
            //0:46 target system showing on a magikoopa
            Assert.IsTrue(!battle.ActionMenu.Showing);
            Assert.IsTrue(!battle.OptionsListMenu.Showing);
            Assert.IsTrue(battle.TargetSystem.Showing);
            Assert.IsTrue(battle.TargetSystem.Actives[0] == Magikoopa);
            Assert.IsTrue(Magikoopa.Health.CurrentValue == 4, $"Magi HP = {Magikoopa.Health.CurrentValue}");
            //magikoopa is hit, she is now at 2
            battle.ActionCommandCenter.AddSuccessfulPress();
            battle.Execute();
            Assert.IsTrue(Magikoopa.Health.CurrentValue == 2, $"Magi HP = {Magikoopa.Health.CurrentValue}");
            //0:53 now its goombario's turn
            Assert.IsTrue(battle.TurnSystem.Active == Goombario);
            Assert.IsTrue(battle.ActionMenu.Showing);
            Assert.IsTrue(battle.ActionMenu.ActiveAction.Name == "Abilities");
            battle.Execute();
            //0:54 press a, abblities options with headbonk selected
            Assert.IsTrue(!battle.ActionMenu.Showing);
            Assert.IsTrue(battle.OptionsListMenu.Showing);
            Assert.IsTrue(!battle.TargetSystem.Showing);
            Assert.IsTrue(battle.ActiveOptionName == "Headbonk");
            //0:55 press a, headbonl selected, now targeting shows
            battle.Execute();
            Assert.IsTrue(battle.TargetSystem.Showing);
            Assert.IsTrue(battle.TargetSystem.Actives[0] == Magikoopa);
            //0:55 press a, goombario is about to hit magijoopa
            battle.ActionCommandCenter.AddSuccessfulPress();
            battle.Execute();
            //0:56 press a, a is pressed at the right time of action command so goombario gets second bounce
            //0:59 magikoopa is dead
            Assert.IsTrue(Magikoopa.Health.CurrentValue == 0, $"Magi HP = {Magikoopa.Health.CurrentValue}");
            Assert.IsTrue(battle.IsEnded());
        }