Example #1
0
        private void SelectFireSigh()
        {
            if (m_CurTouchState == TouchState.SelectSkillTarget_state)
            {
                return;
            }

            if (Input.GetMouseButtonDown(0))
            {
                // TODO... GUIDE
                Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                RaycastHit hit;
                if (Physics.Raycast(ray, out hit))
                {
                    GameObject obj = hit.transform.gameObject;
                    if (obj)
                    {
                        ObjectCreature objC = SceneObjectManager.GetInstance().GetSceneObjectByGameObject(obj);
                        if (objC != null && objC.GetGroupType() == EM_OBJECT_TYPE.EM_OBJECT_TYPE_MONSTER && objC.IsAlive())
                        {
                            SceneObjectManager.GetInstance().UpdateFireSignCreature(objC);
                        }
                    }
                }
            }
        }
Example #2
0
    /// <summary>
    /// 死亡对象的特效从管理器中删除
    /// </summary>
    /// <param name="pDieObj"></param>
    public void OnRemoveDeadObjOfEffect(ObjectCreature pDieObj)
    {
        int nStaticCount = m_EffectStaticList.Count;

        for (int i = nStaticCount - 1; i >= 0; i--)
        {
            if (m_EffectStaticList[i].GetCasterObj() != null && m_EffectStaticList[i].GetCasterObj().GetGuid().Equals(pDieObj.GetGuid()))
            {
                GameObject obj = m_EffectStaticList[i].GetGameObject();
                Destroy(obj);
                obj = null;
                m_EffectStaticList.RemoveAt(i);
            }
        }

        int nSpellCount = m_EffectSpellList.Count;

        for (int i = nSpellCount - 1; i >= 0; i--)
        {
            if (m_EffectSpellList[i].GetCasterObj() != null && m_EffectSpellList[i].GetCasterObj().GetGuid().Equals(pDieObj.GetGuid()))
            {
                GameObject obj = m_EffectSpellList[i].GetGameObject();
                Destroy(obj);
                obj = null;
                m_EffectSpellList.RemoveAt(i);
            }
        }
    }
Example #3
0
        public bool __ImmuneLogic(ObjectCreature pTarget)
        {
            LogManager.LogAssert(m_pHolder);
            LogManager.LogAssert(m_pSpellInfo);

            return(false);               //没有免疫
        }
Example #4
0
 public Spell()
 {
     this.m_pHolder = null;
     for (int i = 0; i < GlobalMembers.MAX_IMPACT_NUMBER; ++i)
     {
         m_ValidImpact[i] = -1;
     }
 }
Example #5
0
 public void onSingleTargetFind(ObjectCreature obj)
 {
     if (mMenuPanel.onSingleTargetFind(obj))
     {   // 找到目标
         mTouchControl.ChangeTouchState(TouchState.FireSign_state);
         mBloodControl.hideFlag();
     }
 }
        //=======================================================================================================
        //添加特效为子物体
        private void addEff(string effectName, GameObject Clone, Transform parent)
        {
            //Clone = Instantiate(Resources.Load(effectName), parent.position, parent.rotation) as GameObject;
            //Clone.transform.parent = parent;
            ObjectCreature pCaster = SceneObjectManager.GetInstance().GetSceneObjectByGameObject(this.gameObject);

            EffectManager.GetInstance().InstanceEffect_Static(effectName, pCaster, parent, 0f, true);
        }
Example #7
0
    /// <summary>
    /// 请求释放技能
    /// </summary>
    /// <param name="obj"></param>
    public void onRequestReleaseSkill(ObjectCreature obj)
    {
        // 请求释放技能
        EventRequestSkillPackage package = new EventRequestSkillPackage(mSkillTargetStruct.mSelctRoleUID, mSkillTargetStruct.mSelectSkillID, obj);

        GameEventDispatcher.Inst.dispatchEvent(GameEventID.SE_RequestReleaseSkill, package);
        mSkillTargetStruct.clear();
    }
