예제 #1
0
    // Start is called before the first frame update
    void Start()
    {
        cookingManager = Camera.main.GetComponent <CookingManager>();

        // TODO: Remettre les "side_menu" càd les bouton details
        //side_menu = GetComponentInChildren<Button>(true);
        //side_menu.onClick.AddListener(delegate { cookingManager.DisplayTaste(spicy, sweet, salty); });
    }
예제 #2
0
    private void Awake()
    {
        if (instane != null)
        {
            Debug.LogWarning("Found more than one CookingManager!");
            return;
        }

        instane = this;
    }
예제 #3
0
    private void Awake()
    {
        currentViewIndex = 0;

        ui             = FindObjectOfType <UIInGameManager>();
        cookingManager = FindObjectOfType <CookingManager>();

        btnCookChange = GetComponent <Button>();
        btnCookChange.onClick.AddListener(OnButtonDown);
    }
예제 #4
0
    // Start is called before the first frame update
    void Start()
    {
        ingredientInfo = GetComponent <Ingredient>();
        gameManager    = GameManager.GetInstance();
        cookingManager = gameManager.cookingManager;
        soundManager   = gameManager.soundManager;

        switchCooldownTimer = 0;
        onCooldown          = false;
    }
예제 #5
0
    // Start is called before the first frame update
    void Start()
    {
        cookingManager = Camera.main.GetComponent <CookingManager>();
        side_menu      = GetComponentInChildren <Canvas>(true);

        side_menu.transform.Find("Taste").gameObject.GetComponent <Button>().onClick.AddListener(delegate { cookingManager.DisplayTaste(); });
        side_menu.transform.Find("Reset").gameObject.GetComponent <Button>().onClick.AddListener(delegate { cookingManager.Reset(); });
        side_menu.transform.Find("Serve").gameObject.GetComponent <Button>().onClick.AddListener(delegate { cookingManager.Serve(); });

        //side_menu.GetComponentInChildren<Button>(true).onClick.AddListener(delegate { cookingManager.DisplayTaste(spicy, sweet, salty); });
    }
예제 #6
0
    private void Awake()
    {
        zoneGame = cookingGame.GetComponent <ZoneGame>();
        cookingGame.SetActive(false);
        ingredientMenu.SetActive(false);

        if (CM == null)
        {
            CM = this;
        }
        else
        {
            Destroy(this.gameObject);
        }
    }
예제 #7
0
    protected override void Awake()
    {
        base.Awake();

        cookingManager = FindObjectOfType <CookingManager>();
        loadQuest      = FindObjectOfType <LoadQuest>();
        ui             = FindObjectOfType <UIInGameManager>();
        npcBehaviour   = FindObjectOfType <NPCBehaviour>();

        cookingManager.SetGameManger(this);
        loadQuest.talkEnd += StartCook;
        loadQuest.nextNpc += NextNPC;

        life = maxLife;
    }
예제 #8
0
    // Start is called before the first frame update
    void Start()
    {
        // Singleton hehe. //
        gameManager    = GameManager.GetInstance();
        cookingManager = gameManager.cookingManager;
        orderManager   = gameManager.orderManager;
        soundManager   = gameManager.soundManager;

        // Setting my timers to 0 safely //
        orderSubmittedTextTimer = 0;


        orderCreatedText.gameObject.SetActive(false);

        TextMeshProUGUI colourDropdownLabel  = colourDropdown.transform.Find("Label").GetComponent <TextMeshProUGUI>();
        TextMeshProUGUI meatVegDropdownLabel = meatVegDropdown.transform.Find("Label").GetComponent <TextMeshProUGUI>();

        // Initialising static texts to their adjustable counter parts. //
        submittedOrderText = adjustableSubmittedOrderText;

        colourDropdown.options.Clear();
        colourDropdownLabel.text = "None";

        meatVegDropdown.options.Clear();
        meatVegDropdownLabel.text = "None";


        PopulateColourDropdownOptions(colourDropdown);
        PopulateMeatVegDropdownOptions(meatVegDropdown);

        playersMouseLook = playerCamera.GetComponent <MouseLook>();


        // ---------------------- Initialising Appliance References ---------------------- //
        theCatcher = gameManager.cookingManager.theCatcher;
        // ------------------------------------------------------------------------------- //
    }
