Exemplo n.º 1
0
    // See: http://www.d20srd.org/srd/carryingCapacity.htm
    private static int AdjustCarryingCapacityForSize(int capacity, SizeCategory size)
    {
        if (size > SizeCategory.Medium)
        {
            for (var i = (int)size - 5; i > 0; i--)
            {
                capacity *= 2;
            }
        }
        else if (size == SizeCategory.Small)
        {
            // Small creature
            capacity = capacity * 3 / 4;
        }
        else if (size < SizeCategory.Small)
        {
            var i = 4 - size;
            do
            {
                --i;
                capacity /= 2;
            } while (i > 0);
        }

        return(capacity);
    }
Exemplo n.º 2
0
        public SearchRouteModel FindRoute(
            string departureCode,
            string destinationCode,
            double weight,
            double height,
            double depth,
            double width,
            int productTypeId)
        {
            var routes = Db.Route
                         .Include(x => x.DepartureLocation)
                         .Include(x => x.DestinationLocation)
                         .ToList();

            var productType =
                Db.ProductType.First(x => x.Id == productTypeId);

            decimal      decWeight = (decimal)weight;
            SizeCategory category  = FindSizeCategory(height, depth, width);

            if (category == null)
            {
                throw new Exception("Can't find a valid size category");
            }

            var weightConfig =
                Db.WeightCostSetting.First(x =>
                                           x.WeightFrom < decWeight &&
                                           x.WeightTo >= decWeight &&
                                           x.SizeCategoryId == category.Id);

            var locations = Db.Location.ToList();
            var path      = FindRoutes(locations, routes, departureCode, destinationCode);

            var routesInformation = new List <SearchRouteBetweenNodesModel>();
            var lastLocationId    = path[0];

            foreach (var locationId in path.Skip(1))
            {
                var route = routes.First(x =>
                                         x.DepartureLocationId == lastLocationId && x.DestinationLocationId == locationId);

                routesInformation.Add(new SearchRouteBetweenNodesModel()
                {
                    FromLocation = new LocationModel(route.DepartureLocation),
                    ToLocation   = new LocationModel(route.DestinationLocation),
                    Cost         = PriceCalculate(weightConfig, productType),
                    Time         = 8,
                    TransportBy  = "Oceanic"
                });

                lastLocationId = locationId;
            }

            return(new SearchRouteModel()
            {
                Routes = routesInformation
            });
        }
