Ejemplo n.º 1
0
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("EchoBlue");

            mat.SetColor("_TintColor", Color);

            return(mat);
        }
Ejemplo n.º 2
0
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("plortPinkBase");

            mat.SetTripleColor(Colors.Slimes.ALBINO);

            return(mat);
        }
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("ornament_tarr");

            mat.SetTexture(TESTCUBE, Packs.Chapter1.Get <Cubemap>("ornamentViktor"));

            return(mat);
        }
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("EchoBlue");

            mat.SetFloat(HUE_VARIANCE, 1f);
            mat.SetFloat(HUE_SPEED, 0.1f);

            return(mat);
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Gets a Slime Definition by ID (force if needed)
        /// </summary>
        /// <param name="id">ID of the slime</param>
        public static SlimeDefinition GetDefinitionByID(Identifiable.Id id)
        {
            if (GameContext.Instance != null)
            {
                return(GameContext.Instance.SlimeDefinitions.GetSlimeByIdentifiableId(id));
            }

            return(SRObjects.GetAll <SlimeDefinition>().FirstOrDefault(def => def.IdentifiableId == id));
        }
Ejemplo n.º 6
0
        //+ SPAWN CONTROL

        // Fixes the Spawns for the slimes
        internal static void FixSpawns()
        {
            foreach (DirectedActorSpawner spawn in SRObjects.GetAllWorld <DirectedActorSpawner>())
            {
                AddMutations(spawn);
            }

            ClearMemory();
        }
        // TODO: Add phasing ability
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("pogo");

            mat.SetTexture(RAMP_GREEN, TextureUtils.CreateRamp("178f61", "00dee5"));
            mat.SetTexture(RAMP_BLUE, TextureUtils.CreateRamp("a6418c", "d453b4"));
            mat.SetTexture(RAMP_BLACK, TextureUtils.CreateRamp("3c115d", "d453b4"));

            return(mat);
        }
Ejemplo n.º 8
0
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("slimeTarr");

            mat.SetColor(TOP_COLOR, ColorUtils.FromHex("5e5451"));
            mat.SetColor(MIDDLE_COLOR, ColorUtils.FromHex("140a07"));
            mat.SetColor(BOTTOM_COLOR, ColorUtils.FromHex("000000"));

            return(mat);
        }
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("ginger");

            mat.SetTexture(RAMP_GREEN, TextureUtils.CreateRamp("5a3d75", "74598e"));
            mat.SetTexture(RAMP_BLUE, TextureUtils.CreateRamp("292929", "393939"));
            mat.SetTexture(RAMP_BLACK, TextureUtils.CreateRamp("8e8e8e", "e7e7e7"));

            return(mat);
        }
Ejemplo n.º 10
0
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("Chickadoo");

            mat.SetTexture(RAMP_GREEN, TextureUtils.CreateRamp("c30101", "ff0505"));
            mat.SetTexture(RAMP_BLUE, TextureUtils.CreateRamp("fd6c01", "ffcfac"));
            mat.SetTexture(RAMP_BLACK, TextureUtils.CreateRamp("fd6c01", "ffcfac"));

            return(mat);
        }
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("spicyTofu");

            mat.SetTexture(RAMP_RED, TextureUtils.CreateRamp("8f1717", "e52600"));
            mat.SetTexture(RAMP_GREEN, TextureUtils.CreateRamp("b01c1c", "eb6200"));
            mat.SetTexture(RAMP_BLUE, TextureUtils.CreateRamp("8f1717", "e52600"));
            mat.SetTexture(RAMP_BLACK, TextureUtils.CreateRamp("a15636", "b37a57"));

            return(mat);
        }
Ejemplo n.º 12
0
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("slimeTarr");

            mat.SetColor(TOP_COLOR, ColorUtils.FromHex("9afcff"));
            mat.SetColor(MIDDLE_COLOR, ColorUtils.FromHex("3194b2"));
            mat.SetColor(BOTTOM_COLOR, ColorUtils.FromHex("0e708f"));

            mat.SetTexture(COLOR_RAMP, TextureUtils.CreateRamp("ffffff", "86e9ff", "ffffff"));

            return(mat);
        }
