Beispiel #1
0
    public IEnumerator  beginBattleOverAnim()
    {
        //锁屏幕,防止出去后狂点按钮报错
        MaskWindow.LockUI();

        Time.timeScale = GameManager.Instance.gameSpeed;
        yield return(new WaitForSeconds(1f));

        playAnimBattleOver();

        BattleDataErlang currentbattleData = BattleManager.battleData;

        if (BattleManager.battleData.isGMFight)
        {
            BattleManager.Instance.awardFinfish();
            yield break;
        }
        //恶魔挑战不播放战后动画
        if (BattleManager.battleData.isOneOnOneBossFight)
        {
            hideOther();
            UiManager.Instance.openDialogWindow <BossAwardWindow>((win) => {
                win.init(BattleManager.Instance.battleAwards, () => {
                    UiManager.Instance.switchWindow <EmptyWindow>((window) => {
                        ScreenManager.Instance.loadScreen(1, null, GameManager.Instance.outOneOnOneBossWindow);
                    });
                    BattleManager.battleData.isOneOnOneBossFight = false;
                });
            });
            yield break;
        }
        //  末日决战boss战阶段不播放胜利或失败动画//
        if (BattleManager.battleData.isLastBattleBossBattle)
        {
            hideOther();
            UiManager.Instance.openDialogWindow <LastBattleAwardWindow>((win) => {
                win.init(BattleManager.Instance.battleAwards, () => {
                    UiManager.Instance.switchWindow <EmptyWindow>((window) => {
                        ScreenManager.Instance.loadScreen(1, null, GameManager.Instance.outLastBattleWindow);
                    });
                    BattleManager.battleData.isLastBattleBossBattle = false;
                });
            });
            yield break;
        }
        // 末日决战结算界面//
        if (BattleManager.battleData.isLastBattle)
        {
            // 胜利//
            if (currentbattleData.winnerID == TeamInfo.OWN_CAMP)
            {
                StartCoroutine(showLastBattleAward());
                yield break;
            }
        }
        if (currentbattleData.isArenaMass || currentbattleData.isArenaFinal || currentbattleData.isGuide || currentbattleData.isLadders || currentbattleData.isPractice || currentbattleData.isGuildFight || currentbattleData.isMineralFightRecord || currentbattleData.isGodsWarFinal)
        {
            bool isWin = currentbattleData.winnerID == TeamInfo.OWN_CAMP;

            if (currentbattleData.isMineralFightRecord)
            {
                string name = BattleManager.battleData.winnerID == TeamInfo.ENEMY_CAMP ? currentbattleData.replayEnemyName : currentbattleData.replayAttackerName;
                TextTipWindow.Show(LanguageConfigManager.Instance.getLanguage("Arena39", name));
                yield return(new WaitForSeconds(1.5f));
            }

            if (currentbattleData.isArenaFinal)
            {
                string name = BattleManager.battleData.winnerID == TeamInfo.ENEMY_CAMP ? currentbattleData.replayEnemyName : currentbattleData.replayAttackerName;
                TextTipWindow.ShowNotUnlock(LanguageConfigManager.Instance.getLanguage("Arena39", name));

                yield return(new WaitForSeconds(1.5f));
            }
            if (currentbattleData.isGodsWarFinal)
            {
                string name = BattleManager.battleData.winnerID == TeamInfo.ENEMY_CAMP ? currentbattleData.replayEnemyName : currentbattleData.replayAttackerName;
                TextTipWindow.ShowNotUnlock(LanguageConfigManager.Instance.getLanguage("Arena39", name));

                yield return(new WaitForSeconds(1.5f));
            }
            if (currentbattleData.isArenaMass)              //delay do
            {
                if (isWin)
                {
                    yield return(new WaitForSeconds(4f));
                }
                else
                {
                    yield return(new WaitForSeconds(4.5f));
                }
            }
            else if (currentbattleData.isLadders)
            {
                if (currentbattleData.isLaddersRecord)
                {
                    string name = BattleManager.battleData.winnerID == TeamInfo.ENEMY_CAMP ? currentbattleData.replayEnemyName : currentbattleData.replayAttackerName;
                    TextTipWindow.Show(LanguageConfigManager.Instance.getLanguage("Arena39", name));
                    yield return(new WaitForSeconds(1.5f));
                }
                else
                {
                    LaddersManagement.Instance.currentChallengeTimes++;
                    LaddersWindow lw = UiManager.Instance.getWindow <LaddersWindow> ();
                    lw.fightBack = true;
                    lw.fightWin  = isWin;

                    if (isWin)
                    {
                        yield return(new WaitForSeconds(4f));
                    }
                    else
                    {
                        yield return(new WaitForSeconds(4.5f));
                    }
                }
            }
            else if (currentbattleData.isGuildFight)
            {
                GuildAreaWindow areaWindow = UiManager.Instance.getWindow <GuildAreaWindow>();
                if (areaWindow != null)
                {
                    areaWindow.isWin       = isWin;
                    areaWindow.isFightBack = true;
                }
                if (isWin)
                {
                    yield return(new WaitForSeconds(2f));
                }
                else
                {
                    yield return(new WaitForSeconds(2.5f));
                }
            }
            else if (currentbattleData.isGuide)
            {
                yield return(new WaitForSeconds(4.5f));
            }
            else if (currentbattleData.isPractice)
            {
                yield return(new WaitForSeconds(4.5f));
            }
            //锁屏幕,防止出去后狂点ArenaAuditionsWindow的关闭按钮报错

            BattleManager.Instance.awardFinfish();
            yield break;
        }

        //世界首领输赢都出去
        if (WorldBossManagerment.Instance.isAttackBoss)
        {
            yield return(new WaitForSeconds(3f));

            hideOther();
            BattleManager.Instance.awardFinfish();
            yield break;
        }
        //if (BattleManager.battleData.winnerID != TeamInfo.ENEMY_CAMP&&MissionInfoManager.Instance.mission!=null) {
        //    if(MissionInfoManager.Instance.mission.getChapterType() == ChapterType.TOWER_FUBEN)
        //    {
        //        yield return new WaitForSeconds(3f);
        //        hideOther();
        //        BattleManager.Instance.awardFinfish();
        //        yield break;
        //    }
        //}

        //敌人胜利的话
        if (BattleManager.battleData.winnerID == TeamInfo.ENEMY_CAMP && !currentbattleData.isGodsWarGroupFight && !currentbattleData.isOneOnOneBossFight)          //诸神战小组赛失败了也有奖励

        {
            int chapterType = 0;
            if (MissionInfoManager.Instance.mission != null)
            {
                chapterType = MissionInfoManager.Instance.mission.getChapterType();
            }

            //讨伐失败了没奖励的,提前出去
            if (FuBenManagerment.Instance.isWarAttackBoss)
            {
                FuBenManagerment.Instance.isWarAttackBossWin = false;
                popBattleStrengItem();
                yield break;
            }
            if (FuBenManagerment.Instance.isWarActiveFuben)
            {
                FuBenManagerment.Instance.isWarActiveWin = false;
                popBattleStrengItem();
                yield break;
            }

            //公会首领,修炼
            if ((GuildManagerment.Instance.isGuildBattle || chapterType == ChapterType.PRACTICE) && !BattleManager.battleData.isHeroRoad)
            {
                if (BattleManager.battleData.isPvP == false)
                {
                    yield return(new WaitForSeconds(3f));

                    //非pvp输了没奖励提前走掉
                    hideOther();
                    BattleManager.Instance.awardFinfish();
                    yield break;
                }
            }
            if (MissionInfoManager.Instance.isTowerFuben() && !BattleManager.battleData.isHeroRoad)
            {
                yield return(new WaitForSeconds(3f));

                hideOther();
                BattleManager.Instance.awardFinfish();
                if (MissionInfoManager.Instance.isTowerFuben())                    //判断是爬塔副本
                {
                    UiManager.Instance.openDialogWindow <MessageWindow>((win) => { //弹出卡片全部阵亡提示
                        win.initWindow(1, LanguageConfigManager.Instance.getLanguage("ladderButton"), "", LanguageConfigManager.Instance.getLanguage("towerShowWindow06"), (msgHandle) => {
                            UiManager.Instance.missionMainWindow.outTowerFuBen();
                        });
                    });
                }
                yield break;
            }
            else
            {
                popBattleStrengItem();
                yield break;
            }

            //if (chapterType == ChapterType.TOWER_FUBEN) {
            //    UiManager.Instance.openDialogWindow<MessageWindow>((win) => {
            //        win.initWindow(1, LanguageConfigManager.Instance.getLanguage("ladderButton"), "", LanguageConfigManager.Instance.getLanguage("towerShowWindow06"), (msgHandle) => {
            //            UiManager.Instance.missionMainWindow.outTowerFuBen();
            //        });
            //    });
            //    yield break;
            //}else {
            //    popBattleStrengItem ();
            //    yield break;
            //}
        }
        if (BattleManager.battleData.isPractice)
        {
            BattleManager.Instance.awardFinfish();
            yield break;
        }


        //建立奖励管理
        AwardDisplayCtrl ctrl = BattleManager.Instance.gameObject.AddComponent <AwardDisplayCtrl> ();

        //英雄之章直接战斗
        if (HeroRoadManagerment.Instance.isCurrentDirectFight())
        {
            yield return(new WaitForSeconds(3f));

            ctrl.Initialize(BattleManager.Instance.battleAwards, AwardManagerment.FB_END);
            BattleManager.Instance.playerTeam.hideAllParter();
            BattleManager.Instance.enemyTeam.hideAllParter();
//			ArmyManager.Instance.unActiveArmy ();
            yield break;
        }

        if (BattleManager.battleData.isPvP)
        {
            ctrl.Initialize(BattleManager.Instance.battleAwards, AwardManagerment.PVP);
        }
        else if (BattleManager.battleData.isArenaMass)
        {
            ctrl.Initialize(BattleManager.Instance.battleAwards, AwardManagerment.ARENA);
        }
        else if (BattleManager.battleData.isGodsWarGroupAward)
        {
            ctrl.Initialize(BattleManager.Instance.battleAwards, AwardManagerment.AWARDS_GODSWAR_GROUP);
        }
        else
        {
            ctrl.Initialize(BattleManager.Instance.battleAwards, AwardManagerment.PVE);
        }


        //yield return new WaitForSeconds (0.3f);



        //星星
        if (!BattleManager.battleData.isPvP && MissionInfoManager.Instance.mission != null)
        {
            if (MissionInfoManager.Instance.mission.getChapterType() == ChapterType.STORY)
            {
                yield return(new WaitForSeconds(showStar()));
            }
        }

        BattleManager.Instance.enemyTeam.hideAllParter();
        if (!BattleManager.battleData.isOneOnOneBossFight)
        {
            BattleManager.Instance.playerExpAdd(ctrl.activeAward);
        }
        float waitTime = 1.5f;

        if (UserManager.Instance.self.getVipLevel() > 0)
        {
            waitTime += 0.3f;
        }


        yield return(new WaitForSeconds(waitTime));

        bool isHaveBeast = false;        //是否有女神上阵并获得经验
        bool isBeastLvUp = false;        //女神是否升级

        BattleManager.Instance.playerTeam.hideAllParter();
        CharacterData tempGuardianForce = BattleManager.Instance.playerTeam.GuardianForce;

        if (tempGuardianForce != null && !BattleManager.Instance.playerTeam.GuardianForce.role.isMaxLevel())
        {
            EXPAward expAward = BattleManager.Instance.getEXPAwardByStoreID(tempGuardianForce, ctrl.activeAward);
            if (expAward != null)
            {
                isHaveBeast = true;
                //召唤兽进场
                BattleManager.Instance.playerTeam.showGuardianForce();
                //召唤兽exp
                yield return(new WaitForSeconds(0.5f));

                if (BattleManager.Instance.GuardianForceExpAdd(tempGuardianForce, expAward))
                {
                    isBeastLvUp = true;
                }
            }
        }

        hideOther();
        yield return(new WaitForSeconds(isHaveBeast ? (isBeastLvUp ? 2.5f : 1.5f) : 0.5f));

        BattleManager.Instance.EffectCamera.gameObject.SetActive(false);

        //讨伐战斗胜利结束处理,提前出去,不然会走AwardDisplayCtrl的openNextWindow,造成闪窗口现象
        if (FuBenManagerment.Instance.isWarAttackBoss && BattleManager.battleData.winnerID == TeamInfo.OWN_CAMP)
        {
            //赢了需要打通副本
            FuBenManagerment.Instance.completeMission(MissionInfoManager.Instance.mission.sid, MissionInfoManager.Instance.mission.getChapterType(), MissionInfoManager.Instance.mission.starLevel);
            //赢了需要扣除次数
            FuBenManagerment.Instance.intoMission(MissionInfoManager.Instance.mission.sid, MissionInfoManager.Instance.mission.starLevel);
            FuBenManagerment.Instance.warWinAward = ctrl.award;

            BattleManager.Instance.awardFinfish();
            if (MissionManager.instance != null)
            {
                MissionManager.instance.missionClean();
            }
            MissionInfoManager.Instance.clearMission();
            yield break;
        }
        //活动副本战斗胜利结束处理,提前出去,不然会走AwardDisplayCtrl的openNextWindow,造成闪窗口现象
        if (FuBenManagerment.Instance.isWarActiveFuben && BattleManager.battleData.winnerID == TeamInfo.OWN_CAMP)
        {
            //赢了需要扣除次数
            FuBenManagerment.Instance.intoMission(MissionInfoManager.Instance.mission.sid, MissionInfoManager.Instance.mission.starLevel);
            FuBenManagerment.Instance.ActiveWinAward = ctrl.award;

            BattleManager.Instance.awardFinfish();
            if (MissionManager.instance != null)
            {
                MissionManager.instance.missionClean();
            }
            MissionInfoManager.Instance.clearMission();
            yield break;
        }

        ctrl.openNextWindow();

        if (ctrl.award == null || ctrl.award.Length == 0)
        {
            yield return(new WaitForSeconds(3f));
        }
    }
