Exemple #1
0
        void GetColdWork(BattleSkillButton skillButton)
        {
            long         targetUID  = PlayerManager.Instance.FindHeroDataModel().UID;
            ColdWorkInfo myColdWork = ColdWorkManager.Instance.GetColdWorkInfo(targetUID, ColdWorkClass.Skill, (uint)skillButton.skillConfigData.m_skillId);

            if (myColdWork != null && myColdWork.lMasterID == targetUID)
            {
                int MpTake = GetSkillMpTake(skillButton.skillConfigData);
                if (MpTake == EmptyColdWork)
                {
                    return;
                }
                //int myMp = PlayerManager.Instance.FindHeroDataModel().UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_CURMP;
                float coldTime = myColdWork.ColdTimeEnd - Time.realtimeSinceStartup;
                //TraceUtil.Log(SystemModel.Common,TraceLevel.Error,"冷却技能:" + LanguageTextManager.GetString(childBtn.skillConfigData.m_name) + ",能否冷却:" + (myMp > MpTake)+",结束时间:" +myColdWork.ColdTimeEnd+ ",时间:"+myColdWork.ColdTime+"," + coldTime);
                //if (MpTake < myMp && coldTime > 0)
                //{
                if (coldTime != 0)
                {
                    skillButton.SetButtonStatus(SkillButtonStatus.Recovering);
                }
                skillButton.RecoverMyself((int)coldTime);
                //}
            }
        }
Exemple #2
0
    public bool SkillCanBeFire(UI.Battle.BattleSkillButton ButtonInstance)
    {
        if (IsDie || BattleManager.Instance.BlockPlayerToIdle)
        {
            return(false);
        }


        bool fireSkill = false;

        //10.24 ÐÂÔöÐޞġ£ÔÊÐíÔÚ±»»÷ÍË£¬»÷·ÉÇé¿öÏÂʹÓÃŒŒÄÜ
        fireSkill = (m_FSMSystem.CurrentStateID == StateID.PlayerBeAttacked &&
                     BeBeAttackBreakLV <= ButtonInstance.skillConfigData.m_breakLevel) ||
                    (m_FSMSystem.CurrentStateID == StateID.PlayerBeHitFly &&
                     BeHitFlyBreakLV <= ButtonInstance.skillConfigData.m_breakLevel);
        //TraceUtil.Log("Ê©·ÅŒŒÄÜ£º" + m_FSMSystem.CurrentStateID + " IsfireSkill:" + fireSkill);
        if (!fireSkill)
        {
            if (BreakSkillCheck(ButtonInstance.skillConfigData))
            {
                if (m_FSMSystem.CurrentStateID == StateID.PlayerNormalSkill ||
                    m_FSMSystem.CurrentStateID == StateID.PlayerInitiativeSkill ||
                    m_FSMSystem.CurrentStateID == StateID.PlayerIdle ||
                    m_FSMSystem.CurrentStateID == StateID.PlayerRun)
                {
                    fireSkill = true;
                }
            }
        }

        return(fireSkill);
    }
Exemple #3
0
 /// <summary>
 /// 设置等待状态的按钮为激活状态
 /// </summary>
 /// <param name="?"></param>
 public void SetWaitButtonEnable(BattleSkillButton battleSkillButton)
 {
     if (battleSkillButton != this && skillButtonStatus == SkillButtonStatus.Wait)
     {
         SetButtonStatus(SkillButtonStatus.Enable);
     }
 }
Exemple #4
0
 /// <summary>
 /// 设置所有等待状态的按钮为激活状态
 /// </summary>
 public void SetWaitBtnsEnable(BattleSkillButton battleSkillButton)
 {
     for (int i = 0; i < BattleButtons.Length; i++)
     {
         if (BattleButtons[i] != null)
         {
             BattleButtons[i].SetWaitButtonEnable(battleSkillButton);
         }
     }
     //BattleButtons.ApplyAllItem(P=>P.SetWaitButtonEnable(battleSkillButton));
 }
Exemple #5
0
    public void AddBattleButtonClickNumber(object obj)
    {
        //TraceUtil.Log("UpdateSkillBtnCLickNum");

        //这里之所以使用了判断是因为,普通的攻击做了特殊的处理
        UI.Battle.BattleSkillButton buttonInstance = obj as UI.Battle.BattleSkillButton;
        UI.Battle.SpecialSkillType  buttonType     = UI.Battle.SpecialSkillType.Normal;

        if (buttonInstance == null)
        {
            buttonType = (UI.Battle.SpecialSkillType)obj;
        }
        else
        {
            buttonType = buttonInstance.SpecialType;
        }

        switch (buttonType)
        {
        case UI.Battle.SpecialSkillType.Normal:
            ClickBtnInfoList[buttonInstance.MyBtnIndex]++;
            break;

        case UI.Battle.SpecialSkillType.NormalBtn:         // 普通攻击
            ClickBtnInfoList[4]++;
            break;

        case UI.Battle.SpecialSkillType.Roll:        //翻滚
            ClickBtnInfoList[5]++;
            break;

        case UI.Battle.SpecialSkillType.Explode:        //爆气
            ClickBtnInfoList[6]++;
            break;

        case UI.Battle.SpecialSkillType.Meaning:        //奥义
            ClickBtnInfoList[7]++;
            break;

        default:
            break;
        }
    }
