コード例 #1
0
        public void ConfiguresTheAttacksBasedOnAttributesOfTheCharacter()
        {
            var sorcerer = CharacterTestTemplates.Sorcerer();
            var claws    = new Claws();

            sorcerer.Add(claws);

            Assert.Equal(2, claws.NumberOfAttacks);
            Assert.Equal(2, claws.CriticalModifier.TotalValue);
            Assert.Equal(20, claws.CriticalThreat);
            Assert.Equal(AttackTypes.Special, claws.AttackType);
            Assert.Equal(0, claws.SaveDC);
            Assert.Equal(0, claws.Range);

            Assert.Equal(3, claws.RoundsPerDay);
            sorcerer.AbilityScores.SetScore(AbilityScoreTypes.Charisma, 16);
            Assert.Equal(6, claws.RoundsPerDay);

            Assert.Equal("1d4", claws.Damage.ToString());
            sorcerer.AbilityScores.SetScore(AbilityScoreTypes.Strength, 16);
            Assert.Equal("1d4+3", claws.Damage.ToString());

            Assert.Equal(3, claws.AttackBonus.TotalValue);

            Assert.Equal("2 claws +3 (1d4+3) 6 rounds/day", claws.DisplayString());
        }
コード例 #2
0
        public PhaseVisualizationController(DatabaseConnector databaseConnector, IViewPhaseVisualizations phaseVisualizationView)
        {
            Claws.NotNull(() => databaseConnector);
            Claws.NotNull(() => phaseVisualizationView);

            this.databaseConnector      = databaseConnector;
            this.phaseVisualizationView = phaseVisualizationView;
        }
コード例 #3
0
        public DatabaseController(IViewDatabases databaseView, DatabaseConnector databaseConnector)
        {
            Claws.NotNull(() => databaseView);
            Claws.NotNull(() => databaseConnector);

            this.databaseView      = databaseView;
            this.databaseConnector = databaseConnector;
        }
コード例 #4
0
        public WordBuilder(WordAnalyzer wordAnalyzer, int?seed = null)
        {
            Claws.NotNull(() => wordAnalyzer);
            this.wordAnalyzer = wordAnalyzer;

            this.random = seed == null ? new Random() : new Random(seed.Value);
            this.BuildChoiceArrays();
        }
コード例 #5
0
        private static void ReleaseEnergy(ExperimentTurn experimentTurn, OrganismState organismState, decimal delta)
        {
            Claws.AtLeast(() => delta, 0);

            delta = Math.Min(delta, organismState.Health);

            organismState.Health       -= delta;
            experimentTurn.ExtraEnergy += delta;
        }
コード例 #6
0
        private static void AbsorbEnergy(ExperimentTurn experimentTurn, OrganismState organismState, decimal delta)
        {
            Claws.AtLeast(() => delta, 0);

            delta = Math.Min(delta, Math.Min(experimentTurn.ExtraEnergy, 1 - organismState.Health));

            experimentTurn.ExtraEnergy -= delta;
            organismState.Health       += delta;
        }
コード例 #7
0
        public void AttackDamageIsBasedOnSizeOfCharacter()
        {
            var sorcerer = CharacterTestTemplates.Sorcerer();
            var claws    = new Claws();

            sorcerer.Add(claws);
            sorcerer.Size.SetSize(CharacterSize.Small, 10, 10);
            Assert.Equal("1d3", claws.Damage.ToString());
        }
コード例 #8
0
        public void FireDamageAddedAtEleventh()
        {
            var sorcerer = CharacterTestTemplates.Sorcerer();
            var claws    = new Claws();

            sorcerer.Add(claws);
            sorcerer.SetLevel(11);
            Assert.Contains("1d6 fire", claws.DisplayString());
        }
コード例 #9
0
        public void MagicalAtFifthLevel()
        {
            var sorcerer = CharacterTestTemplates.Sorcerer();
            var claws    = new Claws();

            sorcerer.Add(claws);
            sorcerer.SetLevel(5);
            Assert.Contains("magical", claws.DisplayString());
        }
コード例 #10
0
        public void DamageIncreasesAt7ThLevel()
        {
            var sorcerer = CharacterTestTemplates.Sorcerer();
            var claws    = new Claws();

            sorcerer.Add(claws);
            sorcerer.SetLevel(7);
            Assert.Equal("1d6", claws.Damage.ToString());
        }
コード例 #11
0
        public ExperimentController(IViewExperiments experimentView, DatabaseConnector databaseConnector, ISimulateExperiments experimentSimulator)
        {
            Claws.NotNull(() => experimentView);
            Claws.NotNull(() => databaseConnector);
            Claws.NotNull(() => experimentSimulator);

            this.experimentView      = experimentView;
            this.databaseConnector   = databaseConnector;
            this.experimentSimulator = experimentSimulator;
        }
