public override void Reset()
 {
     skip = false;
     m_isAlreadySkipped = false;
     m_isFinishLoad     = false;
     dropCount          = 0;
     flashCount         = 0;
     reward             = null;
     SetActiveRenBalls(false);
     Delete();
 }
    private void Drop()
    {
        //IL_0041: Unknown result type (might be due to invalid IL or missing references)
        //IL_012d: Unknown result type (might be due to invalid IL or missing references)
        //IL_0145: Unknown result type (might be due to invalid IL or missing references)
        sectionCommandReceiver.OnHideRarity();
        int i = 0;

        for (int count = managedEffects.Count; i < count; i++)
        {
            if (managedEffects[i] != null)
            {
                Object.Destroy(managedEffects[i].get_gameObject());
            }
        }
        managedEffects.Clear();
        rarity = RARITY_TYPE.D;
        reward = null;
        if (MonoBehaviourSingleton <GachaManager> .IsValid() && MonoBehaviourSingleton <GachaManager> .I.gachaResult != null && dropCount < MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward.Count)
        {
            reward = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward[dropCount];
            SkillItemTable.SkillItemData skillItemData = Singleton <SkillItemTable> .I.GetSkillItemData((uint)reward.itemId);

            if (skillItemData != null)
            {
                rarity = skillItemData.rarity;
            }
        }
        if (reward == null)
        {
            reward = new GachaResult.GachaReward();
        }
        rarityIndex = rarity.ToRarityExpressionID();
        if (mainBall != null)
        {
            Object.Destroy(mainBall.get_gameObject());
        }
        mainBall = CreateBall(ballSocket, rarityIndex, Vector3.get_zero(), true);
        string text;

        if (dropCount != 0)
        {
            text = ((dropCount >= 10) ? "SKILL_GACHA_REAM_DROP_2" : "SKILL_GACHA_REAM_DROP_1");
        }
        else
        {
            text = ((!IsSingleGacha) ? "SKILL_GACHA_REAM" : "SKILL_GACHA_SINGLE");
            Play(text, null, 0f);
        }
        npcAnimator.Play(text, 0, 0f);
        gachaAnimator.Play(text, 0, 0f);
        cameraAnimator.Play(text, 0, 0f);
    }
Exemple #3
0
    public RARITY_TYPE GetMaxRarity()
    {
        RARITY_TYPE rARITY_TYPE = RARITY_TYPE.D;

        if (gachaResult != null && gachaResult.reward != null)
        {
            int i = 0;
            for (int count = gachaResult.reward.Count; i < count; i++)
            {
                GachaResult.GachaReward gachaReward  = gachaResult.reward[i];
                RARITY_TYPE             rARITY_TYPE2 = RARITY_TYPE.D;
                switch (selectGachaType)
                {
                case GACHA_TYPE.QUEST:
                {
                    QuestTable.QuestTableData questData = Singleton <QuestTable> .I.GetQuestData((uint)gachaReward.itemId);

                    if (questData != null)
                    {
                        rARITY_TYPE2 = questData.rarity;
                    }
                    break;
                }

                case GACHA_TYPE.SKILL:
                {
                    SkillItemTable.SkillItemData skillItemData = Singleton <SkillItemTable> .I.GetSkillItemData((uint)gachaReward.itemId);

                    if (skillItemData != null)
                    {
                        rARITY_TYPE2 = skillItemData.rarity;
                    }
                    break;
                }
                }
                if (rARITY_TYPE < rARITY_TYPE2)
                {
                    rARITY_TYPE = rARITY_TYPE2;
                }
            }
        }
        return(rARITY_TYPE);
    }
