Exemplo n.º 1
0
    public GameObject CreatePrefab()
    {
        int            num        = 1;
        int            height     = 1;
        string         id         = "PropLadder";
        string         name       = STRINGS.BUILDINGS.PREFABS.PROPLADDER.NAME;
        string         desc       = STRINGS.BUILDINGS.PREFABS.PROPLADDER.DESC;
        float          mass       = 50f;
        int            width      = num;
        GameObject     gameObject = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, Assets.GetAnim("ladder_poi_kanim"), "off", Grid.SceneLayer.Building, width, height, TUNING.BUILDINGS.DECOR.BONUS.TIER0, NOISE_POLLUTION.NOISY.TIER0, SimHashes.Creature, null, 293f);
        PrimaryElement component  = gameObject.GetComponent <PrimaryElement>();

        component.SetElement(SimHashes.Polypropylene);
        component.Temperature = 294.15f;
        Ladder ladder = gameObject.AddOrGet <Ladder>();

        ladder.upwardsMovementSpeedMultiplier   = 1.5f;
        ladder.downwardsMovementSpeedMultiplier = 1.5f;
        gameObject.AddOrGet <AnimTileable>();
        OccupyArea obj = gameObject.AddOrGet <OccupyArea>();

        Object.DestroyImmediate(obj);
        obj = gameObject.AddOrGet <OccupyArea>();
        obj.OccupiedCellsOffsets = EntityTemplates.GenerateOffsets(num, height);
        obj.objectLayers         = new ObjectLayer[1]
        {
            ObjectLayer.Building
        };
        return(gameObject);
    }
    public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreatePlacedEntity("ChlorineGeyser", STRINGS.CREATURES.SPECIES.CHLORINEGEYSER.NAME, STRINGS.CREATURES.SPECIES.CHLORINEGEYSER.DESC, 2000f, Assets.GetAnim("geyser_side_chlorine_kanim"), "inactive", Grid.SceneLayer.BuildingBack, 4, 2, TUNING.BUILDINGS.DECOR.BONUS.TIER1, NOISE_POLLUTION.NOISY.TIER5, SimHashes.Creature, null, 293f);

        gameObject.GetComponent <KPrefabID>().AddTag(GameTags.DeprecatedContent, false);
        PrimaryElement component = gameObject.GetComponent <PrimaryElement>();

        component.SetElement(SimHashes.IgneousRock);
        component.Temperature = 372.15f;
        Geyser geyser = gameObject.AddOrGet <Geyser>();

        geyser.outputOffset = new Vector2I(0, 1);
        GeyserConfigurator geyserConfigurator = gameObject.AddOrGet <GeyserConfigurator>();

        geyserConfigurator.presetType = "chlorine_gas";
        geyserConfigurator.presetMin  = 0.35f;
        geyserConfigurator.presetMax  = 0.65f;
        Studyable studyable = gameObject.AddOrGet <Studyable>();

        studyable.meterTrackerSymbol = "geotracker_target";
        studyable.meterAnim          = "tracker";
        gameObject.AddOrGet <LoopingSounds>();
        SoundEventVolumeCache.instance.AddVolume("geyser_methane_kanim", "GeyserMethane_shake_LP", NOISE_POLLUTION.NOISY.TIER5);
        SoundEventVolumeCache.instance.AddVolume("geyser_methane_kanim", "GeyserMethane_shake_LP", NOISE_POLLUTION.NOISY.TIER6);
        return(gameObject);
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
        public GameObject CreatePrefab()
        {
            GameObject placedEntity = EntityTemplates.CreatePlacedEntity(ID, CREATURES.SPECIES.JUNGLEGASPLANT.NAME, CREATURES.SPECIES.JUNGLEGASPLANT.DESC, 1f,
                                                                         Assets.GetAnim("palmeratree_kanim"), "idle_loop", Grid.SceneLayer.BuildingFront, 2, 3, DECOR.BONUS.TIER2, defaultTemperature: 350f);

            EntityTemplates.ExtendEntityToBasicPlant(placedEntity, 258.15f, 323.15f, 363.15f, 373.15f, new SimHashes[1] {
                SimHashes.ChlorineGas
            }, true, 0.0f, 0.15f, PalmeraBerryConfig.ID);

            placedEntity.AddOrGet <PalmeraTree>();
            var consumer = placedEntity.AddOrGet <ElementConsumer>();

            consumer.elementToConsume = SimHashes.ChlorineGas;
            consumer.consumptionRate  = 0.001f;

            var emitter = placedEntity.AddOrGet <ElementEmitter>();

            emitter.outputElement = new ElementConverter.OutputElement(0.001f, SimHashes.Hydrogen, outputElementOffsety: 2f);
            emitter.maxPressure   = 1.8f;

            EntityTemplates.CreateAndRegisterPreviewForPlant(
                EntityTemplates.CreateAndRegisterSeedForPlant(placedEntity, SeedProducer.ProductionType.Harvest, SEED_ID,
                                                              "Palmera Tree Seed", "The " + UI.FormatAsLink("Seed", "PLANTS") + " of a " + CREATURES.SPECIES.JUNGLEGASPLANT.NAME + ".",
                                                              Assets.GetAnim("seed_palmeratree_kanim"), "object", 0, new List <Tag> {
                Utils.CropSeed2TileWide
            },
                                                              SingleEntityReceptacle.ReceptacleDirection.Top, new Tag(), 6, CREATURES.SPECIES.JUNGLEGASPLANT.DOMESTICATEDDESC,
                                                              EntityTemplates.CollisionShape.CIRCLE, 0.33f, 0.33f, null, string.Empty), "PalmeraTree_preview", Assets.GetAnim("palmeratree_kanim"), "idle_wilt_loop", 2, 3);

            SoundEventVolumeCache.instance.AddVolume("bristleblossom_kanim", "PrickleFlower_harvest", NOISE_POLLUTION.CREATURES.TIER3);
            SoundEventVolumeCache.instance.AddVolume("bristleblossom_kanim", "PrickleFlower_harvest", NOISE_POLLUTION.CREATURES.TIER3);

            return(placedEntity);
        }
