g_ctf.h 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  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.09b
  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 CONFIG_CTF_MATCH (CS_MAXCLIENTS-1)
  32. typedef enum {
  33. CTF_NOTEAM,
  34. CTF_TEAM1,
  35. CTF_TEAM2
  36. } ctfteam_t;
  37. typedef enum {
  38. CTF_GRAPPLE_STATE_FLY,
  39. CTF_GRAPPLE_STATE_PULL,
  40. CTF_GRAPPLE_STATE_HANG
  41. } ctfgrapplestate_t;
  42. typedef struct ghost_s {
  43. char netname[16];
  44. int number;
  45. // stats
  46. int deaths;
  47. int kills;
  48. int caps;
  49. int basedef;
  50. int carrierdef;
  51. int code; // ghost code
  52. int team; // team
  53. int score; // frags at time of disconnect
  54. edict_t *ent;
  55. } ghost_t;
  56. extern cvar_t *ctf;
  57. #define CTF_TEAM1_SKIN "ctf_r"
  58. #define CTF_TEAM2_SKIN "ctf_b"
  59. #define DF_CTF_FORCEJOIN 131072
  60. #define DF_ARMOR_PROTECT 262144
  61. #define DF_CTF_NO_TECH 524288
  62. #define CTF_CAPTURE_BONUS 15 // what you get for capture
  63. #define CTF_TEAM_BONUS 10 // what your team gets for capture
  64. #define CTF_RECOVERY_BONUS 1 // what you get for recovery
  65. #define CTF_FLAG_BONUS 0 // what you get for picking up enemy flag
  66. #define CTF_FRAG_CARRIER_BONUS 2 // what you get for fragging enemy flag carrier
  67. #define CTF_FLAG_RETURN_TIME 40 // seconds until auto return
  68. #define CTF_CARRIER_DANGER_PROTECT_BONUS 2 // bonus for fraggin someone who has recently hurt your flag carrier
  69. #define CTF_CARRIER_PROTECT_BONUS 1 // bonus for fraggin someone while either you or your target are near your flag carrier
  70. #define CTF_FLAG_DEFENSE_BONUS 1 // bonus for fraggin someone while either you or your target are near your flag
  71. #define CTF_RETURN_FLAG_ASSIST_BONUS 1 // awarded for returning a flag that causes a capture to happen almost immediately
  72. #define CTF_FRAG_CARRIER_ASSIST_BONUS 2 // award for fragging a flag carrier if a capture happens almost immediately
  73. #define CTF_TARGET_PROTECT_RADIUS 400 // the radius around an object being defended where a target will be worth extra frags
  74. #define CTF_ATTACKER_PROTECT_RADIUS 400 // the radius around an object being defended where an attacker will get extra frags when making kills
  75. #define CTF_CARRIER_DANGER_PROTECT_TIMEOUT 8
  76. #define CTF_FRAG_CARRIER_ASSIST_TIMEOUT 10
  77. #define CTF_RETURN_FLAG_ASSIST_TIMEOUT 10
  78. #define CTF_AUTO_FLAG_RETURN_TIMEOUT 30 // number of seconds before dropped flag auto-returns
  79. #define CTF_TECH_TIMEOUT 60 // seconds before techs spawn again
  80. #define CTF_GRAPPLE_SPEED 650 // speed of grapple in flight
  81. #define CTF_GRAPPLE_PULL_SPEED 650 // speed player is pulled at
  82. void CTFInit(void);
  83. void CTFSpawn(void);
  84. void SP_info_player_team1(edict_t *self);
  85. void SP_info_player_team2(edict_t *self);
  86. char *CTFTeamName(int team);
  87. char *CTFOtherTeamName(int team);
  88. void CTFAssignSkin(edict_t *ent, char *s);
  89. void CTFAssignTeam(gclient_t *who);
  90. edict_t *SelectCTFSpawnPoint (edict_t *ent);
  91. qboolean CTFPickup_Flag(edict_t *ent, edict_t *other);
  92. qboolean CTFDrop_Flag(edict_t *ent, gitem_t *item);
  93. void CTFEffects(edict_t *player);
  94. void CTFCalcScores(void);
  95. void SetCTFStats(edict_t *ent);
  96. void CTFDeadDropFlag(edict_t *self);
  97. void CTFScoreboardMessage (edict_t *ent, edict_t *killer);
  98. void CTFTeam_f (edict_t *ent);
  99. void CTFID_f (edict_t *ent);
  100. void CTFSay_Team(edict_t *who, char *msg);
  101. void CTFFlagSetup (edict_t *ent);
  102. void CTFResetFlag(int ctf_team);
  103. void CTFFragBonuses(edict_t *targ, edict_t *inflictor, edict_t *attacker);
  104. void CTFCheckHurtCarrier(edict_t *targ, edict_t *attacker);
  105. // GRAPPLE
  106. void CTFWeapon_Grapple (edict_t *ent);
  107. void CTFPlayerResetGrapple(edict_t *ent);
  108. void CTFGrapplePull(edict_t *self);
  109. void CTFResetGrapple(edict_t *self);
  110. //TECH
  111. gitem_t *CTFWhat_Tech(edict_t *ent);
  112. qboolean CTFPickup_Tech (edict_t *ent, edict_t *other);
  113. void CTFDrop_Tech(edict_t *ent, gitem_t *item);
  114. void CTFDeadDropTech(edict_t *ent);
  115. void CTFSetupTechSpawn(void);
  116. int CTFApplyResistance(edict_t *ent, int dmg);
  117. int CTFApplyStrength(edict_t *ent, int dmg);
  118. qboolean CTFApplyStrengthSound(edict_t *ent);
  119. qboolean CTFApplyHaste(edict_t *ent);
  120. void CTFApplyHasteSound(edict_t *ent);
  121. void CTFApplyRegeneration(edict_t *ent);
  122. qboolean CTFHasRegeneration(edict_t *ent);
  123. void CTFRespawnTech(edict_t *ent);
  124. void CTFResetTech(void);
  125. void CTFOpenJoinMenu(edict_t *ent);
  126. qboolean CTFStartClient(edict_t *ent);
  127. void CTFVoteYes(edict_t *ent);
  128. void CTFVoteNo(edict_t *ent);
  129. void CTFReady(edict_t *ent);
  130. void CTFNotReady(edict_t *ent);
  131. qboolean CTFNextMap(void);
  132. qboolean CTFMatchSetup(void);
  133. qboolean CTFMatchOn(void);
  134. void CTFGhost(edict_t *ent);
  135. void CTFAdmin(edict_t *ent);
  136. qboolean CTFInMatch(void);
  137. void CTFStats(edict_t *ent);
  138. void CTFWarp(edict_t *ent);
  139. void CTFBoot(edict_t *ent);
  140. void CTFPlayerList(edict_t *ent);
  141. qboolean CTFCheckRules(void);
  142. void SP_misc_ctf_banner (edict_t *ent);
  143. void SP_misc_ctf_small_banner (edict_t *ent);
  144. extern char *ctf_statusbar;
  145. void UpdateChaseCam(edict_t *ent);
  146. void ChaseNext(edict_t *ent);
  147. void ChasePrev(edict_t *ent);
  148. void CTFObserver(edict_t *ent);
  149. void SP_trigger_teleport (edict_t *ent);
  150. void SP_info_teleport_destination (edict_t *ent);