Example #8
0
        /// <summary>
        /// buff更新
        /// </summary>
        private void onBufferUpdateCall(GameEvent e)
        {
            BuffUpdatePackage buffEvent = (BuffUpdatePackage)e.data;
            ObjectCreature    creature  = buffEvent.creature;
            Impact            pImpact   = buffEvent.pImpact;
            bool isAdd = buffEvent.isAdd;

            //pImpact.GetImpactRow().m_conduce == 0
            if (!string.IsNullOrEmpty(pImpact.GetImpactRow().getBuffIconBig()))
            {
                // 光环
                // 更新到怒气条下
                EM_OBJECT_TYPE groupType = creature.GetGroupType();
                switch (groupType)
                {
                case EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO:
                {
                    if (isAdd)
                    {
                        mMenuPanel.onSelfAllBuffAdd(pImpact.GetImpactRow());
                    }
                    else
                    {
                        mMenuPanel.onSelfAllBuffRemove(pImpact.GetImpactRow());
                    }
                }
                break;

                case EM_OBJECT_TYPE.EM_OBJECT_TYPE_MONSTER:
                {
                    if (isAdd)
                    {
                        mMenuPanel.onEnemyAllBuffAdd(pImpact.GetImpactRow());
                    }
                    else
                    {
                        mMenuPanel.onEnemyAllBuffRemove(pImpact.GetImpactRow());
                    }
                }
                break;
                }
            }

            if (!string.IsNullOrEmpty(pImpact.GetImpactRow().getBuffIconSmall()))
            {
                // buff 单体
                // 更新到角色血条下
                if (isAdd)
                {
                    mBloodPanel.onSingleBuffAdd(creature.GetGuid(), pImpact.GetImpactRow());
                }
                else
                {
                    mBloodPanel.onSingleBuffRemove(creature.GetGuid(), pImpact.GetImpactRow());
                }
            }
        }
Example #9
0
        public EM_IMPACT_RESULT AddImpactToTarget(ObjectCreature pCreature, int impactID, bool bCritical)
        {
            LogManager.LogAssert(pCreature);
            LogManager.LogAssert(m_pHolder);
            LogManager.LogAssert(m_pSpellInfo);

            EM_IMPACT_RESULT nResult = pCreature.AddImpact(impactID, m_pHolder, bCritical, GetSpellID());

            return(nResult);
        }
Example #10
0
    public bool CheckTarget(ObjectCreature pObject, ObjectCreature pTarget)
    {
        LogManager.LogAssert(IsValid());
        if (CheckAttackDistance(pObject, pTarget))
        {
            return(true);
        }

        return(false);
    }
Example #11
0
 private int m_ImpactCount;                                                                  //自增imact数组索引标记
 public SpellTargetInfo()
 {
     m_pTargetObject = null;
     m_bHit          = 1;
     for (int i = 0; i < GlobalMembers.MAX_IMPACT_NUMBER; ++i)
     {
         m_ValidImpact[i] = -1;
     }
     m_ImpactCount = 0;
 }