Exemplo n.º 5
0
    public GameObject CreatePrefab()
    {
        string         id          = "ForestForagePlantPlanted";
        string         name        = STRINGS.CREATURES.SPECIES.FORESTFORAGEPLANTPLANTED.NAME;
        string         desc        = STRINGS.CREATURES.SPECIES.FORESTFORAGEPLANTPLANTED.DESC;
        float          mass        = 100f;
        KAnimFile      anim        = Assets.GetAnim("podmelon_kanim");
        string         initialAnim = "idle";
        EffectorValues tIER        = DECOR.BONUS.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 <SimTemperatureTransfer>();
        OccupyArea occupyArea = gameObject.AddOrGet <OccupyArea>();

        occupyArea.objectLayers = new ObjectLayer[1]
        {
            ObjectLayer.Building
        };
        gameObject.AddOrGet <EntombVulnerable>();
        gameObject.AddOrGet <DrowningMonitor>();
        gameObject.AddOrGet <Prioritizable>();
        gameObject.AddOrGet <Uprootable>();
        gameObject.AddOrGet <UprootedMonitor>();
        gameObject.AddOrGet <Harvestable>();
        gameObject.AddOrGet <HarvestDesignatable>();
        SeedProducer seedProducer = gameObject.AddOrGet <SeedProducer>();

        seedProducer.Configure("ForestForagePlant", SeedProducer.ProductionType.DigOnly, 1);
        gameObject.AddOrGet <BasicForagePlantPlanted>();
        gameObject.AddOrGet <KBatchedAnimController>().randomiseLoopedOffset = true;
        return(gameObject);
    }
Exemplo n.º 6
0
        public GameObject CreatePrefab()
        {
            GameObject placedEntity = EntityTemplates.CreatePlacedEntity(
                id: Id,
                name: Name,
                desc: Description,
                mass: 1000f,
                anim: Assets.GetAnim("aquabulb_kanim"),
                initialAnim: "idle",
                sceneLayer: Grid.SceneLayer.BuildingFront,
                width: 1,
                height: 2,
                decor: TUNING.DECOR.BONUS.TIER3,
                defaultTemperature: DefaultTemperature);

            placedEntity.AddOrGet <SimTemperatureTransfer>();
            placedEntity.AddOrGet <OccupyArea>().objectLayers = new ObjectLayer[1]
            {
                ObjectLayer.Building
            };
            placedEntity.AddOrGet <EntombVulnerable>();
            placedEntity.AddOrGet <DrowningMonitor>();
            placedEntity.AddOrGet <Prioritizable>();
            placedEntity.AddOrGet <Uprootable>();
            placedEntity.AddOrGet <UprootedMonitor>();
            placedEntity.AddOrGet <Harvestable>();
            placedEntity.AddOrGet <HarvestDesignatable>();
            placedEntity.AddOrGet <SeedProducer>().Configure(AquaBulbSackConfig.Id, SeedProducer.ProductionType.DigOnly, 1);
            placedEntity.AddOrGet <BasicForagePlantPlanted>();
            placedEntity.AddOrGet <KBatchedAnimController>().randomiseLoopedOffset = true;
            return(placedEntity);
        }
Exemplo n.º 7
0
        public GameObject CreatePrefab()
        {
            GameObject placedEntity = EntityTemplates.CreatePlacedEntity(ID, CREATURES.SPECIES.HEATBULB.NAME, CREATURES.SPECIES.HEATBULB.DESC, 1f,
                                                                         Assets.GetAnim("plantheatbulb_kanim"), "close", Grid.SceneLayer.BuildingFront, 1, 1, DECOR.BONUS.TIER3, defaultTemperature: 350f);

            EntityTemplates.ExtendEntityToBasicPlant(placedEntity, 258.15f, 288.15f, 363.15f, 373.15f, pressure_sensitive: false);

            Light2D light2D = placedEntity.AddOrGet <Light2D>();

            light2D.Color = new Color(1f, 1f, 0f);
            light2D.Lux   = 1800;
            light2D.Range = 5;
            placedEntity.AddOrGet <Fervine>();

            EntityTemplates.CreateAndRegisterPreviewForPlant(
                EntityTemplates.CreateAndRegisterSeedForPlant(placedEntity, SeedProducer.ProductionType.Hidden, SEED_ID,
                                                              SeedName, SeedDesc, Assets.GetAnim("plantheatbulb_kanim"), "seedling_ground", 0, new List <Tag> {
                GameTags.DecorSeed
            },
                                                              SingleEntityReceptacle.ReceptacleDirection.Top, new Tag(), 6, "",
                                                              EntityTemplates.CollisionShape.CIRCLE, 0.33f, 0.33f, null, string.Empty), "Heatbulb_preview", Assets.GetAnim("plantheatbulb_kanim"), "close", 1, 1);

            SoundEventVolumeCache.instance.AddVolume("bristleblossom_kanim", "PrickleFlower_harvest", NOISE_POLLUTION.CREATURES.TIER3);
            SoundEventVolumeCache.instance.AddVolume("bristleblossom_kanim", "PrickleFlower_harvest", NOISE_POLLUTION.CREATURES.TIER3);

            return(placedEntity);
        }
