Пример #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 FurnitureObject(FurnitureObjectConfiguration configuration)
            : base(configuration.Name, configuration.MaxHealth)
        {
            worldImage     = configuration.WorldImage;
            ZIndex         = configuration.ZIndex;
            Size           = configuration.Size;
            MaxHealth      = configuration.MaxHealth;
            maxWoodCount   = configuration.MaxWoodCount;
            minWoodCount   = configuration.MinWoodCount;
            BlocksMovement = configuration.BlocksMovement;

            StatusesImmunity.AddRange(configuration.StatusesImmunity);
        }
Пример #3
0
        protected MonsterCreatureObject(MonsterCreatureObjectConfiguration configuration)
            : base(configuration.Name, configuration.MaxHealth, configuration.LogicPattern)
        {
            this.configuration = configuration;

            attackDamage      = configuration.Damage.ToArray();
            hitChance         = configuration.Accuracy;
            lootConfiguration = configuration.LootConfiguration;

            if (configuration.BaseProtection != null)
            {
                foreach (var pair in configuration.BaseProtection)
                {
                    BaseProtection.Add(pair.Key, pair.Value);
                }
            }

            if (configuration.StatusesImmunity != null)
            {
                StatusesImmunity.AddRange(configuration.StatusesImmunity);
            }
        }