Example #1
0
 public Weapon(WeaponTypes weaponType)
 {
     WeaponType = weaponType;
     Ammo       = new Setting(weaponType.ToString() + ".Ammo", SchemeLimits.GetWeaponSettingLimits(weaponType, WeaponSettings.Ammo));
     Power      = new Setting(weaponType.ToString() + ".Power", SchemeLimits.GetWeaponSettingLimits(weaponType, WeaponSettings.Power));
     Delay      = new Setting(weaponType.ToString() + ".Delay", SchemeLimits.GetWeaponSettingLimits(weaponType, WeaponSettings.Delay));
     Crate      = new Setting(weaponType.ToString() + ".Crate", SchemeLimits.GetWeaponSettingLimits(weaponType, WeaponSettings.Crate));
 }
Example #2
0
        public Scheme(SchemeVersion version, int extendedOptionsDataVersion = 0, bool setUpDefaults = true)
        {
            Version = version;

            Settings = new Setting[SchemeTypes.NumberOfNonWeaponSettings];
            for (int i = 0; i < Settings.Length; ++i)
            {
                SettingTypes settingType = (SettingTypes)i;
                Settings[i] = new Setting(settingType.ToString(), SchemeLimits.GetSettingLimits(settingType));
            }

            int weaponsCount = version >= SchemeVersion.Armageddon2 ? SchemeTypes.NumberOfWeapons : SchemeTypes.NumberOfNonSuperWeapons;

            Weapons = new Weapon[weaponsCount];
            for (int i = 0; i < Weapons.Length; ++i)
            {
                Weapons[i] = new Weapon((WeaponTypes)i);
            }

            if (version >= SchemeVersion.Armageddon3)
            {
                int optionsCount = SchemeTypes.GetExtendedOptionsSettingsCount(extendedOptionsDataVersion);
                ExtendedOptions = new Setting[optionsCount];
                for (int i = 0; i < ExtendedOptions.Length; ++i)
                {
                    ExtendedOptionTypes extendedOption = (ExtendedOptionTypes)i;
                    ExtendedOptions[i] = new Setting(extendedOption.ToString(), SchemeLimits.GetExtendedOptionLimits(extendedOption), SchemeTypes.GetExtendedOptionSettingSize(extendedOption));
                }

                Access(ExtendedOptionTypes.DataVersion).SetValue(extendedOptionsDataVersion);
            }

            Access(SettingTypes.Version).SetValue(SchemeTypes.GetSchemeVersionNumber(version));
            Access(SettingTypes.BountyMode).SetValue(SchemeGeneratorMagicNumber);

            if (setUpDefaults)
            {
                SetUpDefaults();
            }
        }