Example #1
0
        public void RunCD(bool bRun)
        {
            EndInvoke(0);
            EndInvoke(1);
            if (bRun)
            {
                SkillDataWhole skillDataWhole;

                _lstCD.Clear();
                _lstCDRemain.Clear();
                _lstWaitSkill.Clear();

                for (int i = 0; i < 2; ++i)
                {
                    int skillId = _charHandler.m_CharData.SkillIDs[i + 1];
                    if (0 != skillId)
                    {
                        skillDataWhole = SkillHandler.GetInst().GetSkillDataByID(skillId);
                        _lstCD.Add(skillDataWhole.m_iCDTime);
                        _lstCDRemain.Add(skillDataWhole.m_iCDTime + 1);                         //加1的原因是cd首次就进行-1操作
                        BeginInvoke(i);
                    }
                }
            }

            //if(_charHandler == BattleCam.GetInst().m_CharHandler)    //被动复活刷新UI冷却显示
            //	Fightbar.GetInst().SetCDShow();
        }
Example #2
0
        public void ToSkillWithoutCheck(int skillId)
        {
            SkillDataWhole skillDataWhole = SkillHandler.GetInst().GetSkillDataByID(skillId);

            if (CheckMP(skillDataWhole, false))
            {
                _ToSkill(skillDataWhole);
            }
        }
Example #3
0
        public void InitTriggerSkill()
        {
            ClearTriggerDic();
            SkillDataWhole skillDataWhole;

            int[] skillIDs = _charHandler.m_CharData.SkillIDs;
            for (int i = 1; i < skillIDs.Length; ++i)
            {
                if (0 == skillIDs[i])
                {
                    break;
                }

                skillDataWhole = SkillHandler.GetInst().GetSkillDataByID(skillIDs[i]);
                switch (skillDataWhole.m_eTriggerType)
                {
                case SkillEnum.TriggerType.BattleStart:
                    _lstSecTrigger.Add(skillIDs[i]);
                    BattleManager.GetInst().AddBattleSecTrigger(skillDataWhole.m_iTriggerParam, _charHandler);
                    break;

                case SkillEnum.TriggerType.AimHeroBorn:
                    _lstFinalTrigger.Add(skillIDs[i]);
                    BattleManager.GetInst().AddFinalEnemyTrigger(skillDataWhole.m_iTriggerParam, _charHandler);
                    break;

                case SkillEnum.TriggerType.SelfCurHP:
                    _lstHpTriggerSelf.Add(skillIDs[i]);
                    BattleManager.GetInst().AddHPTrigger(skillDataWhole.m_iTriggerParam, _charHandler, SkillEnum.TriggerType.SelfCurHP);
                    break;

                case SkillEnum.TriggerType.AimCurHP:
                    _lstHpTriggerOppo.Add(skillIDs[i]);
                    BattleManager.GetInst().AddHPTrigger(skillDataWhole.m_iTriggerParam, _charHandler, SkillEnum.TriggerType.AimCurHP);
                    break;

                case SkillEnum.TriggerType.SelfOtherDie:
                    _iDeadTriggerSelf = skillIDs[i];
                    BattleManager.GetInst().AddDeadTrigger(_charHandler);
                    break;

                case SkillEnum.TriggerType.SelfDie:
                    SelfDieSkillID = skillIDs[i];
                    break;

                case SkillEnum.TriggerType.MainSkill:
                    MainTriggerSkillID = skillIDs[i];
                    break;

                default:
                    break;
                }
            }
        }
Example #4
0
        public void ReleaseSkill(int skillId)
        {
            if (!CheckCanDo(skillId, false))
            {
                return;
            }

            SkillDataWhole skillDataWhole = SkillHandler.GetInst().GetSkillDataByID(skillId);

            _ToSkill(skillDataWhole);
        }
Example #5
0
        public void HPTriggerAim(int hpPercent, CharHandler charHandler)
        {
            int skillId;

            for (int i = _lstHpTriggerOppo.Count - 1; i >= 0; --i)
            {
                skillId = _lstHpTriggerOppo[i];
                if (hpPercent < SkillHandler.GetInst().GetSkillDataByID(skillId).m_iTriggerParam)
                {
                    _lstHpTriggerOppo.RemoveAt(i);
                    _charHandler.ToSkill(skillId);
                }
            }
        }
Example #6
0
        public void FinalEnemyTrigger(int sec)
        {
            int skillId;

            for (int i = _lstFinalTrigger.Count - 1; i >= 0; --i)
            {
                skillId = _lstFinalTrigger[i];
                if (sec == SkillHandler.GetInst().GetSkillDataByID(skillId).m_iTriggerParam)
                {
                    _lstFinalTrigger.RemoveAt(i);
                    _charHandler.ToSkill(skillId);
                }
            }
        }
Example #7
0
        public bool ToSkill(int skillId, bool bManual = false)
        {
            if (!CheckCanDo(skillId, bManual))
            {
                return(false);
            }

            SkillDataWhole skillDataWhole = SkillHandler.GetInst().GetSkillDataByID(skillId);

            if (!CheckMP(skillDataWhole, bManual))
            {
                return(false);
            }

            _ToSkill(skillDataWhole);

            return(true);
        }
Example #8
0
        protected override void Excute(CharHandler charHandler, int index = -1, int skillInstId = -1)
        {
            SkillDataWhole skillDataWhole = SkillHandler.GetInst().GetSkillDataByID(charHandler.m_CharData.m_iCurSkillID);

            if (skillDataWhole.m_eSkillKind == SkillEnum.SkillKind.Soul && charHandler.m_CharData.SoulSkillInvalid.Value)
            {
                return;
            }

            SkillDataSon       skillDataSon;
            List <CharHandler> targets;

            for (int i = 1; i <= skillDataWhole.GetSonCount(); ++i)
            {
                skillDataSon = skillDataWhole.GetSkillDataBySonID(i);
                targets      = GetTargets(charHandler, skillDataSon, index);
                OnDoSkill(skillDataSon, charHandler, targets, skillInstId);
            }
        }
Example #9
0
        private bool CheckCanDo(int skillId, bool bManual)
        {
            switch (m_CharData.m_eState)
            {
            case BattleEnum.Enum_CharState.Dead:
            case BattleEnum.Enum_CharState.Dizzy:
                return(false);

            case BattleEnum.Enum_CharState.DoSkill:
                if (!bManual && SkillHandler.GetInst().GetSkillDataByID(skillId).m_eSkillKind == SkillEnum.SkillKind.Magic)
                {
                    m_CharSkill.EnqueueMagicSkill(skillId);
                }
                return(false);

            default:
                if (m_CharData.SkillForbid.Value)
                {
                    return(false);
                }
                return(true);
            }
        }
Example #10
0
 public void DoSkill(int index)
 {
     SkillHandler.GetInst().NormalSkill(_charHandler, index);
 }
Example #11
0
 public void NormalShoot()
 {
     SkillHandler.GetInst().NormalShoot(_charHandler);
 }
Example #12
0
 public Transform GetSkillBulletObj(int skillId)
 {
     return(BattleScenePool.GetInst().PopEffect <BulletTrace>(SkillHandler.GetInst().GetSkillDataByID(skillId).m_sBulletPath));
 }