示例#1
0
        private static Character GetTestDruid()
        {
            Character druid = PlayerHelper.GetPlayerAtLevel("Druid", 2);

            druid.baseCharisma     = 9;
            druid.baseStrength     = 12;
            druid.baseIntelligence = 15;
            druid.baseWisdom       = 10;
            druid.baseDexterity    = 11;
            druid.baseConstitution = 9;
            druid.proficiencyBonus = 2;
            return(druid);
        }
示例#2
0
        private static Character StartNewGame(string playerClass, int level, string weapon = null)
        {
            AllPlayers.Invalidate();
            AllFeatures.Invalidate();
            DndGame game = DndGame.Instance;

            game.GetReadyToPlay();
            Character player = PlayerHelper.GetPlayerAtLevel(playerClass, level);

            game.AddPlayer(player);
            if (weapon != null)
            {
                player.AddWeapon(weapon);
            }
            game.Start();
            return(player);
        }
示例#3
0
        public void TestSpellRangeTest()
        {
            Spell chaosBolt = AllSpells.Get(SpellNames.ChaosBolt);

            AllPlayers.Invalidate();
            AllFeatures.Invalidate();
            DndGame game = DndGame.Instance;

            game.GetReadyToPlay();
            Character sorcerer = PlayerHelper.GetPlayerAtLevel("Sorcerer", 6);

            sorcerer.name = "Mark";
            game.AddPlayer(sorcerer);
            Monster joe = MonsterBuilder.BuildVineBlight("Joe");

            game.AddCreature((Creature)joe);
            game.Start();

            PositionCreatures(@"
┌───────────────┐
│               │
│               │
│           M   │
│               │
│               └───────────────┐
│                               │
│                                       │
│                               │
│                               │
│               ┌───────────────┘
│           J   │
│               │
│               │
│               │
│               │
└───────────────┘", game.AllCreatures);
            Assert.AreEqual(40, sorcerer.CanCast(chaosBolt).DistanceTo(joe));
            Assert.IsTrue(sorcerer.CanCast(chaosBolt).At(joe));


            PositionCreatures(@"
┌───────────────┐
│               │
│               │
│           M   │
│               │
│               └───────────────┐
│                               │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                                       │
│                               │
│                               │
│               ┌───────────────┘
│           J   │
│               │
│               │
│               │
│               │
└───────────────┘", game.AllCreatures);

            Assert.AreEqual(125, sorcerer.CanCast(chaosBolt).DistanceTo(joe));
            Assert.IsFalse(sorcerer.CanCast(chaosBolt).At(joe));
        }