예제 #1
0
            public static void Postfix()
            {
                Trait trait = Db.Get().CreateTrait(
                    id: SweepyStrings.CustomTraitName,
                    name: ROBOTS.MODELS.SWEEPBOT.NAME,
                    description: ROBOTS.MODELS.SWEEPBOT.NAME,
                    group_name: null,
                    should_save: false,
                    disabled_chore_groups: (ChoreGroup[])null,
                    positive_trait: true,
                    is_valid_starter_trait: true
                    );

                trait.Add(new AttributeModifier(
                              attribute_id: Db.Get().Amounts.InternalBattery.maxAttribute.Id,
                              value: SweepyConfigChecker.BatteryCapacity,
                              description: ROBOTS.MODELS.SWEEPBOT.NAME,
                              is_multiplier: false,
                              uiOnly: false,
                              is_readonly: false
                              ));

                float battery_rate = SweepyConfigChecker.BatteryDrainBasedOnSpeed ? SweepyConfigChecker.BatteryDepletionRate * SweepyConfigChecker.BaseMovementSpeed * SweepyConfigChecker.DrainSpeedMultiplier : SweepyConfigChecker.BatteryDepletionRate;

                battery_rate = !SweepyConfigChecker.SweepyUsesPower ? 0 : battery_rate;
                trait.Add(new AttributeModifier(
                              attribute_id: Db.Get().Amounts.InternalBattery.deltaAttribute.Id,
                              value: -battery_rate,
                              description: ROBOTS.MODELS.SWEEPBOT.NAME,
                              is_multiplier: false,
                              uiOnly: false,
                              is_readonly: false
                              ));
            }
    public static GameObject CreateMoo(string id, string name, string desc, string anim_file, bool is_baby)
    {
        GameObject gameObject = BaseMooConfig.BaseMoo(id, name, CREATURES.SPECIES.MOO.DESC, "MooBaseTrait", anim_file, is_baby, null);

        EntityTemplates.ExtendEntityToWildCreature(gameObject, MooTuning.PEN_SIZE_PER_CREATURE, 75f);
        Trait trait = Db.Get().CreateTrait("MooBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, MooTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - MooTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 75f, name, false, false, true));
        HashSet <Tag> hashSet = new HashSet <Tag>();

        hashSet.Add("GasGrass".ToTag());
        Diet.Info[] infos = new Diet.Info[1]
        {
            new Diet.Info(hashSet, POOP_ELEMENT, CALORIES_PER_DAY_OF_PLANT_EATEN, KG_POOP_PER_DAY_OF_PLANT, null, 0f, false, false)
        };
        Diet diet = new Diet(infos);

        CreatureCalorieMonitor.Def def = gameObject.AddOrGetDef <CreatureCalorieMonitor.Def>();
        def.diet = diet;
        def.minPoopSizeInCalories = MIN_POOP_SIZE_IN_CALORIES;
        SolidConsumerMonitor.Def def2 = gameObject.AddOrGetDef <SolidConsumerMonitor.Def>();
        def2.diet = diet;
        return(gameObject);
    }
    public static GameObject CreatePuftAlpha(string id, string name, string desc, string anim_file, bool is_baby)
    {
        string     symbol_override_prefix = "alp_";
        GameObject prefab = BasePuftConfig.BasePuft(id, name, desc, "PuftAlphaBaseTrait", anim_file, is_baby, symbol_override_prefix, 258.15f, 338.15f);

        EntityTemplates.ExtendEntityToWildCreature(prefab, PuftTuning.PEN_SIZE_PER_CREATURE, 75f);
        Trait trait = Db.Get().CreateTrait("PuftAlphaBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, PuftTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - PuftTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 75f, name, false, false, true));
        List <Diet.Info> list = new List <Diet.Info>();

        list.Add(new Diet.Info(new HashSet <Tag>(new Tag[1]
        {
            SimHashes.ContaminatedOxygen.CreateTag()
        }), SimHashes.SlimeMold.CreateTag(), CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.BAD_2, "SlimeLung", 1000f, false, false));
        list.Add(new Diet.Info(new HashSet <Tag>(new Tag[1]
        {
            SimHashes.ChlorineGas.CreateTag()
        }), SimHashes.BleachStone.CreateTag(), CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.BAD_2, "SlimeLung", 1000f, false, false));
        list.Add(new Diet.Info(new HashSet <Tag>(new Tag[1]
        {
            SimHashes.Oxygen.CreateTag()
        }), SimHashes.OxyRock.CreateTag(), CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.BAD_2, "SlimeLung", 1000f, false, false));
        prefab = BasePuftConfig.SetupDiet(prefab, list.ToArray(), CALORIES_PER_KG_OF_ORE, MIN_POOP_SIZE_IN_KG);
        DiseaseSourceVisualizer diseaseSourceVisualizer = prefab.AddOrGet <DiseaseSourceVisualizer>();

        diseaseSourceVisualizer.alwaysShowDisease = "SlimeLung";
        return(prefab);
    }
예제 #4
0
        public const float warningHighTemperature = 873.15f; //303.15f;
        public static GameObject CreatePuft(
            string id,
            string name,
            string desc,
            string anim_file,
            bool is_baby)
        {
            GameObject wildCreature = EntityTemplates.ExtendEntityToWildCreature(BasePuftConfig.BasePuft(id, name, desc, BASE_TRAIT_ID, anim_file, is_baby, "",
                                                                                                         warningLowTemperature, warningHighTemperature), PuftTuning.PEN_SIZE_PER_CREATURE);
            Trait trait = Db.Get().CreateTrait(BASE_TRAIT_ID, name, name, (string)null, false, (ChoreGroup[])null, true, true);

            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, PuftTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (float)(-(double)PuftTuning.STANDARD_CALORIES_PER_CYCLE / 600.0), name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 75f, name, false, false, true));
            GameObject go = BasePuftConfig.SetupDiet(wildCreature, CONSUME_ELEMENT.CreateTag(), EMIT_ELEMENT.CreateTag(),
                                                     DevilPuftConfig.CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.GOOD_2, (string)null, 0.0f,
                                                     DevilPuftConfig.MIN_POOP_SIZE_IN_KG);

            go.AddOrGetDef <LureableMonitor.Def>().lures = new Tag[1]
            {
                SimHashes.Sulfur.CreateTag()
            };
            return(go);
        }
    public static GameObject CreateDrecko(string id, string name, string desc, string anim_file, bool is_baby)
    {
        GameObject prefab = BaseDreckoConfig.BaseDrecko(id, name, desc, anim_file, "DreckoBaseTrait", is_baby, "fbr_", 308.15f, 363.15f);

        prefab = EntityTemplates.ExtendEntityToWildCreature(prefab, DreckoTuning.PEN_SIZE_PER_CREATURE, 150f);
        Trait trait = Db.Get().CreateTrait("DreckoBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, DreckoTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - DreckoTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 150f, name, false, false, true));
        HashSet <Tag> hashSet = new HashSet <Tag>();

        hashSet.Add("SpiceVine".ToTag());
        hashSet.Add(SwampLilyConfig.ID.ToTag());
        hashSet.Add("BasicSingleHarvestPlant".ToTag());
        Diet.Info[] infos = new Diet.Info[1]
        {
            new Diet.Info(hashSet, POOP_ELEMENT, CALORIES_PER_DAY_OF_PLANT_EATEN, KG_POOP_PER_DAY_OF_PLANT, null, 0f, false, true)
        };
        Diet diet = new Diet(infos);

        CreatureCalorieMonitor.Def def = prefab.AddOrGetDef <CreatureCalorieMonitor.Def>();
        def.diet = diet;
        def.minPoopSizeInCalories = MIN_POOP_SIZE_IN_CALORIES;
        SolidConsumerMonitor.Def def2 = prefab.AddOrGetDef <SolidConsumerMonitor.Def>();
        def2.diet = diet;
        ScaleGrowthMonitor.Def def3 = prefab.AddOrGetDef <ScaleGrowthMonitor.Def>();
        def3.defaultGrowthRate  = 1f / SCALE_GROWTH_TIME_IN_CYCLES / 600f;
        def3.dropMass           = FIBER_PER_CYCLE * SCALE_GROWTH_TIME_IN_CYCLES;
        def3.itemDroppedOnShear = EMIT_ELEMENT;
        def3.levelCount         = 6;
        def3.targetAtmosphere   = SimHashes.Hydrogen;
        return(prefab);
    }
        public static GameObject CreateOilfloater(string id, string name, string desc, string anim_file, bool is_baby)
        {
            GameObject prefab = BaseOilFloaterConfig.BaseOilFloater(id, name, desc, anim_file, BASE_TRAIT_ID, 523.15f, 743.15f, is_baby, variantSprite);

            EntityTemplates.ExtendEntityToWildCreature(prefab, OilFloaterTuning.PEN_SIZE_PER_CREATURE);
            int count = (int)prefab.AddOrGet <PrimaryElement>().Mass;

            string[] loot = new string[count];
            for (int i = 0; i < count; i++)
            {
                loot[i] = "Steel";
            }
            prefab.AddOrGet <Butcherable>().SetDrops(loot);

            DiseaseDropper.Def def = prefab.AddOrGetDef <DiseaseDropper.Def>();
            def.diseaseIdx           = Db.Get().Diseases.GetIndex(Db.Get().Diseases.ZombieSpores.id);
            def.emitFrequency        = 1f;
            def.averageEmitPerSecond = 200;
            def.singleEmitQuantity   = 10000;


            Trait trait = Db.Get().CreateTrait(BASE_TRAIT_ID, name, name, null, false, null, true, true);

            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, OilFloaterTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, -OilFloaterTuning.STANDARD_CALORIES_PER_CYCLE / 600f, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, HITPOINTS.TIER1, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, LIFESPAN.TIER3, name, false, false, true));
            List <Diet.Info> diet_infos = DietInfo(GameTags.Steel, CALORIES_PER_KG_OF_ORE, CONVERSION_EFFICIENCY.GOOD_1, null, 0f);

            return(OilFloaters.SetupDiet(prefab, diet_infos, CALORIES_PER_KG_OF_ORE, MIN_POOP_SIZE_IN_KG, 5 * Patches.Settings.ConsumptionMultiplier));
        }
    public static GameObject CreateMole(string id, string name, string desc, string anim_file, bool is_baby = false)
    {
        GameObject gameObject = BaseMoleConfig.BaseMole(id, name, STRINGS.CREATURES.SPECIES.MOLE.DESC, "MoleBaseTrait", anim_file, is_baby);

        gameObject.AddTag(GameTags.Creatures.Digger);
        EntityTemplates.ExtendEntityToWildCreature(gameObject, MoleTuning.PEN_SIZE_PER_CREATURE, 100f);
        Trait trait = Db.Get().CreateTrait("MoleBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, MoleTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - MoleTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 100f, name, false, false, true));
        List <Tag> list = new List <Tag>();

        list.Add(SimHashes.Regolith.CreateTag());
        list.Add(SimHashes.Dirt.CreateTag());
        list.Add(SimHashes.IronOre.CreateTag());
        List <Diet.Info> list2 = BaseMoleConfig.SimpleOreDiet(list, CALORIES_PER_KG_OF_DIRT, TUNING.CREATURES.CONVERSION_EFFICIENCY.NORMAL);
        Diet             diet  = new Diet(list2.ToArray());

        CreatureCalorieMonitor.Def def = gameObject.AddOrGetDef <CreatureCalorieMonitor.Def>();
        def.diet = diet;
        def.minPoopSizeInCalories = MIN_POOP_SIZE_IN_CALORIES;
        SolidConsumerMonitor.Def def2 = gameObject.AddOrGetDef <SolidConsumerMonitor.Def>();
        def2.diet = diet;
        OvercrowdingMonitor.Def def3 = gameObject.AddOrGetDef <OvercrowdingMonitor.Def>();
        def3.spaceRequiredPerCreature = 0;
        gameObject.AddOrGet <LoopingSounds>();
        return(gameObject);
    }
        public static GameObject CreateSteelRollerSnake(string id, string name, string desc, string anim_file, bool is_baby)
        {
            GameObject wildCreature = EntityTemplates.ExtendEntityToWildCreature(BaseRollerSnakeConfig.BaseRollerSnake(id, name, desc, anim_file, BaseTraitId, is_baby, "blu_"), RollerSnakeTuning.PEN_SIZE_PER_CREATURE, Lifespan);

            Trait trait = Db.Get().CreateTrait(BaseTraitId, name, name, null, false, null, true, true);

            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, RollerSnakeTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (float)(-RollerSnakeTuning.STANDARD_CALORIES_PER_CYCLE / 600.0), name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, Hitpoints, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, Lifespan, name, false, false, true));

            List <Diet.Info> diet_infos = BaseRollerSnakeConfig.BasicRockDiet(
                SimHashes.Carbon.CreateTag(),
                CaloriesPerKg,
                ProducedConversionRate, null, 0.0f);

            BaseRollerSnakeConfig.SetupDiet(wildCreature, diet_infos, CaloriesPerKg, MinPoopSizeInKg);

            ScaleGrowthMonitor.Def scale_monitor = wildCreature.AddOrGetDef <ScaleGrowthMonitor.Def>();
            scale_monitor.defaultGrowthRate  = (float)(1.0 / ScaleGrowthTimeCycles / 600.0);
            scale_monitor.dropMass           = SteelPerCycle * ScaleGrowthTimeCycles;
            scale_monitor.itemDroppedOnShear = EmitElement;
            scale_monitor.levelCount         = 2;
            scale_monitor.targetAtmosphere   = SimHashes.CarbonDioxide;

            return(wildCreature);
        }
    public static GameObject CreateLightBug(string id, string name, string desc, string anim_file, bool is_baby)
    {
        GameObject prefab = BaseLightBugConfig.BaseLightBug(id, name, desc, anim_file, "LightBugBlueBaseTrait", LIGHT2D.LIGHTBUG_COLOR_BLUE, DECOR.BONUS.TIER6, is_baby, "blu_");

        EntityTemplates.ExtendEntityToWildCreature(prefab, LightBugTuning.PEN_SIZE_PER_CREATURE, 25f);
        Trait trait = Db.Get().CreateTrait("LightBugBlueBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, LightBugTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - LightBugTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 5f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 25f, name, false, false, true));
        HashSet <Tag> hashSet = new HashSet <Tag>();

        hashSet.Add(TagManager.Create("SpiceBread"));
        hashSet.Add(TagManager.Create("Salsa"));
        hashSet.Add(SimHashes.Phosphorite.CreateTag());
        hashSet.Add(SimHashes.Phosphorus.CreateTag());
        prefab = BaseLightBugConfig.SetupDiet(prefab, hashSet, Tag.Invalid, CALORIES_PER_KG_OF_ORE);
        LureableMonitor.Def def = prefab.AddOrGetDef <LureableMonitor.Def>();
        def.lures = new Tag[2]
        {
            SimHashes.Phosphorite.CreateTag(),
                SimHashes.Phosphorus.CreateTag()
        };
        return(prefab);
    }
예제 #10
0
        public static Trait CreateTrait(string name)
        {
            Trait trait = Db.Get().CreateTrait(BASE_TRAIT_ID, name, name, (string)null, false, (ChoreGroup[])null, true, true);

            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, SquirrelTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (float)(-(double)SquirrelTuning.STANDARD_CALORIES_PER_CYCLE / 600.0), name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, Hitpoints, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, MaxAge, name, false, false, true));
            return(trait);
        }
