Exemplo n.º 1
0
 protected override void ActiceLogicSelf(RangerAgent.FirePort rfp)
 {
     if (rfp != null && rfp.IsOverride)
     {
         _maxJumpCount = rfp.AttackCount;
     }
 }
Exemplo n.º 2
0
 protected override void ActiceLogicSelf(RangerAgent.FirePort rfp)
 {
     if (_owner.FireTarget != null)
     {
         ThisTransform.position = _owner.FireTarget.ThisTransform.localPosition;
         Vector2 radius = Random.insideUnitCircle;
         Vector3 r3     = Vector3.zero;
         r3.x += radius.x;
         r3.z += radius.y;
         if (r3 != Vector3.zero)
         {
             ThisTransform.forward = r3;
         }
     }
     else
     {
         Vector2 radius = Random.insideUnitCircle * 0.5f;
         Vector3 r3     = Vector3.zero;
         r3.x += radius.x;
         r3.z += radius.y;
         ThisTransform.position = _owner.ThisTransform.localPosition + r3;
         radius = Random.insideUnitCircle;
         r3     = Vector3.zero;
         r3.x  += radius.x;
         r3.z  += radius.y;
         if (r3 != Vector3.zero)
         {
             ThisTransform.forward = r3;
         }
         //_owner.SelfMoveAgent.Move(r3);
     }
 }
Exemplo n.º 3
0
    public override void FireRanger(ActionController target, Transform firePoint, RangerAgent.FirePort rfp)
    {
        RangerAgent.FireRangeInfo fri = rfp._rangeInfo;
        base.FireRanger(target, firePoint, rfp);
        _attackInfo._attackPoints = _owner.TotalAttackPoints;
        _step = 0;
        _damageReceiver.SetRadius(_startRadus);

        if (fri != null)
        {
            _damageScale              = rfp.DamageScale;
            _fireMaxRaduis            = 1f * fri._param1;
            _followAnchor             = fri._needAnchor;
            _hitInfo[_step]._lifeTime = fri._effectTime;
            _attackInfo._damageScale  = _damageScale;
        }
        _deadTime        = -1;
        _target          = null;
        _isFrom2P        = _owner.IsClientPlayer;
        ThisObject.layer = (int)_faction + 1;


        ThisTransform.localPosition = firePoint.position;
        ThisTransform.forward       = _owner.ThisTransform.forward;
        _attackInfo._hitType        = _hitInfo[_step]._hitType;

        _firePoint = firePoint;

        _enableDamage = false;
        ActiveLogic(rfp);
    }
    public override void FireRanger(ActionController target, Transform firePoint, RangerAgent.FirePort rfp)
    {
        _duration            = rfp._attribute1;
        _curLevelTargetCount = Mathf.RoundToInt(rfp._attribute2);
        _damageReceiver.SetRadius(rfp._rangeInfo._param1);
        RangerAgent.FireRangeInfo fri = rfp._rangeInfo;
        base.FireRanger(target, firePoint, rfp);
        _attackInfo._attackPoints       = _owner.TotalAttackPoints;
        _attackInfo._criticalChance     = _owner.Data.TotalCritRate;
        _attackInfo._criticalDamage     = _owner.Data.TotalCritDamage;
        _attackInfo._skillTriggerChance = _owner.Data.TotalSkillTriggerRate;
        _attackInfo._skillAttackDamage  = _owner.Data.TotalSkillAttackDamage;
        if (fri != null)
        {
            _damageScale             = rfp.DamageScale;
            _attackInfo._effectTime  = fri._effectTime;
            _attackInfo._damageScale = _damageScale;
        }
        if (_hitInfo.Length > 0)
        {
            Assertion.Check(_hitInfo.Length == 1);
            _attackInfo._hitType = _hitInfo[0]._hitType;
        }

        _target          = null;
        _isFrom2P        = _owner.IsClientPlayer;
        ThisObject.layer = (int)_faction + 1;

        ThisTransform.localPosition = firePoint.position;

        _firePoint = firePoint;

        ActiveLogic(rfp);
    }
