Beispiel #1
0
        protected Enemy(EnemyTypes type, EnemyConstants.EnemyProperties properties, string file, int x, int y, bool isSpawned) : base(file, true)
        {
            Initialize(type, properties, file);

            X = x;
            Y = y;
            IsSpawnedEnemy = isSpawned;
        }
Beispiel #2
0
 private void Initialize(EnemyTypes type, EnemyConstants.EnemyProperties properties, string file)
 {
     Type      = type;
     MaxHealth = Helpers.RandomInRange(properties.MinHealth, properties.MaxHealth) * DifficultyConstants.HealthFactor *
                 (1 + Level.CurrentLevel * GameplayConstants.HealthFactorPerLevel);
     Health         = MaxHealth;
     MaxMana        = Helpers.RandomInRange(properties.MinMana, properties.MaxMana) * DifficultyConstants.ManaFactor;
     Mana           = MaxMana;
     HealthRegen    = properties.HealthRegen * DifficultyConstants.HealthFactor * (1 + Level.CurrentLevel * GameplayConstants.HealthFactorPerLevel);
     ManaRegen      = properties.ManaRegen * DifficultyConstants.ManaFactor;
     BaseSpeed      = Helpers.RandomInRange(properties.MinSpeed, properties.MaxSpeed) * DifficultyConstants.SpeedFactor;
     CriticalChance = properties.CritChance;
 }
Beispiel #3
0
        protected Enemy(EnemyTypes type, EnemyConstants.EnemyProperties properties, string file, MapSection mapSection) : base(file, true)
        {
            Initialize(type, properties, file);

            if (mapSection == null)
            {
                // Find a random zerd to spawn near
                var zerdTarget = Globals.GameState.Zerds.RandomElement();
                mapSection     = Globals.Map.GetSection(zerdTarget);
                IsSpawnedEnemy = true;
            }

            var spawn = mapSection.GetSpawnSpot(this);

            X = spawn.X;
            Y = spawn.Y;
        }