예제 #11
0
        public static Trait CreateTrait(string name)
        {
            Trait trait = Db.Get().CreateTrait(BaseTraitId, name, name, null, false, null, true, true);

            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, HatchTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (float)(-HatchTuning.STANDARD_CALORIES_PER_CYCLE / 600.0), name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, Hitpoints, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, MaxAge, name, false, false, true));
            return(trait);
        }
예제 #12
0
    public static GameObject CreateOilFloater(string id, string name, string desc, string anim_file, bool is_baby)
    {
        GameObject prefab = BaseOilFloaterConfig.BaseOilFloater(id, name, desc, anim_file, "OilfloaterBaseTrait", 323.15f, 413.15f, is_baby, null);

        EntityTemplates.ExtendEntityToWildCreature(prefab, OilFloaterTuning.PEN_SIZE_PER_CREATURE, 100f);
        Trait trait = Db.Get().CreateTrait("OilfloaterBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, OilFloaterTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - OilFloaterTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 100f, name, false, false, true));
        return(BaseOilFloaterConfig.SetupDiet(prefab, SimHashes.CarbonDioxide.CreateTag(), SimHashes.CrudeOil.CreateTag(), CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.NORMAL, null, 0f, MIN_POOP_SIZE_IN_KG));
    }
예제 #13
0
        public static GameObject CreateOilFloater(string id, string name, string desc, string anim_file, bool is_baby)
        {
            GameObject prefab = BaseOilFloaterConfig.BaseOilFloater(id, name, desc, anim_file, BASE_TRAIT_ID, 263.15f, 313.15f, is_baby, variantSprite);

            EntityTemplates.ExtendEntityToWildCreature(prefab, CREATURES.SPACE_REQUIREMENTS.TIER4);
            Trait trait = Db.Get().CreateTrait(BASE_TRAIT_ID, name, name, null, false, null, true, true);

            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, OilFloaterTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, -OilFloaterTuning.STANDARD_CALORIES_PER_CYCLE / 600f, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, HITPOINTS.TIER1, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, LIFESPAN.TIER2, name, false, false, true));
            return(BaseOilFloaterConfig.SetupDiet(prefab, CONSUME_ELEMENT.CreateTag(), EMIT_ELEMENT.CreateTag(), CALORIES_PER_KG_OF_ORE, PHO_TUNING.CONVERSION_EFFICIENCY.NORMAL_LOW, null, 0f, MIN_POOP_SIZE_IN_KG));
        }