Example #12
0
    /// <summary>
    /// 攻击
    /// 防御
    /// 生命
    /// 命中率
    /// 闪避率
    /// 暴击率
    /// 韧性率
    /// 格挡率
    /// 破甲率
    /// 伤害加成率
    /// 伤害减免率
    /// 暴击伤害率
    /// </summary>
    /// <param name="heroData"></param>
    public void SetData(ObjectCreature creature)
    {
        m_AText1.text  = GameUtils.getString("attribute1name");
        m_AText2.text  = GameUtils.getString("attribute2name");
        m_AText3.text  = GameUtils.getString("attribute3name");
        m_AText4.text  = GameUtils.getString("attribute4name");
        m_AText5.text  = GameUtils.getString("attribute5name");
        m_AText6.text  = GameUtils.getString("attribute6name");
        m_AText7.text  = GameUtils.getString("attribute7name");
        m_AText8.text  = GameUtils.getString("attribute8name");
        m_AText9.text  = GameUtils.getString("attribute9name");
        m_AText10.text = GameUtils.getString("attribute10name");
        m_AText11.text = GameUtils.getString("attribute11name");
        m_AText12.text = GameUtils.getString("attribute12name");

        m_BText1.text  = GameUtils.getString("attribute1name");
        m_BText2.text  = GameUtils.getString("attribute2name");
        m_BText3.text  = GameUtils.getString("attribute3name");
        m_BText4.text  = GameUtils.getString("attribute4name");
        m_BText5.text  = GameUtils.getString("attribute5name");
        m_BText6.text  = GameUtils.getString("attribute6name");
        m_BText7.text  = GameUtils.getString("attribute7name");
        m_BText8.text  = GameUtils.getString("attribute8name");
        m_BText9.text  = GameUtils.getString("attribute9name");
        m_BText10.text = GameUtils.getString("attribute10name");
        m_BText11.text = GameUtils.getString("attribute11name");
        m_BText12.text = GameUtils.getString("attribute12name");

        m_AValue1.text  = creature.GetPhysicalAttack().ToString();
        m_AValue2.text  = creature.GetPhysicalDefence().ToString();
        m_AValue3.text  = creature.GetMaxHP().ToString();
        m_AValue4.text  = creature.GetHit().ToString();
        m_AValue5.text  = creature.GetDodge().ToString();
        m_AValue6.text  = creature.GetCritical().ToString();
        m_AValue7.text  = creature.GetTenacity().ToString();
        m_AValue8.text  = creature.GetBlockRate().ToString();
        m_AValue9.text  = creature.GetPierceRate().ToString();
        m_AValue10.text = creature.GetHurtAddRate().ToString();
        m_AValue11.text = creature.GetHurtReduceRate().ToString();
        m_AValue12.text = creature.GetCriticalHurtRate().ToString();

        m_BValue1.text  = GameUtils.getString("attribute1des");
        m_BValue2.text  = GameUtils.getString("attribute2des");
        m_BValue3.text  = GameUtils.getString("attribute3des");
        m_BValue4.text  = GameUtils.getString("attribute4des");
        m_BValue5.text  = GameUtils.getString("attribute5des");
        m_BValue6.text  = GameUtils.getString("attribute6des");
        m_BValue7.text  = GameUtils.getString("attribute7des");
        m_BValue8.text  = GameUtils.getString("attribute8des");
        m_BValue9.text  = GameUtils.getString("attribute9des");
        m_BValue10.text = GameUtils.getString("attribute10des");
        m_BValue11.text = GameUtils.getString("attribute11des");
        m_BValue12.text = GameUtils.getString("attribute12des");
    }
Example #13
0
    /// <summary>
    /// 英雄属性;
    /// </summary>
    /// <param name="objectCreature"></param>
    /// <returns></returns>
    public UICommon_HeroProp ShowHeroProp(ObjectCreature objectCreature)
    {
        UICommon_HeroProp commonUI = UICommonFactory.GenerateUICommon(UICommonType.CommonHeroProp) as UICommon_HeroProp;

        if (commonUI != null)
        {
            commonUI.SetData(objectCreature);
        }

        return(commonUI);
    }
Example #14
0
    public void InitBornPoint(ObjectCreature obj)
    {
        Transform _tran = GetTransform(obj.GetGameObject().transform, m_SpellInfo.GetSpellRow().getBullEffectPoint());

        if (_tran == null)
        {
            LogManager.LogError("!!!Error: [InitBornPoint]弹道特效" + obj.GetGameObject() + "目标发射点位置获取错误:" + m_SpellInfo.GetSpellRow().getBullEffectPoint() + "  技能ID:" + m_SpellInfo.GetSpellRow().getId());
            return;
        }
        SetCasterObj(obj);
        SetInitialLocation(_tran.position);
    }
Example #15
0
    /// <summary>
    /// 查找是否有该目标
    /// </summary>
    /// <param name="obj"></param>
    public void onSingleTargetFind(ObjectCreature obj)
    {
        EM_OBJECT_TYPE type = obj.GetGroupType();

        if ((mSkillTargetStruct.isForSelf && type == EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO) ||
            (!mSkillTargetStruct.isForSelf && type != EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO))
        {
            onRequestReleaseSkill(obj);
            // 找到目标
            mTouchControl.ChangeTouchState(TouchState.FireSign_state);
        }
    }
