示例#1
0
    public GameObject CreatePrefab()
    {
        GameObject gameObject = PuftBleachstoneConfig.CreatePuftBleachstone("PuftBleachstoneBaby", CREATURES.SPECIES.PUFT.VARIANT_BLEACHSTONE.BABY.NAME, CREATURES.SPECIES.PUFT.VARIANT_BLEACHSTONE.BABY.DESC, "baby_puft_kanim", true);

        EntityTemplates.ExtendEntityToBeingABaby(gameObject, "PuftBleachstone", null);
        return(gameObject);
    }
    public GameObject CreatePrefab()
    {
        GameObject gameObject = PacuTropicalConfig.CreatePacu("PacuTropicalBaby", CREATURES.SPECIES.PACU.VARIANT_TROPICAL.BABY.NAME, CREATURES.SPECIES.PACU.VARIANT_TROPICAL.BABY.DESC, "baby_pacu_kanim", true);

        EntityTemplates.ExtendEntityToBeingABaby(gameObject, "PacuTropical", null);
        return(gameObject);
    }
        public GameObject CreatePrefab()
        {
            var pacu = OilFishConfig.CreatePacu(ID, NAME, DESC, "baby_pacu_kanim", true);

            EntityTemplates.ExtendEntityToBeingABaby(pacu, OilFishConfig.ID);
            return(pacu);
        }
示例#4
0
    public GameObject CreatePrefab()
    {
        GameObject gameObject = LightBugPurpleConfig.CreateLightBug("LightBugPurpleBaby", CREATURES.SPECIES.LIGHTBUG.VARIANT_PURPLE.BABY.NAME, CREATURES.SPECIES.LIGHTBUG.VARIANT_PURPLE.BABY.DESC, "baby_lightbug_kanim", true);

        EntityTemplates.ExtendEntityToBeingABaby(gameObject, "LightBugPurple", null);
        return(gameObject);
    }
示例#5
0
    public GameObject CreatePrefab()
    {
        GameObject gameObject = PacuCleanerConfig.CreatePacu("PacuCleanerBaby", CREATURES.SPECIES.PACU.VARIANT_CLEANER.BABY.NAME, CREATURES.SPECIES.PACU.VARIANT_CLEANER.BABY.DESC, "baby_pacu_kanim", true);

        EntityTemplates.ExtendEntityToBeingABaby(gameObject, "PacuCleaner", null);
        return(gameObject);
    }
示例#6
0
    public GameObject CreatePrefab()
    {
        GameObject gameObject = SquirrelConfig.CreateSquirrel("SquirrelBaby", CREATURES.SPECIES.SQUIRREL.BABY.NAME, CREATURES.SPECIES.SQUIRREL.BABY.DESC, "baby_squirrel_kanim", true);

        EntityTemplates.ExtendEntityToBeingABaby(gameObject, "Squirrel", null);
        return(gameObject);
    }
    public GameObject CreatePrefab()
    {
        GameObject gameObject = DreckoPlasticConfig.CreateDrecko("DreckoPlasticBaby", CREATURES.SPECIES.DRECKO.VARIANT_PLASTIC.BABY.NAME, CREATURES.SPECIES.DRECKO.VARIANT_PLASTIC.BABY.DESC, "baby_drecko_kanim", true);

        EntityTemplates.ExtendEntityToBeingABaby(gameObject, "DreckoPlastic", null);
        return(gameObject);
    }