Exemplo n.º 5
0
    public override bool InitSkillData(SkillData skillData, AIAgent owner)
    {
        bool ret = base.InitSkillData(skillData, owner);

        if (ret)
        {
            RangerAgent.FirePort fp = _owner.ACOwner.ACGetFirePort(_fireInfos[0].FirePortIdx);
            fp._fireCount = 1;
        }
        return(ret);
    }
 protected override void OverrideFirePort(RangerAgent.FirePort firePort, SkillData skillData)
 {
     //firePort._rangeInfo._param1 = skillData.CurrentLevelData._attackRange;
     firePort._rangeInfo._effectTime = skillData.CurrentLevelData.attackEffectTime;
     firePort.DamageScale            = firePort.DamageScaleSource * skillData.CurrentLevelData.damageScale;
     //need not override fire count
     //firePort._fireCount = _skillData.CurrentLevelData._bulletEquotient;
     firePort.DotDamageTime = _skillData.CurrentLevelData.dotDamageTime;
     firePort._attribute1   = skillData.CurrentLevelData.attribute1;
     firePort._attribute2   = skillData.CurrentLevelData.attribute2;
     firePort.AttackCount   = skillData.CurrentLevelData.attackNumber;
 }
Exemplo n.º 7
0
    protected void ActiveLogic(RangerAgent.FirePort rfp)
    {
        if (GameManager.Instance.IsPVPMode)
        {
            _canHitAll = true;
        }

        _curBombPosition = BOMB_POSITION.AT_DEAD;
        if (_moveAgent != null)
        {
            _moveAgent.enabled = true;
        }
        if (_bulletDisplayers != null)
        {
            if (_bulletDisplayers.Length == 1)
            {
                _currentEffectIndex = 0;
            }
            else if (_bulletDisplayers.Length > 1)
            {
                _currentEffectIndex = Random.Range(0, _bulletDisplayers.Length - 1);
            }
            if (_currentEffectIndex >= 0)
            {
                _bulletDisplayers[_currentEffectIndex].StartEffect();
            }
        }
        if (_sfxFireName != "")
        {
            Debug.Log("bullet +" + _sfxFireName);
            SoundManager.Instance.PlaySoundEffect(_sfxFireName);
        }
        ActiceLogicSelf(rfp);
        if (_firePortLifeInIdx > -1)
        {
            FireByPort(_firePortLifeInIdx);
        }
        if (_hasGEffect)
        {
            EffectByGravity(_gSpeed, null, _gDirection, 999, false, false);
        }
        if (_damageReceiver != null && !_needNotHitID)
        {
            _damageReceiver._hitID = GameManager.GainHitID();
        }
        if (_shakePos == SHAKE_POS.AT_BEGIN)
        {
            CameraController.Instance.StartCameraEffect(EnumCameraEffect.none, _shakeLevel, false);
        }
        StartCoroutine(STATE());
    }
Exemplo n.º 8
0
 protected override void ActiceLogicSelf(RangerAgent.FirePort rfp)
 {
     if (_owner.TargetAC != null)
     {
         ThisTransform.position = _owner.TargetAC.ThisTransform.localPosition;
     }
     else
     {
         Vector2 radius = Random.insideUnitCircle * 5;
         Vector3 r3     = Vector3.zero;
         r3.x += radius.x;
         r3.z += radius.y;
         ThisTransform.position = _owner.ThisTransform.localPosition + r3;
     }
 }