예제 #14
0
    public static GameObject CreateOilFloater(string id, string name, string desc, string anim_file, bool is_baby)
    {
        GameObject    gameObject    = BaseOilFloaterConfig.BaseOilFloater(id, name, desc, anim_file, "OilfloaterDecorBaseTrait", 283.15f, 343.15f, is_baby, "oxy_");
        DecorProvider decorProvider = gameObject.AddOrGet <DecorProvider>();

        decorProvider.SetValues(DECOR.BONUS.TIER6);
        EntityTemplates.ExtendEntityToWildCreature(gameObject, OilFloaterTuning.PEN_SIZE_PER_CREATURE, 150f);
        Trait trait = Db.Get().CreateTrait("OilfloaterDecorBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, OilFloaterTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - OilFloaterTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 150f, name, false, false, true));
        return(BaseOilFloaterConfig.SetupDiet(gameObject, SimHashes.Oxygen.CreateTag(), Tag.Invalid, CALORIES_PER_KG_OF_ORE, 0f, null, 0f, 0f));
    }
        public static GameObject CreateOilfloater(string id, string name, string desc, string anim_file, bool is_baby)
        {
            GameObject prefab = BaseOilFloaterConfig.BaseOilFloater(id, name, desc, anim_file, BASE_TRAIT_ID, 210.15f, 273.15f, is_baby, variantSprite);

            EntityTemplates.ExtendEntityToWildCreature(prefab, OilFloaterTuning.PEN_SIZE_PER_CREATURE);
            Trait trait = Db.Get().CreateTrait(BASE_TRAIT_ID, name, name, null, false, null, true, true);

            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, OilFloaterTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, -OilFloaterTuning.STANDARD_CALORIES_PER_CYCLE / 600f, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, HITPOINTS.TIER1, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, LIFESPAN.TIER3, name, false, false, true));
            List <Diet.Info> diet_infos = DietInfo(GameTags.Steel, CALORIES_PER_KG_OF_ORE, CONVERSION_EFFICIENCY.GOOD_1, null, 0f);

            return(OilFloaters.SetupDiet(prefab, diet_infos, CALORIES_PER_KG_OF_ORE, MIN_POOP_SIZE_IN_KG, 5 * Patches.Settings.ConsumptionMultiplier));
        }
    public static GameObject CreateHatch(string id, string name, string desc, string anim_file, bool is_baby)
    {
        bool       is_baby2 = is_baby;
        GameObject prefab   = BaseHatchConfig.BaseHatch(id, name, desc, anim_file, "HatchMetalBaseTrait", is_baby2, "mtl_");

        prefab = EntityTemplates.ExtendEntityToWildCreature(prefab, HatchTuning.PEN_SIZE_PER_CREATURE, 100f);
        Trait trait = Db.Get().CreateTrait("HatchMetalBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, HatchTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - HatchTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 400f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 100f, name, false, false, true));
        List <Diet.Info> diet_infos = BaseHatchConfig.MetalDiet(GameTags.Metal, CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.GOOD_1, null, 0f);

        return(BaseHatchConfig.SetupDiet(prefab, diet_infos, CALORIES_PER_KG_OF_ORE, MIN_POOP_SIZE_IN_KG));
    }
예제 #17
0
            private static void Postfix(Db __instance)
            {
                // добавляем модификаторы инфаркта к трейтам:
                // Торопыжка
                Trait traitTwinkletoes = __instance.traits.Get("Twinkletoes");

                traitTwinkletoes.Add(new AttributeModifier(HeartAttackMonitor.ATTRIBUTE_ID, -0.05f, traitTwinkletoes.Name));

                // Силач
                Trait traitStrongArm = __instance.traits.Get("StrongArm");

                traitStrongArm.Add(new AttributeModifier(HeartAttackMonitor.ATTRIBUTE_ID, -0.05f, traitStrongArm.Name));

                // Анемия
                Trait traitAnemic = __instance.traits.Get("Anemic");

                traitAnemic.Add(new AttributeModifier(HeartAttackMonitor.ATTRIBUTE_ID, +0.1f, traitAnemic.Name));

                // Пацифист
                Trait traitScaredyCat = __instance.traits.Get("ScaredyCat");

                traitScaredyCat.Add(new AttributeModifier(HeartAttackMonitor.ATTRIBUTE_ID, +0.1f, traitScaredyCat.Name));

                // Лапшерукий
                Trait traitNoodleArms = __instance.traits.Get("NoodleArms");

                traitNoodleArms.Add(new AttributeModifier(HeartAttackMonitor.ATTRIBUTE_ID, +0.05f, traitNoodleArms.Name));
            }
예제 #18
0
 public static void GenerateBaseTrait()
 {
     lock (_lock)
     {
         if (hasGeneratedBaseTrait)
         {
             return;
         }
         Trait trait = Db.Get().CreateTrait(BaseTraitId, Id, Id, null, false, null, true, true);
         trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, StomachSize, Id, false, false, true));
         trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (float)(-CaloriesPerCycle / 600.0), Id, false, false, true));
         trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, Hitpoints, Id, false, false, true));
         trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, Lifespan, Id, false, false, true));
         hasGeneratedBaseTrait = true;
     }
 }
