public override void OnHit(Missile proj, Collision coll) { Damageable dam = coll.collider.GetComponent <Damageable>(); if (!proj.friendlyOff && dam.transform == proj.originator) // if friendly fire is on and the collider is the owner { return; } base.OnHit(proj, coll); // the part where you seduce that PIMPLE-POPPING, NOSE-PICKING, NIPPLE-TWISTING, DICK OF AN ASS. if (dam) { Debug.Log("Duration: " + duration); Debug.Log("Collided Object: " + coll.gameObject); Debug.Log("SpellCaster: " + proj.originator.name); dam.Seduce(duration, coll.gameObject, proj.originator); // BECOME SEDUCED! proj.Die(); // don't need this anymore return; } if (proj.bounceCount <= 0) { proj.Die(); return; } // if the projectile is out of bounces, die. proj.bounceCount--; // apologies, I thought it was kinda funny. Carry on. }
public override void OnHit(Missile proj, Collision coll) { base.OnHit(proj, coll); proj.bounceCount--; explode(proj, coll); if (proj.bounceCount <= 0) { proj.Die(); } }
public override void OnHit(Missile proj, Collision coll) { if (!proj.friendlyOff && coll.transform == proj.originator) { Debug.Log("Friendly Hit!"); return; } base.OnHit(proj, coll); Damageable collDam = coll.collider.GetComponent <Damageable>(); if (collDam) { Vector3 knockBack = (coll.transform.position - proj.transform.position).normalized; knockBack.y = upwardKnockup; knockBack = knockBack.normalized; collDam.TakeDamage(proj.originator, proj.power, knockBack, knockBackForce); SpellCaster originator = proj.originator.GetComponent <SpellCaster>(); originator.invokeChangeFollowers(collDam); // Instantiate special effect proj.Die(); return; } Rigidbody rbody = coll.collider.attachedRigidbody; if (rbody != null) { rbody.AddExplosionForce(knockBackForce, proj.transform.position, 1f); } if (proj.bounceCount <= 0) { proj.Die(); } else { bounce(proj); proj.bounceCount--; } }
public override void OnHit(Missile proj, Collision coll) { base.OnHit(proj, coll); Damageable dam = coll.collider.GetComponent <Damageable>(); if (dam) // if you hit something damageable { dam.Heal(proj.power); // heal damage Transform newHealEffect = Instantiate(healEffect, dam.transform); // apply heal effect newHealEffect.rotation = Quaternion.identity; // make sure it's facing upwards Destroy(newHealEffect.gameObject, 3f); // get rid of heal effect proj.Die(); // destroy projectile return; } if (proj.bounceCount <= 0) // if the projectile has no more bounces { proj.Die(); return; } proj.bounceCount--; // reduce bounces }
public override void OnHit(Missile proj, Collision coll) { if (proj.friendlyOff && coll.transform == proj.originator) { return; } base.OnHit(proj, coll); if (proj.bounceCount <= 0) { GravityWellVortex newGravWell = Instantiate(gravWellPrefab, proj.transform.position, Quaternion.identity); // create gravity well // Instantiate special effect proj.Die(); return; } bounce(proj); proj.bounceCount--; }
public override void OnHit(Missile proj, Collision coll) { base.OnHit(proj, coll); Damageable collDam = coll.collider.GetComponent <Damageable>(); if (collDam) { collDam.InitiateTransmutation(proj.duration, possibleReplacements[Random.Range(0, possibleReplacements.Length)]); SpellCaster originator = proj.originator.GetComponent <SpellCaster>(); originator.invokeChangeFollowers(collDam); } if (proj.bounceCount <= 0) { proj.Die(); return; } bounce(proj); proj.bounceCount--; }
void subBlastHit(Missile proj) { Collider[] colls = Physics.OverlapSphere(proj.transform.position, subRadius); if (colls.Length != 0) { foreach (Collider coll in colls) { Damageable dam = coll.GetComponent <Damageable>(); if (dam) { Vector3 knockBack = (coll.transform.position - proj.transform.position).normalized; knockBack.y = upwardKnockup; knockBack = knockBack.normalized; dam.TakeDamage(proj.originator, proj.power, knockBack, knockBackForce); SpellCaster originator = proj.originator.GetComponent <SpellCaster>(); originator.invokeChangeFollowers(dam); } } } proj.Die(); }