Exemple #1
0
 protected virtual void OnPerformAbility(Entity ent, AbilityCastData castData)
 {
     AbilityPerformer.HandleAbilityCastDataVisual(castData);
     if (castData.AbilityCast.Main.RotateOnCast == true)
     {
         RotateTowardsCastDirection(castData);
     }
 }
Exemple #2
0
            protected virtual void PerformAbility(AbilityCastData castData)
            {
                if (castData.AbilityCast.Methods.CastOriginTiming == AbilityCastOriginTiming.PerformEntrance)
                {
                    castData.FillOrigin(DetermineCastOrigin(castData.AbilityCast));
                }

                OnPerformAbility.Invoke(master, castData);

                castData.OnResultEmitted.Subscribe(OnCastDataEmitResult);
                AbilityPerformer.PerformAbility(castData);

                OnAbilityPerformed.Invoke(master, castData);
            }
        private void HandleMovingHitEntities()
        {
            Entity[] hitEntities;
            AbilityPerformer.AdditionalHitInfos[] hitEntitiesInfos;
            var everything = AbilityPerformer.ComputeMovingHitboxHitEntities(_castData, transform.position, _currentMoveSpeed);

            hitEntities      = everything.Item1;
            hitEntitiesInfos = everything.Item2;

            if (_hitboxData.SameTargetHitPeriod > 0f)
            {
                for (int i = 0; i < hitEntities.Length; i++)
                {
                    if (_hitEntitiesDic.ContainsKey(hitEntities[i]))
                    {
                        if (Time.time - _hitEntitiesDic[hitEntities[i]] < _hitboxData.SameTargetHitPeriod)
                        {
                            continue;
                        }
                        else
                        {
                            _hitEntitiesDic[hitEntities[i]] = Time.time;
                        }
                    }
                    else
                    {
                        _hitEntitiesDic.Add(hitEntities[i], Time.time);
                    }

                    ApplyHitOnEntity(hitEntities[i], hitEntitiesInfos[i]);
                }
            }
            else
            {
                hitEntities = AbilityPerformer.ComputeStaticHitboxHitEntities(_castData, transform.position, _hitEntitiesDic.Keys);
                for (int i = 0; i < hitEntities.Length; i++)
                {
                    if (_hitEntitiesDic.ContainsKey(hitEntities[i]))
                    {
                        continue;
                    }

                    _hitEntitiesDic.Add(hitEntities[i], Time.time);
                    ApplyHitOnEntity(hitEntities[i], hitEntitiesInfos[i]);
                }
            }
        }
        private void ApplyHitOnEntity(Entity ent, AbilityPerformer.AdditionalHitInfos infos)
        {
            AbilityCastResult result = null;

            if (infos != null)
            {
                result = new AbilityCastResult(_castData);
                Vector3 impact = infos.Hit.point;
                if (impact.sqrMagnitude <= Mathf.Epsilon)
                {
                    impact = infos.RayOrigin;
                }
                result.FillImpact(impact);
            }
            AbilityPerformer.ApplyAbilityPerformedOnHitEntity(_castData, ent, result);
            HandleCheckHitboxLife();
        }
        private void HandleStaticHitEntities()
        {
            Entity[] hitEntities;
            if (_hitboxData.SameTargetHitPeriod > 0f)
            {
                hitEntities = AbilityPerformer.ComputeStaticHitboxHitEntities(_castData, transform.position);
                for (int i = 0; i < hitEntities.Length; i++)
                {
                    if (_hitEntitiesDic.ContainsKey(hitEntities[i]))
                    {
                        if (Time.time - _hitEntitiesDic[hitEntities[i]] < _hitboxData.SameTargetHitPeriod)
                        {
                            continue;
                        }
                        else
                        {
                            _hitEntitiesDic[hitEntities[i]] = Time.time;
                        }
                    }
                    else
                    {
                        _hitEntitiesDic.Add(hitEntities[i], Time.time);
                    }

                    ApplyHitOnEntity(hitEntities[i], null);
                }
            }
            else
            {
                hitEntities = AbilityPerformer.ComputeStaticHitboxHitEntities(_castData, transform.position, _hitEntitiesDic.Keys);
                for (int i = 0; i < hitEntities.Length; i++)
                {
                    if (_hitEntitiesDic.ContainsKey(hitEntities[i]))
                    {
                        continue;
                    }

                    _hitEntitiesDic.Add(hitEntities[i], Time.time);
                    ApplyHitOnEntity(hitEntities[i], null);
                }
            }
        }
Exemple #6
0
 private void OnDeath(Entity ent, AbilityCastResult killingResult)
 {
     AbilityPerformer.HandleAbilityCastResultFX(killingResult, Data._deathFX);
 }
Exemple #7
0
 private void OnAbilityHitResult(Entity ent, AbilityCastResult result)
 {
     AbilityPerformer.HandleAbilityCastResultVisual(result);
 }