Example #16
0
        public bool Add(ObjectCreature pObject)
        {
            if (pObject == null)
            {
                return(false);
            }
            SpellTargetInfo listInfo = new SpellTargetInfo();

            listInfo.m_pTargetObject = pObject;
            m_pObjectList.Add(listInfo);
            return(true);
        }
Example #17
0
    private void SwithResourceType(int Type, int ID, int Num, ObjectCreature value)
    {
        switch (Type)
        {
        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_TYPE_INVALID:
            break;

        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_MP:
            if (!ObjectSelf.GetInstance().isSkillShow)
            {
                FightControler.Inst.OnUpdatePowerValue(value.GetGroupType(), -Num);
            }
            break;

        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_MP_PERCENT:
            FightControler.Inst.OnUpdatePowerValue(value.GetGroupType(), -(FightControler.Inst.GetPowerValue(value.GetGroupType()) * Num / 100));
            break;

        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_HP:
            value.SetHP((value.GetHP() - Num));
            break;

        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_CURRENTHP_PERCENT:
            value.SetHP((value.GetHP() - (value.GetHP() * (Num / 100))));
            break;

        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_MAXHP_PERCENT:
            value.SetHP((value.GetHP() - (value.GetMaxHP() * (Num / 100))));
            break;

        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_COMMON:
            break;

        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_GOLD:
            break;

        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_RONGHUN:
            break;

        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_RUNEPOINT:
            break;

        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_PARTNER:
            break;

        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_ITEM:
            break;

        case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_EQUIP:
            break;
        }
    }
Example #18
0
        /// <summary>
        /// 血量变化
        /// </summary>
        private void onHpChangeCall(GameEvent e)
        {
            UI_HurtInfo info = (UI_HurtInfo)e.data;

            if (info != null)
            {
                ObjectCreature obj = info.pTarget;
                mBloodControl.UpdateBloodValue(obj.GetGuid(), (float)obj.GetHP() / obj.GetMaxHP());
                if (obj.GetHP() < 0)
                {
                    return;
                }
                if (obj.GetGroupType() == EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO)
                {
                    // hero
                    Transform trans = ((ObjectHero)obj).GetAnimation().EventControl.Pre_Head_T_EffectPoint;
                    if (info.nHurt > 0)
                    {
                        // 英雄加血
                        mNumberMgr.showNumber(System.Math.Abs(info.nHurt), HPNumberType.HP_HEAL, trans.position);
                    }
                    else
                    {
                        // 英雄掉血
                        mNumberMgr.showNumber(System.Math.Abs(info.nHurt), HPNumberType.HP_SELF_HURT, trans.position);
                    }
                }
                else if (obj.GetGroupType() == EM_OBJECT_TYPE.EM_OBJECT_TYPE_MONSTER)
                {
                    // monster
                    Transform trans = ((ObjectMonster)obj).GetAnimation().EventControl.Pre_Head_T_EffectPoint;
                    if (info.nHurt < 0)
                    {
                        //敌人掉血
                        if (info.bCritical)
                        {
                            // 暴击
                            mNumberMgr.showNumber(System.Math.Abs(info.nHurt), HPNumberType.HP_HEAVY, trans.position);
                        }
                        else
                        {
                            mNumberMgr.showNumber(System.Math.Abs(info.nHurt), HPNumberType.HP_ENEMY_HURT, trans.position);
                        }
                    }
                    else
                    {
                        // 敌人加血
                        mNumberMgr.showNumber(System.Math.Abs(info.nHurt), HPNumberType.HP_HEAL, trans.position);
                    }
                }
            }
        }
Example #19
0
 public void UpdateSurplusNormalAttackTime()
 {
     if (SurplusAttackLength <= 0)
     {
         SurplusAttackLength = 0;
         ObjectCreature obj = SceneObjectManager.GetInstance().GetSceneObjectByGameObject(this.gameObject);
         obj.SetObjectActionState(ObjectCreature.ObjectActionState.AttackIdle);
     }
     else
     {
         SurplusAttackLength -= Time.deltaTime;
     }
 }
