Esempio n. 1
0
 protected override void effectSetting_OnSpellCollision(ColliderEventArgs args, Collider obj)
 {
     base.effectSetting_OnSpellCollision(args, obj);
     Entity e = effectSetting.spell.SpellTargetTransform.GetComponent<Entity>();
     if (e != null)
         effectSetting.TriggerApplySpell(e);
 }
Esempio n. 2
0
 /// <summary>
 /// Calling this will trigger a collision in all of the spell effects
 /// </summary>
 /// <param name="args"></param>
 /// <param name="other"></param>
 public void TriggerCollision(ColliderEventArgs args, Collider other)
 {
     if (OnSpellCollision != null)
         OnSpellCollision(args, other);
     if (destroyOnCollision)
     {
         TriggerDestroySpell();
     }
 }
Esempio n. 3
0
 protected override void effectSetting_OnSpellCollision(ColliderEventArgs args, Collider obj)
 {
     base.effectSetting_OnSpellCollision(args, obj);
     if (obj.gameObject.layer == LayerMask.NameToLayer("Entity"))
     {
         Entity e = obj.gameObject.GetComponent<Entity>();
         if (e != null)
             effectSetting.TriggerApplySpell(e);
     }
 }
    public void TryTriggerCollision(ColliderEventArgs args, Collider c)
    {
        // Don't trigger with a mood box
        if (c.gameObject.layer == LayerMask.NameToLayer("MoodBox"))
            return;

        if (c.gameObject.layer == LayerMask.NameToLayer("Entity"))
        {
            Entity e = c.gameObject.GetComponent<Entity>();

            if (e == null || effectSetting.spell.IgnoreEntities.Contains(e))
                return;

            switch (TargetEntityMethod)
            {
                case MotorTargetEntityMethod.Enemy:
                    if (!effectSetting.spell.CastingEntity.IsEnemy(e))
                    {
                        return;
                    }
                    break;
                case MotorTargetEntityMethod.Friendly:
                    if (effectSetting.spell.CastingEntity.IsEnemy(e))
                    {
                        return;
                    }
                    break;
            }
            
            switch (EntityTriggerState)
            {
                case MotorEntityTriggerState.Dead:
                    if (e.LivingState != EntityLivingState.Dead)
                        return;
                    break;
                case MotorEntityTriggerState.Living:
                    if (e.LivingState != EntityLivingState.Alive)
                        return;
                    break;
            }
        }

        effectSetting.TriggerCollision(new ColliderEventArgs(), c);
    }
Esempio n. 5
0
 protected virtual void OnCollisionStay(ColliderEventArgs colliderArgs)
 {
 }
Esempio n. 6
0
 protected virtual void OnCollisionEnter(ColliderEventArgs colliderArgs)
 {
 }
 protected override void effectSetting_OnSpellCollision(ColliderEventArgs args, Collider obj)
 {
     base.effectSetting_OnSpellCollision(args, obj);
     _audioSource.PlayOneShot(audioClip);
 }
Esempio n. 8
0
 protected virtual void effectSetting_OnSpellCollision(ColliderEventArgs args, Collider obj)
 {
 }
 /// <summary>
 /// Triggers an event when on a collision has been cast and if the trigger event is set to OnCollision
 /// </summary>
 protected override void effectSetting_OnSpellCollision(ColliderEventArgs args, Collider obj)
 {
     base.effectSetting_OnSpellCollision(args, obj);
         if (_triggerEvent == SpellEffectTriggerEvent.Collision)
             EventTriggered(new SpellEffectStandardEventArgs(SpellEffectTriggerEvent.Collision) { Collider = obj, TargetPosition = args.HitPoint });
 }