public bool canPlayerHeroTargetingType3(Monster p, bool checkTargetOnly, TargetingDecal decal)
    {
        _v    = p.cTransformPosition;
        _v.x += (p.fowardDirectionValue);

        if (p.hasShootingPos)
        {
            _v.y  = p.shootingPos[1];
            _v.y *= p.monsterData.scale;
        }
        else
        {
            _v.y += p.hitObject.height * 0.7f;
        }

        if (checkTargetOnly == false)
        {
            p.targetHeight   = p.hitObject.height;
            p.targetPosition = _v;
            p.targetUniqueId = -1;
            p.setSkillTarget(null);
        }

        if (decal != null)
        {
            _v   = p.cTransformPosition;
            _v.y = 1.0f;

            decal.setPosition(_v);
        }

        return(true);
    }
    // 리미트 거리가 없는 것.
    public bool canPlayerHeroTargetingType2WithOutDistCheck(Monster p, bool checkTargetOnly, TargetingDecal decal)
    {
        _target = TargetingData.getAutomaticTarget(p, targetType, targetAttr, canUseThisSkillOnThisType);
        if (_target == null)
        {
            return(false);
        }


        if (checkTargetOnly == false)
        {
            p.setSkillTarget(_target);
            p.targetHeight   = _target.hitObject.height;
            p.targetPosition = _target.cTransformPosition;
            p.targetUniqueId = _target.stat.uniqueId;
        }

        //if(p.isPlayer)
        {
            _v   = _target.cTransformPosition;
            _v.y = 1.0f;

            decal.setPosition(_v);
        }

        _target = null;
        return(true);
    }
    // 리미트 거리가 있는 것.
    public bool canPlayerHeroTargetingType2(Monster p, bool checkTargetOnly, TargetingDecal decal)
    {
        //데미지 범위. exeData.attr[1];
        _target = TargetingData.getAutomaticTarget(p, targetType, targetAttr, canUseThisSkillOnThisType);

        if (_target == null)
        {
            return(false);
        }
        //단순히 현재 상태에서 검사!
        if (VectorUtil.DistanceXZ(_target.cTransformPosition, p.cTransformPosition) < _targetDistanceLimit)
        {
            if (checkTargetOnly == false)
            {
                p.setSkillTarget(_target);
                p.targetHeight   = _target.hitObject.height;
                p.targetPosition = _target.cTransformPosition;
                p.targetUniqueId = _target.stat.uniqueId;
            }

            _v   = _target.cTransformPosition;
            _v.y = 1.0f;

            decal.setPosition(_v);

            _target = null;
            return(true);
        }

        _target = null;
        return(false);
    }
//============= 플레이어 타게팅 검사 로직  =======================

    public bool canPlayerHeroTargetingType1(Monster p, bool checkTargetOnly, TargetingDecal decal)
    {
        // 플레이어 1번의 경우.....
        _v    = p.cTransformPosition;
        _v.x += ((p.isPlayerSide)?targetAttr[0].Get():-targetAttr[0].Get());

        if (checkTargetOnly == false)
        {
            p.targetPosition = _v;
        }

        _v.y = 1.0f;
        decal.setPosition(_v);

        return(true);
    }
Exemplo n.º 5
0
    void updateTargetingDecal()
    {
        if (_nowSelectedSkillData == null)
        {
            return;
        }

        if (_nowSelectedSkillData.targeting != TargetingData.NONE)        //checkSkillTarget(true))
        {
            if (_setTarget == false)
            {
                switch (_nowSelectedSkillData.targeting)
                {
                case TargetingData.FIXED_1:

                    //				public int actionSkillTarget = 0;
                    //				public float actionSkillDist = 0.0f;

                    switch (_nowSelectedAISlot.ai.actionSkillTarget)
                    {
                    case -1:                     // 본인.
                        mon.setSkillTarget(mon);
                        mon.targetHeight      = mon.hitObject.height;
                        mon.targetPosition    = mon.cTransformPosition;
                        mon.targetPosition.x += _nowSelectedAISlot.ai.actionSkillDist;
                        mon.targetUniqueId    = mon.stat.uniqueId;
                        decal.setPosition(mon.targetPosition);
                        _decalVisible = true;
                        _setTarget    = true;

                        break;

                    case 0:                     // 플레이어 히어로.
                        mon.setSkillTarget(GameManager.me.player);
                        mon.targetHeight      = GameManager.me.player.hitObject.height;
                        mon.targetPosition    = GameManager.me.player.cTransformPosition;
                        mon.targetPosition.x += _nowSelectedAISlot.ai.actionSkillDist;
                        mon.targetUniqueId    = mon.skillTarget.stat.uniqueId;
                        decal.setPosition(mon.targetPosition);
                        _decalVisible = true;
                        _setTarget    = true;
                        break;

                    default:

                        if (_nowSelectedSkillData.targetType == Skill.TargetType.ME)
                        {
                            mon.setSkillTarget(GameManager.me.characterManager.getCloseMonsterTeamTargetByIndex(_nowSelectedAISlot.ai.actionSkillTarget, mon));
                        }
                        else
                        {
                            mon.setSkillTarget(GameManager.me.characterManager.getCloseEnemyTargetByIndex(false, _nowSelectedAISlot.ai.actionSkillTarget));
                        }

                        if (mon.skillTarget != null)
                        {
                            mon.targetHeight      = mon.skillTarget.hitObject.height;
                            mon.targetPosition    = mon.skillTarget.cTransformPosition;
                            mon.targetPosition.x += _nowSelectedAISlot.ai.actionSkillDist;
                            mon.targetUniqueId    = mon.skillTarget.stat.uniqueId;
                            _decalVisible         = true;
                            decal.setPosition(mon.targetPosition);
                            _setTarget = true;
                        }

                        break;
                    }

                    break;

                case TargetingData.AUTOMATIC_2:
                    _decalVisible = checkSkillTarget(true);
                    _setTarget    = _decalVisible;
                    break;

                case TargetingData.FORWARD_LINEAR_3:

                    if (mon.isVisible)
                    {
                        _decalVisible = checkSkillTarget(true);
                        _setTarget    = _decalVisible;
                    }
                    break;
                }
            }

            if (_decalVisible && _nowSelectedSkillData.targetType == Skill.TargetType.ENEMY)
            {
                if (decal.didStartEffect == false)
                {
                    decal.startDecalEffect();
                }

                decal.visible = true;
            }
            else
            {
                decal.visible = false;
            }
        }
        else
        {
            decal.visible = false;
        }
    }