Example #20
0
 public void UpdateFidTime()
 {
     if (FidLengh <= 0)
     {
         FidLengh = 0;
         ObjectCreature obj = SceneObjectManager.GetInstance().GetSceneObjectByGameObject(this.gameObject);
         obj.SetObjectActionState(ObjectCreature.ObjectActionState.normalAttack);
     }
     else
     {
         FidLengh -= Time.deltaTime;
     }
 }
Example #21
0
    /// <summary>
    /// 实例化一个静态effect
    /// </summary>
    /// <param name="effectName">要实例化的特效名称</param>
    /// <param name="parent">实例化特效依附的父类挂点</param>
    /// <param name="lifetime">是否重置指定的生存时间,默认为特效对象上的Light组件获得</param>
    /// <param name="isAttach">是否需要依附,默认不依附任何挂点</param>
    public void InstanceEffect_Static(string effectName, ObjectCreature pCaster, Transform parent, float lifetime = 0f, bool isAttach = false)
    {
        EffectStatic _effect = GetFreeEffectStatic(effectName);

        if (_effect != null && _effect.GetGameObject() != null)
        {
            GameObject obj = _effect.GetGameObject();
            obj.transform.position = parent.position;
            obj.transform.rotation = parent.transform.rotation;
            _effect.SetCasterObj(pCaster);
            if (isAttach)
            {
                obj.transform.parent = parent;
            }
            _effect.ResetTime();
            _effect.SetActivation(true);
        }
        else
        {
            GameObject _AssetRes = AssetLoader.Inst.GetAssetRes(effectName);
            if (_AssetRes == null)
            {
                LogManager.LogError("!!!!Error:InstanceEffect_Static() effectRes is null!The effectName:" + effectName + "GameObject is:" + pCaster.GetGameObject() + "effect location:" + parent.name);
                return;
            }

            EffectStatic _newEffect = new EffectStatic();

            GameObject _obj = Instantiate(_AssetRes, parent.position, parent.transform.rotation) as GameObject;
            if (pCaster is ObjectMonster)
            {
                float _scale = ((ObjectMonster)pCaster).GetMonsterRow().getMonsterEnlarge();
                _obj.transform.localScale = new UnityEngine.Vector3(_scale, _scale, _scale);
            }
            GameUtils.AttachParticleCS(_obj.transform);
            if (isAttach)
            {
                _obj.transform.parent = parent;
            }
            _newEffect.SetGameObject(_obj);
            _newEffect.SetCasterObj(pCaster);
            _newEffect.SetEffectName(effectName);
            //if (lifetime > 0f)
            //{
            //    _newEffect.SetLiftTime(lifetime);
            //}

            m_EffectStaticList.Add(_newEffect);
        }
    }
Example #22
0
    /// <summary>
    /// 实例化弹道特效
    /// </summary>
    /// <param name="effectName">特效名称</param>
    /// <param name="MasterObj">发起者对象</param>
    /// <param name="TargetObj">目标对象</param>
    /// <param name="_SpellInfo">子弹的技能信息</param>
    public void InstanceEffect_Bullet(string effectName, ObjectCreature MasterObj, ObjectCreature TargetObj, SpellInfo _SpellInfo, EffectHit_Callback HitHandle = null)
    {
        //子弹释放中音效
        AudioControler.Inst.PlaySound(_SpellInfo.GetSpellRow().getBulletsFiredSound());
        //技能弹道的音效
        AudioControler.Inst.PlaySound(_SpellInfo.GetSpellRow().getBallIsticSound());

        EffectSpell _effect = GetFreeEffectSpell(effectName);

        if (_effect != null && _effect.GetGameObject() != null)
        {
            GameObject obj = _effect.GetGameObject();
            _effect.ResetTime();
            _effect.InitBornPoint(MasterObj);
            _effect.InitTargetPoint(TargetObj);
            _effect.SetHitEffectHandle(HitHandle);
            _effect.SetGameObject(obj);
        }
        else
        {
            GameObject _AssetRes = AssetLoader.Inst.GetAssetRes(effectName);
            if (_AssetRes == null)
            {
                return;
            }

            EffectSpell _newEffect = new EffectSpell(_SpellInfo);
            _newEffect.InitBornPoint(MasterObj);
            _newEffect.InitTargetPoint(TargetObj);

            GameObject _obj = Instantiate(_AssetRes, _newEffect.GetInitialLocation(), Quaternion.identity) as GameObject;
            if (MasterObj is ObjectMonster)
            {
                float _scale = ((ObjectMonster)MasterObj).GetMonsterRow().getMonsterEnlarge();
                _obj.transform.localScale = new UnityEngine.Vector3(_scale, _scale, _scale);
            }
            GameUtils.AttachParticleCS(_obj.transform);
            _newEffect.SetGameObject(_obj);
            _newEffect.SetEffectName(effectName);
            _newEffect.SetHitEffectHandle(HitHandle);

            m_EffectSpellList.Add(_newEffect);
        }
        //技能震动
        if (FightEditorContrler.GetInstantiate() != null)
        {
            FightEditorContrler.GetInstantiate().SkillShake(_SpellInfo.GetSpellRow().getVibrationScreen(), EM_SPELL_SHAKE_TYPE.EM_SPELL_SHAKE_TYPE_RELEASE);
        }
    }
