Ejemplo n.º 1
0
    public void QuickProgress()
    {
        if (characterWindowOpened)
        {
            CharacterWindow.WindowClosed();
        }
        if (activityLogOpened)
        {
            activityLogWindow.WindowClosed();
        }
        if (realmInventoryOpened)
        {
            realmInventoryWindow.WindowClosed();
        }
        if (townManager.BuildingWindowActive)
        {
            townManager.CloseBuildingWindow();
        }
        if (glossaryWindow.isActiveAndEnabled)
        {
            GlossaryClose();
        }
        if (townEventWindow.isActiveAndEnabled)
        {
            TownEventClose();
        }

        var partyRecord = new PartyActivityRecord(PartyActionType.Embark,
                                                  Types[Random.Range(0, Types.Count)], Difficulties[Random.Range(0, Difficulties.Count)],
                                                  Lengths[Random.Range(0, Lengths.Count)], Dungeons[Random.Range(0, Dungeons.Count)],
                                                  DarkestDungeonManager.Campaign.Heroes.Where(item => true).OrderBy(x => Random.value).Take(4).ToList());

        DarkestDungeonManager.Campaign.CurrentLog().EmbarkRecord = partyRecord;

        activityLogWindow.RecalculateHeight();
        DarkestDungeonManager.Campaign.ExecuteProgress();
        activityLogWindow.RecalculateHeight();
        DarkestDungeonManager.Campaign.AdvanceNextWeek();
        activityLogWindow.ProgressWeek();

        UpdateTownInfo();

        var returnRecord = new PartyActivityRecord(partyRecord, new[] { Random.value > 0.05f,
                                                                        Random.value > 0.05f, Random.value > 0.05f, Random.value > -1, }, Random.value > 0.3f);

        DarkestDungeonManager.Campaign.CurrentLog().ReturnRecord = returnRecord;
        activityLogWindow.RecalculateHeight();

        if (DarkestDungeonManager.Campaign.TriggeredEvent == null)
        {
            bottomPanel.TownEventButton.gameObject.SetActive(false);
        }
        else
        {
            bottomPanel.TownEventButton.gameObject.SetActive(true);
            townEventWindow.UpdateEvent(DarkestDungeonManager.Campaign.TriggeredEvent);
        }

        //ProgressLoop();
    }
    public void QuickProgress()
    {
        if (characterWindowOpened)
            characterWindow.WindowClosed();
        if (activityLogOpened)
            activityLogWindow.WindowClosed();
        if (realmInventoryOpened)
            realmInventoryWindow.WindowClosed();
        if (townManager.BuildingWindowActive)
            townManager.CloseBuildingWindow();
        if (glossaryWindow.isActiveAndEnabled)
            GlossaryClose();
        if (townEventWindow.isActiveAndEnabled)
            TownEventClose();

        var partyRecord = new PartyActivityRecord(PartyActionType.Embark,
            Types[Random.Range(0, Types.Count)], Difficulties[Random.Range(0, Difficulties.Count)],
            Lengths[Random.Range(0, Lengths.Count)], Dungeons[Random.Range(0, Dungeons.Count)],
            DarkestDungeonManager.Campaign.Heroes.Where(item => true).OrderBy(x => Random.value).Take(4).ToList());

        DarkestDungeonManager.Campaign.CurrentLog().EmbarkRecord = partyRecord;

        activityLogWindow.RecalculateHeight();
        DarkestDungeonManager.Campaign.ExecuteProgress();
        activityLogWindow.RecalculateHeight();
        DarkestDungeonManager.Campaign.AdvanceNextWeek();
        activityLogWindow.ProgressWeek();

        (townManager.buildingWindows[0] as AbbeyWindow).UpdateSlots();
        (townManager.buildingWindows[3] as SanitariumWindow).UpdateSlots();
        (townManager.buildingWindows[4] as TavernWindow).UpdateSlots();
        (townManager.buildingWindows[8] as NomadWagonWindow).wagonInventory.UpdateShop();
        (townManager.buildingWindows[9] as StageCoachWindow).recruitPanel.
            UpdateRecruitPanel(DarkestDungeonManager.Campaign.Estate.StageCoach.Heroes);

        rosterPanel.UpdateRoster();


        var returnRecord = new PartyActivityRecord(partyRecord,
            new bool[] { Random.value > 0.05f ? true : false,
                    Random.value > 0.05f ? true : false,
                    Random.value > 0.05f ? true : false,
                    Random.value > -1 ? true : false, },
                Random.value > 0.3f ? true : false);

        DarkestDungeonManager.Campaign.CurrentLog().ReturnRecord = returnRecord;
        activityLogWindow.RecalculateHeight();

        if (DarkestDungeonManager.Campaign.TriggeredEvent == null)
            bottomPanel.townEventButton.gameObject.SetActive(false);
        else
        {
            bottomPanel.townEventButton.gameObject.SetActive(true);
            townEventWindow.UpdateEvent(DarkestDungeonManager.Campaign.TriggeredEvent);
        }

        //ProgressLoop();
    }