Ejemplo n.º 1
0
        public static void Postfix(GameObject __result)
        {
            ColdBreather coldBreather = __result.GetComponent <ColdBreather>();

            if (coldBreather != null)
            {
                coldBreather.deltaEmitTemperature = CustomizePlantsState.StateManager.State.WheezewortTempDelta;
            }
            else
            {
                Debug.LogWarning("ERROR: coldbreather was null!");
            }
        }
Ejemplo n.º 2
0
            public static void Postfix(ColdBreatherConfig __instance, ref GameObject __result)
            {
                TemperatureVulnerable temperatureVulnerable = __result.AddOrGet <TemperatureVulnerable>();

                temperatureVulnerable.Configure(50f, 10f, 900f, 1000f);

                ColdBreather coldBreather = __result.AddOrGet <ColdBreather>();

                coldBreather.deltaEmitTemperature = -10f;
                coldBreather.emitOffsetCell       = new Vector3(0f, 2f);

                Storage storage = BuildingTemplates.CreateDefaultStorage(__result);

                storage.showInUI = true;

                ElementConsumer elementConsumer = __result.AddOrGet <ElementConsumer>();

                elementConsumer.capacityKG        = 20f;
                elementConsumer.consumptionRate   = 5f;
                elementConsumer.consumptionRadius = 5;

                ElementConverter elementConverter = __result.AddOrGet <ElementConverter>();
                var newConsumedElements           = new[] { new ElementConverter.ConsumedElement(GameTagExtensions.Create(SimHashes.CarbonDioxide), 3f) };
                var newOutputElements             = new[]
                {
                    new ElementConverter.OutputElement(1f, SimHashes.Carbon, 323.15f, true, 0f, 0.5f, false, 1f, byte.MaxValue, 0),
                    new ElementConverter.OutputElement(2f, SimHashes.Oxygen, 323.15f, true, 0f, 0.5f, false, 1f, byte.MaxValue, 0)
                };

                elementConverter.consumedElements = newConsumedElements;
                elementConverter.outputElements   = newOutputElements;
                ElementDropper elementDropper = __result.AddComponent <ElementDropper>();

                elementDropper.emitMass   = 100f;
                elementDropper.emitTag    = SimHashes.Carbon.CreateTag();
                elementDropper.emitOffset = new Vector3(0.5f, 1f, 0f);
            }
    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);
    }
 private static void Postfix(ColdBreather __instance)
 {
     __instance.GetComponent <TinkerableColdBreather>()?.ApplyModifier();
 }