public static void InitProjectileBounceEffect(Projectiles.Projectile projectile) { GameObject eGO = Instantiate(Inst.projectileBouncePrefab, Inst.transform); eGO.name = "ProjectileBounceEffect"; eGO.transform.position = projectile.GetPreviousPosition(); eGO.transform.rotation = projectile.transform.rotation; eGO.transform.localScale *= projectile.FromTurret.GunsCaliber / Global.Effects.PROJECTILE_PEN_EFFECT_SIZEMOD_REFERENCE_CALIBER; Destroy(eGO, eGO.GetComponent <ParticleSystem>().main.duration); }
public override void InflictDamage(DamageZone damageZone, Projectiles.Projectile projectile, DamageParams param = default) { if (PenetrationCheck(projectile, damageZone.Ship.HullArmor, Vector3.Angle(damageZone.Ship.transform.forward, projectile.transform.forward))) { // Penetration effects EffectManager.InitProjectilePenEffect(projectile); damageZone.Ship.Rigidbody.AddForceAtPosition(projectile.Velocity * projectile.FromTurret.GunsCaliber * damageZone.Ship.Armament.GunTurrets[0].ShipRecoil, projectile.GetPreviousPosition(), ForceMode.Impulse); // Add water ingress to ship damageZone.Ship.AddWaterIngress((byte)param.fparam[0]); } else { // Bounce effects EffectManager.InitProjectileBounceEffect(projectile); } }
public override void InflictDamage(DamageZone damageZone, Projectiles.Projectile projectile, DamageParams param = default) { GunTurret turret = ((GameObject)param.oparam[0]).GetComponent <GunTurret>(); if (PenetrationCheck(projectile, turret.TurretArmor, Vector3.Angle(damageZone.Ship.transform.forward, projectile.transform.forward))) { // Penetration effects EffectManager.InitProjectilePenEffect(projectile); damageZone.Ship.Rigidbody.AddForceAtPosition(projectile.Velocity * projectile.FromTurret.GunsCaliber * damageZone.Ship.Armament.GunTurrets[0].ShipRecoil, projectile.GetPreviousPosition(), ForceMode.Impulse); // Destroy Turret turret.Disable(); } else { // Bounce effects EffectManager.InitProjectileBounceEffect(projectile); } }