Advertisement
Guest User

20130730_r11991.patch

a guest
Jul 30th, 2013
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 29.80 KB | None | 0 0
  1. Index: cl_main.c
  2. ===================================================================
  3. --- cl_main.c   (revision 11991)
  4. +++ cl_main.c   (working copy)
  5. @@ -178,6 +178,13 @@
  6.         VectorSet(cl.playercrouchmins, -16, -16, -24);
  7.         VectorSet(cl.playercrouchmaxs, 16, 16, 25);
  8.     }
  9. +   else if (gamemode == GAME_TRANSFUSION)
  10. +   {
  11. +       VectorSet(cl.playerstandmins, -16, -16, -20);
  12. +       VectorSet(cl.playerstandmaxs, 16, 16, 32);
  13. +       VectorSet(cl.playercrouchmins, -16, -16, -20);
  14. +       VectorSet(cl.playercrouchmaxs, 16, 16, -5);
  15. +   }
  16.     else
  17.     {
  18.         VectorSet(cl.playerstandmins, -16, -16, -24);
  19. Index: common.c
  20. ===================================================================
  21. --- common.c    (revision 11991)
  22. +++ common.c    (working copy)
  23. @@ -1178,6 +1178,8 @@
  24.                     c = '\n';
  25.                 else if (c == 't')
  26.                     c = '\t';
  27. +               else
  28. +                   c = *--data;
  29.             }
  30.             if (len < (int)sizeof(com_token) - 1)
  31.                 com_token[len++] = c;
  32. Index: console.c
  33. ===================================================================
  34. --- console.c   (revision 11991)
  35. +++ console.c   (working copy)
  36. @@ -1680,7 +1680,26 @@
  37.     if (con_notify.integer < 0)
  38.         Cvar_SetValueQuick(&con_notify, 0);
  39.     if (gamemode == GAME_TRANSFUSION)
  40. -       v = 8; // vertical offset
  41. +   {
  42. +       if (cl.gametype == GAME_DEATHMATCH)
  43. +       {
  44. +           int active_players = 0;
  45. +           int i;
  46. +           for (i=0 ; i<cl.maxclients ; i++)
  47. +           {
  48. +               if (cl.scores[i].name[0])
  49. +               {
  50. +                   active_players++;
  51. +               }
  52. +           }
  53. +           if (active_players > 4)
  54. +               v = 48;
  55. +           else
  56. +               v = 24;
  57. +       }
  58. +       else
  59. +           v = 0;
  60. +   }
  61.     else
  62.         v = 0;
  63.  
  64. Index: darkplaces.ico
  65. ===================================================================
  66. Cannot display: file marked as a binary type.
  67. svn:mime-type = image/x-icon
  68. Index: menu.c
  69. ===================================================================
  70. --- menu.c  (revision 11991)
  71. +++ menu.c  (working copy)
  72. @@ -1044,18 +1044,19 @@
  73.  
  74.  static void M_Transfusion_Episode_Draw (void)
  75.  {
  76. -   int y;
  77. +   /*int y;
  78.     cachepic_t *p;
  79. -   char vabuf[1024];
  80. +   char vabuf[1024];*/
  81.     M_Background(640, 480);
  82.  
  83. -   p = Draw_CachePic ("gfx/menu/tb-episodes");
  84. +   M_Print(264, 236, "Coming Soon...");
  85. +   /*p = Draw_CachePic ("gfx/menu/tb-episodes");
  86.     M_DrawPic (640/2 - p->width/2, 40, "gfx/menu/tb-episodes");
  87.     for (y = 0; y < EPISODE_ITEMS; y++){
  88.         M_DrawPic (0, 160 + y * 40, va(vabuf, sizeof(vabuf), "gfx/menu/episode%i", y+1));
  89.     }
  90.  
  91. -   M_DrawPic (0, 120 + (m_episode_cursor + 1) * 40, va(vabuf, sizeof(vabuf), "gfx/menu/episode%iselected", m_episode_cursor + 1));
  92. +   M_DrawPic (0, 120 + (m_episode_cursor + 1) * 40, va("gfx/menu/episode%iselected", m_episode_cursor + 1));*/
  93.  }
  94.  
  95.  static void M_Transfusion_Episode_Key (int key, int ascii)
  96. @@ -1066,7 +1067,7 @@
  97.         M_Menu_Main_f ();
  98.         break;
  99.  
  100. -   case K_DOWNARROW:
  101. +   /*case K_DOWNARROW:
  102.         S_LocalSound ("sound/misc/menu1.wav");
  103.         m_episode_cursor++;
  104.         if (m_episode_cursor >= EPISODE_ITEMS)
  105. @@ -1083,7 +1084,7 @@
  106.     case K_ENTER:
  107.         Cbuf_AddText ("deathmatch 0\n");
  108.         m_entersound = true;
  109. -       M_Menu_Transfusion_Skill_f ();
  110. +       M_Menu_Transfusion_Skill_f ();*/
  111.     }
  112.  }
  113.  
  114. @@ -2373,14 +2374,15 @@
  115.  static const char *transfusionbindnames[][2] =
  116.  {
  117.  {"",               "Movement"},        // Movement commands
  118. -{"+forward",       "walk forward"},
  119. -{"+back",          "backpedal"},
  120. -{"+left",          "turn left"},
  121. -{"+right",             "turn right"},
  122. -{"+moveleft",      "step left"},
  123. -{"+moveright",         "step right"},
  124. -{"+jump",          "jump / swim up"},
  125. -{"+movedown",      "swim down"},
  126. +{"+forward",       "Walk Forward"},
  127. +{"+back",          "Backpedal"},
  128. +{"+left",          "Turn Left"},
  129. +{"+right",             "Turn Right"},
  130. +{"+moveleft",      "Step Left"},
  131. +{"+moveright",         "Step Right"},
  132. +{"+button5",       "Crouch"},
  133. +{"+jump",          "Jump / Swim Up"},
  134. +{"+movedown",      "Swim Down"},
  135.  {"",               "Combat"},          // Combat commands
  136.  {"impulse 1",      "Pitch Fork"},
  137.  {"impulse 2",      "Flare Gun"},
  138. @@ -2394,28 +2396,29 @@
  139.  {"impulse 8",      "Tesla Cannon"},
  140.  {"impulse 9",      "Life Leech"},
  141.  {"impulse 10",     "Voodoo Doll"},
  142. -{"impulse 21",     "next weapon"},
  143. -{"impulse 22",     "previous weapon"},
  144. -{"+attack",        "attack"},
  145. -{"+button3",       "altfire"},
  146. +{"impulse 21",     "Next Weapon"},
  147. +{"impulse 22",     "Previous Weapon"},
  148. +{"+attack",        "Attack"},
  149. +{"+button3",       "Alt-fire"},
  150.  {"",               "Inventory"},       // Inventory commands
  151.  {"impulse 40",     "Dr.'s Bag"},
  152.  {"impulse 41",     "Crystal Ball"},
  153.  {"impulse 42",     "Beast Vision"},
  154.  {"impulse 43",     "Jump Boots"},
  155. -{"impulse 23",     "next item"},
  156. -{"impulse 24",     "previous item"},
  157. -{"impulse 25",     "use item"},
  158. +{"impulse 23",     "Next Item"},
  159. +{"impulse 24",     "Previous Item"},
  160. +{"impulse 25",     "Use Item"},
  161.  {"",               "Misc"},            // Misc commands
  162. -{"+button4",       "use"},
  163. -{"impulse 50",     "add bot (red)"},
  164. -{"impulse 51",     "add bot (blue)"},
  165. -{"impulse 52",     "kick a bot"},
  166. -{"impulse 26",     "next armor type"},
  167. -{"impulse 27",     "identify player"},
  168. -{"impulse 55",     "voting menu"},
  169. -{"impulse 56",     "observer mode"},
  170. -{"",               "Taunts"},            // Taunts
  171. +{"+button4",       "Use"},
  172. +{"impulse 50",     "Add bot (Red)"},
  173. +{"impulse 51",     "Add bot (Blue)"},
  174. +{"impulse 52",     "Kick a bot"},
  175. +//{"impulse 26",       "Next armor type"},
  176. +{"impulse 27",     "Identify Player"},
  177. +{"impulse 55",     "Voting Menu"},
  178. +{"impulse 56",     "Observer Mode"},
  179. +{"impulse 70",     "Taunt"}
  180. +/*{"",             "Taunts"},            // Taunts
  181.  {"impulse 70",     "taunt 0"},
  182.  {"impulse 71",     "taunt 1"},
  183.  {"impulse 72",     "taunt 2"},
  184. @@ -2425,7 +2428,7 @@
  185.  {"impulse 76",     "taunt 6"},
  186.  {"impulse 77",     "taunt 7"},
  187.  {"impulse 78",     "taunt 8"},
  188. -{"impulse 79",     "taunt 9"}
  189. +{"impulse 79",     "taunt 9"}*/
  190.  };
  191.  
  192.  static const char *goodvsbad2bindnames[][2] =
  193. @@ -3155,10 +3158,10 @@
  194.  static void M_Credits_Draw (void)
  195.  {
  196.     M_Background(640, 480);
  197. -   M_DrawPic (0, 0, "gfx/creditsmiddle");
  198. +   M_DrawPic (180, 66, "gfx/menu/tile2573");//middle
  199. +   //draw scroller here
  200.     M_Print (640/2 - 14/2*8, 236, "Coming soon...");
  201. -   M_DrawPic (0, 0, "gfx/creditstop");
  202. -   M_DrawPic (0, 433, "gfx/creditsbottom");
  203. +   M_DrawPic (0, 0, "gfx/menu/tile2574");//outline
  204.  }
  205.  
  206.  
  207. @@ -3423,7 +3426,7 @@
  208.         if (lanConfig_cursor < 0)
  209.             lanConfig_cursor = NUM_LANCONFIG_CMDS-1;
  210.         // when in start game menu, skip the unused search qw servers item
  211. -       if (StartingGame && lanConfig_cursor == 2)
  212. +       if (StartingGame && lanConfig_cursor >= 2)
  213.             lanConfig_cursor = 1;
  214.         break;
  215.  
  216. @@ -3433,8 +3436,8 @@
  217.         if (lanConfig_cursor >= NUM_LANCONFIG_CMDS)
  218.             lanConfig_cursor = 0;
  219.         // when in start game menu, skip the unused search qw servers item
  220. -       if (StartingGame && lanConfig_cursor == 1)
  221. -           lanConfig_cursor = 2;
  222. +       if (StartingGame && lanConfig_cursor >= 2)
  223. +           lanConfig_cursor = 0;
  224.         break;
  225.  
  226.     case K_ENTER:
  227. @@ -3707,6 +3710,35 @@
  228.  // Map list for Transfusion
  229.  static level_t     transfusionlevels[] =
  230.  {
  231. +   {"bb1",         "The Stronghold"},
  232. +   {"bb2",         "Winter Wonderland"},
  233. +   {"bb3",         "Bodies"},
  234. +   {"bb4",         "The Tower"},
  235. +   {"bb5",         "Click!"},
  236. +   {"bb7",         "Midgard"},
  237. +   {"bb8",         "Fun With Heads"},
  238. +   {"bodiesctf",   "Bodies CTF"},
  239. +
  240. +   {"e1m7",        "Altar of Stone"},
  241. +   {"e3m7",        "The Pit of Cerberus"},
  242. +   {"e4m8",        "The Hall of the Epiphany"},
  243. +
  244. +   {"cpbb03",      "Unholy Cathedral"},
  245. +
  246. +   {"b2a15",       "B2 Area 15"},
  247. +   {"b2bodies",    "B2 Bodies"},
  248. +   {"b2cabana",    "B2 Cabana"},
  249. +   {"b2crypt",     "B2 Crypt"},
  250. +   {"b2power",     "B2 Power"},
  251. +
  252. +   {"cabalarena",  "Cabal Arena"},
  253. +   {"fragenstein", "Fragenstein"},
  254. +   {"fragm",       "Frag'm"},
  255. +   {"qmorbias",    "Qmorbias"},
  256. +   {"qe1m7",       "Quake 1 e1m7"},
  257. +   {"highnoon",    "High Noon"}
  258. +
  259. +   /*
  260.     {"e1m1",        "Cradle to Grave"},
  261.     {"e1m2",        "Wrong Side of the Tracks"},
  262.     {"e1m3",        "Phantom Express"},
  263. @@ -3811,10 +3843,18 @@
  264.     {"qdm5",        "The Cistern"},
  265.     {"qmorbias",    "DM-Morbias"},
  266.     {"simple",      "Dead Simple"}
  267. +   */
  268.  };
  269.  
  270.  static episode_t   transfusionepisodes[] =
  271.  {
  272. +   {"BloodBath", 0, 8},
  273. +   {"Blood 1", 8, 3},
  274. +   {"Cryptic Passage", 11, 1},
  275. +   {"Blood 2", 12, 5},
  276. +   {"Custom", 17, 6}
  277. +  
  278. +   /*
  279.     {"The Way of All Flesh", 0, 8},
  280.     {"Even Death May Die", 8, 9},
  281.     {"Farewell to Arms", 17, 8},
  282. @@ -3826,6 +3866,7 @@
  283.     {"Blood 2", 68, 8},
  284.     {"Transfusion", 76, 9},
  285.     {"Conversions", 85, 9}
  286. +   */
  287.  };
  288.  
  289.  static level_t goodvsbad2levels[] =
  290. @@ -3918,7 +3959,7 @@
  291.  static gamelevels_t hipnoticgame = {"Scourge of Armagon", hipnoticlevels, hipnoticepisodes, 6};
  292.  static gamelevels_t roguegame = {"Dissolution of Eternity", roguelevels, rogueepisodes, 4};
  293.  static gamelevels_t nehahragame = {"Nehahra", nehahralevels, nehahraepisodes, 4};
  294. -static gamelevels_t transfusiongame = {"Transfusion", transfusionlevels, transfusionepisodes, 11};
  295. +static gamelevels_t transfusiongame = {"Transfusion", transfusionlevels, transfusionepisodes, 5};
  296.  static gamelevels_t goodvsbad2game = {"Good Vs. Bad 2", goodvsbad2levels, goodvsbad2episodes, 1};
  297.  static gamelevels_t battlemechgame = {"Battlemech", battlemechlevels, battlemechepisodes, 1};
  298.  static gamelevels_t openquartzgame = {"OpenQuartz", openquartzlevels, openquartzepisodes, 3};
  299. Index: prvm_offsets.h
  300. ===================================================================
  301. --- prvm_offsets.h  (revision 11991)
  302. +++ prvm_offsets.h  (working copy)
  303. @@ -398,6 +398,22 @@
  304.  PRVM_DECLARE_field(weaponframe)
  305.  PRVM_DECLARE_field(weaponmodel)
  306.  PRVM_DECLARE_field(yaw_speed)
  307. +PRVM_DECLARE_field(ammo_flare) // Transfusion flare ammo
  308. +PRVM_DECLARE_field(ammo_tnt_bundle) // Transfusion TNT Bundle
  309. +PRVM_DECLARE_field(ammo_tnt_remote) // Transfusion Remote Det TNT
  310. +PRVM_DECLARE_field(ammo_tnt_proxy) // Transfusion Proximity Det TNT
  311. +PRVM_DECLARE_field(ammo_spray) // Transfusion Hairspray Can
  312. +PRVM_DECLARE_field(ammo_leech) // Transfusion Life Leech ammo
  313. +PRVM_DECLARE_field(ammo_voodoo) // Transfusion VooDoo Doll ammo
  314. +PRVM_DECLARE_field(armor_fire) // Transfusion Fire Armor
  315. +PRVM_DECLARE_field(armor_body) // Transfusion Body Armor
  316. +PRVM_DECLARE_field(armor_spirit) // Transfusion Spirit Armor
  317. +PRVM_DECLARE_field(item_boots) // Transfusion Jump Boots
  318. +PRVM_DECLARE_field(item_medkit) // Transfusion Medkit
  319. +PRVM_DECLARE_field(item_beastvision) // Transfusion Beastvision
  320. +PRVM_DECLARE_field(item_crystalball) // Transfusion Crystal Ball
  321. +PRVM_DECLARE_field(item_divingsuit) // Transfusion Diving Suit
  322. +PRVM_DECLARE_field(active_inventory) // Transfusion Active Inventory Item
  323.  PRVM_DECLARE_function(CSQC_ConsoleCommand)
  324.  PRVM_DECLARE_function(CSQC_Ent_Remove)
  325.  PRVM_DECLARE_function(CSQC_Ent_Spawn)
  326. Index: quakedef.h
  327. ===================================================================
  328. --- quakedef.h  (revision 11991)
  329. +++ quakedef.h  (working copy)
  330. @@ -365,7 +365,52 @@
  331.  #define HIT_EMPATHY_SHIELDS (1<<(23+3))
  332.  
  333.  //===========================================
  334. +//Transfusion added defines
  335. +//stats - items requring a full int value
  336. +//the HUD can show almost all values at once, requiring more stats than just y/n items
  337. +#define    TFN_AMMO_FLARE          30
  338. +#define    TFN_AMMO_SHELLS         6
  339. +#define    TFN_AMMO_BULLETS        7
  340. +#define    TFN_AMMO_NAPALM         8
  341. +#define    TFN_AMMO_TNT_BUNDLE     31
  342. +#define    TFN_AMMO_TNT_REMOTE     32
  343. +#define    TFN_AMMO_TNT_PROXY      33
  344. +#define    TFN_AMMO_SPRAY          34
  345. +#define    TFN_AMMO_TESLA          9
  346. +#define    TFN_AMMO_LEECH          35
  347. +#define    TFN_AMMO_VOODOO         36
  348. +#define TFN_ITEM_MEDKIT            37
  349. +#define TFN_ITEM_DIVINGSUIT        38
  350. +#define TFN_ITEM_CRYSTALBALL   39
  351. +#define TFN_ITEM_BEASTVISION   40
  352. +#define TFN_ITEM_BOOTS         41
  353. +#define    TFN_ARMOR_FIRE          42
  354. +#define    TFN_ARMOR_BODY          43
  355. +#define TFN_ARMOR_SPIRIT       44
  356. +#define TFN_ACTIVE_INVENTORY   45
  357.  
  358. +//items - yes/no items
  359. +#define TFN_WEAPON_PITCHFORK   1
  360. +#define TFN_WEAPON_FLARE       2
  361. +#define TFN_WEAPON_SHOTGUN     4
  362. +#define TFN_WEAPON_TOMMYGUN        8
  363. +#define TFN_WEAPON_NAPALM      16
  364. +#define TFN_WEAPON_TNT_BUNDLE  32
  365. +#define TFN_WEAPON_TNT_PROXY   64
  366. +#define TFN_WEAPON_TNT_REMOTE  128
  367. +#define TFN_WEAPON_HAIRSPRAY   256
  368. +#define TFN_WEAPON_TESLA       512
  369. +#define TFN_WEAPON_LIFELEECH   1024
  370. +#define TFN_WEAPON_VOODOO      2048
  371. +#define TFN_KEY_SKULL          (1<<23)
  372. +#define TFN_KEY_EYE                (1<<24)
  373. +#define TFN_KEY_FIRE           (1<<25)
  374. +#define TFN_KEY_DAGGER         (1<<26)
  375. +#define TFN_KEY_SPIDER         (1<<27)
  376. +#define TFN_KEY_MOON           (1<<28)
  377. +#define TFN_DEATHMASK          262144
  378. +//===========================================
  379. +
  380.  #include "zone.h"
  381.  #include "fs.h"
  382.  #include "common.h"
  383. Index: sbar.c
  384. ===================================================================
  385. --- sbar.c  (revision 11991)
  386. +++ sbar.c  (working copy)
  387. @@ -36,6 +36,14 @@
  388.  cachepic_t *sb_sbar_minimal;
  389.  cachepic_t *sb_sbar_overlay;
  390.  
  391. +// only used by TFn
  392. +cachepic_t *sb_sbar_min_left;
  393. +cachepic_t *sb_sbar_min_right;
  394. +cachepic_t *sb_scoreboard;
  395. +cachepic_t *sb_tfhudnums[6][11];
  396. +cachepic_t *sb_keys[2][6];
  397. +cachepic_t *sb_inventory[5];
  398. +
  399.  // AK changed the bound to 9
  400.  cachepic_t *sb_weapons[7][9]; // 0 is active, 1 is owned, 2-5 are flashes
  401.  cachepic_t *sb_ammo[4];
  402. @@ -206,6 +214,42 @@
  403.         zymsb_crosshair_left2 = Draw_CachePic_Flags ("gfx/hud/crosshair_left2", CACHEPICFLAG_QUIET);
  404.         zymsb_crosshair_right = Draw_CachePic_Flags ("gfx/hud/crosshair_right", CACHEPICFLAG_QUIET);
  405.     }
  406. +   else if (gamemode == GAME_TRANSFUSION)
  407. +   {
  408. +       for (i = 0;i < 10;i++)
  409. +       {
  410. +           sb_tfhudnums[0][i] = Draw_CachePic_Flags (va(vabuf, sizeof(vabuf), "gfx/hud/num_sm_dblue/hn_b2-%i",i), CACHEPICFLAG_QUIET); //small dark blue
  411. +           sb_tfhudnums[1][i] = Draw_CachePic_Flags (va(vabuf, sizeof(vabuf), "gfx/hud/num_sm_lblue/hn_b1-%i",i), CACHEPICFLAG_QUIET); //small light blue
  412. +           sb_tfhudnums[2][i] = Draw_CachePic_Flags (va(vabuf, sizeof(vabuf), "gfx/hud/num_sm_gray/hn_a-%i",i), CACHEPICFLAG_QUIET); //small white/gray
  413. +           sb_tfhudnums[3][i] = Draw_CachePic_Flags (va(vabuf, sizeof(vabuf), "gfx/hud/num_med_red/tile225%i",i), CACHEPICFLAG_QUIET); //medium red
  414. +           sb_tfhudnums[4][i] = Draw_CachePic_Flags (va(vabuf, sizeof(vabuf), "gfx/hud/num_lg_blue/tile224%i",i), CACHEPICFLAG_QUIET); //large blue
  415. +           sb_tfhudnums[5][i] = Draw_CachePic_Flags (va(vabuf, sizeof(vabuf), "gfx/hud/num_lg_red/tile219%i",i), CACHEPICFLAG_QUIET); //large red
  416. +       }
  417. +       sb_sbar = Draw_CachePic_Flags("gfx/hud/tile2200", CACHEPICFLAG_QUIET);
  418. +       sb_sbar_min_left = Draw_CachePic_Flags("gfx/hud/tile2201", CACHEPICFLAG_QUIET);
  419. +       sb_sbar_min_right = Draw_CachePic_Flags("gfx/hud/tile2173", CACHEPICFLAG_QUIET);
  420. +       sb_scoreboard = Draw_CachePic_Flags("gfx/hud/scoreboard", CACHEPICFLAG_QUIET);
  421. +       sb_keys[0][0] = Draw_CachePic_Flags("gfx/hud/keys/tile2220-g", CACHEPICFLAG_QUIET); //skull
  422. +       sb_keys[0][1] = Draw_CachePic_Flags("gfx/hud/keys/tile2221-g", CACHEPICFLAG_QUIET); //eye
  423. +       sb_keys[0][2] = Draw_CachePic_Flags("gfx/hud/keys/tile2222-g", CACHEPICFLAG_QUIET); //fire
  424. +       sb_keys[0][3] = Draw_CachePic_Flags("gfx/hud/keys/tile2223-g", CACHEPICFLAG_QUIET); //dagger
  425. +       sb_keys[0][4] = Draw_CachePic_Flags("gfx/hud/keys/tile2224-g", CACHEPICFLAG_QUIET); //spider
  426. +       sb_keys[0][5] = Draw_CachePic_Flags("gfx/hud/keys/tile2225-g", CACHEPICFLAG_QUIET); //moon
  427. +       sb_keys[1][0] = Draw_CachePic_Flags("gfx/hud/keys/tile2220", CACHEPICFLAG_QUIET);
  428. +       sb_keys[1][1] = Draw_CachePic_Flags("gfx/hud/keys/tile2221", CACHEPICFLAG_QUIET);
  429. +       sb_keys[1][2] = Draw_CachePic_Flags("gfx/hud/keys/tile2222", CACHEPICFLAG_QUIET);
  430. +       sb_keys[1][3] = Draw_CachePic_Flags("gfx/hud/keys/tile2223", CACHEPICFLAG_QUIET);
  431. +       sb_keys[1][4] = Draw_CachePic_Flags("gfx/hud/keys/tile2224", CACHEPICFLAG_QUIET);
  432. +       sb_keys[1][5] = Draw_CachePic_Flags("gfx/hud/keys/tile2225", CACHEPICFLAG_QUIET);
  433. +       sb_armor[0] = Draw_CachePic_Flags("gfx/hud/armorbars/tile2207", CACHEPICFLAG_QUIET);
  434. +       sb_armor[1] = Draw_CachePic_Flags("gfx/hud/armorbars/tile2209", CACHEPICFLAG_QUIET);
  435. +       sb_armor[2] = Draw_CachePic_Flags("gfx/hud/armorbars/tile2208", CACHEPICFLAG_QUIET);
  436. +       sb_inventory[0] = Draw_CachePic_Flags("gfx/hud/inventory/tile2569", CACHEPICFLAG_QUIET); //medkit
  437. +       sb_inventory[1] = Draw_CachePic_Flags("gfx/hud/inventory/tile2564", CACHEPICFLAG_QUIET); //diving suit
  438. +       sb_inventory[2] = Draw_CachePic_Flags("gfx/hud/inventory/tile2566", CACHEPICFLAG_QUIET); //crystal ball
  439. +       sb_inventory[3] = Draw_CachePic_Flags("gfx/hud/inventory/tile2568", CACHEPICFLAG_QUIET); //beast vision
  440. +       sb_inventory[4] = Draw_CachePic_Flags("gfx/hud/inventory/tile2560", CACHEPICFLAG_QUIET); //jump boots
  441. +   }
  442.     else
  443.     {
  444.         sb_disc = Draw_CachePic_Flags ("gfx/disc", CACHEPICFLAG_QUIET);
  445. @@ -448,14 +492,27 @@
  446.  static void Sbar_DrawNum (int x, int y, int num, int digits, int color)
  447.  {
  448.     char str[32], *ptr;
  449. -   int l, frame;
  450. +   int l, frame, x_length;
  451.  
  452. +   if (gamemode == GAME_TRANSFUSION)
  453. +   {
  454. +       if (num == 0 && color == 2 )
  455. +           return;
  456. +       if (color > 3) //health and large ammo
  457. +           x_length = 18;
  458. +       else if (color > 2) //smaller red is a medium font
  459. +           x_length = 10;
  460. +       else //small fonts, small ammo, armor
  461. +           x_length = 8;
  462. +   }
  463. +   else
  464. +       x_length = 24;
  465.     l = dpsnprintf(str, sizeof(str), "%i", num);
  466.     ptr = str;
  467.     if (l > digits)
  468.         ptr += (l-digits);
  469.     if (l < digits)
  470. -       x += (digits-l)*24;
  471. +       x += (digits-l)*x_length;
  472.  
  473.     while (*ptr)
  474.     {
  475. @@ -464,9 +521,15 @@
  476.         else
  477.             frame = *ptr -'0';
  478.  
  479. -       Sbar_DrawPic (x, y, sb_nums[color][frame]);
  480. -       x += 24;
  481. -
  482. +       if (gamemode == GAME_TRANSFUSION)
  483. +       {
  484. +           if (!(color == 4 && !num))
  485. +               Sbar_DrawPic (x, y, sb_tfhudnums[color][frame]);
  486. +       }
  487. +       else
  488. +           Sbar_DrawPic (x, y, sb_nums[color][frame]);
  489. +       x += x_length;
  490. +      
  491.         ptr++;
  492.     }
  493.  }
  494. @@ -1214,7 +1277,11 @@
  495.         fps_scaley = 12;
  496.         //fps_y = vid_conheight.integer - sb_lines; // yes this may draw over the sbar
  497.         //fps_y = bound(0, fps_y, vid_conheight.integer - fps_strings*fps_scaley);
  498. -       fps_y = vid_conheight.integer - sbar_info_pos.integer - fps_strings*fps_scaley;
  499. +       if (gamemode == GAME_TRANSFUSION)
  500. +           fps_y = 0;
  501. +       else
  502. +           fps_y = vid_conheight.integer - sbar_info_pos.integer - fps_strings*fps_scaley;
  503. +
  504.         if (soundstring[0])
  505.         {
  506.             fps_x = vid_conwidth.integer - DrawQ_TextWidth(soundstring, 0, fps_scalex, fps_scaley, true, FONT_INFOBAR);
  507. @@ -1609,6 +1676,92 @@
  508.             DrawQ_Pic(sbar_x + 120 * scale, sbar_y + 120 * scale, zymsb_crosshair_center, 16 * scale, 16 * scale, 1, 1, 1, 1, DRAWFLAG_NORMAL);
  509.  #endif
  510.         }
  511. +       else if (gamemode == GAME_TRANSFUSION)
  512. +       {
  513. +           if (sb_showscores || (cl.stats[STAT_HEALTH] <= 0 && cl_deathscoreboard.integer))
  514. +               Sbar_DrawScoreboard ();
  515. +
  516. +           //if deathmatch, draw scoreboard
  517. +           if (cl.gametype == GAME_DEATHMATCH)
  518. +           {
  519. +               Sbar_DrawAlphaPic(0,0,sb_scoreboard, sbar_alpha_bg.value);
  520. +               if (scoreboardlines > 4)
  521. +                   Sbar_DrawAlphaPic(0,22,sb_scoreboard, sbar_alpha_bg.value);
  522. +               Sbar_MiniDeathmatchOverlay (8, 6);
  523. +           }
  524. +
  525. +           if (sb_lines > 24) //Large HUD
  526. +           {
  527. +               // sbar
  528. +               Sbar_DrawAlphaPic ((vid_conwidth.integer/2 - 320), (vid_conheight.integer - 113), sb_sbar, sbar_alpha_bg.value);
  529. +               // keys
  530. +               Sbar_DrawPic ((vid_conwidth.integer/2 - 183), (vid_conheight.integer - 67), cl.stats[STAT_ITEMS] & TFN_KEY_SKULL ? sb_keys[1][0] : sb_keys[0][0]);
  531. +               Sbar_DrawPic ((vid_conwidth.integer/2 + 163), (vid_conheight.integer - 67), cl.stats[STAT_ITEMS] & TFN_KEY_EYE ? sb_keys[1][1] : sb_keys[0][1]);
  532. +               Sbar_DrawPic ((vid_conwidth.integer/2 - 183), (vid_conheight.integer - 45), cl.stats[STAT_ITEMS] & TFN_KEY_FIRE ? sb_keys[1][2] : sb_keys[0][2]);
  533. +               Sbar_DrawPic ((vid_conwidth.integer/2 + 163), (vid_conheight.integer - 45), cl.stats[STAT_ITEMS] & TFN_KEY_DAGGER ? sb_keys[1][3] : sb_keys[0][3]);
  534. +               Sbar_DrawPic ((vid_conwidth.integer/2 - 183), (vid_conheight.integer - 23), cl.stats[STAT_ITEMS] & TFN_KEY_SPIDER ? sb_keys[1][4] : sb_keys[0][4]);
  535. +               Sbar_DrawPic ((vid_conwidth.integer/2 + 163), (vid_conheight.integer - 23), cl.stats[STAT_ITEMS] & TFN_KEY_MOON ? sb_keys[1][5] : sb_keys[0][5]);
  536. +               // health
  537. +               Sbar_DrawNum ((vid_conwidth.integer/2 - 157), (vid_conheight.integer - 45), cl.stats[STAT_HEALTH], 3, 5);
  538. +               // armor
  539. +               if (cl.stats[TFN_ARMOR_FIRE] >= 5)
  540. +                   DrawQ_Pic((vid_conwidth.integer/2 - 233), (vid_conheight.integer - 51), sb_armor[0] , (cl.stats[TFN_ARMOR_FIRE] / 5 + 2), 14, 1, 1, 1, sbar_alpha_fg.value, 0);
  541. +               if (cl.stats[TFN_ARMOR_BODY] >= 5)
  542. +                   DrawQ_Pic((vid_conwidth.integer/2 - 233), (vid_conheight.integer - 35), sb_armor[1], (cl.stats[TFN_ARMOR_BODY] / 5 + 2), 14, 1, 1, 1, sbar_alpha_fg.value, 0);
  543. +               if (cl.stats[TFN_ARMOR_SPIRIT] >= 5)
  544. +                   DrawQ_Pic((vid_conwidth.integer/2 - 233), (vid_conheight.integer - 19), sb_armor[2], (cl.stats[TFN_ARMOR_SPIRIT] / 5 + 2), 14, 1, 1, 1, sbar_alpha_fg.value, 0);
  545. +               Sbar_DrawNum ((vid_conwidth.integer/2 - 225), (vid_conheight.integer - 51), cl.stats[TFN_ARMOR_FIRE], 3, 2);
  546. +               Sbar_DrawNum ((vid_conwidth.integer/2 - 225), (vid_conheight.integer - 35), cl.stats[TFN_ARMOR_BODY], 3, 2);
  547. +               Sbar_DrawNum ((vid_conwidth.integer/2 - 225), (vid_conheight.integer - 19), cl.stats[TFN_ARMOR_SPIRIT], 3, 2);
  548. +               // ammo_big - only thing thats hidden when you're dead
  549. +               if (cl.stats[STAT_HEALTH])
  550. +                   Sbar_DrawNum ((vid_conwidth.integer/2 + 103), (vid_conheight.integer - 45), cl.stats[STAT_AMMO], 3, 4);
  551. +               // inventory
  552. +               if (!(cl.stats[TFN_ACTIVE_INVENTORY] == 0 && cl.stats[TFN_ITEM_MEDKIT] == 0))
  553. +               {
  554. +                   Sbar_DrawNum ((vid_conwidth.integer - 125), (vid_conheight.integer - 62), cl.stats[TFN_ITEM_MEDKIT + cl.stats[TFN_ACTIVE_INVENTORY]], 3, 3);
  555. +                   Sbar_DrawPic ((vid_conwidth.integer - 129), (vid_conheight.integer - 47), sb_inventory[cl.stats[TFN_ACTIVE_INVENTORY]]);
  556. +               }
  557. +
  558. +               // ammo counts
  559. +               Sbar_DrawNum ((vid_conwidth.integer/2 - 55), (vid_conheight.integer - 41), cl.stats[TFN_AMMO_FLARE], 3, cl.stats[STAT_ACTIVEWEAPON] == TFN_WEAPON_FLARE ? 1:0);
  560. +               Sbar_DrawNum ((vid_conwidth.integer/2 - 55), (vid_conheight.integer - 29), cl.stats[TFN_AMMO_SHELLS], 3, cl.stats[STAT_ACTIVEWEAPON] == TFN_WEAPON_SHOTGUN ? 1:0);
  561. +               Sbar_DrawNum ((vid_conwidth.integer/2 - 55), (vid_conheight.integer - 17), cl.stats[TFN_AMMO_BULLETS], 3, cl.stats[STAT_ACTIVEWEAPON] == TFN_WEAPON_TOMMYGUN ? 1:0);
  562. +               Sbar_DrawNum ((vid_conwidth.integer/2 - 9), (vid_conheight.integer - 41), cl.stats[TFN_AMMO_NAPALM], 3, cl.stats[STAT_ACTIVEWEAPON] == TFN_WEAPON_NAPALM ? 1:0);
  563. +               Sbar_DrawNum ((vid_conwidth.integer/2 - 9), (vid_conheight.integer - 29), cl.stats[TFN_AMMO_TNT_BUNDLE], 3, cl.stats[STAT_ACTIVEWEAPON] == TFN_WEAPON_TNT_BUNDLE ? 1:0);
  564. +               Sbar_DrawNum ((vid_conwidth.integer/2 + 250), (vid_conheight.integer - 17), cl.stats[TFN_AMMO_TNT_PROXY], 3, cl.stats[STAT_ACTIVEWEAPON] == TFN_WEAPON_TNT_PROXY ? 1:0);
  565. +               Sbar_DrawNum ((vid_conwidth.integer/2 + 285), (vid_conheight.integer - 17), cl.stats[TFN_AMMO_TNT_REMOTE], 3, cl.stats[STAT_ACTIVEWEAPON] == TFN_WEAPON_TNT_REMOTE ? 1:0);
  566. +               Sbar_DrawNum ((vid_conwidth.integer/2 - 9), (vid_conheight.integer - 17), cl.stats[TFN_AMMO_SPRAY], 3, cl.stats[STAT_ACTIVEWEAPON] == TFN_WEAPON_HAIRSPRAY ? 1:0);
  567. +               Sbar_DrawNum ((vid_conwidth.integer/2 + 37), (vid_conheight.integer - 41), cl.stats[TFN_AMMO_TESLA], 3, cl.stats[STAT_ACTIVEWEAPON] == TFN_WEAPON_TESLA ? 1:0);
  568. +               Sbar_DrawNum ((vid_conwidth.integer/2 + 37), (vid_conheight.integer - 29), cl.stats[TFN_AMMO_LEECH], 3, cl.stats[STAT_ACTIVEWEAPON] == TFN_WEAPON_LIFELEECH ? 1:0);
  569. +               Sbar_DrawNum ((vid_conwidth.integer/2 + 37), (vid_conheight.integer - 17), cl.stats[TFN_AMMO_VOODOO], 3, cl.stats[STAT_ACTIVEWEAPON] == TFN_WEAPON_VOODOO ? 1:0);
  570. +           }
  571. +           else if (sb_lines <= 24 && sb_lines) //Minimized HUD, !sb_lines = completely blank, no HUD
  572. +           {
  573. +               Sbar_DrawAlphaPic (0, (vid_conheight.integer - 52), sb_sbar_min_left, sbar_alpha_bg.value);
  574. +               Sbar_DrawAlphaPic ((vid_conwidth.integer - 145), (vid_conheight.integer - 51), sb_sbar_min_right,sbar_alpha_bg.value);
  575. +               // health
  576. +               Sbar_DrawNum (7, (vid_conheight.integer - 45), cl.stats[STAT_HEALTH], 3, 5);
  577. +               // ammo_big
  578. +               Sbar_DrawNum (75, (vid_conheight.integer - 45), cl.stats[STAT_AMMO], 3, 4);
  579. +               //armor
  580. +               if (cl.stats[TFN_ARMOR_FIRE] >= 5)
  581. +                   DrawQ_Pic((vid_conwidth.integer/2 + 178), (vid_conheight.integer - 48), sb_armor[0], (cl.stats[TFN_ARMOR_FIRE] / 5 + 2), 14, 1, 1, 1, sbar_alpha_fg.value, 0);
  582. +               if (cl.stats[TFN_ARMOR_BODY] >= 5)
  583. +                   DrawQ_Pic((vid_conwidth.integer/2 + 178), (vid_conheight.integer - 32), sb_armor[1], (cl.stats[TFN_ARMOR_BODY] / 5 + 2), 14, 1, 1, 1, sbar_alpha_fg.value, 0);
  584. +               if (cl.stats[TFN_ARMOR_SPIRIT] >= 5)
  585. +                   DrawQ_Pic((vid_conwidth.integer/2 + 178), (vid_conheight.integer - 16), sb_armor[2], (cl.stats[TFN_ARMOR_SPIRIT] / 5 + 2), 14, 1, 1, 1, sbar_alpha_fg.value, 0);
  586. +               Sbar_DrawNum ((vid_conwidth.integer/2 + 186), (vid_conheight.integer - 48), cl.stats[TFN_ARMOR_FIRE], 3, 2);
  587. +               Sbar_DrawNum ((vid_conwidth.integer/2 + 186), (vid_conheight.integer - 32), cl.stats[TFN_ARMOR_BODY], 3, 2);
  588. +               Sbar_DrawNum ((vid_conwidth.integer/2 + 186), (vid_conheight.integer - 16), cl.stats[TFN_ARMOR_SPIRIT], 3, 2);
  589. +               // inventory
  590. +               if (!(cl.stats[TFN_ACTIVE_INVENTORY] == 0 && cl.stats[TFN_ITEM_MEDKIT] == 0))
  591. +               {
  592. +                   Sbar_DrawNum ((vid_conwidth.integer - 40), (vid_conheight.integer - 40), cl.stats[TFN_ITEM_MEDKIT + cl.stats[TFN_ACTIVE_INVENTORY]], 3, 3);
  593. +                   Sbar_DrawPic ((vid_conwidth.integer - 88), (vid_conheight.integer - 45), sb_inventory[cl.stats[TFN_ACTIVE_INVENTORY]]);
  594. +               }
  595. +           }
  596. +       }
  597.         else // Quake and others
  598.         {
  599.             sbar_x = (vid_conwidth.integer - 320)/2;
  600. @@ -1797,6 +1950,17 @@
  601.             else
  602.                 DrawQ_String(x, y, va(vabuf, sizeof(vabuf), "         spect %c%s", myself ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false, FONT_SBAR );
  603.         }
  604. +       else if (gamemode == GAME_TRANSFUSION)
  605. +       {
  606. +           // draw colors behind score
  607. +           c = palette_rgb_pantsscoreboard[(s->colors & 0xf0) >> 4];
  608. +           DrawQ_Fill(x, y+1, 40*FONT_SBAR->width_of[0], 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), sbar_alpha_fg.value, 0);
  609. +           c = palette_rgb_shirtscoreboard[s->colors & 0xf];
  610. +           DrawQ_Fill(x, y+4, 40*FONT_SBAR->width_of[0], 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), sbar_alpha_fg.value, 0);
  611. +           // print the text
  612. +           //DrawQ_String(x, y, va("%c%4i %s", myself ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, true);
  613. +           DrawQ_String(x, y, va(vabuf, sizeof(vabuf), "%5i %c%s", (int) s->frags, myself ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false, FONT_SBAR );
  614. +       }
  615.         else
  616.         {
  617.             // draw colors behind score
  618. @@ -1873,15 +2037,20 @@
  619.     DrawQ_Pic ((vid_conwidth.integer - sb_ranking->width)/2, 8, sb_ranking, 0, 0, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
  620.  
  621.     // draw the text
  622. -   y = 40;
  623. +
  624. +   if (gamemode == GAME_TRANSFUSION)
  625. +       y = 82;
  626. +   else
  627. +       y = 40;
  628.     if (cls.protocol == PROTOCOL_QUAKEWORLD)
  629.     {
  630.         DrawQ_String(xmin, y, va(vabuf, sizeof(vabuf), "ping pl%% time frags team  name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false, FONT_SBAR );
  631.     }
  632. +   else if (gamemode == GAME_TRANSFUSION)
  633. +       DrawQ_String(xmin, y, va(vabuf, sizeof(vabuf), "frags  name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false, FONT_SBAR );
  634.     else
  635. -   {
  636.         DrawQ_String(xmin, y, va(vabuf, sizeof(vabuf), "ping pl%% frags  name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL, false, FONT_SBAR );
  637. -   }
  638. +
  639.     y += 8;
  640.  
  641.     if (Sbar_IsTeammatch ())
  642. @@ -1964,6 +2133,37 @@
  643.  
  644.     if (gamemode == GAME_TRANSFUSION)
  645.     {
  646. +       // decide where to print
  647. +       numlines = 8;
  648. +      
  649. +       // give up if there isn't room
  650. +       if (numlines < 1)
  651. +           return;
  652. +      
  653. +       // scores
  654. +       Sbar_SortFrags ();
  655. +      
  656. +       //find us
  657. +       for (i = 0; i < scoreboardlines; i++)
  658. +           if (fragsort[i] == cl.playerentity - 1)
  659. +               break;
  660. +          
  661. +       // figure out start
  662. +       i -= numlines/2;
  663. +       i = min(i, scoreboardlines - numlines);
  664. +       i = max(i, 0);
  665. +      
  666. +       for (;i < scoreboardlines ;i++)
  667. +       {
  668. +           if (x >= 600)
  669. +           {
  670. +               x = 8;
  671. +               y += 22;
  672. +               if (y > 40)
  673. +                   return;
  674. +           }
  675. +           x += 152 + Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
  676. +       }
  677.         for (;i < range_end && x < vid_conwidth.integer;i++)
  678.             x += 128 + (int)Sbar_PrintScoreboardItem(cl.scores + fragsort[i], x, y);
  679.     }
  680. Index: sv_main.c
  681. ===================================================================
  682. --- sv_main.c   (revision 11991)
  683. +++ sv_main.c   (working copy)
  684. @@ -2062,6 +2062,31 @@
  685.     stats[STAT_ROCKETS] = (int)PRVM_serveredictfloat(ent, ammo_rockets);
  686.     stats[STAT_CELLS] = (int)PRVM_serveredictfloat(ent, ammo_cells);
  687.     stats[STAT_ACTIVEWEAPON] = (int)PRVM_serveredictfloat(ent, weapon);
  688. +
  689. +   if (gamemode == GAME_TRANSFUSION)
  690. +   {
  691. +       stats[TFN_AMMO_FLARE] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.ammo_flare);
  692. +       //stats[TFN_AMMO_SHELLS] =  // Done by Quake already
  693. +       //stats[TFN_AMMO_BULLETS] = // Done by Quake already
  694. +       //stats[TFN_AMMO_NAPALM] =  // Done by Quake already
  695. +       stats[TFN_AMMO_TNT_BUNDLE] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.ammo_tnt_bundle);
  696. +       stats[TFN_AMMO_TNT_REMOTE] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.ammo_tnt_remote);
  697. +       stats[TFN_AMMO_TNT_PROXY] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.ammo_tnt_proxy);
  698. +       stats[TFN_AMMO_SPRAY] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.ammo_spray);
  699. +       //stats[TFN_AMMO_TESLA] =  // Done by Quake already
  700. +       stats[TFN_AMMO_LEECH] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.ammo_leech);
  701. +       stats[TFN_AMMO_VOODOO] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.ammo_voodoo);
  702. +       stats[TFN_ARMOR_FIRE] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.armor_fire);
  703. +       stats[TFN_ARMOR_BODY] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.armor_body);
  704. +       stats[TFN_ARMOR_SPIRIT] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.armor_spirit);
  705. +       stats[TFN_ITEM_BOOTS] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.item_boots);
  706. +       stats[TFN_ITEM_MEDKIT] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.item_medkit);
  707. +       stats[TFN_ITEM_BEASTVISION] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.item_beastvision);
  708. +       stats[TFN_ITEM_CRYSTALBALL] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.item_crystalball);
  709. +       stats[TFN_ITEM_DIVINGSUIT] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.item_divingsuit);
  710. +       stats[TFN_ACTIVE_INVENTORY] = (int)PRVM_EDICTFIELDFLOAT(ent, prog->fieldoffsets.active_inventory);
  711. +   }
  712. +
  713.     stats[STAT_VIEWZOOM] = viewzoom;
  714.     stats[STAT_TOTALSECRETS] = (int)PRVM_serverglobalfloat(total_secrets);
  715.     stats[STAT_TOTALMONSTERS] = (int)PRVM_serverglobalfloat(total_monsters);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement