Example #1
0
 public virtual void Damage(Collider hitCollider, Vector3 position, Vector3 direction, Missile missile)
 {
     if (IsLive)
     {
         ApplyDamage(missile.GetDamage(), missile.GetOwner());
         if (OnDamage != null)
             OnDamage(hitCollider, position, direction, missile.GetPower(), missile.GetDamage(), missile.GetOwner());
     }
 }
Example #2
0
 public virtual void Damage(Collider hitCollider, Vector3 position, Vector3 direction, float power, float damage, Missile missile)
 {
     if (IsLive)
     {
         ApplyDamage(damage, missile.GetOwner());
         if (OnDamage != null)
         {
             OnDamage(hitCollider, position, direction, power, damage, missile.GetOwner());
         }
     }
 }
Example #3
0
 public override void Damage(Collider hitCollider, Vector3 position, Vector3 direction, Missile missile)
 {
     killPosition = position;
     killDirection = direction;
     killPower = missile.GetPower();
     var damageAmount = missile.GetDamage();
     if (hitCollider == HeadCollider)
     {
         Debug.Log("HEADSHOT!");
         damageAmount *= 10f;
     }
     base.Damage(hitCollider, position, direction, killPower, damageAmount, missile.GetOwner());
 }
Example #4
0
 public void Trigger(Missile missile)
 {
     //Debug.Log("MISSILE SENSOR TRIGGERED!!!!");
     var missileOwner = missile.GetOwner();
     if (missileOwner != null)
     {
         var missileOwnerActor = missileOwner.GetComponentInParent<ActorAgent>();
         if (missileOwnerActor != null)
         {
             if (missileOwnerActor.Team == opposingTeam)
             {
                 var target = Targeting.FindNearest(opposingTeam, owner.GetVehicle().transform.position, 500f);
                 owner.SetTarget(target);
             }
         }
     }
 }
Example #5
0
    public void Trigger(Missile missile)
    {
        //Debug.Log("MISSILE SENSOR TRIGGERED!!!!");
        var missileOwner = missile.GetOwner();

        if (missileOwner != null)
        {
            var missileOwnerActor = missileOwner.GetComponentInParent <ActorAgent>();
            if (missileOwnerActor != null)
            {
                if (missileOwnerActor.Team == opposingTeam)
                {
                    var target = Targeting.FindNearest(opposingTeam, owner.GetVehicle().transform.position, 500f);
                    owner.SetTarget(target);
                }
            }
        }
    }