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); } }
private static ICreatureObject CreateMonster(IMonsterConfiguration config) { return(new MonsterCreatureImpl(new MonsterCreatureImplConfiguration(config))); }