예제 #19
0
    public static GameObject CreateCrab(string id, string name, string desc, string anim_file, bool is_baby, string deathDropID)
    {
        bool       is_baby2 = is_baby;
        GameObject prefab   = BaseCrabConfig.BaseCrab(id, name, desc, anim_file, "CrabBaseTrait", is_baby2, null, deathDropID);

        prefab = EntityTemplates.ExtendEntityToWildCreature(prefab, CrabTuning.PEN_SIZE_PER_CREATURE, 100f);
        Trait trait = Db.Get().CreateTrait("CrabBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, CrabTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - CrabTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 100f, name, false, false, true));
        List <Diet.Info> diet_infos = BaseCrabConfig.BasicDiet(SimHashes.Sand.CreateTag(), CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.NORMAL, null, 0f);

        return(BaseCrabConfig.SetupDiet(prefab, diet_infos, CALORIES_PER_KG_OF_ORE, MIN_POOP_SIZE_IN_KG));
    }
예제 #20
0
    public GameObject CreatePrefab()
    {
        string         text        = STRINGS.CREATURES.SPECIES.GLOM.NAME;
        string         id          = "Glom";
        string         name        = text;
        string         desc        = STRINGS.CREATURES.SPECIES.GLOM.DESC;
        float          mass        = 25f;
        KAnimFile      anim        = Assets.GetAnim("glom_kanim");
        string         initialAnim = "idle_loop";
        EffectorValues tIER        = DECOR.BONUS.TIER0;
        GameObject     gameObject  = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, anim, initialAnim, Grid.SceneLayer.Creatures, 1, 1, tIER, default(EffectorValues), SimHashes.Creature, null, 293f);
        Trait          trait       = Db.Get().CreateTrait("GlomBaseTrait", text, text, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, text, false, false, true));
        KPrefabID component = gameObject.GetComponent <KPrefabID>();

        component.AddTag(GameTags.Creatures.Walker, false);
        component.prefabInitFn += delegate(GameObject inst)
        {
            inst.GetAttributes().Add(Db.Get().Attributes.MaxUnderwaterTravelCost);
        };
        EntityTemplates.ExtendEntityToBasicCreature(gameObject, FactionManager.FactionID.Pest, "GlomBaseTrait", "WalkerNavGrid1x1", NavType.Floor, 32, 2f, string.Empty, 0, true, true, 293.15f, 393.15f, 273.15f, 423.15f);
        gameObject.AddWeapon(1f, 1f, AttackProperties.DamageType.Standard, AttackProperties.TargetType.Single, 1, 0f);
        gameObject.AddOrGet <Trappable>();
        gameObject.AddOrGetDef <ThreatMonitor.Def>();
        gameObject.AddOrGetDef <CreatureFallMonitor.Def>();
        ElementDropperMonitor.Def def = gameObject.AddOrGetDef <ElementDropperMonitor.Def>();
        def.dirtyEmitElement        = SimHashes.ContaminatedOxygen;
        def.dirtyProbabilityPercent = 25f;
        def.dirtyCellToTargetMass   = 1f;
        def.dirtyMassPerDirty       = 0.2f;
        def.dirtyMassReleaseOnDeath = 3f;
        def.emitDiseaseIdx          = Db.Get().Diseases.GetIndex("SlimeLung");
        def.emitDiseasePerKg        = 1000f;
        OvercrowdingMonitor.Def def2 = gameObject.AddOrGetDef <OvercrowdingMonitor.Def>();
        def2.spaceRequiredPerCreature = 0;
        gameObject.AddOrGet <LoopingSounds>();
        LoopingSounds component2 = gameObject.GetComponent <LoopingSounds>();

        component2.updatePosition = true;
        DiseaseSourceVisualizer diseaseSourceVisualizer = gameObject.AddOrGet <DiseaseSourceVisualizer>();

        diseaseSourceVisualizer.alwaysShowDisease = "SlimeLung";
        SoundEventVolumeCache.instance.AddVolume("glom_kanim", "Morb_movement_short", NOISE_POLLUTION.CREATURES.TIER2);
        SoundEventVolumeCache.instance.AddVolume("glom_kanim", "Morb_jump", NOISE_POLLUTION.CREATURES.TIER3);
        SoundEventVolumeCache.instance.AddVolume("glom_kanim", "Morb_land", NOISE_POLLUTION.CREATURES.TIER3);
        SoundEventVolumeCache.instance.AddVolume("glom_kanim", "Morb_expel", NOISE_POLLUTION.CREATURES.TIER4);
        EntityTemplates.CreateAndRegisterBaggedCreature(gameObject, true, false, false);
        ChoreTable.Builder chore_table = new ChoreTable.Builder().Add(new DeathStates.Def(), true).Add(new TrappedStates.Def(), true).Add(new BaggedStates.Def(), true)
                                         .Add(new FallStates.Def(), true)
                                         .Add(new StunnedStates.Def(), true)
                                         .Add(new DrowningStates.Def(), true)
                                         .Add(new DebugGoToStates.Def(), true)
                                         .Add(new FleeStates.Def(), true)
                                         .Add(new DropElementStates.Def(), true)
                                         .Add(new IdleStates.Def(), true);
        EntityTemplates.AddCreatureBrain(gameObject, chore_table, GameTags.Creatures.Species.GlomSpecies, null);
        return(gameObject);
    }
    public static GameObject CreatePuft(string id, string name, string desc, string anim_file, bool is_baby)
    {
        GameObject prefab = BasePuftConfig.BasePuft(id, name, STRINGS.CREATURES.SPECIES.PUFT.DESC, "PuftBaseTrait", anim_file, is_baby, null, 288.15f, 328.15f);

        EntityTemplates.ExtendEntityToWildCreature(prefab, PuftTuning.PEN_SIZE_PER_CREATURE, 75f);
        Trait trait = Db.Get().CreateTrait("PuftBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, PuftTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - PuftTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 75f, name, false, false, true));
        prefab = BasePuftConfig.SetupDiet(prefab, SimHashes.ContaminatedOxygen.CreateTag(), SimHashes.SlimeMold.CreateTag(), CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.GOOD_2, "SlimeLung", 1000f, MIN_POOP_SIZE_IN_KG);
        DiseaseSourceVisualizer diseaseSourceVisualizer = prefab.AddOrGet <DiseaseSourceVisualizer>();

        diseaseSourceVisualizer.alwaysShowDisease = "SlimeLung";
        return(prefab);
    }
예제 #22
0
        public static GameObject CreateOilfloater(string id, string name, string desc, string anim_file, bool is_baby)
        {
            GameObject prefab = AquaticOilFloater(id, name, desc, anim_file, BASE_TRAIT_ID, 263.15f, 323.15f, is_baby, variantSprite);

            //prefab.RemoveDef<SubmergedMonitor.Def>();
            //prefab.AddOrGetDef<CreatureFallMonitor.Def>().canSwim = false;

            EntityTemplates.ExtendEntityToWildCreature(prefab, OilFloaterTuning.PEN_SIZE_PER_CREATURE);
            Trait trait = Db.Get().CreateTrait(BASE_TRAIT_ID, name, name, null, false, null, true, true);

            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, OilFloaterTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, -OilFloaterTuning.STANDARD_CALORIES_PER_CYCLE / 600f, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, HITPOINTS.TIER1, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, LIFESPAN.TIER3, name, false, false, true));
            List <Diet.Info> diet_infos = DietInfo(GameTags.AnyWater, CALORIES_PER_KG_OF_ORE, CONVERSION_EFFICIENCY.GOOD_1, null, 0f);

            return(OilFloaters.SetupDiet(prefab, diet_infos, CALORIES_PER_KG_OF_ORE, MIN_POOP_SIZE_IN_KG, 15f * ILoveSlicksters.Settings.ConsumptionMultiplier));
        }
