Ejemplo n.º 1
0
        public bool ActivateEachTick()
        {
            LogManager.LogAssert(m_pHolder);
            LogManager.LogAssert(m_pSpellInfo);
            bool bRet = false;

            //FIGHTOBJECT_LIST targetlist = new FIGHTOBJECT_LIST();
            __CalculateSpellTarget(ref m_TargetList);

            if (m_TargetList.m_nCount > 0)
            {
                SkillTemplate pSpellRow = m_pSpellInfo.GetSpellRow();
                LogManager.LogAssert(pSpellRow);
                // 将该技能的效果作用于目标身上
                ObjectCreature pScanObject = null;
                //产生impact
                for (int TargetIndex = 0; TargetIndex < m_TargetList.m_nCount; TargetIndex++)
                {
                    pScanObject = m_TargetList.m_pObjectList[TargetIndex].m_pTargetObject;
                    //目标临时buff
                    __ImpactEffectOnSpellStartToTarget(pScanObject);
                    //计算命中并且未命中
                    if (__HitLogic(pScanObject) != EM_SPELL_RESULT.EM_SPELL_RESULT_NORMAL)
                    {
                        pScanObject.OnDodge(m_pHolder, m_pSpellInfo);
                        //发送消息
                        continue;
                    }
                    bool bCritical = __CriticalAttack(pScanObject);
                    //爆击逻辑
                    m_pHolder.OnCritical(pScanObject, m_pSpellInfo, bCritical);
                    //被爆击逻辑
                    pScanObject.OnBeCritical(m_pHolder, m_pSpellInfo);
                    //逻辑
                    bRet = __DoSpellLogic(pSpellRow.getSkillLogicID(), pScanObject, bCritical);
                    LogManager.LogAssert(bRet);
                    for (int m = 0; m < pSpellRow.getBuffList().Length; ++m)
                    {
                        if (pSpellRow.getBuffList()[m] != -1)
                        {
                            pScanObject.AddImpact(pSpellRow.getBuffList()[m], m_pHolder, bCritical, GetSpellID());
                        }
                    }
                }
            }

            return(true);
        }
Ejemplo n.º 2
0
        public bool ActiveOnce()
        {
            //释放技能音效
            //AudioControler.Inst.PlaySound(m_pSpellInfo.GetSpellRow().getAttackSound());

            List <SPELL_EVENT> pList = m_pHolder.GetSpellEventQueue().GetEventList(SPELL_EVENT_ID.SPELL_EVENT_ID_USESPELL);

            LogManager.LogAssert(pList);
            foreach (var item in pList)
            {
                Impact pImpact = item.m_pImpact;
                if (pImpact != null)
                {
                    pImpact.OnSpellUse(m_pSpellInfo, m_SpellTarget);
                }
            }

            LogManager.LogAssert(m_pHolder);
            LogManager.LogAssert(m_pSpellInfo);
            int  m_Hitcount = 0;//命中个数
            bool bRet       = false;

            //目标逻辑
            //FIGHTOBJECT_LIST targetlist = new FIGHTOBJECT_LIST();
            __CalculateSpellTarget(ref m_TargetList);
            AddLinkEff();
            if (m_TargetList.m_nCount > 0)
            {
                SkillTemplate pSpellRow = m_pSpellInfo.GetSpellRow();
                LogManager.LogAssert(pSpellRow);
                // 将该技能的效果作用于目标身上
                ObjectCreature pScanObject = null;
                //产生impact
                for (int TargetIndex = 0; TargetIndex < m_TargetList.m_nCount; TargetIndex++)
                {
                    pScanObject = m_TargetList.m_pObjectList[TargetIndex].m_pTargetObject;
                    //目标临时buff
                    __ImpactEffectOnSpellStartToTarget(pScanObject);

                    //根据圆桌算法 返回行为结果:暴击,闪避,普通攻击 [10/16/2015 Zmy]
                    EM_SPELL_RESULT nResult = EM_SPELL_RESULT.EM_SPELL_RESULT_FAIL;
                    OnRoundTableOperation(pScanObject, ref nResult);
                    //计算命中并且未命中
                    if (/*__HitLogic(pScanObject)*/ nResult == EM_SPELL_RESULT.EM_SPELL_RESULT_MISS)
                    {
                        pScanObject.OnDodge(m_pHolder, m_pSpellInfo);
                        m_TargetList.OnUpdateTargetHit(pScanObject);
                        //发送消息
                        continue;
                    }

                    //命中可以震动
                    m_Hitcount++;

                    //每命中一个单位 奖励怒气
                    //if (FightControler.Inst != null)
                    //    FightControler.Inst.OnUpdatePowerValue(m_pHolder.GetGroupType(), m_pSpellInfo.GetSpellRow().getInitHitFury());


                    //bool bCritical = __CriticalAttack(pScanObject);
                    bool bCritical = nResult == EM_SPELL_RESULT.EM_SPELL_RESULT_CRITICAL ? true : false;
                    //爆击逻辑
                    m_pHolder.OnCritical(pScanObject, m_pSpellInfo, bCritical);
                    //被爆击逻辑
                    pScanObject.OnBeCritical(m_pHolder, m_pSpellInfo, bCritical);
                    //逻辑
                    bRet = __DoSpellLogic(pSpellRow.getSkillLogicID(), pScanObject, bCritical);
                    LogManager.LogAssert(bRet);

                    for (int m = 0; m < pSpellRow.getBuffList().Length; ++m)
                    {
                        if (pSpellRow.getBuffList()[m] != -1)
                        {
                            EM_IMPACT_RESULT bImpactRet = pScanObject.AddImpact(pSpellRow.getBuffList()[m], m_pHolder, bCritical, GetSpellID());
                            if (bImpactRet == EM_IMPACT_RESULT.EM_IMPACT_RESULT_NORMAL)
                            {
                                m_TargetList.OnUpdateTargetImpact(pScanObject, pSpellRow.getBuffList()[m]);
                            }
                        }
                    }
                }
                //命中结算
                __SpellOverLogic(m_Hitcount);
            }
            //技能结尾部分,缓存所产生的战斗信息 [3/23/2015 Zmy]
            OnCacheSepllInfo();
            return(true);
        }