Exemple #4
0
    private void SortGachaResult()
    {
        int num   = -1;
        int index = -1;

        if (selectGachaType == GACHA_TYPE.QUEST)
        {
            int i = 0;
            for (int count = gachaResult.reward.Count; i < count; i++)
            {
                QuestTable.QuestTableData questData = Singleton <QuestTable> .I.GetQuestData((uint)gachaResult.reward[i].itemId);

                if (questData != null && (int)questData.rarity > num)
                {
                    num   = (int)questData.rarity;
                    index = i;
                }
            }
        }
        else
        {
            if (selectGachaType != GACHA_TYPE.SKILL)
            {
                return;
            }
            int j = 0;
            for (int count2 = gachaResult.reward.Count; j < count2; j++)
            {
                SkillItemTable.SkillItemData skillItemData = Singleton <SkillItemTable> .I.GetSkillItemData((uint)gachaResult.reward[j].itemId);

                if (skillItemData != null && (int)skillItemData.rarity > num)
                {
                    num   = (int)skillItemData.rarity;
                    index = j;
                }
            }
        }
        GachaResult.GachaReward value = gachaResult.reward[index];
        gachaResult.reward[index] = gachaResult.reward[gachaResult.reward.Count - 1];
        gachaResult.reward[gachaResult.reward.Count - 1] = value;
    }
    private IEnumerator DoSkillGacha()
    {
        Transform _transform = this.get_transform();

        Reset();
        if (line != null)
        {
            line.set_enabled(true);
        }
        isReam = false;
        if (MonoBehaviourSingleton <GachaManager> .IsValid() && MonoBehaviourSingleton <GachaManager> .I.IsReam())
        {
            isReam = true;
        }
        SetActivateBasketCollider(true);
        Vector3 basket_pos = basket.get_position();

        for (int l = 0; l < 20; l++)
        {
            CreateBall(_transform, 0, basket_pos + Quaternion.AngleAxis((float)(l * 45), Vector3.get_right()) * new Vector3(0.04f * (float)(l - 10), 0.08f, 0f), false);
        }
        LoadingQueue load_queue = new LoadingQueue(this);

        if (isReam)
        {
            int k = 0;
            for (int j = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward.Count; k < j; k++)
            {
                GachaResult.GachaReward      rwd             = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward[k];
                SkillItemTable.SkillItemData skill_item_data = Singleton <SkillItemTable> .I.GetSkillItemData((uint)rwd.itemId);

                if (skill_item_data != null)
                {
                    load_queue.Load(RESOURCE_CATEGORY.ITEM_MODEL, ResourceName.GetSkillItemModel(skill_item_data.modelID), false);
                    load_queue.Load(RESOURCE_CATEGORY.ITEM_MODEL, ResourceName.GetSkillItemSymbolModel(skill_item_data.iconID), false);
                }
            }
            List <GachaResult.GachaReward> rewards = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward;
            if (ballsRen != null)
            {
                for (int i = 0; i < ballsRen.Length; i++)
                {
                    if (i < rewards.Count)
                    {
                        GachaResult.GachaReward      rwd2             = rewards[i];
                        SkillItemTable.SkillItemData skill_item_data2 = Singleton <SkillItemTable> .I.GetSkillItemData((uint)rwd2.itemId);

                        if (skill_item_data2 != null)
                        {
                            MeshRenderer mr       = ballsRen[i].GetComponent <MeshRenderer>();
                            int          index    = skill_item_data2.rarity.ToRarityExpressionID();
                            MeshRenderer rareBall = balls[index].GetComponent <MeshRenderer>();
                            mr.set_sharedMaterial(rareBall.get_sharedMaterial());
                        }
                    }
                }
            }
        }
        int[] se_id_list = (int[])Enum.GetValues(typeof(AUDIO));
        int[] array      = se_id_list;
        foreach (int id in array)
        {
            load_queue.CacheSE(id, null);
        }
        LoadingQueue loadQueue = new LoadingQueue(this);

        for (int tx = 0; tx < 3; tx++)
        {
            LoadObject loadObj = loadQueue.Load(RESOURCE_CATEGORY.MAGI_BASKET_MODEL_TEX, ResourceName.GetMagiGachaModelTexutre(2 + tx), false);
            while (loadQueue.IsLoading())
            {
                yield return((object)loadQueue.Wait());
            }
            basketModelTextureList[tx] = loadObj.loadedObject;
        }
        if (backupBasketModelTexture != null)
        {
            Material mat = GetMaterial(basket);
            if (mat != null)
            {
                mat.set_mainTexture(backupBasketModelTexture);
                mat.SetColor("_SpeLightColor", backupBasketSpeColor);
            }
        }
        yield return((object)new WaitForSeconds(1f));

        npcModel = Utility.CreateGameObject("NPC", this.get_transform().get_parent(), -1);
        managedObjects.Add(npcModel.get_gameObject());
        NPCLoader npc_loader = npcModel.get_gameObject().AddComponent <NPCLoader>();

        npc_loader.Load(Singleton <NPCTable> .I.GetNPCData(1).npcModelID, 0, false, true, SHADER_TYPE.NORMAL, null);
        while (npc_loader.isLoading)
        {
            yield return((object)null);
        }
        if (load_queue != null && load_queue.IsLoading())
        {
            yield return((object)load_queue.Wait());
        }
        npcAnimator = npc_loader.animator;
        yield return((object)null);

        m_isFinishLoad = true;
        npcAnimator.set_cullingMode(0);
        npcAnimator.Rebind();
        npcAnimator.set_cullingMode(0);
        gachaAnimator.Rebind();
        cameraAnimator.set_cullingMode(0);
        cameraAnimator.Rebind();
        string anim_name = (!IsSingleGacha) ? "SKILL_GACHA_REAM" : "SKILL_GACHA_SINGLE";

        dropCount = 0;
        Drop();
        Play(anim_name, null, 0f);
        if (isReam)
        {
            while (dropCount < 11)
            {
                if (skip && IsFinishDrop10())
                {
                    if (MonoBehaviourSingleton <TransitionManager> .I.isChanging)
                    {
                        yield return((object)null);
                    }
                    Time.set_timeScale(1f);
                    skip = false;
                    yield return((object)MonoBehaviourSingleton <TransitionManager> .I.In());
                }
                yield return((object)null);
            }
        }
        while (mainBall.get_gameObject().get_activeSelf())
        {
            yield return((object)null);
        }
        if (skip)
        {
            yield return((object)MonoBehaviourSingleton <TransitionManager> .I.In());

            Time.set_timeScale(1f);
        }
        yield return((object)null);

        sectionCommandReceiver.OnEnd();
        coroutine = null;
    }
