public void ResolveCollision(CombatantManager other) { if (other.Team != Originator.Team) { Vector2 knockback = other.GetPosition() - Originator.GetPosition(); knockback = knockback.normalized * 5; int exp = other.RecieveHit(this, Damage, knockback); Originator.RecieveExp(exp); } }
/// <summary> /// Administer damage and experience as the result of a collision with this attack /// </summary> /// <param name="other"> /// The CombatantManager of the enemy or player recieving the attack /// </param> public void ResolveCollision(CombatantManager other) { if (other.Team != Originator.Team) { Vector2 knockback = other.GetPosition() - Originator.GetPosition(); knockback = knockback.normalized * 0.5f; int exp = other.RecieveHit(this, Damage, knockback); Originator.RecieveExp(exp); Expire(); GameObject.Destroy(Bolt.gameObject); } }
public void ResolveCollision(CombatantManager other) { if (other.Team != Originator.Team) { Vector2 DashNormal = Helpers.ClockwiseNormalVector(DashVector).normalized * 2; Vector2 enemyVector = other.GetPosition() - Position; float angle = Vector2.SignedAngle(DashVector, enemyVector); if (angle > 0) { DashNormal *= -1; } int exp = other.RecieveHit(this, Damage, DashNormal); Originator.RecieveExp(exp); } }