Beispiel #1
0
    public void LoadParty(RaidParty heroParty)
    {
        party.CreateFormation(heroParty);
        ranks.DistributeParty(party);
        overlay.LockOnUnits(party);
        overlay.UpdateOverlay();

        foreach (var unit in party.Units)
        {
            unit.OverlaySlot.onHeroSelected += UpdateHero;
            unit.Formation = this;
        }

        party.Units.Sort((x, y) => { if (x.Rank == y.Rank)
                                     {
                                         return(0);
                                     }
                                     if (x.Rank > y.Rank)
                                     {
                                         return(1);
                                     }
                                     else
                                     {
                                         return(-1);
                                     } });

        party.Units[0].OverlaySlot.UnitSelected();
    }
Beispiel #2
0
    public void LoadParty(RaidParty heroParty, PhotonPlayer player)
    {
        Party.CreateFormation(heroParty, player);
        Ranks.DistributeParty(Party);
        Overlay.LockOnUnits(Party);
        Overlay.UpdateOverlay();

        foreach (var unit in Party.Units)
        {
            unit.OverlaySlot.HeroSelected += UpdateHero;
            unit.Formation = this;
        }

        Party.Units.Sort((x, y) => { if (x.Rank == y.Rank)
                                     {
                                         return(0);
                                     }
                                     if (x.Rank > y.Rank)
                                     {
                                         return(1);
                                     }
                                     else
                                     {
                                         return(-1);
                                     } });
    }
    public void LoadInitialSetup(Quest quest, RaidParty party)
    {
        DiscardAll();

        for (int i = 0; i < DarkestDungeonManager.Data.Provision.StartingLengthInventories[quest.Length].Count; i++)
        {
            DistributeItem(DarkestDungeonManager.Data.Provision.StartingLengthInventories[quest.Length][i]);
        }

        for (int i = 0; i < party.HeroInfo.Count; i++)
        {
            if (DarkestDungeonManager.Data.Provision.HeroClassItemList.ContainsKey(party.HeroInfo[i].Hero.Class))
            {
                for (int j = 0; j < DarkestDungeonManager.Data.Provision.HeroClassItemList[party.HeroInfo[i].Hero.Class].Count; j++)
                {
                    DistributeItem(DarkestDungeonManager.Data.Provision.HeroClassItemList[party.HeroInfo[i].Hero.Class][j]);
                }
            }
        }

        for (int i = 0; i < quest.Goal.StartingItems.Count; i++)
        {
            DistributeItem(quest.Goal.StartingItems[i]);
        }
    }
Beispiel #4
0
    public void QuickStart(PartyInventory inventory)
    {
        Quest = DarkestDungeonManager.Campaign.Quests.Find(quest => quest.Difficulty == 1) ?? DarkestDungeonManager.Campaign.Quests[0];

        RaidParty = new RaidParty(DarkestDungeonManager.Campaign.Heroes.GetRange(0, 4));
        inventory.LoadInitialSetup(Quest, RaidParty);
        InventorySlotData = inventory.SaveInventorySlotData();
    }
Beispiel #5
0
    public RaidInfo(SaveCampaignData saveData)
    {
        QuestCompleted = saveData.QuestCompleted;
        Quest          = saveData.Quest;
        Dungeon        = saveData.Dungeon;
        RaidParty      = new RaidParty(saveData.RaidParty);

        ExploredRoomCount = saveData.ExploredRoomCount;
        if (Dungeon.Rooms.ContainsKey(saveData.CurrentLocation))
        {
            CurrentLocation = Dungeon.Rooms[saveData.CurrentLocation];
        }
        else
        {
            foreach (var hallway in Dungeon.Hallways)
            {
                CurrentLocation = hallway.Value.Halls.Find(hallSector => hallSector.Id == saveData.CurrentLocation);
                if (CurrentLocation != null)
                {
                    break;
                }
            }
        }
        if (saveData.LastRoom != "")
        {
            LastRoom = Dungeon.Rooms[saveData.LastRoom];
        }
        if (saveData.PreviousLastSector != "")
        {
            foreach (var hallway in Dungeon.Hallways)
            {
                PreviousLastSector = hallway.Value.Halls.Find(hallSector => hallSector.Id == saveData.PreviousLastSector);
                if (PreviousLastSector != null)
                {
                    break;
                }
            }
        }
        if (saveData.LastSector != "")
        {
            foreach (var hallway in Dungeon.Hallways)
            {
                LastSector = hallway.Value.Halls.Find(hallSector => hallSector.Id == saveData.LastSector);
                if (LastSector != null)
                {
                    break;
                }
            }
        }

        KilledMonsters     = new List <string>(saveData.KilledMonsters);
        InvestigatedCurios = new List <string>(saveData.InvestigatedCurios);
    }