示例#8
0
        public GameObject CreatePrefab()
        {
            GameObject gameObject = AquaOilfloaterConfig.CreateOilfloater(ID, PHO_STRINGS.VARIANT_AQUA.BABY.NAME, PHO_STRINGS.VARIANT_AQUA.BABY.DESC, "baby_aqua_oilfloater_kanim", true);

            EntityTemplates.ExtendEntityToBeingABaby(gameObject, "AquaOilfloater");
            return(gameObject);
        }
        public GameObject CreatePrefab()
        {
            GameObject rollerSnake = SteelRollerSnakeConfig.CreateSteelRollerSnake(Id, Name, Description, "babyrollersnake_kanim", true);

            EntityTemplates.ExtendEntityToBeingABaby(rollerSnake, SteelRollerSnakeConfig.Id, null);
            return(rollerSnake);
        }
        public GameObject CreatePrefab()
        {
            GameObject gameObject = RobotOilfloaterConfig.CreateOilfloater(ID, PHO_STRINGS.VARIANT_ROBOT.BABY.NAME, PHO_STRINGS.VARIANT_ROBOT.BABY.DESC, "custom_baby_oilfloater_kanim", true);

            EntityTemplates.ExtendEntityToBeingABaby(gameObject, "RobotOilfloater");
            return(gameObject);
        }
    public GameObject CreatePrefab()
    {
        GameObject gameObject = MoleConfig.CreateMole("MoleBaby", CREATURES.SPECIES.MOLE.BABY.NAME, CREATURES.SPECIES.MOLE.BABY.DESC, "baby_driller_kanim", true);

        EntityTemplates.ExtendEntityToBeingABaby(gameObject, "Mole", null);
        return(gameObject);
    }
    public GameObject CreatePrefab()
    {
        GameObject gameObject = CrabConfig.CreateCrab("CrabBaby", CREATURES.SPECIES.CRAB.BABY.NAME, CREATURES.SPECIES.CRAB.BABY.DESC, "baby_pincher_kanim", true, "BabyCrabShell");

        EntityTemplates.ExtendEntityToBeingABaby(gameObject, "Crab", "BabyCrabShell");
        return(gameObject);
    }
示例#13
0
        public GameObject CreatePrefab()
        {
            GameObject gameObject = EthanolOilfloaterConfig.CreateOilfloater(ID, PHO_STRINGS.VARIANT_ETHANOL.BABY.NAME, PHO_STRINGS.VARIANT_ETHANOL.BABY.DESC, "custom_baby_oilfloater_kanim", true);

            EntityTemplates.ExtendEntityToBeingABaby(gameObject, "EthanolOilfloater", null);
            return(gameObject);
        }
示例#14
0
    public GameObject CreatePrefab()
    {
        GameObject gameObject = HatchVeggieConfig.CreateHatch("HatchVeggieBaby", CREATURES.SPECIES.HATCH.VARIANT_VEGGIE.BABY.NAME, CREATURES.SPECIES.HATCH.VARIANT_VEGGIE.BABY.DESC, "baby_hatch_kanim", true);

        EntityTemplates.ExtendEntityToBeingABaby(gameObject, "HatchVeggie", null);
        return(gameObject);
    }
    public GameObject CreatePrefab()
    {
        GameObject gameObject = PuftConfig.CreatePuft("PuftBaby", CREATURES.SPECIES.PUFT.BABY.NAME, CREATURES.SPECIES.PUFT.BABY.DESC, "baby_puft_kanim", true);

        EntityTemplates.ExtendEntityToBeingABaby(gameObject, "Puft", null);
        return(gameObject);
    }
示例#16
0
        public GameObject CreatePrefab()
        {
            GameObject gameObject = FrozenOilfloaterConfig.CreateOilfloater(ID, PHO_STRINGS.VARIANT_FROZEN.BABY.NAME, PHO_STRINGS.VARIANT_FROZEN.BABY.DESC, kanim_id, true);

            EntityTemplates.ExtendEntityToBeingABaby(gameObject, "FrozenOilfloater");
            return(gameObject);
        }
    public GameObject CreatePrefab()
    {
        GameObject gameObject = OilFloaterHighTempConfig.CreateOilFloater("OilfloaterHighTempBaby", CREATURES.SPECIES.OILFLOATER.VARIANT_HIGHTEMP.BABY.NAME, CREATURES.SPECIES.OILFLOATER.VARIANT_HIGHTEMP.BABY.DESC, "baby_oilfloater_kanim", true);

        EntityTemplates.ExtendEntityToBeingABaby(gameObject, "OilfloaterHighTemp", null);
        return(gameObject);
    }
示例#18
0
    public GameObject CreatePrefab()
    {
        GameObject gameObject = LightBugConfig.CreateLightBug("LightBugBaby", CREATURES.SPECIES.LIGHTBUG.BABY.NAME, CREATURES.SPECIES.LIGHTBUG.BABY.DESC, "baby_lightbug_kanim", true);

        EntityTemplates.ExtendEntityToBeingABaby(gameObject, "LightBug", null);
        gameObject.GetComponent <KPrefabID>().AddTag(RoomConstraints.ConstraintTags.LightSource, false);
        return(gameObject);
    }