Ejemplo n.º 13
0
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("pepperJam");

            mat.SetColor(COLOR20, ColorUtils.FromHex("f52f53") * 1.4f);
            mat.SetColor(COLOR21, ColorUtils.FromHex("f52f53") * 0.7f);

            mat.SetColor(COLOR30, ColorUtils.FromHex("f52f53") * 0.3f);
            mat.SetColor(COLOR31, ColorUtils.FromHex("f52f53") * 1.4f);

            return(mat);
        }
Ejemplo n.º 14
0
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("plortQuantumBase");

            // TODO: Fix coloring
            mat.SetColor(TOP_COLOR, ColorUtils.FromHex("0cb485"));
            mat.SetColor(MIDDLE_COLOR, ColorUtils.FromHex("912b66"));
            mat.SetColor(BOTTOM_COLOR, ColorUtils.FromHex("e64499"));

            mat.SetFloat(AVG_CYCLE_LENGTH, 5.97f);
            mat.SetFloat(CYCLE_GLITCH_RATIO, 0.75f);
            mat.SetFloat(CUTOFF, 0.25f);

            return(mat);
        }
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("Toy_BeechBall");

            mat.SetTexture(COLOR_MASK, Packs.Chapter1.Get <Texture2D>("maskSlimeToysCustom"));

            for (int i = 0; i < 8; i++)
            {
                mat.SetColor("_Color" + i + "0", ColorUtils.FromHex("ff8800"));
                mat.SetColor("_Color" + i + "1", ColorUtils.FromHex("cc4400"));
            }

            mat.SetColor(COLOR30, ColorUtils.FromHex("333333"));
            mat.SetColor(COLOR31, ColorUtils.FromHex("222222"));

            return(mat);
        }
Ejemplo n.º 16
0
        protected override Material CreateModelMat()
        {
            Material mat = SRObjects.GetInst <Material>("Depth Water Ball");

            mat.SetTexture(COLOR_RAMP, TextureUtils.CreateRamp("5b6f09", "68bb30"));
            mat.SetFloat(WAVE_FADE, 0);
            mat.SetFloat(WAVE_SPEED, 0);
            mat.SetFloat(WAVE_NOISE, 0);
            mat.SetFloat(WAVE_HEIGHT, 0);

            mat.SetFloat(REFRACTED_LIGHT_FADE, 0);
            mat.SetFloat(REFRACTION_AMOUNT, 0);

            mat.SetTexture(DIRT, null);
            mat.SetFloat(DIRT_FADE, 0);

            return(mat);
        }
Ejemplo n.º 17
0
        /// <summary>
        /// Dumps an Unity Object
        /// </summary>
        /// <typeparam name="T">Type of Object</typeparam>
        /// <param name="name">Name of the object to dump</param>
        public static void DumpObject <T>(string name) where T : Object
        {
            T obj = SRObjects.Get <T>(name);

            if (obj == null)
            {
                foreach (T newObj in Object.FindObjectsOfType <T>())
                {
                    if (newObj.name.Equals(name))
                    {
                        obj = newObj;
                        break;
                    }
                }
            }

            DumpObject(obj);
        }