Beispiel #6
0
    public void UpdateFromRaid()
    {
        UpdateFromEstate();

        InRaid = true;

        QuestCompleted = RaidSceneManager.Raid.QuestCompleted;
        Quest          = RaidSceneManager.Raid.Quest;
        Dungeon        = RaidSceneManager.Raid.Dungeon;
        if (RaidParty == null)
        {
            RaidParty = new RaidPartySaveData();
        }
        RaidParty.UpdateFromRaidParty(RaidSceneManager.Raid.RaidParty);
        CampingPhase       = RaidSceneManager.Raid.CampingPhase;
        CampingTimeLeft    = RaidSceneManager.Raid.CampingTimeLeft;
        NightAmbushReduced = RaidSceneManager.Raid.NightAmbushReduced;
        HungerCooldown     = RaidSceneManager.Raid.HungerCooldown;
        AncestorTalk       = RaidSceneManager.Raid.AncestorTalk;

        CurrentLocation = RaidSceneManager.Raid.CurrentLocation == null ?
                          RaidSceneManager.Raid.Dungeon.StartingRoom.Id :
                          RaidSceneManager.Raid.CurrentLocation.Id;

        ExploredRoomCount  = RaidSceneManager.Raid.ExploredRoomCount;
        LastRoom           = RaidSceneManager.Raid.LastRoom == null ? "" : RaidSceneManager.Raid.LastRoom.Id;
        LastSector         = RaidSceneManager.Raid.LastSector == null ? "" : RaidSceneManager.Raid.LastSector.Id;
        PreviousLastSector = RaidSceneManager.Raid.PreviousLastSector == null ? LastSector : RaidSceneManager.Raid.PreviousLastSector.Id;


        KilledMonsters     = RaidSceneManager.Raid.KilledMonsters;
        InvestigatedCurios = RaidSceneManager.Raid.InvestigatedCurios;

        TorchAmount    = RaidSceneManager.TorchMeter.TorchAmount;
        MaxTorchAmount = RaidSceneManager.TorchMeter.MaxAmount;

        ModifiedMinTorch = RaidSceneManager.TorchMeter.Modifier == null ? -1 : RaidSceneManager.TorchMeter.Modifier.Min;
        ModifiedMaxTorch = RaidSceneManager.TorchMeter.Modifier == null ? -1 : RaidSceneManager.TorchMeter.Modifier.Max;

        HeroFormationData.UpdateFormation(RaidSceneManager.Formations.Heroes);
        InventoryItems = RaidSceneManager.Inventory.SaveInventorySlotData();

        if (RaidSceneManager.BattleGround.BattleStatus == BattleStatus.Fighting)
        {
            InBattle = true;
            BattleGroundSaveData.UpdateFromBattleGround(RaidSceneManager.BattleGround);
        }
        else
        {
            InBattle = false;
        }
    }
    public void CheckEmbarkBuffs(RaidParty raidParty)
    {
        if (TriggeredEvent == null && GuaranteedEvent == null)
            return;

        foreach(var eventEntry in EventModifiers.EventData)
            if (eventEntry.Type == TownEventDataType.EmbarkPartyBuff)
                for (int j = 0; j < raidParty.HeroInfo.Count; j++)
                {
                    var embarkBuff = new BuffInfo(DarkestDungeonManager.Data.Buffs[eventEntry.StringData],BuffSourceType.Estate);
                    raidParty.HeroInfo[j].Hero.AddBuff(embarkBuff);
                }
    }
 public void UpdateFromRaidParty(RaidParty raidParty)
 {
     IsMovingLeft = raidParty.IsMovingLeft;
     HeroInfo.Clear();
     for (int i = 0; i < raidParty.HeroInfo.Count; i++)
     {
         var newHeroInfo = new RaidPartyHeroInfoSaveData();
         newHeroInfo.IsAlive      = raidParty.HeroInfo[i].IsAlive;
         newHeroInfo.HeroRosterId = raidParty.HeroInfo[i].Hero.RosterId;
         newHeroInfo.Factor       = raidParty.HeroInfo[i].DeathRecord == null ? DeathFactor.Unknown:
                                    raidParty.HeroInfo[i].DeathRecord.Factor;
         newHeroInfo.Killer = raidParty.HeroInfo[i].DeathRecord == null || raidParty.HeroInfo[i].DeathRecord.KillerName == null ?
                              "" : raidParty.HeroInfo[i].DeathRecord.KillerName;
         HeroInfo.Add(newHeroInfo);
     }
 }
    public void CreateFormation(RaidParty party, PhotonPlayer player)
    {
        Units = new List <FormationUnit>();

        for (int i = 0; i < party.HeroInfo.Count; i++)
        {
            if (party.HeroInfo[i].IsAlive)
            {
                FormationUnit unit = Instantiate((Resources.Load("Prefabs/Heroes/"
                                                                 + party.HeroInfo[i].Hero.ClassStringId) as GameObject)).GetComponent <FormationUnit>();

                unit.transform.SetParent(transform, false);
                unit.Party = this;
                unit.Initialize(party.HeroInfo[i].Hero, 4 - i, player.isMasterClient ? Team.Heroes : Team.Monsters);
                Units.Add(unit);
                unit.ResetAnimations();

                if (party.HeroInfo[i].Hero.HeroClass.Modes.Count > 0)
                {
                    party.HeroInfo[i].Hero.CurrentMode = party.HeroInfo[i].Hero.HeroClass.Modes.Find(mode => mode.IsRaidDefault);
                }
            }
        }
    }
Beispiel #10
0
 public void DeployFromPreparation(RaidPreparationManager preparationManager, ShopManager shopManager)
 {
     Quest             = preparationManager.SelectedQuestSlot.Quest;
     RaidParty         = new RaidParty(preparationManager.raidPartyPanel);
     InventorySlotData = shopManager.partyInventory.SaveInventorySlotData();
 }