Exemplo n.º 8
0
        [HarmonyPriority(410)] //slightly higher priority since it clears events and other might want to hook in as well
        public static void Postfix(GeyserGenericConfig __instance, ref List <GameObject> __result)
        {
            GameObject geyserGenericOrg = __result.Find(x => x.name == "GeyserGeneric");

            if (geyserGenericOrg == null)
            {
                Debug.LogWarning("[CustomizeGeyser] RandomizerPatch critical error: Did not find GeyserGeneric");
                return;
            }

            GameObject geyserGeneric = EntityTemplates.CreatePlacedEntity(id: "GeyserGeneric", name: "Random Geyser Spawner", desc: GeyserGenericDescription, mass: 2000f,
                                                                          anim: Assets.GetAnim(GeyserGenericKAnim), initialAnim: GeyserGenericInitialState, sceneLayer: Grid.SceneLayer.BuildingBack,
                                                                          width: 3, height: 3, decor: TUNING.BUILDINGS.DECOR.BONUS.TIER1, noise: TUNING.NOISE_POLLUTION.NOISY.TIER6,
                                                                          element: SimHashes.Katairite, additionalTags: null, defaultTemperature: 372.15f);

            geyserGeneric.AddOrGet <SaveLoadRoot>();
            geyserGeneric.AddOrGet <KPrefabID>().prefabInitFn += PrefabInitGenericGeysers;

            __result.Remove(geyserGenericOrg);
            __result.Add(geyserGeneric);

#if DEBUG_1
            Debug.Log("[CustomizeGeyser] Attached to GeyserGeneric");
#endif

            if (RandomizerTable.geysers == null)
            {
                RandomizerTable.Initialize();
            }
        }
    public GameObject CreateGeyser(string id, string anim, int width, int height, string name, string desc, HashedString presetType)
    {
        float      mass       = 2000f;
        GameObject gameObject = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, Assets.GetAnim(anim), "inactive", Grid.SceneLayer.BuildingBack, width, height, BUILDINGS.DECOR.BONUS.TIER1, NOISE_POLLUTION.NOISY.TIER6, SimHashes.Creature, null, 293f);

        gameObject.AddOrGet <OccupyArea>().objectLayers = new ObjectLayer[1]
        {
            ObjectLayer.Building
        };
        PrimaryElement component = gameObject.GetComponent <PrimaryElement>();

        component.SetElement(SimHashes.Katairite);
        component.Temperature = 372.15f;
        gameObject.AddOrGet <Prioritizable>();
        gameObject.AddOrGet <Uncoverable>();
        Geyser geyser = gameObject.AddOrGet <Geyser>();

        geyser.outputOffset = new Vector2I(0, 1);
        GeyserConfigurator geyserConfigurator = gameObject.AddOrGet <GeyserConfigurator>();

        geyserConfigurator.presetType = presetType;
        Studyable studyable = gameObject.AddOrGet <Studyable>();

        studyable.meterTrackerSymbol = "geotracker_target";
        studyable.meterAnim          = "tracker";
        gameObject.AddOrGet <LoopingSounds>();
        SoundEventVolumeCache.instance.AddVolume("geyser_side_steam_kanim", "Geyser_shake_LP", NOISE_POLLUTION.NOISY.TIER5);
        SoundEventVolumeCache.instance.AddVolume("geyser_side_steam_kanim", "Geyser_erupt_LP", NOISE_POLLUTION.NOISY.TIER6);
        return(gameObject);
    }
Exemplo n.º 10
0
        public GameObject CreatePrefab()
        {
            var plantEntityTemplate = EntityTemplates.CreatePlacedEntity(
                id: Id,
                name: CREATURES.SPECIES.HEATBULB.NAME,
                desc: CREATURES.SPECIES.HEATBULB.DESC,
                width: 1,
                height: 1,
                mass: 1f,
                anim: Assets.GetAnim("plantheatbulb_kanim"),
                initialAnim: "close",
                sceneLayer: Grid.SceneLayer.BuildingFront,
                decor: DECOR.BONUS.TIER3,
                defaultTemperature: 350f);

            EntityTemplates.ExtendEntityToBasicPlant(
                template: plantEntityTemplate,
                temperature_lethal_low: 258.15f,
                temperature_warning_low: 288.15f,
                temperature_warning_high: 363.15f,
                temperature_lethal_high: 373.15f,
                pressure_sensitive: false,
                can_tinker: false);

            var light2D = plantEntityTemplate.AddOrGet <Light2D>();

            light2D.Color = new Color(1f, 1f, 0f);
            light2D.Lux   = 1800;
            light2D.Range = 5;

            plantEntityTemplate.AddOrGet <Fervine>();

            var seed = EntityTemplates.CreateAndRegisterSeedForPlant(
                plant: plantEntityTemplate,
                id: SeedId,
                name: SeedName,
                desc: SeedDesc,
                productionType: SeedProducer.ProductionType.Hidden,
                anim: Assets.GetAnim("plantheatbulb_kanim"),
                initialAnim: "seed_swamplily",
                numberOfSeeds: 0,
                additionalTags: new List <Tag> {
                GameTags.DecorSeed
            },
                sortOrder: 6,
                width: 0.33f,
                height: 0.33f);

            EntityTemplates.CreateAndRegisterPreviewForPlant(
                seed: seed,
                id: "Heatbulb_preview",
                anim: Assets.GetAnim("plantheatbulb_kanim"),
                initialAnim: "close",
                width: 1,
                height: 1);

            SoundEventVolumeCache.instance.AddVolume("bristleblossom_kanim", "PrickleFlower_harvest", NOISE_POLLUTION.CREATURES.TIER3);

            return(plantEntityTemplate);
        }
