public GameObject CreatePrefab() { string id = "BeanPlant"; string name = STRINGS.CREATURES.SPECIES.BEAN_PLANT.NAME; string desc = STRINGS.CREATURES.SPECIES.BEAN_PLANT.DESC; float mass = 2f; KAnimFile anim = Assets.GetAnim("beanplant_kanim"); string initialAnim = "idle_empty"; EffectorValues tIER = DECOR.BONUS.TIER1; GameObject gameObject = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, anim, initialAnim, Grid.SceneLayer.BuildingFront, 1, 2, tIER, default(EffectorValues), SimHashes.Creature, null, 258.15f); EntityTemplates.ExtendEntityToBasicPlant(gameObject, 198.15f, 248.15f, 273.15f, 323.15f, null, true, 0f, 0.15f, "BeanPlantSeed", true, true, true, true, 2400f); EntityTemplates.ExtendPlantToIrrigated(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = SimHashes.Ethanol.CreateTag(), massConsumptionRate = 0.0333333351f } }); EntityTemplates.ExtendPlantToFertilizable(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = SimHashes.Dirt.CreateTag(), massConsumptionRate = 0.008333334f } }); PressureVulnerable pressureVulnerable = gameObject.AddOrGet <PressureVulnerable>(); PressureVulnerable pressureVulnerable2 = pressureVulnerable; mass = 0.025f; float pressureLethalLow = 0f; SimHashes[] safeAtmospheres = new SimHashes[1] { SimHashes.CarbonDioxide }; pressureVulnerable2.Configure(mass, pressureLethalLow, 10f, 30f, safeAtmospheres); UprootedMonitor component = gameObject.GetComponent <UprootedMonitor>(); component.monitorCell = new CellOffset(0, -1); gameObject.AddOrGet <StandardCropPlant>(); GameObject plant = gameObject; SeedProducer.ProductionType productionType = SeedProducer.ProductionType.Harvest; initialAnim = "BeanPlantSeed"; desc = STRINGS.CREATURES.SPECIES.SEEDS.BEAN_PLANT.NAME; name = STRINGS.CREATURES.SPECIES.SEEDS.BEAN_PLANT.DESC; anim = Assets.GetAnim("seed_beanplant_kanim"); List <Tag> list = new List <Tag>(); list.Add(GameTags.CropSeed); list = list; GameObject gameObject2 = EntityTemplates.CreateAndRegisterSeedForPlant(plant, productionType, initialAnim, desc, name, anim, "object", 1, list, SingleEntityReceptacle.ReceptacleDirection.Top, default(Tag), 4, STRINGS.CREATURES.SPECIES.BEAN_PLANT.DOMESTICATEDDESC, EntityTemplates.CollisionShape.RECTANGLE, 0.6f, 0.3f, null, string.Empty, false); EntityTemplates.ExtendEntityToFood(gameObject2, FOOD.FOOD_TYPES.BEAN); EntityTemplates.CreateAndRegisterPreviewForPlant(gameObject2, "BeanPlant_preview", Assets.GetAnim("beanplant_kanim"), "place", 1, 2); return(gameObject); }
public GameObject CreatePrefab() { GameObject placedEntity = EntityTemplates.CreatePlacedEntity(ID, DisplayName, Description, 1 , Assets.GetAnim("sea_lettuce_kanim"), "idle_empty", Grid.SceneLayer.BuildingBack, 1, 2, TUNING.DECOR.BONUS.TIER0, new EffectorValues(), SimHashes.Creature, null, 308.15f); GameObject template = placedEntity; float temperature_lethal_low = 263.15f; // -10C float temperature_warning_low = 258.15f; // -15C float temperature_warning_high = 383.15f; // 110C float temperature_lethal_high = 388.15f; // 115C bool pressure_sensitive = false; SimHashes[] safe_elements = new SimHashes[4] { SimHashes.Water, SimHashes.DirtyWater, SimHashes.SaltWater, SimHashes.Brine }; EntityTemplates.ExtendEntityToBasicPlant(template, temperature_lethal_low, temperature_warning_low, temperature_warning_high, temperature_lethal_high, safe_elements, pressure_sensitive, 0, 0.15f , CropId, false , true, true, true, 2400f); EntityTemplates.ExtendPlantToFertilizable(placedEntity, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo() { tag = SimHashes.Dirt.CreateTag(), massConsumptionRate = 0.0008333334f } }); //var drownMonitor = placedEntity.GetComponent<DrowningMonitor>(); //drownMonitor.canDrownToDeath = false; //drownMonitor.livesUnderWater = true; placedEntity.AddOrGet <StandardCropPlant>(); placedEntity.AddOrGet <KAnimControllerBase>().randomiseLoopedOffset = true; placedEntity.AddOrGet <LoopingSounds>(); EntityTemplates.CreateAndRegisterPreviewForPlant( EntityTemplates.CreateAndRegisterSeedForPlant(placedEntity, SeedProducer.ProductionType.Harvest , ID + "Seed", DisplayName, Description , Assets.GetAnim("seed_sealettuce_kanim"), "object", 0 , new List <Tag>() { TagManager.Create(nameof(SeedName)) } , SingleEntityReceptacle.ReceptacleDirection.Top, new Tag(), 1 , DomesticateDesc , EntityTemplates.CollisionShape.CIRCLE, 0.25f, 0.25f, null, string.Empty, false) , ID + "_preview", Assets.GetAnim("sea_lettuce_kanim"), "place", 1, 2); var soundInst = SoundEventVolumeCache.instance; soundInst.AddVolume("sea_lettuce_kanim", "SeaLettuce_grow", TUNING.NOISE_POLLUTION.CREATURES.TIER3); soundInst.AddVolume("sea_lettuce_kanim", "SeaLettuce_harvest", TUNING.NOISE_POLLUTION.CREATURES.TIER3); return(placedEntity); }
public GameObject CreatePrefab() { string id = "ForestTree"; string name = STRINGS.CREATURES.SPECIES.WOOD_TREE.NAME; string desc = STRINGS.CREATURES.SPECIES.WOOD_TREE.DESC; float mass = 2f; KAnimFile anim = Assets.GetAnim("tree_kanim"); string initialAnim = "idle_empty"; EffectorValues tIER = DECOR.BONUS.TIER1; List <Tag> additionalTags = new List <Tag>(); GameObject gameObject = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, anim, initialAnim, Grid.SceneLayer.Building, 1, 2, tIER, default(EffectorValues), SimHashes.Creature, additionalTags, 298.15f); EntityTemplates.ExtendEntityToBasicPlant(gameObject, 258.15f, 288.15f, 313.15f, 448.15f, null, true, 0f, 0.15f, "WoodLog", true, true, true, false, 2400f); gameObject.AddOrGet <BuddingTrunk>(); gameObject.UpdateComponentRequirement <Harvestable>(false); Tag tag = ElementLoader.FindElementByHash(SimHashes.DirtyWater).tag; EntityTemplates.ExtendPlantToIrrigated(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = tag, massConsumptionRate = 0.116666667f } }); EntityTemplates.ExtendPlantToFertilizable(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = GameTags.Dirt, massConsumptionRate = 0.0166666675f } }); gameObject.AddComponent <StandardCropPlant>(); UprootedMonitor component = gameObject.GetComponent <UprootedMonitor>(); component.monitorCell = new CellOffset(0, -1); BuddingTrunk buddingTrunk = gameObject.AddOrGet <BuddingTrunk>(); buddingTrunk.budPrefabID = "ForestTreeBranch"; GameObject plant = gameObject; SeedProducer.ProductionType productionType = SeedProducer.ProductionType.Hidden; initialAnim = "ForestTreeSeed"; desc = STRINGS.CREATURES.SPECIES.SEEDS.WOOD_TREE.NAME; name = STRINGS.CREATURES.SPECIES.SEEDS.WOOD_TREE.DESC; anim = Assets.GetAnim("seed_tree_kanim"); additionalTags = new List <Tag>(); additionalTags.Add(GameTags.CropSeed); additionalTags = additionalTags; GameObject seed = EntityTemplates.CreateAndRegisterSeedForPlant(plant, productionType, initialAnim, desc, name, anim, "object", 1, additionalTags, SingleEntityReceptacle.ReceptacleDirection.Top, default(Tag), 4, STRINGS.CREATURES.SPECIES.WOOD_TREE.DOMESTICATEDDESC, EntityTemplates.CollisionShape.CIRCLE, 0.3f, 0.3f, null, string.Empty, false); EntityTemplates.CreateAndRegisterPreviewForPlant(seed, "ForestTree_preview", Assets.GetAnim("tree_kanim"), "place", 3, 3); return(gameObject); }
public GameObject CreatePrefab() { string id = "ColdWheat"; string name = STRINGS.CREATURES.SPECIES.COLDWHEAT.NAME; string desc = STRINGS.CREATURES.SPECIES.COLDWHEAT.DESC; float mass = 1f; KAnimFile anim = Assets.GetAnim("coldwheat_kanim"); string initialAnim = "idle_empty"; EffectorValues tIER = DECOR.BONUS.TIER1; GameObject gameObject = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, anim, initialAnim, Grid.SceneLayer.BuildingFront, 1, 1, tIER, default(EffectorValues), SimHashes.Creature, null, 255f); EntityTemplates.ExtendEntityToBasicPlant(gameObject, 118.149994f, 218.15f, 278.15f, 358.15f, new SimHashes[3] { SimHashes.Oxygen, SimHashes.ContaminatedOxygen, SimHashes.CarbonDioxide }, true, 0f, 0.15f, "ColdWheatSeed", true, true, true, true, 2400f); EntityTemplates.ExtendPlantToFertilizable(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = GameTags.Dirt, massConsumptionRate = 0.008333334f } }); EntityTemplates.ExtendPlantToIrrigated(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = GameTags.Water, massConsumptionRate = 0.0333333351f } }); gameObject.AddOrGet <StandardCropPlant>(); GameObject plant = gameObject; SeedProducer.ProductionType productionType = SeedProducer.ProductionType.DigOnly; initialAnim = "ColdWheatSeed"; desc = STRINGS.CREATURES.SPECIES.SEEDS.COLDWHEAT.NAME; name = STRINGS.CREATURES.SPECIES.SEEDS.COLDWHEAT.DESC; anim = Assets.GetAnim("seed_coldwheat_kanim"); List <Tag> list = new List <Tag>(); list.Add(GameTags.CropSeed); list = list; id = STRINGS.CREATURES.SPECIES.COLDWHEAT.DOMESTICATEDDESC; GameObject gameObject2 = EntityTemplates.CreateAndRegisterSeedForPlant(plant, productionType, initialAnim, desc, name, anim, "object", 1, list, SingleEntityReceptacle.ReceptacleDirection.Top, default(Tag), 2, id, EntityTemplates.CollisionShape.CIRCLE, 0.2f, 0.2f, null, string.Empty, true); EntityTemplates.ExtendEntityToFood(gameObject2, FOOD.FOOD_TYPES.COLD_WHEAT_SEED); EntityTemplates.CreateAndRegisterPreviewForPlant(gameObject2, "ColdWheat_preview", Assets.GetAnim("coldwheat_kanim"), "place", 1, 1); SoundEventVolumeCache.instance.AddVolume("coldwheat_kanim", "ColdWheat_grow", NOISE_POLLUTION.CREATURES.TIER3); SoundEventVolumeCache.instance.AddVolume("coldwheat_kanim", "ColdWheat_harvest", NOISE_POLLUTION.CREATURES.TIER3); return(gameObject); }
public GameObject CreatePrefab() { string id = "MushroomPlant"; string name = STRINGS.CREATURES.SPECIES.MUSHROOMPLANT.NAME; string desc = STRINGS.CREATURES.SPECIES.MUSHROOMPLANT.DESC; float mass = 1f; KAnimFile anim = Assets.GetAnim("fungusplant_kanim"); string initialAnim = "idle_empty"; EffectorValues tIER = DECOR.BONUS.TIER1; GameObject gameObject = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, anim, initialAnim, Grid.SceneLayer.BuildingFront, 1, 2, tIER, default(EffectorValues), SimHashes.Creature, null, 293f); GameObject template = gameObject; mass = 228.15f; float temperature_warning_low = 278.15f; float temperature_warning_high = 308.15f; float temperature_lethal_high = 398.15f; SimHashes[] safe_elements = new SimHashes[1] { SimHashes.CarbonDioxide }; initialAnim = MushroomConfig.ID; EntityTemplates.ExtendEntityToBasicPlant(template, mass, temperature_warning_low, temperature_warning_high, temperature_lethal_high, safe_elements, true, 0f, 0.15f, initialAnim, true, true, true, true, 2400f); EntityTemplates.ExtendPlantToFertilizable(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = GameTags.SlimeMold, massConsumptionRate = 0.006666667f } }); gameObject.AddOrGet <StandardCropPlant>(); IlluminationVulnerable illuminationVulnerable = gameObject.AddOrGet <IlluminationVulnerable>(); illuminationVulnerable.SetPrefersDarkness(true); template = gameObject; SeedProducer.ProductionType productionType = SeedProducer.ProductionType.Harvest; initialAnim = "MushroomSeed"; desc = STRINGS.CREATURES.SPECIES.SEEDS.MUSHROOMPLANT.NAME; name = STRINGS.CREATURES.SPECIES.SEEDS.MUSHROOMPLANT.DESC; anim = Assets.GetAnim("seed_fungusplant_kanim"); int numberOfSeeds = 0; List <Tag> list = new List <Tag>(); list.Add(GameTags.CropSeed); list = list; id = STRINGS.CREATURES.SPECIES.MUSHROOMPLANT.DOMESTICATEDDESC; GameObject seed = EntityTemplates.CreateAndRegisterSeedForPlant(template, productionType, initialAnim, desc, name, anim, "object", numberOfSeeds, list, SingleEntityReceptacle.ReceptacleDirection.Top, default(Tag), 2, id, EntityTemplates.CollisionShape.CIRCLE, 0.33f, 0.33f, null, string.Empty, false); EntityTemplates.CreateAndRegisterPreviewForPlant(seed, "MushroomPlant_preview", Assets.GetAnim("fungusplant_kanim"), "place", 1, 2); SoundEventVolumeCache.instance.AddVolume("bristleblossom_kanim", "PrickleFlower_harvest", NOISE_POLLUTION.CREATURES.TIER3); SoundEventVolumeCache.instance.AddVolume("bristleblossom_kanim", "PrickleFlower_harvest", NOISE_POLLUTION.CREATURES.TIER3); return(gameObject); }
public GameObject CreatePrefab() { string id = "BasicSingleHarvestPlant"; string name = STRINGS.CREATURES.SPECIES.BASICSINGLEHARVESTPLANT.NAME; string desc = STRINGS.CREATURES.SPECIES.BASICSINGLEHARVESTPLANT.DESC; float mass = 1f; KAnimFile anim = Assets.GetAnim("meallice_kanim"); string initialAnim = "idle_empty"; EffectorValues tIER = DECOR.PENALTY.TIER1; GameObject gameObject = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, anim, initialAnim, Grid.SceneLayer.BuildingBack, 1, 2, tIER, default(EffectorValues), SimHashes.Creature, null, 293f); GameObject template = gameObject; SimHashes[] safe_elements = new SimHashes[3] { SimHashes.Oxygen, SimHashes.ContaminatedOxygen, SimHashes.CarbonDioxide }; EntityTemplates.ExtendEntityToBasicPlant(template, 218.15f, 283.15f, 303.15f, 398.15f, safe_elements, true, 0f, 0.15f, "BasicPlantFood", true, false, true, true, 2400f); gameObject.AddOrGet <StandardCropPlant>(); gameObject.AddOrGet <KAnimControllerBase>().randomiseLoopedOffset = true; gameObject.AddOrGet <LoopingSounds>(); template = gameObject; SeedProducer.ProductionType productionType = SeedProducer.ProductionType.Harvest; initialAnim = "BasicSingleHarvestPlantSeed"; desc = STRINGS.CREATURES.SPECIES.SEEDS.BASICSINGLEHARVESTPLANT.NAME; name = STRINGS.CREATURES.SPECIES.SEEDS.BASICSINGLEHARVESTPLANT.DESC; anim = Assets.GetAnim("seed_meallice_kanim"); int numberOfSeeds = 0; List <Tag> list = new List <Tag>(); list.Add(GameTags.CropSeed); list = list; id = STRINGS.CREATURES.SPECIES.BASICSINGLEHARVESTPLANT.DOMESTICATEDDESC; GameObject seed = EntityTemplates.CreateAndRegisterSeedForPlant(template, productionType, initialAnim, desc, name, anim, "object", numberOfSeeds, list, SingleEntityReceptacle.ReceptacleDirection.Top, default(Tag), 1, id, EntityTemplates.CollisionShape.CIRCLE, 0.3f, 0.3f, null, string.Empty, false); EntityTemplates.ExtendPlantToFertilizable(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = GameTags.Dirt, massConsumptionRate = 0.0166666675f } }); EntityTemplates.CreateAndRegisterPreviewForPlant(seed, "BasicSingleHarvestPlant_preview", Assets.GetAnim("meallice_kanim"), "place", 1, 2); SoundEventVolumeCache.instance.AddVolume("meallice_kanim", "MealLice_harvest", NOISE_POLLUTION.CREATURES.TIER3); SoundEventVolumeCache.instance.AddVolume("meallice_kanim", "MealLice_LP", NOISE_POLLUTION.CREATURES.TIER4); return(gameObject); }
public GameObject CreatePrefab() { var placedEntity = EntityTemplates.CreatePlacedEntity( id: Id, name: Name, desc: Description, mass: 1f, anim: Assets.GetAnim("magmafern"), initialAnim: "idle_empty", sceneLayer: Grid.SceneLayer.BuildingFront, width: 1, height: 1, decor: TUNING.DECOR.BONUS.TIER2, defaultTemperature: DefaultTemperature); EntityTemplates.ExtendEntityToBasicPlant( template: placedEntity, temperature_lethal_low: TemperatureLethalLow, temperature_warning_low: TemperatureWarningLow, temperature_warning_high: TemperatureWarningHigh, temperature_lethal_high: TemperatureLethalHigh, safe_elements: new[] { SimHashes.Magma }, pressure_sensitive: false, crop_id: SeedId); EntityTemplates.ExtendPlantToFertilizable( template: placedEntity, fertilizers: new[] { new PlantElementAbsorber.ConsumeInfo() { tag = ElementLoader.FindElementByHash(SimHashes.Obsidian).tag, massConsumptionRate = FertilizationRate } }) ; EntityTemplates.ExtendPlantToIrrigated( template: placedEntity, info: new PlantElementAbsorber.ConsumeInfo() { tag = ElementLoader.FindElementByHash(SimHashes.Magma).tag, massConsumptionRate = IrrigationRate }); placedEntity.AddOrGet <StandardCropPlant>(); var seed = EntityTemplates.CreateAndRegisterSeedForPlant( plant: placedEntity, productionType: SeedProducer.ProductionType.DigOnly, id: SeedId, name: SeedName, desc: SeedDescription, anim: Assets.GetAnim("seed_magmafern"), initialAnim: "object", numberOfSeeds: 1, additionalTags: new List <Tag>() { GameTags.CropSeed }, planterDirection: SingleEntityReceptacle.ReceptacleDirection.Top, replantGroundTag: new Tag(), sortOrder: 2, domesticatedDescription: DomesticatedDescription, collisionShape: EntityTemplates.CollisionShape.CIRCLE, width: 0.2f, height: 0.2f, ignoreDefaultSeedTag: true); var foodInfo = new EdiblesManager.FoodInfo( SeedId, caloriesPerUnit: 0.0f, quality: 0, preserveTemperatue: PreserveTemperature, rotTemperature: RotTemperature, spoilTime: TUNING.FOOD.SPOIL_TIME.SLOW, can_rot: true); EntityTemplates.ExtendEntityToFood( template: seed, foodInfo: foodInfo); EntityTemplates.CreateAndRegisterPreviewForPlant( seed: seed, id: "MagmaFern_preview", anim: Assets.GetAnim("magmafern"), initialAnim: "place", width: 1, height: 1); SoundEventVolumeCache.instance.AddVolume("magmafern", "MagmaFern_grow", TUNING.NOISE_POLLUTION.CREATURES.TIER3); SoundEventVolumeCache.instance.AddVolume("magmafern", "MagmaFern_harvest", TUNING.NOISE_POLLUTION.CREATURES.TIER3); return(placedEntity); }
public GameObject CreatePrefab() { GameObject gameObject = EntityTemplates.CreatePlacedEntity("ColdBreather", STRINGS.CREATURES.SPECIES.COLDBREATHER.NAME, STRINGS.CREATURES.SPECIES.COLDBREATHER.DESC, 400f, Assets.GetAnim("coldbreather_kanim"), "grow_seed", Grid.SceneLayer.BuildingFront, 1, 2, DECOR.BONUS.TIER1, NOISE_POLLUTION.NOISY.TIER2, SimHashes.Creature, null, 293f); gameObject.AddOrGet <ReceptacleMonitor>(); gameObject.AddOrGet <EntombVulnerable>(); gameObject.AddOrGet <WiltCondition>(); gameObject.AddOrGet <Prioritizable>(); gameObject.AddOrGet <Uprootable>(); gameObject.AddOrGet <UprootedMonitor>(); gameObject.AddOrGet <DrowningMonitor>(); EntityTemplates.ExtendPlantToFertilizable(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = SimHashes.Phosphorite.CreateTag(), massConsumptionRate = 0.006666667f } }); TemperatureVulnerable temperatureVulnerable = gameObject.AddOrGet <TemperatureVulnerable>(); temperatureVulnerable.Configure(213.15f, 183.15f, 368.15f, 463.15f); gameObject.AddOrGet <OccupyArea>().objectLayers = new ObjectLayer[1] { ObjectLayer.Building }; ColdBreather coldBreather = gameObject.AddOrGet <ColdBreather>(); coldBreather.deltaEmitTemperature = -5f; coldBreather.emitOffsetCell = new Vector3(0f, 1f); coldBreather.consumptionRate = 1f; gameObject.AddOrGet <KBatchedAnimController>().randomiseLoopedOffset = true; Storage storage = BuildingTemplates.CreateDefaultStorage(gameObject, false); storage.showInUI = false; ElementConsumer elementConsumer = gameObject.AddOrGet <ElementConsumer>(); elementConsumer.storeOnConsume = true; elementConsumer.configuration = ElementConsumer.Configuration.AllGas; elementConsumer.capacityKG = 2f; elementConsumer.consumptionRate = 0.25f; elementConsumer.consumptionRadius = 1; elementConsumer.sampleCellOffset = new Vector3(0f, 0f); SimTemperatureTransfer component = gameObject.GetComponent <SimTemperatureTransfer>(); component.SurfaceArea = 10f; component.Thickness = 0.001f; GameObject plant = gameObject; SeedProducer.ProductionType productionType = SeedProducer.ProductionType.Hidden; string id = "ColdBreatherSeed"; string name = STRINGS.CREATURES.SPECIES.SEEDS.COLDBREATHER.NAME; string desc = STRINGS.CREATURES.SPECIES.SEEDS.COLDBREATHER.DESC; KAnimFile anim = Assets.GetAnim("seed_coldbreather_kanim"); List <Tag> list = new List <Tag>(); list.Add(GameTags.CropSeed); list = list; GameObject seed = EntityTemplates.CreateAndRegisterSeedForPlant(plant, productionType, id, name, desc, anim, "object", 1, list, SingleEntityReceptacle.ReceptacleDirection.Top, default(Tag), 2, STRINGS.CREATURES.SPECIES.COLDBREATHER.DOMESTICATEDDESC, EntityTemplates.CollisionShape.CIRCLE, 0.3f, 0.3f, null, string.Empty, false); EntityTemplates.CreateAndRegisterPreviewForPlant(seed, "ColdBreather_preview", Assets.GetAnim("coldbreather_kanim"), "place", 1, 2); SoundEventVolumeCache.instance.AddVolume("coldbreather_kanim", "ColdBreather_grow", NOISE_POLLUTION.CREATURES.TIER3); SoundEventVolumeCache.instance.AddVolume("coldbreather_kanim", "ColdBreather_intake", NOISE_POLLUTION.CREATURES.TIER3); return(gameObject); }
}; //wilt1, grow_seed public static void ProcessPlant(GameObject plant) { PlantData setting = CustomizePlantsState.StateManager.State.PlantSettings?.FirstOrDefault(t => t.id == plant.name); if (setting == null) { return; } #region decor plant fixes if (setting.fruitId != null) //decor plant fixes { PrickleGrass grass = plant.GetComponent <PrickleGrass>(); if (grass != null || plant.name == ColdBreatherConfig.ID || plant.name == EvilFlowerConfig.ID) { UnityEngine.Object.DestroyImmediate(grass); //what happens if this is null? plant.AddOrGet <StandardCropPlant>(); KPrefabID prefab = plant.GetComponent <KPrefabID>(); prefab.prefabInitFn += (inst => { StandardCropPlant stdcrop2 = inst.GetComponent <StandardCropPlant>(); stdcrop2.anims = PlantHelper.DecorAnim; }); //KBatchedAnimController kbatchedAnimController = plant.AddOrGet<KBatchedAnimController>(); //kbatchedAnimController.AnimFiles = new KAnimFile[1] //{ // Assets.GetAnim("bristleblossom_kanim") //}; //kbatchedAnimController.initialAnim = "idle_empty"; } SeedProducer seed = plant.GetComponent <SeedProducer>(); if (seed != null) { seed.seedInfo.productionType = SeedProducer.ProductionType.Harvest; seed.seedInfo.newSeedsProduced = 1; } } #endregion #region fruitId if (setting.fruitId != null || setting.fruit_grow_time != null || setting.fruit_amount != null) //actual setting fruit { Crop crop = plant.AddOrGet <Crop>(); Crop.CropVal cropval = crop.cropVal; //this is a copy if (setting.fruitId != null) { cropval.cropId = setting.fruitId; } if (cropval.cropId == "") { cropval.cropId = "WoodLog"; } if (setting.fruit_grow_time != null) { cropval.cropDuration = (float)setting.fruit_grow_time; } if (cropval.cropDuration < 1f) { cropval.cropDuration = 1f; } if (setting.fruit_amount != null) { cropval.numProduced = (int)setting.fruit_amount; } if (cropval.numProduced < 1) { cropval.numProduced = 1; } crop.Configure(cropval); KPrefabID prefab = plant.GetComponent <KPrefabID>(); GeneratedBuildings.RegisterWithOverlay(OverlayScreen.HarvestableIDs, prefab.PrefabID().ToString()); Growing growing = plant.AddOrGet <Growing>(); growing.growthTime = cropval.cropDuration; if (setting.id != ForestTreeConfig.ID) // don't harvest arbor trees directly { plant.AddOrGet <Harvestable>(); } plant.AddOrGet <HarvestDesignatable>(); plant.AddOrGet <StandardCropPlant>(); } #endregion #region irrigation if (setting.irrigation != null) { RemoveIrrigation(plant); List <PlantElementAbsorber.ConsumeInfo> irrigation = new List <PlantElementAbsorber.ConsumeInfo>(3); List <PlantElementAbsorber.ConsumeInfo> fertilization = new List <PlantElementAbsorber.ConsumeInfo>(3); foreach (KeyValuePair <string, float> entry in setting.irrigation) { if (GameTags.LiquidElements.Contains(entry.Key)) { irrigation.Add(new PlantElementAbsorber.ConsumeInfo(entry.Key, entry.Value / 600f)); } else if (GameTags.SolidElements.Contains(entry.Key)) { fertilization.Add(new PlantElementAbsorber.ConsumeInfo(entry.Key, entry.Value / 600f)); } else { Debug.Log(ToDialog("Irrigation for " + setting.id + " defines bad element: " + entry.Key)); } } if (irrigation.Count > 0) { EntityTemplates.ExtendPlantToIrrigated(plant, irrigation.ToArray()); } if (fertilization.Count > 0) { EntityTemplates.ExtendPlantToFertilizable(plant, fertilization.ToArray()); } } #endregion #region illumination if (setting.illumination != null) { IlluminationVulnerable illumination = plant.GetComponent <IlluminationVulnerable>(); CropSleepingMonitor.Def cropSleep = plant.GetDef <CropSleepingMonitor.Def>(); if (setting.illumination == 0f) { if (illumination != null) { UnityEngine.Object.DestroyImmediate(illumination); } if (cropSleep != null) { FumLib.FumTools.RemoveDef(plant, cropSleep); } } else if (setting.illumination < 0f) { if (illumination == null) { illumination = plant.AddOrGet <IlluminationVulnerable>(); } if (cropSleep != null) { FumLib.FumTools.RemoveDef(plant, cropSleep); } illumination.SetPrefersDarkness(true); } else if (setting.illumination == 1f) { if (illumination == null) { illumination = plant.AddOrGet <IlluminationVulnerable>(); } if (cropSleep != null) { FumLib.FumTools.RemoveDef(plant, cropSleep); } illumination.SetPrefersDarkness(false); } else { if (illumination != null) { UnityEngine.Object.DestroyImmediate(illumination); } if (cropSleep == null) { cropSleep = plant.AddOrGetDef <CropSleepingMonitor.Def>(); } cropSleep.lightIntensityThreshold = (float)setting.illumination; cropSleep.prefersDarkness = false; } } #endregion #region safe_elements if (setting.safe_elements != null) { plant.GetComponent <KPrefabID>().prefabInitFn += (inst => { PressureVulnerable pressure = inst.GetComponent <PressureVulnerable>(); pressure.safe_atmospheres.Clear(); foreach (string safe_element in setting.safe_elements) { pressure.safe_atmospheres.Add(ElementLoader.FindElementByName(safe_element)); } }); } #endregion #region pressure if (setting.pressures != null) { PressureVulnerable pressure = plant.AddOrGet <PressureVulnerable>(); pressure.pressureLethal_Low = 0f; pressure.pressureWarning_Low = 0f; pressure.pressureWarning_High = float.MaxValue; pressure.pressureLethal_High = float.MaxValue; pressure.pressure_sensitive = false; for (int i = 0; i < setting.pressures.Length; i++) { switch (i) { case 0: pressure.pressureLethal_Low = setting.pressures[i]; pressure.pressure_sensitive = true; break; case 1: pressure.pressureWarning_Low = setting.pressures[i]; break; case 2: pressure.pressureWarning_High = setting.pressures[i]; break; case 3: pressure.pressureLethal_High = setting.pressures[i]; break; } } } #endregion #region decor try { if (setting.decor_value != null) { plant.GetComponent <DecorProvider>().baseDecor = (float)setting.decor_value; } if (setting.decor_radius != null) { plant.GetComponent <DecorProvider>().baseRadius = (float)setting.decor_radius; } } catch (Exception) { Debug.LogWarning("[CustomizePlants] For some weird reason " + plant.name + " has no DecorProvider."); } #endregion #region temperatures if (setting.temperatures != null) { TemperatureVulnerable temperature = plant.AddOrGet <TemperatureVulnerable>(); for (int i = 0; i < setting.temperatures.Length; i++) { switch (i) { case 0: temperature.internalTemperatureLethal_Low = setting.temperatures[i]; break; case 1: temperature.internalTemperatureWarning_Low = setting.temperatures[i]; break; case 2: temperature.internalTemperatureWarning_High = setting.temperatures[i]; break; case 3: temperature.internalTemperatureLethal_High = setting.temperatures[i]; break; } } } #endregion #region submerged_threshold if (setting.submerged_threshold != null) { DrowningMonitor drowning = plant.AddOrGet <DrowningMonitor>(); if (setting.submerged_threshold == 0f) //doesn't care about water { UnityEngine.Object.DestroyImmediate(drowning); } else if (setting.submerged_threshold < 0f) //needs water { drowning.livesUnderWater = true; drowning.canDrownToDeath = false; } else //if(setting.submerged_threshold > 0f) //hates water { drowning.livesUnderWater = false; drowning.canDrownToDeath = false; } } #endregion #region can_tinker if (setting.can_tinker != null) { if (setting.can_tinker == true) { Tinkerable.MakeFarmTinkerable(plant); } } #endregion #region require_solid_tile if (setting.require_solid_tile != null) { UprootedMonitor uproot = plant.AddOrGet <UprootedMonitor>(); if (setting.require_solid_tile == false) { UnityEngine.Object.DestroyImmediate(uproot); } } #endregion #region max_age if (setting.max_age != null && plant.GetComponent <StandardCropPlant>() != null) //only if plant has fruit { Growing growing = plant.AddOrGet <Growing>(); if (setting.max_age <= 0) { growing.shouldGrowOld = false; } else { growing.shouldGrowOld = true; growing.maxAge = (float)setting.max_age; } } #endregion #region disease if (setting.disease != null || setting.disease_amount != null) { DiseaseDropper.Def def = plant.AddOrGetDef <DiseaseDropper.Def>(); if (setting.disease != null) { def.diseaseIdx = Db.Get().Diseases.GetIndex(setting.disease); } if (setting.disease_amount != null) { def.singleEmitQuantity = (int)setting.disease_amount; } if (def.diseaseIdx == byte.MaxValue || def.singleEmitQuantity == 0) { FumLib.FumTools.RemoveDef(plant, def); } } #endregion #region input_element if (setting.input_element != null) { ElementConsumer consumer = plant.AddOrGet <ElementConsumer>(); Element element = ElementLoader.FindElementByName(setting.input_element); if (element == null || element.IsSolid) //invalid element { Debug.Log(ToDialog("input_element is bad element: " + setting.input_element)); UnityEngine.Object.DestroyImmediate(consumer); } else if (setting.input_rate <= 0f) //delete consumer { UnityEngine.Object.DestroyImmediate(consumer); } else { consumer.configuration = ElementConsumer.Configuration.Element; consumer.consumptionRadius = 2; consumer.sampleCellOffset = new Vector3(0f, 0f); consumer.EnableConsumption(true); consumer.showInStatusPanel = true; consumer.storeOnConsume = false; //consumer deletes elements; output_element might overrides this consumer.consumptionRate = (float)setting.input_rate; consumer.elementToConsume = element.id; consumer.capacityKG = (float)setting.input_rate * 10; plant.AddOrGet <Storage>().capacityKg = consumer.capacityKG; plant.AddOrGet <SaltPlant>(); } } #endregion #region output_element if (setting.output_element != null) { ElementConsumer consumer = plant.GetComponent <ElementConsumer>(); ElementConverter converter = plant.AddOrGet <ElementConverter>(); Element element = ElementLoader.FindElementByName(setting.output_element); if (element == null) //invalid element { Debug.Log(ToDialog("output_element is bad element: " + setting.output_element)); UnityEngine.Object.DestroyImmediate(converter); } else if (setting.output_rate <= 0f) //delete converter { UnityEngine.Object.DestroyImmediate(converter); if (consumer != null) { consumer.storeOnConsume = false; } } else { if (consumer != null) //transform elements { consumer.storeOnConsume = true; converter.consumedElements = new ElementConverter.ConsumedElement[1] { new ElementConverter.ConsumedElement(consumer.elementToConsume.CreateTag(), consumer.consumptionRate) }; converter.OutputMultiplier = (float)setting.output_rate / consumer.consumptionRate; //Debug.Log("TAG is: " + consumer.elementToConsume.CreateTag().Name + " SimHash is: " + consumer.elementToConsume.ToString()); } else //create from nothing { converter.consumedElements = new ElementConverter.ConsumedElement[0]; converter.OutputMultiplier = 1f; } converter.outputElements = new ElementConverter.OutputElement[1] { new ElementConverter.OutputElement((float)setting.output_rate, element.id, 0f, true, false, 0f, 1f) }; plant.AddOrGet <Storage>(); plant.AddOrGet <SaltPlant>(); } } #endregion }
public GameObject CreatePrefab() { string id = "SaltPlant"; string name = STRINGS.CREATURES.SPECIES.SALTPLANT.NAME; string desc = STRINGS.CREATURES.SPECIES.SALTPLANT.DESC; float mass = 2f; KAnimFile anim = Assets.GetAnim("saltplant_kanim"); string initialAnim = "idle_empty"; EffectorValues tIER = DECOR.PENALTY.TIER1; List <Tag> list = new List <Tag>(); list.Add(GameTags.Hanging); list = list; GameObject gameObject = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, anim, initialAnim, Grid.SceneLayer.BuildingFront, 1, 2, tIER, default(EffectorValues), SimHashes.Creature, list, 258.15f); EntityTemplates.MakeHangingOffsets(gameObject, 1, 2); GameObject template = gameObject; mass = 198.15f; float temperature_warning_low = 248.15f; float temperature_warning_high = 323.15f; float temperature_lethal_high = 393.15f; initialAnim = 381665462.ToString(); EntityTemplates.ExtendEntityToBasicPlant(template, mass, temperature_warning_low, temperature_warning_high, temperature_lethal_high, null, true, 0f, 0.15f, initialAnim, true, true, true, true, 2400f); gameObject.AddOrGet <SaltPlant>(); EntityTemplates.ExtendPlantToFertilizable(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = SimHashes.Sand.CreateTag(), massConsumptionRate = 0.0116666667f } }); PressureVulnerable pressureVulnerable = gameObject.AddOrGet <PressureVulnerable>(); PressureVulnerable pressureVulnerable2 = pressureVulnerable; temperature_lethal_high = 0.025f; temperature_warning_high = 0f; SimHashes[] safeAtmospheres = new SimHashes[1] { SimHashes.ChlorineGas }; pressureVulnerable2.Configure(temperature_lethal_high, temperature_warning_high, 10f, 30f, safeAtmospheres); KPrefabID component = gameObject.GetComponent <KPrefabID>(); component.prefabInitFn += delegate(GameObject inst) { PressureVulnerable component3 = inst.GetComponent <PressureVulnerable>(); component3.safe_atmospheres.Add(ElementLoader.FindElementByHash(SimHashes.ChlorineGas)); }; Storage storage = gameObject.AddOrGet <Storage>(); storage.showInUI = false; storage.capacityKg = 1f; ElementConsumer elementConsumer = gameObject.AddOrGet <ElementConsumer>(); elementConsumer.showInStatusPanel = true; elementConsumer.showDescriptor = true; elementConsumer.storeOnConsume = false; elementConsumer.elementToConsume = SimHashes.ChlorineGas; elementConsumer.configuration = ElementConsumer.Configuration.Element; elementConsumer.consumptionRadius = 4; elementConsumer.sampleCellOffset = new Vector3(0f, -1f); elementConsumer.consumptionRate = 0.006f; UprootedMonitor component2 = gameObject.GetComponent <UprootedMonitor>(); component2.monitorCell = new CellOffset(0, 1); gameObject.AddOrGet <StandardCropPlant>(); template = gameObject; SeedProducer.ProductionType productionType = SeedProducer.ProductionType.Harvest; initialAnim = "SaltPlantSeed"; desc = STRINGS.CREATURES.SPECIES.SEEDS.SALTPLANT.NAME; name = STRINGS.CREATURES.SPECIES.SEEDS.SALTPLANT.DESC; anim = Assets.GetAnim("seed_saltplant_kanim"); list = new List <Tag>(); list.Add(GameTags.CropSeed); list = list; GameObject seed = EntityTemplates.CreateAndRegisterSeedForPlant(template, productionType, initialAnim, desc, name, anim, "object", 1, list, SingleEntityReceptacle.ReceptacleDirection.Bottom, default(Tag), 4, STRINGS.CREATURES.SPECIES.SALTPLANT.DOMESTICATEDDESC, EntityTemplates.CollisionShape.CIRCLE, 0.35f, 0.35f, null, string.Empty, false); GameObject template2 = EntityTemplates.CreateAndRegisterPreviewForPlant(seed, "SaltPlant_preview", Assets.GetAnim("saltplant_kanim"), "place", 1, 2); EntityTemplates.MakeHangingOffsets(template2, 1, 2); return(gameObject); }
public GameObject CreatePrefab() { string id = "Oxyfern"; string name = STRINGS.CREATURES.SPECIES.OXYFERN.NAME; string desc = STRINGS.CREATURES.SPECIES.OXYFERN.DESC; float mass = 1f; KAnimFile anim = Assets.GetAnim("oxy_fern_kanim"); string initialAnim = "idle_full"; EffectorValues tIER = DECOR.PENALTY.TIER1; GameObject gameObject = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, anim, initialAnim, Grid.SceneLayer.BuildingBack, 1, 2, tIER, default(EffectorValues), SimHashes.Creature, null, 293f); gameObject.AddOrGet <ReceptacleMonitor>(); gameObject.AddOrGet <EntombVulnerable>(); gameObject.AddOrGet <WiltCondition>(); gameObject.AddOrGet <Prioritizable>(); gameObject.AddOrGet <Uprootable>(); gameObject.AddOrGet <UprootedMonitor>(); gameObject.AddOrGet <DrowningMonitor>(); TemperatureVulnerable temperatureVulnerable = gameObject.AddOrGet <TemperatureVulnerable>(); temperatureVulnerable.Configure(273.15f, 253.15f, 313.15f, 373.15f); Tag tag = ElementLoader.FindElementByHash(SimHashes.Water).tag; EntityTemplates.ExtendPlantToIrrigated(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = tag, massConsumptionRate = 0.0316666663f } }); EntityTemplates.ExtendPlantToFertilizable(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = GameTags.Dirt, massConsumptionRate = 0.006666667f } }); gameObject.AddOrGet <Oxyfern>(); gameObject.AddOrGet <OccupyArea>().objectLayers = new ObjectLayer[1] { ObjectLayer.Building }; gameObject.AddOrGet <KBatchedAnimController>().randomiseLoopedOffset = true; PressureVulnerable pressureVulnerable = gameObject.AddOrGet <PressureVulnerable>(); PressureVulnerable pressureVulnerable2 = pressureVulnerable; mass = 0.025f; float pressureLethalLow = 0f; SimHashes[] safeAtmospheres = new SimHashes[1] { SimHashes.CarbonDioxide }; pressureVulnerable2.Configure(mass, pressureLethalLow, 10f, 30f, safeAtmospheres); KPrefabID component = gameObject.GetComponent <KPrefabID>(); component.prefabInitFn += delegate(GameObject inst) { PressureVulnerable component2 = inst.GetComponent <PressureVulnerable>(); component2.safe_atmospheres.Add(ElementLoader.FindElementByHash(SimHashes.CarbonDioxide)); }; gameObject.AddOrGet <LoopingSounds>(); Storage storage = gameObject.AddOrGet <Storage>(); storage.showInUI = false; storage.capacityKg = 1f; ElementConsumer elementConsumer = gameObject.AddOrGet <ElementConsumer>(); elementConsumer.showInStatusPanel = false; elementConsumer.storeOnConsume = true; elementConsumer.storage = storage; elementConsumer.elementToConsume = SimHashes.CarbonDioxide; elementConsumer.configuration = ElementConsumer.Configuration.Element; elementConsumer.consumptionRadius = 2; elementConsumer.EnableConsumption(true); elementConsumer.sampleCellOffset = new Vector3(0f, 0f); elementConsumer.consumptionRate = 0.000156250011f; ElementConverter elementConverter = gameObject.AddOrGet <ElementConverter>(); elementConverter.OutputMultiplier = 50f; elementConverter.consumedElements = new ElementConverter.ConsumedElement[1] { new ElementConverter.ConsumedElement(1960575215.ToString().ToTag(), 0.000625000044f) }; elementConverter.outputElements = new ElementConverter.OutputElement[1] { new ElementConverter.OutputElement(0.0312500037f, SimHashes.Oxygen, 0f, true, false, 0f, 1f, 0.75f, byte.MaxValue, 0) }; GameObject plant = gameObject; SeedProducer.ProductionType productionType = SeedProducer.ProductionType.Hidden; initialAnim = "OxyfernSeed"; desc = STRINGS.CREATURES.SPECIES.SEEDS.OXYFERN.NAME; name = STRINGS.CREATURES.SPECIES.SEEDS.OXYFERN.DESC; anim = Assets.GetAnim("seed_oxyfern_kanim"); List <Tag> list = new List <Tag>(); list.Add(GameTags.CropSeed); list = list; GameObject seed = EntityTemplates.CreateAndRegisterSeedForPlant(plant, productionType, initialAnim, desc, name, anim, "object", 1, list, SingleEntityReceptacle.ReceptacleDirection.Top, default(Tag), 2, STRINGS.CREATURES.SPECIES.OXYFERN.DOMESTICATEDDESC, EntityTemplates.CollisionShape.CIRCLE, 0.3f, 0.3f, null, string.Empty, false); EntityTemplates.CreateAndRegisterPreviewForPlant(seed, "Oxyfern_preview", Assets.GetAnim("oxy_fern_kanim"), "place", 1, 2); SoundEventVolumeCache.instance.AddVolume("oxy_fern_kanim", "MealLice_harvest", NOISE_POLLUTION.CREATURES.TIER3); SoundEventVolumeCache.instance.AddVolume("oxy_fern_kanim", "MealLice_LP", NOISE_POLLUTION.CREATURES.TIER4); return(gameObject); }
public GameObject CreatePrefab() { string iD = ID; string name = STRINGS.CREATURES.SPECIES.SEALETTUCE.NAME; string desc = STRINGS.CREATURES.SPECIES.SEALETTUCE.DESC; float mass = 1f; KAnimFile anim = Assets.GetAnim("sea_lettuce_kanim"); string initialAnim = "idle_empty"; EffectorValues tIER = DECOR.BONUS.TIER0; GameObject gameObject = EntityTemplates.CreatePlacedEntity(iD, name, desc, mass, anim, initialAnim, Grid.SceneLayer.BuildingBack, 1, 2, tIER, default(EffectorValues), SimHashes.Creature, null, 308.15f); GameObject template = gameObject; mass = 248.15f; float temperature_warning_low = 295.15f; float temperature_warning_high = 338.15f; float temperature_lethal_high = 398.15f; bool pressure_sensitive = false; SimHashes[] safe_elements = new SimHashes[3] { SimHashes.Water, SimHashes.SaltWater, SimHashes.Brine }; EntityTemplates.ExtendEntityToBasicPlant(template, mass, temperature_warning_low, temperature_warning_high, temperature_lethal_high, safe_elements, pressure_sensitive, 0f, 0.15f, "Lettuce", true, true, true, true, 2400f); EntityTemplates.ExtendPlantToIrrigated(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = SimHashes.SaltWater.CreateTag(), massConsumptionRate = 0.008333334f } }); EntityTemplates.ExtendPlantToFertilizable(gameObject, new PlantElementAbsorber.ConsumeInfo[1] { new PlantElementAbsorber.ConsumeInfo { tag = SimHashes.BleachStone.CreateTag(), massConsumptionRate = 0.000833333354f } }); gameObject.GetComponent<DrowningMonitor>().canDrownToDeath = false; gameObject.GetComponent<DrowningMonitor>().livesUnderWater = true; gameObject.AddOrGet<StandardCropPlant>(); gameObject.AddOrGet<KAnimControllerBase>().randomiseLoopedOffset = true; gameObject.AddOrGet<LoopingSounds>(); template = gameObject; SeedProducer.ProductionType productionType = SeedProducer.ProductionType.Harvest; initialAnim = ID + "Seed"; desc = STRINGS.CREATURES.SPECIES.SEEDS.SEALETTUCE.NAME; name = STRINGS.CREATURES.SPECIES.SEEDS.SEALETTUCE.DESC; anim = Assets.GetAnim("seed_sealettuce_kanim"); int numberOfSeeds = 0; List<Tag> list = new List<Tag>(); list.Add(GameTags.WaterSeed); list = list; iD = STRINGS.CREATURES.SPECIES.SEALETTUCE.DOMESTICATEDDESC; GameObject seed = EntityTemplates.CreateAndRegisterSeedForPlant(template, productionType, initialAnim, desc, name, anim, "object", numberOfSeeds, list, SingleEntityReceptacle.ReceptacleDirection.Top, default(Tag), 1, iD, EntityTemplates.CollisionShape.CIRCLE, 0.25f, 0.25f, null, string.Empty, false); EntityTemplates.CreateAndRegisterPreviewForPlant(seed, ID + "_preview", Assets.GetAnim("sea_lettuce_kanim"), "place", 1, 2); SoundEventVolumeCache.instance.AddVolume("sea_lettuce_kanim", "SeaLettuce_grow", NOISE_POLLUTION.CREATURES.TIER3); SoundEventVolumeCache.instance.AddVolume("sea_lettuce_kanim", "SeaLettuce_harvest", NOISE_POLLUTION.CREATURES.TIER3); return gameObject; }