private void HandleTargetCollisionSlowdown(NPC target) { int slowDuration = GetSlowDuration(); // the beam is too weak to hitstun if (slowDuration * BEAM_SLOW_RECOVERY_THRESHOLD <= 1) { return; } Player player = Main.player[projectile.owner]; MyPlayer modPlayer = player.GetModPlayer <MyPlayer>(); float scalingSlowDown = 1f - (BEAM_SLOWDOWN_INTENSITY); scalingSlowDown *= (float)Math.Sqrt(BeamIntensityPercentage); modPlayer.ApplyHitStun(target, slowDuration, (1f - scalingSlowDown), BEAM_SLOW_RECOVERY_THRESHOLD); }