Esempio n. 1
0
        public void TestSecondWind()
        {
            AllPlayers.Invalidate();
            Character fred = AllPlayers.Get("Old Fred");

            fred.ActivateFeature("SecondWind");
            Assert.AreEqual("1d10+4(healing)", fred.diceWeAreRolling);
        }
Esempio n. 2
0
		public void TestPlayerAmmunition()
		{
			AllPlayers.Invalidate();
			Character willy = AllPlayers.Get("Willy");
			Assert.AreEqual(20, willy.GetAmmunitionCount("Arrow"));
			Character merkin = AllPlayers.Get("Merkin");
			Assert.AreEqual(20, merkin.GetAmmunitionCount("Bolt"));
		}
Esempio n. 3
0
        public void TestAmmoAndSpellSlotLevelsWithClonedSpells()
        {
            Spell     bonesOfTheEarth = AllSpells.Get("Bones of the Earth");
            Character merkin          = AllPlayers.Get("Merkin");

            Assert.AreEqual(6, bonesOfTheEarth.Clone(merkin, 6).AmmoCount);
            Assert.AreEqual(8, bonesOfTheEarth.Clone(merkin, 7).AmmoCount);
            Assert.AreEqual(10, bonesOfTheEarth.Clone(merkin, 8).AmmoCount);
            Assert.AreEqual(12, bonesOfTheEarth.Clone(merkin, 9).AmmoCount);
        }
Esempio n. 4
0
        public void TestSpellSlotLevelsWithClonedSpells()
        {
            Spell     fireball = AllSpells.Get("Fireball");
            Character merkin   = AllPlayers.Get("Merkin");

            Assert.AreEqual("8d6(fire)", fireball.Clone(merkin, 3).DieStr);
            Assert.AreEqual("9d6(fire)", fireball.Clone(merkin, 4).DieStr);
            Assert.AreEqual("10d6(fire)", fireball.Clone(merkin, 5).DieStr);
            Assert.AreEqual("11d6(fire)", fireball.Clone(merkin, 6).DieStr);
            Assert.AreEqual("12d6(fire)", fireball.Clone(merkin, 7).DieStr);
            Assert.AreEqual("13d6(fire)", fireball.Clone(merkin, 8).DieStr);
            Assert.AreEqual("14d6(fire)", fireball.Clone(merkin, 9).DieStr);
        }
Esempio n. 5
0
        public void TestRaceClass()
        {
            Character oldFred = AllPlayers.Get("Old Fred");

            Assert.AreEqual("Lizardfolk Fighter 4 / Barbarian 1", oldFred.raceClass);

            Character fred = AllPlayers.GetFromId(PlayerID.Fred);

            Assert.AreEqual("Lizardfolk Barbarian 6", fred.raceClass);

            Character ava = AllPlayers.GetFromId(PlayerID.Ava);

            Assert.AreEqual("Human Paladin 6", ava.raceClass);
        }
Esempio n. 6
0
		public void TestPlayerLoad()
		{
			Character willy = AllPlayers.Get("Willy");
			Assert.AreEqual(6, willy.Level);
			Assert.AreEqual(45, willy.HitPoints);
			Assert.AreEqual(204, willy.goldPieces);
			Assert.AreEqual(Skills.insight | Skills.perception | Skills.performance | Skills.sleightOfHand | Skills.stealth, willy.proficientSkills);
			Assert.AreEqual(Skills.deception | Skills.persuasion | Skills.sleightOfHand | Skills.perception, willy.doubleProficiency);
			Assert.AreEqual(Ability.dexterity | Ability.intelligence, willy.savingThrowProficiency);
			Assert.AreEqual(Ability.none, willy.spellCastingAbility);
			Assert.AreEqual(3, willy.initiative);
			Assert.AreEqual(VantageKind.Advantage, willy.rollInitiative);
			Assert.AreEqual("#710138", willy.dieBackColor);
			Assert.AreEqual(4, willy.headshotIndex);
		}
Esempio n. 7
0
		public void TestPlayerIds()
		{
			Character lady = AllPlayers.Get("Lady");
			Assert.AreEqual(PlayerID.Lady, lady.playerID);
			Character willy = AllPlayers.Get("Willy");
			Assert.AreEqual(PlayerID.Willy, willy.playerID);
			Character merkin = AllPlayers.Get("Merkin");
			Assert.AreEqual(PlayerID.Merkin, merkin.playerID);
			Character fred = AllPlayers.Get("Fred");
			Assert.AreEqual(PlayerID.Fred, fred.playerID);
			Character ava = AllPlayers.Get("Ava");
			Assert.AreEqual(PlayerID.LilCutie, ava.playerID);
			Character shemo = AllPlayers.Get("Shemo");
			Assert.AreEqual(PlayerID.Shemo, shemo.playerID);
		}
