
-- class definition for class based mods
--
-- this info is used in GameRuleClassLib.lua and in the in game menu

local gl_runspeed_factor=1;
local gl_stamina_use_run=1;
local gl_walkspeed_factor=1;
local gl_swimspeed_factor=1;
local gl_crouchspeed_factor=1;
local gl_pronespeed_factor=1;
local gl_jumpforce_factor=1;

if toNumberOrZero(getglobal("gl_runspeed_factor"))>0 then 
	gl_runspeed_factor=tonumber(getglobal("gl_runspeed_factor"));
end
if toNumberOrZero(getglobal("gl_stamina_use_run"))>0 then 
	gl_stamina_use_run=tonumber(getglobal("gl_stamina_use_run"));
end
if toNumberOrZero(getglobal("gl_walkspeed_factor"))>0 then 
	gl_walkspeed_factor=tonumber(getglobal("gl_walkspeed_factor"));
end
if toNumberOrZero(getglobal("gl_swimspeed_factor"))>0 then 
	gl_swimspeed_factor=tonumber(getglobal("gl_swimspeed_factor"));
end
if toNumberOrZero(getglobal("gl_crouchspeed_factor"))>0 then 
	gl_crouchspeed_factor=tonumber(getglobal("gl_crouchspeed_factor"));
end
if toNumberOrZero(getglobal("gl_pronespeed_factor"))>0 then 
	gl_pronespeed_factor=tonumber(getglobal("gl_pronespeed_factor"));
end
if toNumberOrZero(getglobal("gl_jumpforce_factor"))>0 then 
	gl_jumpforce_factor=tonumber(getglobal("gl_jumpforce_factor"));
end


local MCD_Scale=1.4;
local RunSpeedMult=1.15*gl_runspeed_factor;   --patch2 : runspeed 15% faster
local staminaRunMult=0.7*gl_stamina_use_run;  --patch2 : 30% less use of stamina when run

--[GL controlling rockets and nades]
local initial_ag36_nades=tonumber(getglobal("gl_initial_ag36_nades"));
local pickup_ag36_nades=tonumber(getglobal("gl_pickup_ag36_nades"));
local droppickup_ag36_nades=tonumber(getglobal("gl_droppickup_ag36_nades"));
local max_ag36_nades=tonumber(getglobal("gl_max_ag36_nades"));

local initial_oicw_nades=tonumber(getglobal("gl_initial_oicw_nades"));
local pickup_oicw_nades=tonumber(getglobal("gl_pickup_oicw_nades"));
local droppickup_oicw_nades=tonumber(getglobal("gl_droppickup_oicw_nades"));
local max_oicw_nades=tonumber(getglobal("gl_max_oicw_nades"));

local initial_rockets=tonumber(getglobal("gl_initial_rockets"));
local pickup_rockets=tonumber(getglobal("gl_pickup_rockets"));
local droppickup_rockets=tonumber(getglobal("gl_droppickup_rockets"));
local max_rockets=tonumber(getglobal("gl_max_rockets"));

local initial_sticky_explosives=tonumber(getglobal("gl_initial_sticky_explosives"));
local pickup_sticky_explosives=tonumber(getglobal("gl_pickup_sticky_explosives"));
local droppickup_sticky_explosives=tonumber(getglobal("gl_droppickup_sticky_explosives"));
local max_sticky_explosives=tonumber(getglobal("gl_max_sticky_explosives"));

local initial_sniper_ammo=tonumber(getglobal("gl_initial_sniper_ammo"));
local pickup_sniper_ammo=tonumber(getglobal("gl_pickup_sniper_ammo"));
local droppickup_sniper_ammo=tonumber(getglobal("gl_droppickup_sniper_ammo"));
local max_sniper_ammo=tonumber(getglobal("gl_max_sniper_ammo"));

-- sniper uses flashbang
local snipergrenade="SmokeGrenade";
local scoutgrenade="HandGrenade";
local egineergrenade="SmokeGrenade";

local sn_init_fb=0;
local sn_pickup_fb=0;
local sn_droppickup_fb=0;
local sn_max_fb=0;
local sn_init_sg=1;
local sn_pickup_sg=1;
local sn_droppickup_sg=0;
local sn_max_sg=2;