Ejemplo n.º 18
0
        /// <summary>Builds this Item</summary>
        protected override void Build()
        {
            // Load Material
            ModelMat = SRObjects.GetInst <Material>("EchoBlue");
            ModelMat.SetColor(TINT_COLOR, ColorUtils.FromHex("22222222"));
            ModelMat.SetFloat(BRIGHTNESS, 0.1f);
            ModelMat.SetFloat(ANIMATION_SPEED, 0f);

            // Get GameObjects
            Prefab      = PrefabUtils.CopyPrefab(BaseItem);
            Prefab.name = NamePrefix + Name;
            Prefab.transform.localScale = Scale;

            GameObject child = Prefab.FindChild("model");

            child.transform.localScale = ModelScale;

            // Load Components
            Rigidbody    body = Prefab.GetComponent <Rigidbody>();
            Vacuumable   vac  = Prefab.GetComponent <Vacuumable>();
            Identifiable iden = Prefab.GetComponent <Identifiable>();

            MeshFilter   filter = child.GetComponent <MeshFilter>();
            MeshRenderer render = child.GetComponent <MeshRenderer>();

            // Setup Components
            body.mass = Mass;
            vac.size  = Size;
            iden.id   = ID;

            filter.sharedMesh     = Mesh;
            render.sharedMaterial = ModelMat;

            // Setup Proximity
            Prefab.AddComponent <EffyProximity>();

            // Add Particles
            GameObject part = Object.Instantiate(EffyParticles, Prefab.transform, true);

            part.name = "EffyPart";
            part.transform.localScale = Vector3.one;
        }
        protected override void Build()
        {
            // Pre Build Manipulation

            // Build Control
            base.Build();

            // Post Build Manipulation
            SpawnResource spawn = Prefab.GetComponent <SpawnResource>();

            GameObject fixedVeggie = GardenResourceFixes.GetFixedPrefab(Identifiable.Id.GINGER_VEGGIE, (obj) => obj.GetComponent <ResourceCycle>().unripeGameHours = 12);

            spawn.BonusObjectsToSpawn = new[] { fixedVeggie };

            // Fix Sprouts
            foreach (GameObject sprout in Prefab.FindChildren("Sprout"))
            {
                sprout.GetComponent <MeshFilter>().sharedMesh       = SRObjects.Get <Mesh>("sprout_parsnip");
                sprout.GetComponent <MeshRenderer>().sharedMaterial = SRObjects.Get <Material>("parsnip NoSway");
            }
        }
        // Sets up this registry
        internal static void Setup()
        {
            // Normal Gordos
            gordoIcons.Add(Identifiable.Id.BOOM_GORDO, SRObjects.Get <Sprite>("iconGordoBoom"));
            gordoIcons.Add(Identifiable.Id.CRYSTAL_GORDO, SRObjects.Get <Sprite>("iconGordoCrystal"));
            gordoIcons.Add(Identifiable.Id.DERVISH_GORDO, SRObjects.Get <Sprite>("iconGordoDervish"));
            gordoIcons.Add(Identifiable.Id.GOLD_GORDO, SRObjects.Get <Sprite>("iconGordoGold"));
            gordoIcons.Add(Identifiable.Id.HONEY_GORDO, SRObjects.Get <Sprite>("iconGordoHoney"));
            gordoIcons.Add(Identifiable.Id.HUNTER_GORDO, SRObjects.Get <Sprite>("iconGordoHunter"));
            gordoIcons.Add(Identifiable.Id.MOSAIC_GORDO, SRObjects.Get <Sprite>("iconGordoMosaic"));
            gordoIcons.Add(Identifiable.Id.PARTY_GORDO, SRObjects.Get <Sprite>("iconSlimePartyGordo"));
            gordoIcons.Add(Identifiable.Id.PHOSPHOR_GORDO, SRObjects.Get <Sprite>("iconGordoPhosphor"));
            gordoIcons.Add(Identifiable.Id.PINK_GORDO, SRObjects.Get <Sprite>("iconGordoPink"));
            gordoIcons.Add(Identifiable.Id.QUANTUM_GORDO, SRObjects.Get <Sprite>("iconGordoQuantum"));
            gordoIcons.Add(Identifiable.Id.RAD_GORDO, SRObjects.Get <Sprite>("iconGordoRad"));
            gordoIcons.Add(Identifiable.Id.ROCK_GORDO, SRObjects.Get <Sprite>("iconGordoRock"));
            gordoIcons.Add(Identifiable.Id.TABBY_GORDO, SRObjects.Get <Sprite>("iconGordoTabby"));
            gordoIcons.Add(Identifiable.Id.TANGLE_GORDO, SRObjects.Get <Sprite>("iconGordoTangle"));

            // Special Cases
            gordoIcons.Add(Identifiable.Id.PUDDLE_GORDO, SRObjects.Get <Sprite>("iconSlimePuddle"));
        }
        protected override void Build()
        {
            // Pre Build Manipulation

            // Build Control
            base.Build();

            // Post Build Manipulation
            Fashion fash  = Prefab.GetComponent <Fashion>();
            Fashion other = SRObjects.Get <GameObject>("fashionHandlebar").GetComponent <Fashion>();

            fash.attachPrefab = PrefabUtils.CopyPrefab(other.attachPrefab);
            Material mat = SRObjects.GetInst <Material>("FashionPod1");

            for (int i = 0; i < 8; i++)
            {
                mat.SetColor("_Color" + i + "0", ColorUtils.FromHex("eeeeee"));
                mat.SetColor("_Color" + i + "1", ColorUtils.FromHex("aaaaaa"));
            }

            fash.attachPrefab.FindChild("model_fp_handlebars").GetComponent <MeshRenderer>().sharedMaterial = mat;
        }