Exemple #6
0
        public bool BattleSkillButtonCallBack(BattleSkillButton ButtonInstance)
        {
            string coroutineMethodName = "MultiSegmentComboTime" + ButtonInstance.MyBtnIndex;

            StopCoroutine(coroutineMethodName);
            bool flag = PlayerManager.Instance.FindHero().GetComponent <PlayerBehaviour> ().OnButtonCallBack(ButtonInstance);

            //Debug.Log("Fire at:"+Time.realtimeSinceStartup+"  "+ flag);
            if (flag)
            {
                SetButtonAttribute(ButtonInstance.MyBtnIndex);
                //CD
                GetColdWork(ButtonInstance);
                if (ComboBattleButton [ButtonInstance.MyBtnIndex].CurrentIndex != 1)
                {
                    StartCoroutine(coroutineMethodName);
                }
            }
            return(flag);
        }
Exemple #7
0
    /// <summary>
    /// ŒŒÄÜÀžµã»÷»Øµ÷ŽŠÀí
    /// </summary>
    /// <param name="ButtonInstance"></param>
    public bool OnButtonCallBack(UI.Battle.BattleSkillButton ButtonInstance)
    {
        //按钮记忆处理
        //var clickBtn = ButtonInstance.GetComponent<SkillBtnRemember>();
        //if (clickBtn != null)
        //{
        //    clickBtn.OnSkillBtnClicked(fireSkill);
        //}
        var fireSkill = SkillCanBeFire(ButtonInstance);

        if (fireSkill)
        {
            switch (ButtonInstance.skillButtonStatus)
            {
            case SkillButtonStatus.Enable:
                //²»žÄ±äµ±Ç°ŒŒÄÜ£¬»ºŽæÑ¡ÔñµÄŒŒÄÜ¡£ÔÚÖ÷¶¯ŒŒÄÜÊ©·ÅʱÓÃGetSkillBySkillID·œ·šžÄ±äÒ»ÏÂÍæŒÒµ±Ç°ŒŒÄÜ
                //GetSkillBySkillID(ButtonInstance.skillConfigData.m_skillId);
                UIEventManager.Instance.TriggerUIEvent(UIEventType.AddAPMNumber, null);
                UIEventManager.Instance.TriggerUIEvent(UIEventType.AddBattleButtonClickNumber, ButtonInstance);
                this.m_nextSkillID = ButtonInstance.skillConfigData.m_skillId;
                var prepareSkill = m_skills.SingleOrDefault(P => P.SkillId == this.m_nextSkillID);

                if (prepareSkill != null)
                {
                    prepareSkill.AddSkillStateChangeDelegate(OnTransation);
                    prepareSkill.PrePare();

                    if (!GameManager.Instance.m_gameSettings.DoubleClickSkill)
                    {
                        switch (ButtonInstance.skillConfigData.m_directionParam)
                        {
                        case 1:                                                                                                          //·œÏòÐÍ
                            var position1 = transform.TransformPoint(Vector3.forward * ButtonInstance.skillConfigData.m_launchRange[0]); //°ÑœÇÉ«ÕýÇ°·œŸàÀ댌ÄÜÊÍ·Å·¶Î§Î»ÖÃ×÷Ϊʩ·Åµã
                            m_initiativeSkillSelectedState.ChangeState(position1, TouchPhase.Began);
                            m_initiativeSkillSelectedState.ChangeState(position1, TouchPhase.Ended);
                            break;

                        case 2:                                                                                                                 //·¶Î§
                            var position2 = transform.TransformPoint(Vector3.forward * ButtonInstance.skillConfigData.m_launchRange[0] * 0.5f); //°ÑœÇÉ«ÕýÇ°·œŸàÀ댌ÄÜÊÍ·Å·¶Î§Î»ÖÃ×÷Ϊʩ·Åµã
                            m_initiativeSkillSelectedState.ChangeState(position2, TouchPhase.Began);
                            m_initiativeSkillSelectedState.ChangeState(position2, TouchPhase.Ended);
                            break;
                        }
                    }
                }
                break;

            case SkillButtonStatus.Wait:
                //Èç¹ûœÇÉ«ÕýÔÚŒŒÄÜÑ¡ÔñÖС£ÔòÅжόŒÄÜÀàÐÍ£¬ÈçÊÇ·œÏòÐÍ£¬Ôò³¯œÇÉ«ÕýÇ°·œÊ©·Å¡£
                //Èç¹ûÊÇ·¶Î§ÐÍ£¬Ôò......
                if (GameManager.Instance.m_gameSettings.DoubleClickSkill && ExecuteInitiativeSkillSelectedState == true)
                {
                    UIEventManager.Instance.TriggerUIEvent(UIEventType.AddAPMNumber, null);
                    UIEventManager.Instance.TriggerUIEvent(UIEventType.AddBattleButtonClickNumber, ButtonInstance);
                    switch (ButtonInstance.skillConfigData.m_directionParam)
                    {
                    case 1:                                                                                                          //·œÏòÐÍ
                        var position1 = transform.TransformPoint(Vector3.forward * ButtonInstance.skillConfigData.m_launchRange[0]); //°ÑœÇÉ«ÕýÇ°·œŸàÀ댌ÄÜÊÍ·Å·¶Î§Î»ÖÃ×÷Ϊʩ·Åµã
                        m_initiativeSkillSelectedState.ChangeState(position1, TouchPhase.Began);
                        m_initiativeSkillSelectedState.ChangeState(position1, TouchPhase.Ended);
                        break;

                    case 2:                                                                                                                 //·¶Î§
                        var position2 = transform.TransformPoint(Vector3.forward * ButtonInstance.skillConfigData.m_launchRange[0] * 0.5f); //°ÑœÇÉ«ÕýÇ°·œŸàÀ댌ÄÜÊÍ·Å·¶Î§Î»ÖÃ×÷Ϊʩ·Åµã
                        m_initiativeSkillSelectedState.ChangeState(position2, TouchPhase.Began);
                        m_initiativeSkillSelectedState.ChangeState(position2, TouchPhase.Ended);
                        break;
                    }
                }
                break;
            }
        }

        return(fireSkill);
    }