示例#19
0
        public GameObject CreatePrefab()
        {
            GameObject puft = DevilPuftConfig.CreatePuft(DevilPuftConfig.BABY_ID, DevilPuftConfig.BabyName,
                                                         DevilPuftConfig.BabyDescription,
                                                         "devil_puft_baby_kanim", true);

            EntityTemplates.ExtendEntityToBeingABaby(puft, (Tag)DevilPuftConfig.ID, (string)null);
            return(puft);
        }
示例#20
0
        public GameObject CreatePrefab()
        {
            GameObject puft = CloudyPuftConfig.CreatePuft(CloudyPuftConfig.BABY_ID, CloudyPuftConfig.BabyName,
                                                          CloudyPuftConfig.BabyDescription,
                                                          "cloudy_puft_baby_kanim"
                                                          //"baby_puft_kanim"
                                                          , true);

            EntityTemplates.ExtendEntityToBeingABaby(puft, (Tag)CloudyPuftConfig.ID, (string)null);
            return(puft);
        }
示例#21
0
        public GameObject CreatePrefab()
        {
            GameObject pacu = AlgaePacuConfig.CreatePacu(ID,
                                                         NAME,
                                                         DESCRIPTION,
                                                         "algaebaby_pacu_kanim",
                                                         true);

            EntityTemplates.ExtendEntityToBeingABaby(pacu, AlgaePacuConfig.ID, null);
            return(pacu);
        }
示例#22
0
        public GameObject CreatePrefab()
        {
            GameObject hatch = FloralHatchConfig.CreateHatch(
                FloralHatchConfig.BabyId,
                FloralHatchConfig.BabyName,
                FloralHatchConfig.BabyDescription,
                "floral_hatch_baby_kanim",
                true);

            EntityTemplates.ExtendEntityToBeingABaby(hatch, FloralHatchConfig.Id, null);
            return(hatch);
        }
        public GameObject CreatePrefab()
        {
            GameObject hatch = HatchMutedConfig.CreateHatch(
                HatchMutedConfig.BabyId,
                HatchMutedConfig.BabyName,
                HatchMutedConfig.BabyDescription,
                "baby_hatch_new",
                true);

            EntityTemplates.ExtendEntityToBeingABaby(hatch, HatchMutedConfig.Id, null);
            return(hatch);
        }
示例#24
0
        public GameObject CreatePrefab()
        {
            GameObject hatch = WoodenHatchConfig.CreateHatch(
                WoodenHatchConfig.BabyId,
                WoodenHatchConfig.BabyName,
                WoodenHatchConfig.BabyDescription,
                "wooden_hatch_baby_kanim",
                true);

            EntityTemplates.ExtendEntityToBeingABaby(hatch, WoodenHatchConfig.Id, null);
            return(hatch);
        }
示例#25
0
        public GameObject CreatePrefab()
        {
            GameObject baby = MetalDrecko.CreateCritter(
                MetalDrecko.BabyId,
                MetalDrecko.BabyName,
                MetalDrecko.BabyDescription,
                "baby_metal_drecko_kanim",
                true);

            EntityTemplates.ExtendEntityToBeingABaby(baby, MetalDrecko.ID, null);
            return(baby);
        }
示例#26
0
        public GameObject CreatePrefab()
        {
            GameObject baby = SpringAdultPip.CreateCritter(
                SpringAdultPip.BabyId,
                SpringAdultPip.BabyName,
                SpringAdultPip.BabyDescription,
                "baby_squirrel_spring_kanim",
                true);

            EntityTemplates.ExtendEntityToBeingABaby(baby, SpringAdultPip.ID, null);
            return(baby);
        }
示例#27
0
        public GameObject CreatePrefab()
        {
            GameObject hatch = SturdyHatchConfig.CreateHatch(
                SturdyHatchConfig.BabyId,
                SturdyHatchConfig.BabyName,
                SturdyHatchConfig.BabyDescription,
                "diamond_hatch_baby_kanim",
                true);

            EntityTemplates.ExtendEntityToBeingABaby(hatch, SturdyHatchConfig.Id, null);
            return(hatch);
        }
