Exemplo n.º 1
0
    /** 执行卡牌强化 */
    private void doSacrifice(Card mainCard)
    {
        GuideManager.Instance.saveTimes(GuideManager.TypeSacrifice);
        ArrayList messageList = new ArrayList();
        IntensifyCardSacrificeContent icsc = sacrificeContent.GetComponent <IntensifyCardSacrificeContent> ();

        if (icsc.sacrificeRotCtrl.isSeniorQualityByFoods())
        {
            messageList.Add(LanguageConfigManager.Instance.getLanguage("Intensify23"));
        }
        if (mainCard.isSkillExpUpFull(icsc.sacrificeRotCtrl.recalculateSkillEXP()))
        {
            messageList.Add(LanguageConfigManager.Instance.getLanguage("Intensify22"));
        }
        if (!EvolutionManagerment.Instance.isMaxEvoLevel(mainCard) && mainCard.getQualityId() > QualityType.EXCELLENT && icsc.sacrificeRotCtrl.isNamesake(mainCard.sid))
        {
            messageList.Add(LanguageConfigManager.Instance.getLanguage("Intensify24"));
        }
        if (icsc.sacrificeRotCtrl.isHasBloodLvByFoods())
        {
            messageList.Add(LanguageConfigManager.Instance.getLanguage("Intensify31"));
        }
        string messageInfo = MessageWindow.createMessageInfo(messageList);

        if (!string.IsNullOrEmpty(messageInfo))
        {
            UiManager.Instance.openDialogWindow <MessageWindow> ((win) => {
                win.content.pivot = UIWidget.Pivot.Left;
                //win.content.transform.localPosition = new Vector3 (-190, 136, 0);
                //win.content.transform.localScale = new Vector3 (1.1f, 1.1f, 1);
                win.initWindow(2, LanguageConfigManager.Instance.getLanguage("s0094"), LanguageConfigManager.Instance.getLanguage("s0093"), messageInfo, (msg) => {
                    if (msg.buttonID == MessageHandle.BUTTON_LEFT)
                    {
                        MaskWindow.UnlockUI();
                        return;
                    }
                    else
                    {
                        sacrificeContent.intensify();
                    }
                });
            });
        }
        else
        {
            sacrificeContent.intensify();
        }
    }
