Example #1
0
    private void OnTriggerExit(Collider other)
    {
        if (other.tag == Tag)
        {
            CharacterAttention OtherAttention = other.gameObject.GetComponent <CharacterAttention>();

            if (OtherAttention.GetOwner().GetAlignment() == Character.TeamAlignment.PLAYERS)
            {
                if (other.gameObject.layer != CharacterDeadLayerID ||
                    Owner.GetAlignment() == Character.TeamAlignment.PLAYERS)
                {
                    PlayerLeavesAttentionRange(OtherAttention.GetOwner());
                }
            }
            else
            {
                EnemyLeavesAttentionRange(OtherAttention.GetOwner());
            }
        }
        else if (other.tag == TagHitObjects)
        {
            SkillHitObject OtherHitObject = other.gameObject.GetComponent <SkillHitObject>();

            if ((OtherHitObject.GetAlignment() == Character.TeamAlignment.ALL ||
                 OtherHitObject.GetAlignment() == Character.TeamAlignment.ENEMIES) &&
                OtherHitObject.GetOwnerAlignment() == Character.TeamAlignment.PLAYERS)
            {
                PlayerHitObjectsInRange.Remove(OtherHitObject);
                OtherHitObject.RemoveInCharactersAttention(this);
            }
        }
    }
Example #2
0
    private void OnTriggerEnter(Collider other)
    {
        if (other.tag == Tag)
        {
            CharacterAttention OtherAttention = other.gameObject.GetComponent <CharacterAttention>();

            if (OtherAttention.GetOwner().GetAlignment() == Character.TeamAlignment.PLAYERS)
            {
                PlayerEntersAttentionRange(OtherAttention.GetOwner());
            }
            else
            {
                EnemyEntersAttentionRange(OtherAttention.GetOwner());
            }
        }
        else if (other.tag == TagHitObjects || other.tag == TagPlayerHitObjects)
        {
            SkillHitObject OtherHitObject = other.gameObject.GetComponent <SkillHitObject>();

            if ((OtherHitObject.GetAlignment() == Character.TeamAlignment.ALL ||
                 OtherHitObject.GetAlignment() == Character.TeamAlignment.ENEMIES) &&
                OtherHitObject.GetOwnerAlignment() == Character.TeamAlignment.PLAYERS)
            {
                PlayerHitObjectsInRange.Add(OtherHitObject);
                OtherHitObject.AddInCharactersAttention(this);
            }
        }
    }
Example #3
0
 public void RemoveHitObjectAfterDestroy(SkillHitObject DestroyedHitObject)
 {
     if ((DestroyedHitObject.GetAlignment() == Character.TeamAlignment.ALL ||
          DestroyedHitObject.GetAlignment() == Character.TeamAlignment.ENEMIES) &&
         DestroyedHitObject.GetOwnerAlignment() == Character.TeamAlignment.PLAYERS)
     {
         PlayerHitObjectsInRange.Remove(DestroyedHitObject);
     }
 }
Example #4
0
    public override void UpdateSkillActivation(ItemSkill SourceItemSkill, float CurrentActivationTime, bool StillActivating, bool ActivationIntervallReached)
    {
        if (CurrentActivationTime < ActivationTime)
        {
            return;
        }

        // Spawn and Initialize Projectile:
        SkillHitObject SpawnedHitObject = Instantiate(HitObjectPrefab, SourceItemSkill.transform.position, SourceItemSkill.GetCurrentOwner().transform.rotation);

        if (SpawnSound)
        {
            var audioSource = SpawnedHitObject.gameObject.GetComponent <AudioSource>();
            if (!audioSource)
            {
                audioSource = SpawnedHitObject.gameObject.AddComponent <AudioSource>();
            }
            audioSource.clip = SpawnSound;
            if (LoopSound)
            {
                audioSource.loop           = LoopSound;
                SpawnedHitObject.FadeSound = true;
                SpawnedHitObject.StartCoroutine(FadeAudioIn(audioSource, .5f));
            }
            else
            {
                audioSource.Play();
            }
        }

        SpawnedHitObject.InitializeHitObject(SourceItemSkill.GetCurrentOwner(), SourceItemSkill, this, UseSkillLevelAtActivationMoment);

        // Stop Skill Activation:
        if (Cooldown > 0)
        {
            SourceItemSkill.SetCurrentCooldown(Cooldown);
        }
        RemoveActivationMovementRateModifier(SourceItemSkill, SourceItemSkill.GetCurrentOwner());
        SourceItemSkill.StoppedActivatingSkillWithHitObjects(this);
        SourceItemSkill.FinishedSkillActivation();
    }
Example #5
0
 public bool RemoveEffectSkillHitObject(SkillHitObject HitObject)
 {
     return(EffectSkillHitObjects.Remove(HitObject));
 }
Example #6
0
 public void AddEffectSkillHitObject(SkillHitObject HitObject)
 {
     EffectSkillHitObjects.Add(HitObject);
 }