Beispiel #2
0
    public override void buttonEventBase(GameObject gameObj)
    {
        base.buttonEventBase(gameObj);
        string btnName = gameObj.name;

        if (btnName == "applyFriendButton")
        {
            //申请好友
            applyFriend();
        }
        else if (btnName == "deleteFriendButton")
        {
            //删除好友
            UiManager.Instance.createMessageWindowByTwoButton(LanguageConfigManager.Instance.getLanguage("s0379"), delFriend);
        }
        else if (btnName == "btn_challenge")
        {
            //挑战
            challengeLaddersPlayer();
        }
        else if (btnName == "btn_seekFriendHelp")
        {
            //请求好友帮助
            FriendInfo[] friends = FriendsManagerment.Instance.getFriendList();
            if (friends == null || friends.Length == 0)
            {
                MessageWindow.ShowAlert(Language("laddersTip_16"));
            }
            else
            {
                if (LaddersManagement.Instance.FriendCanHelp)
                {
                    UiManager.Instance.openWindow <LaddersFriendsWindow> ();
                }
                else
                {
                    Vip vip = VipManagerment.Instance.getVipbyLevel(UserManager.Instance.self.getVipLevel());
                    if (vip != null)
                    {
                        if (vip.privilege.ladderHelpTimes + LaddersManagement.Instance.TotalApplyFriendHelpTimes > LaddersManagement.Instance.currentFriendHelpTimes)
                        {
                            UiManager.Instance.openWindow <LaddersFriendsWindow>((win) =>
                            {
                                int costTimes = LaddersManagement.Instance.currentFriendHelpTimes - LaddersManagement.Instance.TotalApplyFriendHelpTimes + 1;
                                int cost      = CommonConfigSampleManager.Instance.getSampleBySid <LadderFriendsHelpCostSample>(CommonConfigSampleManager.LadderFriendsHelp_SID).getCostByCount(costTimes - 1);
                                //防止购买成功后没有进行战斗的情况(最大免费 + 已经购买 - 已经战斗的次数>0)
                                if (LaddersManagement.Instance.TotalApplyFriendHelpTimes + LaddersManagement.Instance.mBuyFriendFightCount - LaddersManagement.Instance.currentFriendHelpTimes > 0)
                                {
                                    cost = 0;
                                }
                                win.setCostInfo(cost, vip.privilege.ladderHelpTimes - (costTimes - 1), vip.privilege.ladderHelpTimes);
                            });
                        }
                        else
                        {
                            UiManager.Instance.openDialogWindow <MessageWindow>((win) =>
                            {
                                win.initWindow(2, LanguageConfigManager.Instance.getLanguage("recharge01"), LanguageConfigManager.Instance.getLanguage("s0093"),
                                               LanguageConfigManager.Instance.getLanguage("s015313"), (msgHandle) =>
                                {
                                    if (msgHandle.buttonID == MessageHandle.BUTTON_LEFT)
                                    {
                                        UiManager.Instance.openWindow <VipWindow>();
                                    }
                                });
                            });
                        }
                    }
                    else
                    {
                        UiManager.Instance.openDialogWindow <MessageWindow>((win) =>
                        {
                            win.initWindow(2, LanguageConfigManager.Instance.getLanguage("recharge01"), LanguageConfigManager.Instance.getLanguage("s0093"),
                                           LanguageConfigManager.Instance.getLanguage("s015314"), (msgHandle) =>
                            {
                                if (msgHandle.buttonID == MessageHandle.BUTTON_LEFT)
                                {
                                    UiManager.Instance.openWindow <VipWindow>();
                                }
                            });
                        });
                    }
                }
            }
        }
        else if (btnName == "GuildAreaChallenge")
        {
            if (fatherWindow is GuildAreaWindow)
            {
                GuildAreaWindow win = fatherWindow as GuildAreaWindow;
                win.challenge();
            }
        }
        else if (btnName == "close" || btnName == "btn_close")
        {
            //清理查看数据
            if (MissionManager.instance != null)
            {
                MissionManager.instance.showAll();
                MissionManager.instance.setBackGround();
            }
            ChatManagerment.Instance.chatCard = null;
            if (callback != null)
            {
                callback();
                callback = null;
            }
            if (fatherWindow is FriendsWindow)
            {
                finishWindow();
                if (FriendFindRecommendWindow.CACHE_LIST != null)
                {
                    UiManager.Instance.openDialogWindow <FriendFindRecommendWindow> ();
                }
//				if (isOperateFriend) {
//					EventDelegate.Add (OnHide, () => {
//						if (reLoadFriendWin != null) {
//							reLoadFriendWin (isOperateFriend);
//							reLoadFriendWin = null;
//						}
//					});
//				}
            }
            else if (fatherWindow is GuildMemberWindow)
            {
                finishWindow();
                GuildMemberWindow win = fatherWindow as GuildMemberWindow;
                win.updateMemberInfo();
            }
            else if (comeFrom == PvpPlayerWindow.FROM_CHAT)
            {
                finishWindow();

                /*这里开始是可滑动聊天窗口展示的关闭后处理,暂时不删
                 * UiManager.Instance.openDialogWindow<NewChatWindow> ((win) => {
                 *      win.initChatWindow (ChatManagerment.Instance.sendType - 1);
                 * });
                 */
            }
            else
            {
                finishWindow();
            }
            comeFrom = FROM_OTHER;
        }
    }