Ejemplo n.º 1
0
        public void PreLoad()
        {
            HarmonyPatcher.GetInstance().PatchAll(Assembly.GetExecutingAssembly());

            SRML.Console.Console.RegisterCommand(new SetColorsCommand());
            TranslationPatcher.AddTranslationKey("pedia", RAVEBALL_KEY, "Rave Ball");
            TranslationPatcher.AddTranslationKey("pedia", RAVEBALL_UI_KEY, "Rave Ball");
            TranslationPatcher.AddTranslationKey("pedia", RAVEBALL_DESC_KEY,
                                                 "This ball may look plain, but it makes slimes want to party!");
            //IdentifiableRegistry.CreateIdentifiableId(RAVE_BALL_ID, "RAVE_BALL_TOY");
            var bundle = AssetBundle.LoadFromStream(Assembly.GetExecutingAssembly()
                                                    .GetManifestResourceStream(typeof(Main), "colorfulslimes"));
            var g = bundle.LoadAsset <GameObject>("raveball");

            g.AddComponent <RegionMember>();
            g.AddComponent <Identifiable>().id = CustomIds.RAVE_BALL_TOY;
            g.layer = LayerMask.NameToLayer("Actor");
            g.AddComponent <Vacuumable>().size = Vacuumable.Size.LARGE;
            g.AddComponent <Raveball>();
            g.transform.GetChild(0).gameObject.AddComponent <VacDelaunchTrigger>();

            LookupRegistry.RegisterIdentifiablePrefab(g);

            SaveRegistry.RegisterDataParticipant <SlimePainter>();
        }
Ejemplo n.º 2
0
        public override void PreLoad()
        {
            SlimeTraitRegistry.Register(new DietTraitProcessor(SRModInfo.GetCurrentInfo().Id, "diet"));
            SlimeTraitRegistry.Register(new TemperamentTraitProcessor(SRModInfo.GetCurrentInfo().Id, "temperament"));

            SRCallbacks.OnActorSpawn     += SRCallbacks_OnActorSpawn;
            SRCallbacks.OnSaveGameLoaded += (s) => s.Player.AddComponent <GenomeViewer>();
            SaveRegistry.RegisterDataParticipant <GenomeHolder>();
            SaveRegistry.RegisterDataParticipant <SlimeGeneticsHandler>();

            BindingRegistry.RegisterActions(typeof(ModActions));
            TranslationPatcher.AddUITranslation("key.probegenetics", "Probe Genetic Data");

            GeneticUI.SetupGeneticUI();
        }
Ejemplo n.º 3
0
        public override void PreLoad()
        {
            HarmonyInstance.PatchAll();
            SRML.Console.Console.RegisterCommand(new ChangeVacVisualCommand());
            SaveRegistry.RegisterDataParticipant <PlortUndisappearifier>();

            LookupRegistry.RegisterUpgradeEntry(Ids.MOCHI_HACK, Main.assetBundle.LoadAsset <Sprite>("upgrade_initial"), 10000);

            Ids.MOCHI_HACK.GetTranslation().SetDescriptionTranslation("Hack the gate at Mochi's Manor to make it ineffective and go in/out with your normal inventory. But you have to be careful, Mochi may or may not see when her precious quicksilver slimes disappear, and if that happens, she will attack your base, trying to take them back!").SetNameTranslation("Gate Hack");
            PersonalUpgradeRegistry.RegisterUpgradeLock(Ids.MOCHI_HACK, (PlayerState x) => x.CreateBasicLock(null, delegate
            {
                ProgressModel model = SRSingleton <SceneContext> .Instance.ProgressDirector.model;
                return(model != null && model.HasProgress(ProgressDirector.ProgressType.ENTER_ZONE_MOCHI_RANCH));
            }, 0f));
        }