コード例 #12
0
 public static bool IsWeapon(string itemBase)
 {
     if (Bows.Contains(itemBase))
     {
         return(true);
     }
     if (Claws.Contains(itemBase))
     {
         return(true);
     }
     if (OneHandedAxes.Contains(itemBase))
     {
         return(true);
     }
     if (OneHandedMaces.Contains(itemBase))
     {
         return(true);
     }
     if (OneHandedSwords.Contains(itemBase))
     {
         return(true);
     }
     if (TwoHandedAxes.Contains(itemBase))
     {
         return(true);
     }
     if (TwoHandedMaces.Contains(itemBase))
     {
         return(true);
     }
     if (TwoHandedSwords.Contains(itemBase))
     {
         return(true);
     }
     if (Sceptres.Contains(itemBase))
     {
         return(true);
     }
     if (Daggers.Contains(itemBase))
     {
         return(true);
     }
     if (Staves.Contains(itemBase))
     {
         return(true);
     }
     if (Wands.Contains(itemBase))
     {
         return(true);
     }
     return(false);
 }
コード例 #13
0
        public static void BridgeDemo()
        {
            CharachterClass Paladin = new Paladin();
            CharachterClass Assasin = new Assasin();
            CharachterClass Wizzard = new Wizzard();
            IWeapon         Staff   = new Staff();
            IWeapon         Sword   = new Sword();
            IWeapon         Claws   = new Claws();

            Staff.GiveBonus(Wizzard);
            Sword.GiveBonus(Paladin);
            Claws.GiveBonus(Assasin);
            Claws.GiveBonus(Wizzard);
        }
コード例 #14
0
        public void DraconicBloodlineDoesBonusDamageOfType()
        {
            var sorcerer   = CharacterTestTemplates.Sorcerer();
            var draconic   = new Mock <IDraconicBloodline>();
            var dragonType = new DragonType();

            dragonType.EnergyType = "cold";
            draconic.Setup(x => x.DragonType).Returns(dragonType);
            sorcerer.Add(draconic.Object);

            var claws = new Claws();

            sorcerer.Add(claws);
            sorcerer.SetLevel(11);
            Assert.Contains("1d6 cold", claws.DisplayString());
        }
コード例 #15
0
        public ProgramController(ProgramView programView,
                                 DatabaseConnector databaseConnector,
                                 DatabaseController databaseController,
                                 ExperimentController experimentController,
                                 PhaseVisualizationController phaseVisualizationController)
        {
            Claws.NotNull(() => programView);
            Claws.NotNull(() => databaseConnector);
            Claws.NotNull(() => databaseController);
            Claws.NotNull(() => experimentController);
            Claws.NotNull(() => phaseVisualizationController);

            this.programView                  = programView;
            this.databaseConnector            = databaseConnector;
            this.databaseController           = databaseController;
            this.experimentController         = experimentController;
            this.phaseVisualizationController = phaseVisualizationController;
        }
コード例 #16
0
        public static string GetItemType(string itemBase)
        {
            if (Bows.Contains(itemBase))
            {
                return("Bow");
            }
            if (Claws.Contains(itemBase))
            {
                return("Claw");
            }
            if (OneHandedAxes.Contains(itemBase))
            {
                return("One Hand Axe");
            }
            if (OneHandedMaces.Contains(itemBase))
            {
                return("One Hand Mace");
            }
            if (OneHandedSwords.Contains(itemBase))
            {
                return("One Hand Sword");
            }
            if (TwoHandedAxes.Contains(itemBase))
            {
                return("Two Hand Axe");
            }
            if (TwoHandedMaces.Contains(itemBase))
            {
                return("Two Hand Mace");
            }
            if (Sceptres.Contains(itemBase))
            {
                return("Sceptre");
            }
            if (Daggers.Contains(itemBase))
            {
                return("Dagger");
            }
            if (Staves.Contains(itemBase))
            {
                return("Staff");
            }
            if (Belts.Contains(itemBase))
            {
                return("Belt");
            }
            if (Amulets.Contains(itemBase))
            {
                return("Amulet");
            }
            if (Rings.Contains(itemBase))
            {
                return("Ring");
            }
            if (Boots.Contains(itemBase))
            {
                return("Boots");
            }
            if (Gloves.Contains(itemBase))
            {
                return("Gloves");
            }
            if (BodyArmors.Contains(itemBase))
            {
                return("Body Armour");
            }
            if (Wands.Contains(itemBase))
            {
                return("Wand");
            }
            if (Helmets.Contains(itemBase))
            {
                return("Helmet");
            }
            if (Shields.Contains(itemBase))
            {
                return("Shield");
            }
            if (Jewels.Contains(itemBase))
            {
                return("Jewel");
            }
            if (itemBase == "Gem")
            {
                return(itemBase);
            }
            if (Quivers.Contains(itemBase))
            {
                return("Quiver");
            }

            return("No type found");
        }
コード例 #17
0
        public ExperimentSimulator(DatabaseConnector databaseConnector)
        {
            Claws.NotNull(() => databaseConnector);

            this.databaseConnector = databaseConnector;
        }