예제 #9
0
 // Start is called before the first frame update
 void Start()
 {
     gameManager       = GameManager.GetInstance();
     theCookingManager = gameManager.cookingManager;
 }
예제 #10
0
        public void Start()
        {
            try
            {
                _dir = Path.Combine(Environment.ExpandEnvironmentVariables("%userprofile%/Desktop"), "NGUInjector");
                if (!Directory.Exists(_dir))
                {
                    Directory.CreateDirectory(_dir);
                }

                var logDir = Path.Combine(_dir, "logs");
                if (!Directory.Exists(logDir))
                {
                    Directory.CreateDirectory(logDir);
                }

                OutputWriter = new StreamWriter(Path.Combine(logDir, "inject.log"))
                {
                    AutoFlush = true
                };
                LootWriter = new StreamWriter(Path.Combine(logDir, "loot.log"))
                {
                    AutoFlush = true
                };
                CombatWriter = new StreamWriter(Path.Combine(logDir, "combat.log"))
                {
                    AutoFlush = true
                };
                AllocationWriter = new StreamWriter(Path.Combine(logDir, "allocation.log"))
                {
                    AutoFlush = true
                };
                PitSpinWriter = new StreamWriter(Path.Combine(logDir, "pitspin.log"), true)
                {
                    AutoFlush = true
                };
                CardsWriter = new StreamWriter(Path.Combine(logDir, "cards.log"))
                {
                    AutoFlush = true
                };

                _profilesDir = Path.Combine(_dir, "profiles");
                if (!Directory.Exists(_profilesDir))
                {
                    Directory.CreateDirectory(_profilesDir);
                }


                var oldPath = Path.Combine(_dir, "allocation.json");
                var newPath = Path.Combine(_profilesDir, "default.json");

                if (File.Exists(oldPath) && !File.Exists(newPath))
                {
                    File.Move(oldPath, newPath);
                }
            }
            catch (Exception e)
            {
                Log(e.Message);
                Log(e.StackTrace);
                Loader.Unload();
                return;
            }

            try
            {
                Character = FindObjectOfType <Character>();

                Log("Injected");
                LogLoot("Starting Loot Writer");
                LogCombat("Starting Combat Writer");
                LogCard("Starting Card Writer");
                Controller          = Character.inventoryController;
                PlayerController    = FindObjectOfType <PlayerController>();
                ArbitraryController = FindObjectOfType <ArbitraryController>();
                _invManager         = new InventoryManager();
                _yggManager         = new YggdrasilManager();
                _questManager       = new QuestManager();
                _combManager        = new CombatManager();
                _cardManager        = new CardManager();
                _cookingManager     = new CookingManager();
                _consumablesManager = new ConsumablesManager();
                LoadoutManager.ReleaseLock();
                DiggerManager.ReleaseLock();

                Settings = new SavedSettings(_dir);

                if (!Settings.LoadSettings())
                {
                    var temp = new SavedSettings(null)
                    {
                        PriorityBoosts        = new int[] { },
                        YggdrasilLoadout      = new int[] { },
                        SwapYggdrasilLoadouts = false,
                        SwapTitanLoadouts     = false,
                        TitanLoadout          = new int[] { },
                        ManageDiggers         = true,
                        ManageYggdrasil       = false,
                        ManageEnergy          = true,
                        ManageMagic           = true,
                        ManageInventory       = true,
                        ManageGear            = true,
                        AutoConvertBoosts     = true,
                        SnipeZone             = 0,
                        FastCombat            = false,
                        PrecastBuffs          = true,
                        AutoFight             = false,
                        AutoQuest             = false,
                        AutoQuestITOPOD       = false,
                        AllowMajorQuests      = false,
                        GoldDropLoadout       = new int[] { },
                        AutoMoneyPit          = false,
                        AutoSpin                 = false,
                        MoneyPitLoadout          = new int[] { },
                        AutoRebirth              = false,
                        ManageWandoos            = false,
                        MoneyPitThreshold        = 1e5,
                        DoGoldSwap               = false,
                        BoostBlacklist           = new int[] { },
                        CombatMode               = 0,
                        RecoverHealth            = false,
                        SnipeBossOnly            = true,
                        AllowZoneFallback        = false,
                        QuestFastCombat          = true,
                        AbandonMinors            = false,
                        MinorAbandonThreshold    = 30,
                        QuestCombatMode          = 0,
                        AutoBuyEM                = false,
                        AutoSpellSwap            = false,
                        CounterfeitThreshold     = 400,
                        SpaghettiThreshold       = 30,
                        BloodNumberThreshold     = 1e10,
                        CastBloodSpells          = false,
                        IronPillThreshold        = 10000,
                        BloodMacGuffinAThreshold = 6,
                        BloodMacGuffinBThreshold = 6,
                        CubePriority             = 0,
                        CombatEnabled            = false,
                        GlobalEnabled            = false,
                        QuickDiggers             = new int[] { },
                        QuickLoadout             = new int[] { },
                        UseButterMajor           = false,
                        ManualMinors             = false,
                        UseButterMinor           = false,
                        ActivateFruits           = false,
                        ManageR3                 = true,
                        WishPriorities           = new int[] { },
                        BeastMode                = true,
                        ManageNGUDiff            = true,
                        AllocationFile           = "default",
                        TitanGoldTargets         = new bool[ZoneHelpers.TitanZones.Length],
                        ManageGoldLoadouts       = false,
                        ResnipeTime              = 3600,
                        TitanMoneyDone           = new bool[ZoneHelpers.TitanZones.Length],
                        TitanSwapTargets         = new bool[ZoneHelpers.TitanZones.Length],
                        GoldCBlockMode           = false,
                        DebugAllocation          = false,
                        AdventureTargetITOPOD    = false,
                        ITOPODRecoverHP          = false,
                        ITOPODCombatMode         = 0,
                        ITOPODBeastMode          = true,
                        ITOPODFastCombat         = true,
                        ITOPODPrecastBuffs       = false,
                        DisableOverlay           = false,
                        OptimizeITOPODFloor      = false,
                        YggSwapThreshold         = 1,
                        UpgradeDiggers           = true,
                        BlacklistedBosses        = new int[0],
                        SpecialBoostBlacklist    = new int[0],
                        MoreBlockParry           = false,
                        WishSortOrder            = false,
                        WishSortPriorities       = false,
                        ManageMayo               = false,
                        TrashCards               = false,
                        TrashAdventureCards      = false,
                        AutoCastCards            = false,
                        CardsTrashQuality        = 0,
                        TrashCardCost            = 0,
                        DontCastCardType         = new string[0],
                        TrashChunkers            = false,
                        HackAdvance              = false
                    };

                    Settings.MassUpdate(temp);

                    Log($"Created default settings");
                }

                settingsForm = new SettingsForm();

                if (string.IsNullOrEmpty(Settings.AllocationFile))
                {
                    Settings.SetSaveDisabled(true);
                    Settings.AllocationFile = "default";
                    Settings.SetSaveDisabled(false);
                }

                if (Settings.TitanGoldTargets == null || Settings.TitanGoldTargets.Length == 0)
                {
                    Settings.SetSaveDisabled(true);
                    Settings.TitanGoldTargets = new bool[ZoneHelpers.TitanZones.Length];
                    Settings.SetSaveDisabled(false);
                }

                if (Settings.TitanMoneyDone == null || Settings.TitanMoneyDone.Length == 0)
                {
                    Settings.SetSaveDisabled(true);
                    Settings.TitanMoneyDone = new bool[ZoneHelpers.TitanZones.Length];
                    Settings.SetSaveDisabled(false);
                }

                if (Settings.TitanSwapTargets == null || Settings.TitanSwapTargets.Length == 0)
                {
                    Settings.SetSaveDisabled(true);
                    Settings.TitanSwapTargets = new bool[ZoneHelpers.TitanZones.Length];
                    Settings.SetSaveDisabled(false);
                }

                if (Settings.SpecialBoostBlacklist == null)
                {
                    Settings.SetSaveDisabled(true);
                    Settings.SpecialBoostBlacklist = new int[0];
                    Settings.SetSaveDisabled(false);
                }

                if (Settings.BlacklistedBosses == null)
                {
                    Settings.SetSaveDisabled(true);
                    Settings.BlacklistedBosses = new int[0];
                    Settings.SetSaveDisabled(false);
                }

                WishManager = new WishManager();

                LoadAllocation();
                LoadAllocationProfiles();

                ZoneWatcher = new FileSystemWatcher
                {
                    Path                = _dir,
                    Filter              = "zoneOverride.json",
                    NotifyFilter        = NotifyFilters.LastWrite,
                    EnableRaisingEvents = true
                };

                ZoneWatcher.Changed += (sender, args) =>
                {
                    Log(_dir);
                    ZoneStatHelper.CreateOverrides(_dir);
                };

                ConfigWatcher = new FileSystemWatcher
                {
                    Path                = _dir,
                    Filter              = "settings.json",
                    NotifyFilter        = NotifyFilters.LastWrite,
                    EnableRaisingEvents = true
                };

                ConfigWatcher.Changed += (sender, args) =>
                {
                    if (IgnoreNextChange)
                    {
                        IgnoreNextChange = false;
                        return;
                    }
                    Settings.LoadSettings();
                    settingsForm.UpdateFromSettings(Settings);
                    LoadAllocation();
                };

                AllocationWatcher = new FileSystemWatcher
                {
                    Path                = _profilesDir,
                    Filter              = "*.json",
                    NotifyFilter        = NotifyFilters.LastWrite | NotifyFilters.FileName,
                    EnableRaisingEvents = true
                };

                AllocationWatcher.Changed += (sender, args) => { LoadAllocation(); };
                AllocationWatcher.Created += (sender, args) => { LoadAllocationProfiles(); };
                AllocationWatcher.Deleted += (sender, args) => { LoadAllocationProfiles(); };
                AllocationWatcher.Renamed += (sender, args) => { LoadAllocationProfiles(); };

                Settings.SaveSettings();
                Settings.LoadSettings();

                LogAllocation("Started Allocation Writer");

                ZoneStatHelper.CreateOverrides(_dir);

                settingsForm.UpdateFromSettings(Settings);
                settingsForm.Show();

                InvokeRepeating("AutomationRoutine", 0.0f, 10.0f);
                InvokeRepeating("SnipeZone", 0.0f, .1f);
                InvokeRepeating("MonitorLog", 0.0f, 1f);
                InvokeRepeating("QuickStuff", 0.0f, .5f);
                InvokeRepeating("ShowBoostProgress", 0.0f, 60.0f);
                InvokeRepeating("SetResnipe", 0f, 1f);


                reference = this;
            }
            catch (Exception e)
            {
                Log(e.ToString());
                Log(e.StackTrace);
                Log(e.InnerException.ToString());
            }
        }
