Example #1
0
        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);
            }
        }
Example #2
0
        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);
            }
        }
Example #3
0
 public abstract void InflictDamage(
     DamageZone damageZone,
     Projectiles.Projectile projectile,
     DamageParams param = default
     );