public void TestThatAllBobsDiesAtEndOfTurnTeam02()
        {
            Character[] tf2Blue = new Character[6];
            for (int i = 0; i < 6; i++)
            {
                tf2Blue[i] = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
            }

            Character[] tf2Red = new Character[6];
            for (int i = 0; i < 6; i++)
            {
                tf2Red[i] = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
            }
            var target = new GameBoard(null, tf2Blue, tf2Red, null, null);

            for (int i = 0; i < 6; i++)
            {
                Effect effThat = new Effect("health", 1, 100.0, true, target.getSecondTeamCharacters()[i]);
                target.addEffect(effThat);
            }

            target.turn();
            Assert.AreEqual(target.getSecondTeamCharacters()[0].GetDead(), true);
            Assert.AreEqual(target.getSecondTeamCharacters()[1].GetDead(), true);
            Assert.AreEqual(target.getSecondTeamCharacters()[2].GetDead(), true);
            Assert.AreEqual(target.getSecondTeamCharacters()[3].GetDead(), true);
            Assert.AreEqual(target.getSecondTeamCharacters()[4].GetDead(), true);
            Assert.AreEqual(target.getSecondTeamCharacters()[5].GetDead(), true);
        }
 //returns the third ability
 private void setFourthAbility()
 {
     Character bob = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
     Effect blah = new Effect("health", 1, 1.0, true, bob);
     CharAbility blahAb = new CharAbility("Blah", blah, "attack", 1, bob);
     characterAbilities[3] = blahAb;
 }
 public void TestThatEffectApplyEffectIsAppliedToDodge()
 {
     Character bob = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
     var target = new Effect("dodge", 1, 1.0, true, bob);
     target.ApplyEffect();
     Assert.AreEqual(target.GetCharacter().GetCharacterDodgeChance(), bob.GetCharacterDodgeChance());
 }
 public void TestThatCharAbilityHasCorrectEffect()
 {
     Character bob = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
     Effect blah = new Effect("blah", 1, 0.0, true, bob);
     var target = new CharAbility("Fire", blah, "spell",1, bob);
     Assert.AreEqual(target.getAbilityEffect(), blah);
 }
 public void TestThatEffectApplyEffectIsAppliedToHealth()
 {
     Character bob = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
     var target = new Effect("health", 1, 1.0, true, bob);
     target.ApplyEffect();
     Assert.AreEqual(target.GetCharacter().GetCharacterHitPoints(), bob.GetCharacterHitPoints());
 }
 public void TestThatCharClassHasAThirdAbility()
 {
     var target = new CharClass("Warrior", null);
     Character bob = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
     Effect blah = new Effect("health", 1, 1.0, true, bob);
     CharAbility[] targ2 = target.getCharacterAbilities();
     CharAbility blahAb = new CharAbility("Blah", blah, "attack", 1, bob);
     Assert.AreEqual(targ2[2].getAbilityName(), blahAb.getAbilityName());
 }
        public CharAbility(String ability, Effect effect, String modif, int cost, Character targ)
        {
            abilityName = ability;
            abilityEffects = effect;
            target = targ;
            modifier = modif;

            if (cost < 1)
            {
                mpCost = 1;
            }
            else if (cost > 100)
            {
                mpCost = 100;
            }
            else
            {
                mpCost = cost;
            }
        }
 public void TestThatEffectHasTurnDuration()
 {
     var target = new Effect("blah", 1, 0.0, true, null);
     Assert.AreEqual(target.GetDuration(), 1);
 }
 public void TestThatEffectHasResetIsTrue()
 {
     var target = new Effect("blah", 1, 0.0, true, null);
     Assert.True(target.GetReset());
 }
 public void TestThatEffectHasResetIsFalse()
 {
     var target = new Effect("blah", 1, 0.0, true, null);
 }
 public void TestThatEffectHasReset()
 {
     var target = new Effect("blah", 1, 0.0, true, null);
     Assert.AreEqual(target.GetReset(), true);
 }
 public void TestThatEffectHasMagnitude()
 {
     var target = new Effect("blah", 1, 0.0, true, null);
     Assert.AreEqual(target.GetMagnitude(), 0.0);
 }
 public void TestThatEffectHasCharacter()
 {
     var target = new Effect("blah", 1, 0.0, true, new Character("Bob", null, 10, 10, 10, new Item(), "Warrior"));
     Assert.AreEqual(target.GetCharacter().GetCharacterName(), new Character("Bob", null, 10, 10, 10, new Item(), "Warrior").GetCharacterName());
 }
 public void TestThatGameBoardHasNoEffectAfterRemovingEffectinEffectList()
 {
     Character bob = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
     Effect effThat = new Effect("health", 10, 1.0, true, bob);
     var target = new GameBoard(null, null, null, null, null);
     target.addEffect(effThat);
     target.destroyEffect(effThat);
     Assert.AreEqual(target.getEffectList().Count, 0);
 }
 public void TestThatCharAbilityHasCorrectModifier()
 {
     Character bob = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
     Effect blah = new Effect("blah", 1, 0.0, true, bob);
     var target = new CharAbility("Fire", blah, "spell", 1, bob);
 }
 public void TestThatEffectApplyEffectDoesNotDecreaseDurationAfterItIsZero()
 {
     var target = new Effect("blah", 0, 0.0, true, new Character("Bob", null, 10, 10, 10, new Item(), "Warrior"));
     target.ApplyEffect();
     Assert.AreEqual(target.GetDuration(), 0);
 }
 public void TestThatSetTargetChangesTheTargetToTheCorrectTarget()
 {
     Character bob = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
     var testEffect = new Effect("dodge", 1, 1.0, true, bob);
     var george = new Character("George", null, 10, 10, 10, new Item(), "Mage");
     testEffect.setTarget(george);
 }
 public void TestThatEnvironmentHasWeatherAbility()
 {
     Effect blah = new Effect("blah", 1, 0.0, true, null);
     var target = new Environments("shine", blah);
     Assert.AreEqual(target.getWeatherAbility(), blah);
 }
        public void TestThatGameBoardDoesFifthCharacterActionsDuringTurnTeam01()
        {
            Character[] tf2Blue = new Character[6];
            for (int i = 0; i < 6; i++)
            {
                tf2Blue[i] = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
            }

            Character[] tf2Red = new Character[6];
            for (int i = 0; i < 6; i++)
            {
                tf2Red[i] = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
            }

            var target = new GameBoard(null, tf2Blue, tf2Red, null, null);

            for (int i = 0; i < 6; i++)
            {
                Effect effThat = new Effect("health", 1, 10.0, true, target.getFirstTeamCharacters()[i]);
                target.addEffect(effThat);
            }

            target.turn();

            Assert.AreEqual(target.getFirstTeamCharacters()[4].GetCharacterHitPoints(), 90);
        }
 public void TestThatEffectInitializes()
 {
     var target = new Effect("blah", 1, 0.0, true, null);
     Assert.IsNotNull(target);
 }
 public void TestThatEffectHasAttribute()
 {
     var target = new Effect("blah", 1, 0.0, true, null);
     Assert.AreEqual(target.GetAttribute(), "blah");
 }
 public void TestThatGameBoardHasEffectInEffectList()
 {
     Character bob = new Character("Bob", null, 10, 10, 10, new Item(), "Warrior");
     Effect effThat = new Effect("health", 10, 1.0, true, bob);
     var target = new GameBoard(null, null, null, null, null);
     target.addEffect(effThat);
     Assert.AreEqual(effThat, target.getEffectList()[0]);
 }