
// Variables that are used on both client and server

SWEP.Author		= ""
SWEP.Contact		= ""
SWEP.Purpose		= ""
SWEP.Instructions	= ""

SWEP.ViewModel		= "models/weapons/v_pistol.mdl"
SWEP.WorldModel		= "models/weapons/w_camphone.mdl"

util.PrecacheModel( SWEP.ViewModel )
util.PrecacheModel( SWEP.WorldModel )

SWEP.Primary.ClipSize		= -1
SWEP.Primary.DefaultClip	= -1
SWEP.Primary.Automatic		= false
SWEP.Primary.Ammo			= "none"

SWEP.Secondary.ClipSize		= -1
SWEP.Secondary.DefaultClip	= -1
SWEP.Secondary.Automatic	= true
SWEP.Secondary.Ammo			= "none"

SWEP.ShootSound				= "NPC_CScanner.TakePhoto"

/*---------------------------------------------------------
   Precache Stuff
---------------------------------------------------------*/
function SWEP:Precache()
	util.PrecacheSound( self.ShootSound )
end

/*---------------------------------------------------------
	Reload does nothing
---------------------------------------------------------*/
function SWEP:Reload()
end

/*---------------------------------------------------------
   Think does nothing
---------------------------------------------------------*/
function SWEP:Think()	
end

/*---------------------------------------------------------
   The effect when a weapon is fired successfully
---------------------------------------------------------*/
function SWEP:DoShootEffect()

	self.Weapon:EmitSound( self.ShootSound	)
	self.Weapon:SendWeaponAnim( ACT_VM_PRIMARYATTACK )
	self.Owner:SetAnimation( PLAYER_ATTACK1 )
	
end



/*---------------------------------------------------------
	PrimaryAttack
---------------------------------------------------------*/
function SWEP:PrimaryAttack()

	self:DoShootEffect()
	
	// If we're multiplayer this can be done totally clientside
	if (!SinglePlayer() && SERVER) then return end
	
	self.Owner:ConCommand( "jpeg" )
	
end

/*---------------------------------------------------------
	SecondaryAttack
---------------------------------------------------------*/
function SWEP:SecondaryAttack()

	if (CLIENT) then return end
	
	if (self.FOV == nil) then self.FOV = self.Owner:GetFOV() end
	
	// Adjust FOV
	local cmd = self.Owner:GetCurrentCommand()
	self.FOV = self.FOV + cmd:GetMouseY() * 0.1
	
	self.FOV = math.Clamp( self.FOV, 1, 170 )
	
	self.Owner:SetFOV( self.FOV, 0.07 )
	
end


function SWEP:Deploy()

	if (CLIENT) then return end
	
	self.Owner:DrawViewModel( false )

	if (self.FOV == nil) then
		self.FOV = self.Owner:GetFOV()
	end
	
	self.Owner:SetFOV( self.FOV, 0.4 )
	
end