Exemple #6
0
    public override void UpdateUI()
    {
        bool flag = MonoBehaviourSingleton <GachaManager> .I.selectGacha.num == 1;

        SetActive((Enum)UI.OBJ_SINGLE_ROOT, flag);
        SetActive((Enum)UI.OBJ_MULTI_ROOT, !flag);
        if (flag)
        {
            GachaResult.GachaReward      gachaReward   = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward[0];
            SkillItemTable.SkillItemData skillItemData = Singleton <SkillItemTable> .I.GetSkillItemData((uint)gachaReward.itemId);

            if (skillItemData == null)
            {
                SetActive((Enum)UI.OBJ_SINGLE_ROOT, false);
            }
            SetLabelText((Enum)UI.LBL_NAME, skillItemData.name);
            SetLabelText((Enum)UI.LBL_ATK, skillItemData.baseAtk.ToString());
            SetLabelText((Enum)UI.LBL_DEF, skillItemData.baseDef.ToString());
            SetLabelText((Enum)UI.LBL_HP, skillItemData.baseHp.ToString());
            SetLabelText((Enum)UI.LBL_DESCRIPTION, skillItemData.GetExplanationText(1));
            SetRenderSkillItemModel((Enum)UI.TEX_MODEL, skillItemData.id, true, false);
            SetRenderSkillItemSymbolModel((Enum)UI.TEX_INNER_MODEL, skillItemData.id, true);
            RARITY_TYPE[] array = (RARITY_TYPE[])Enum.GetValues(typeof(RARITY_TYPE));
            int           i     = 0;
            for (int num = array.Length; i < num; i++)
            {
                SetActive((Enum)rarityAnimRoot[i], skillItemData.rarity == array[i]);
            }
            ResetTween((Enum)rarityAnimRoot[(int)skillItemData.rarity], 0);
            ResetTween((Enum)UI.OBJ_RARITY_TEXT_ROOT, 0);
            if (skillItemData.rarity <= RARITY_TYPE.C)
            {
                ResetTween((Enum)UI.OBJ_RARITY_LIGHT, 0);
                PlayTween((Enum)UI.OBJ_RARITY_LIGHT, true, (EventDelegate.Callback)null, false, 0);
            }
            PlayTween((Enum)rarityAnimRoot[(int)skillItemData.rarity], true, (EventDelegate.Callback)null, false, 0);
            PlayTween((Enum)UI.OBJ_RARITY_TEXT_ROOT, true, (EventDelegate.Callback)null, false, 0);
            if (AnimationDirector.I is SkillGachaDirector)
            {
                (AnimationDirector.I as SkillGachaDirector).PlayUIRarityEffect(skillItemData.rarity, GetCtrl(UI.OBJ_RARITY_ROOT), GetCtrl(rarityAnimRoot[(int)skillItemData.rarity]));
            }
        }
        else
        {
            int index = 0;
            MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward.ForEach(delegate(GachaResult.GachaReward reward)
            {
                bool flag2     = false;
                Transform ctrl = GetCtrl(iconRootAry[index]);
                SkillItemTable.SkillItemData skillItemData2 = Singleton <SkillItemTable> .I.GetSkillItemData((uint)reward.itemId);
                if (skillItemData2 == null)
                {
                    SetActive(ctrl, false);
                }
                else
                {
                    SetActive(ctrl, true);
                    bool is_new       = flag2;
                    ItemIcon itemIcon = ItemIcon.CreateRewardItemIcon(REWARD_TYPE.SKILL_ITEM, (uint)reward.itemId, ctrl, -1, null, 0, is_new, -1, false, null, false, false, ItemIcon.QUEST_ICON_SIZE_TYPE.DEFAULT);
                    itemIcon.SetEnableCollider(false);
                    Transform ctrl2 = GetCtrl(magiNameAry[index]);
                    SetLabelText(ctrl2, skillItemData2.name);
                    SetEvent(GetCtrl(iconRootAry[index]), "SKILL_DETAIL", index);
                    index++;
                }
            });
        }
        int num2 = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.crystal;

        if (MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId > 0)
        {
            ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData((uint)MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId);

            UITexture[] array2 = new UITexture[3]
            {
                FindCtrl(GetCtrl(UI.OBJ_GACHA_DISABLE_ROOT), UI.TEX_TICKET).GetComponent <UITexture>(),
                FindCtrl(GetCtrl(UI.OBJ_GACHA_ENABLE_ROOT), UI.TEX_TICKET).GetComponent <UITexture>(),
                GetCtrl(UI.TEX_TICKET_HAVE).GetComponent <UITexture>()
            };
            UITexture[] array3 = array2;
            foreach (UITexture ui_tex in array3)
            {
                ResourceLoad.LoadItemIconTexture(ui_tex, itemData.iconID);
            }
            num2 = MonoBehaviourSingleton <InventoryManager> .I.GetItemNum((ItemInfo x) => x.tableData.id == itemData.id, 1, false);
        }
        SetActive(footerRoot, UI.SPR_CRYSTAL, MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId == 0);
        SetActive(footerRoot, UI.TEX_TICKET_HAVE, MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId > 0);
        SetLabelText(footerRoot, UI.LBL_CRYSTAL_NUM, num2.ToString());
        SetGachaButtonActive(!MonoBehaviourSingleton <GachaManager> .I.IsSelectTutorialGacha() && MonoBehaviourSingleton <GachaManager> .I.gachaResult.remainCount != 0);
    }