Exemplo n.º 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Core.Domain.Items.Armor.Paizo.CoreRulebook.Chainmail"/> class.
        /// </summary>
        /// <param name="size">The size of the character intended to wear the armor.</param>
        /// <param name="material">The material the chainmail is made from.</param>
        /// <exception cref="System.ComponentModel.InvalidEnumArgumentException">Thrown when an argument is a nonstandard enum.</exception>
        public Chainmail(SizeCategory size, ChainmailMaterial material)
            : base(6, GetHardnessForMaterial(material))
        {
            const byte   ARMOR_CHECK_PENALTY = 5;
            const byte   MAX_DEX_BONUS       = 2;
            const double WEIGHT        = 40;
            const double PRICE         = 150;
            const float  SPEED_PENALTY = 0.25f;
            NameFragment standardName  = new NameFragment("Chainmail", "http://www.d20pfsrd.com/equipment/armor/chainmail/");

            switch (material)
            {
            case ChainmailMaterial.Adamantine:
                this.IsMasterwork           = true;
                this.MasterworkIsToggleable = false;
                this.ArmorCheckPenalty      = () => StandardArmorCheckPenaltyCalculation(ARMOR_CHECK_PENALTY);
                this.MaximumDexterityBonus  = () => MAX_DEX_BONUS;
                this.MundaneMarketPrice     = () => Adamantine.GetMediumArmorBaseMarketPrice(MarketValueScaledBySize(size, PRICE));
                this.Weight      = () => WeightScaledBySize(size, WEIGHT);
                this.MundaneName = () => new INameFragment[] {
                    new NameFragment("Adamantine", Adamantine.WebAddress),
                    standardName
                };
                this.SpeedPenalty    = SPEED_PENALTY;
                var(drMag, drBypass) = Adamantine.GetMediumArmorDamageReduction();
                this.OnApplied      += (sender, e) => {
                    e.Character?.DamageReduction?.Add(drMag, drBypass);
                };
                break;

            case ChainmailMaterial.Mithral:
                this.IsMasterwork           = true;
                this.MasterworkIsToggleable = false;
                this.ArmorCheckPenalty      = () => Mithral.GetArmorCheckPenalty(ARMOR_CHECK_PENALTY);
                this.MaximumDexterityBonus  = () => Mithral.GetArmorMaximumDexterityBonus(MAX_DEX_BONUS);
                this.MundaneMarketPrice     = () => Mithral.GetMediumArmorBaseMarketPrice(MarketValueScaledBySize(size, PRICE));
                this.Weight      = () => Mithral.GetWeight(WeightScaledBySize(size, WEIGHT));
                this.MundaneName = () => new INameFragment[] {
                    new NameFragment("Mithral", Mithral.WebAddress),
                    standardName
                };
                this.SpeedPenalty = 0;
                break;

            case ChainmailMaterial.Steel:
                this.ArmorCheckPenalty     = () => StandardArmorCheckPenaltyCalculation(ARMOR_CHECK_PENALTY);
                this.MaximumDexterityBonus = () => MAX_DEX_BONUS;
                this.MundaneMarketPrice    = () => StandardMundaneMarketPriceCalculation(MarketValueScaledBySize(size, PRICE));
                this.Weight       = () => WeightScaledBySize(size, WEIGHT);
                this.MundaneName  = () => new INameFragment[] { standardName };
                this.SpeedPenalty = SPEED_PENALTY;
                break;

            default:
                throw new InvalidEnumArgumentException(nameof(material), (int)material, material.GetType());
            }
        }
