void OnTriggerEnter(Collider other) { if ((other.CompareTag(Strings.Tags.ENEMY) || other.CompareTag(Strings.Tags.PLAYER))) { if (projectileProperties.shooterInstanceID != other.gameObject.GetInstanceID()) { IDamageable damageable = other.GetComponent <IDamageable>(); IMovable moveable = other.GetComponent <IMovable>(); if (!damageable.IsNull()) { damager.Set(projectileProperties.damage * damageMultiplier, DamagerType.Geyser, Vector3.down); // Shooter is player AnalyticsManager.Instance.AddModDamage(ModType.Geyser, damager.damage); if (damageable.GetHealth() - damager.damage <= 0.01f) { AnalyticsManager.Instance.AddModKill(ModType.Geyser); } damageable.TakeDamage(damager); } if (!moveable.IsNull()) { moveable.AddDecayingForce(Vector3.up * upForce); } } } }
void OnTriggerEnter(Collider other) { if (!objectsHitThisGush.Contains(other.gameObject)) { if (projectileProperties.shooterInstanceID != other.gameObject.GetInstanceID()) { objectsHitThisGush.Add(other.gameObject); IDamageable damageable = other.GetComponent <IDamageable>(); if (damageable.IsNull()) { damager.Set(projectileProperties.damage, DamagerType.Geyser, Vector3.down); if (isPlayer) { AnalyticsManager.Instance.AddModDamage(ModType.Geyser, damager.damage); if (damageable.GetHealth() - damager.damage <= 0.01f) { AnalyticsManager.Instance.AddModKill(ModType.Geyser); } } damageable.TakeDamage(damager); } IMovable moveable = other.GetComponent <IMovable>(); if (!moveable.IsNull()) { moveable.AddDecayingForce(Vector3.up * upForce * transform.localScale.magnitude); } } } }
private void Push(IMovable movable) { Vector3 forceDirection = transform.forward; if (movable != null) { movable.AddDecayingForce(forceDirection.normalized * shooterProperties.pushForce); } }
void OnTriggerStay(Collider col) { im = col.gameObject.GetComponent <IMovable>(); if (!im.IsNull()) { im.AddDecayingForce(pushVector); } }