Ejemplo n.º 1
0
        public void AddThreat(ActorObj pAvatar, int nValue)
        {
            if (Owner == null || pAvatar == null)
            {
                return;
            }
            if (Owner == pAvatar)
            {
                return;
            }

            Threat pThreat = GetThreat(pAvatar.GetAvatarID(), true);

            if (pThreat == null)
            {
                return;
            }

            if (nValue >= 0 || pThreat.nThreat <= 0)
            {
                pThreat.nThreat += nValue;
            }
            pThreat.nThreat = Mathf.Max(-1, pThreat.nThreat);
            if (CompareThreat(pThreat))
            {
                SetTarget(pThreat.nAvatarID, pThreat.nThreat);
            }

            //设置战斗状态
            if (!Owner.IsFight())
            {
                Owner.EnterCombat();
            }
        }
Ejemplo n.º 2
0
        public bool TryAddTarget(SkillData pSkillData, ActorObj pCaster, ActorObj pTarget, List <ActorObj> vTargetList, List <int> vExcludeList, Vector3 vSrcPos)
        {
            if (pSkillData == null || !pCaster || !pTarget)
            {
                return(false);
            }

            if (vExcludeList.Contains(pTarget.GetAvatarID()))
            {
                return(false);
            }

            //int nTarCheck = pSkillData->GetValue(MSV_AreaTarCheck);
            //if (nTarCheck > 0)
            //{
            //	SDConditionParamAvatar sParam;
            //	sParam.ParamAvatar = pCaster;
            //	if (!GSKillConditionCheckManager::Instance().Check(nTarCheck, pTarget, &sParam))
            //		return false;
            //}

            //if (pSkillData->IsAreaAddExclude())
            //{
            //	vExcludeList.insert(pTarget.GetAvatarID());
            //}
            return(true);
        }
Ejemplo n.º 3
0
        public void OnTaunt(ActorObj pAvatar, int nValue)
        {
            if (!Owner)
            {
                return;
            }

            //受到嘲讽时,将第一名的加上去
            Threat pThreat = GetThreat(pAvatar.GetAvatarID(), true);

            pThreat.nThreat += nValue;
            if (!CompareThreat(pThreat))
            {
                int nMaxThreat = Mathf.Max(m_nTargetThreat, pThreat.nThreat);
                //嘲讽是否存在可能越界的情况
                pThreat.nThreat += nMaxThreat;
            }

            if (pThreat != null)
            {
                SetTarget(pAvatar.GetAvatarID(), pThreat.nThreat);
            }
        }