Example #23
0
    public bool CheckAttackDistance(ObjectCreature pObject, ObjectCreature pTarget)
    {
        LogManager.LogAssert(IsValid());
        LogManager.LogAssert(pObject);
        LogManager.LogAssert(pTarget);
        Vector3 _SrcPos     = pObject.getWorldPos();
        Vector3 _DstPos     = pTarget.getWorldPos();
        float   _myLengthSq = (_SrcPos.x - _DstPos.x) * (_SrcPos.x - _DstPos.x) + (_SrcPos.z - _DstPos.z) * (_SrcPos.z - _DstPos.z);

        if (_myLengthSq > m_pTableRowSpell.getAttDistance())
        {
            return(false);
        }
        return(true);
    }
Example #24
0
    /// <summary>
    /// 指定一个静态特效立即失效。PS:必须通过持有人与特效名称查找
    /// </summary>
    /// <param name="pCaster"></param>
    /// <param name="_effectName"></param>
    public void DisableStaticEffect(ObjectCreature pCaster, string _effectName)
    {
        int nCount = m_EffectStaticList.Count;

        for (int i = 0; i < nCount; i++)
        {
            if (m_EffectStaticList[i].GetIsActivation() && m_EffectStaticList[i].GetEffectName().Equals(_effectName))
            {
                if (m_EffectStaticList[i].GetCasterObj().GetGuid().Equals(pCaster.GetGuid()))
                {
                    m_EffectStaticList[i].SetActivation(false);
                }
            }
        }
    }
Example #25
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);
        }
Example #26
0
        public void InitLogic(int TemplateID, int Priority, ObjectCreature ReleaseObj, SpellInfo info, float timeInterval)
        {
            m_TempSkillTag.Clear();
            m_Oneself.Clear();
            m_Enemy.Clear();

            m_TemplateID   = TemplateID;
            m_ReleaseObj   = ReleaseObj;
            m_Priority     = Priority;
            m_Spellinfo    = info;
            m_ID           = ReleaseObj.GetGameObject().GetInstanceID();
            m_Tempai       = (SkillaiTemplate)DataTemplate.GetInstance().m_SkillaiTable.getTableData(m_TemplateID);
            m_TimeInterval = timeInterval;

            curState = LogicState.EM_LOGICSTATE_USE;
        }
Example #27
0
        public void ClearUp()
        {
            curState = LogicState.EM_LOGICSTATE_IDLE;

            m_TempSkillTag.Clear();
            m_Oneself.Clear();
            m_Enemy.Clear();

            m_TemplateID   = -1;
            m_ReleaseObj   = null;
            m_Priority     = -1;
            m_Spellinfo    = null;
            m_ID           = -1;
            m_Tempai       = null;
            m_TimeInterval = 0f;
        }