Exemplo n.º 11
0
    public GameObject CreatePrefab()
    {
        string         id          = "PrickleFlower";
        string         name        = STRINGS.CREATURES.SPECIES.PRICKLEFLOWER.NAME;
        string         desc        = STRINGS.CREATURES.SPECIES.PRICKLEFLOWER.DESC;
        float          mass        = 1f;
        KAnimFile      anim        = Assets.GetAnim("bristleblossom_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 = 218.15f;
        float temperature_warning_low  = 278.15f;
        float temperature_warning_high = 303.15f;
        float temperature_lethal_high  = 398.15f;

        SimHashes[] safe_elements = new SimHashes[3]
        {
            SimHashes.Oxygen,
            SimHashes.ContaminatedOxygen,
            SimHashes.CarbonDioxide
        };
        initialAnim = PrickleFruitConfig.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.ExtendPlantToIrrigated(gameObject, new PlantElementAbsorber.ConsumeInfo[1]
        {
            new PlantElementAbsorber.ConsumeInfo
            {
                tag = GameTags.Water,
                massConsumptionRate = 0.0333333351f
            }
        });
        gameObject.AddOrGet <StandardCropPlant>();
        DiseaseDropper.Def def = gameObject.AddOrGetDef <DiseaseDropper.Def>();
        def.diseaseIdx         = Db.Get().Diseases.GetIndex(Db.Get().Diseases.PollenGerms.id);
        def.singleEmitQuantity = 1000000;
        IlluminationVulnerable illuminationVulnerable = gameObject.AddOrGet <IlluminationVulnerable>();

        illuminationVulnerable.SetPrefersDarkness(false);
        template = gameObject;
        SeedProducer.ProductionType productionType = SeedProducer.ProductionType.Harvest;
        initialAnim = "PrickleFlowerSeed";
        desc        = STRINGS.CREATURES.SPECIES.SEEDS.PRICKLEFLOWER.NAME;
        name        = STRINGS.CREATURES.SPECIES.SEEDS.PRICKLEFLOWER.DESC;
        anim        = Assets.GetAnim("seed_bristleblossom_kanim");
        int        numberOfSeeds = 0;
        List <Tag> list          = new List <Tag>();

        list.Add(GameTags.CropSeed);
        list = list;
        id   = STRINGS.CREATURES.SPECIES.PRICKLEFLOWER.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.25f, 0.25f, null, string.Empty, false);

        EntityTemplates.CreateAndRegisterPreviewForPlant(seed, "PrickleFlower_preview", Assets.GetAnim("bristleblossom_kanim"), "place", 1, 2);
        SoundEventVolumeCache.instance.AddVolume("bristleblossom_kanim", "PrickleFlower_harvest", NOISE_POLLUTION.CREATURES.TIER3);
        SoundEventVolumeCache.instance.AddVolume("bristleblossom_kanim", "PrickleFlower_grow", NOISE_POLLUTION.CREATURES.TIER3);
        return(gameObject);
    }
Exemplo n.º 12
0
        public GameObject CreatePrefab()
        {
            var placedEntity = EntityTemplates.CreatePlacedEntity(
                id: Id,
                name: Name,
                desc: Description,
                mass: 1f,
                anim: Assets.GetAnim(AnimName),
                initialAnim: "idle_loop",
                sceneLayer: Grid.SceneLayer.BuildingFront,
                width: 1,
                height: 2,
                decor: DECOR.BONUS.TIER2,
                defaultTemperature: 320f);

            EntityTemplates.ExtendEntityToBasicPlant(
                template: placedEntity,
                temperature_lethal_low: 283.15f,
                temperature_warning_low: 294.25f,
                temperature_warning_high: 310.15f,
                temperature_lethal_high: 323.15f,
                safe_elements: new[] { SimHashes.CarbonDioxide, SimHashes.Oxygen, SimHashes.ContaminatedOxygen },
                crop_id: TremGrainConfig.Id);

            placedEntity.AddOrGet <TremWheat>();

            var consumer = placedEntity.AddOrGet <ElementConsumer>();

            consumer.elementToConsume = SimHashes.Water;
            consumer.consumptionRate  = 0.0233334f;

            var seed = EntityTemplates.CreateAndRegisterSeedForPlant(
                plant: placedEntity,
                id: SeedId,
                name: UI.FormatAsLink(SeedName, Id),
                desc: SeedDescription,
                productionType: SeedProducer.ProductionType.Harvest,
                anim: Assets.GetAnim(AnimNameSeed),
                numberOfSeeds: 0,
                additionalTags: new List <Tag> {
                GameTags.CropSeed
            },
                sortOrder: 9,
                domesticatedDescription: "Coolboyoclock",
                width: 0.33f,
                height: 0.33f);

            EntityTemplates.CreateAndRegisterPreviewForPlant(
                seed: seed,
                id: "TremWheat_preview",
                anim: Assets.GetAnim(AnimName),
                initialAnim: "place",
                width: 1,
                height: 1);

            SoundEventVolumeCache.instance.AddVolume("bristleblossom_kanim", "PrickleFlower_harvest", NOISE_POLLUTION.CREATURES.TIER1);

            return(placedEntity);
        }
