/* Alliance basic #defines.
 * These can't depend on any server/game stuff because
 * this may be potentially included in both server and
 * client code. */
#ifndef _BB_DEFS_H_
#define _BB_DEFS_H_

#define BATTLEBOTS_VERSION "1.0.1"

#define BATTLEBOTS_CLIENT_VERSION "1.0.1"  // Joe - client ver check, gets /100
#define BATTLEBOTS_SERVER_VERSION "1.0.1"

#define BATTLEBOTS_MOTD_TIME 3000  // Joe - 3 seconds for motd

// tri-state values
#define TRI_TRUE	1
#define TRI_FALSE	-1
#define TRI_DEFAULT	0

// These are strings because they're loaded in cvars.
// q2 was 1900/420

// INCIN -- CVARS also carry a <cvarname.string> value,
// these don't need to be hardcoded any more..

//#define Q2_DEFAULT_HOOK_SPEED				"1900"
//#define Q2_DEFAULT_PULL_SPEED               "420"

#define BATTLE_DEFAULT_HOOK_SPEED				"2025"
#define BATTLE_DEFAULT_PULL_SPEED               "550" //"500"

#define REGULAR_DEFAULT_HOOK_SPEED				"1150"
#define REGULAR_DEFAULT_PULL_SPEED				"750"

#define BATTLEBOTS_DEFAULT_HEALTH_RESTORE_INTERVAL	"1"
#define BATTLEBOTS_DEFAULT_HEALTH_RESTORE_STEP		"5"
#define BATTLEBOTS_DEFAULT_HEALTH_RESTORE_MAX			"160"

#define BATTLEBOTS_DEFAULT_ARMOR_RESTORE_INTERVAL		"1"
#define BATTLEBOTS_DEFAULT_ARMOR_RESTORE_STEP			"5"
#define BATTLEBOTS_DEFAULT_ARMOR_RESTORE_MAX			"120"

// Alternate Restore
// Note if BATTLE_MAX_HEALTH is changed, also change health restore max above
#define BATTLE_MAX_HEALTH                                       160
#define BATTLE_STARTING_HEALTH                                  110

#define BATTLE_MAX_ARMOR                                       120
#define BATTLE_STARTING_ARMOR                                  70


#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_INTERVAL				"2"

#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_MACHINEGUN			10
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_MACHINEGUN_MAX		100
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_SHOTGUN				1

// Joe double shotgun, give twice as much
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_SHOTGUN_MAX			10
//#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_SHOTGUN_MAX			20

#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_GRENADE_LAUNCHER		1
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_GRENADE_LAUNCHER_MAX	5

// begin handgrenade Joe
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_HANDGRENADE	        1
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_HANDGRENADE_MAX	    5
// end handgrenade Joe

#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_ROCKET_LAUNCHER		1
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_ROCKET_LAUNCHER_MAX	10
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_LIGHTNING				10
//Crock - Way to much lightning ammo - Changed 100 to 60
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_LIGHTNING_MAX			60
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_RAILGUN				1
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_RAILGUN_MAX			7   // 1 slug = 3 shots
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_PLASMAGUN				10
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_PLASMAGUN_MAX			50
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_BFG					1
#define BATTLEBOTS_DEFAULT_AMMO_RESTORE_BFG_MAX				5

#define BATTLEBOTS_DEFAULT_PARTIAL_FRIENDLY_FIRE_FRACTION		"0.25"

/* Nacho: Jersey related defines */
//#define MAX_JERSEYS        20 //max number of jerseys we want to have
//#define JERSEY_UNASSIGNED  -1 //designation for an unassigned jersey

// Declared position defines
#define POS_UNDEFINED 0
#define POS_OFFENSE   1
#define POS_DEFENSE   2
/* end Nacho */

// begin Joe handgrenade
#define BATTLE_HG_DAMAGE         85
#define BATTLE_HG_RADIUS         150	//120
#define BATTLE_HG_DROPOFF        .3
#define BATTLE_DEFAULT_DROPOFF   .5

#define BATTLE_HG_SPEED_TIMER    1.5  //3.0 is expert default in q2
#define BATTLE_HG_MINSPEED       400	//800  //400.
#define BATTLE_HG_MAXSPEED       1600	//1600 //1200. 800 in expert q2

#define BATTLE_HG_EXPLODE_TIMER	   0.4f		//0.4f
//nobounce
#define BATTLE_NBHG_EXPLODE_TIMER  0.7f	//0.7f
// end Joe handgrenade


// Joe combat weapons

// #define DEFAULT_SHOTGUN_SPREAD	700
// #define DEFAULT_SHOTGUN_COUNT	11
// #define DEFAULT_SHOTGUN_DAMAGE	10

// note: for shotgun Crock had 600 spread, 20 count, 6 damage
// Myrkul wants spread 1.2 widths of body, when you are 6 man lengths away

#define SUPER_SHOTGUN_SPREAD 600
#define SUPER_SHOTGUN_COUNT  20
#define SUPER_SHOTGUN_DAMAGE 6
// Hugo
#define BATTLEBOTS_SHOTGUN_DAMAGE 5


// ok, example mins and maxs (bounding box):  (-15, -15, -24) & (15, 15, 32)
// so a player is 30 wide and deep and 56 tall
// shotgun achieves 2*spread at 8192
// if 2*spread is 36 at 336 away, how much is it at 8192 away?

// is this geometry right?    36/336 = x/8192,  x = 877,   x/2 = 438.5

