public GameObject CreatePrefab()
        {
            Db.Get().effects.Add(CreateEffect());

            GameObject gameObject = EntityTemplates.CreateLooseEntity("Stimulant", "Stimulant", "Temporarily increases physical ability at the cost of increased metabolism.", 1f, unitMass: true, Assets.GetAnim("pill_2_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, isPickupable: true);

            EntityTemplates.ExtendEntityToMedicine(gameObject, medicineInfo);
            ComplexRecipe.RecipeElement[] inputs = new ComplexRecipe.RecipeElement[3]
            {
                new ComplexRecipe.RecipeElement(SimHashes.RefinedCarbon.CreateTag(), 10f),
                new ComplexRecipe.RecipeElement(SpiceNutConfig.ID, 1f),
                new ComplexRecipe.RecipeElement("LightBugEgg", 1f)
            };
            ComplexRecipe.RecipeElement[] outputs = new ComplexRecipe.RecipeElement[1]
            {
                new ComplexRecipe.RecipeElement("Stimulant", 10f)
            };
            string id = ComplexRecipeManager.MakeRecipeID("Apothecary", inputs, outputs);

            recipe = new ComplexRecipe(id, inputs, outputs)
            {
                time        = 75f,
                description = "Temporarily increases physical ability at the cost of increased metabolism.",
                nameDisplay = ComplexRecipe.RecipeNameDisplay.Result,
                fabricators = new List <Tag> {
                    "Apothecary"
                },
                sortOrder = 1
            };
            return(gameObject);
        }
示例#2
0
    public GameObject CreatePrefab()
    {
        string    id          = "ResearchDatabank";
        string    name        = ITEMS.INDUSTRIAL_PRODUCTS.RESEARCH_DATABANK.NAME;
        string    desc        = ITEMS.INDUSTRIAL_PRODUCTS.RESEARCH_DATABANK.DESC;
        float     mass        = 1f;
        bool      unitMass    = true;
        KAnimFile anim        = Assets.GetAnim("floppy_disc_kanim");
        string    initialAnim = "object";

        Grid.SceneLayer sceneLayer = Grid.SceneLayer.Front;
        EntityTemplates.CollisionShape collisionShape = EntityTemplates.CollisionShape.CIRCLE;
        float      width        = 0.35f;
        float      height       = 0.35f;
        bool       isPickupable = true;
        List <Tag> list         = new List <Tag>();

        list.Add(GameTags.IndustrialIngredient);
        list.Add(GameTags.Experimental);
        list = list;
        GameObject     gameObject     = EntityTemplates.CreateLooseEntity(id, name, desc, mass, unitMass, anim, initialAnim, sceneLayer, collisionShape, width, height, isPickupable, 0, SimHashes.Creature, list);
        EntitySplitter entitySplitter = gameObject.AddOrGet <EntitySplitter>();

        entitySplitter.maxStackSize = (float)ROCKETRY.DESTINATION_RESEARCH.BASIC;
        return(gameObject);
    }
示例#3
0
        public GameObject CreatePrefab()
        {
            var entity = EntityTemplates.CreateLooseEntity(
                id: Id,
                name: NameWithLink,
                desc: Description,
                mass: 1f,
                unitMass: false,
                anim: Assets.GetAnim("kukumelon_kanim"),
                initialAnim: "object",
                sceneLayer: Grid.SceneLayer.Front,
                collisionShape: EntityTemplates.CollisionShape.RECTANGLE,
                width: 0.8f,
                height: 0.7f,
                isPickupable: true);

            var foodInfo = new EdiblesManager.FoodInfo(
                id: Id,
                caloriesPerUnit: 2000000f,
                quality: 6,
                preserveTemperatue: 255.15f,
                rotTemperature: 277.15f,
                spoilTime: TUNING.FOOD.SPOIL_TIME.SLOW,
                can_rot: true);

            var food = EntityTemplates.ExtendEntityToFood(entity, foodInfo);

            new Recipe(Id, 1f, 0, null, RecipeDescription, 25)
            .SetFabricator(CookingStationConfig.ID, 100f)
            .AddIngredient(new Recipe.Ingredient(PalmeraBerryConfig.Id, 1f));

            return(food);
        }
    public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreateLooseEntity("PacuFillet", ITEMS.FOOD.MEAT.NAME, ITEMS.FOOD.MEAT.DESC, 1f, false, Assets.GetAnim("pacufillet_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, null);

        EntityTemplates.ExtendEntityToFood(gameObject, FOOD.FOOD_TYPES.FISH_MEAT);
        return(gameObject);
    }
    public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreateLooseEntity("AdvancedCure", ITEMS.PILLS.ADVANCEDCURE.NAME, ITEMS.PILLS.ADVANCEDCURE.DESC, 1f, true, Assets.GetAnim("vial_spore_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, null);
        KPrefabID  component  = gameObject.GetComponent <KPrefabID>();

        component.AddTag(GameTags.MedicalSupplies, false);
        ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[2]
        {
            new ComplexRecipe.RecipeElement(SimHashes.Steel.CreateTag(), 1f),
            new ComplexRecipe.RecipeElement("LightBugOrangeEgg", 1f)
        };
        ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement("AdvancedCure", 1f)
        };
        string        id            = ComplexRecipeManager.MakeRecipeID("Apothecary", array, array2);
        ComplexRecipe complexRecipe = new ComplexRecipe(id, array, array2);

        complexRecipe.time        = 200f;
        complexRecipe.description = ITEMS.PILLS.ADVANCEDCURE.RECIPEDESC;
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.Result;
        complexRecipe.fabricators = new List <Tag>
        {
            "Apothecary"
        };
        complexRecipe.sortOrder    = 20;
        complexRecipe.requiredTech = "MedicineIV";
        recipe = complexRecipe;
        return(gameObject);
    }
示例#6
0
    public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreateLooseEntity("BasicBooster", ITEMS.PILLS.BASICBOOSTER.NAME, ITEMS.PILLS.BASICBOOSTER.DESC, 1f, true, Assets.GetAnim("pill_2_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, null);

        EntityTemplates.ExtendEntityToMedicine(gameObject, MEDICINE.BASICBOOSTER);
        ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement("Carbon", 1f)
        };
        ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement("BasicBooster".ToTag(), 1f)
        };
        string        id            = ComplexRecipeManager.MakeRecipeID("Apothecary", array, array2);
        ComplexRecipe complexRecipe = new ComplexRecipe(id, array, array2);

        complexRecipe.time        = 50f;
        complexRecipe.description = ITEMS.PILLS.BASICBOOSTER.RECIPEDESC;
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.Result;
        complexRecipe.fabricators = new List <Tag>
        {
            "Apothecary"
        };
        complexRecipe.sortOrder = 1;
        recipe = complexRecipe;
        return(gameObject);
    }
示例#7
0
        public GameObject CreatePrefab()
        {
            var looseEntity = EntityTemplates.CreateLooseEntity(
                id: Id,
                name: Name,
                desc: Description,
                mass: 1f,
                unitMass: false,
                anim: Assets.GetAnim("cactusflower_kanim"),
                initialAnim: "object",
                sceneLayer: Grid.SceneLayer.Front,
                collisionShape: EntityTemplates.CollisionShape.RECTANGLE,
                width: 0.6f,
                height: 0.4f,
                isPickupable: true);

            var foodInfo = new EdiblesManager.FoodInfo(
                id: Id,
                caloriesPerUnit: 1200000f,
                quality: TUNING.FOOD.FOOD_QUALITY_GOOD,
                preserveTemperatue: 255.15f,
                rotTemperature: 277.15f,
                spoilTime: 3600f,
                can_rot: true);

            var foodEntity = EntityTemplates.ExtendEntityToFood(
                template: looseEntity,
                foodInfo: foodInfo);

            return(foodEntity);
        }
    public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreateLooseEntity("BasicPlantFood", ITEMS.FOOD.BASICPLANTFOOD.NAME, ITEMS.FOOD.BASICPLANTFOOD.DESC, 1f, false, Assets.GetAnim("meallicegrain_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.CIRCLE, 0.25f, 0.25f, true, 0, SimHashes.Creature, null);

        EntityTemplates.ExtendEntityToFood(gameObject, FOOD.FOOD_TYPES.BASICPLANTFOOD);
        return(gameObject);
    }
    public GameObject CreatePrefab()
    {
        string    id          = "BabyCrabShell";
        string    name        = ITEMS.INDUSTRIAL_PRODUCTS.CRAB_SHELL.NAME;
        string    desc        = ITEMS.INDUSTRIAL_PRODUCTS.CRAB_SHELL.DESC;
        float     mass        = 5f;
        bool      unitMass    = true;
        KAnimFile anim        = Assets.GetAnim("crabshells_small_kanim");
        string    initialAnim = "object";

        Grid.SceneLayer sceneLayer = Grid.SceneLayer.Front;
        EntityTemplates.CollisionShape collisionShape = EntityTemplates.CollisionShape.RECTANGLE;
        float      width        = 0.9f;
        float      height       = 0.6f;
        bool       isPickupable = true;
        List <Tag> list         = new List <Tag>();

        list.Add(GameTags.IndustrialIngredient);
        list.Add(GameTags.Organics);
        list = list;
        GameObject gameObject = EntityTemplates.CreateLooseEntity(id, name, desc, mass, unitMass, anim, initialAnim, sceneLayer, collisionShape, width, height, isPickupable, 0, SimHashes.Creature, list);

        gameObject.AddOrGet <EntitySplitter>();
        gameObject.AddOrGet <SimpleMassStatusItem>();
        EntityTemplates.CreateAndRegisterCompostableFromPrefab(gameObject);
        return(gameObject);
    }
        public GameObject CreatePrefab()
        {
            var looseEntity = EntityTemplates.CreateLooseEntity(
                id: Id,
                name: Name,
                desc: Description,
                mass: 1000f,
                unitMass: true,
                anim: Assets.GetAnim("aquabulbsack_kanim"),
                initialAnim: "object",
                sceneLayer: Grid.SceneLayer.BuildingBack,
                collisionShape: EntityTemplates.CollisionShape.RECTANGLE,
                width: 0.4f,
                height: 0.8f,
                isPickupable: true,
                additionalTags: new List <Tag>()
            {
                GameTags.IndustrialIngredient,
                GameTags.Organics
            });

            looseEntity.AddOrGet <EntitySplitter>();
            looseEntity.AddOrGet <SimpleMassStatusItem>();
            EntityTemplates.CreateAndRegisterCompostableFromPrefab(looseEntity);
            return(looseEntity);
        }
        public GameObject CreatePrefab()
        {
            GameObject looseEntity = EntityTemplates.CreateLooseEntity(ID, Name, Description, 1f, true, Assets.GetAnim((HashedString)"floral_antihistamine_kanim"),
                                                                       "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, (List <Tag>)null);
            MedicineInfo medicine_info = new MedicineInfo(ID.ToLower(), Effect_, MedicineInfo.MedicineType.CureSpecific, (string)null, new string[1]
            {
                "Allergies"
            });

            EntityTemplates.ExtendEntityToMedicine(looseEntity, medicine_info);
            looseEntity.GetComponent <KPrefabID>().AddTag(GameTags.MedicalSupplies, false);
            ComplexRecipe.RecipeElement[] ingredients = new ComplexRecipe.RecipeElement[2]
            {
                new ComplexRecipe.RecipeElement(SimHashes.Copper.CreateTag(), 100f),
                new ComplexRecipe.RecipeElement((Tag)FilamentsConfig.Id, 50f)
            };
            ComplexRecipe.RecipeElement[] results = new ComplexRecipe.RecipeElement[1]
            {
                new ComplexRecipe.RecipeElement((Tag)ID, 1f)
            };

            FloralAntihistamineConfig.recipe = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID("Apothecary", (IList <ComplexRecipe.RecipeElement>)ingredients, (IList <ComplexRecipe.RecipeElement>)results), ingredients, results, 0)
            {
                time        = 200f,
                description = (string)Description,
                nameDisplay = ComplexRecipe.RecipeNameDisplay.Result,
                fabricators = new List <Tag>()
                {
                    (Tag)"Apothecary"
                },
                sortOrder    = 20,
                requiredTech = AdvancedCureConfig.recipe.requiredTech// "MedicineIV"
            };
            return(looseEntity);
        }
示例#12
0
    public void RegisterEquipment(IEquipmentConfig config)
    {
        EquipmentDef equipmentDef      = config.CreateEquipmentDef();
        string       id                = equipmentDef.Id;
        string       name              = equipmentDef.Name;
        string       recipeDescription = equipmentDef.RecipeDescription;
        float        mass              = equipmentDef.Mass;
        bool         unitMass          = true;
        KAnimFile    anim              = equipmentDef.Anim;
        string       initialAnim       = "object";

        Grid.SceneLayer sceneLayer = Grid.SceneLayer.Ore;
        EntityTemplates.CollisionShape collisionShape = equipmentDef.CollisionShape;
        float      width         = equipmentDef.width;
        float      height        = equipmentDef.height;
        bool       isPickupable  = true;
        SimHashes  outputElement = equipmentDef.OutputElement;
        GameObject gameObject    = EntityTemplates.CreateLooseEntity(id, name, recipeDescription, mass, unitMass, anim, initialAnim, sceneLayer, collisionShape, width, height, isPickupable, 0, outputElement, null);
        Equippable equippable    = gameObject.AddComponent <Equippable>();

        equippable.def = equipmentDef;
        Debug.Assert((Object)equippable.def != (Object)null);
        equippable.slotID = equipmentDef.Slot;
        Debug.Assert(equippable.slot != null);
        config.DoPostConfigure(gameObject);
        Assets.AddPrefab(gameObject.GetComponent <KPrefabID>());
    }
示例#13
0
        public GameObject CreatePrefab()
        {
            GameObject looseEntity = EntityTemplates.CreateLooseEntity(ID, Name, Description, 1f, true, Assets.GetAnim((HashedString)"mending_serum_kanim"),
                                                                       "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, (List <Tag>)null);
            MedicineInfo medicine_info = new MedicineInfo(ID.ToLower(), Effect_, MedicineInfo.MedicineType.Booster, "AdvancedDoctorStation", (string[])null);

            EntityTemplates.ExtendEntityToMedicine(looseEntity, medicine_info);
            looseEntity.GetComponent <KPrefabID>().AddTag(GameTags.MedicalSupplies, false);
            ComplexRecipe.RecipeElement[] ingredients = new ComplexRecipe.RecipeElement[3]
            {
                new ComplexRecipe.RecipeElement((Tag)RawEggConfig.ID, 3f),
                new ComplexRecipe.RecipeElement((Tag)NectarConfig.Id, 10f),
                new ComplexRecipe.RecipeElement((Tag)SwampLilyFlowerConfig.ID, 1f)
            };
            ComplexRecipe.RecipeElement[] results = new ComplexRecipe.RecipeElement[1]
            {
                new ComplexRecipe.RecipeElement((Tag)ID, 1f)
            };
            MendingSerumConfig.recipe = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID("Apothecary", (IList <ComplexRecipe.RecipeElement>)ingredients, (IList <ComplexRecipe.RecipeElement>)results), ingredients, results, 0)
            {
                time        = 200f,
                description = (string)Description,
                nameDisplay = ComplexRecipe.RecipeNameDisplay.Result,
                fabricators = new List <Tag>()
                {
                    (Tag)"Apothecary"
                },
                sortOrder    = 20,
                requiredTech = AdvancedCureConfig.recipe.requiredTech// "MedicineIV"
            };
            return(looseEntity);
        }
示例#14
0
        public GameObject CreatePrefab()
        {
            GameObject gameObject = EntityTemplates.CreateLooseEntity(
                id: ID,
                name: STRINGS.ITEMS.INDUSTRIAL_PRODUCTS.SKELETON.NAME,
                desc: STRINGS.ITEMS.INDUSTRIAL_PRODUCTS.SKELETON.DESC,
                mass: MASS,
                unitMass: true,
                anim: Assets.GetAnim("bones_kanim"),
                initialAnim: "object",
                sceneLayer: Grid.SceneLayer.Ore,
                collisionShape: EntityTemplates.CollisionShape.RECTANGLE,
                width: 0.9f,
                height: 0.8f,
                isPickupable: true,
                sortOrder: 0,
                element: SimHashes.Creature,
                additionalTags: new List <Tag> {
                GameTags.IndustrialIngredient, GameTags.Organics
            });

            gameObject.AddOrGet <SimpleMassStatusItem>();
            gameObject.AddOrGet <OccupyArea>().OccupiedCellsOffsets = EntityTemplates.GenerateOffsets(1, 1);
            DecorProvider decorProvider = gameObject.AddOrGet <DecorProvider>();

            decorProvider.baseDecor  = TUNING.DUPLICANTSTATS.CLOTHING.DECOR_MODIFICATION.BASIC;
            decorProvider.baseRadius = 3f;
            gameObject.AddOrGetDef <EffectLineOfSight.Def>().effectName = DeathPatches.OBSERVED_ROTTEN_CORPSE;
            gameObject.AddOrGet <Skeleton>();
            ConfigureRecipes();
            return(gameObject);
        }
示例#15
0
    public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreateLooseEntity("IntermediateCure", ITEMS.PILLS.INTERMEDIATECURE.NAME, ITEMS.PILLS.INTERMEDIATECURE.DESC, 1f, true, Assets.GetAnim("iv_slimelung_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, null);
        KPrefabID  component  = gameObject.GetComponent <KPrefabID>();

        component.AddTag(GameTags.MedicalSupplies, false);
        ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[2]
        {
            new ComplexRecipe.RecipeElement(SwampLilyFlowerConfig.ID, 1f),
            new ComplexRecipe.RecipeElement(SimHashes.Phosphorite.CreateTag(), 1f)
        };
        ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement("IntermediateCure", 1f)
        };
        string        id            = ComplexRecipeManager.MakeRecipeID("Apothecary", array, array2);
        ComplexRecipe complexRecipe = new ComplexRecipe(id, array, array2);

        complexRecipe.time        = 100f;
        complexRecipe.description = ITEMS.PILLS.INTERMEDIATECURE.RECIPEDESC;
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.Result;
        complexRecipe.fabricators = new List <Tag>
        {
            "Apothecary"
        };
        complexRecipe.sortOrder    = 10;
        complexRecipe.requiredTech = "MedicineII";
        recipe = complexRecipe;
        return(gameObject);
    }
示例#16
0
        public GameObject CreatePrefab()
        {
            string    name        = "Bark Skin";
            string    desc        = "Are produced by wooden hatch";
            float     mass        = 1f;//too litle, add more later
            bool      unitMass    = false;
            KAnimFile anim        = Assets.GetAnim("bark_skin_kanim");
            string    initialAnim = "object";

            Grid.SceneLayer sceneLayer = Grid.SceneLayer.Front;
            EntityTemplates.CollisionShape collisionShape = EntityTemplates.CollisionShape.CIRCLE;
            float      width          = 0.35f;
            float      height         = 0.35f;
            bool       isPickupable   = true;
            List <Tag> additionalTags = new List <Tag>
            {
                GameTags.IndustrialIngredient,
                GameTags.Organics
            };
            GameObject gameObject = EntityTemplates.CreateLooseEntity(ID, name, desc, mass, unitMass, anim, initialAnim, sceneLayer, collisionShape, width, height, isPickupable, 0, SimHashes.Creature, additionalTags);

            gameObject.AddOrGet <EntitySplitter>();
            gameObject.AddOrGet <SimpleMassStatusItem>();
            return(gameObject);
        }
    public GameObject CreatePrefab()
    {
        string    iD          = ID;
        string    name        = ITEMS.INDUSTRIAL_PRODUCTS.BASIC_FABRIC.NAME;
        string    desc        = ITEMS.INDUSTRIAL_PRODUCTS.BASIC_FABRIC.DESC;
        float     mass        = 1f;
        bool      unitMass    = true;
        KAnimFile anim        = Assets.GetAnim("swampreedwool_kanim");
        string    initialAnim = "object";

        Grid.SceneLayer sceneLayer = Grid.SceneLayer.BuildingBack;
        EntityTemplates.CollisionShape collisionShape = EntityTemplates.CollisionShape.RECTANGLE;
        float      width        = 0.8f;
        float      height       = 0.45f;
        bool       isPickupable = true;
        int        sortOrder    = SORTORDER.BUILDINGELEMENTS + BasicFabricTuning.SORTORDER;
        List <Tag> list         = new List <Tag>();

        list.Add(GameTags.IndustrialIngredient);
        list.Add(GameTags.BuildingFiber);
        list = list;
        GameObject gameObject = EntityTemplates.CreateLooseEntity(iD, name, desc, mass, unitMass, anim, initialAnim, sceneLayer, collisionShape, width, height, isPickupable, sortOrder, SimHashes.Creature, list);

        gameObject.AddOrGet <EntitySplitter>();
        PrefabAttributeModifiers prefabAttributeModifiers = gameObject.AddOrGet <PrefabAttributeModifiers>();

        prefabAttributeModifiers.AddAttributeDescriptor(decorModifier);
        return(gameObject);
    }
    public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreateLooseEntity("Antihistamine", ITEMS.PILLS.ANTIHISTAMINE.NAME, ITEMS.PILLS.ANTIHISTAMINE.DESC, 1f, true, Assets.GetAnim("pill_allergies_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, null);

        EntityTemplates.ExtendEntityToMedicine(gameObject, MEDICINE.ANTIHISTAMINE);
        ComplexRecipe.RecipeElement[] array = new ComplexRecipe.RecipeElement[2]
        {
            new ComplexRecipe.RecipeElement("PrickleFlowerSeed", 1f),
            new ComplexRecipe.RecipeElement(SimHashes.Dirt.CreateTag(), 1f)
        };
        ComplexRecipe.RecipeElement[] array2 = new ComplexRecipe.RecipeElement[1]
        {
            new ComplexRecipe.RecipeElement("Antihistamine", 10f)
        };
        string        id            = ComplexRecipeManager.MakeRecipeID("Apothecary", array, array2);
        ComplexRecipe complexRecipe = new ComplexRecipe(id, array, array2);

        complexRecipe.time        = 100f;
        complexRecipe.description = ITEMS.PILLS.ANTIHISTAMINE.RECIPEDESC;
        complexRecipe.nameDisplay = ComplexRecipe.RecipeNameDisplay.Result;
        complexRecipe.fabricators = new List <Tag>
        {
            "Apothecary"
        };
        complexRecipe.sortOrder = 10;
        recipe = complexRecipe;
        return(gameObject);
    }
示例#19
0
        public GameObject CreatePrefab()
        {
            var entity = EntityTemplates.CreateLooseEntity(
                id: Id,
                name: UI.FormatAsLink(Name, Id),
                desc: Description,
                mass: 1f,
                unitMass: false,
                anim: Assets.GetAnim("filaments_kanim"),
                initialAnim: "object",
                sceneLayer: Grid.SceneLayer.Front,
                collisionShape: EntityTemplates.CollisionShape.RECTANGLE,
                width: 0.70f,
                height: 0.80f,
                isPickupable: true);

            var foodInfo = new EdiblesManager.FoodInfo(
                id: Id,
                dlcId: DlcManager.VANILLA_ID,
                caloriesPerUnit: 1000f,
                quality: TUNING.FOOD.FOOD_QUALITY_MEDIOCRE,
                preserveTemperatue: 255.15f,
                rotTemperature: 277.15f,
                spoilTime: TUNING.FOOD.SPOIL_TIME.SLOW,
                can_rot: true);

            var foodEntity = EntityTemplates.ExtendEntityToFood(entity, foodInfo);



            return(foodEntity);
        }
示例#20
0
    public static GameObject CreateArtifact(string id, string name, string desc, string initial_anim, string ui_anim, ArtifactTier artifact_tier, PostInitFn postInitFn = null, SimHashes element = SimHashes.Creature)
    {
        GameObject gameObject = EntityTemplates.CreateLooseEntity("artifact_" + id.ToLower(), name, desc, 25f, true, Assets.GetAnim("artifacts_kanim"), initial_anim, Grid.SceneLayer.Ore, EntityTemplates.CollisionShape.RECTANGLE, 1f, 1f, true, SORTORDER.BUILDINGELEMENTS, element, new List <Tag>
        {
            GameTags.MiscPickupable
        });
        OccupyArea occupyArea = gameObject.AddOrGet <OccupyArea>();

        occupyArea.OccupiedCellsOffsets = EntityTemplates.GenerateOffsets(1, 1);
        DecorProvider decorProvider = gameObject.AddOrGet <DecorProvider>();

        decorProvider.SetValues(artifact_tier.decorValues);
        decorProvider.overrideName = gameObject.name;
        SpaceArtifact spaceArtifact = gameObject.AddOrGet <SpaceArtifact>();

        spaceArtifact.SetUIAnim(ui_anim);
        spaceArtifact.SetArtifactTier(artifact_tier);
        gameObject.AddOrGet <KSelectable>();
        gameObject.GetComponent <KBatchedAnimController>().initialMode = KAnim.PlayMode.Loop;
        postInitFn?.Invoke(gameObject);
        KPrefabID component = gameObject.GetComponent <KPrefabID>();

        component.AddTag(GameTags.PedestalDisplayable, false);
        component.AddTag(GameTags.Artifact, false);
        return(gameObject);
    }
        public GameObject CreatePrefab()
        {
            GameObject food = EntityTemplates.ExtendEntityToFood(EntityTemplates.CreateLooseEntity(ID, Name, Desc, 1f, false, Assets.GetAnim("kukumelon_kanim"), "object",
                                                                                                   Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.7f, true), new EdiblesManager.FoodInfo(ID, 2000000f, 6, 255.15f, 277.15f, FOOD.SPOIL_TIME.SLOW, true));

            new Recipe(ID, 1f, 0, null, RecipeDesc, 25).SetFabricator(CookingStationConfig.ID, 100f).AddIngredient(new Recipe.Ingredient(PalmeraBerryConfig.ID, 1f));
            return(food);
        }
    public GameObject CreatePrefab()
    {
        GameObject template = EntityTemplates.CreateLooseEntity("FruitCake", ITEMS.FOOD.FRUITCAKE.NAME, ITEMS.FOOD.FRUITCAKE.DESC, 1f, false, Assets.GetAnim("fruitcake_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, null);

        template = EntityTemplates.ExtendEntityToFood(template, FOOD.FOOD_TYPES.FRUITCAKE);
        ComplexRecipeManager.Get().GetRecipe(recipe.id).FabricationVisualizer = MushBarConfig.CreateFabricationVisualizer(template);
        return(template);
    }
    public GameObject CreatePrefab()
    {
        GameObject template = EntityTemplates.CreateLooseEntity("PickledMeal", ITEMS.FOOD.PICKLEDMEAL.NAME, ITEMS.FOOD.PICKLEDMEAL.DESC, 1f, false, Assets.GetAnim("pickledmeal_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.6f, 0.7f, true, 0, SimHashes.Creature, null);

        template = EntityTemplates.ExtendEntityToFood(template, FOOD.FOOD_TYPES.PICKLEDMEAL);
        KPrefabID component = template.GetComponent <KPrefabID>();

        component.AddTag(GameTags.Pickled, false);
        return(template);
    }
    public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreateLooseEntity("EggShell", ITEMS.INDUSTRIAL_PRODUCTS.EGG_SHELL.NAME, ITEMS.INDUSTRIAL_PRODUCTS.EGG_SHELL.DESC, 1f, false, Assets.GetAnim("eggshells_kanim"), "object", Grid.SceneLayer.Front, EntityTemplates.CollisionShape.RECTANGLE, 0.9f, 0.6f, true, 0, SimHashes.Creature, null);
        KPrefabID  component  = gameObject.GetComponent <KPrefabID>();

        component.AddTag(GameTags.Organics, false);
        gameObject.AddOrGet <EntitySplitter>();
        gameObject.AddOrGet <SimpleMassStatusItem>();
        EntityTemplates.CreateAndRegisterCompostableFromPrefab(gameObject);
        return(gameObject);
    }
示例#25
0
        public GameObject CreatePrefab()
        {
            var entity = EntityTemplates.CreateLooseEntity(
                id: Id,
                name: NameWithLink,
                desc: Description,
                mass: 1f,
                unitMass: false,
                anim: Assets.GetAnim("kukumelon_kanim"),
                initialAnim: "object",
                sceneLayer: Grid.SceneLayer.Front,
                collisionShape: EntityTemplates.CollisionShape.RECTANGLE,
                width: 0.8f,
                height: 0.7f,
                isPickupable: true);

            var foodInfo = new EdiblesManager.FoodInfo(
                id: Id,
                caloriesPerUnit: 2000000f,
                quality: 6,
                preserveTemperatue: 255.15f,
                rotTemperature: 277.15f,
                spoilTime: TUNING.FOOD.SPOIL_TIME.SLOW,
                can_rot: true);

            var food = EntityTemplates.ExtendEntityToFood(entity, foodInfo);

            new Recipe(Id, 1f, 0, null, RecipeDescription, 25)
            .SetFabricator(CookingStationConfig.ID, 100f)
            .AddIngredient(new Recipe.Ingredient(PalmeraBerryConfig.Id, 1f));

            ComplexRecipe.RecipeElement[] ingredients =
            {
                new ComplexRecipe.RecipeElement(PalmeraBerryConfig.Id, 1f)
            };

            ComplexRecipe.RecipeElement[] results =
            {
                new ComplexRecipe.RecipeElement(SteamedPalmeraBerryConfig.Id, 1f)
            };

            FriedMushroomConfig.recipe = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID(CookingStationConfig.ID, ingredients, results), ingredients, results)
            {
                time                   = 100f,
                description            = RecipeDescription,
                useResultAsDescription = true,
                fabricators            = new List <Tag> {
                    CookingStationConfig.ID
                },
                sortOrder = 120
            };

            return(food);
        }
示例#26
0
    public GameObject CreatePrefab()
    {
        GameObject gameObject = EntityTemplates.CreateLooseEntity("RawEgg", ITEMS.FOOD.RAWEGG.NAME, ITEMS.FOOD.RAWEGG.DESC, 1f, false, Assets.GetAnim("rawegg_kanim"), "object", Grid.SceneLayer.Ore, EntityTemplates.CollisionShape.RECTANGLE, 0.8f, 0.4f, true, 0, SimHashes.Creature, null);

        EntityTemplates.ExtendEntityToFood(gameObject, FOOD.FOOD_TYPES.RAWEGG);
        TemperatureCookable temperatureCookable = gameObject.AddOrGet <TemperatureCookable>();

        temperatureCookable.cookTemperature = 344.15f;
        temperatureCookable.cookedID        = "CookedEgg";
        return(gameObject);
    }
示例#27
0
        public GameObject CreatePrefab()
        {
            var go = EntityTemplates.CreateLooseEntity(
                id: ID,
                name: STRINGS.ITEMS.MASSIVE_HEATSINK_CORE.NAME,
                desc: STRINGS.ITEMS.MASSIVE_HEATSINK_CORE.DESC,
                mass: MASS,
                unitMass: true,
                anim: Assets.GetAnim("massiveheatsink_core_kanim"),
                initialAnim: "idle_crystal",
                sceneLayer: Grid.SceneLayer.Ore,
                collisionShape: EntityTemplates.CollisionShape.RECTANGLE,
                width: 1f,
                height: 1f,
                isPickupable: true,
                sortOrder: SORTORDER.BUILDINGELEMENTS,
                element: SimHashes.Unobtanium,
                additionalTags: new List <Tag> {
                GameTags.IndustrialIngredient,
                GameTags.PedestalDisplayable,
                GameTags.Artifact,
            });

            // это частично спокировано из ArtifactConfig.CreateArtifact, надо поглядывать если что то поменяют
            var occupyArea = go.AddOrGet <OccupyArea>();

            occupyArea.OccupiedCellsOffsets = EntityTemplates.GenerateOffsets(1, 1);
            var decorProvider = go.AddOrGet <DecorProvider>();

            decorProvider.SetValues(TIER_CORE.decorValues);
            decorProvider.overrideName = STRINGS.ITEMS.MASSIVE_HEATSINK_CORE.NAME;
            var spaceArtifact = go.AddOrGet <SpaceArtifact>();

            spaceArtifact.SetUIAnim("ui_crystal");
            spaceArtifact.SetArtifactTier(TIER_CORE);
            spaceArtifact.uniqueAnimNameFragment = "idle_crystal";
            spaceArtifact.artifactType           = ArtifactType.Any;
            go.AddOrGet <KSelectable>();
            go.GetComponent <KBatchedAnimController>().initialMode = KAnim.PlayMode.Loop;

            var pe = go.GetComponent <PrimaryElement>();

            pe.Mass        = MASS;
            pe.Temperature = TEMPERATURE;

            // добавляем в список артифактов только в ваниле, воизбежание непредвиденных последствий на длц
            if (DlcManager.IsPureVanilla())
            {
                ArtifactConfig.artifactItems[ArtifactType.Any].Add(go.name);
            }
            return(go);
        }
示例#28
0
        public GameObject CreatePrefab()
        {
            var entity = EntityTemplates.CreateLooseEntity(
                id: Id,
                name: Name,
                desc: Description,
                mass: 1f,
                unitMass: false,
                anim: Assets.GetAnim("lavacake"),
                initialAnim: "object",
                sceneLayer: Grid.SceneLayer.Front,
                collisionShape: EntityTemplates.CollisionShape.RECTANGLE,
                width: 0.8f,
                height: 0.4f,
                isPickupable: true);

            var foodInfo = new EdiblesManager.FoodInfo(
                id: Id,
                caloriesPerUnit: 4000000f,
                quality: 6,
                preserveTemperatue: 255.15f,
                rotTemperature: 277.15f,
                spoilTime: TUNING.FOOD.SPOIL_TIME.SLOW,
                can_rot: true);

            var food = EntityTemplates.ExtendEntityToFood(
                template: entity,
                foodInfo: foodInfo);

            ComplexRecipe.RecipeElement[] ingredients =
            {
                new ComplexRecipe.RecipeElement(MagmaFernConfig.SeedId, 2f)
            };

            ComplexRecipe.RecipeElement[] results =
            {
                new ComplexRecipe.RecipeElement(Id, 1f)
            };

            Recipe = new ComplexRecipe(ComplexRecipeManager.MakeRecipeID(CookingStationConfig.ID, ingredients, results), ingredients, results)
            {
                time        = TUNING.FOOD.RECIPES.STANDARD_COOK_TIME,
                description = RecipeDescription,
                nameDisplay = ComplexRecipe.RecipeNameDisplay.Result,
                fabricators = new List <Tag> {
                    GourmetCookingStationConfig.ID
                },
                sortOrder = 120
            };

            return(food);
        }
示例#29
0
        public GameObject CreatePrefab()
        {
            var looseEntity = EntityTemplates.CreateLooseEntity(
                id: Id,
                name: Name,
                desc: Description,
                mass: 1f,
                unitMass: false,
                anim: Assets.GetAnim("cactusfleshgrilled_kanim"),
                initialAnim: "object",
                sceneLayer: Grid.SceneLayer.Front,
                collisionShape: EntityTemplates.CollisionShape.RECTANGLE,
                width: 0.8f,
                height: 0.4f,
                isPickupable: true);

            var foodInfo = new EdiblesManager.FoodInfo(
                id: Id,
                caloriesPerUnit: 2800000f,
                quality: TUNING.FOOD.FOOD_QUALITY_MEDIOCRE,
                preserveTemperatue: 255.15f,
                rotTemperature: 277.15f,
                spoilTime: 2400f,
                can_rot: true);

            var foodEntity = EntityTemplates.ExtendEntityToFood(
                template: looseEntity,
                foodInfo: foodInfo);

            var input  = new[] { new ComplexRecipe.RecipeElement(CactusFleshConfig.Id, 2f) };
            var output = new[] { new ComplexRecipe.RecipeElement(Id, 1f) };

            var recipeId = ComplexRecipeManager.MakeRecipeID(
                fabricator: CookingStationConfig.ID,
                inputs: input,
                outputs: output);

            Recipe = new ComplexRecipe(recipeId, input, output)
            {
                time        = TUNING.FOOD.RECIPES.STANDARD_COOK_TIME,
                description = RecipeDescription,
                nameDisplay = ComplexRecipe.RecipeNameDisplay.Result,
                fabricators = new List <Tag> {
                    CookingStationConfig.ID
                },
                sortOrder    = 2,
                requiredTech = null
            };

            return(foodEntity);
        }
示例#30
0
        public GameObject CreatePrefab()
        {
            var entity = EntityTemplates.CreateLooseEntity(ID, Name, Desc, 1f, false,
                                                           Assets.GetAnim("palmeraberry_kanim"), "object", Grid.SceneLayer.Front,
                                                           EntityTemplates.CollisionShape.RECTANGLE, 0.77f, 0.48f, true);

            var foodEntity = EntityTemplates.ExtendEntityToFood(entity, new EdiblesManager.FoodInfo(ID, 0.0f, TUNING.FOOD.FOOD_QUALITY_AWFUL, 255.15f, 277.15f, TUNING.FOOD.SPOIL_TIME.SLOW, true));

            Sublimates sublimates = foodEntity.AddOrGet <Sublimates>();

            sublimates.spawnFXHash = SpawnFXHashes.OxygenEmissionBubbles;
            sublimates.info        = new Sublimates.Info(0.001f, 0f, 1.8f, 0.0f, SimHashes.Hydrogen);

            return(foodEntity);
        }