示例#1
0
 private void OnRetire()
 {
     Network.DraftRetired retiredDraft = Network.GetRetiredDraft();
     Log.Arena.Print(string.Format("DraftManager.OnRetire deckID={0}", retiredDraft.Deck), new object[0]);
     this.m_chest = retiredDraft.Chest;
     this.InformDraftDisplayOfChoices(new List <NetCache.CardDefinition>());
 }
示例#2
0
 private void ClearDeckInfo()
 {
     this.m_draftDeck = null;
     this.m_losses    = 0;
     this.m_wins      = 0;
     this.m_maxWins   = 0x7fffffff;
     this.m_isNewKey  = false;
     this.m_chest     = null;
     this.m_deckActiveDuringSession = false;
 }
示例#3
0
    private void OnChoicesAndContents()
    {
        Network.DraftChoicesAndContents draftChoicesAndContents = Network.GetDraftChoicesAndContents();
        this.m_currentSlot = draftChoicesAndContents.Slot;
        this.m_validSlot   = draftChoicesAndContents.Slot;
        CollectionDeck deck = new CollectionDeck {
            ID            = draftChoicesAndContents.DeckInfo.Deck,
            Type          = DeckType.DRAFT_DECK,
            HeroCardID    = draftChoicesAndContents.Hero.Name,
            HeroCardFlair = new CardFlair(draftChoicesAndContents.Hero.Premium)
        };

        this.m_draftDeck = deck;
        Log.Arena.Print(string.Format("DraftManager.OnChoicesAndContents - Draft Deck ID: {0}, Hero Card = {1}", this.m_draftDeck.ID, this.m_draftDeck.HeroCardID), new object[0]);
        foreach (Network.CardUserData data in draftChoicesAndContents.DeckInfo.Cards)
        {
            string str = (data.DbId != 0) ? GameUtils.TranslateDbIdToCardId(data.DbId) : string.Empty;
            Log.Arena.Print(string.Format("DraftManager.OnChoicesAndContents - Draft deck contains card {0}", str), new object[0]);
            if (!this.m_draftDeck.AddCard(str, data.Premium))
            {
                Debug.LogWarning(string.Format("DraftManager.OnChoicesAndContents() - Card {0} could not be added to draft deck", str));
            }
        }
        this.m_losses = draftChoicesAndContents.Losses;
        if (draftChoicesAndContents.Wins > this.m_wins)
        {
            this.m_isNewKey = true;
        }
        else
        {
            this.m_isNewKey = false;
        }
        this.m_wins    = draftChoicesAndContents.Wins;
        this.m_maxWins = draftChoicesAndContents.MaxWins;
        this.m_chest   = draftChoicesAndContents.Chest;
        if ((this.m_losses > 0) && DemoMgr.Get().ArenaIs1WinMode())
        {
            Network.RetireDraftDeck(this.GetDraftDeck().ID, this.GetSlot());
        }
        else
        {
            if ((this.m_wins == 5) && (DemoMgr.Get().GetMode() == DemoMode.BLIZZCON_2013))
            {
                DemoMgr.Get().CreateDemoText(GameStrings.Get("GLUE_BLIZZCON2013_ARENA_5_WINS"), false, false);
            }
            else if ((this.m_losses == 3) && !Options.Get().GetBool(Option.HAS_LOST_IN_ARENA, false))
            {
                NotificationManager.Get().CreateInnkeeperQuote(new Vector3(155.3f, NotificationManager.DEPTH, 34.5f), GameStrings.Get("VO_INNKEEPER_ARENA_3RD_LOSS"), "VO_INNKEEPER_ARENA_3RD_LOSS", 0f, null);
                Options.Get().SetBool(Option.HAS_LOST_IN_ARENA, true);
            }
            this.InformDraftDisplayOfChoices(draftChoicesAndContents.Choices);
        }
    }