예제 #23
0
    public static GameObject CreateLightBug(string id, string name, string desc, string anim_file, bool is_baby)
    {
        GameObject prefab = BaseLightBugConfig.BaseLightBug(id, name, desc, anim_file, "LightBugBaseTrait", LIGHT2D.LIGHTBUG_COLOR, DECOR.BONUS.TIER4, is_baby, null);

        EntityTemplates.ExtendEntityToWildCreature(prefab, LightBugTuning.PEN_SIZE_PER_CREATURE, 25f);
        Trait trait = Db.Get().CreateTrait("LightBugBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, LightBugTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - LightBugTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 5f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 25f, name, false, false, true));
        HashSet <Tag> hashSet = new HashSet <Tag>();

        hashSet.Add(TagManager.Create(PrickleFruitConfig.ID));
        hashSet.Add(TagManager.Create("GrilledPrickleFruit"));
        hashSet.Add(SimHashes.Phosphorite.CreateTag());
        return(BaseLightBugConfig.SetupDiet(prefab, hashSet, Tag.Invalid, CALORIES_PER_KG_OF_ORE));
    }
예제 #24
0
    public static GameObject CreatePuftBleachstone(string id, string name, string desc, string anim_file, bool is_baby)
    {
        GameObject prefab = BasePuftConfig.BasePuft(id, name, desc, "PuftBleachstoneBaseTrait", anim_file, is_baby, "anti_", 258.15f, 308.15f);

        prefab = EntityTemplates.ExtendEntityToWildCreature(prefab, PuftTuning.PEN_SIZE_PER_CREATURE, 75f);
        Trait trait = Db.Get().CreateTrait("PuftBleachstoneBaseTrait", name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, PuftTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - PuftTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 75f, name, false, false, true));
        prefab = BasePuftConfig.SetupDiet(prefab, SimHashes.ChlorineGas.CreateTag(), SimHashes.BleachStone.CreateTag(), CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.GOOD_2, null, 0f, MIN_POOP_SIZE_IN_KG);
        LureableMonitor.Def def = prefab.AddOrGetDef <LureableMonitor.Def>();
        def.lures = new Tag[1]
        {
            SimHashes.BleachStone.CreateTag()
        };
        return(prefab);
    }