local sc_init_fb=0;
local sc_pickup_fb=0;
local sc_droppickup_fb=0;
local sc_max_fb=0;
local sc_init_hg=2;
local sc_pickup_hg=2;
local sc_droppickup_hg=0;
local sc_max_hg=5;

local eg_init_fb=0;
local eg_pickup_fb=0;
local eg_droppickup_fb=0;
local eg_max_fb=0;
local eg_init_sg=1;
local eg_pickup_sg=1;
local eg_droppickup_sg=0;
local eg_max_sg=2;


--[end GL, search for locals for other changes within this file]
if toNumberOrZero(getglobal("gl_sniper_flashbang"))==1 then
	snipergrenade="FlashbangGrenade";
	sn_init_fb=1;
	sn_pickup_fb=1;
	sn_droppickup_fb=0;
	sn_max_fb=2;
	sn_init_sg=0;
	sn_pickup_sg=0;
	sn_droppickup_sg=0;
	sn_max_sg=0;
end

if toNumberOrZero(getglobal("gl_scout_flashbang"))==1 then
	scoutgrenade="FlashbangGrenade";
	sc_init_fb=2;
	sc_pickup_fb=2;
	sc_droppickup_fb=0;
	sc_max_fb=5;
	sc_init_hg=0;
	sc_pickup_hg=0;
	sc_droppickup_hg=0;
	sc_max_hg=0;
end

if toNumberOrZero(getglobal("gl_engineer_flashbang"))==1 then
	engineergrenade="FlashbangGrenade";
	eg_init_fb=1;
	eg_pickup_fb=1;
	eg_droppickup_fb=0;
	eg_max_fb=2;
	eg_init_sg=0;
	eg_pickup_sg=0;
	eg_droppickup_sg=0;
	eg_max_sg=0;
end