예제 #11
0
 private void Awake()
 {
     cookingManager = FindObjectOfType <CookingManager>();
 }
예제 #12
0
    public void ActivateSwitch()
    {
        if (onCooldown == false)
        {
            switch (type)
            {
            case SwitchType.CUTTER_SWITCH_1:
                onCooldown = true;
                gameManager.cookingManager.theSlicer.CutterSwitch1();
                SoundManager.StopPlayingSound(gameManager.cookingManager.theSlicer.cutterGauge1Transform.GetComponent <AudioSource>());
                SoundManager.PlaySound(gameManager.cookingManager.theSlicer.cutterGauge1Transform.GetComponent <AudioSource>());
                break;

            case SwitchType.CUTTER_SWITCH_2:
                onCooldown = true;
                gameManager.cookingManager.theSlicer.CutterSwitch2();
                SoundManager.StopPlayingSound(gameManager.cookingManager.theSlicer.cutterGauge2Transform.GetComponent <AudioSource>());
                SoundManager.PlaySound(gameManager.cookingManager.theSlicer.cutterGauge2Transform.GetComponent <AudioSource>());
                break;

            case SwitchType.WATER_TAP:
                onCooldown = true;
                CookingManager.WaterTapSwitch();
                SoundManager.PlaySound(gameManager.cookingManager.waterTap.GetComponent <AudioSource>());
                break;

            case SwitchType.ORDER_ACCEPT:
                onCooldown = true;

                SoundManager.PlaySound(soundManager.newOrderMonitorSource);

                gameManager.orderManager.AcceptOrder(gameManager.orderManager.requestedOrders[0]);
                break;

            case SwitchType.ORDER_REJECT:
                onCooldown = true;

                SoundManager.PlaySound(soundManager.newOrderMonitorSource);

                gameManager.orderManager.RejectOrder();
                break;

            case SwitchType.CANON_BUTTON:
                onCooldown = true;
                cookingManager.theCanon.ShootCapsule();
                break;

            case SwitchType.CANON_INCINERATE_BUTTON:
                onCooldown = true;
                cookingManager.theCanon.IncinerateCapsule();
                break;

            case SwitchType.BLENDER_BUTTON:
                onCooldown = true;
                gameManager.cookingManager.theBlender.BlenderButton();
                SoundManager.PlaySound(soundManager.blenderButtonSource);
                break;

            case SwitchType.ITEM_SPAWNER:
                onCooldown = true;

                SoundManager.StopPlayingSound(soundManager.itemFabMonitorSource);
                SoundManager.PlaySound(soundManager.itemFabMonitorSource);

                cookingManager.IngredientSpawnTimer();
                break;

            case SwitchType.MONITOR_FORWARD:
                onCooldown = true;
                {
                    MonitorScreen monitor = FindMonitorFromSwitch(gameManager.playerController.selectedSwitch);

                    // I know this is really bad but don't judge me. If the switch had an ingredient component, I'm going to assume that its the item fabricator monitor. Giving a reference to the ingredient
                    // will help in displaying the ingredients stats and stuff. //
                    if (gameManager.playerController.selectedSwitch.GetComponent <Ingredient>())
                    {
                        soundManager.PlayMonitorSound(monitor.thisMonitor);
                        monitor.currentIngredientDisplay = gameManager.playerController.selectedSwitch.GetComponent <Ingredient>();
                        monitor.SetScreenState(ScreenState.SECONDARY);
                    }
                    else
                    {
                        soundManager.PlayMonitorSound(monitor.thisMonitor);
                        monitor.SetScreenState(ScreenState.SECONDARY);
                    }
                    break;
                }

            case SwitchType.MONITOR_BACK:
                onCooldown = true;
                {
                    MonitorScreen monitor = FindMonitorFromSwitch(gameManager.playerController.selectedSwitch);

                    soundManager.PlayMonitorSound(monitor.thisMonitor);

                    monitor.SetScreenState(ScreenState.MAIN_MENU);
                    break;
                }

            case SwitchType.NEXT_ORDER:
                onCooldown = true;

                SoundManager.PlaySound(soundManager.currentOrderMonitorSource);

                gameManager.orderManager.SwapSelectedOrder();
                break;

            case SwitchType.COOKING_ORB_HATCH:
                onCooldown = true;
                if (gameManager.cookingManager.theOrb.currentCookingOrbState == CookingOrbState.INGREDIENTS_AND_WATER)
                {
                    gameManager.cookingManager.theOrb.BeginCooking();
                }
                break;

            case SwitchType.CAPSULE_VENDOR:
                onCooldown = true;
                SoundManager.StopPlayingSound(soundManager.capsuleVendorSource);
                SoundManager.PlaySound(soundManager.capsuleVendorSource);
                cookingManager.theVendor.vendorAnimator.SetBool("IsSpawned", true);
                gameManager.cookingManager.theVendor.SpawnCapsule();
                break;

            case SwitchType.MAIN_MENU_PLAY:
                onCooldown = true;
                SoundManager.StopPlayingSound(soundManager.mainMenuSpecialSource);
                SoundManager.PlaySound(soundManager.mainMenuSpecialSource);
                gameManager.StartGame();

                gameManager.playerController.selectedSwitch = null;
                break;

            case SwitchType.MAIN_MENU_QUIT:
                onCooldown = true;
                SoundManager.StopPlayingSound(soundManager.mainMenuSource);
                SoundManager.PlaySound(soundManager.mainMenuSource);
                Application.Quit();
                Debug.Log("Quitting game...");
                gameManager.playerController.selectedSwitch = null;
                break;

            case SwitchType.MAIN_MENU_OPTIONS:
                onCooldown = true;
                SoundManager.StopPlayingSound(soundManager.mainMenuSource);
                SoundManager.PlaySound(soundManager.mainMenuSource);
                gameManager.menuManager.ActivateMenu(MenuState.optionMenu);
                gameManager.playerController.selectedSwitch = null;
                break;
            }
        }
        else
        {
            Debug.Log("You can't spam this button that fast!");
        }
    }