예제 #25
0
        public GameObject CreatePrefab()
        {
            string         name         = (string)MurderBotConfig.NAME;
            string         desc         = (string)MurderBotConfig.DESCRIPTION;
            string         id           = (string)MurderBotConfig.ID;
            double         mass         = (double)SweepBotConfig.MASS;
            EffectorValues none         = TUNING.BUILDINGS.DECOR.NONE;
            KAnimFile      anim         = Assets.GetAnim((HashedString)"sweep_bot_kanim");
            EffectorValues decor        = none;
            EffectorValues noise        = new EffectorValues();
            GameObject     placedEntity = EntityTemplates.CreatePlacedEntity(id, name, desc, (float)mass, anim, "idle", Grid.SceneLayer.Creatures, 1, 1, decor, noise, SimHashes.Creature, (List <Tag>)null, 293f);

            placedEntity.AddOrGet <LoopingSounds>();
            placedEntity.GetComponent <KBatchedAnimController>().isMovable = true;
            KPrefabID kprefabId = placedEntity.AddOrGet <KPrefabID>();

            kprefabId.AddTag(GameTags.Creature, false);
            placedEntity.AddComponent <Pickupable>();
            placedEntity.AddOrGet <Clearable>().isClearable = false;

            Trait trait = Db.Get().CreateTrait("MurderBotBaseTrait", name, name, (string)null, false, (ChoreGroup[])null, true, true);

            trait.Add(new AttributeModifier(Db.Get().Amounts.InternalBattery.maxAttribute.Id, 21000f, name, false, false, true));
            trait.Add(new AttributeModifier(Db.Get().Amounts.InternalBattery.deltaAttribute.Id, -40f, name, false, false, true));
            Modifiers modifiers = placedEntity.AddOrGet <Modifiers>();

            modifiers.initialTraits = new string[1]
            {
                "MurderBotBaseTrait"
            };
            modifiers.initialAmounts.Add(Db.Get().Amounts.HitPoints.Id);
            modifiers.initialAmounts.Add(Db.Get().Amounts.InternalBattery.Id);
            placedEntity.AddOrGet <KBatchedAnimController>().SetSymbolVisiblity((KAnimHashedString)"snapto_pivot", false);
            placedEntity.AddOrGet <Traits>();
            placedEntity.AddOrGet <CharacterOverlay>();
            placedEntity.AddOrGet <Effects>();
            placedEntity.AddOrGetDef <AnimInterruptMonitor.Def>();
            placedEntity.AddOrGetDef <StorageUnloadMonitor.Def>();
            placedEntity.AddOrGetDef <RobotBatteryMonitor.Def>();
            placedEntity.AddOrGetDef <SweetBotReactMonitor.Def>();
            placedEntity.AddOrGetDef <CreatureFallMonitor.Def>();
            placedEntity.AddOrGetDef <SweepBotTrappedMonitor.Def>();
            placedEntity.AddOrGet <AnimEventHandler>();

            SymbolOverrideControllerUtil.AddToPrefab(placedEntity);
            placedEntity.AddOrGet <OrnamentReceptacle>().AddDepositTag(GameTags.PedestalDisplayable);
            placedEntity.AddOrGet <DecorProvider>();
            placedEntity.AddOrGet <UserNameable>();
            placedEntity.AddOrGet <CharacterOverlay>();
            placedEntity.AddOrGet <ItemPedestal>();
            Navigator navigator = placedEntity.AddOrGet <Navigator>();

            navigator.NavGridName      = "WalkerBabyNavGrid";
            navigator.CurrentNavType   = NavType.Floor;
            navigator.defaultSpeed     = 1f;
            navigator.updateProber     = true;
            navigator.maxProbingRadius = 32;
            navigator.sceneLayer       = Grid.SceneLayer.Creatures;
            kprefabId.AddTag(GameTags.Creatures.Walker, false);
            ChoreTable.Builder chore_table = new ChoreTable.Builder().Add((StateMachine.BaseDef) new FallStates.Def(), true).Add((StateMachine.BaseDef) new AnimInterruptStates.Def(), true).Add((StateMachine.BaseDef) new SweepBotTrappedStates.Def(), true).Add((StateMachine.BaseDef) new ReturnToChargeStationStates.Def(), true).Add((StateMachine.BaseDef) new IdleStates.Def(), true);
            placedEntity.AddOrGet <LoopingSounds>();
            EntityTemplates.AddCreatureBrain(placedEntity, chore_table, GameTags.Robots.Models.SweepBot, (string)null);

            return(placedEntity);
        }