Example #28
0
    public bool CheckConsume(ObjectCreature pObject)
    {
        LogManager.LogAssert(IsValid());
        LogManager.LogAssert(pObject);
//      for (int i = 0; i < GlobalMembers.MAX_SPELLCAST_CONSUME_COUNT; i++)
//      {
//          switch (m_pTableRowSpell.m_skillCostType[i])
//          {
//             case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_COMMON:
//              {
//              }
//              break;
//          case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_GOLD:
//              {
//              }
//              break;
//          case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_RONGHUN:
//              {
//              }
//              break;
//          case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_MP:
//              {
//              }
//              break;
//          case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_MP_PERCENT:
//              {
//              }
//              break;
//          case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_HP:
//              {
//              }
//              break;
//          case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_HP_PERCENT:
//              {
//              }
//              break;
//          case (int)EM_EXTRAITEM_TYPE.EM_EXTRAITEM_RUNEPOINT:
//              {
//              }
//              break;
//          default:
//			    break;
//          }
//      }

        return(true);
    }
Example #29
0
        public EM_SPELL_RESULT __HitLogic(ObjectCreature pTarget)
        {
            LogManager.LogAssert(m_pHolder);
            LogManager.LogAssert(m_pSpellInfo);
            // 目标是友方 直接命中 [3/9/2015 Zmy]
            if (pTarget.GetGroupType() == m_pHolder.GetGroupType())
            {
                return(EM_SPELL_RESULT.EM_SPELL_RESULT_NORMAL);
            }

            /*if ((pTarget.IsInFightState(EM_CARD_FIGHT_STATE_IDLE))||(pTarget.IsInFightState(EM_CARD_FIGHT_STATE_IMM)))
             * {
             *      return EM_SPELL_RESULT_MISS;
             * }*/
            /*一次攻击行为的命中判定率P的计算公式为:
             *     P = p - b / (〖a((A + X) / (B + X))〗^k + c) + A^'-B'
             *     其中A为攻击方命中最终值,B为防御方最终闪避值,A’为攻击方命中最终率,B’为防御方闪避最终率。
             *     X、a、b、c、k、p 分别为命中率计算系数,配置在10_config表中。*/
            float nParamX = DataTemplate.GetInstance().m_GameConfig.getDodge_X();
            float nParama = DataTemplate.GetInstance().m_GameConfig.getDodge_a();
            float nParamb = DataTemplate.GetInstance().m_GameConfig.getDodge_b();
            float nParamc = DataTemplate.GetInstance().m_GameConfig.getDodge_c();
            float nParamk = DataTemplate.GetInstance().m_GameConfig.getDodge_k();
            float nParamp = DataTemplate.GetInstance().m_GameConfig.getDodge_p();

            double fParam = (m_pHolder.GetHit() + nParamX) / (pTarget.GetDodge() + nParamX);

            fParam = Math.Pow(fParam, nParamk);
            int fHit = (int)((nParamp - nParamb / (nParama * fParam + nParamc) + m_pHolder.GetHitRate() - pTarget.GetDodgeRate()) * 10000L);

            fHit = Math.Max((int)(DataTemplate.GetInstance().m_GameConfig.getDodge_min() * 10000f), fHit);

//          System.Random ran = new System.Random();
//          int nRand = ran.Next(1, 10000);
            //取系统时间的毫秒数为随机种子!规避伪随机导致的结果相同[9/22/2015 Zmy]
            int iRnd = System.DateTime.Now.Millisecond;

            System.Random randomCoor = new System.Random(iRnd);
            int           nRand      = randomCoor.Next(1, 10000);

            if (nRand <= fHit)
            {
                return(EM_SPELL_RESULT.EM_SPELL_RESULT_NORMAL);
            }

            return(EM_SPELL_RESULT.EM_SPELL_RESULT_MISS);
        }
Example #30
0
 private void OnAiTagLogic6()
 {
     if (m_Enemy != null && m_Enemy.Count > 0)
     {
         float Maxcount = (float)m_Enemy[0].GetHP() / (float)m_Enemy[0].GetMaxHP();
         int   cout     = m_Enemy.Count;
         m_SkillTag = m_Enemy[0];
         for (int i = 0; i < cout; ++i)
         {
             if ((float)m_Enemy[i].GetHP() / (float)m_Enemy[i].GetMaxHP() >= Maxcount)
             {
                 Maxcount   = (float)m_Enemy[i].GetHP() / (float)m_Enemy[i].GetMaxHP();
                 m_SkillTag = m_Enemy[i];
             }
         }
     }
 }