/* Prototypes for alliance functions. */

// Prototypes for Alliance server-side (game) only functions

// Can't be included in client (cgame) build since we don't provide
// implementations for these functions in cgame code.

// a_grapple.c
//qboolean grappleUsed();
#ifndef _BB_PROTO_H_
#define _BB_PROTO_H_

qboolean playerMayFireGrapple(gentity_t *ent);
void Weapon_Offhand_GrapplingHook_Fire  (gentity_t *ent);
void Weapon_Offhand_HookFree (gentity_t *ent);
void Weapon_Offhand_HookThink (gentity_t *ent);
static gentity_t *Fire_Offhand_Grapple (gentity_t *self, vec3_t start, vec3_t dir);
void G_Offhand_GrappleDie( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod );
//void G_Run_Offhand_Grapple(gentity_t *ent);
//void G_RunGrappleHooked(gentity_t *ent);
void OffHand_grappleImpact(gentity_t*, gentity_t*, trace_t*);

void addHookChain(gentity_t *hook, gentity_t *mover);
void removeHookChain(gentity_t *hook);
void moveMoverHooks(gentity_t *mover, vec3_t move, vec3_t amove);
void BB_SpawnFlagbases( int team );
gentity_t *BB_SpawnFlagbase( vec3_t origin, int team);

// a_game.c
void giveFreeGear(gentity_t *ent);
void healthRegen(gentity_t *ent);
void armorRegen(gentity_t *ent);
void ammoRegen(gclient_t *client);
void precacheFreeGear(void);

// Hugo - Runes
#ifndef MISSIONPACK
void Pickup_Rune (gentity_t *ent, gentity_t *other, trace_t *trace);
void BounceRune (gentity_t *self, vec3_t dir);
void RespawnRunes( gentity_t *ent );
void SpawnRunes( powerup_t pw );
//void SpawnRunes(runepowerup_t pw);
void G_RunRunes( gentity_t *ent );
void DropRunes (gentity_t *ent);
#endif

qboolean G_TouchWeapon( gentity_t *ent );
void setGameMode(gamemode_t gamemode);
gentity_t *SelectRuneSpawnPoint( void );

// Hugo

qboolean addSoundtoTeamMessage(gentity_t *ent);
qboolean addSoundtoMessage(gentity_t *ent);
void playGlobalSound(char *soundfile);
void play_voice(gentity_t *ent, char *args);
void play_team(gentity_t *ent, char *args);

// Joe health regen rules
void damageRestore(gentity_t *attacker, gentity_t *targ, int damage);
void CombatPickupDroppedWeapon(gentity_t *ent, gentity_t *other);
void alternateRestoreKill(gentity_t *attacker, gentity_t *target);
// end Joe



void BattleCTFScoring(gentity_t *targ, gentity_t *inflictor,
                      gentity_t *attacker, int damage, int typeofdeath);    // alliance Joe combatctfscoring
// Myrkul: In damage scoring mode, you can get bonuses every time you do damage,
// so the non-kill bonuses (like caps) are scaled up to compensate
float damageScoringScale(void);

// Myrkul: utility in g_team.c for having a client print messages.  Don't use
// for anything frequent.
void QDECL PrintMsg( gentity_t *ent, const char *fmt, ... );

//qboolean allianceInhibitSpawn_old(gentity_t *ent); //INCIN --- NOT BEING USED
qboolean allianceInhibitSpawn(gitem_t *item);

qboolean freeGear(void);
qboolean freeShotgun(void);
qboolean freeGrenadeLauncher(void);

// begin handgrenade Joe
qboolean freeHandgrenade(void);
// end handgrenade Joe
qboolean freeMachinegun(void);
qboolean freeLightningGun(void);
qboolean freeRocketLauncher(void);
qboolean freePlasmaGun(void);
qboolean freeRailgun(void);
qboolean freeBFG(void);

#ifdef MISSIONPACK
qboolean freeCHAINGUN(void);
qboolean freeNAILGUN(void);
qboolean freePROX_LAUNCHER(void);
#endif

qboolean freeOnhandGrapple(void);

qboolean healthRestore(void);
qboolean armorRestore(void);
qboolean ammoRestore(void);
qboolean battleWeapons(void);
qboolean globalGrapple(void);




char *stringTeamImbalance(int blueMinusRed);
qboolean teamsImbalanced(int *blueMinusRed);
void checkTeamSizes(void);

void Cmd_Play_Voice_f(gentity_t *ent);
void Cmd_Play_Team_f(gentity_t *ent);
void Cmd_Time_f(gentity_t *ent);
void Cmd_Userinfo_f (int clientNum);

qboolean partialFriendlyFireEnabled(void);
float partialFriendlyFireFraction(void);
qboolean weaponsStayEnabled(void);

qboolean teamplayGame(void);

qboolean addSoundtoTeamMessage(gentity_t *ent);
qboolean addSoundtoMessage(gentity_t *ent);
void playGlobalSound(char *soundfile);

void Svcmd_BattleMode_f(void);  // Joe combat command
void Svcmd_DefaultMode_f(void);

qboolean BG_battleWeaponsEnabled(void);
int BG_gamemode(void);
/*
qboolean BG_IamClient(void);
qboolean BG_IamServer(void);
*/

qboolean BG_noClientPredictFire(void);
void BG_check_Offhand_Grapple(pmove_t *pm);
qboolean BG_predictHook(void);  // Joe
qboolean BG_SkyHook(void);
int BG_getGrappleHookSpeed(void);
qboolean BG_ammoRestore(void);
qboolean BG_superShotgun(void);
void initPellets(vec2_t pellets[]);  // Joe combat shotgun

// begin Joe
void QDECL G_ChatLogPrintf( const char *fmt, ... );
// end Joe

void Svcmd_Stuff_f(void);
void tourneyExitLevel(void);

qboolean fileExists(const char *filename);
char *Q_strtok(char *s, const char *delim, char *olds);
void playTeamSound(char *soundfile, int team);

void A_initMOTD(void);
void A_displayMOTD(int clientNum);
void A_printMOTD(int clientNum);

#endif //_BB_PROTO_H_

