Exemple #1
0
        private bool isDefaultValue(ExtendedVariantsModule.Variant variant)
        {
            AbstractExtendedVariant variantHandler = ExtendedVariantsModule.Instance.VariantHandlers[variant];

            return(variantHandler.GetValue() == variantHandler.GetDefaultValue());
        }
        /// <summary>
        /// Sets a variant value.
        /// </summary>
        /// <param name="variantChange">The variant to change</param>
        /// <param name="newValue">The new value</param>
        /// <returns>The old value for this variant</returns>
        private int setVariantValue(ExtendedVariantsModule.Variant variantChange, int newValue, out int actualNewValue)
        {
            int oldValue;

            switch (variantChange)
            {
            case ExtendedVariantsModule.Variant.ChaserCount:
                oldValue = ExtendedVariantsModule.Settings.ChaserCount;
                ExtendedVariantsModule.Settings.ChaserCount = newValue;
                actualNewValue = newValue;
                break;

            case ExtendedVariantsModule.Variant.AffectExistingChasers:
                oldValue = ExtendedVariantsModule.Settings.AffectExistingChasers ? 1 : 0;
                ExtendedVariantsModule.Settings.AffectExistingChasers = (newValue != 0);
                actualNewValue = (newValue != 0 ? 1 : 0);
                break;

            case ExtendedVariantsModule.Variant.RefillJumpsOnDashRefill:
                oldValue = ExtendedVariantsModule.Settings.RefillJumpsOnDashRefill ? 1 : 0;
                ExtendedVariantsModule.Settings.RefillJumpsOnDashRefill = (newValue != 0);
                actualNewValue = (newValue != 0 ? 1 : 0);
                break;

            case ExtendedVariantsModule.Variant.HiccupStrength:
                oldValue = ExtendedVariantsModule.Settings.HiccupStrength;
                ExtendedVariantsModule.Settings.HiccupStrength = newValue;
                actualNewValue = newValue;
                break;

            case ExtendedVariantsModule.Variant.SnowballDelay:
                oldValue = ExtendedVariantsModule.Settings.SnowballDelay;
                ExtendedVariantsModule.Settings.SnowballDelay = newValue;
                actualNewValue = newValue;
                break;

            case ExtendedVariantsModule.Variant.BadelineLag:
                oldValue = ExtendedVariantsModule.Settings.BadelineLag;
                ExtendedVariantsModule.Settings.BadelineLag = newValue;
                actualNewValue = newValue;
                break;

            case ExtendedVariantsModule.Variant.DelayBetweenBadelines:
                oldValue = ExtendedVariantsModule.Settings.DelayBetweenBadelines;
                ExtendedVariantsModule.Settings.DelayBetweenBadelines = newValue;
                actualNewValue = newValue;
                break;

            case ExtendedVariantsModule.Variant.OshiroCount:
                oldValue = ExtendedVariantsModule.Settings.OshiroCount;
                ExtendedVariantsModule.Settings.OshiroCount = newValue;
                actualNewValue = newValue;
                break;

            case ExtendedVariantsModule.Variant.ReverseOshiroCount:
                oldValue = ExtendedVariantsModule.Settings.ReverseOshiroCount;
                ExtendedVariantsModule.Settings.ReverseOshiroCount = newValue;
                actualNewValue = newValue;
                break;

            case ExtendedVariantsModule.Variant.DisableOshiroSlowdown:
                oldValue = ExtendedVariantsModule.Settings.DisableOshiroSlowdown ? 1 : 0;
                ExtendedVariantsModule.Settings.DisableOshiroSlowdown = (newValue != 0);
                actualNewValue = (newValue != 0 ? 1 : 0);
                break;

            case ExtendedVariantsModule.Variant.DisableSeekerSlowdown:
                oldValue = ExtendedVariantsModule.Settings.DisableSeekerSlowdown ? 1 : 0;
                ExtendedVariantsModule.Settings.DisableSeekerSlowdown = (newValue != 0);
                actualNewValue = (newValue != 0 ? 1 : 0);
                break;

            case ExtendedVariantsModule.Variant.BadelineAttackPattern:
                oldValue = ExtendedVariantsModule.Settings.BadelineAttackPattern;
                ExtendedVariantsModule.Settings.BadelineAttackPattern = newValue;
                actualNewValue = newValue;
                break;

            case ExtendedVariantsModule.Variant.ChangePatternsOfExistingBosses:
                oldValue = ExtendedVariantsModule.Settings.ChangePatternsOfExistingBosses ? 1 : 0;
                ExtendedVariantsModule.Settings.ChangePatternsOfExistingBosses = (newValue != 0);
                actualNewValue = (newValue != 0 ? 1 : 0);
                break;

            case ExtendedVariantsModule.Variant.FirstBadelineSpawnRandom:
                oldValue = ExtendedVariantsModule.Settings.FirstBadelineSpawnRandom ? 1 : 0;
                ExtendedVariantsModule.Settings.FirstBadelineSpawnRandom = (newValue != 0);
                actualNewValue = (newValue != 0 ? 1 : 0);
                break;

            case ExtendedVariantsModule.Variant.BadelineBossCount:
                oldValue = ExtendedVariantsModule.Settings.BadelineBossCount;
                ExtendedVariantsModule.Settings.BadelineBossCount = newValue;
                actualNewValue = newValue;
                break;

            case ExtendedVariantsModule.Variant.BadelineBossNodeCount:
                oldValue = ExtendedVariantsModule.Settings.BadelineBossNodeCount;
                ExtendedVariantsModule.Settings.BadelineBossNodeCount = newValue;
                actualNewValue = newValue;
                break;

            case ExtendedVariantsModule.Variant.RisingLavaSpeed:
                oldValue = ExtendedVariantsModule.Settings.RisingLavaSpeed;
                ExtendedVariantsModule.Settings.RisingLavaSpeed = newValue;
                actualNewValue = newValue;
                break;

            case ExtendedVariantsModule.Variant.AllowThrowingTheoOffscreen:
                oldValue = ExtendedVariantsModule.Settings.AllowThrowingTheoOffscreen ? 1 : 0;
                ExtendedVariantsModule.Settings.AllowThrowingTheoOffscreen = (newValue != 0);
                actualNewValue = (newValue != 0 ? 1 : 0);
                break;

            case ExtendedVariantsModule.Variant.AllowLeavingTheoBehind:
                oldValue = ExtendedVariantsModule.Settings.AllowLeavingTheoBehind ? 1 : 0;
                ExtendedVariantsModule.Settings.AllowLeavingTheoBehind = (newValue != 0);
                actualNewValue = (newValue != 0 ? 1 : 0);
                break;

            default:
                AbstractExtendedVariant variant = ExtendedVariantsModule.Instance.VariantHandlers[variantChange];
                oldValue = variant.GetValue();
                variant.SetValue(newValue);
                actualNewValue = variant.GetValue();
                break;
            }

            return(oldValue);
        }