Пример #1
0
        public MonsterCreatureImplConfiguration(IMonsterConfiguration config)
        {
            var health = RandomHelper.GetRandomValue(config.Stats.MinHealth, config.Stats.MaxHealth);

            Id                        = config.Id;
            Name                      = config.Name;
            LogicPattern              = config.LogicPattern;
            Experience                = config.Experience;
            Size                      = config.Size;
            ZIndex                    = ZIndex.Creature;
            Accuracy                  = config.Stats.Accuracy;
            DodgeChance               = config.Stats.DodgeChance;
            MaxHealth                 = health;
            RemainsType               = config.RemainsType;
            DamageMarkType            = config.DamageMarkType;
            CatchFireChanceMultiplier = config.Stats.CatchFireChanceMultiplier;
            SelfExtinguishChance      = config.Stats.SelfExtinguishChanceMultiplier;
            Image                     = config.Image;
            LootConfiguration         = config.Loot;
            VisibilityRange           = config.Stats.VisibilityRange;
            Speed                     = config.Stats.Speed;
            ShieldBlockChance         = config.Stats.ShieldBlockChance;
            ShieldBlocksDamage        = config.Stats.ShieldBlocksDamage;
            Damage.AddRange(config.Stats.Damage.Select(conf => new MonsterDamageValue(conf.Element, conf.MinValue, conf.MaxValue)));
            foreach (var protectionConfiguration in config.Stats.Protection)
            {
                BaseProtection.Add(protectionConfiguration.Element, protectionConfiguration.Value);
            }

            if (config.Stats.StatusesImmunity != null)
            {
                StatusesImmunity.AddRange(config.Stats.StatusesImmunity);
            }
        }
Пример #2
0
        // ----- Public Methods --- //
        public Weapon(WeaponType type, AdditionalWeaponPropertiesDTO additionalProperties = null)
        {
            Type                 = type;
            Damage               = new List <DamageDice>();
            Properties           = new List <WeaponProperty>();
            MagicProperties      = new List <string>();
            ExternalDescriptions = new List <string>();

            BasicWeaponSetup(additionalProperties != null ? additionalProperties.IsMagic : false);

            if (additionalProperties != null)
            {
                if (additionalProperties.ReplaceBaseDamageType)
                {
                    var newDamage = new DamageDice(Damage.First().Die, additionalProperties.ReplacementDamageType, additionalProperties.IsMagic);
                    Damage = new List <DamageDice> {
                        newDamage
                    };
                }

                Material      = additionalProperties.Material;
                MagicModifier = additionalProperties.MagicModifier;
                Damage.AddRange(additionalProperties.AdditionalDamage);
                MagicProperties.AddRange(additionalProperties.MagicProperties);
                RequiresAttunement  = additionalProperties.RequiresAttunement;
                AttunementAlignment = additionalProperties.AttunementRequiresMatchingAlignment;
                Name            = additionalProperties.Name;
                NamePostfix     = additionalProperties.NamePostfix;
                ReplaceName     = additionalProperties.ReplaceName;
                IsMagic         = additionalProperties.IsMagic;
                IsSentient      = additionalProperties.IsSentient;
                MagicItemRarity = additionalProperties.MagicItemRarity;
                Alignment       = additionalProperties.Alignment;
                ExternalDescriptions.AddRange(additionalProperties.ExternalDescription);
                Properties.AddRange(additionalProperties.AdditionalProperties);
            }
        }