// attack mode handling(burst)
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_ATTACK_H__41C3EB49_F58F_4166_9868_379D8C2A0421__INCLUDED_)
#define AFX_ATTACK_H__41C3EB49_F58F_4166_9868_379D8C2A0421__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// The 27 CS Weapons are:
//   usp glock18 deagle p228 elite fiveseven xm1014 m3 mp5 tmp p90
//   mac10 ump ak47 sg552 m4a1 aug scout awp g3sg1 sg550 m249
//   flashbang hegrenade smokegrenade knife c4
enum 
{
	 WEAPON_NONE = 0
	,WEAPON_USP,WEAPON_GLOCK,WEAPON_DEAGLE,WEAPON_P228,WEAPON_ELITE,WEAPON_FIVE7
	,WEAPON_XM,WEAPON_M3
	,WEAPON_MP5,WEAPON_TMP,WEAPON_P90,WEAPON_MAC,WEAPON_UMP
	,WEAPON_AK,WEAPON_SIG,WEAPON_COLT,WEAPON_AUG
	,WEAPON_SCOUT,WEAPON_AWP,WEAPON_G3SG1,WEAPON_SG550
	,WEAPON_PARA,WEAPON_KNIFE
	,WEAPON_FLASH,WEAPON_HE,WEAPON_SMOKE,WEAPON_C4
};


class BurstInfo
{
public:
	BurstInfo(){ reset(); }
	struct RangeInfo
	{
		int   range;
		float ftime;
		float dtime;
		float sdelay;
		int   flags; // duck,use,dontaim
	};
	enum { BURSTFLAG_DUCK  = 1, // automatically duck while shooting (sdelay required)
		   BURSTFLAG_NOAIM = 2, // dont autoaim using this weapon (useful for grenades)
		   BURSTFLAG_STOP  = 4, // stop Movement before shooting (useful for awp) (sdelay required)
	       BURSTFLAG_ZOOM  = 8, // zoom in before shooting. use with sdelay
		   BURSTFLAG_GROUND=16, // don't shoot with this weapon if not on ground
		   BURSTFLAG_USE   =32};// press the USE-Key to stop faster (only with BURSTFLAG_STOP)

public:
	RangeInfo* get(int weaponID, int idx);
	void       set(int weaponID, BurstInfo::RangeInfo* newEntry, int idx);
	char*      description(int weaponID, int idx);
	static char* description(const BurstInfo::RangeInfo*);
	static int getWeaponID(const char* weapon);
	bool copy(const char* weaponfrom, const char* weaponto);

	bool savecfg (const char* filename, const char* prefix);
	void reset();

	const RangeInfo* getTimeInfo(int weapon,int distance);

protected:
	enum { NUM_USABLE_WEAPONS = 30 };
	RangeInfo range[NUM_USABLE_WEAPONS][5];

};

#endif // !defined(AFX_ATTACK_H__41C3EB49_F58F_4166_9868_379D8C2A0421__INCLUDED_)