Exemple #7
0
    private IEnumerator DoQuestGacha()
    {
        Init();
        int display_rarity = 0;

        SetLinkCamera(true);
        int enemy_id = 0;

        EnemyTable.EnemyData enemy_data = null;
        if (MonoBehaviourSingleton <GachaManager> .I.gachaResult != null)
        {
            GachaResult.GachaReward reward       = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward[0];
            uint reward_quest_id                 = (uint)reward.itemId;
            QuestTable.QuestTableData quest_data = Singleton <QuestTable> .I.GetQuestData(reward_quest_id);

            if (quest_data != null)
            {
                enemy_data = Singleton <EnemyTable> .I.GetEnemyData((uint)quest_data.GetMainEnemyID());
            }
        }
        if (enemy_data == null)
        {
            if (enemy_id == 0)
            {
                enemy_id = 1101001;
            }
            enemy_data = Singleton <EnemyTable> .I.GetEnemyData((uint)enemy_id);
        }
        NPCLoader   npc_loader   = LoadNPC();
        EnemyLoader enemy_loader = null;

        if (enemy_data != null)
        {
            int displayAnimID = enemy_data.animId;
            OutGameSettingsManager.EnemyDisplayInfo displayInfo = MonoBehaviourSingleton <OutGameSettingsManager> .I.SearchEnemyDisplayInfoForGacha(enemy_data);

            int   modelID      = enemy_data.modelId;
            float displayScale = enemy_data.modelScale;
            if (displayInfo != null)
            {
                displayAnimID = displayInfo.animID;
                displayScale  = displayInfo.gachaScale;
            }
            enemy_loader = LoadEnemy(enemyPosition, modelID, displayAnimID, displayScale, enemy_data.baseEffectName, enemy_data.baseEffectNode);
            while (enemy_loader.isLoading)
            {
                yield return((object)null);
            }
            enemy_loader.ApplyGachaDisplayScaleToParentNode();
            CheckAndReplaceShader(enemy_loader);
            enemy_loader.get_gameObject().SetActive(false);
        }
        while (npc_loader.isLoading)
        {
            yield return((object)null);
        }
        LoadingQueue lo_queue = new LoadingQueue(this);

        CacheAudio(lo_queue);
        if (enemy_data != null)
        {
            CacheEnemyAudio(enemy_data, lo_queue);
        }
        while (lo_queue.IsLoading())
        {
            yield return((object)null);
        }
        PlayerAnimCtrl npc_anim = PlayerAnimCtrl.Get(npc_loader.animator, PLCA.IDLE_01, null, null, null);

        CreateNPCEffect(npc_loader.model);
        yield return((object)null);

        stageAnimator.set_cullingMode(0);
        stageAnimator.Rebind();
        targetRarity = MonoBehaviourSingleton <GachaManager> .I.GetMaxRarity().ToRarityExpressionID() + 1;

        if (targetRarity > 4)
        {
            targetRarity = 4;
        }
        stageAnimator.Play("StageAnim_Main");
        Play("MainAnim_Start", null, 0f);
        PlayEffect(startEffectPrefabs[0]);
        npc_anim.Play(PLCA.QUEST_GACHA, true);
        bool rankup3 = UpdateDisplayRarity(ref display_rarity);

        PlayAudio(AUDIO.OPENING_01);
        while (Step(0.5f))
        {
            yield return((object)null);
        }
        PlayAudio(AUDIO.OPENING_02);
        PlayAudio(AUDIO.OPENING_03);
        while (Step(1.4f))
        {
            yield return((object)null);
        }
        PlayAudio(AUDIO.OPENING_04);
        while (Step(2.6f))
        {
            yield return((object)null);
        }
        PlayAudio(AUDIO.DOOR_01);
        while (Step(3.2f))
        {
            yield return((object)null);
        }
        PlayAudio(AUDIO.DOOR_02);
        while (Step(3.38f))
        {
            yield return((object)null);
        }
        PlayAudio(AUDIO.MAGI_INTRO_01);
        while (Step(6.5f))
        {
            yield return((object)null);
        }
        npc_loader.get_gameObject().SetActive(false);
        PlayMeteorEffect(display_rarity);
        PlayAudio(AUDIO.METEOR_01);
        while (Step(7.5f))
        {
            yield return((object)null);
        }
        PlayMagicEffect(display_rarity, rankup3);
        PlayMagicAudio(display_rarity);
        rankup3 = UpdateDisplayRarity(ref display_rarity);
        PlayMeteorEffect(display_rarity);
        while (Step(8.5f))
        {
            yield return((object)null);
        }
        PlayMagicEffect(display_rarity, rankup3);
        PlayMagicAudio(display_rarity);
        rankup3 = UpdateDisplayRarity(ref display_rarity);
        PlayMeteorEffect(display_rarity);
        PlayAudio(AUDIO.METEOR_02);
        while (Step(9.5f))
        {
            yield return((object)null);
        }
        PlayMagicEffect(display_rarity, rankup3);
        PlayMagicAudio(display_rarity);
        while (Step(10.5f))
        {
            yield return((object)null);
        }
        if (enemy_loader != null)
        {
            enemy_loader.get_gameObject().SetActive(true);
        }
        if (!skip)
        {
            PlayEnemyAnimation(enemy_loader, "Base Layer.GACHA_SINGLE");
        }
        Play("MainAnim_End", null, 0f);
        UpdateDisplayRarity(ref display_rarity);
        PlayEndEffect(display_rarity);
        RARITY_TYPE rarity = MonoBehaviourSingleton <GachaManager> .I.GetMaxRarity();

        PlayAppearAudio(rarity, false);
        if (enemy_data != null)
        {
            PlayEnemyAudio(enemy_data, false);
        }
        while (Step(11.5f))
        {
            yield return((object)null);
        }
        while (Step(13f))
        {
            yield return((object)null);
        }
        if (skip)
        {
            while (MonoBehaviourSingleton <TransitionManager> .I.isChanging)
            {
                yield return((object)null);
            }
            PlayEnemyAnimation(enemy_loader, "Base Layer.IDLE");
            Time.set_timeScale(1f);
            if (MonoBehaviourSingleton <TransitionManager> .I.isTransing)
            {
                yield return((object)MonoBehaviourSingleton <TransitionManager> .I.In());
            }
        }
        else
        {
            skip = true;
        }
        Time.set_timeScale(1f);
        sectionCommandReceiver.OnEnd();
    }
    public override void UpdateUI()
    {
        bool flag = MonoBehaviourSingleton <GachaManager> .I.selectGacha.num == 1;

        SetActive((Enum)UI.OBJ_SINGLE_ROOT, flag);
        SetActive((Enum)UI.OBJ_MULTI_ROOT, !flag);
        SetActive((Enum)UI.OBJ_BG_SINGLE, flag);
        SetActive((Enum)UI.OBJ_BG_MULTI, !flag);
        if (flag)
        {
            string text     = string.Empty;
            int    star_num = 0;
            GachaResult.GachaReward   gachaReward = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward[0];
            QuestTable.QuestTableData questData   = Singleton <QuestTable> .I.GetQuestData((uint)gachaReward.itemId);

            if (questData != null)
            {
                text     = questData.questText;
                star_num = (int)questData.difficulty;
            }
            SetLabelText((Enum)UI.LBL_NAME, text);
            RARITY_TYPE[] array = (RARITY_TYPE[])Enum.GetValues(typeof(RARITY_TYPE));
            int           i     = 0;
            for (int num = array.Length; i < num; i++)
            {
                SetActive((Enum)rarityAnimRoot[i], questData.rarity == array[i]);
            }
            SetGachaQuestDifficulty(UI.OBJ_DIFFICULTY_ROOT, star_num);
            ResetTween((Enum)UI.OBJ_DIFFICULTY_ROOT, 0);
            ResetTween((Enum)rarityAnimRoot[(int)questData.rarity], 0);
            ResetTween((Enum)UI.OBJ_RARITY_TEXT_ROOT, 0);
            if (questData.rarity <= RARITY_TYPE.C)
            {
                ResetTween((Enum)UI.OBJ_RARITY_LIGHT, 0);
                PlayTween((Enum)UI.OBJ_RARITY_LIGHT, true, (EventDelegate.Callback)null, false, 0);
            }
            PlayTween((Enum)UI.OBJ_RARITY_TEXT_ROOT, true, (EventDelegate.Callback)null, false, 0);
            PlayTween((Enum)rarityAnimRoot[(int)questData.rarity], true, (EventDelegate.Callback) delegate
            {
                PlayTween((Enum)UI.OBJ_DIFFICULTY_ROOT, true, (EventDelegate.Callback)null, false, 0);
            }, false, 0);
            QuestGachaDirectorBase questGachaDirectorBase = AnimationDirector.I as QuestGachaDirectorBase;
            if (questGachaDirectorBase != null)
            {
                questGachaDirectorBase.PlayRarityAudio(questData.rarity, true);
                questGachaDirectorBase.PlayUIRarityEffect(questData.rarity, GetCtrl(UI.OBJ_RARITY_ROOT), GetCtrl(rarityAnimRoot[(int)questData.rarity]));
            }
        }
        else
        {
            int index = 0;
            MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward.ForEach(delegate(GachaResult.GachaReward reward)
            {
                bool flag2 = false;
                int num3   = 0;
                QuestItemInfo questItem = MonoBehaviourSingleton <InventoryManager> .I.GetQuestItem((uint)reward.itemId);
                if (questItem != null)
                {
                    flag2 = GameSaveData.instance.IsNewItem(ITEM_ICON_TYPE.QUEST_ITEM, questItem.uniqueID);
                    flag2 = IsNewItemQuestEnemySpecies(questItem);
                    num3  = questItem.infoData.questData.tableData.GetMainEnemyLv();
                }
                bool is_new       = flag2;
                ItemIcon itemIcon = ItemIcon.CreateRewardItemIcon(REWARD_TYPE.QUEST_ITEM, (uint)reward.itemId, GetCtrl(iconRootAry[index]), -1, null, 0, is_new, -1, false, null, false, false, ItemIcon.QUEST_ICON_SIZE_TYPE.DEFAULT);
                itemIcon.SetEnableCollider(false);
                string text2 = string.Empty;
                if (num3 > 0)
                {
                    text2 = string.Format(StringTable.Get(STRING_CATEGORY.MAIN_STATUS, 1u), num3.ToString());
                }
                SetLabelText(GetCtrl(iconRootAry[index]), iconLevelAry[index], text2);
                SetEvent(GetCtrl(iconRootAry[index]), "QUEST_DETAIL", index);
                index++;
            });
        }
        int num2 = MonoBehaviourSingleton <UserInfoManager> .I.userStatus.crystal;

        if (MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId > 0)
        {
            ItemTable.ItemData itemData = Singleton <ItemTable> .I.GetItemData((uint)MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId);

            UITexture[] array2 = new UITexture[3]
            {
                FindCtrl(FindCtrl(footerRoot, UI.OBJ_GACHA_DISABLE_ROOT), UI.TEX_TICKET).GetComponent <UITexture>(),
                FindCtrl(FindCtrl(footerRoot, UI.OBJ_GACHA_ENABLE_ROOT), UI.TEX_TICKET).GetComponent <UITexture>(),
                FindCtrl(footerRoot, UI.TEX_TICKET_HAVE).GetComponent <UITexture>()
            };
            UITexture[] array3 = array2;
            foreach (UITexture ui_tex in array3)
            {
                ResourceLoad.LoadItemIconTexture(ui_tex, itemData.iconID);
            }
            num2 = MonoBehaviourSingleton <InventoryManager> .I.GetItemNum((ItemInfo x) => x.tableData.id == itemData.id, 1, false);

            if (MonoBehaviourSingleton <GachaManager> .I.gachaResult.counter >= 0)
            {
                SetActive(footerRoot, UI.GACHATICKETCOUNTERSRESULT, false);
                SetActive(footerRoot, UI.S_COUNTER, false);
                SetActive(footerRoot, UI.S_AVAILABLE, true);
            }
            else if (MonoBehaviourSingleton <GachaManager> .I.gachaResult.counter > 0)
            {
                SetActive(footerRoot, UI.GACHATICKETCOUNTERSRESULT, true);
                SetActive(footerRoot, UI.S_COUNTER, true);
                SetActive(footerRoot, UI.S_AVAILABLE, false);
                SetActive(footerRoot, UI.NUMBER_COUNTER_IMG, true);
                FindCtrl(footerRoot, UI.NUMBER_COUNTER_IMG).GetComponent <UISprite>().spriteName = MonoBehaviourSingleton <GachaManager> .I.gachaResult.counter.ToString();

                FindCtrl(FindCtrl(footerRoot, UI.GACHATICKETCOUNTERSRESULT), UI.COUNTER_PROGRESSBAR_FOREGROUND).GetComponent <UISprite>().fillAmount = (float)(10 - MonoBehaviourSingleton <GachaManager> .I.gachaResult.counter) / 10f;
                SetLabelText(footerRoot, UI.COUNTER_LBL, MonoBehaviourSingleton <GachaManager> .I.gachaResult.counter);
            }
            else
            {
                SetActive(footerRoot, UI.GACHATICKETCOUNTERSRESULT, true);
                SetActive(footerRoot, UI.S_COUNTER, false);
                SetActive(footerRoot, UI.S_AVAILABLE, true);
            }
        }
        SetActive(footerRoot, UI.SPR_CRYSTAL, MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId == 0);
        SetActive(footerRoot, UI.TEX_TICKET_HAVE, MonoBehaviourSingleton <GachaManager> .I.selectGacha.requiredItemId > 0);
        SetLabelText(footerRoot, UI.LBL_CRYSTAL_NUM, num2.ToString());
        if (MonoBehaviourSingleton <GachaManager> .I.gachaResult.gachaGuaranteeCampaignInfo == null)
        {
            SetGachaButtonActive(!MonoBehaviourSingleton <GachaManager> .I.IsSelectTutorialGacha() && MonoBehaviourSingleton <GachaManager> .I.gachaResult.remainCount != 0);
        }
        else
        {
            SetGachaButtonActive(!MonoBehaviourSingleton <GachaManager> .I.IsSelectTutorialGacha());
        }
    }
