Exemplo n.º 1
0
        public GameUI()
        {
            InitializeComponent();
            Thread.CurrentThread.CurrentUICulture = new CultureInfo("de");

            Character bob = new Character("Bob", null, 10, 10, 10, null, "Wizard");
            bob.SetFirstAbilityForCharacter(new CharAbility("It Has Begun",new Effect("health", 1, 10, false, null),"attack",10,null));
            bob.SetSecondAbilityForCharacter(new CharAbility("Devour Soul", new Effect("attackPower", 1, 10, false, null), "attack", 10, null));
            bob.SetThirdAbilityForCharacter(new CharAbility("Enrage", new Effect("dodge", 1, 1, false, null), "spell", 10, null));
            bob.SetFourthAbilityForCharacter(new CharAbility("Time Branch", new Effect("crit",1,1,false,null), "spell", 100, null));

            Character george = new Character("George", null, 1, 1, 10, null, "Warrior");
            george.SetFirstAbilityForCharacter(new CharAbility("Let's Do This!", new Effect("health", 1, 40, false, null), "attack", 1, null));
            george.SetSecondAbilityForCharacter(new CharAbility("Poke", new Effect("health", 1, 1, false, null), "attack", 1, null));
            george.SetThirdAbilityForCharacter(new CharAbility("Prod", new Effect("health", 1, 2, false, null), "attack", 2, null));
            george.SetFourthAbilityForCharacter(new CharAbility("Glitter Strike", new Effect("spellPower", 1, 10, false, null), "spell", 10, null));

            String[] names = {"Red", "Blue"};
            Character[] team1 = {bob, null, null, null, null, null};
            Character[] team2 = {george, null, null, null, null, null};
            board = new GameBoard(names , team1, team2, null, null);

            Player1Health.Value = team1[0].GetCharacterHitPoints();
            PlayerHealth2.Value = team2[0].GetCharacterHitPoints();
            if (board.getTurn())
            {
                CurrentTeam.Text = names[0];
                CurrentCharacterName.Text = team1[0].GetCharacterName();

                attack1.Text = board.getFirstTeamCharacters()[0].GetCharacterAbilities()[0].getAbilityName();
                attack2.Text = board.getFirstTeamCharacters()[0].GetCharacterAbilities()[1].getAbilityName();
                attack3.Text = board.getFirstTeamCharacters()[0].GetCharacterAbilities()[2].getAbilityName();
                attack4.Text = board.getFirstTeamCharacters()[0].GetCharacterAbilities()[3].getAbilityName();
            }
            else
            {
                CurrentTeam.Text = names[1];
                CurrentCharacterName.Text = team2[0].GetCharacterName();

                attack1.Text = board.getSecondTeamCharacters()[0].GetCharacterAbilities()[0].getAbilityName();
                attack2.Text = board.getSecondTeamCharacters()[0].GetCharacterAbilities()[1].getAbilityName();
                attack3.Text = board.getSecondTeamCharacters()[0].GetCharacterAbilities()[2].getAbilityName();
                attack4.Text = board.getSecondTeamCharacters()[0].GetCharacterAbilities()[3].getAbilityName();
            }

            georgeImg.Image = Image.FromFile("C:/Documents and Settings/heidtbkd/TacCom/Source/TacCom/WindowsFormsApplication1/textures/characters/george/George_The_Fancy_Man.png");
            bobImg.Image = Image.FromFile("C:/Documents and Settings/heidtbkd/TacCom/Source/TacCom/WindowsFormsApplication1/textures/characters/bob/bob.png");

            Size imgSize = new Size();
            imgSize.Width = 400;
            imgSize.Height = 400;

            georgeImg.Image = resizeImage(georgeImg.Image, imgSize);
            bobImg.Image = resizeImage(bobImg.Image, imgSize);
        }
Exemplo n.º 2
0
 public void TestThatSetAbility2SetsTheAbilityListCorrectly()
 {
     var target = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
     CharAbility ca = new CharAbility("Hit", new Effect("health", 1, 10, false, null), "attack", 10, null);
     target.SetSecondAbilityForCharacter(ca);
     Assert.AreEqual(target.GetCharacterAbilities()[1], ca);
 }