Ejemplo n.º 22
0
        /// <summary>
        /// Dumps an Unity Object
        /// </summary>
        /// <param name="name">Name of the object to dump</param>
        /// <param name="type">Type of Object (Needs to be a subclass of Object)</param>
        public static void DumpObject(string name, System.Type type)
        {
            if (!type?.IsSubclassOf(typeof(Object)) ?? false)
            {
                return;
            }

            Object obj = SRObjects.Get(name, type);

            if (obj == null)
            {
                foreach (Object newObj in Object.FindObjectsOfType <Object>())
                {
                    if (newObj.name.Equals(name))
                    {
                        obj = newObj;
                        break;
                    }
                }
            }

            DumpObject(name, obj);
        }
Ejemplo n.º 23
0
        // Method that runs when the game starts so it can fix things then
        internal static void FixAtGameLoad()
        {
            // Fixes to the scales
            if (QOL.FixScales)
            {
                // Gilded Ginger Fix
                ScaleFix(Identifiable.Id.GINGER_VEGGIE, Vector3.one * 1.2f, "model_parsnip");
                ObjectFix(Identifiable.Id.GINGER_VEGGIE, (obj) =>
                {
                    // TODO: Fix this later
                    float perc = 1.2f / 2.1f;

                    CapsuleCollider col = obj.GetComponent <CapsuleCollider>();
                    SphereCollider sCol = obj.GetComponent <SphereCollider>();

                    GameObject launch           = obj.FindChild("DelaunchTrigger");
                    launch.transform.localScale = launch.transform.localScale * perc;

                    col.radius *= perc;
                    col.height *= perc;

                    sCol.radius *= perc;
                });
            }

            if (QOL.ImpCollisions)
            {
                ObjectFix(SRObjects.Get <GameObject>("ranchPorch"), (obj) =>
                {
                    ModLogger.Log("Test");
                    foreach (MeshCollider col in obj.GetComponentsInChildren <MeshCollider>())
                    {
                        col.sharedMesh = col.gameObject.GetComponent <MeshFilter>().sharedMesh;
                    }
                });
            }
        }
 protected override Material CreateModelMat()
 {
     return(SRObjects.Get <Material>("objWoodKit01"));
 }