Exemple #9
0
    private IEnumerator DoQuestGacha()
    {
        m_isSkipAll = false;
        Init();
        SetLinkCamera(true);
        EnemyLoader[]               enemyLoaderList = new EnemyLoader[11];
        EnemyTable.EnemyData[]      enemy_datas     = new EnemyTable.EnemyData[11];
        QuestTable.QuestTableData[] quest_datas     = new QuestTable.QuestTableData[11];
        if (MonoBehaviourSingleton <GachaManager> .IsValid() && MonoBehaviourSingleton <GachaManager> .I.gachaResult != null)
        {
            int i = 0;
            for (int n2 = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward.Count; i < n2; i++)
            {
                GachaResult.GachaReward reward = MonoBehaviourSingleton <GachaManager> .I.gachaResult.reward[i];
                uint reward_quest_id           = (uint)reward.itemId;
                quest_datas[i] = Singleton <QuestTable> .I.GetQuestData(reward_quest_id);

                if (quest_datas[i] != null)
                {
                    enemy_datas[i] = Singleton <EnemyTable> .I.GetEnemyData((uint)quest_datas[i].GetMainEnemyID());

                    if (enemy_datas[i] == null)
                    {
                        Log.Error("EnemyTable[{0}] == null", quest_datas[i].GetMainEnemyID());
                    }
                }
                else
                {
                    Log.Error("QuestTable[{0}] == null", reward.itemId);
                    quest_datas[i] = new QuestTable.QuestTableData();
                    enemy_datas[i] = new EnemyTable.EnemyData();
                }
            }
        }
        NPCLoader npc_loader = LoadNPC();

        npc_loader.Load(Singleton <NPCTable> .I.GetNPCData(2).npcModelID, 0, false, true, SHADER_TYPE.NORMAL, null);
        int n = 0;

        for (int m = 11; n < m; n++)
        {
            float scale         = enemy_datas[n].modelScale;
            int   displayAnimID = enemy_datas[n].animId;
            int   modelID       = enemy_datas[n].modelId;
            OutGameSettingsManager.EnemyDisplayInfo displayInfo = MonoBehaviourSingleton <OutGameSettingsManager> .I.SearchEnemyDisplayInfoForGacha(enemy_datas[n]);

            if (displayInfo != null)
            {
                displayAnimID = displayInfo.animID;
                scale         = displayInfo.gachaScale;
            }
            enemyLoaderList[n] = LoadEnemy(enemyPositions[n], modelID, displayAnimID, scale, enemy_datas[n].baseEffectName, enemy_datas[n].baseEffectNode);
        }
        int l = 0;

        for (int k = 11; l < k; l++)
        {
            while (enemyLoaderList[l].isLoading)
            {
                yield return((object)null);
            }
            enemyLoaderList[l].ApplyGachaDisplayScaleToParentNode();
            CheckAndReplaceShader(enemyLoaderList[l]);
            enemyLoaderList[l].get_gameObject().SetActive(false);
        }
        LoadingQueue lo_queue = new LoadingQueue(this);

        CacheAudio(lo_queue);
        for (int j = 0; j < 11; j++)
        {
            CacheEnemyAudio(enemy_datas[j], lo_queue);
        }
        while (npc_loader.isLoading)
        {
            yield return((object)null);
        }
        while (lo_queue.IsLoading())
        {
            yield return((object)null);
        }
        PlayerAnimCtrl npc_anim = PlayerAnimCtrl.Get(npc_loader.animator, PLCA.IDLE_01, null, null, null);

        CreateNPCEffect(npc_loader.model);
        yield return((object)null);

        stageAnimator.set_cullingMode(0);
        stageAnimator.Rebind();
        stageAnimator.Play("StageAnim_Main");
        Play("MainAnim_Start", null, 0f);
        PlayEffect(startEffectPrefabs[0]);
        npc_anim.Play(PLCA.QUEST_GACHA, true);
        PlayAudio(AUDIO.OPENING_01);
        while (Step(0.5f))
        {
            yield return((object)null);
        }
        PlayAudio(AUDIO.OPENING_02);
        PlayAudio(AUDIO.OPENING_03);
        while (Step(1.4f))
        {
            yield return((object)null);
        }
        PlayAudio(AUDIO.OPENING_04);
        while (Step(2.6f))
        {
            yield return((object)null);
        }
        PlayAudio(AUDIO.DOOR_01);
        while (Step(3.2f))
        {
            yield return((object)null);
        }
        PlayAudio(AUDIO.DOOR_02);
        while (Step(3.38f))
        {
            yield return((object)null);
        }
        PlayAudio(AUDIO.MAGI_INTRO_01);
        while (Step(5.1f))
        {
            yield return((object)null);
        }
        PlayAudio(AUDIO.MAGI_INTRO_02);
        while (Step(5.5f))
        {
            yield return((object)null);
        }
        PlayEffect(startEffectPrefabs[1]);
        Transform[] magic_effects = (Transform[])new Transform[11];
        Transform[] end_effects   = (Transform[])new Transform[11];
        int         meteor_step   = 0;
        int         magic_step    = 0;
        int         max_step      = 11;

        time -= Time.get_deltaTime();
        while (meteor_step < max_step || magic_step < max_step)
        {
            time += Time.get_deltaTime();
            if (meteor_step < max_step && meteorTimings[meteor_step] <= time)
            {
                PlayEffect(magicCircles[meteor_step], meteorEffectPrefabs[quest_datas[meteor_step].rarity.ToRarityExpressionID()]);
                if (meteor_step == max_step - 1)
                {
                    PlayAudio(AUDIO.METEOR_01);
                }
                meteor_step++;
            }
            if (magic_step < max_step && magicTimings[magic_step] <= time)
            {
                magic_effects[magic_step] = PlayEffect(magicCircles[magic_step], magicEffectPrefabs[quest_datas[magic_step].rarity.ToRarityExpressionID()]);
                PlayMagicAudio((int)quest_datas[magic_step].rarity);
                magic_step++;
            }
            yield return((object)null);
        }
        int idx = magic_step - 1;

        if (idx < max_step && idx >= 0)
        {
            PlayMagicAudio((int)quest_datas[idx].rarity);
        }
        while (Step(13.5f))
        {
            yield return((object)null);
        }
        if (skip && !m_isSkipAll)
        {
            if (MonoBehaviourSingleton <TransitionManager> .I.isChanging)
            {
                yield return((object)null);
            }
            Time.set_timeScale(1f);
            skip = false;
            time = 13.5f;
            yield return((object)MonoBehaviourSingleton <TransitionManager> .I.In());

            sectionCommandReceiver.ActivateSkipButton();
        }
        ActivateFirstSkipFlag();
        int         end_step           = 0;
        float       end_time2          = 13.5f;
        float       end_step_time      = 1.5f;
        float       end_step_time_last = 2f;
        RARITY_TYPE rarity_type;

        while (true)
        {
            sectionCommandReceiver.OnHideRarity();
            PlayAudio(AUDIO.RARITY_EXPOSITION);
            if (end_step > 0)
            {
                int prevIndex = end_step - 1;
                if (enemyLoaderList[prevIndex] != null)
                {
                    enemyLoaderList[prevIndex].get_gameObject().SetActive(false);
                }
                if (magic_effects[prevIndex] != null)
                {
                    Object.Destroy(magic_effects[prevIndex].get_gameObject());
                    magic_effects[prevIndex] = null;
                }
                if (end_effects[prevIndex] != null)
                {
                    Object.Destroy(end_effects[prevIndex].get_gameObject());
                    end_effects[prevIndex] = null;
                }
            }
            EnemyLoader nowEnemyLoader = enemyLoaderList[end_step];
            nowEnemyLoader.get_gameObject().SetActive(true);
            if (!skip)
            {
                string stateName = "Base Layer.GACHA_11";
                if (end_step == enemyLoaderList.Length - 1)
                {
                    stateName = "Base Layer.GACHA_SINGLE";
                }
                PlayEnemyAnimation(nowEnemyLoader, stateName);
            }
            rarity_type = quest_datas[end_step].rarity;
            int effect_rarity = rarity_type.ToRarityExpressionID();
            if (rarity_type == RARITY_TYPE.SS)
            {
                effect_rarity = 3;
            }
            end_effects[end_step] = PlayEffect(magicCircles[end_step], endEffectPrefabs[effect_rarity]);
            Play($"MainAnim_End_{end_step + 1:D2}", null, 0f);
            bool is_short = end_step < 11;
            PlayAppearAudio(rarity_type, is_short);
            if (enemy_datas.Length > end_step)
            {
                PlayEnemyAudio(enemy_datas[end_step], is_short);
            }
            end_step++;
            if (end_step >= 11)
            {
                break;
            }
            float waitTime = 0f;
            while (waitTime < showRarityWaitTime)
            {
                waitTime += Time.get_deltaTime();
                if (base.IsSkipAppearEnemy)
                {
                    waitTime = showRarityWaitTime;
                }
                yield return((object)null);
            }
            if (!base.IsSkipAppearEnemy)
            {
                sectionCommandReceiver.OnShowRarity(rarity_type);
            }
            end_time2 += end_step_time;
            while (Step(end_time2))
            {
                if (base.IsSkipAppearEnemy)
                {
                    time = end_time2;
                }
                yield return((object)null);
            }
            sectionCommandReceiver.ActivateSkipButton();
            ResetSkipAppearEnemyFlag();
        }
        yield return((object)new WaitForSeconds(lastShowRarityWaitTime));

        sectionCommandReceiver.OnShowRarity(rarity_type);
        end_time2 += end_step_time_last;
        while (Step(end_time2))
        {
            yield return((object)null);
        }
        if (skip)
        {
            while (MonoBehaviourSingleton <TransitionManager> .I.isChanging)
            {
                yield return((object)null);
            }
            int lastIndex = enemyLoaderList.Length - 1;
            if (lastIndex >= 0)
            {
                PlayEnemyAnimation(enemyLoaderList[lastIndex], "Base Layer.IDLE");
            }
            Time.set_timeScale(1f);
            if (MonoBehaviourSingleton <TransitionManager> .I.isTransing)
            {
                yield return((object)MonoBehaviourSingleton <TransitionManager> .I.In());
            }
        }
        else
        {
            skip = true;
        }
        sectionCommandReceiver.OnHideRarity();
        Time.set_timeScale(1f);
        sectionCommandReceiver.OnEnd();
    }