// shotgun will shoot in a perfect square of 4x3 pellets
// calc of right and up unit vectors are sometimes reversed
//#define BATTLE_SHOTGUN_SPREAD 438
#define BATTLE_SHOTGUN_SPREAD 600  // Joe
#define BATTLE_SHOTGUN_COUNT  13 //Added 1 pellet

// Joe - pick from 2 choices
//#define BATTLE_SHOTGUN_REPEATS 1
#define BATTLE_SHOTGUN_REPEATS 2

// note make sure you pick even multiples, or you will get rounded down
//#define BATTLE_SHOTGUN_DAMAGE  (96/(BATTLE_SHOTGUN_COUNT * BATTLE_SHOTGUN_REPEATS))
//edited:Crock - Its not likely that both shots will hit, Increased damage: 65 per shot
#define BATTLE_SHOTGUN_DAMAGE  (130/(BATTLE_SHOTGUN_COUNT * BATTLE_SHOTGUN_REPEATS)) // Joe

#define BATTLE_MACHINEGUN_DAMAGE 9   // 10/s * 9 = 90 damage/min

//INCIN -- replced with cvar used with unlagged
//#define BATTLE_LIGHTNING_DAMAGE 8  // Crock - New: 10 * 10 = 100 damage/sec
#define BATTLE_LIGHTNING_RATE		100  // fire every 100 ms or 10/s, default was 20/s!

#define BATTLE_GL_DAMAGE			65  //Crock from 100 to 50 - GL damage way to high - try and reduce spam in Combat
#define BATTLE_GL_SPLASH_DAMAGE		50 //Crock from 100 to 50 - GL damage way to high - try and reduce spam in Combat
#define BATTLE_GL_SPLASHRADIUS		120

#define BATTLE_RL_DAMAGE			70//80
#define BATTLE_RL_SPLASH_DAMAGE		100
#define BATTLE_RL_SPLASHRADIUS		130 //Crock Lower rocket radius

#define BATTLE_BFG_DAMAGE 80
#define BATTLE_BFG_SPLASH_DAMAGE 100
#define BATTLE_BFG_SPLASHRADIUS 120

#define BATTLE_PLASMA_DAMAGE 15     // 15 * 10/s = 150 damage/sec
#define BATTLE_PLASMA_SPLASH_DAMAGE 15
#define BATTLE_PLASMA_RADIUS 30

// note make sure you pick even multiples, or you will get rounded down
#define BATTLE_RAILGUN_REPEATS 3
//#define BATTLE_RAILGUN_DAMAGE 111/BATTLE_RAILGUN_REPEATS
#define BATTLE_RAILGUN_DAMAGE (g_tripleRail.integer > 0) ? 180/BATTLE_RAILGUN_REPEATS : 100 // Joe - edited: Crock - lowered a bit

// end Joe


// Notification/Network scheme:
// We only notify all players of kills.  Points for damage are just silently
// added.
// We send over kill messages as a tempentity broadcast, with the text messages
// constructed and printed on the client.
// The number of points awarded is also passed with the kill tempentity so that
// points can be tweaked on the server without changing the client code.

// This enum is used as both the array index for the strings used in scoring
// messages and as the order of bits in the scoring event bitvector.
typedef enum {
    SCORE_CARRIER_KILL,
    SCORE_CARRIER_DEFENSE,
    SCORE_CARRIER_SAVE,
    SCORE_BASE_DEFENSE,
    SCORE_FLAG_DEFENSE,
    SCORE_DEFENDER_KILL,
    SCORE_FLAG_HOLDING,
} scoringBonus_t;

// flag on carrier kills indicating bonus was awarded on the basis of distance
// rather than time
#define FL_DISTANCE                0x00008000

#define CTF_TOTAL_BONUSES           7

#define SCORE_FLAG_PENALTY          128          // flag indicating penalty

// special damage amount to indicate a kill
#define DAMAGE_KILL                 -1337

// Joe bloodwolf
// going to use this in client for no play_voice during countdown
#define GS_NORMAL 0
#define GS_COUNTDOWN 1
#define GS_MATCHSETUP 2
#define GS_MATCH 3
#define GS_LINGER 4
#define GS_INTERMISSION_WAR 5
#define GS_INTERMISSION_WAR_COUNTDOWN 5
// end Joe

// bots
// this is how bots know stuff
/*
"sound/teamplay/flagret_blu.wav"
"sound/teamplay/flagret_blu.wav"
"sound/items/poweruprespawn.wav"
"*falling1.wav"  // himself
 
"sound/teamplay/flagret_enemy.wav"
 
*/

//#define DEBUG  // Joe - let everyone debug bots

// Alliance: Myrkul: moved from g_local.h
char	*vtos( const vec3_t v );
char	*vtofs( const vec3_t v );

// Joe - hook lifetime
#define HOOK_TIME      4  // seconds
#define GRAPPLE_REFIRE 2  // frames
#define HOOK_DAMAGE    3

// Joe - used in cgame/bg_client.c too
#define	MISSILE_PRESTEP_TIME	50

// Joe
// full or 30/3 ?
#define BATTLE_RAILGUN_SPLASH_DAMAGE BATTLE_RAILGUN_DAMAGE
#define BATTLE_RAILGUN_SPLASH_RADIUS 120 // like combat bfg

#define RAILGUN_SPLASH_DAMAGE 30  // was actually in id code
#define RAILGUN_SPLASH_RADIUS 28  // like plasma

#endif //_BB_DEFS_H_


