Beispiel #1
0
        /// <summary>
        /// 更新怒气事件响应
        /// </summary>
        public void onUpdateAngerCall(ref EM_OBJECT_TYPE type)
        {
            if (isFightEnd)
            {
                return;
            }

            StopCoroutine("onUpdateAnger");
            bool isSelf = false;
            bool isAdd  = false;

            GameConfig config = DataTemplate.GetInstance().m_GameConfig;

            if (type == EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO)
            {
                isSelf = true;
            }

            float value = FightControler.Inst.GetPowerValue(type);

            value = value >= ObjectSelf.GetInstance().GetMaxPowerValue() ? 1 : value / config.getMax_rage_point();
//            value /= config.getMax_rage_point();
            //Debug.Log("into .................");
            // StartCoroutine(onUpdateAnger(value, isSelf, isAdd));
        }
Beispiel #2
0
        /// <summary>
        /// 怒气值更新
        /// </summary>
        private void onAngerUpdate(GameEvent e)
        {
            EM_OBJECT_TYPE type  = (EM_OBJECT_TYPE)e.data;
            int            value = FightControler.Inst.GetPowerValue(type);

            switch (type)
            {
            case EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO:
            {
                //mSelfAnger.setValue(value / DataTemplate.GetInstance().m_GameConfig.getEach_rage_point());
                //// 更新怒气进度
                //anglerVaule = FightControler.Inst.GetPowerValue(type);
                GameConfig config = DataTemplate.GetInstance().m_GameConfig;
                //anglerVaule = anglerVaule >= ObjectSelf.GetInstance().GetMaxPowerValue() ? 1 : anglerVaule / ObjectSelf.GetInstance().GetMaxPowerValue();
                mSelfAnger.setValue(FightControler.Inst.GetPowerPoint(type));
                anglerVaule = (float)FightControler.Inst.GetPowerPointValue(type) / config.getEach_rage_point();
                //Debug.Log("anglerVaule:"+anglerVaule);
                //UpdateAnger(anglerVaule);
                if (FightControler.Inst.GetPowerPoint(type) == 0)
                {
                    return;
                }
                StartCoroutine(UpdateAnger(lastValue, anglerVaule, FightControler.Inst.GetPowerPoint(type) - lasPointValue));
                //PlayUpdateAnger(type);
                lasPointValue = FightControler.Inst.GetPowerPoint(type);
            }
            break;

            default:
            {
                // mEnemyAnger.setValue(value / DataTemplate.GetInstance().m_GameConfig.getEach_rage_point());
            }
            break;
            }
        }
Beispiel #3
0
 /// <summary>
 /// 构造对象必须指定所属阵营
 /// </summary>
 /// <param name="nType"></param>
 public BattleAnger(EM_OBJECT_TYPE nType)
 {
     m_BasePower     = 0;
     m_GroupType     = nType;
     m_CurPointValue = 0;
     m_CurPowerPoint = 0;
 }
Beispiel #4
0
 /// <summary>
 /// 获取当前单位怒气值
 /// </summary>
 /// <param name="nGroupType"></param>
 /// <returns></returns>
 public int GetPowerPointValue(EM_OBJECT_TYPE nGroupType)
 {
     if (nGroupType == EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO)
     {
         return(m_HeroPower.GetCurPowerPointValue());
     }
     return(-1);
 }
Beispiel #5
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());
                }
            }
        }
Beispiel #6
0
 /// <summary>
 /// 根据百分比,更新怒气值
 /// </summary>
 /// <param name="nGroupType">所属阵营</param>
 /// <param name="nPercent">百分比</param>
 public void OnUpdatePowerPercent(EM_OBJECT_TYPE nGroupType, float nPercent)
 {
     if (nGroupType == EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO)
     {
         m_HeroPower.OnUpdatePowerPercent(nPercent);
     }
     else
     {
         m_EnemyPower.OnUpdatePowerPercent(nPercent);
     }
 }
Beispiel #7
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);
        }
    }
Beispiel #8
0
 // 根据阵营返回当前怒气值 [3/2/2015 Zmy]
 public int GetPowerValue(EM_OBJECT_TYPE nGroupType)
 {
     if (nGroupType == EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO)
     {
         return(m_HeroPower.GetPowerValue());
     }
     else if (nGroupType == EM_OBJECT_TYPE.EM_OBJECT_TYPE_MONSTER)
     {
         return(m_EnemyPower.GetPowerValue());;
     }
     else
     {
         return(-1);
     }
 }
Beispiel #9
0
        /// <summary>
        /// 更新战斗怒气值。
        /// </summary>
        /// <param name="nGroupType">要更新的所属阵营</param>
        /// <param name="nValue">要更新的值</param>
        public void OnUpdatePowerValue(EM_OBJECT_TYPE nGroupType, int nValue)
        {
            if (nValue == 0)
            {
                return;
            }

            if (nGroupType == EM_OBJECT_TYPE.EM_OBJECT_TYPE_HERO)
            {
                m_HeroPower.OnUpdatePowerValue(nValue);
            }
            else
            {
                m_EnemyPower.OnUpdatePowerValue(nValue);
            }
        }
Beispiel #10
0
        public bool 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))
            {
                //不能选择自己 &&  选择的目标是自己
                if (!mSkillTargetStruct.isMyEff && obj.GetGuid().GUID_value == mSkillTargetStruct.mSelctRoleUID.GUID_value)
                {
                    return(false);
                }

                onRequestReleaseSkill(obj);
                return(true);
            }

            return(false);
        }