Example #1
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));
        }
        /// <summary>Registers the item into it's registry</summary>
        public override UpgradeItem Register()
        {
            base.Register();

            LookupRegistry.RegisterUpgradeEntry(ScriptableObjectsUtils.CreateUpgradeDefinition(Upgrade, Icon ?? SRObjects.MissingIcon, Cost));
            PersonalUpgradeRegistry.RegisterUpgradeCallback(Upgrade, ApplyUpgrade);

            if (StartUnlocked)
            {
                PersonalUpgradeRegistry.RegisterDefaultUpgrade(Upgrade);
            }
            else
            {
                PersonalUpgradeRegistry.RegisterUpgradeLock(Upgrade, CreateUpgradeLocker);
            }

            return(this);
        }