Exemplo n.º 9
0
    public override void FireRanger(ActionController target, Transform firePoint, RangerAgent.FirePort rfp)
    {
        int index = Mathf.RoundToInt(rfp._attribute1);

        _renderer.SetColor(_levelColor[index]);
        Vector3 scale = _lineTransform.localScale;

        scale.x = _levelWidth[index];
        _lineTransform.localScale = scale;

        RangerAgent.FireRangeInfo fri = rfp._rangeInfo;
        base.FireRanger(target, firePoint, rfp);
        _attackInfo._attackPoints       = _owner.TotalAttackPoints;
        _attackInfo._criticalChance     = _owner.Data.TotalCritRate;
        _attackInfo._criticalDamage     = _owner.Data.TotalCritDamage;
        _attackInfo._skillTriggerChance = _owner.Data.TotalSkillTriggerRate;
        _attackInfo._skillAttackDamage  = _owner.Data.TotalSkillAttackDamage;
        if (fri != null)
        {
            _damageScale             = rfp.DamageScale;
            _attackInfo._effectTime  = fri._effectTime;
            _attackInfo._damageScale = _damageScale;
        }
        if (_hitInfo.Length > 0)
        {
            Assertion.Check(_hitInfo.Length == 1);
            _attackInfo._hitType = _hitInfo[0]._hitType;
        }

        _target          = null;
        _isFrom2P        = _owner.IsClientPlayer;
        ThisObject.layer = (int)_faction + 1;

        ThisTransform.localPosition = firePoint.position;

        _firePoint = firePoint;

        ActiveLogic(rfp);
    }
Exemplo n.º 10
0
    public override bool InitSkillData(SkillData skillData, AIAgent owner)
    {
        bool ret = true;

        if (skillData != null)
        {
            _owner = owner as AIAgent;
            if (_skillData != skillData && skillData != null)
            {
                _skillData = skillData;
            }
            InitEnergyCost(_owner.ACOwner.Data.TotalReduceEnergy);
            _damageScale = _damageScaleSource * skillData.CurrentLevelData.damageScale;
            if (_fireInfos != null && _fireInfos.Length != 0)
            {
                foreach (FireportInfo fpi in _fireInfos)
                {
                    if (/*fpi.FirePortIdx < 0 && */ fpi._firePortName != "")
                    {
                        fpi.FirePortIdx = _owner.ACOwner.ACGetFirePortIndex(fpi._firePortName);
                        RangerAgent.FirePort fp = _owner.ACOwner.ACGetFirePort(fpi.FirePortIdx);
                        //if(!fp.IsOverride)
                        {
                            OverrideFirePort(fp, skillData);
                            fp.IsOverride = true;
                        }
                    }
                }
            }
        }
        else
        {
            ret          = false;
            _damageScale = _damageScaleSource;
        }
        return(ret);
    }
Exemplo n.º 11
0
    public override void FireRanger(ActionController target, Transform firePoint, RangerAgent.FirePort rfp)
    {
        RangerAgent.FireRangeInfo fri = rfp._rangeInfo;
        base.FireRanger(target, firePoint, rfp);
        _attackInfo._attackPoints = _owner.TotalAttackPoints;
        if (fri != null)
        {
            _damageScale = rfp.DamageScale;
            _damageReceiver.SetRadius(fri._param1);
            _followAnchor            = fri._needAnchor;
            _attackInfo._effectTime  = fri._effectTime;
            _attackInfo._damageScale = _damageScale;
        }

        _deadTime        = -1;
        _target          = null;
        _isFrom2P        = _owner.IsClientPlayer;
        ThisObject.layer = (int)_faction + 1;
        _step            = 0;

        ThisTransform.localPosition = firePoint.position;
        _attackInfo._hitType        = _hitInfo[_step]._hitType;

        _firePoint = firePoint;

        if (_attackInfo._hitType == AttackHitType.BlackHole ||
            _attackInfo._hitType == AttackHitType.ParrySuccess)
        {
            _enableDamage = false;
        }
        else
        {
            //_enableDamage = true;
        }
        ActiveLogic(rfp);
    }
Exemplo n.º 12
0
 //some kind of may want to do some thing before bullet fire
 //should be override by sub class
 protected virtual void ActiceLogicSelf(RangerAgent.FirePort rfp)
 {
 }