MultiplayerClassDefiniton=
{
	PlayerClasses={			-- for class based mods
	
		
		Grunt=
		{
			model="objects/characters/pmodels/hero/hero_mp.cgf",
			health		= 130,
			armor		= 50,
			max_armor	= 50,
			weapon1={"Machete",},
			weapon2={"Falcon",},
			weapon3={"AG36","OICW","M249",},
			weapon4={},
			primaryWeaponSlot=3,
			
			grenades=scoutgrenade,

			items = {
				--"PickupHeatVisionGoggles",
			},
	
			move_params = {
				speed_run=MCD_Scale*3.5*RunSpeedMult,
				speed_walk=MCD_Scale*3.0*gl_walkspeed_factor,
				speed_swim=MCD_Scale*2.8*gl_swimspeed_factor,
				speed_crouch=MCD_Scale*1.6*gl_crouchspeed_factor,
				speed_prone=MCD_Scale*0.6*gl_pronespeed_factor,
				jump_force=3.3*gl_jumpforce_factor,
				lean_angle=14.0,
				bob_pitch=0.015,
				bob_roll=0.035,
				bob_lenght=5.5*MCD_Scale,
				bob_weapon=0.005/MCD_Scale,
			},
			
			StaminaTable = {
				sprintScale	= 1.4,
				sprintSwimScale = 1.4,
				decoyRun	= 30*staminaRunMult,
				decoyJump	= 10,
				restoreRun	= 1.5,
				restoreWalk	= 8,
				restoreIdle	= 10,
		
				breathDecoyUnderwater	= 3,
				breathDecoyAim		= 10,
				breathRestore		= 80,
			},
			
			InitialAmmo=
			{
				Pistol=90,			-- Falcon
				Shotgun=30,			-- Shotgun
				SMG=150,				-- P90
				Assault=200,		-- M4,OICW,AG36
				HandGrenade=sc_init_hg,	-- HandGrenade
				FlashbangGrenade=sc_init_fb,
				AG36Grenade=initial_ag36_nades,	-- AG36 second firemod
				OICWGrenade=initial_oicw_nades,	-- OICW second firemod
			},
			AmmoPickup=
			{
				Pistol=45,	    -- Falcon
				Shotgun=30,			-- Shotgun
				SMG=100,				-- P90
				Assault=125,		-- M4,OICW,AG36
				HandGrenade=sc_pickup_hg,	-- HandGrenade
				FlashbangGrenade=sc_pickup_fb,
				AG36Grenade=pickup_ag36_nades,	-- AG36 second firemod
				OICWGrenade=pickup_oicw_nades,	-- OICW second firemod
			},
			DropAmmoPickup=
			{
				Pistol=25,			-- Falcon
				Shotgun=15,			-- Shotgun
				SMG=75,					-- P90
				Assault=100,		-- M4,OICW,AG36
				HandGrenade=sc_droppickup_hg,	-- HandGrenade
				FlashbangGrenade=sc_droppickup_fb,
				AG36Grenade=droppickup_ag36_nades,	-- AG36 second firemod
				OICWGrenade=droppickup_oicw_nades,	-- OICW second firemod
			},
			MaxAmmo=
			{
				Pistol=90,	    -- Falcon
				Shotgun=50,			-- Shotgun
				SMG=200,				-- P90
				Assault=250,		-- M4,OICW,AG36
				HandGrenade=sc_max_hg,	-- HandGrenade
				FlashbangGrenade=sc_max_fb,
				AG36Grenade=max_ag36_nades,	-- AG36 second firemod
				OICWGrenade=max_oicw_nades,	-- OICW second firemod
			},
		},
		
		Sniper=
		{
			model="objects/characters/mercenaries/merc_rear/merc_rear_mp.cgf",
			health		=130,
			armor		=50,
			max_armor	=50,
			weapon1={"Machete",},
			weapon2={"Falcon",},
			weapon3={"SniperRifle","RL",},
			weapon4={},
			primaryWeaponSlot=3,
			grenades=snipergrenade,
			
			items = {
				"PickupBinoculars",
				--"PickupHeatVisionGoggles",
			},
			
			move_params = {
				speed_run=MCD_Scale*3.8*RunSpeedMult,
				speed_walk=MCD_Scale*3.3*gl_walkspeed_factor,
				speed_swim=MCD_Scale*2.8*gl_swimspeed_factor,
				speed_crouch=MCD_Scale*1.6*gl_crouchspeed_factor,
				speed_prone=MCD_Scale*0.6*gl_pronespeed_factor,
				jump_force=4.3*gl_jumpforce_factor,
				lean_angle=14.0,
				bob_pitch=0.015,
				bob_roll=0.035,
				bob_lenght=5.5*MCD_Scale,
				bob_weapon=0.005/MCD_Scale,
			},
	
			StaminaTable = {
				sprintScale	= 1.4,
				sprintSwimScale = 1.4,
				decoyRun	= 30*staminaRunMult,
				decoyJump	= 10,
				restoreRun	= 1.5,
				restoreWalk	= 8,
				restoreIdle	= 10,
		
				breathDecoyUnderwater	= 3,
				breathDecoyAim		= 10,
				breathRestore		= 80,
			},
			InitialAmmo=
			{
				Pistol=90,		-- Falcon
				Rocket= initial_rockets, -- RL
				Sniper= initial_sniper_ammo,		-- SniperRifle
				SmokeGrenade=sn_init_sg,		-- SmokeGrenade
				FlashbangGrenade=sn_init_fb,
			},
			AmmoPickup=
			{
				Pistol=45,		-- Falcon
				Rocket= pickup_rockets,		-- RL
				Sniper=pickup_sniper_ammo,		-- SniperRifle
				SmokeGrenade=sn_pickup_sg,		-- SmokeGrenade
				FlashbangGrenade=sn_pickup_fb,
			},
			DropAmmoPickup=
			{
				Pistol=45,		-- Falcon
				Rocket= droppickup_rockets,		-- RL
				Sniper= droppickup_sniper_ammo,		-- SniperRifle
				SmokeGrenade=sn_droppickup_sg,		-- SmokeGrenade
				FlashbangGrenade=sn_droppickup_fb,
			},
			MaxAmmo=
			{
				Pistol=90,		-- Falcon
				Rocket=max_rockets,		-- RL
				Sniper=max_sniper_ammo,		-- SniperRifle
				SmokeGrenade=sn_max_sg,		-- SmokeGrenade
				FlashbangGrenade=sn_max_fb,
			},
		},
		
		Support=
		{
			model="objects/characters/mercenaries/merc_scout/merc_scout_mp.cgf",
			health		= 130,
			armor		= 50,
			max_armor	= 50,
			weapon1={"M4", "Shotgun", "MP5", "P90",},			
			weapon2={"MedicTool", "Falcon",},
			weapon3={"EngineerTool",},
			weapon4={},	-- Wrench building and repairing / scouttool for blowing things up
			primaryWeaponSlot=1,
			grenades=engineergrenade,

			items = {
				--"PickupHeatVisionGoggles",
			},
			
			move_params = {
				speed_run=MCD_Scale*3.8*RunSpeedMult,
				speed_walk=MCD_Scale*3.2*gl_walkspeed_factor,
				speed_swim=MCD_Scale*2.8*gl_swimspeed_factor,
				speed_crouch=MCD_Scale*1.4*gl_crouchspeed_factor,
				speed_prone=MCD_Scale*0.6*gl_pronespeed_factor,
				jump_force=4.3*gl_jumpforce_factor,
				lean_angle=14.0,
				bob_pitch=0.015,
				bob_roll=0.035,
				bob_lenght=5.5*MCD_Scale,
				bob_weapon=0.005/MCD_Scale,
			},
	
			StaminaTable = {
				sprintScale	= 1.4,
				sprintSwimScale = 1.4,
				decoyRun	= 30*staminaRunMult,
				decoyJump	= 10,
				restoreRun	= 1.5,
				restoreWalk	= 8,
				restoreIdle	= 10,
		
				breathDecoyUnderwater	= 3,
				breathDecoyAim		= 10,
				breathRestore		= 80,
			},
			InitialAmmo=
			{
				Pistol=90,			-- Falcon
				Assault=200,		-- Shotgun
				HealthPack=3,		-- Healthpacks
				SMG=175,
				SmokeGrenade=eg_init_sg,		-- SmokeGrenade	
				FlashbangGrenade=eg_init_fb,
				StickyExplosive=initial_sticky_explosives,-- ScoutTool		
			},
			AmmoPickup=
			{
				Pistol=45,		-- Falcon
				Assault=50,		-- Shotgun
				HealthPack=2,		-- Healthpacks
				SMG=100,
				SmokeGrenade=eg_pickup_sg,		-- SmokeGrenade	
				FlashbangGrenade=eg_pickup_fb,
				StickyExplosive=pickup_sticky_explosives,-- ScoutTool		
			},
			DropAmmoPickup=
			{
				Pistol=30,		-- Falcon
				Assault=50,		-- Shotgun
				HealthPack=2,		-- Healthpacks
				SMG=60,
				SmokeGrenade=eg_droppickup_sg,		-- SmokeGrenade	
				FlashbangGrenade=eg_droppickup_fb,
				StickyExplosive=droppickup_sticky_explosives,-- ScoutTool		
			},
			MaxAmmo=
			{
				Pistol=90,		-- Falcon
				Assault=250,		-- Shotgun
				HealthPack=6,		-- MedicTool
				SMG=250,
				SmokeGrenade=eg_max_sg,		-- SmokeGrenade	
				FlashbangGrenade=eg_max_fb,
				StickyExplosive=max_sticky_explosives,-- ScoutTool			
			},
		},
	},
	-----------------------------------------------------------------

	DefaultMultiPlayer=				-- team or non team mods
	{
		health		= 130, 			
		armor		= 0,
		max_armor	= 100,

		move_params = {
			speed_run=MCD_Scale*4.2*RunSpeedMult,
			speed_walk=MCD_Scale*3.5*gl_walkspeed_factor,
			speed_swim=MCD_Scale*2.8*gl_swimspeed_factor,
			speed_crouch=MCD_Scale*1.6*gl_crouchspeed_factor,
                        speed_prone=MCD_Scale*0.6*gl_pronespeed_factor,
			jump_force=MCD_Scale*66.3*gl_jumpforce_factor,
			lean_angle=14.0,
			bob_pitch=0.015,
			bob_roll=0.035,
			bob_lenght=5.5*MCD_Scale,
			bob_weapon=0.005/MCD_Scale,
		},
		
		StaminaTable = {
			sprintScale	= 1.4,
			sprintSwimScale = 1.4,
			decoyRun	= 30*staminaRunMult,
			decoyJump	= 10,
			restoreRun	= 1.5,
			restoreWalk	= 8,
			restoreIdle	= 10,
	
			breathDecoyUnderwater	= 4,
			breathDecoyAim		= 10,
			breathRestore		= 80,
		},
	},
};