g_ctf.h 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193
  1. /*
  2. Copyright (C) 1997-2001 Id Software, Inc.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. #define CTF_VERSION 1.52
  16. #define CTF_VSTRING2(x) #x
  17. #define CTF_VSTRING(x) CTF_VSTRING2(x)
  18. #define CTF_STRING_VERSION CTF_VSTRING(CTF_VERSION)
  19. #define STAT_CTF_TEAM1_PIC 17
  20. #define STAT_CTF_TEAM1_CAPS 18
  21. #define STAT_CTF_TEAM2_PIC 19
  22. #define STAT_CTF_TEAM2_CAPS 20
  23. #define STAT_CTF_FLAG_PIC 21
  24. #define STAT_CTF_JOINED_TEAM1_PIC 22
  25. #define STAT_CTF_JOINED_TEAM2_PIC 23
  26. #define STAT_CTF_TEAM1_HEADER 24
  27. #define STAT_CTF_TEAM2_HEADER 25
  28. #define STAT_CTF_TECH 26
  29. #define STAT_CTF_ID_VIEW 27
  30. #define STAT_CTF_MATCH 28
  31. #define STAT_CTF_ID_VIEW_COLOR 29
  32. #define STAT_CTF_TEAMINFO 30
  33. #define CONFIG_CTF_MATCH (CS_AIRACCEL-1)
  34. #define CONFIG_CTF_TEAMINFO (CS_AIRACCEL-2)
  35. typedef enum {
  36. CTF_NOTEAM,
  37. CTF_TEAM1,
  38. CTF_TEAM2
  39. } ctfteam_t;
  40. typedef enum {
  41. CTF_GRAPPLE_STATE_FLY,
  42. CTF_GRAPPLE_STATE_PULL,
  43. CTF_GRAPPLE_STATE_HANG
  44. } ctfgrapplestate_t;
  45. typedef struct ghost_s {
  46. char netname[16];
  47. int number;
  48. // stats
  49. int deaths;
  50. int kills;
  51. int caps;
  52. int basedef;
  53. int carrierdef;
  54. int code; // ghost code
  55. int team; // team
  56. int score; // frags at time of disconnect
  57. edict_t *ent;
  58. } ghost_t;
  59. extern cvar_t *ctf;
  60. #define CTF_TEAM1_SKIN "ctf_r"
  61. #define CTF_TEAM2_SKIN "ctf_b"
  62. #define DF_CTF_FORCEJOIN 131072
  63. #define DF_ARMOR_PROTECT 262144
  64. #define DF_CTF_NO_TECH 524288
  65. #define CTF_CAPTURE_BONUS 15 // what you get for capture
  66. #define CTF_TEAM_BONUS 10 // what your team gets for capture
  67. #define CTF_RECOVERY_BONUS 1 // what you get for recovery
  68. #define CTF_FLAG_BONUS 0 // what you get for picking up enemy flag
  69. #define CTF_FRAG_CARRIER_BONUS 2 // what you get for fragging enemy flag carrier
  70. #define CTF_FLAG_RETURN_TIME 40 // seconds until auto return
  71. #define CTF_CARRIER_DANGER_PROTECT_BONUS 2 // bonus for fraggin someone who has recently hurt your flag carrier
  72. #define CTF_CARRIER_PROTECT_BONUS 1 // bonus for fraggin someone while either you or your target are near your flag carrier
  73. #define CTF_FLAG_DEFENSE_BONUS 1 // bonus for fraggin someone while either you or your target are near your flag
  74. #define CTF_RETURN_FLAG_ASSIST_BONUS 1 // awarded for returning a flag that causes a capture to happen almost immediately
  75. #define CTF_FRAG_CARRIER_ASSIST_BONUS 2 // award for fragging a flag carrier if a capture happens almost immediately
  76. #define CTF_TARGET_PROTECT_RADIUS 400 // the radius around an object being defended where a target will be worth extra frags
  77. #define CTF_ATTACKER_PROTECT_RADIUS 400 // the radius around an object being defended where an attacker will get extra frags when making kills
  78. #define CTF_CARRIER_DANGER_PROTECT_TIMEOUT 8
  79. #define CTF_FRAG_CARRIER_ASSIST_TIMEOUT 10
  80. #define CTF_RETURN_FLAG_ASSIST_TIMEOUT 10
  81. #define CTF_AUTO_FLAG_RETURN_TIMEOUT 30 // number of seconds before dropped flag auto-returns
  82. #define CTF_TECH_TIMEOUT 60 // seconds before techs spawn again
  83. #define CTF_GRAPPLE_SPEED 650 // speed of grapple in flight
  84. #define CTF_GRAPPLE_PULL_SPEED 650 // speed player is pulled at
  85. void CTFInit(void);
  86. void CTFSpawn(void);
  87. void CTFPrecache(void);
  88. void SP_info_player_team1(edict_t *self);
  89. void SP_info_player_team2(edict_t *self);
  90. char *CTFTeamName(int team);
  91. char *CTFOtherTeamName(int team);
  92. void CTFAssignSkin(edict_t *ent, char *s);
  93. void CTFAssignTeam(gclient_t *who);
  94. edict_t *SelectCTFSpawnPoint (edict_t *ent);
  95. qboolean CTFPickup_Flag(edict_t *ent, edict_t *other);
  96. qboolean CTFDrop_Flag(edict_t *ent, gitem_t *item);
  97. void CTFEffects(edict_t *player);
  98. void CTFCalcScores(void);
  99. void SetCTFStats(edict_t *ent);
  100. void CTFDeadDropFlag(edict_t *self);
  101. void CTFScoreboardMessage (edict_t *ent, edict_t *killer);
  102. void CTFTeam_f (edict_t *ent);
  103. void CTFID_f (edict_t *ent);
  104. void CTFSay_Team(edict_t *who, char *msg);
  105. void CTFFlagSetup (edict_t *ent);
  106. void CTFResetFlag(int ctf_team);
  107. void CTFFragBonuses(edict_t *targ, edict_t *inflictor, edict_t *attacker);
  108. void CTFCheckHurtCarrier(edict_t *targ, edict_t *attacker);
  109. // GRAPPLE
  110. void CTFWeapon_Grapple (edict_t *ent);
  111. void CTFPlayerResetGrapple(edict_t *ent);
  112. void CTFGrapplePull(edict_t *self);
  113. void CTFResetGrapple(edict_t *self);
  114. //TECH
  115. gitem_t *CTFWhat_Tech(edict_t *ent);
  116. qboolean CTFPickup_Tech (edict_t *ent, edict_t *other);
  117. void CTFDrop_Tech(edict_t *ent, gitem_t *item);
  118. void CTFDeadDropTech(edict_t *ent);
  119. void CTFSetupTechSpawn(void);
  120. int CTFApplyResistance(edict_t *ent, int dmg);
  121. int CTFApplyStrength(edict_t *ent, int dmg);
  122. qboolean CTFApplyStrengthSound(edict_t *ent);
  123. qboolean CTFApplyHaste(edict_t *ent);
  124. void CTFApplyHasteSound(edict_t *ent);
  125. void CTFApplyRegeneration(edict_t *ent);
  126. qboolean CTFHasRegeneration(edict_t *ent);
  127. void CTFRespawnTech(edict_t *ent);
  128. void CTFResetTech(void);
  129. void CTFOpenJoinMenu(edict_t *ent);
  130. qboolean CTFStartClient(edict_t *ent);
  131. void CTFVoteYes(edict_t *ent);
  132. void CTFVoteNo(edict_t *ent);
  133. void CTFReady(edict_t *ent);
  134. void CTFNotReady(edict_t *ent);
  135. qboolean CTFNextMap(void);
  136. qboolean CTFMatchSetup(void);
  137. qboolean CTFMatchOn(void);
  138. void CTFGhost(edict_t *ent);
  139. void CTFAdmin(edict_t *ent);
  140. qboolean CTFInMatch(void);
  141. void CTFStats(edict_t *ent);
  142. void CTFWarp(edict_t *ent);
  143. void CTFBoot(edict_t *ent);
  144. void CTFPlayerList(edict_t *ent);
  145. qboolean CTFCheckRules(void);
  146. void SP_misc_ctf_banner (edict_t *ent);
  147. void SP_misc_ctf_small_banner (edict_t *ent);
  148. extern char *ctf_statusbar;
  149. void UpdateChaseCam(edict_t *ent);
  150. void ChaseNext(edict_t *ent);
  151. void ChasePrev(edict_t *ent);
  152. void CTFObserver(edict_t *ent);
  153. void SP_trigger_teleport (edict_t *ent);
  154. void SP_info_teleport_destination (edict_t *ent);
  155. void CTFSetPowerUpEffect(edict_t *ent, int def);