Exemplo n.º 2
0
    public override void buttonEventBase(GameObject gameObj)
    {
        base.buttonEventBase(gameObj);
        if (gameObj.name == "buttonSelect" || gameObj.name.Contains("buttonFood"))
        {
            GuideManager.Instance.doGuide();
            //是进化就走特殊渠道选择副卡
            if (contentType == IntensifyCardManager.INTENSIFY_CARD_EVOLUTION)
            {
                if (IntensifyCardManager.Instance.getMainCard() == null)
                {
                    UiManager.Instance.createMessageWindowByOneButton(LanguageConfigManager.Instance.getLanguage("Evo05"), null);
                    return;
                }
                UiManager.Instance.openDialogWindow <EvolutionChooseWindow> ((win) => {
                    win.initWin(openChooswWinCallBack, setEvoType);
                });
            }
            else if (contentType == IntensifyCardManager.INTENSIFY_CARD_SUPRE_EVO)
            {
                IntensifyCardManager.Instance.resetSuperExoChoosedNum();
                if (IntensifyCardManager.Instance.getMainCard() == null)
                {
                    UiManager.Instance.createMessageWindowByOneButton(LanguageConfigManager.Instance.getLanguage("Evo05"), null);
                    return;
                }
                UiManager.Instance.openDialogWindow <EvolutionChooseWindow>((win) =>
                {
                    win.initWin(openChooswWinCallBack, setEvoType);
                });
            }
            else
            {
                UiManager.Instance.openWindow <IntensifyCardChooseWindow>((win) =>
                {
                    win.initWindow(contentType, IntensifyCardManager.FOODCARDSELECT);
                });
            }
        }
        else if (gameObj.name == "buttonMain")
        {
            GuideManager.Instance.doGuide();
            IntensifyCardManager.Instance.setMainCard(null);
            UiManager.Instance.openWindow <IntensifyCardChooseWindow> ((win) => {
                win.initWindow(contentType, IntensifyCardManager.MAINCARDSELECT);
            });
        }
        else if (gameObj.name == "buttonOneKey")
        {
            if (contentType == IntensifyCardManager.INTENSIFY_CARD_SACRIFICE)
            {
                sacrificeContent.oneKey();
            }
            else if (contentType == IntensifyCardManager.INTENSIFY_CARD_ADDON)
            {
                addonContent.oneKey();
            }
            MaskWindow.UnlockUI();
        }
        else if (gameObj.name == "buttonIntensify")
        {
            if (IntensifyCardManager.Instance.getMainCard() == null)
            {
                UiManager.Instance.createMessageWindowByOneButton(LanguageConfigManager.Instance.getLanguage("Evo05"), null);
                MaskWindow.UnlockUI();
                return;
            }
            //献祭开始
            if (contentType == IntensifyCardManager.INTENSIFY_CARD_SACRIFICE)
            {
                Card mainCard = IntensifyCardManager.Instance.getMainCard();
                if (mainCard != null)
                {
                    IntensifyCardSacrificeContent icsc = sacrificeContent.GetComponent <IntensifyCardSacrificeContent> ();
                    if (!mainCard.isCanSacrific())
                    {
                        doSacrifice(mainCard);
                    }
                    else
                    {
                        UiManager.Instance.openDialogWindow <MessageLineWindow> ((win) => {
                            win.Initialize(LanguageConfigManager.Instance.getLanguage("Intensify_t04l1"));
                        });
                        MaskWindow.UnlockUI();
                        return;
                    }
                }
            }
            else if (contentType == IntensifyCardManager.INTENSIFY_CARD_SUPRE_EVO)
            {
                Card mc = IntensifyCardManager.Instance.getMainCard();//主卡

                if (!EvolutionManagerment.Instance.isCanEvoByString(mc))
                {
                    MaskWindow.UnlockUI();
                    return;
                }
                if (!string.IsNullOrEmpty(superEvoContent.getErrorMsg()))
                {
                    UiManager.Instance.createMessageWindowByTwoButton(superEvoContent.getErrorMsg(), (MessageHandle msg) =>
                    {
                        if (msg.buttonID == MessageHandle.BUTTON_LEFT)
                        {
                            MaskWindow.UnlockUI();
                            return;
                        }
                        intensifyButton.gameObject.SetActive(false);
                        superEvoContent.intensify();
                    });
                }
                else
                {
                    intensifyButton.gameObject.SetActive(false);
                    superEvoContent.intensify();
                }
                if (UiManager.Instance.cardBookWindow != null)
                {
                    UiManager.Instance.cardBookWindow.destoryWindow();
                }
            }
            //进化
            else if (contentType == IntensifyCardManager.INTENSIFY_CARD_EVOLUTION)
            {
                Card mc = IntensifyCardManager.Instance.getMainCard();//主卡

                if (!EvolutionManagerment.Instance.isCanEvoByString(mc))
                {
                    MaskWindow.UnlockUI();
                    return;
                }
                if (!string.IsNullOrEmpty(learnSkillAndEvoContent.getErrorMsg()))
                {
                    UiManager.Instance.createMessageWindowByTwoButton(learnSkillAndEvoContent.getErrorMsg(), (MessageHandle msg) =>
                    {
                        if (msg.buttonID == MessageHandle.BUTTON_LEFT)
                        {
                            MaskWindow.UnlockUI();
                            return;
                        }
                        intensifyButton.gameObject.SetActive(false);
                        learnSkillAndEvoContent.intensify(contentType, costSum.text, evoType);
                    });
                }
                else
                {
                    intensifyButton.gameObject.SetActive(false);
                    learnSkillAndEvoContent.intensify(contentType, costSum.text, evoType);
                }
                if (UiManager.Instance.cardBookWindow != null)
                {
                    UiManager.Instance.cardBookWindow.destoryWindow();
                }
            }
            else if (contentType == IntensifyCardManager.INTENSIFY_CARD_ADDON)
            {
                addonContent.intensify();
            }
        }
        else if (gameObj.name == "goGetMoney")
        {
            UiManager.Instance.openWindow <NoticeWindow> ((win) => {
                win.entranceId = NoticeSampleManager.Instance.getNoticeSampleBySid(NoticeType.ALCHEMY_SID).entranceId;
                win.updateSelectButton(NoticeType.ALCHEMY_SID);
            });
        }
        else if (gameObj.name == "buttonHelp")
        {
            UiManager.Instance.openDialogWindow <GeneralDesWindow> ((win) => {
                //Intensify1|献祭
                //Intensify3|进化
                //Intensify4|附加
                //inherit_00|传承
                //Intensify26|超进化
                if (getTitle() == LanguageConfigManager.Instance.getLanguage("Intensify1"))
                {
                    win.initialize(LanguageConfigManager.Instance.getLanguage("Intensify_des1"), LanguageConfigManager.Instance.getLanguage("Intensify25"), LanguageConfigManager.Instance.getLanguage("Intensify_t01"));
                }
                else if (getTitle() == LanguageConfigManager.Instance.getLanguage("inherit_00"))
                {
                    win.initialize(LanguageConfigManager.Instance.getLanguage("Intensify_des4"), LanguageConfigManager.Instance.getLanguage("Intensify25"), LanguageConfigManager.Instance.getLanguage("Intensify_t04"));
                }
                else if (getTitle() == LanguageConfigManager.Instance.getLanguage("Intensify3"))
                {
                    win.initialize(LanguageConfigManager.Instance.getLanguage("Intensify_des2"), LanguageConfigManager.Instance.getLanguage("Intensify25"), LanguageConfigManager.Instance.getLanguage("Intensify_t02"));
                }
                else if (getTitle() == LanguageConfigManager.Instance.getLanguage("Intensify4"))
                {
                    win.initialize(LanguageConfigManager.Instance.getLanguage("Intensify_des3"), LanguageConfigManager.Instance.getLanguage("Intensify25"), LanguageConfigManager.Instance.getLanguage("Intensify_t03"));
                }
                else if (getTitle() == LanguageConfigManager.Instance.getLanguage("Intensify26"))
                {
                    win.initialize(LanguageConfigManager.Instance.getLanguage("Intensify_des3"), LanguageConfigManager.Instance.getLanguage("Intensify25"), LanguageConfigManager.Instance.getLanguage("Intensify_t03"));
                }
            });
        }
        else if (gameObj.name == "close")
        {
            IntensifyCardManager.Instance.clearData();
            if (!GuideManager.Instance.isGuideComplete())
            {
                UiManager.Instance.openMainWindow();
                GuideManager.Instance.doGuide();
                IntensifyCardManager.Instance.isFromIncrease = false;
                MaskWindow.UnlockUI();
                return;
            }
            if (IntensifyCardManager.Instance.isFromIncrease)
            {
                UiManager.Instance.openMainWindow();
                IntensifyCardManager.Instance.isFromIncrease = false;
            }
            else
            {
                WindowBase win;
                win = UiManager.Instance.getWindow <CardStoreWindow>();
                if (win != null)
                {
                    UiManager.Instance.BackToWindow <CardStoreWindow>();
                }
                else
                {
                    win = UiManager.Instance.getWindow <TeamEditWindow>();
                    if (win != null)
                    {
                        UiManager.Instance.BackToWindow <TeamEditWindow>();
                        this.dialogCloseUnlockUI = false;
                    }
                    else
                    {
                        finishWindow();
                    }
                }
            }
        }
        //传承
        if (contentType == IntensifyCardManager.INTENSIFY_CARD_INHERIT)
        {
            inheritContent.doClieckEvent(gameObj);
        }
    }