Example #1
0
        public EnchantedMagicWeapon(IWeapon weapon, List<IWeaponEnchantment> weaponEnchantments)
        {
            enchantments = new List<IWeaponEnchantment>();
            LoadCriticalDamageDictionary();

            plusWeapon = QualifyWeapon(weapon);
            enchantments.AddRange(weaponEnchantments);

            // IWeapon
            WeaponName = plusWeapon.WeaponName;
            GivenName = plusWeapon.GivenName;
            Proficiency = plusWeapon.Proficiency;
            WeaponUse = plusWeapon.WeaponUse;
            WeaponCategory = plusWeapon.WeaponCategory;
            WeaponSubCategory = plusWeapon.WeaponSubCategory;
            WeaponSize = plusWeapon.WeaponSize;
            WeaponCost = plusWeapon.WeaponCost;
            Damage = plusWeapon.Damage;
            ThreatRangeLowerBound = plusWeapon.ThreatRangeLowerBound;
            CriticalDamage = plusWeapon.CriticalDamage;
            DamageType = plusWeapon.DamageType;
            Weight = plusWeapon.Weight;
            Hardness = plusWeapon.Hardness;
            HitPoints = plusWeapon.HitPoints;
            RangeIncrement = plusWeapon.RangeIncrement;
            MaxRange = plusWeapon.MaxRange;
            IsBow = plusWeapon.IsBow;

            //IForgedWeapon
            AdditionalEnchantmentCost = plusWeapon.AdditionalEnchantmentCost;
            ToHitModifier = plusWeapon.ToHitModifier;
            DamageBonus = plusWeapon.DamageBonus;
            ComponentName = plusWeapon.ComponentName;

            //IPlusEnhancedWeapon
            PlusEnhancement = plusWeapon.PlusEnhancement;
            GeneratesLight = plusWeapon.GeneratesLight;
            RequiredFeats = plusWeapon.RequiredFeats;

            //IWeaponEnhancement

            // Properties needing method assignments
            //		IWeapon
            CostModifier = TallyCostModifiers();
            ThreatRange = CalculateThreatRange();
            //		IPlusWeapon and IWeaponEnchantment
            MinimumCasterLevel = DetermineMinimumCasterLevel(plusWeapon.MinimumCasterLevel);
            MagicAura = AssembleAuras();
            //		IWeaponEnchantment
            RequiredSpells = AssembleRequiredSpells();
            AdditionalRequirements = AssembleAdditionalRequirements();
            //		Non interface implemented properties
            ModifiedRangeIncrement = CalculateRangeModifier(plusWeapon.RangeIncrement);
            ModifiedMaxRange = CalculateRangeModifier(plusWeapon.MaxRange);

            SpecialInfo = AppendSpecialInfo();
        }
Example #2
0
        public void TestPlusEnhancementWeapon()
        {
            // A weapon must be masterwork before it can be magical.
            // A magic weapon:
            //		Has a plus enhancement from 1 to 5
            //		Adds the plus enhancement to attack and damage
            //		Has a cost that is: Square the plus enhancement and then multiply by 2
            //		Adjusts the hardness and hit points based on plus modifier
            //		Must be a plus 1 before any special qualities can be added
            //		... more here to add
            //		PhbWeapon => ForgedWeapon => PlusWeapon => EnchantedWeapon
            var weaopn = new PhbWeapon("Dagger");

            weaopn.NameWeapon("My Magic Friend!");
            var silver       = new AlchemicalSilver();
            var forgedWeapon = new ForgedWeapon(weaopn, silver);
            var plusWeapon   = new PlusEnhancedWeapon(forgedWeapon, 1);

            plusWeapon.EnableLightGeneration();
            Approvals.Verify(plusWeapon.ToString());
        }
Example #3
0
        public void TestKeenAnarchicFlamingBurstDagger()
        {
            var plusWeapon = new PlusEnhancedWeapon(new ForgedWeapon(new PhbWeapon("Dagger"), new Masterwork()), 4);

            plusWeapon.NameWeapon("Boring dagger");
            var flamingBurst = new WeaponEnchantment("Flaming Burst");
            var keen         = new WeaponEnchantment("Keen");
            var anarchic     = new WeaponEnchantment("Anarchic");
            var distance     = new WeaponEnchantment("Distance");

            plusWeapon.EnableLightGeneration();
            List <IWeaponEnchantment> enchantments = new List <IWeaponEnchantment>()
            {
                anarchic, distance, flamingBurst, keen,
            };
            var flamingBurstDagger = new EnchantedMagicWeapon(plusWeapon, enchantments);

            flamingBurstDagger.NameWeapon("Totally Awesome Slashy Pokey Death from Far Far Away!");
            var sb = new StringBuilder(string.Format("Min. Caster Lvl: {0}", flamingBurstDagger.MinimumCasterLevel));

            Approvals.Verify(flamingBurstDagger.ToString());
        }
Example #4
0
        public void TestPlusMithralWeapon()
        {
            var plusWeapon = new PlusEnhancedWeapon(new ForgedWeapon(new PhbWeapon("Dagger"), new Mithral()), 3);

            Approvals.Verify(plusWeapon.ToString());
        }
Example #5
0
 public void TestPlusMithralWeapon()
 {
     var plusWeapon = new PlusEnhancedWeapon(new ForgedWeapon(new PhbWeapon("Dagger"), new Mithral()), 3);
     Approvals.Verify(plusWeapon.ToString());
 }
Example #6
0
 public void TestPlusEnhancementWeapon()
 {
     // A weapon must be masterwork before it can be magical.
     // A magic weapon:
     //		Has a plus enhancement from 1 to 5
     //		Adds the plus enhancement to attack and damage
     //		Has a cost that is: Square the plus enhancement and then multiply by 2
     //		Adjusts the hardness and hit points based on plus modifier
     //		Must be a plus 1 before any special qualities can be added
     //		... more here to add
     //		PhbWeapon => ForgedWeapon => PlusWeapon => EnchantedWeapon
     var weaopn = new PhbWeapon("Dagger");
     weaopn.NameWeapon("My Magic Friend!");
     var silver = new AlchemicalSilver();
     var forgedWeapon = new ForgedWeapon(weaopn, silver);
     var plusWeapon = new PlusEnhancedWeapon(forgedWeapon, 1);
     plusWeapon.EnableLightGeneration();
     Approvals.Verify(plusWeapon.ToString());
 }
Example #7
0
 public void TestKeenAnarchicFlamingBurstDagger()
 {
     var plusWeapon = new PlusEnhancedWeapon(new ForgedWeapon(new PhbWeapon("Dagger"), new Masterwork()), 4);
     plusWeapon.NameWeapon("Boring dagger");
     var flamingBurst = new WeaponEnchantment("Flaming Burst");
     var keen = new WeaponEnchantment("Keen");
     var anarchic = new WeaponEnchantment("Anarchic");
     var distance = new WeaponEnchantment("Distance");
     plusWeapon.EnableLightGeneration();
     List<IWeaponEnchantment> enchantments = new List<IWeaponEnchantment>() { anarchic, distance, flamingBurst, keen, };
     var flamingBurstDagger = new EnchantedMagicWeapon(plusWeapon, enchantments);
     flamingBurstDagger.NameWeapon("Totally Awesome Slashy Pokey Death from Far Far Away!");
     var sb = new StringBuilder(string.Format("Min. Caster Lvl: {0}", flamingBurstDagger.MinimumCasterLevel));
     Approvals.Verify(flamingBurstDagger.ToString());
 }