Exemplo n.º 13
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);
    }
Exemplo n.º 14
0
        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);
        }
Exemplo n.º 15
0
    public GameObject CreatePrefab()
    {
        GameObject     gameObject = EntityTemplates.CreatePlacedEntity("PropElevator", STRINGS.BUILDINGS.PREFABS.PROPELEVATOR.NAME, STRINGS.BUILDINGS.PREFABS.PROPELEVATOR.DESC, 50f, Assets.GetAnim("gravitas_elevator_kanim"), "off", Grid.SceneLayer.Building, 2, 3, TUNING.BUILDINGS.DECOR.BONUS.TIER0, NOISE_POLLUTION.NOISY.TIER0, SimHashes.Creature, null, 293f);
        PrimaryElement component  = gameObject.GetComponent <PrimaryElement>();

        component.SetElement(SimHashes.Steel);
        component.Temperature = 294.15f;
        return(gameObject);
    }
Exemplo n.º 16
0
    public GameObject CreatePrefab()
    {
        GameObject     gameObject = EntityTemplates.CreatePlacedEntity("PropTable", STRINGS.BUILDINGS.PREFABS.PROPTABLE.NAME, STRINGS.BUILDINGS.PREFABS.PROPTABLE.DESC, 50f, Assets.GetAnim("table_breakroom_kanim"), "off", Grid.SceneLayer.Building, 3, 1, TUNING.BUILDINGS.DECOR.BONUS.TIER0, NOISE_POLLUTION.NOISY.TIER0, SimHashes.Creature, null, 293f);
        PrimaryElement component  = gameObject.GetComponent <PrimaryElement>();

        component.SetElement(SimHashes.Unobtanium);
        component.Temperature = 294.15f;
        return(gameObject);
    }
    public GameObject CreatePrefab()
    {
        GameObject     gameObject = EntityTemplates.CreatePlacedEntity("PropFacilityCouch", STRINGS.BUILDINGS.PREFABS.PROPFACILITYCOUCH.NAME, STRINGS.BUILDINGS.PREFABS.PROPFACILITYCOUCH.DESC, 50f, Assets.GetAnim("gravitas_couch_kanim"), "off", Grid.SceneLayer.Building, 4, 2, TUNING.BUILDINGS.DECOR.BONUS.TIER0, NOISE_POLLUTION.NOISY.TIER0, SimHashes.Creature, null, 293f);
        PrimaryElement component  = gameObject.GetComponent <PrimaryElement>();

        component.SetElement(SimHashes.Granite);
        component.Temperature = 294.15f;
        return(gameObject);
    }
Exemplo n.º 18
0
    public GameObject CreatePrefab()
    {
        GameObject     gameObject = EntityTemplates.CreatePlacedEntity("PropSurfaceSatellite2", STRINGS.BUILDINGS.PREFABS.PROPSURFACESATELLITE2.NAME, STRINGS.BUILDINGS.PREFABS.PROPSURFACESATELLITE2.DESC, 50f, Assets.GetAnim("satellite2_kanim"), "off", Grid.SceneLayer.Building, 4, 4, TUNING.BUILDINGS.DECOR.BONUS.TIER0, NOISE_POLLUTION.NOISY.TIER0, SimHashes.Creature, null, 293f);
        PrimaryElement component  = gameObject.GetComponent <PrimaryElement>();

        component.SetElement(SimHashes.Unobtanium);
        component.Temperature = 294.15f;
        return(gameObject);
    }
Exemplo n.º 19
0
    public GameObject CreatePrefab()
    {
        GameObject     gameObject = EntityTemplates.CreatePlacedEntity("PropTallPlant", STRINGS.BUILDINGS.PREFABS.PROPFACILITYTALLPLANT.NAME, STRINGS.BUILDINGS.PREFABS.PROPFACILITYTALLPLANT.DESC, 50f, Assets.GetAnim("gravitas_tall_plant_kanim"), "off", Grid.SceneLayer.Building, 1, 3, TUNING.BUILDINGS.DECOR.BONUS.TIER0, NOISE_POLLUTION.NOISY.TIER0, SimHashes.Creature, null, 293f);
        PrimaryElement component  = gameObject.GetComponent <PrimaryElement>();

        component.SetElement(SimHashes.Polypropylene);
        component.Temperature = 294.15f;
        return(gameObject);
    }
    public GameObject CreatePrefab()
    {
        GameObject     gameObject = EntityTemplates.CreatePlacedEntity("PropSkeleton", STRINGS.BUILDINGS.PREFABS.PROPSKELETON.NAME, STRINGS.BUILDINGS.PREFABS.PROPSKELETON.DESC, 50f, Assets.GetAnim("skeleton_poi_kanim"), "off", Grid.SceneLayer.Building, 1, 2, TUNING.BUILDINGS.DECOR.BONUS.TIER5, NOISE_POLLUTION.NOISY.TIER0, SimHashes.Creature, null, 293f);
        PrimaryElement component  = gameObject.GetComponent <PrimaryElement>();

        component.SetElement(SimHashes.Creature);
        component.Temperature = 294.15f;
        return(gameObject);
    }