Exemplo n.º 13
0
    //must not be override by any other child class
    public void Fire(ActionController target, Transform firePoint, int angleOffset, int angleOffsetY, float lifeTime, RangerAgent.FirePort rfp)
    {
        _isDead = false;
        _attackInfo._isFromSkill = rfp.IsFromSkill;

        _lifeTime                       = lifeTime;
        _deadTime                       = -1;
        _target                         = target;
        _isFrom2P                       = _owner.IsClientPlayer;
        ThisObject.layer                = (int)_faction + 1;
        _firePoint                      = firePoint;
        _step                           = 0;
        _attackInfo._attackPoints       = _owner.TotalAttackPoints;
        _attackInfo._criticalChance     = _owner.Data.TotalCritRate;
        _attackInfo._criticalDamage     = _owner.Data.TotalCritDamage;
        _attackInfo._skillTriggerChance = _owner.Data.TotalSkillTriggerRate;
        _attackInfo._skillAttackDamage  = _owner.Data.TotalSkillAttackDamage;
        _attackInfo._pushStrength       = _pushStrength;
        _attackInfo._pushTime           = _pushTime;
        _attackInfo._pushAngle          = _pushAngle;
        _attackInfo._pushByPoint        = _pushByPoint;
        RangerAgent.FireRangeInfo fri = rfp._rangeInfo;
        if (angleOffsetY != 0)
        {
            _enableSpeedY = true;
            _fireAngleY   = angleOffsetY;
        }
        if (fri != null)
        {
            _attackInfo._effectTime = fri._effectTime;
        }
        //_damageScale = rfp.DamageScale;
        if (!_owner.IsPlayer && _owner.ACGetCurrentAttack() != null)
        {
            _attackInfo._damageScale = _damageScale * _owner.ACGetCurrentAttack().DamageScale;
        }
        else
        {
            _attackInfo._damageScale = _damageScale * rfp.DamageScale;
        }
        if (_firePorts != null && _firePorts.Length != 0)
        {
            foreach (RangerAgent.FirePort pt in _firePorts)
            {
                pt.IsFromSkill = rfp.IsFromSkill;
                pt.DamageScale = _attackInfo._damageScale;
            }
        }

        ThisTransform.localPosition = firePoint.position;
        if (rfp._shootByFirePointDirection)
        {
            ThisTransform.forward = firePoint.forward;
        }
        else if (target != null)
        {
            if (target.ThisTransform.localPosition != ThisTransform.localPosition)
            {
                Vector3 d3 = target.ThisTransform.localPosition - ThisTransform.localPosition;
                d3.y = 0;
                ThisTransform.forward = d3;
            }
            else
            {
                ThisTransform.forward = _owner.ThisTransform.forward;
            }
        }
        else
        {
            ThisTransform.forward = _owner.ThisTransform.forward;
        }
        if (angleOffset != 65535)
        {
            ThisTransform.Rotate(new Vector3(0, angleOffset, 0));
        }
        if (rfp.IsOverride && _hitInfo != null && _hitInfo.Length > 0)
        {
            foreach (Eot eot in _hitInfo[_step]._eots)
            {
                eot.lastTime = rfp.DotDamageTime;
            }
        }
        //add record to remeber ther port name
        // for if some one want to kill bullet
        _firePortName = rfp._portName;
        ActiveLogic(rfp);
    }
Exemplo n.º 14
0
 // must override by bullet ranger
 public virtual void FireRanger(ActionController target, Transform firePoint, RangerAgent.FirePort rfp)
 {
     _isDead = false;
     _attackInfo._isFromSkill = rfp.IsFromSkill;
     _firePortName            = rfp._portName;
 }
Exemplo n.º 15
0
 protected override void OverrideFirePort(RangerAgent.FirePort firePort, SkillData skillData)
 {
     firePort.DamageScale = firePort.DamageScaleSource * skillData.CurrentLevelData.damageScale;
 }