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 ProgressLoop()
    {
        for (int i = 0; i < 10000; i++)
        {
            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.ProgressWeek();

            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();
        }
        (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();
    }
    public void UpdatePartyActivity(PartyActivityRecord record)
    {
        int index = 0;

        for (int i = 0; i < record.Classes.Count; i++)
        {
            portraits[i].gameObject.SetActive(true);
            if (record.Alive[i])
            {
                portraits[i].sprite = DarkestDungeonManager.HeroSprites[record.Classes[i]]["A"].Portrait;
            }
            else
            {
                portraits[i].sprite = DarkestDungeonManager.Data.Sprites["deadhero_portrait"];
            }

            names[i].text = record.Names[i];
            index         = i;
        }
        for (int i = index + 1; i < names.Count; i++)
        {
            portraits[i].gameObject.SetActive(false);
        }

        description.text = record.Description;
        gameObject.SetActive(true);
    }
    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();
    }
    public PartyActivityRecord(PartyActivityRecord embarkRecord, bool[] aliveStatus, bool isSuccessfull)
    {
        PartyActionType = PartyActionType.Result;
        QuestType       = embarkRecord.QuestType;
        QuestDifficulty = embarkRecord.QuestDifficulty;
        QuestLength     = embarkRecord.QuestLength;
        Dungeon         = embarkRecord.Dungeon;
        IsSuccessfull   = isSuccessfull;

        Names   = embarkRecord.Names.ToList();
        Classes = embarkRecord.Classes.ToList();
        Alive   = new List <bool>(aliveStatus);
    }
Exemple #6
0
    public void Read(BinaryReader br)
    {
        WeekNumber = br.ReadInt32();

        bool hasReturn = br.ReadBoolean();
        bool hasEmbark = br.ReadBoolean();

        if (hasReturn)
        {
            ReturnRecord = new PartyActivityRecord();
            ReturnRecord.Read(br);
        }
        if (hasEmbark)
        {
            EmbarkRecord = new PartyActivityRecord();
            EmbarkRecord.Read(br);
        }
    }
    public void ProgressLoop()
    {
        for (int i = 0; i < 10000; i++)
        {
            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.ProgressWeek();

            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();
        }

        UpdateTownInfo();
    }
 public void UpdateReturnPartyLog(PartyActivityRecord partyRecord)
 {
     WeekLog.ReturnRecord = partyRecord;
     ReturnSlot.UpdatePartyActivity(partyRecord);
 }
 public void UpdateEmbarkPartyLog(PartyActivityRecord partyRecord)
 {
     WeekLog.EmbarkRecord = partyRecord;
     EmbarkSlot.UpdatePartyActivity(partyRecord);
 }