Exemplo n.º 21
0
    public GameObject CreatePrefab()
    {
        GameObject     gameObject = EntityTemplates.CreatePlacedEntity("PropFacilityDisplay", STRINGS.BUILDINGS.PREFABS.PROPFACILITYDISPLAY1.NAME, STRINGS.BUILDINGS.PREFABS.PROPFACILITYDISPLAY1.DESC, 50f, Assets.GetAnim("gravitas_display1_kanim"), "off", Grid.SceneLayer.Building, 2, 3, TUNING.BUILDINGS.DECOR.BONUS.TIER0, NOISE_POLLUTION.NOISY.TIER0, SimHashes.Creature, null, 293f);
        PrimaryElement component  = gameObject.GetComponent <PrimaryElement>();

        component.SetElement(SimHashes.Steel);
        component.Temperature = 294.15f;
        gameObject.AddOrGet <LoreBearer>();
        return(gameObject);
    }
Exemplo n.º 22
0
    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);
    }
Exemplo n.º 24
0
    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);
    }
Exemplo n.º 25
0
        public static GameObject AquaticOilFloater(string id, string name, string desc, string anim_file, string traitId, float warnLowTemp, float warnHighTemp, bool is_baby, string symbolOverridePrefix = null)
        {
            float          mass       = 50f;
            EffectorValues tier       = TUNING.DECOR.BONUS.TIER1;
            GameObject     gameObject = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, Assets.GetAnim(anim_file), "swim_idle_loop", Grid.SceneLayer.Creatures, 1, 1, tier, default(EffectorValues), SimHashes.Creature, null, (warnLowTemp + warnHighTemp) / 2f);

            gameObject.GetComponent <KPrefabID>().AddTag(GameTags.Creatures.Swimmer);
            gameObject.GetComponent <KPrefabID>().AddTag(GameTags.SwimmingCreature);

            EntityTemplates.ExtendEntityToBasicCreature(gameObject, FactionManager.FactionID.Pest, traitId, "SwimmerNavGrid", NavType.Swim, 32, 3f, TUNING.FOOD.FOOD_TYPES.FISH_MEAT.Id, 2, false, false, warnLowTemp, warnHighTemp, warnLowTemp - 15f, warnHighTemp + 20f);
            if (!string.IsNullOrEmpty(symbolOverridePrefix))
            {
                gameObject.AddOrGet <SymbolOverrideController>().ApplySymbolOverridesByAffix(Assets.GetAnim(anim_file), symbolOverridePrefix, null, 0);
            }
            gameObject.AddOrGet <ElementVulnerable>();
            gameObject.AddOrGet <LoopingSounds>();
            gameObject.AddOrGetDef <ThreatMonitor.Def>();
            gameObject.AddOrGet <GasDrowningMonitor>();
            gameObject.AddOrGetDef <CreatureAquaticGroomingMonitor.Def>();

            gameObject.AddOrGetDef <CreatureFallMonitor.Def>().canSwim = true;
            gameObject.AddWeapon(1f, 1f, AttackProperties.DamageType.Standard, AttackProperties.TargetType.Single, 1, 0f);
            EntityTemplates.CreateAndRegisterBaggedCreature(gameObject, false, true, false);
            string inhaleSound = "OilFloater_intake_air";

            if (is_baby)
            {
                inhaleSound = "OilFloaterBaby_intake_air";
            }

            IdleStates.Def state = new IdleStates.Def();
            state.customIdleAnim = new IdleStates.Def.IdleAnimCallback(AquaOilfloaterConfig.CustomIdleAnim);

            ChoreTable.Builder chore_table = new ChoreTable.Builder().Add(new DeathStates.Def()).Add(new AnimInterruptStates.Def())
                                             .Add(new GrowUpStates.Def()).Add(new TrappedStates.Def()).Add(new IncubatingStates.Def())
                                             .Add(new BaggedStates.Def()).Add(new FallStates.Def()).Add(new StunnedStates.Def())
                                             /*.Add(new DrowningStates.Def())*/.Add(new DebugGoToStates.Def()).PushInterruptGroup()//.Add(new GasDrowningStates.Def())
                                             .Add(new CreatureSleepStates.Def()).Add(new FixedCaptureStates.Def())
                                             .Add(new RanchedStates.Def()).Add(new LayEggStates.Def()).Add(new InhaleStates.Def
            {
                inhaleSound = inhaleSound
            }).Add(new SameSpotPoopStates.Def()).Add(new CallAdultStates.Def()).PopInterruptGroup()
                                             .Add(state);

            EntityTemplates.AddCreatureBrain(gameObject, chore_table, GameTags.Creatures.Species.OilFloaterSpecies, symbolOverridePrefix);
            //string sound = "OilFloater_move_LP";
            //if (is_baby)
            //{
            //    sound = "OilFloaterBaby_move_LP";
            //}
            //gameObject.AddOrGet<OilFloaterMovementSound>().sound = sound;
            return(gameObject);
        }
    public GameObject CreatePrefab()
    {
        string         iD          = ID;
        string         name        = STRINGS.CREATURES.SPECIES.BASICFABRICMATERIALPLANT.NAME;
        string         desc        = STRINGS.CREATURES.SPECIES.BASICFABRICMATERIALPLANT.DESC;
        float          mass        = 1f;
        KAnimFile      anim        = Assets.GetAnim("swampreed_kanim");
        string         initialAnim = "idle_empty";
        EffectorValues tIER        = DECOR.BONUS.TIER0;
        GameObject     gameObject  = EntityTemplates.CreatePlacedEntity(iD, name, desc, mass, anim, initialAnim, Grid.SceneLayer.BuildingBack, 1, 3, tIER, default(EffectorValues), SimHashes.Creature, null, 293f);
        GameObject     template    = gameObject;

        initialAnim = BasicFabricConfig.ID;
        SimHashes[] safe_elements = new SimHashes[5]
        {
            SimHashes.Oxygen,
            SimHashes.ContaminatedOxygen,
            SimHashes.CarbonDioxide,
            SimHashes.DirtyWater,
            SimHashes.Water
        };
        EntityTemplates.ExtendEntityToBasicPlant(template, 248.15f, 295.15f, 310.15f, 398.15f, safe_elements, false, 0f, 0.15f, initialAnim, false, true, true, true, 2400f);
        EntityTemplates.ExtendPlantToIrrigated(gameObject, new PlantElementAbsorber.ConsumeInfo[1]
        {
            new PlantElementAbsorber.ConsumeInfo
            {
                tag = GameTags.DirtyWater,
                massConsumptionRate = 0.266666681f
            }
        });
        gameObject.AddOrGet <StandardCropPlant>();
        gameObject.AddOrGet <KAnimControllerBase>().randomiseLoopedOffset = true;
        gameObject.AddOrGet <LoopingSounds>();
        template = gameObject;
        SeedProducer.ProductionType productionType = SeedProducer.ProductionType.Harvest;
        initialAnim = SEED_ID;
        desc        = STRINGS.CREATURES.SPECIES.SEEDS.BASICFABRICMATERIALPLANT.NAME;
        name        = STRINGS.CREATURES.SPECIES.SEEDS.BASICFABRICMATERIALPLANT.DESC;
        anim        = Assets.GetAnim("seed_swampreed_kanim");
        int        numberOfSeeds = 0;
        List <Tag> list          = new List <Tag>();

        list.Add(GameTags.WaterSeed);
        list = list;
        iD   = STRINGS.CREATURES.SPECIES.BASICFABRICMATERIALPLANT.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("swampreed_kanim"), "place", 1, 3);
        SoundEventVolumeCache.instance.AddVolume("swampreed_kanim", "FabricPlant_grow", NOISE_POLLUTION.CREATURES.TIER3);
        SoundEventVolumeCache.instance.AddVolume("swampreed_kanim", "FabricPlant_harvest", NOISE_POLLUTION.CREATURES.TIER3);
        return(gameObject);
    }
    public static GameObject BaseMoo(string id, string name, string desc, string traitId, string anim_file, bool is_baby, string symbol_override_prefix)
    {
        float          mass        = 50f;
        KAnimFile      anim        = Assets.GetAnim(anim_file);
        string         initialAnim = "idle_loop";
        EffectorValues tIER        = DECOR.BONUS.TIER0;
        GameObject     gameObject  = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, anim, initialAnim, Grid.SceneLayer.Creatures, 2, 2, tIER, default(EffectorValues), SimHashes.Creature, null, 293f);

        EntityTemplates.ExtendEntityToBasicCreature(gameObject, FactionManager.FactionID.Prey, traitId, "FlyerNavGrid2x2", NavType.Hover, 32, 2f, "Meat", 10, true, true, 123.149994f, 423.15f, 73.1499939f, 473.15f);
        if (!string.IsNullOrEmpty(symbol_override_prefix))
        {
            gameObject.AddOrGet <SymbolOverrideController>().ApplySymbolOverridesByAffix(Assets.GetAnim(anim_file), symbol_override_prefix, null, 0);
        }
        KPrefabID component = gameObject.GetComponent <KPrefabID>();

        component.AddTag(GameTags.Creatures.Flyer, false);
        component.prefabInitFn += delegate(GameObject inst)
        {
            inst.GetAttributes().Add(Db.Get().Attributes.MaxUnderwaterTravelCost);
        };
        gameObject.AddOrGet <LoopingSounds>();
        LureableMonitor.Def def = gameObject.AddOrGetDef <LureableMonitor.Def>();
        def.lures = new Tag[1]
        {
            SimHashes.BleachStone.CreateTag()
        };
        gameObject.AddOrGetDef <ThreatMonitor.Def>();
        gameObject.AddOrGetDef <SubmergedMonitor.Def>();
        EntityTemplates.CreateAndRegisterBaggedCreature(gameObject, true, false, false);
        gameObject.AddOrGetDef <RanchableMonitor.Def>();
        gameObject.AddOrGetDef <FixedCapturableMonitor.Def>();
        ChoreTable.Builder chore_table = new ChoreTable.Builder().Add(new DeathStates.Def(), true).Add(new AnimInterruptStates.Def(), true).Add(new BaggedStates.Def(), true)
                                         .Add(new StunnedStates.Def(), true)
                                         .Add(new DebugGoToStates.Def(), true)
                                         .Add(new DrowningStates.Def(), true)
                                         .PushInterruptGroup()
                                         .Add(new CreatureSleepStates.Def(), true)
                                         .Add(new FixedCaptureStates.Def(), true)
                                         .Add(new RanchedStates.Def(), true)
                                         .Add(new EatStates.Def(), true)
                                         .Add(new PlayAnimsStates.Def(GameTags.Creatures.Poop, false, "poop", STRINGS.CREATURES.STATUSITEMS.EXPELLING_GAS.NAME, STRINGS.CREATURES.STATUSITEMS.EXPELLING_GAS.TOOLTIP), true)
                                         .Add(new MoveToLureStates.Def(), true)
                                         .PopInterruptGroup()
                                         .Add(new IdleStates.Def
        {
            customIdleAnim = new IdleStates.Def.IdleAnimCallback(BaseMooConfig.CustomIdleAnim)
        }, true);
        EntityTemplates.AddCreatureBrain(gameObject, chore_table, GameTags.Creatures.Species.MooSpecies, symbol_override_prefix);
        return(gameObject);
    }