Exemplo n.º 4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Core.Domain.Items.Shields.Paizo.CoreRulebook.HeavyShield"/> class.
        /// </summary>
        /// <param name="size">The size of character this shield is intended to be used by.</param>
        /// <param name="material">The dominant material the shield is crafted from.</param>
        /// <exception cref="System.ComponentModel.InvalidEnumArgumentException">Thrown when an argument is a nonstandard enum.</exception>
        public HeavyShield(SizeCategory size, HeavyShieldMaterial material)
            : base(armorClassBonus:           ARMOR_BONUS,
                   materialInchesOfThickness: InchesOfThicknessScaledBySize(size, GetMediumInchesOfThicknessForMaterial(material)),
                   materialHitPointsPerInch:  GetHitPointsPerInchOfThicknessForMaterial(material),
                   materialHardness:          GetHardnessForMaterial(material))
        {
            const double STEEL_WEIGHT = 15;
            const double STEEL_PRICE  = 20;

            switch (material)
            {
            case HeavyShieldMaterial.Darkwood:
                this.IsMasterwork           = true;
                this.MasterworkIsToggleable = false;
                this.ArmorCheckPenalty      = () => Darkwood.GetShieldArmorCheckPenalty(BASE_ARMOR_CHECK_PENALTY);
                this.MundaneMarketPrice     = () => Darkwood.GetShieldBaseMarketValue(MarketValueScaledBySize(size, WOOD_PRICE), this.GetWeight());
                this.Weight      = () => Darkwood.GetWeight(WeightScaledBySize(size, WOOD_WEIGHT));
                this.MundaneName = () => new INameFragment[] {
                    new NameFragment("Darkwood", Darkwood.WebAddress),
                    StandardShieldName
                };
                break;

            case HeavyShieldMaterial.Mithral:
                this.IsMasterwork           = true;
                this.MasterworkIsToggleable = false;
                this.ArmorCheckPenalty      = () => Mithral.GetArmorCheckPenalty(BASE_ARMOR_CHECK_PENALTY);
                this.MundaneMarketPrice     = () => Mithral.GetShieldBaseMarketValue(MarketValueScaledBySize(size, STEEL_PRICE));
                this.Weight      = () => Mithral.GetWeight(WeightScaledBySize(size, STEEL_WEIGHT));
                this.MundaneName = () => new INameFragment[] {
                    new NameFragment("Mithral", Mithral.WebAddress),
                    StandardShieldName
                };
                break;

            case HeavyShieldMaterial.Steel:
                this.ArmorCheckPenalty  = () => this.StandardArmorCheckPenaltyCalculation(BASE_ARMOR_CHECK_PENALTY);
                this.MundaneMarketPrice = () => StandardMundaneMarketPriceCalculation(MarketValueScaledBySize(size, STEEL_PRICE));
                this.Weight             = () => WeightScaledBySize(size, STEEL_WEIGHT);
                this.MundaneName        = () => new INameFragment[] {
                    new NameFragment("Heavy Steel Shield", StandardShieldName.WebAddress),
                };
                break;

            case HeavyShieldMaterial.Wood:
                this.ArmorCheckPenalty  = () => this.StandardArmorCheckPenaltyCalculation(BASE_ARMOR_CHECK_PENALTY);
                this.MundaneMarketPrice = () => StandardMundaneMarketPriceCalculation(MarketValueScaledBySize(size, WOOD_PRICE));
                this.Weight             = () => WeightScaledBySize(size, WOOD_WEIGHT);
                this.MundaneName        = () => new INameFragment[] {
                    new NameFragment("Heavy Wooden Shield", StandardShieldName.WebAddress),
                };
                break;

            default:
                throw new InvalidEnumArgumentException(nameof(material), (int)material, material.GetType());
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// Use this constructor for hide armor made of default materials.
 /// Initializes a new instance of the <see cref="T:Core.Domain.Items.Armor.Paizo.CoreRulebook.HideArmor"/> class.
 /// </summary>
 /// <param name="size">The size of character this armor is designed for.</param>
 public HideArmor(SizeCategory size)
     : base(baseArmorBonus:   BASE_ARMOR_BONUS,
            materialHardness: Leather.Hardness)
 {
     this.ArmorCheckPenalty     = () => StandardArmorCheckPenaltyCalculation(ARMOR_CHECK_PENALTY);
     this.MaximumDexterityBonus = () => MAX_DEX_BONUS;
     this.MundaneName           = () => new INameFragment[] { StandardName };
     this.MundaneMarketPrice    = () => base.StandardMundaneMarketPriceCalculation(MarketValueScaledBySize(size, PRICE));
     this.Weight = () => WeightScaledBySize(size, WEIGHT);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:Core.Domain.Items.Armor.Paizo.CoreRulebook.PaddedArmor"/> class.
 /// </summary>
 /// <param name="size">Size.</param>
 public PaddedArmor(SizeCategory size)
     : base(1, Cloth.Hardness)
 {
     this.ArmorCheckPenalty = () => StandardArmorCheckPenaltyCalculation(1);
     this.MaximumDexterityBonus = () => 8;
     this.MundaneName = () => new INameFragment[] {
         new NameFragment("Padded Armor", "http://www.d20pfsrd.com/equipment/Armor/padded")
     };
     this.MundaneMarketPrice = () => base.StandardMundaneMarketPriceCalculation(MarketValueScaledBySize(size, 5));
     this.Weight = () => WeightScaledBySize(size, 10);
 }
Exemplo n.º 7
0
 private static int GetReachForSizeCategory(SizeCategory sizeCat)
 {
     if (sizeCat <= SizeCategory.Medium)
     {
         return(0);
     }
     else
     {
         return(10);
     }
 }
Exemplo n.º 8
0
        /// <summary>
        /// Scales a shield's thickness based on the shield's size.
        /// </summary>
        /// <returns>The new thickness (in inches).</returns>
        /// <param name="size">The shield's size.</param>
        /// <param name="mediumInchesOfThickness">The thickness of a medium-size shield of this type.</param>
        /// <exception cref="System.ComponentModel.InvalidEnumArgumentException">Thrown when an argument is a nonstandard enum.</exception>
        protected static float InchesOfThicknessScaledBySize(SizeCategory size, float mediumInchesOfThickness)
        {
            switch (size)
            {
            case SizeCategory.Small:  return(mediumInchesOfThickness / 2f);

            case SizeCategory.Medium: return(mediumInchesOfThickness);

            case SizeCategory.Large:  return(mediumInchesOfThickness * 2f);

            default:
                throw new InvalidEnumArgumentException(nameof(size), (int)size, size.GetType());
            }
        }
Exemplo n.º 9
0
        /// <summary>
        /// Scales an armor's weight based on the armor's size.
        /// </summary>
        /// <returns>The new weight.</returns>
        /// <param name="size">The armor's size.</param>
        /// <param name="mediumWeight">The medium-size weight for armor of this type.</param>
        /// <exception cref="System.ComponentModel.InvalidEnumArgumentException">Thrown when an argument is a nonstandard enum.</exception>
        protected static double WeightScaledBySize(SizeCategory size, double mediumWeight)
        {
            switch (size)
            {
            case SizeCategory.Small:  return(mediumWeight / 2.0);

            case SizeCategory.Medium: return(mediumWeight);

            case SizeCategory.Large:  return(mediumWeight * 2.0);

            default:
                throw new InvalidEnumArgumentException(nameof(size), (int)size, size.GetType());
            }
        }
Exemplo n.º 10
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Core.Domain.Items.Armor.Paizo.CoreRulebook.Breastplate"/> class.
        /// </summary>
        /// <param name="size">The size of the character intended to wear the armor.</param>
        /// <param name="material">The material the breastplate is made from.</param>
        /// <exception cref="System.ComponentModel.InvalidEnumArgumentException">Thrown when an argument is a nonstandard enum.</exception>
        public Breastplate(SizeCategory size, BreastplateMaterial material)
            : base(BASE_ARMOR_BONUS, GetHardnessForMaterial(material))
        {
            switch (material)
            {
            case BreastplateMaterial.Adamantine:
                this.IsMasterwork           = true;
                this.MasterworkIsToggleable = false;
                this.ArmorCheckPenalty      = () => StandardArmorCheckPenaltyCalculation(ARMOR_CHECK_PENALTY);
                this.MaximumDexterityBonus  = () => MAX_DEX_BONUS;
                this.MundaneMarketPrice     = () => Adamantine.GetMediumArmorBaseMarketPrice(MarketValueScaledBySize(size, PRICE));
                this.Weight      = () => WeightScaledBySize(size, WEIGHT);
                this.MundaneName = () => new INameFragment[] {
                    new NameFragment("Adamantine", Adamantine.WebAddress),
                    StandardName
                };
                this.SpeedPenalty    = SPEED_PENALTY;
                var(drMag, drBypass) = Adamantine.GetMediumArmorDamageReduction();
                this.OnApplied      += (sender, e) => {
                    e.Character?.DamageReduction?.Add(drMag, drBypass);
                };
                break;

            case BreastplateMaterial.Mithral:
                this.IsMasterwork           = true;
                this.MasterworkIsToggleable = false;
                this.ArmorCheckPenalty      = () => Mithral.GetArmorCheckPenalty(ARMOR_CHECK_PENALTY);
                this.MaximumDexterityBonus  = () => Mithral.GetArmorMaximumDexterityBonus(MAX_DEX_BONUS);
                this.MundaneMarketPrice     = () => Mithral.GetMediumArmorBaseMarketPrice(MarketValueScaledBySize(size, PRICE));
                this.Weight      = () => Mithral.GetWeight(WeightScaledBySize(size, WEIGHT));
                this.MundaneName = () => new INameFragment[] {
                    new NameFragment("Mithral", Mithral.WebAddress),
                    StandardName
                };
                this.SpeedPenalty = 0;
                break;

            case BreastplateMaterial.Steel:
                this.ArmorCheckPenalty     = () => StandardArmorCheckPenaltyCalculation(ARMOR_CHECK_PENALTY);
                this.MaximumDexterityBonus = () => MAX_DEX_BONUS;
                this.MundaneMarketPrice    = () => StandardMundaneMarketPriceCalculation(MarketValueScaledBySize(size, PRICE));
                this.Weight       = () => WeightScaledBySize(size, WEIGHT);
                this.MundaneName  = () => new INameFragment[] { StandardName };
                this.SpeedPenalty = SPEED_PENALTY;
                break;

            default:
                throw new InvalidEnumArgumentException(nameof(material), (int)material, material.GetType());
            }
        }
Exemplo n.º 11
0
        public static int SpriteScale(SizeCategory size)
        {
            switch (size)
            {
            case SizeCategory.ExtraSmall:
            case SizeCategory.Small: return(1);

            case SizeCategory.Medium: return(3);

            case SizeCategory.Large: return(5);

            default: return(1);
            }
        }
Exemplo n.º 12
0
 /// <summary>
 /// Use this constructor for full plate made of dragonhide.
 /// Initializes a new instance of the <see cref="T:Core.Domain.Items.Armor.Paizo.CoreRulebook.FullPlate"/> class.
 /// </summary>
 /// <param name="size">The size of character this armor is designed for.</param>
 /// <param name="color">The color of the dragonhide.</param>
 public FullPlate(SizeCategory size, DragonhideColor color)
     : base(baseArmorBonus:   BASE_ARMOR_BONUS,
            materialHardness: Dragonhide.Hardness)
 {
     this.IsMasterwork           = true;
     this.MasterworkIsToggleable = false;
     this.ArmorCheckPenalty      = () => StandardArmorCheckPenaltyCalculation(ARMOR_CHECK_PENALTY);
     this.MaximumDexterityBonus  = () => MAX_DEX_BONUS;
     this.MundaneName            = () => new INameFragment[] {
         new NameFragment($"{ color } Dragonhide", Dragonhide.WebAddress),
         StandardName
     };
     this.MundaneMarketPrice = () => Dragonhide.GetArmorBaseMarketPrice(MarketValueScaledBySize(size, PRICE), this.Enchantments, color);
     this.Weight             = () => WeightScaledBySize(size, WEIGHT);
 }
Exemplo n.º 13
0
 /// <summary>
 /// Use this constructor when the shield is to be made from Dragonhide.
 /// Initializes a new instance of the <see cref="T:Core.Domain.Items.Shields.Paizo.CoreRulebook.HeavyShield"/> class.
 /// </summary>
 /// <param name="size">The size of character this shield is intended to be used by.</param>
 /// <param name="color">The color of dragonhide this shield is crafted from.</param>
 /// <exception cref="System.ComponentModel.InvalidEnumArgumentException">Thrown when an argument is a nonstandard enum.</exception>
 public HeavyShield(SizeCategory size, DragonhideColor color)
     : base(armorClassBonus:           ARMOR_BONUS,
            materialInchesOfThickness: InchesOfThicknessScaledBySize(size, 3f / 2f),
            materialHitPointsPerInch:  Dragonhide.HitPointsPerInch,
            materialHardness:          Dragonhide.Hardness)
 {
     this.IsMasterwork           = true;
     this.MasterworkIsToggleable = false;
     this.ArmorCheckPenalty      = () => this.StandardArmorCheckPenaltyCalculation(BASE_ARMOR_CHECK_PENALTY);
     this.MundaneMarketPrice     = () => Dragonhide.GetShieldBaseMarketPrice(MarketValueScaledBySize(size, WOOD_PRICE), this.Enchantments, color);
     this.Weight      = () => WeightScaledBySize(size, WOOD_WEIGHT);
     this.MundaneName = () => new INameFragment[] {
         new NameFragment($"{ color } Dragonhide", Dragonhide.WebAddress),
         StandardShieldName
     };
 }
Exemplo n.º 14
0
        public static int GetMaxRangeBonusForSize(SizeCategory size)
        {
            switch (size)
            {
            case SizeCategory.ExtraSmall:
            case SizeCategory.Small:         return(1);

            case SizeCategory.Medium:        return(2);

            case SizeCategory.Large:         return(3);

            case SizeCategory.Gigantic:      return(4);

            case SizeCategory.GiganticSuper: return(5);

            default: return(1);
            }
        }
Exemplo n.º 15
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T:Core.Domain.Items.Shields.Paizo.CoreRulebook.TowerShield"/> class.
        /// </summary>
        /// <param name="size">The size of character this shield is intended to be used by.</param>
        /// <param name="material">The dominant material the shield is crafted from.</param>
        /// <exception cref="System.ComponentModel.InvalidEnumArgumentException">Thrown when an argument is a nonstandard enum.</exception>
        public TowerShield(SizeCategory size, TowerShieldMaterial material)
            : base(armorClassBonus:           ARMOR_BONUS,
                   materialInchesOfThickness: InchesOfThicknessScaledBySize(size, INCHES_OF_THICKNESS),
                   materialHitPointsPerInch:  GetHitPointsPerInchOfThicknessForMaterial(material),
                   materialHardness:          GetHardnessForMaterial(material))
        {
            switch (material)
            {
            case TowerShieldMaterial.Darkwood:
                this.IsMasterwork           = true;
                this.MasterworkIsToggleable = false;
                this.ArmorCheckPenalty      = () => Darkwood.GetShieldArmorCheckPenalty(BASE_ARMOR_CHECK_PENALTY);
                this.MundaneMarketPrice     = () => Darkwood.GetShieldBaseMarketValue(MarketValueScaledBySize(size, WOOD_PRICE), this.GetWeight());
                this.Weight      = () => Darkwood.GetWeight(WeightScaledBySize(size, WOOD_WEIGHT));
                this.MundaneName = () => new INameFragment[] {
                    new NameFragment("Darkwood", Darkwood.WebAddress),
                    StandardShieldName
                };
                break;

            case TowerShieldMaterial.Wood:
                this.ArmorCheckPenalty  = () => this.StandardArmorCheckPenaltyCalculation(BASE_ARMOR_CHECK_PENALTY);
                this.MundaneMarketPrice = () => StandardMundaneMarketPriceCalculation(MarketValueScaledBySize(size, WOOD_PRICE));
                this.Weight             = () => WeightScaledBySize(size, WOOD_WEIGHT);
                this.MundaneName        = () => new INameFragment[] {
                    StandardShieldName
                };
                break;

            default:
                throw new InvalidEnumArgumentException(nameof(material), (int)material, material.GetType());
            }
            // Tower shields apply a maximum dexterity bonus to AC
            this.OnApplied += (sender, e) => {
                e.Character?.ArmorClass?.MaxKeyAbilityScore?.Add(this.GetMaximumDexterityBonus);
            };
            // Tower shields inflict a -2 penalty to melee attack rolls
            this.OnApplied += (sender, e) => {
                e.Character?.AttackBonuses?.GenericMeleeAttackBonus?.Penalties?.Add(() => 2);
            };
        }
Exemplo n.º 16
0
    public bool IsRogueWeapon(SizeCategory wielderSize, WeaponType wpnType)
    {
        // TODO: looks like Troika intended to differentiate by the Wielder's Size? Was not implemented
        if (IsSimple(wpnType))
        {
            return(true);
        }

        switch (wpnType)
        {
        case WeaponType.hand_crossbow:
        case WeaponType.rapier:
        case WeaponType.short_sword:
        case WeaponType.sap:
        case WeaponType.shortbow:
        case WeaponType.composite_shortbow:
            return(true);

        default:
            return(false);
        }
    }
Exemplo n.º 17
0
 /// <summary>
 /// Use this constructor when the shield is to be made from Dragonhide.
 /// Initializes a new instance of the <see cref="T:Core.Domain.Items.Shields.Paizo.CoreRulebook.TowerShield"/> class.
 /// </summary>
 /// <param name="size">The size of character this shield is intended to be used by.</param>
 /// <param name="color">The dominant material the shield is crafted from.</param>
 public TowerShield(SizeCategory size, DragonhideColor color)
     : base(armorClassBonus:           ARMOR_BONUS,
            materialInchesOfThickness: InchesOfThicknessScaledBySize(size, INCHES_OF_THICKNESS),
            materialHitPointsPerInch:  Dragonhide.HitPointsPerInch,
            materialHardness:          Dragonhide.Hardness)
 {
     this.IsMasterwork           = true;
     this.MasterworkIsToggleable = false;
     this.ArmorCheckPenalty      = () => this.StandardArmorCheckPenaltyCalculation(BASE_ARMOR_CHECK_PENALTY);
     this.MundaneMarketPrice     = () => Dragonhide.GetShieldBaseMarketPrice(MarketValueScaledBySize(size, WOOD_PRICE), this.Enchantments, color);
     this.Weight      = () => WeightScaledBySize(size, WOOD_WEIGHT);
     this.MundaneName = () => new INameFragment[] {
         new NameFragment($"{ color } Dragonhide", Dragonhide.WebAddress),
         StandardShieldName
     };
     // Tower shields apply a maximum dexterity bonus to AC
     this.OnApplied += (sender, e) => {
         e.Character?.ArmorClass?.MaxKeyAbilityScore?.Add(this.GetMaximumDexterityBonus);
     };
     // Tower shields inflict a -2 penalty to melee attack rolls
     this.OnApplied += (sender, e) => {
         e.Character?.AttackBonuses?.GenericMeleeAttackBonus?.Penalties?.Add(() => 2);
     };
 }
Exemplo n.º 18
0
 public static int GetSizeDifference(SizeCategory a, SizeCategory b)
 {
     return((int)a - (int)b);
 }
Exemplo n.º 19
0
		public BodyPart(TCreatureLimb origin){
			this.name=origin.name;
			this.pairNr=origin.pairNr;
			this.equipmentName=origin.equipmentName;
			this.regrowthRate=origin.regrowthRate;
			this.size=origin.size;
			this.slottedItemID="";
			this.slottedItem=null;
			this.weaponSize=origin.weaponSize;
			subPart=new BodyPart[origin.subLimbs.Length];
			for(int i=0;i<subPart.Length;i++)
				subPart[i]=new BodyPart(origin.subLimbs[i]);
		}
Exemplo n.º 20
0
    //Diese Funktion dient dazu die Funktionalität bei Add Effect zu gewährleisten, muss aber selbst aufgerufen werden, um Performance bei großen Effekt-Manipulierungen zu steigern.
    public virtual void updateStatistics()
    {
        dirtAH = true;
        EnforceEffectSupression ();
        //Sortiere die Listen der AttributsHelfer
        for (int i=0; i<AttributeHelper.Count; i++) {
            for (int ii=0; i<AttributeHelper[i].AllModifications.Count; ii++) {
                AttributeHelper [i].AllModifications [ii].Sort (delegate(AttributModificationHelper.Modification x, AttributModificationHelper.Modification y) {
                    if (x.IsSupressed (AttributeHelper [i].AttributeName) && y.IsSupressed (AttributeHelper [i].AttributeName))
                        return 0;
                    if (!x.IsSupressed (AttributeHelper [i].AttributeName) && y.IsSupressed (AttributeHelper [i].AttributeName))
                        return 1;
                    if (x.IsSupressed (AttributeHelper [i].AttributeName) && !y.IsSupressed (AttributeHelper [i].AttributeName))
                        return -1;
                    if (x.Order > y.Order)
                        return 1;
                    if (x.Order < y.Order)
                        return -1;
                    return 0;
                });

            }
            AttributeHelper [i].Inhibitors.Sort (delegate(AttributModificationHelper.Inhibitor x, AttributModificationHelper.Inhibitor y) {
                if (x.IsSupressed (AttributeHelper [i].AttributeName) && y.IsSupressed (AttributeHelper [i].AttributeName))
                    return 0;
                if (!x.IsSupressed (AttributeHelper [i].AttributeName) && y.IsSupressed (AttributeHelper [i].AttributeName))
                    return 1;
                if (x.IsSupressed (AttributeHelper [i].AttributeName) && !y.IsSupressed (AttributeHelper [i].AttributeName))
                    return -1;
                if (x.Order > y.Order)
                    return 1;
                if (x.Order < y.Order)
                    return -1;
                return 0;
            });
        }

        cWeight = bWeight + GetCurrentValueModification ("weight");
        cSizeCategory = bSizeCategory + (int)GetCurrentValueModification ("sizecategory");

        //Setzten der Statuseffekte
    }
Exemplo n.º 21
0
        private SizeCategory ReturnSizeCategory()
        {
            var          sizes        = new List <SelectListItem>();
            var          category     = new List <SelectListItem>();
            SizeCategory sizeCategory = new SizeCategory();

            sizes.Add(new SelectListItem
            {
                Value = "XS",
                Text  = "XS"
            });
            sizes.Add(new SelectListItem
            {
                Value = "S",
                Text  = "S"
            });
            sizes.Add(new SelectListItem
            {
                Value = "M",
                Text  = "M"
            });
            sizes.Add(new SelectListItem
            {
                Value = "L",
                Text  = "L"
            });
            sizes.Add(new SelectListItem
            {
                Value = "XL",
                Text  = "XL"
            });
            sizes.Add(new SelectListItem
            {
                Value = "2XL",
                Text  = "2XL"
            });
            sizes.Add(new SelectListItem
            {
                Value = "3XL",
                Text  = "3XL"
            });

            category.Add(new SelectListItem
            {
                Text  = "Shirts",
                Value = "Shirts"
            });
            category.Add(new SelectListItem
            {
                Text  = "Jumpers and Cardigans",
                Value = "Jumpers and Cardigans"
            });
            category.Add(new SelectListItem
            {
                Text  = "Hoodies and Sweatshirts",
                Value = "Hoodies and Sweatshirts"
            });
            category.Add(new SelectListItem
            {
                Text  = "Jackets and Coats",
                Value = "Jackets and Coats"
            });
            sizeCategory.Category = category;
            sizeCategory.Sizes    = sizes;

            return(sizeCategory);
        }
Exemplo n.º 22
0
 private decimal CalculateDeliveryPrice(SizeCategory sizeCategory, WeightCategory weight) => (decimal)sizeCategory + (decimal)weight;
Exemplo n.º 23
0
 //Mode bestimmt ob als Teil eines Templates oder aus einem File gesetzt werden soll. true ist hierbei ID, false=template
 public void setupObjectByCompact(CompactRPGObject o,bool mode)
 {
     this._name = o.name;
     bWeight = o.bWeight;
     bSizeCategory = o.bSizeCategory;
     if (mode) {
         cEffects=new List<TEffect>();
         AttributeHelper=new List<AttributModificationHelper>();
         if(o.cEffects!=null)
         foreach(TEffect e in o.cEffects)
             OnNewEffect(e);
         IDCounter = o.c;
     }
     else
         if(o.bEffects!=null)
         foreach (string effSting in o.bEffects)
             OnNewEffect( RPGCore.instance.spawnEffect (effSting));
     if(o.Information!=null)
         cInformation =new List<Content>(o.Information);
     updateStatistics ();
 }