///
    /// 判定是否为第16关的boss 属性克制
    ///
    bool isGuide16Floor(Item curItem, BanBattleManager battleMgr)
    {
        bool     found = false;
        NewFloor floor = Core.Data.newDungeonsManager.curFightingFloor;

        if (floor != null && floor.config.ID == 60116)
        {
            BanBattleRole curBattleRole = battleMgr.GetBattleRole(curItem.defenseIndex);
            if (curBattleRole != null)
            {
                if (curBattleRole.isBoss == (short)1)
                {
                    if (curItem.period == Period.AttributeConflict)
                    {
                        AccountConfigManager accMgr = Core.Data.AccountMgr;

                        if (accMgr.UserConfig.ShengWuZhe == (short)0)
                        {
                            ConsoleEx.DebugLog("isGuide16Floor is going", ConsoleEx.RED);

                            accMgr.UserConfig.ShengWuZhe = 1;
                            accMgr.save();

                            found = true;
                        }
                    }
                }
            }
        }

        return(found);
    }
예제 #2
0
    public void OnGiveUp()
    {
        if (hasClick)
        {
            return;
        }
        hasClick = true;
        ///
        /// 跳过战斗的播放动画
        ///
        Core.Data.temper.SkipBattle    = true;
        BanBattleProcess.Instance.skip = true;
        ///
        /// 保存战斗的速度状态
        ///
        BanBattleManager battleMgr = BanBattleManager.Instance;

        battleMgr.SpeedOrSkipMgr.SpeedUpAndAutoSave();
        battleMgr.attackSideInfo.CancelInvoke();
        ///
        ///战斗暂停已结束
        ///
        TimeMgr.getInstance().WarPause = false;
        TimeMgr.getInstance().setBaseLine(1f);
        StopAllCoroutines();
        AsyncTask.RemoveAllDelayedWork();
        SettleBossBattle();
        updatePlayerLv();

        Core.SM.beforeLoadLevel(SceneName.GAME_BATTLE, SceneName.MAINUI);
        AsyncLoadScene.m_Instance.LoadScene(SceneName.MAINUI);
        Core.Data.temper.WarErrorCode = -1;
    }
    public bool FeatureWar_Cast(BoxCollider collider, float manualHeight)
    {
        //用来判断是否为特殊步骤
        bool             over      = true;
        BanBattleManager battleMgr = BanBattleManager.Instance;

        if (curStep == GuideStep.XiaoWuKong_OverSkill1)
        {
            Object obj = PrefabLoader.loadFromUnPack("Ban/AngryGuide", false);
            castGuide = Instantiate(obj) as GameObject;
            RED.AddChild(castGuide, BanBattleManager.Instance.AngryPos);
            castGuide.transform.localPosition = new Vector3(0f, 11f, 0f);
            //走到这一步
            curStep = GuideStep.XiaoWuKong_Cast_Overskill;
            //小悟空的怒气技要把按钮暴露出来
            StartCoroutine(turnAngryBtn());

            //设定Boxcollider的位置
            collider.center = new Vector3(-424f, FitScreen(-198f, manualHeight), 0);
            collider.size   = new Vector3(160f, 160f, 0);

            over = false;
            now  = Time.realtimeSinceStartup;
        }
        else if (curStep == GuideStep.XiaoWuKong_Cast_Overskill)
        {
            ///
            /// --- 为了防止用户的快速点击操作 -----
            ///
            float cur   = Time.realtimeSinceStartup;
            float delta = cur - now;
            if (delta <= 1)
            {
                return(false);
            }

            if (castGuide != null)
            {
                Destroy(castGuide);
            }
            Time.timeScale = 1.0f;

            BanSideInfo attside = battleMgr.attackSideInfo;
            attside.PlayerAngryWord.FeatureWarShow(1, string.Empty, () => { battleMgr.AngryUI(false, null, -1); });
            attside.angrySlot.curAP = 0;

            //走到这一步
            curStep = GuideStep.XiaoWuKong_Cast_Over;
            //设定Boxcollider的位置
            collider.center = Vector3.zero;
            collider.size   = new Vector3(1600f, 1200f, 0);

            over = false;

            StartCoroutine(battleMgr.getGuideUI.Guide_DX());
        }

        return(over);
    }
    //小悟空的怒气技要把按钮暴露出来
    IEnumerator turnAngryBtn()
    {
        BanBattleManager battleMgr = BanBattleManager.Instance;

        Time.timeScale = 1.0f;
        yield return(new WaitForSeconds(0.1f));

        SkillData sd = Core.Data.skillManager.getSkillDataConfig(25037);

        battleMgr.AngryUI(true, sd, 1);
        Invoke("stopAgain", 0.6f);
    }
 void showLevel16(Item curItem, BanBattleManager battleMgr)
 {
     if (isGuide16Floor(curItem, battleMgr))
     {
         AsyncTask.QueueOnMainThread(() => {
             StartCoroutine(battleMgr.getGuideUI.Guide_Level16());
         },
                             #if NewGuide
                                     0.45f);
                             #else
                                     0.85f);
                             #endif
     }
 }
    /// <summary>
    /// 新手引导第一关
    /// </summary>

    IEnumerator showLevel1(Item curItem, BanBattleManager battleMgr, GuideManager mgr, TemporyData temp)
    {
        NewFloor floor = Core.Data.newDungeonsManager.curFightingFloor;

                #if NewGuide
        if (floor != null && floor.config.ID == 60103 && mgr.isGuiding)
        {
                #else
        if (floor != null && floor.config.ID == 60101 && mgr.isGuiding)
        {
                #endif
            if (isGuideLevel1(curItem, battleMgr))
            {
                SkillData sd = Core.Data.skillManager.getSkillDataConfig(25037);
                battleMgr.AngryUI(true, sd, 1);
                yield return(new WaitForSeconds(BanTimeCenter.XiaoWuKong_Level1));

                Time.timeScale = 0.0f;
                mgr.AutoRUN();
            }
        }
    }

    bool isGuideLevel1(Item curItem, BanBattleManager battleMgr)
    {
        bool guide  = false;
        int  attNum = battleMgr.GetBattleRole(curItem.attackIndex).number;
        int  defNum = battleMgr.GetBattleRole(curItem.defenseIndex).number;

                #if NewGuide
        if (attNum == 10142 && defNum == 10172)
        {
                #else
        if (attNum == 10142 && defNum == 10175)
        {
                #endif
            if (curItem.period == Period.AngrySkillReady)
            {
                guide   = true;
                curStep = GuideStep.XiaoWuKong_OS_1;
                ConsoleEx.DebugLog("isGuideLevel1 is going", ConsoleEx.RED);
            }
        }

        return(guide);
    }

    #endregion
}
    //孙悟空3释放终结技能
    bool isGuide_5(Item curItem, BanBattleManager battleMgr)
    {
        bool guide  = false;
        int  attNum = battleMgr.GetBattleRole(curItem.attackIndex).number;
        int  defNum = battleMgr.GetBattleRole(curItem.defenseIndex).number;

        if (attNum == 10218 && defNum == 10104 && curItem.period == Period.AngrySkill)
        {
            guide   = true;
            curStep = GuideStep.WuKong3_OS_4;
            ConsoleEx.DebugLog("isGuide_5 is going", ConsoleEx.RED);
        }

        return(guide);
    }
    //孙悟空2继承小悟空20怒气
    bool isGuide_3(Item curItem, BanBattleManager battleMgr)
    {
        bool guide  = false;
        int  attNum = battleMgr.GetBattleRole(curItem.attackIndex).number;
        int  defNum = battleMgr.GetBattleRole(curItem.defenseIndex).number;

        if (attNum == 10107 && defNum == 10105 && curItem.period == Period.Attend)
        {
            guide   = true;
            curStep = GuideStep.WuKong2_Anger;
            ConsoleEx.DebugLog("isGuide_3 is going", ConsoleEx.RED);
        }

        return(guide);
    }
    //战斗新手引导的第。。。版本
    IEnumerator showGuideXX(Item curItem, BanBattleManager battleMgr)
    {
        GuideManager mgr  = Core.Data.guideManger;
        TemporyData  temp = Core.Data.temper;

        if (temp.currentBattleType == TemporyData.BattleType.FightWithFulisa)
        {
            yield return(StartCoroutine(FeatureWar(curItem, battleMgr)));
        }
        else if (temp.currentBattleType == TemporyData.BattleType.BossBattle)
        {
            StartCoroutine(showLevel1(curItem, battleMgr, mgr, temp));
            showLevel16(curItem, battleMgr);
        }
    }
예제 #10
0
    public void ReleaseADestory()
    {
//		if(Root != null) {
//			Root.dealloc();
//			Root = null;
//		}

        if (main3DManager != null)
        {
            Destroy(main3DManager.gameObject);
            main3DManager = null;
        }

        base.dealloc();
        Instance = null;
        Destroy(this.gameObject);
    }
    void showGuideX(Item curItem, BanBattleManager battleMgr)
    {
        GuideManager mgr  = Core.Data.guideManger;
        TemporyData  temp = Core.Data.temper;

        if (mgr.isGuiding)
        {
            if (temp.currentBattleType == TemporyData.BattleType.FightWithFulisa)
            {
                StartCoroutine(showFeatureWar(curItem, battleMgr, mgr));
            }
            else if (temp.currentBattleType == TemporyData.BattleType.BossBattle)
            {
                StartCoroutine(showLevel1(curItem, battleMgr, mgr, temp));
            }
        }
    }
    //对决的新手引导
    bool isGuide_8(Item curItem, BanBattleManager battleMgr)
    {
        bool guide  = false;
        int  attNum = battleMgr.GetBattleRole(curItem.attackIndex).number;

        if (attNum == 10218 && curItem.defenseIndex == 6)
        {
            if (curItem.period == Period.NormalAttack)
            {
                guide   = true;
                curStep = GuideStep.WuKong3_Vs_BILUSI;
                ConsoleEx.DebugLog("isGuide_7 is going", ConsoleEx.RED);
            }
        }

        return(guide);
    }
    //比鲁斯
    bool isGuide_6(Item curItem, BanBattleManager battleMgr)
    {
        bool guide  = false;
        int  attNum = battleMgr.GetBattleRole(curItem.attackIndex).number;

        if (attNum == 10218 && curItem.defenseIndex == 6)
        {
            if (curItem.period == Period.AttributeConflict)
            {
                guide   = true;
                curStep = GuideStep.BILUSI_V_WuKong3;
                ConsoleEx.DebugLog("isGuide_6 is going", ConsoleEx.RED);
            }
        }

        return(guide);
    }
예제 #14
0
    //在右边死亡
    void dropBallEx()
    {
        BanBattleManager battleMgr = BanBattleManager.Instance;

        if (battleMgr != null)
        {
            bool drop = battleMgr.dropOneBall(AttCombo);
            AttCombo = 0;             // clear cache
            if (drop)
            {
                CRLuo_PlayAnim_FX Suffer = battleMgr.main3DManager.Man_R;
                if (Suffer != null)
                {
                    dropBallAnim(Suffer.gameObject, false);
                }
            }
        }
    }
    //小悟空克制比克大魔王
    bool isGuide_1(Item curItem, BanBattleManager battleMgr)
    {
        bool guide  = false;
        int  attNum = battleMgr.GetBattleRole(curItem.attackIndex).number;
        int  defNum = battleMgr.GetBattleRole(curItem.defenseIndex).number;

        if (attNum == 10142 && defNum == 10193)
        {
            if (curItem.period == Period.AttributeConflict)
            {
                guide   = true;
                curStep = GuideStep.XiaoWuKong_V_BiKe;
                ConsoleEx.DebugLog("isGuide_1 is going", ConsoleEx.RED);
            }
        }

        return(guide);
    }
    //新版本未来之战的新手引导的逻辑
    IEnumerator FeatureWar(Item curItem, BanBattleManager battleMgr)
    {
        int attNum = battleMgr.GetBattleRole(curItem.attackIndex).number;
        int defNum = battleMgr.GetBattleRole(curItem.defenseIndex).number;

        //克制阶段
        if (isGuide_9(curItem, attNum, defNum))
        {
            yield return(StartCoroutine(battleMgr.getGuideUI.Guide_9()));

            AsyncTask.QueueOnMainThread(() => {
                StartCoroutine(battleMgr.getGuideUI.Guide_A());
            }, 1.2f);
        }

        //怒气阶段
        if (isGuide_B(curItem, attNum, defNum))
        {
            yield return(StartCoroutine(battleMgr.getGuideUI.Guide_B()));

            StartCoroutine(battleMgr.getGuideUI.Guide_C());
        }

        //普通技能阶段
        if (isGuide_D(curItem, attNum, defNum))
        {
            yield return(StartCoroutine(battleMgr.getGuideUI.Guide_D()));

            AsyncTask.QueueOnMainThread(() => {
                StartCoroutine(battleMgr.getGuideUI.Guide_E());
            }, 0.05f);
        }

        //对决阶段
        if (isGuide_F(curItem, attNum, defNum))
        {
            yield return(StartCoroutine(battleMgr.getGuideUI.Guide_F()));

            StartCoroutine(battleMgr.getGuideUI.Guide_10());
        }

        yield return(null);
    }
예제 #17
0
    public void showCoin()
    {
        if (OverSkill_Appear)
        {
            BanBattleManager battleMgr = BanBattleManager.Instance;
            if (battleMgr != null)
            {
                CRLuo_PlayAnim_FX Suffer = battleMgr.main3DManager.Man_R;

                if (Suffer != null)
                {
                    GameObject coin = getDropCoin(Count);
                    coin.SetActive(true);
                    RED.AddChild(coin, Suffer.gameObject);
                    float hight = Suffer.mainMeshRender.renderer.bounds.extents.y + Suffer.mainMeshRender.renderer.bounds.center.y;
                    coin.transform.localPosition = new Vector3(0f, hight, 0f);
                    Core.Data.soundManager.SoundFxPlay(SoundFx.FX_BrokeGold);
                }
            }
        }
    }
    /// <summary>
    /// 未来之战的引导
    /// </summary>

    IEnumerator showFeatureWar(Item curItem, BanBattleManager battleMgr, GuideManager mgr)
    {
        if (isGuide_1(curItem, battleMgr))
        {
            yield return(new WaitForSeconds(BanTimeCenter.XiaoWuKong_V_BiKe));

            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }

        if (isGuide_2(curItem, battleMgr))
        {
            //小悟空的怒气技要把按钮暴露出来
            SkillData sd = Core.Data.skillManager.getSkillDataConfig(25037);
            battleMgr.AngryUI(true, sd, 4);
            yield return(new WaitForSeconds(BanTimeCenter.XiaoWuKong_OS_4));

            mgr.AutoRUN();
            yield return(new WaitForSeconds(1F));

            Time.timeScale = 0.0f;
        }

        if (isGuide_3(curItem, battleMgr))
        {
            yield return(new WaitForSeconds(BanTimeCenter.WuKong2_Anger));

            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }

        if (isGuide_4(curItem, battleMgr))
        {
            //悟空2的怒气技要把按钮暴露出来
            SkillData sd = Core.Data.skillManager.getSkillDataConfig(25037);
            battleMgr.AngryUI(true, sd, 4);
            yield return(new WaitForSeconds(BanTimeCenter.XiaoWuKong_OS_4));

            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }

        if (isGuide_5(curItem, battleMgr))
        {
            //悟空3的怒气技要把按钮暴露出来
            SkillData sd = Core.Data.skillManager.getSkillDataConfig(25058);
            battleMgr.AngryUI(true, sd, 4);
            yield return(new WaitForSeconds(BanTimeCenter.XiaoWuKong_OS_4));

            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }

        if (isGuide_6(curItem, battleMgr))
        {
            yield return(new WaitForSeconds(BanTimeCenter.BILUSI_V_WuKong3));

            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }

        //没有怒气值不能释放主动技能
        if (isGuide_7(curItem, battleMgr))
        {
            yield return(new WaitForSeconds(BanTimeCenter.WuKong3_NO_ANGER));

            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }

        //超级孙悟空3对决比鲁斯
        if (isGuide_8(curItem, battleMgr))
        {
            Time.timeScale = 0.0f;
            mgr.AutoRUN();
        }
    }
예제 #19
0
    protected override void OnEvent(EventTypeDefine p_e, object p_param)
    {
        ConsoleEx.DebugLog("EventType = " + p_e.ToString(), ConsoleEx.YELLOW);
        BanBattleManager battleMgr = BanBattleManager.Instance;
        BanSideInfo      attside   = battleMgr != null ? battleMgr.attackSideInfo : null;
        GuideManager     guideMgr  = Core.Data.guideManger;

#if NewGuide
        NewUIGuide guideUI = NewUIGuide.Instance;
#else
        UIGuide guideUI = UIGuide.Instance;
#endif
        TemporyData temp = Core.Data.temper;

        switch (p_e)
        {
        //打开第一个宝箱
        case EventTypeDefine.OpenTreasureChest:
            if (Open != null)
            {
                GuideData data = p_param as GuideData;
                if (data != null)
                {
                    Open(data.MultiIndex);
                    Core.Data.guideManger.DelayAutoRun(1.5f);
                }
            }
            break;

        //退出战斗
        case EventTypeDefine.ExitFightingScene:
            if (Exit != null)
            {
                AsyncTask.QueueOnMainThread(
                    () => {
                    Exit();
                    #region Add by jc 如果没有升级并且已经是最后一步引导了
                    if (Core.Data.playerManager.Lv <= temp.mPreLevel && temp.mPreLevel > 0 && !guideMgr.isLastOfCurGuide)
                    {
                        guideUI.HideGuide();
                        Core.Data.guideManger.DelayAutoRun(2.5f);
                    }
                    #endregion
                }
                    , 0.5f
                    );
            }
            break;

        case EventTypeDefine.Click_XiaoWuKongVBiKe:                       //显示双方队伍
        case EventTypeDefine.Click_WuKong2_Anger:                         //孙悟空2继承小悟空20怒气
        case EventTypeDefine.Click_BILUSI_V_WuKong3:                      //比鲁斯
        case EventTypeDefine.Click_WuKong3_NO_ANGER:                      //没有怒气值不能释放主动技能
        case EventTypeDefine.Click_WuKong3_Vs_BiLu:                       //孙悟空3对决比鲁斯
            guideUI.HideGuide();
            Time.timeScale = 1.0f;
            break;

            #region 怒气技的起始阶段
        case EventTypeDefine.Click_XiaoWuKong_OS_4: {
            Time.timeScale = 1.0f;
            SkillData sd = Core.Data.skillManager.getSkillDataConfig(25037);
            attside.PlayerAngryWord.FeatureWarShow(1, sd.name, () => { Time.timeScale = 0f; });
        }
        break;

        case EventTypeDefine.Click_WuKong2_OS_4: {
            Time.timeScale = 1.0f;
            SkillData sd = Core.Data.skillManager.getSkillDataConfig(25008);
            attside.PlayerAngryWord.FeatureWarShow(1, sd.name, () => { Time.timeScale = 0f; });
        }
        break;

        case EventTypeDefine.Click_WuKong3_OS_4: {
            Time.timeScale = 1.0f;
            SkillData sd = Core.Data.skillManager.getSkillDataConfig(25058);
            attside.PlayerAngryWord.FeatureWarShow(1, sd.name, () => { Time.timeScale = 0f; });
        }
        break;
            #endregion

        case EventTypeDefine.Click_XiaoWuKong_OS_4_2:
            Time.timeScale = 1.0f;
            attside.PlayerAngryWord.FeatureWarShow(2, string.Empty, () => { Time.timeScale = 0f; });
            break;

        case EventTypeDefine.Click_XiaoWuKong_OS_4_3:
            Time.timeScale = 1.0f;
            attside.PlayerAngryWord.FeatureWarShow(3, string.Empty, () => { Time.timeScale = 0f; });
            break;

        case EventTypeDefine.Click_XiaoWuKong_OS_4_4:
            Time.timeScale = 1.0f;
            guideUI.HideGuide();
            AsyncTask.RemoveAllDelayedWork();
            attside.PlayerAngryWord.FeatureWarShow(4, string.Empty, () => { battleMgr.AngryUI(false, null, -1); });

            long      now  = Core.TimerEng.curTime;
            TimerTask task = new TimerTask(now, now + 2, 1, ThreadType.MainThread);
            task.onEventEnd = (t) => {
                Time.timeScale = 1.0f;
                AsyncTask.RemoveAllDelayedWork();
                battleMgr.AngryUI(false, null, -1);
            };
            task.DispatchToRealHandler();
            break;

        case EventTypeDefine.Click_XiaoWuKong_Lv1: {
            Time.timeScale = 1.0f;
            guideUI.HideGuide();
            AsyncTask.RemoveAllDelayedWork();

            attside.PlayerAngryWord.FeatureWarShow(1, string.Empty, () => { battleMgr.AngryUI(false, null, -1); });
            attside.angrySlot.curAP = 0;
            battleMgr.Root.Camera1.eventReceiverMask = LayerMask.NameToLayer("Everything");
        }
        break;

        //调用武者强化
        case EventTypeDefine.Click_JumpToStrengthening:
            if (Exit != null)
            {
                UIGuide.Instance.HideGuide();

                Core.Data.guideManger.DelayAutoRun(2f);
                // --- 武者强化 ---
                FinalTrialMgr.GetInstance().jumpTo = TrialEnum.None;
                BattleToUIInfo.From = RUIType.EMViewState.S_Team_NoSelect;
                Exit();
            }

            break;
        }
    }
예제 #20
0
    void Awake()
    {
        Instance = this;
        CityFloorData.Instance.isCanClick = true;

        TemporyData temp = Core.Data.temper;

        float ratio = Screen.width / (Screen.height * 1.0f);

        if (Mathf.Approximately(ratio, Consts._16Bi9))
        {
            go_WinOrLosePos.transform.localPosition = new Vector3(0f, 20f, 0f);
        }
        else if (Mathf.Approximately(ratio, Consts._4Bi3))
        {
            go_WinOrLosePos.transform.localPosition = new Vector3(0f, 110f, 0f);
        }
        else
        {
            go_WinOrLosePos.transform.localPosition = new Vector3(0f, 30f, 0f);
        }


        ///
        ///  --- 跳过功能和暂停功能 ---
        ///  PVE 只能有暂停功能
        ///  PVP 只能有跳过功能
        ///

        //初始化战斗数据
        if (KindOfWar == AnyWar.PVE)
        {
            //新手引导的时候不出现暂停按钮
            if (Core.Data.guideManger.isGuiding)
            {
                PauseGo.SetActive(false);
                SpeedUpGo.SetActive(false);
                AutoGo.SetActive(false);
            }
            else
            {
                PauseGo.SetActive(true);
                SpeedUpGo.SetActive(true);
                AutoGo.SetActive(true);
            }

            if (temp.currentBattleType == TemporyData.BattleType.FightWithFulisa)
            {
                PauseGo.SetActive(false);
                SpeedUpGo.SetActive(false);
                AutoGo.SetActive(false);
            }

            SkipGo.SetActive(false);

            if (temp.clientDataResp != null && temp.clientDataResp.data != null && temp.clientDataResp.data.warInfo != null)
            {
                War = new BT_Logical(temp.clientDataResp.data.warInfo);
                if (War.LocalMode)
                {
                    if (War.StepMode)
                    {
                        War.startWarOfWarBegin();

                        War.RegisterLogicalCmp(ReadFromLocal);
                    }
                    else
                    {
                        War.startWar();
                        War.EndWar();
                    }
                }
            }
        }
        else             // is a PVP war

        {
            PauseGo.SetActive(false);
            SpeedUpGo.SetActive(false);
            AutoGo.SetActive(false);
            //新手引导不应该有跳过
            if (Core.Data.guideManger.isGuiding)
            {
                SkipGo.SetActive(false);
            }
            else
            {
                SkipGo.SetActive(true);
            }

            //世界战斗 也应该出现怒气技能释放的按钮
            if (temp.currentBattleType == TemporyData.BattleType.WorldBossWar)
            {
                attackSideInfo.PlayerAngryBtn.gameObject.SetActive(false);
            }
        }

        //展示3D场景
        show3DScene();

        //一场战斗连击数的统计
        temp.hasLiquidate         = false;
        temp.SkipBattle           = false;
        temp.GiveUpBattle         = false;
        temp.ForceWriteCombo      = 0;
        main3DManager.NotifyCombo = (combo) => { hitCCMgr.RecordCombo(combo); };

        KilledEnemyArray = new List <int>();

        AutoJustice();

        //重置时间的管理器
        TimeMgr.getInstance().Reset();
    }