Ejemplo n.º 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);
            }
        }
Ejemplo n.º 2
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);
            }
        }
Ejemplo n.º 3
0
Archivo: NPC.cs Proyecto: cvogt/AlbLib
        public override int GetHashCode()
        {
            int hashCode = 0;

            unchecked {
                if (unknown != null)
                {
                    hashCode += 1000000007 * unknown.GetHashCode();
                }
                hashCode += 1000000009 * Type.GetHashCode();
                hashCode += 1000000021 * Gender.GetHashCode();
                hashCode += 1000000033 * Race.GetHashCode();
                hashCode += 1000000087 * Class.GetHashCode();
                hashCode += 1000000093 * Magic.GetHashCode();
                hashCode += 1000000097 * Level.GetHashCode();
                hashCode += 1000000103 * Language.GetHashCode();
                hashCode += 1000000123 * Appearance.GetHashCode();
                hashCode += 1000000181 * Face.GetHashCode();
                hashCode += 1000000207 * InventoryPicture.GetHashCode();
                hashCode += 1000000223 * ActionPoints.GetHashCode();
                hashCode += 1000000241 * DialogueOptions.GetHashCode();
                hashCode += 1000000271 * ResponseOptions.GetHashCode();
                hashCode += 1000000289 * TrainingPoints.GetHashCode();
                hashCode += 1000000297 * Gold.GetHashCode();
                hashCode += 1000000321 * Rations.GetHashCode();
                hashCode += 1000000349 * Conditions.GetHashCode();
                hashCode += 1000000363 * Strength.GetHashCode();
                hashCode += 1000000403 * Intelligence.GetHashCode();
                hashCode += 1000000409 * Dexterity.GetHashCode();
                hashCode += 1000000411 * Speed.GetHashCode();
                hashCode += 1000000427 * Stamina.GetHashCode();
                hashCode += 1000000433 * Luck.GetHashCode();
                hashCode += 1000000439 * MagicResistance.GetHashCode();
                hashCode += 1000000447 * MagicTallent.GetHashCode();
                hashCode += 1000000453 * CloseRangeCombat.GetHashCode();
                hashCode += 1000000459 * LongRangeCombat.GetHashCode();
                hashCode += 1000000483 * CriticalHit.GetHashCode();
                hashCode += 1000000513 * Lockpicking.GetHashCode();
                hashCode += 1000000531 * LifePoints.GetHashCode();
                hashCode += 1000000579 * SpellPoints.GetHashCode();
                hashCode += 1000000007 * Age.GetHashCode();
                hashCode += 1000000009 * BaseProtection.GetHashCode();
                hashCode += 1000000021 * Protection.GetHashCode();
                hashCode += 1000000033 * BaseDamage.GetHashCode();
                hashCode += 1000000087 * Damage.GetHashCode();
                hashCode += 1000000093 * Experience.GetHashCode();
                if (Spells != null)
                {
                    hashCode += 1000000097 * Spells.GetHashCode();
                }
                if (Name != null)
                {
                    hashCode += 1000000103 * Name.GetHashCode();
                }
                if (SpellStrengths != null)
                {
                    hashCode += 1000000123 * SpellStrengths.GetHashCode();
                }
            }
            return(hashCode);
        }