Esempio n. 8
0
        public void TestProperties()
        {
            Character fred = AllPlayers.Get("Fred");
            DndGame   game = DndGame.Instance;

            game.GetReadyToPlay();
            game.AddPlayer(fred);
            game.Start();

            Expressions.Do("Set(_rage,true)", fred);
            Assert.IsTrue(Expressions.GetBool("_rage", fred));
            Assert.IsTrue(Expressions.GetBool("InRage", fred));
            Expressions.Do("Set(_rage,false)", fred);
            Assert.IsFalse(Expressions.GetBool("_rage", fred));
            Assert.IsFalse(Expressions.GetBool("InRage", fred));
        }
Esempio n. 9
0
		public void TestLady()
		{
			Character lady = AllPlayers.Get("Lady");
			Assert.AreEqual(6, lady.Level);
			Assert.AreEqual(46, lady.HitPoints);
			Assert.AreEqual(0, lady.goldPieces);
			Assert.AreEqual(Skills.animalHandling | Skills.arcana| Skills.intimidation| Skills.investigation| Skills.perception | Skills.survival, lady.proficientSkills);
			Assert.AreEqual(Skills.none, lady.doubleProficiency);
			Assert.AreEqual(Ability.strength| Ability.constitution, lady.savingThrowProficiency);
			Assert.AreEqual(Ability.none, lady.spellCastingAbility);
			Assert.AreEqual(2, lady.initiative);
			Assert.AreEqual(VantageKind.Normal, lady.rollInitiative);
			Assert.AreEqual(37, lady.hueShift);
			Assert.AreEqual("#fea424", lady.dieBackColor);
			Assert.AreEqual(0, lady.headshotIndex);
		}
Esempio n. 10
0
        public void TestWeaponProficiencies()
        {
            Character willy = AllPlayers.Get("Willy");

            Assert.IsTrue(willy.IsProficientWith(Weapons.HandCrossbow));
            Assert.IsTrue(willy.IsProficientWith(Weapons.Longbow));
            Assert.IsTrue(willy.IsProficientWith(Weapons.Longsword));
            Assert.IsTrue(willy.IsProficientWith(Weapons.Rapier));
            Assert.IsTrue(willy.IsProficientWith(Weapons.Shortsword));
            Assert.IsTrue(willy.IsProficientWith(Weapons.Simple));
            Assert.IsFalse(willy.IsProficientWith(Weapons.Martial));

            Character shemo = AllPlayers.Get("Shemo");

            Assert.IsTrue(shemo.IsProficientWith(Weapons.Club));
            Assert.IsTrue(shemo.IsProficientWith(Weapons.Dagger));
            Assert.IsTrue(shemo.IsProficientWith(Weapons.Dart));
            Assert.IsTrue(shemo.IsProficientWith(Weapons.Javelin));
            Assert.IsTrue(shemo.IsProficientWith(Weapons.Mace));
            Assert.IsTrue(shemo.IsProficientWith(Weapons.Quarterstaff));
            Assert.IsTrue(shemo.IsProficientWith(Weapons.Sickle));
            Assert.IsTrue(shemo.IsProficientWith(Weapons.Scimitar));
            Assert.IsTrue(shemo.IsProficientWith(Weapons.Sling));
            Assert.IsTrue(shemo.IsProficientWith(Weapons.Spear));
            Assert.IsFalse(shemo.IsProficientWith(Weapons.Simple));
            Assert.IsFalse(shemo.IsProficientWith(Weapons.Martial));

            Character lady = AllPlayers.Get("Lady");

            Assert.IsTrue(lady.IsProficientWith(Weapons.LightCrossbow));
            Assert.IsTrue(lady.IsProficientWith(Weapons.Simple));
            Assert.IsTrue(lady.IsProficientWith(Weapons.Martial));

            Character merkin = AllPlayers.Get("Merkin");

            Assert.IsTrue(merkin.IsProficientWith(Weapons.Wizard));
            Assert.IsFalse(merkin.IsProficientWith(Weapons.Simple));
            Assert.IsFalse(merkin.IsProficientWith(Weapons.Martial));
            Assert.IsFalse(merkin.IsProficientWith(Weapons.UnarmedStrike));

            Character fred = AllPlayers.Get("Fred");

            Assert.IsTrue(fred.IsProficientWith(Weapons.Simple));
            Assert.IsTrue(fred.IsProficientWith(Weapons.Martial));
        }