示例#28
0
        public GameObject CreatePrefab()
        {
            const float X      = 0.5f * ((WIDTH + 1) % 2);
            var         prefab = MooConfig.CreateMoo(ID, MooReproductionStrings.CREATURES.
                                                     SPECIES.MOO.BABY.NAME, MooReproductionStrings.CREATURES.SPECIES.MOO.BABY.DESC,
                                                     "gassy_moo_kanim", true);
            // Resize to 1x1
            var collider = prefab.GetComponent <KBoxCollider2D>();

            collider.size   = new Vector2f(WIDTH, HEIGHT);
            collider.offset = new Vector2f(X, HEIGHT * 0.5f);
            var kbac = prefab.GetComponent <KBatchedAnimController>();

            kbac.Offset     = new Vector3(X, 0f, 0f);
            kbac.animScale *= 0.5f;
            var occupyArea = prefab.AddOrGet <OccupyArea>();

            occupyArea.OccupiedCellsOffsets = EntityTemplates.GenerateOffsets(WIDTH, HEIGHT);
            EntityTemplates.ExtendEntityToBeingABaby(prefab, MooConfig.ID, null, false, 5.0f);
            // Reduce to 1kg meat for baby
            var butcherable = prefab.GetComponent <Butcherable>();

            if (butcherable != null)
            {
                butcherable.SetDrops(new string[] { MeatConfig.ID });
            }
            MooReproductionPatches.UpdateMooChores(prefab);
            // Babies should not be ranchable or auto wrangled, but there is no RemoveDef
            // function...
            var smc = prefab.GetComponent <StateMachineController>();

            if (smc != null && smc.defHandle.IsValid())
            {
                var defs = smc.cmpdef?.defs;
                if (defs != null)
                {
                    defs.Remove(smc.GetDef <RanchableMonitor.Def>());
                    defs.Remove(smc.GetDef <FixedCapturableMonitor.Def>());
                }
            }
            return(prefab);
        }
    public void test()
    {
        // configurations
        string         id                   = "HatchHard";
        string         name                 = "Stone Hatch";
        string         desc                 = "Stone Hatches excrete solid Coal as waste and enjoy burrowing into the ground.";
        string         anim_file            = "hatch_kanim";
        bool           is_baby              = false;
        string         traitId              = "HatchHardBaseTrait";
        string         override_prefix      = "hvy_";
        int            space_requirement    = HatchTuning.PEN_SIZE_PER_CREATURE;
        float          lifespan             = 100f;
        float          mass                 = 100f;
        int            width                = 1;
        int            height               = 1;
        EffectorValues decor                = TUNING.DECOR.BONUS.TIER0;
        string         navGridName          = !is_baby ? "WalkerNavGrid1x1" : "WalkerBabyNavGrid";
        NavType        navi                 = NavType.Floor;
        float          moveSpeed            = 2f;
        string         dropOnDeath          = "Meat";
        int            dropCount            = 2;
        bool           canDrown             = true;
        bool           canCrushed           = false;
        float          tempLowDeath         = 243.15f;
        float          tempLowWarning       = 283.15f;
        float          tempBorn             = 293f;
        float          tempHighWarning      = 293.15f;
        float          tempHighDeath        = 343.15f;
        bool           pickup_only_from_top = true;
        bool           pickup_allow_mark    = true;
        bool           pickup_use_gun       = false;
        Tag            tag                  = GameTags.Creatures.Walker;
        Tag            species              = GameTags.Creatures.Species.HatchSpecies;
        float          attackValue          = 1f;

        ChoreTable.Builder chore_table = new ChoreTable.Builder().Add(new DeathStates.Def(), true).Add(new AnimInterruptStates.Def(), true).Add(new ExitBurrowStates.Def(), !is_baby).Add(new PlayAnimsStates.Def(GameTags.Creatures.Burrowed, true, "idle_mound", STRINGS.CREATURES.STATUSITEMS.BURROWED.NAME, STRINGS.CREATURES.STATUSITEMS.BURROWED.TOOLTIP), !is_baby).Add(new GrowUpStates.Def(), true).Add(new TrappedStates.Def(), true).Add(new IncubatingStates.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 AttackStates.Def(), !is_baby).PushInterruptGroup().Add(new CreatureSleepStates.Def(), true).Add(new FixedCaptureStates.Def(), true).Add(new RanchedStates.Def(), true).Add(new PlayAnimsStates.Def(GameTags.Creatures.WantsToEnterBurrow, false, "hide", STRINGS.CREATURES.STATUSITEMS.BURROWING.NAME, STRINGS.CREATURES.STATUSITEMS.BURROWING.TOOLTIP), !is_baby).Add(new LayEggStates.Def(), true).Add(new EatStates.Def(), true).Add(new PlayAnimsStates.Def(GameTags.Creatures.Poop, false, "poop", STRINGS.CREATURES.STATUSITEMS.EXPELLING_SOLID.NAME, STRINGS.CREATURES.STATUSITEMS.EXPELLING_SOLID.TOOLTIP), true).Add(new CallAdultStates.Def(), true).PopInterruptGroup().Add(new IdleStates.Def(), true);

        string adultId           = "HatchHard";
        string eggId             = "HatchHardBaby";
        string eggName           = "Stone Hatchling Egg";
        string anim_egg          = "egg_hatch_kanim";
        float  egg_mass          = 2f;
        string dropOnMature      = null;
        float  fertility_cycles  = 60f;
        float  incubation_cycles = 20f;
        int    egg_sortorder     = 2;
        List <FertilityMonitor.BreedingChance> egg_chances = new List <FertilityMonitor.BreedingChance>();

        egg_chances.Add(BreedingChance("HatchHardEgg", 1f));
        bool  is_ranchable = true;
        bool  is_fish      = false;
        float egg_scale    = 1f;

        float            calories_per_KG = 700000f / 140f;
        float            min_poop_KG     = 25;
        List <Diet.Info> diet_list       = BaseHatchConfig.HardRockDiet(SimHashes.Carbon.CreateTag(), calories_per_KG, TUNING.CREATURES.CONVERSION_EFFICIENCY.NORMAL, null, 0f);
        // end of configurations

        // basic generation
        object    obj           = Activator.CreateInstance(typeof(HatchHardConfig));
        KPrefabID obj_kPrefabID = (obj as HatchHardConfig).CreatePrefab().GetComponent <KPrefabID>();

        obj_kPrefabID.prefabInitFn  += (obj as HatchHardConfig).OnPrefabInit;
        obj_kPrefabID.prefabSpawnFn += (obj as HatchHardConfig).OnSpawn;
        Assets.AddPrefab(obj_kPrefabID);

        // advanced generation
        // critter = BaseHatchConfig.BaseHatch(id, name, desc, anim_file, traitId, is_baby, override_prefix);
        GameObject critter;

        critter = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, Assets.GetAnim(anim_file), "idle_loop", Grid.SceneLayer.Creatures, width, height, decor, default(EffectorValues), SimHashes.Creature, null, tempBorn);
        EntityTemplates.ExtendEntityToBasicCreature(critter, FactionManager.FactionID.Pest, traitId, navGridName, navi, 32, moveSpeed, dropOnDeath, dropCount, canDrown, canCrushed, tempLowWarning, tempHighWarning, tempLowDeath, tempHighDeath);
        if (override_prefix != null)
        {
            critter.AddOrGet <SymbolOverrideController>().ApplySymbolOverridesByAffix(Assets.GetAnim(anim_file), override_prefix, null, 0);
        }
        critter.AddOrGet <Trappable>();
        critter.AddOrGetDef <CreatureFallMonitor.Def>();
        critter.AddOrGetDef <BurrowMonitor.Def>();
        critter.AddOrGetDef <WorldSpawnableMonitor.Def>().adjustSpawnLocationCb = (int cell) => { return(cell); };//new Func<int, int>(BaseHatchConfig.AdjustSpawnLocationCB);
        critter.AddOrGetDef <ThreatMonitor.Def>().fleethresholdState            = Health.HealthState.Dead;
        critter.AddWeapon(attackValue, attackValue, AttackProperties.DamageType.Standard, AttackProperties.TargetType.Single, 1, 0f);
        EntityTemplates.CreateAndRegisterBaggedCreature(critter, pickup_only_from_top, pickup_allow_mark, pickup_use_gun);
        KPrefabID prefabID = critter.GetComponent <KPrefabID>();

        prefabID.AddTag(tag, false);
        prefabID.prefabInitFn += delegate(GameObject inst) { inst.GetAttributes().Add(Db.Get().Attributes.MaxUnderwaterTravelCost); };
        EntityTemplates.AddCreatureBrain(critter, chore_table, species, override_prefix);

        EntityTemplates.ExtendEntityToWildCreature(critter, space_requirement, lifespan);

        Diet diet = new Diet(diet_list.ToArray());

        CreatureCalorieMonitor.Def calorieMonitor = critter.AddOrGetDef <CreatureCalorieMonitor.Def>();
        calorieMonitor.diet = diet;
        calorieMonitor.minPoopSizeInCalories = calories_per_KG * min_poop_KG;
        critter.AddOrGetDef <SolidConsumerMonitor.Def>().diet = diet;

        if (is_baby)
        {
            EntityTemplates.ExtendEntityToBeingABaby(critter, adultId, dropOnMature);
        }
        else
        {
            EntityTemplates.ExtendEntityToFertileCreature(critter, eggId, eggName, desc, anim_egg,
                                                          egg_mass, eggId, fertility_cycles,
                                                          incubation_cycles, egg_chances,
                                                          egg_sortorder, is_ranchable, is_fish, true, egg_scale);
        }
    }
    /// Creates new critters which were not already loaded by EntityLoad ...
    public static void CreateNewCritters()
    {
        foreach (var setting in CustomizeCritterState.StateManager.State.critter_settings)
        {
            if (setting?.id == null)
            {
                continue;
            }

            if (Assets.Prefabs.Find(a => a.gameObject?.name == setting.id) == null)
            {
                // configurations
                string             id                = setting.id;
                string             name              = setting.name ?? "Stone Hatch";
                string             desc              = setting.desc ?? "Stone Hatches excrete solid Coal as waste and enjoy burrowing into the ground.";
                string             anim_file         = setting.anim_file ?? "hatch_kanim";
                bool               is_baby           = setting.is_baby ?? false;
                string             traitId           = setting.traitId ?? "HatchHardBaseTrait";
                string             override_prefix   = setting.override_prefix;
                int                space_requirement = setting.space_requirement ?? HatchTuning.PEN_SIZE_PER_CREATURE;
                float              lifespan          = setting.lifespan ?? 100f;
                float              mass              = setting.mass ?? 100f;
                float              width             = setting.width ?? 1f;
                float              height            = setting.height ?? 1f;
                EffectorValues     decor             = setting.decor ?? TUNING.DECOR.BONUS.TIER0;
                string             navGridName       = setting.navGridName ?? (!is_baby ? "WalkerNavGrid1x1" : "WalkerBabyNavGrid");
                NavType            navi; Enum.TryParse(setting.navi, out navi);// ?? NavType.Floor;
                float              moveSpeed            = setting.moveSpeed ?? 2f;
                string[]           dropOnDeath          = setting.dropOnDeath ?? new string[] { "Meat", "Meat" };
                bool               canDrown             = setting.canDrown ?? true;
                bool               canCrushed           = setting.canCrushed ?? false;
                float              tempLowDeath         = setting.tempLowDeath ?? 243.15f;
                float              tempLowWarning       = setting.tempLowWarning ?? 283.15f;
                float              tempBorn             = setting.tempBorn ?? 293f;
                float              tempHighWarning      = setting.tempHighWarning ?? 293.15f;
                float              tempHighDeath        = setting.tempHighDeath ?? 343.15f;
                bool               pickup_only_from_top = setting.pickup_only_from_top ?? true;
                bool               pickup_allow_mark    = setting.pickup_allow_mark ?? true;
                bool               pickup_use_gun       = setting.pickup_use_gun ?? false;
                string[]           tags        = setting.tags ?? new string[] { GameTags.Creatures.Walker.ToString() };
                Tag                species     = setting.species ?? GameTags.Creatures.Species.HatchSpecies;
                float              attackValue = setting.attackValue ?? 1f;
                ChoreTable.Builder chore_table = setting.chore_table ?? new ChoreTable.Builder().Add(new DeathStates.Def(), true).Add(new AnimInterruptStates.Def(), true).Add(new ExitBurrowStates.Def(), !is_baby).Add(new PlayAnimsStates.Def(GameTags.Creatures.Burrowed, true, "idle_mound", STRINGS.CREATURES.STATUSITEMS.BURROWED.NAME, STRINGS.CREATURES.STATUSITEMS.BURROWED.TOOLTIP), !is_baby).Add(new GrowUpStates.Def(), true).Add(new TrappedStates.Def(), true).Add(new IncubatingStates.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 AttackStates.Def(), !is_baby).PushInterruptGroup().Add(new CreatureSleepStates.Def(), true).Add(new FixedCaptureStates.Def(), true).Add(new RanchedStates.Def(), true).Add(new PlayAnimsStates.Def(GameTags.Creatures.WantsToEnterBurrow, false, "hide", STRINGS.CREATURES.STATUSITEMS.BURROWING.NAME, STRINGS.CREATURES.STATUSITEMS.BURROWING.TOOLTIP), !is_baby).Add(new LayEggStates.Def(), true).Add(new EatStates.Def(), true).Add(new PlayAnimsStates.Def(GameTags.Creatures.Poop, false, "poop", STRINGS.CREATURES.STATUSITEMS.EXPELLING_SOLID.NAME, STRINGS.CREATURES.STATUSITEMS.EXPELLING_SOLID.TOOLTIP), true).Add(new CallAdultStates.Def(), true).PopInterruptGroup().Add(new IdleStates.Def(), true);

                string adultId          = setting.adultId ?? "HatchHard";
                string eggId            = setting.eggId ?? "HatchHardEgg";
                string babyId           = setting.babyId ?? "HatchHardBaby";
                string dropOnMature     = setting.dropOnMature ?? null;
                float  fertility_cycles = setting.fertility_cycles ?? 60f;
                List <FertilityMonitor.BreedingChance> egg_chances = new List <FertilityMonitor.BreedingChance>();
                egg_chances.Add(BreedingChance("HatchHardEgg", 1f));
                bool is_ranchable = setting.is_ranchable ?? true;

                float            calories_per_KG = setting.calories_per_KG ?? (700000f / 140f);
                float            min_poop_KG     = setting.min_poop_KG ?? 25f;
                List <Diet.Info> diet_list       = setting.diet_list ?? BaseHatchConfig.HardRockDiet(SimHashes.Carbon.CreateTag(), calories_per_KG, TUNING.CREATURES.CONVERSION_EFFICIENCY.NORMAL, null, 0f);
                // end of configurations

                GameObject critter;
                critter = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, Assets.GetAnim(anim_file), "idle_loop", Grid.SceneLayer.Creatures, (int)width, (int)height, decor, default(EffectorValues), SimHashes.Creature, null, tempBorn);
                EntityTemplates.ExtendEntityToBasicCreature(critter, FactionManager.FactionID.Pest, traitId, navGridName, navi, 32, moveSpeed, "Meat", 2, canDrown, canCrushed, tempLowWarning, tempHighWarning, tempLowDeath, tempHighDeath);
                critter.AddOrGet <Butcherable>().SetDrops(dropOnDeath);
                if (override_prefix != null)
                {
                    critter.AddOrGet <SymbolOverrideController>().ApplySymbolOverridesByAffix(Assets.GetAnim(anim_file), override_prefix, null, 0);
                }
                critter.AddOrGet <Trappable>();
                critter.AddOrGetDef <CreatureFallMonitor.Def>();
                critter.AddOrGetDef <BurrowMonitor.Def>();
                critter.AddOrGetDef <WorldSpawnableMonitor.Def>().adjustSpawnLocationCb = (int cell) => { return(cell); };//new Func<int, int>(BaseHatchConfig.AdjustSpawnLocationCB);
                critter.AddOrGetDef <ThreatMonitor.Def>().fleethresholdState            = Health.HealthState.Dead;
                if (attackValue > 0f)
                {
                    critter.AddWeapon(attackValue, attackValue, AttackProperties.DamageType.Standard, AttackProperties.TargetType.Single, 1, 0f);
                }
                EntityTemplates.CreateAndRegisterBaggedCreature(critter, pickup_only_from_top, pickup_allow_mark, pickup_use_gun);
                KPrefabID prefabID = critter.GetComponent <KPrefabID>();
                prefabID.ProcessTags(tags);
                prefabID.prefabInitFn += delegate(GameObject inst) { inst.GetAttributes().Add(Db.Get().Attributes.MaxUnderwaterTravelCost); };
                EntityTemplates.AddCreatureBrain(critter, chore_table, species, override_prefix);

                EntityTemplates.ExtendEntityToWildCreature(critter, space_requirement, lifespan);

                Diet diet = new Diet(diet_list.ToArray());
                CreatureCalorieMonitor.Def calorieMonitor = critter.AddOrGetDef <CreatureCalorieMonitor.Def>();
                calorieMonitor.diet = diet;
                calorieMonitor.minPoopSizeInCalories = calories_per_KG * min_poop_KG;
                critter.AddOrGetDef <SolidConsumerMonitor.Def>().diet = diet;

                if (is_baby)
                {
                    EntityTemplates.ExtendEntityToBeingABaby(critter, adultId, dropOnMature);
                }
                else
                {
                    FertilityMonitor.Def def = critter.AddOrGetDef <FertilityMonitor.Def>();
                    def.baseFertileCycles      = fertility_cycles;
                    def.eggPrefab              = new Tag(eggId);
                    def.initialBreedingWeights = egg_chances;
                    KPrefabID creature_prefab_id = critter.GetComponent <KPrefabID>();
                    creature_prefab_id.prefabSpawnFn += delegate(GameObject inst)
                    {
                        WorldInventory.Instance.Discover(eggId.ToTag(), WorldInventory.GetCategoryForTags(egg_tags));
                        WorldInventory.Instance.Discover(babyId.ToTag(), WorldInventory.GetCategoryForTags(creature_prefab_id.Tags));
                    };
                    if (is_ranchable)
                    {
                        critter.AddOrGetDef <RanchableMonitor.Def>();
                    }
                    critter.AddOrGetDef <FixedCapturableMonitor.Def>();
                }

                if (setting.scales != null)
                {
                    ScaleGrowthMonitor.Def def_scale = critter.AddOrGetDef <ScaleGrowthMonitor.Def>();
                    def_scale.defaultGrowthRate  = setting.scales.growthRate ?? (setting.scales.growthRate ?? (1f / DreckoConfig.SCALE_GROWTH_TIME_IN_CYCLES / 600f));
                    def_scale.dropMass           = setting.scales.mass ?? (DreckoConfig.FIBER_PER_CYCLE * DreckoConfig.SCALE_GROWTH_TIME_IN_CYCLES);
                    def_scale.itemDroppedOnShear = setting.scales.drop ?? "Dirt";
                    def_scale.levelCount         = setting.scales.levelCount ?? 6;
                    def_scale.targetAtmosphere   = (setting.scales.atmosphere ?? "Void").ToSimHash();
                }

                if (setting.expulsion != null)
                {
                    ElementDropperMonitor.Def def_morb = critter.AddOrGetDef <ElementDropperMonitor.Def>();
                    def_morb.dirtyEmitElement        = (setting.expulsion.element ?? "Dirt").ToSimHash();
                    def_morb.dirtyProbabilityPercent = setting.expulsion.probability ?? 25f;
                    def_morb.dirtyCellToTargetMass   = setting.expulsion.cellTargetMass ?? 1f;
                    def_morb.dirtyMassPerDirty       = setting.expulsion.massPerDirt ?? 0.2f;
                    def_morb.dirtyMassReleaseOnDeath = setting.expulsion.onDeath ?? 3f;
                    def_morb.emitDiseaseIdx          = Db.Get().Diseases.GetIndex(setting.expulsion.diseaseId ?? "");
                    def_morb.emitDiseasePerKg        = setting.expulsion.diseaseAmount ?? 0f;
                }

                if (setting.light != null)
                {
                    if (setting.light.color != Color.black)
                    {
                        Light2D light2D = critter.AddOrGet <Light2D>();
                        light2D.Color         = setting.light.color ?? Color.white;
                        light2D.overlayColour = TUNING.LIGHT2D.LIGHTBUG_OVERLAYCOLOR;
                        light2D.Range         = setting.light.range ?? 5f;
                        light2D.Angle         = 0f;
                        light2D.Direction     = TUNING.LIGHT2D.LIGHTBUG_DIRECTION;
                        light2D.Offset        = TUNING.LIGHT2D.LIGHTBUG_OFFSET;
                        light2D.shape         = LightShape.Circle;
                        light2D.drawOverlay   = true;
                        light2D.Lux           = setting.light.lux ?? 1800;
                        critter.AddOrGet <LightSymbolTracker>().targetSymbol = "snapTo_light_locator";
                        critter.AddOrGetDef <CreatureLightToggleController.Def>();
                    }
                }
            }
        }
    }