Exemplo n.º 28
0
    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);
    }
Exemplo n.º 29
0
    public GameObject CreatePrefab()
    {
        GameObject     gameObject = EntityTemplates.CreatePlacedEntity("PropLight", STRINGS.BUILDINGS.PREFABS.PROPLIGHT.NAME, STRINGS.BUILDINGS.PREFABS.PROPLIGHT.DESC, 50f, Assets.GetAnim("setpiece_light_kanim"), "off", Grid.SceneLayer.Building, 1, 1, TUNING.BUILDINGS.DECOR.BONUS.TIER0, NOISE_POLLUTION.NOISY.TIER0, SimHashes.Creature, null, 293f);
        PrimaryElement component  = gameObject.GetComponent <PrimaryElement>();

        component.SetElement(SimHashes.Steel);
        component.Temperature = 294.15f;
        OccupyArea occupyArea = gameObject.AddOrGet <OccupyArea>();

        occupyArea.objectLayers = new ObjectLayer[1]
        {
            ObjectLayer.Building
        };
        return(gameObject);
    }
Exemplo n.º 30
0
    public GameObject CreatePrefab()
    {
        string         id          = "GasGrass";
        string         name        = STRINGS.CREATURES.SPECIES.GASGRASS.NAME;
        string         desc        = STRINGS.CREATURES.SPECIES.GASGRASS.DESC;
        float          mass        = 1f;
        KAnimFile      anim        = Assets.GetAnim("gassygrass_kanim");
        string         initialAnim = "idle_empty";
        EffectorValues tIER        = DECOR.BONUS.TIER3;
        GameObject     gameObject  = EntityTemplates.CreatePlacedEntity(id, name, desc, mass, anim, initialAnim, Grid.SceneLayer.BuildingFront, 1, 3, tIER, default(EffectorValues), SimHashes.Creature, null, 255f);

        EntityTemplates.ExtendEntityToBasicPlant(gameObject, 218.15f, 0f, 348.15f, 373.15f, null, true, 0f, 0.15f, "GasGrassHarvested", true, true, true, true, 2400f);
        EntityTemplates.ExtendPlantToIrrigated(gameObject, new PlantElementAbsorber.ConsumeInfo[1]
        {
            new PlantElementAbsorber.ConsumeInfo
            {
                tag = GameTags.Chlorine,
                massConsumptionRate = 0.000833333354f
            }
        });
        gameObject.AddOrGet <StandardCropPlant>();
        HarvestDesignatable harvestDesignatable = gameObject.AddOrGet <HarvestDesignatable>();

        harvestDesignatable.defaultHarvestStateWhenPlanted = false;
        CropSleepingMonitor.Def def = gameObject.AddOrGetDef <CropSleepingMonitor.Def>();
        def.lightIntensityThreshold = 20000f;
        def.prefersDarkness         = false;
        GameObject plant = gameObject;

        SeedProducer.ProductionType productionType = SeedProducer.ProductionType.Hidden;
        initialAnim = "GasGrassSeed";
        desc        = STRINGS.CREATURES.SPECIES.SEEDS.GASGRASS.NAME;
        name        = STRINGS.CREATURES.SPECIES.SEEDS.GASGRASS.DESC;
        anim        = Assets.GetAnim("seed_gassygrass_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.GASGRASS.DOMESTICATEDDESC, EntityTemplates.CollisionShape.CIRCLE, 0.2f, 0.2f, null, string.Empty, false);

        EntityTemplates.CreateAndRegisterPreviewForPlant(seed, "GasGrass_preview", Assets.GetAnim("gassygrass_kanim"), "place", 1, 1);
        SoundEventVolumeCache.instance.AddVolume("gassygrass_kanim", "GasGrass_grow", NOISE_POLLUTION.CREATURES.TIER3);
        SoundEventVolumeCache.instance.AddVolume("gassygrass_kanim", "GasGrass_harvest", NOISE_POLLUTION.CREATURES.TIER3);
        return(gameObject);
    }