Weapons/ToolGun/ToolMode.Effects.cs

Part of the ToolMode class for the ToolGun. Implements network-broadcasted visual/audio effects when the tool shoots, validating the tool, owner, and target, then invoking Toolgun.PlayToolEffects with the target world transform. Also defines an empty ShootFailEffects override point.

Networking
public abstract partial class ToolMode
{
	[Rpc.Broadcast]
	public virtual void ShootEffects( SelectionPoint target )
	{
		if ( !Toolgun.IsValid() ) return;

		var player = Toolgun.Owner;
		if ( !player.IsValid() ) return;

		if ( !target.IsValid() )
		{
			Log.Warning( "ShootEffects: Unknown object" );
			return;
		}

		Toolgun.PlayToolEffects( target.WorldTransform() );
	}

	public virtual void ShootFailEffects( SelectionPoint target )
	{

	}

}