Ejemplo n.º 25
0
        // To setup the controller
        internal static void Setup()
        {
            MissingImage = SRObjects.MissingIcon?.texture;
            GadgetSite   = SRObjects.Get <Sprite>("iconPlaceGadget")?.texture;

            foreach (string name in Enum.GetNames(typeof(Identifiable.Id)))
            {
                Identifiable.Id ID = EnumUtils.Parse <Identifiable.Id>(name);
                if (toIgnoreIden.Contains(ID))
                {
                    continue;
                }

                GameObject obj = Identifiable.GORDO_CLASS.Contains(ID)
                                        ? ExceptionUtils.IgnoreErrors(() => GameContext.Instance.LookupDirector.GetGordo(ID))
                                        : ExceptionUtils.IgnoreErrors(() => GameContext.Instance.LookupDirector.GetPrefab(ID));

                if (obj == null)
                {
                    continue;
                }

                InstallIDMarker(ID, obj);
            }

            foreach (string name in Enum.GetNames(typeof(Gadget.Id)))
            {
                Gadget.Id ID = EnumUtils.Parse <Gadget.Id>(name);
                if (toIgnoreGadget.Contains(ID))
                {
                    continue;
                }

                GameObject obj = ExceptionUtils.IgnoreErrors(() => GameContext.Instance.LookupDirector.GetGadgetDefinition(ID).prefab);

                if (obj == null)
                {
                    continue;
                }

                InstallGadgetMarker(ID, obj);
            }

            foreach (Identifiable found in UnityEngine.Object.FindObjectsOfType <Identifiable>())
            {
                if (found.gameObject.scene.buildIndex == 3)
                {
                    InstallIDMarker(found.id, found.gameObject);
                }
            }

            foreach (GordoIdentifiable found in UnityEngine.Object.FindObjectsOfType <GordoIdentifiable>())
            {
                if (found.gameObject.scene.buildIndex == 3)
                {
                    InstallIDMarker(found.id, found.gameObject);
                }
            }

            foreach (Gadget found in UnityEngine.Object.FindObjectsOfType <Gadget>())
            {
                if (found.gameObject.scene.buildIndex == 3)
                {
                    InstallGadgetMarker(found.id, found.gameObject);
                }
            }

            foreach (GadgetSite found in UnityEngine.Object.FindObjectsOfType <GadgetSite>())
            {
                if (found.gameObject.scene.buildIndex == 3)
                {
                    found.gameObject.InstallMarker <GadgetSiteMarker>();
                }
            }

            OnMarkerSetup?.Invoke();
        }
        /// <summary>
        /// Spawns all areas in the reigstry list
        /// </summary>
        internal static void SpawnAreas()
        {
            // Register full areas
            foreach (Area area in Areas)
            {
                // Create object
                GameObject obj = UnityEngine.Object.Instantiate(area.area, area.position, Quaternion.identity);
                obj.name = area.area.name;

                // Setup Zone Director
                ZoneDirector director = obj.AddComponent <ZoneDirector>();
                area.directorSetup?.Invoke(director);

                // Setup Each Cell
                foreach (Transform child in obj.transform)
                {
                    if (area.cellSetup == null)
                    {
                        break;
                    }

                    if (!child.name.StartsWith("cell"))
                    {
                        continue;
                    }

                    CellDirector cell   = child.gameObject.AddComponent <CellDirector>();
                    Region       region = child.gameObject.AddComponent <Region>();
                    child.gameObject.AddComponent <RegionInitializer>();

                    area.cellSetup.Invoke(cell, region);
                }

                // Setup Each Marker
                foreach (AreaObjMarker marker in obj.GetComponentsInChildren <AreaObjMarker>())
                {
                    if (area.spawnAction == null)
                    {
                        break;
                    }

                    GameObject mo = SRObjects.GetInst <GameObject>(marker.objName);
                    mo.transform.parent        = marker.transform.parent;
                    mo.transform.localPosition = marker.transform.localPosition;

                    if (!marker.runSpawnAction)
                    {
                        continue;
                    }

                    area.spawnAction.Invoke(mo);
                }
            }

            // Register area cells
            foreach (AreaCell area in AreaCells)
            {
                // Create object
                GameObject obj = UnityEngine.Object.Instantiate(area.cell, area.position, Quaternion.identity, ZoneDirector.zones[area.zone].transform);
                obj.name = area.cell.name;

                // Setup Cell
                CellDirector cell   = obj.AddComponent <CellDirector>();
                Region       region = obj.AddComponent <Region>();
                obj.AddComponent <RegionInitializer>();

                area.cellSetup.Invoke(cell, region);

                // Setup Each Marker
                foreach (AreaObjMarker marker in obj.GetComponentsInChildren <AreaObjMarker>())
                {
                    if (area.spawnAction == null)
                    {
                        break;
                    }

                    GameObject mo = SRObjects.GetInst <GameObject>(marker.objName);
                    mo.transform.parent        = marker.transform.parent;
                    mo.transform.localPosition = marker.transform.localPosition;

                    if (!marker.runSpawnAction)
                    {
                        continue;
                    }

                    area.spawnAction.Invoke(mo);
                }
            }

            // Register area cell content
            foreach (AreaCellContent area in CellContent)
            {
                // Get parent cell
                Transform parentCell = ZoneDirector.zones[area.zone].transform.Find(area.cellName);
                if (parentCell == null)
                {
                    continue;
                }

                // Create object
                GameObject obj = UnityEngine.Object.Instantiate(area.content, area.position, Quaternion.identity, parentCell.transform);
                obj.name = area.content.name;

                // Setup Each Marker
                foreach (AreaObjMarker marker in obj.GetComponentsInChildren <AreaObjMarker>())
                {
                    if (area.spawnAction == null)
                    {
                        break;
                    }

                    GameObject mo = SRObjects.GetInst <GameObject>(marker.objName);
                    mo.transform.parent        = marker.transform.parent;
                    mo.transform.localPosition = marker.transform.localPosition;

                    if (!marker.runSpawnAction)
                    {
                        continue;
                    }

                    area.spawnAction.Invoke(mo);
                }
            }
        }