Example #1
0
        public void TestChaosBoltDamageDieAndType()
        {
            AllPlayers.Invalidate();
            DndGame game = DndGame.Instance;

            game.GetReadyToPlay();
            Character merkin = AllPlayers.GetFromName("Merkin");

            game.AddPlayer(merkin);

            List <PlayerActionShortcut> actionShortcuts = AllActionShortcuts.Get(merkin.playerID, "Chaos Bolt");

            Assert.AreEqual(3, actionShortcuts.Count);              // This will fail when Merkin levels up.
            DiceRoll chaosBoltLevel3 = DiceRoll.GetFrom(actionShortcuts[2]);

            Assert.IsTrue(chaosBoltLevel3.IsMagic);
            Assert.AreEqual(DiceRollType.ChaosBolt, chaosBoltLevel3.Type);
            Assert.AreEqual("2d8(),3d6()", chaosBoltLevel3.DamageHealthExtraDice);
        }
Example #2
0
        public void TestChaosBoltDamagePlusModifier()
        {
            Character player = AddSorcererToGame(level: 6, baseCharisma: 17, proficiencyBonus: 3, "Chaos Bolt");

            player.proficiencyBonus = 3;
            List <PlayerActionShortcut> actionShortcuts = AllActionShortcuts.Get(player.playerID, "Chaos Bolt");

            Assert.AreEqual(3, actionShortcuts.Count);
            Assert.AreEqual("2d8(),1d6()", DiceRoll.GetFrom(actionShortcuts[0], player).DamageHealthExtraDice);
            Assert.AreEqual("2d8(),2d6()", DiceRoll.GetFrom(actionShortcuts[1], player).DamageHealthExtraDice);
            Assert.AreEqual("2d8(),3d6()", DiceRoll.GetFrom(actionShortcuts[2], player).DamageHealthExtraDice);

            foreach (PlayerActionShortcut playerActionShortcut in actionShortcuts)
            {
                DiceRoll chaosBoltLevel3 = DiceRoll.GetFrom(playerActionShortcut);
                Assert.IsTrue(chaosBoltLevel3.IsMagic);
                Assert.AreEqual(DiceRollType.ChaosBolt, chaosBoltLevel3.Type);
                Assert.AreEqual(6, chaosBoltLevel3.Modifier);
            }
        }
Example #3
0
        public static DiceRoll GetSpellFrom(string spellName, Character player, int spellSlotLevel = -1)
        {
            PlayerActionShortcut shortcut = PlayerActionShortcut.FromSpell(spellName, player, spellSlotLevel);

            return(DiceRoll.GetFrom(shortcut));
        }