Beispiel #1
0
        public AttributeConverters()
        {
            ToPercentAttributeFormatter formatter  = new ToPercentAttributeFormatter(1f, GameUtil.TimeSlice.None);
            StandardAttributeFormatter  formatter2 = new StandardAttributeFormatter(GameUtil.UnitClass.Mass, GameUtil.TimeSlice.None);

            MovementSpeed           = Create("MovementSpeed", "Movement Speed", DUPLICANTS.ATTRIBUTES.ATHLETICS.SPEEDMODIFIER, Db.Get().Attributes.Athletics, 0.1f, 0f, formatter);
            ConstructionSpeed       = Create("ConstructionSpeed", "Construction Speed", DUPLICANTS.ATTRIBUTES.CONSTRUCTION.SPEEDMODIFIER, Db.Get().Attributes.Construction, 0.25f, 0f, formatter);
            DiggingSpeed            = Create("DiggingSpeed", "Digging Speed", DUPLICANTS.ATTRIBUTES.DIGGING.SPEEDMODIFIER, Db.Get().Attributes.Digging, 0.25f, 0f, formatter);
            MachinerySpeed          = Create("MachinerySpeed", "Machinery Speed", DUPLICANTS.ATTRIBUTES.MACHINERY.SPEEDMODIFIER, Db.Get().Attributes.Machinery, 0.1f, 0f, formatter);
            HarvestSpeed            = Create("HarvestSpeed", "Harvest Speed", DUPLICANTS.ATTRIBUTES.BOTANIST.HARVEST_SPEED_MODIFIER, Db.Get().Attributes.Botanist, 0.05f, 0f, formatter);
            PlantTendSpeed          = Create("PlantTendSpeed", "Plant Tend Speed", DUPLICANTS.ATTRIBUTES.BOTANIST.TINKER_MODIFIER, Db.Get().Attributes.Botanist, 0.025f, 0f, formatter);
            CompoundingSpeed        = Create("CompoundingSpeed", "Compounding Speed", DUPLICANTS.ATTRIBUTES.CARING.FABRICATE_SPEEDMODIFIER, Db.Get().Attributes.Caring, 0.1f, 0f, formatter);
            ResearchSpeed           = Create("ResearchSpeed", "Research Speed", DUPLICANTS.ATTRIBUTES.LEARNING.RESEARCHSPEED, Db.Get().Attributes.Learning, 0.4f, 0f, formatter);
            TrainingSpeed           = Create("TrainingSpeed", "Training Speed", DUPLICANTS.ATTRIBUTES.LEARNING.SPEEDMODIFIER, Db.Get().Attributes.Learning, 0.1f, 0f, formatter);
            CookingSpeed            = Create("CookingSpeed", "Cooking Speed", DUPLICANTS.ATTRIBUTES.COOKING.SPEEDMODIFIER, Db.Get().Attributes.Cooking, 0.05f, 0f, formatter);
            ArtSpeed                = Create("ArtSpeed", "Art Speed", DUPLICANTS.ATTRIBUTES.ART.SPEEDMODIFIER, Db.Get().Attributes.Art, 0.1f, 0f, formatter);
            DoctorSpeed             = Create("DoctorSpeed", "Doctor Speed", DUPLICANTS.ATTRIBUTES.CARING.SPEEDMODIFIER, Db.Get().Attributes.Caring, 0.2f, 0f, formatter);
            TidyingSpeed            = Create("TidyingSpeed", "Tidying Speed", DUPLICANTS.ATTRIBUTES.STRENGTH.SPEEDMODIFIER, Db.Get().Attributes.Strength, 0.25f, 0f, formatter);
            AttackDamage            = Create("AttackDamage", "Attack Damage", DUPLICANTS.ATTRIBUTES.DIGGING.ATTACK_MODIFIER, Db.Get().Attributes.Digging, 0.05f, 0f, formatter);
            ImmuneLevelBoost        = Create("ImmuneLevelBoost", "Immune Level Boost", DUPLICANTS.ATTRIBUTES.IMMUNITY.BOOST_MODIFIER, Db.Get().Attributes.Immunity, 0.00166666671f, 0f, new ToPercentAttributeFormatter(100f, GameUtil.TimeSlice.PerCycle));
            ToiletSpeed             = Create("ToiletSpeed", "Toilet Speed", string.Empty, Db.Get().Attributes.ToiletEfficiency, 1f, -1f, formatter);
            CarryAmountFromStrength = Create("CarryAmountFromStrength", "Carry Amount", DUPLICANTS.ATTRIBUTES.STRENGTH.CARRYMODIFIER, Db.Get().Attributes.Strength, 40f, 0f, formatter2);
            TemperatureInsulation   = Create("TemperatureInsulation", "Temperature Insulation", DUPLICANTS.ATTRIBUTES.INSULATION.SPEEDMODIFIER, Db.Get().Attributes.Insulation, 0.1f, 0f, formatter);
            SeedHarvestChance       = Create("SeedHarvestChance", "Seed Harvest Chance", DUPLICANTS.ATTRIBUTES.BOTANIST.BONUS_SEEDS, Db.Get().Attributes.Botanist, 0.033f, 0f, formatter);
            RanchingEffectDuration  = Create("RanchingEffectDuration", "Ranching Effect Duration", DUPLICANTS.ATTRIBUTES.RANCHING.EFFECTMODIFIER, Db.Get().Attributes.Ranching, 0.1f, 0f, formatter);
        }
        private static void AddBuildingsAndModifier()
        {
            Utils.AddBuildingToPlanScreen("Equipment", FishingStationConfig.ID, ShearingStationConfig.ID);
            Utils.AddBuildingToPlanScreen("Equipment", ButcherStationConfig.ID, ShearingStationConfig.ID);
            Utils.AddBuildingToTechnology("AnimalControl", ButcherStationConfig.ID, FishingStationConfig.ID);

            var formatter = new ToPercentAttributeFormatter(1f, GameUtil.TimeSlice.None);

            RanchingEffectExtraMeat = Db.Get().AttributeConverters.Create(
                id: "RanchingEffectExtraMeat",
                name: "Ranching Effect Extra Meat",
                description: STRINGS.DUPLICANTS.ATTRIBUTES.RANCHING.EFFECTEXTRAMEATMODIFIER,
                attribute: Db.Get().Attributes.Ranching,
                multiplier: ButcherStationOptions.Instance.extra_meat_per_ranching_attribute / 100f,
                base_value: 0f,
                formatter: formatter,
                available_dlcs: DlcManager.AVAILABLE_ALL_VERSIONS);

            RoomsExpandedCompat();
        }
        internal static void Init()
        {
            var db = Db.Get();
            var effectFarmTinker = db.effects.Get(FARM_TINKER_EFFECT_ID);
            var toPercent        = new ToPercentAttributeFormatter(1f);

            ColdBreatherThroughput = new Attribute(
                id: nameof(ColdBreatherThroughput),
                is_trainable: false,
                show_in_ui: Attribute.Display.General,
                is_profession: false,
                base_value: 0);
            ColdBreatherThroughput.SetFormatter(toPercent);
            db.Attributes.Add(ColdBreatherThroughput);

            ColdBreatherThroughputBaseValue = new AttributeModifier(
                attribute_id: ColdBreatherThroughput.Id,
                value: THROUGHPUT_BASE_VALUE);

            ColdBreatherThroughputFarmTinkerModifier = new AttributeModifier(
                attribute_id: ColdBreatherThroughput.Id,
                value: THROUGHPUT_MODIFIER_FARMTINKER,
                is_multiplier: true,
                is_readonly: false);
            effectFarmTinker.Add(ColdBreatherThroughputFarmTinkerModifier);

            OxyfernThroughput = new Attribute(
                id: nameof(OxyfernThroughput),
                is_trainable: false,
                show_in_ui: Attribute.Display.General,
                is_profession: false,
                base_value: 0);
            OxyfernThroughput.SetFormatter(toPercent);
            db.Attributes.Add(OxyfernThroughput);

            OxyfernThroughputBaseValue = new AttributeModifier(
                attribute_id: OxyfernThroughput.Id,
                value: THROUGHPUT_BASE_VALUE);

            OxyfernThroughputFarmTinkerModifier = new AttributeModifier(
                attribute_id: OxyfernThroughput.Id,
                value: THROUGHPUT_MODIFIER_FARMTINKER,
                is_multiplier: true,
                is_readonly: false);
            effectFarmTinker.Add(OxyfernThroughputFarmTinkerModifier);

            ExtraSeedChance = new Attribute(
                id: nameof(ExtraSeedChance),
                is_trainable: false,
                show_in_ui: Attribute.Display.General,
                is_profession: false,
                base_value: 0);
            ExtraSeedChance.SetFormatter(toPercent);
            db.Attributes.Add(ExtraSeedChance);

            ExtraSeedChanceDecorativeBaseValue = new AttributeModifier(
                attribute_id: ExtraSeedChance.Id,
                value: EXTRA_SEED_CHANCE_BASE_VALUE_DECORATIVE,
                is_readonly: false);

            ExtraSeedChanceNotDecorativeBaseValue = new AttributeModifier(
                attribute_id: ExtraSeedChance.Id,
                value: EXTRA_SEED_CHANCE_BASE_VALUE_NOT_DECORATIVE,
                is_readonly: false);

            // todo: добавить текстовку и отрегулировать
            ExtraSeedTendingChance = db.AttributeConverters.Create(
                id: nameof(ExtraSeedTendingChance),
                name: "Seed Tending Chance",
                description: DUPLICANTS.ATTRIBUTES.BOTANIST.BONUS_SEEDS,
                attribute: db.Attributes.Botanist,
                multiplier: EXTRA_SEED_CHANCE_PER_BOTANIST_SKILL,
                base_value: 0f,
                formatter: toPercent);

#if EXPANSION1
            // модификаторы для жучинкусов
            var effectDivergentCropTended = db.effects.Get(DIVERGENT_CROP_TENDED_EFFECT_ID);
            var effectWormCropTended      = db.effects.Get(DIVERGENT_CROP_TENDED_WORM_EFFECT_ID);

            ColdBreatherThroughputDivergentModifier = new AttributeModifier(
                attribute_id: ColdBreatherThroughput.Id,
                value: THROUGHPUT_MODIFIER_DIVERGENT,
                is_multiplier: true,
                is_readonly: false);
            effectDivergentCropTended.Add(ColdBreatherThroughputDivergentModifier);

            ColdBreatherThroughputWormModifier = new AttributeModifier(
                attribute_id: ColdBreatherThroughput.Id,
                value: THROUGHPUT_MODIFIER_WORM,
                is_multiplier: true,
                is_readonly: false);
            effectWormCropTended.Add(ColdBreatherThroughputWormModifier);

            OxyfernThroughputDivergentModifier = new AttributeModifier(
                attribute_id: OxyfernThroughput.Id,
                value: THROUGHPUT_MODIFIER_DIVERGENT,
                is_multiplier: true,
                is_readonly: false);
            effectDivergentCropTended.Add(OxyfernThroughputDivergentModifier);

            OxyfernThroughputWormModifier = new AttributeModifier(
                attribute_id: OxyfernThroughput.Id,
                value: THROUGHPUT_MODIFIER_WORM,
                is_multiplier: true,
                is_readonly: false);
            effectWormCropTended.Add(OxyfernThroughputWormModifier);

            ExtraSeedChanceDivergentModifier = new AttributeModifier(
                attribute_id: ExtraSeedChance.Id,
                value: EXTRA_SEED_CHANCE_MODIFIER_DIVERGENT,
                is_readonly: false);
            effectDivergentCropTended.Add(ExtraSeedChanceDivergentModifier);

            ExtraSeedChanceWormModifier = new AttributeModifier(
                attribute_id: ExtraSeedChance.Id,
                value: EXTRA_SEED_CHANCE_MODIFIER_WORM,
                is_readonly: false);
            effectWormCropTended.Add(ExtraSeedChanceWormModifier);
#endif
        }
Beispiel #4
0
            public static void Postfix(ref Db __instance)
            {
                ToPercentAttributeFormatter formatter = new ToPercentAttributeFormatter(1f, GameUtil.TimeSlice.None);

                RanchingEffectExtraMeat = __instance.AttributeConverters.Create("RanchingEffectExtraMeat", "Ranching Effect Extra Meat", STRINGS.DUPLICANTS.ATTRIBUTES.RANCHING.EFFECTEXTRAMEATMODIFIER, Db.Get().Attributes.Ranching, Config.Get().EXTRAMEATPERRANCHINGATTRIBUTE, 0f, formatter);
            }