예제 #26
0
    public static void AddMinionTraits(string name, Modifiers modifiers)
    {
        Trait trait = Db.Get().CreateTrait(MINION_BASE_TRAIT_ID, name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Stamina.deltaAttribute.Id, -0.116666667f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, -1666.66663f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, 4000000f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Toxicity.deltaAttribute.Id, 0f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Attributes.AirConsumptionRate.Id, 0.1f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Bladder.deltaAttribute.Id, 0.166666672f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 100f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Attributes.MaxUnderwaterTravelCost.Id, 8f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Attributes.DecorExpectation.Id, 0f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Attributes.FoodExpectation.Id, 0f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Attributes.ToiletEfficiency.Id, 1f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Attributes.RoomTemperaturePreference.Id, 0f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Attributes.CarryAmount.Id, 200f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Attributes.QualityOfLife.Id, 1f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Attributes.SpaceNavigation.Id, 1f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Attributes.Sneezyness.Id, 0f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.ImmuneLevel.deltaAttribute.Id, 0.025f, name, false, false, true));
    }
예제 #27
0
    public static GameObject CreatePrefab(string id, string base_trait_id, string name, string description, string anim_file, bool is_baby, string symbol_prefix, float warnLowTemp, float warnHighTemp)
    {
        float          mass               = 200f;
        KAnimFile      anim               = Assets.GetAnim(anim_file);
        string         initialAnim        = "idle_loop";
        EffectorValues tIER               = DECOR.BONUS.TIER0;
        float          defaultTemperature = (warnLowTemp + warnHighTemp) / 2f;
        GameObject     gameObject         = EntityTemplates.CreatePlacedEntity(id, name, description, mass, anim, initialAnim, Grid.SceneLayer.Creatures, 1, 1, tIER, default(EffectorValues), SimHashes.Creature, null, defaultTemperature);
        KPrefabID      component          = gameObject.GetComponent <KPrefabID>();

        component.AddTag(GameTags.SwimmingCreature, false);
        component.AddTag(GameTags.Creatures.Swimmer, false);
        Trait trait = Db.Get().CreateTrait(base_trait_id, name, name, null, false, null, true, true);

        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.maxAttribute.Id, PacuTuning.STANDARD_STOMACH_SIZE, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Calories.deltaAttribute.Id, (0f - PacuTuning.STANDARD_CALORIES_PER_CYCLE) / 600f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.HitPoints.maxAttribute.Id, 25f, name, false, false, true));
        trait.Add(new AttributeModifier(Db.Get().Amounts.Age.maxAttribute.Id, 25f, name, false, false, true));
        EntityTemplates.CreateAndRegisterBaggedCreature(gameObject, false, false, true);
        EntityTemplates.ExtendEntityToBasicCreature(gameObject, FactionManager.FactionID.Prey, base_trait_id, "SwimmerNavGrid", NavType.Swim, 32, 2f, "FishMeat", 1, false, false, warnLowTemp, warnHighTemp, warnLowTemp - 20f, warnHighTemp + 20f);
        if (is_baby)
        {
            KBatchedAnimController component2 = gameObject.GetComponent <KBatchedAnimController>();
            component2.animWidth  = 0.5f;
            component2.animHeight = 0.5f;
        }
        ChoreTable.Builder chore_table = new ChoreTable.Builder().Add(new DeathStates.Def(), true).Add(new AnimInterruptStates.Def(), true).Add(new GrowUpStates.Def(), true)
                                         .Add(new TrappedStates.Def(), true)
                                         .Add(new IncubatingStates.Def(), true)
                                         .Add(new BaggedStates.Def(), true)
                                         .Add(new FallStates.Def
        {
            getLandAnim = new Func <FallStates.Instance, string>(GetLandAnim)
        }, true)
                                         .Add(new DebugGoToStates.Def(), true)
                                         .Add(new FlopStates.Def(), true)
                                         .PushInterruptGroup()
                                         .Add(new FixedCaptureStates.Def(), true)
                                         .Add(new LayEggStates.Def(), true)
                                         .Add(new EatStates.Def(), true)
                                         .Add(new PlayAnimsStates.Def(GameTags.Creatures.Poop, false, "lay_egg_pre", STRINGS.CREATURES.STATUSITEMS.EXPELLING_SOLID.NAME, STRINGS.CREATURES.STATUSITEMS.EXPELLING_SOLID.TOOLTIP), true)
                                         .Add(new MoveToLureStates.Def(), true)
                                         .PopInterruptGroup()
                                         .Add(new IdleStates.Def(), true);
        CreatureFallMonitor.Def def = gameObject.AddOrGetDef <CreatureFallMonitor.Def>();
        def.canSwim = true;
        gameObject.AddOrGetDef <FlopMonitor.Def>();
        gameObject.AddOrGetDef <FishOvercrowdingMonitor.Def>();
        gameObject.AddOrGet <Trappable>();
        gameObject.AddOrGet <LoopingSounds>();
        EntityTemplates.AddCreatureBrain(gameObject, chore_table, GameTags.Creatures.Species.PacuSpecies, symbol_prefix);
        HashSet <Tag> hashSet = new HashSet <Tag>();

        hashSet.Add(SimHashes.Algae.CreateTag());
        Diet.Info[] infos = new Diet.Info[1]
        {
            new Diet.Info(hashSet, SimHashes.ToxicSand.CreateTag(), CALORIES_PER_KG_OF_ORE, TUNING.CREATURES.CONVERSION_EFFICIENCY.NORMAL, null, 0f, false, false)
        };
        Diet diet = new Diet(infos);

        CreatureCalorieMonitor.Def def2 = gameObject.AddOrGetDef <CreatureCalorieMonitor.Def>();
        def2.diet = diet;
        def2.minPoopSizeInCalories = CALORIES_PER_KG_OF_ORE * MIN_POOP_SIZE_IN_KG;
        SolidConsumerMonitor.Def def3 = gameObject.AddOrGetDef <SolidConsumerMonitor.Def>();
        def3.diet = diet;
        LureableMonitor.Def def4 = gameObject.AddOrGetDef <LureableMonitor.Def>();
        def4.lures = new Tag[1]
        {
            GameTags.Creatures.FishTrapLure
        };
        if (!string.IsNullOrEmpty(symbol_prefix))
        {
            gameObject.AddOrGet <SymbolOverrideController>().ApplySymbolOverridesByAffix(Assets.GetAnim("pacu_kanim"), symbol_prefix, null, 0);
        }
        return(gameObject);
    }