_OpenScript( "includes/vector3.lua" );
MyIndex = 0;
Owner = 0;
CurrentTime = 0;
function onInit()
	_SWEPSetSound( MyIndex, "single shot", "weapon_physcannon.launch");
end

function onThink( )

end

function onPrimaryAttack( )
	local vPlayerAng = _PlayerGetShootAng( Owner );	if (vPlayerAng == nil) then _Msg("Playerang was null!\n") return; end;
	local vPlayerVel = vecMul( vPlayerAng, vector3(200, 200, -200) );	_EntSetVelocity( Owner, vPlayerVel );
	_PlaySoundPlayer(Owner,"/ambient/explosions/exp4.wav");
		_EffectSetOrigin(_PlayerGetShootPos(Owner));
		_EffectDispatch( "MuzzleFlash" );
	_ScreenText( Owner, "Jetpack Accelerating!", 1.75, -.45, 255, 255, 255, 100, 1, 1, 1, 0, 5 )
	_SWEPUseAmmo( MyIndex, 0, 1 );
end

function onSecondaryAttack( )
	local vPlayerAng = _PlayerGetShootAng( Owner );	if (vPlayerAng == nil) then _Msg("Playerang was null!\n") return; end;
	local vPlayerVel = vecMul( vPlayerAng, vector3(0, 0, 0) );	_EntSetVelocity( Owner, vPlayerVel );
	_PlaySoundPlayer(Owner,"/ambient/explosions/exp3.wav");
		_EffectSetOrigin(_PlayerGetShootPos(Owner));
		_EffectDispatch( "MuzzleFlash" );
	_ScreenText( Owner, "Hover Activated...", 1.75, -.45, 255, 255, 255, 100, 1, 1, 1, 0, 5 )
	_SWEPUseAmmo( MyIndex, 0, 1 );
end

function onReload()
	_ScreenText( Owner, "Recharging...", 1.75, -.45, 255, 255, 255, 100, 1, 1, 1, 0, 5 )

return true;

end

function getWeaponSwapHands()  --If true, switch hands.
		return false;	
	end
	
	function getWeaponFOV()  --Field of view when using this weapon. If ya wanna be ghetto, set to 10 for a sniper rifle
		return 80;	
	end
	
	function getWeaponSlot() --This is the "slot" on the inventory where your weapon will be. (Crowbar is 1, pistol is 2, smg is 3)
		return 0;	
	end
	
	function getWeaponSlotPos() --This is the position in the slot. (Crowbar is 1, stunstick is 2, smg is 1, rpg is 2.)
		return 6;	
	end
	
	function getFiresUnderwater() --Can you shoot in atlantis?
		return false;     --sure, y nawt?! lawl!
	end
	
	function getReloadsSingly()  --You gonna reload like a shotgun?
		return true;
	end
	
	function getDamage()  --How much do you hurt people?
		return 0;
	end
	
	function getPrimaryShotDelay() --Rate of fire (unknown units)
		return 0.01;
	end
	
	function getSecondaryShotDelay() --Rate of Secondary Fire
		return 0.01;
	end
	
	function getPrimaryIsAutomatic() --Can you just hold the mouse button?
		return true;
	end
	
	function getSecondaryIsAutomatic() --Same, for secondary
		return true;
	end

function getBulletSpread() --OK, here is where we are going to use those vector functions that we opened up in the first line of code. This is how much the bullets spread. I am assuming it is XYZ.
		return vector3( 0.0, 0.0, 0.0 );
	end
	
	function getViewKick() --Where and how much to kick your view.
		return vector3( 90.0, 0.0, 0.0);
	end
	
	function getViewKickRandom() --Random View kick values
		return vector3( 0.0, 0.0, 0.0 );
	end

	function getViewModel( ) --Weapon model. In this case, it is the 357.
		return "models/weapons/v_c4.mdl";
	end
	
	function getWorldModel( ) --The weapon model as it appears to everyone else. NOTE, It is not the same! There is a v_ and a w_
		return "models/weapons/w_c4.mdl";
	end
	
	function getClassName() --Name it after this script. Don't duplicate classnames. Make them all unique.
		return "weapon_jetpack";
	end

	function getPrimaryAmmoType() --Sadly... I don't know what this does? I guess it is how the bullet interacts with the world?
		return "pistol";
	end
		
	function getSecondaryAmmoType()
		return "pistol";
	end

	-- return -1 if it doesn't use clips
	function getMaxClipPrimary() --How many primary fire bullets you can hold.
		return 666;
	end
	
	function getMaxClipSecondary()
		return -1;
	end
	
	-- ammo in gun by default
	function getDefClipPrimary() --Default Ammo
		return 1337;
	end
	
	function getDefClipSecondary()
		return -1;
	end

	-- pistol, smg, ar2, shotgun, rpg, phys, crossbow, melee, slam, grenade
	function getAnimPrefix() --How to animate
		return "phys";
	end

	function getPrintName() --Name in inventory
		return "Jetpack";
	end
	
	
	-- 0 = Don't override, shoot bullets, make sound and flash
	-- 1 = Don't shoot bullets but do make flash/sounds
	-- 2 = Only play animations
	-- 3 = Don't do anything
	
	function getPrimaryScriptOverride()
		return 3;
	end

	function getSecondaryScriptOverride() --all explained
		return 3;
	end