Exemplo n.º 1
0
    public RaidParty(RaidPartySaveData saveData)
    {
        IsMovingLeft = saveData.IsMovingLeft;

        HeroInfo = new List <RaidHeroInfo>();
        for (int i = 0; i < saveData.HeroInfo.Count; i++)
        {
            var hero = DarkestDungeonManager.Campaign.Heroes.Find(campaignHero =>
                                                                  campaignHero.RosterId == saveData.HeroInfo[i].HeroRosterId);
            RaidHeroInfo newInfo = new RaidHeroInfo(hero);
            newInfo.IsAlive = saveData.HeroInfo[i].IsAlive;
            if (saveData.HeroInfo[i].IsAlive == false)
            {
                newInfo.DeathRecord = new DeathRecord()
                {
                    Factor         = saveData.HeroInfo[i].Factor,
                    HeroClassIndex = hero.ClassIndexId,
                    HeroName       = hero.HeroName,
                    KillerName     = saveData.HeroInfo[i].Killer,
                    ResolveLevel   = hero.Resolve.Level,
                };
            }
            HeroInfo.Add(newInfo);
        }
    }
Exemplo n.º 2
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;
        }
    }
Exemplo n.º 3
0
    public void PopulateStartingRaidInfo(string startingRoom)
    {
        RaidParty = new RaidPartySaveData()
        {
            IsMovingLeft = false,
            HeroInfo     = new List <RaidPartyHeroInfoSaveData>()
            {
                new RaidPartyHeroInfoSaveData()
                {
                    Factor       = DeathFactor.AttackMonster,
                    Killer       = "",
                    IsAlive      = true,
                    HeroRosterId = 1,
                },
                new RaidPartyHeroInfoSaveData()
                {
                    Factor       = DeathFactor.AttackMonster,
                    Killer       = "",
                    IsAlive      = true,
                    HeroRosterId = 2,
                },
            }
        };

        ExploredRoomCount  = 1;
        CurrentLocation    = startingRoom;
        LastRoom           = startingRoom;
        PreviousLastSector = "";
        LastSector         = "";
        KilledMonsters     = new List <string>();
        InvestigatedCurios = new List <string>();

        TorchAmount      = 100;
        MaxTorchAmount   = 100;
        ModifiedMinTorch = -1;
        ModifiedMaxTorch = -1;

        HeroFormationData = new BattleFormationSaveData();
        HeroFormationData.UnitData.Add(new FormationUnitSaveData()
        {
            IsHero     = true,
            RosterId   = 1,
            Rank       = 1,
            CombatInfo = new FormationUnitInfo()
            {
                CombatId = 1,
            }
        });
        HeroFormationData.UnitData.Add(new FormationUnitSaveData()
        {
            IsHero     = true,
            RosterId   = 2,
            Rank       = 2,
            CombatInfo = new FormationUnitInfo()
            {
                CombatId = 2,
            }
        });

        InventoryItems = new List <InventorySlotData>();
    }