Advertisement
Guest User

Untitled

a guest
Sep 27th, 2011
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 19.54 KB | None | 0 0
  1. /*
  2. Copyright (C) 1997-2001 Id Software, Inc.
  3.  
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8.  
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12.  
  13. See the GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with this program; if not, write to the Free Software
  17. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  18.  
  19. */
  20.  
  21. // gs_weapondefs.c  -   hard coded weapon definitions
  22.  
  23. #include "q_arch.h"
  24. #include "q_math.h"
  25. #include "q_shared.h"
  26. #include "q_comref.h"
  27. #include "q_collision.h"
  28. #include "gs_public.h"
  29.  
  30. #define INSTANT 0
  31.  
  32. #define WEAPONDOWN_FRAMETIME 50
  33. #define WEAPONUP_FRAMETIME 50
  34. #define DEFAULT_BULLET_SPREAD 350
  35.  
  36. gs_weapon_definition_t gs_weaponDefs[] =
  37. {
  38.     {
  39.         "no weapon",
  40.         WEAP_NONE,
  41.         {
  42.             FIRE_MODE_STRONG,               // fire mode
  43.             AMMO_NONE,                      // ammo tag
  44.             0,                              // ammo usage per shot
  45.             0,                              // projectiles fired each shot
  46.  
  47.             //timings (in msecs)
  48.             WEAPONUP_FRAMETIME,             // weapon up frametime
  49.             WEAPONDOWN_FRAMETIME,                            // weapon down frametime
  50.             0,                              // reload frametime
  51.             0,                              // cooldown frametime
  52.             0,                              // projectile timeout
  53.             0,                              // smooth refire
  54.  
  55.             //damages
  56.             0,                              // damage
  57.             0,                              // selfdamage ratio
  58.             0,                              // knockback
  59.             0,                              // stun
  60.             0,                              // splash radius
  61.             0,                              // splash minimum damage
  62.             0,                              // splash minimum knockback
  63.  
  64.             //projectile def
  65.             0,                              // speed
  66.             0,                              // spread
  67.  
  68.             //ammo
  69.             0,                              // pickup amount
  70.             0                               // max amount
  71.         },
  72.  
  73.         {
  74.             FIRE_MODE_WEAK,                 // fire mode
  75.             AMMO_NONE,                      // ammo tag
  76.             0,                              // ammo usage per shot
  77.             0,                              // projectiles fired each shot
  78.  
  79.             //timings (in msecs)
  80.             WEAPONUP_FRAMETIME,             // weapon up frametime
  81.             WEAPONDOWN_FRAMETIME,                            // weapon down frametime
  82.             0,                              // reload frametime
  83.             0,                              // cooldown frametime
  84.             0,                              // projectile timeout
  85.             0,                              // smooth refire
  86.  
  87.             //damages
  88.             0,                              // damage
  89.             0,                              // selfdamage ratio
  90.             0,                              // knockback
  91.             0,                              // stun
  92.             0,                              // splash radius
  93.             0,                              // splash minimum damage
  94.             0,                              // splash minimum knockback
  95.  
  96.             //projectile def
  97.             0,                              // speed
  98.             0,                              // spread
  99.  
  100.             //ammo
  101.             0,                              // pickup amount
  102.             0                               // max amount
  103.         },
  104.     },
  105.  
  106.     {
  107.         "gunblade",
  108.         WEAP_GUNBLADE,
  109.         {
  110.             FIRE_MODE_STRONG,
  111.             AMMO_GUNBLADE,
  112.             1,                              // ammo usage per shot
  113.             1,                              // projectiles fired each shot
  114.  
  115.             //timings (in msecs)
  116.             WEAPONUP_FRAMETIME,             // weapon up frametime
  117.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  118.             400,                            // reload frametime
  119.             0,                              // cooldown frametime
  120.             5000,                           // projectile timeout
  121.             0,                              // smooth refire
  122.  
  123.             //damages
  124.             45,                             // damage
  125.             0.5,                            // selfdamage ratio
  126.             78,                             // knockback
  127.             0,                              // stun
  128.             90,                             // splash radius
  129.             8,                              // splash minimum damage
  130.             10,                             // splash minimum knockback
  131.  
  132.             //projectile def
  133.             3000,                           // speed
  134.             0,                              // spread
  135.  
  136.             //ammo
  137.             2,                              // pickup amount
  138.             10                              // max amount
  139.         },
  140.  
  141.         {
  142.             FIRE_MODE_WEAK,
  143.             AMMO_WEAK_GUNBLADE,
  144.             0,                              // ammo usage per shot
  145.             0,                              // projectiles fired each shot
  146.  
  147.             //timings (in msecs)
  148.             WEAPONUP_FRAMETIME,             // weapon up frametime
  149.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  150.             800,                            // reload frametime
  151.             0,                              // cooldown frametime
  152.             64,                             // projectile timeout  / projectile range for instant weapons
  153.             0,                              // smooth refire
  154.  
  155.             //damages
  156.             45,                             // damage
  157.             0,                              // selfdamage ratio
  158.             50,                             // knockback
  159.             0,                              // stun
  160.             0,                              // splash radius
  161.             0,                              // splash minimum damage
  162.             0,                              // splash minimum knockback
  163.  
  164.             //projectile def
  165.             0,                              // speed
  166.             0,                              // spread
  167.  
  168.             //ammo
  169.             0,                              // pickup amount
  170.             0                               // max amount
  171.         },
  172.     },
  173.  
  174.     {
  175.         "Machinegun",
  176.         WEAP_MACHINEGUN,
  177.         {
  178.             FIRE_MODE_STRONG,
  179.             AMMO_STRONG_BULLETS,
  180.             1,                              // ammo usage per shot
  181.             1,                              // projectiles fired each shot
  182.  
  183.             //timings (in msecs)
  184.             WEAPONUP_FRAMETIME,             // weapon up frametime
  185.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  186.             75,                             // reload frametime
  187.             0,                              // cooldown frametime
  188.             6000,                           // projectile timeout
  189.             0,                              // smooth refire
  190.  
  191.             //damages
  192.             7.65,                           // damage
  193.             0,                              // selfdamage ratio
  194.             5,                              // knockback
  195.             0,                              // stun
  196.             0,                              // splash radius
  197.             0,                              // splash minimum damage
  198.             0,                              // splash minimum knockback
  199.  
  200.             //projectile def
  201.             INSTANT,                        // speed
  202.             175,                            // spread
  203.  
  204.             //ammo
  205.             0,                              // pickup amount
  206.             0                               // max amount
  207.         },
  208.  
  209.         {
  210.             FIRE_MODE_WEAK,
  211.             AMMO_BULLETS,
  212.             1,                              // ammo usage per shot
  213.             1,                              // projectiles fired each shot
  214.  
  215.             //timings (in msecs)
  216.             WEAPONUP_FRAMETIME,             // weapon up frametime
  217.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  218.             75,                             // reload frametime
  219.             0,                              // cooldown frametime
  220.             6000,                           // projectile timeout
  221.             0,                              // smooth refire
  222.  
  223.             //damages
  224.             7.65,                           // damage
  225.             0,                              // selfdamage ratio
  226.             5,                              // knockback
  227.             0,                              // stun
  228.             0,                              // splash radius
  229.             0,                              // splash minimum damage
  230.             0,                              // splash minimum knockback
  231.  
  232.             //projectile def
  233.             INSTANT,                        // speed
  234.             175,                            // spread
  235.  
  236.             //ammo
  237.             100,                            // pickup amount
  238.             100                             // max amount
  239.         },
  240.     },
  241.  
  242.     {
  243.         "Riotgun",
  244.         WEAP_RIOTGUN,
  245.         {
  246.             FIRE_MODE_STRONG,
  247.             AMMO_SHELLS,
  248.             1,                              // ammo usage per shot
  249.             26,                             // projectiles fired each shot
  250.  
  251.             //timings (in msecs)
  252.             WEAPONUP_FRAMETIME,             // weapon up frametime
  253.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  254.             850,                            // reload frametime
  255.             0,                              // cooldown frametime
  256.             8192,                           // projectile timeout / projectile range for instant weapons
  257.             0,                              // smooth refire
  258.  
  259.             //damages
  260.             4,                              // damage
  261.             0,                              // selfdamage ratio (rg cant selfdamage)
  262.             5,                              // knockback
  263.             85,                             // stun
  264.             0,                              // splash radius
  265.             0,                              // splash minimum damage
  266.             0,                              // splash minimum knockback
  267.  
  268.             //projectile def
  269.             INSTANT,                        // speed
  270.             70,                             // spread
  271.  
  272.             //ammo
  273.             5,                              // pickup amount
  274.             10                              // max amount
  275.         },
  276.  
  277.         {
  278.             FIRE_MODE_WEAK,
  279.             AMMO_WEAK_SHELLS,
  280.             1,                              // ammo usage per shot
  281.             23,                             // projectiles fired each shot
  282.  
  283.             //timings (in msecs)
  284.             WEAPONUP_FRAMETIME,             // weapon up frametime
  285.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  286.             850,                            // reload frametime
  287.             0,                              // cooldown frametime
  288.             8192,                           // projectile timeout / projectile range for instant weapons
  289.             0,                              // smooth refire
  290.  
  291.             //damages
  292.             4,                              // damage
  293.             0,                              // selfdamage ratio (rg cant selfdamage)
  294.             5,                              // knockback
  295.             85,                             // stun
  296.             0,                              // splash radius
  297.             0,                              // splash minimum damage
  298.             0,                              // splash minimum knockback
  299.  
  300.             //projectile def
  301.             INSTANT,                        // speed
  302.             70,                             // spread
  303.  
  304.             //ammo
  305.             10,                             // pickup amount
  306.             15                              // max amount
  307.         },
  308.     },
  309.  
  310.     {
  311.         "Grenade Launcher",
  312.         WEAP_GRENADELAUNCHER,
  313.         {
  314.             FIRE_MODE_STRONG,
  315.             AMMO_GRENADES,
  316.             1,                              // ammo usage per shot
  317.             1,                              // projectiles fired each shot
  318.  
  319.             //timings (in msecs)
  320.             WEAPONUP_FRAMETIME,             // weapon up frametime
  321.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  322.             675,                            // reload frametime
  323.             0,                              // cooldown frametime
  324.             1250,                           // projectile timeout
  325.             0,                              // smooth refire
  326.  
  327.             //damages
  328.             65,                             // damage
  329.             0.85,                           // selfdamage ratio
  330.             100,                            // knockback
  331.             1250,                           // stun
  332.             170,                            // splash radius
  333.             15,                             // splash minimum damage
  334.             10,                             // splash minimum knockback
  335.  
  336.             //projectile def
  337.             900,                            // speed
  338.             0,                              // spread
  339.  
  340.             //ammo
  341.             5,                              // pickup amount
  342.             10                              // max amount
  343.         },
  344.  
  345.         {
  346.             FIRE_MODE_WEAK,
  347.             AMMO_WEAK_GRENADES,
  348.             1,                              // ammo usage per shot
  349.             1,                              // projectiles fired each shot
  350.  
  351.             //timings (in msecs)
  352.             WEAPONUP_FRAMETIME,             // weapon up frametime
  353.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  354.             675,                            // reload frametime
  355.             0,                              // cooldown frametime
  356.             1250,                           // projectile timeout
  357.             0,                              // smooth refire
  358.  
  359.             //damages
  360.             60,                             // damage
  361.             0.85,                           // selfdamage ratio
  362.             90,                             // knockback
  363.             1250,                           // stun
  364.             160,                            // splash radius
  365.             15,                             // splash minimum damage
  366.             5,                              // splash minimum knockback
  367.  
  368.             //projectile def
  369.             900,                            // speed
  370.             0,                              // spread
  371.  
  372.             //ammo
  373.             10,                             // pickup amount
  374.             15                              // max amount
  375.         },
  376.     },
  377.  
  378.     {
  379.         "Rocket Launcher",
  380.         WEAP_ROCKETLAUNCHER,
  381.         {
  382.             FIRE_MODE_STRONG,
  383.             AMMO_ROCKETS,
  384.             1,                              // ammo usage per shot
  385.             1,                              // projectiles fired each shot
  386.  
  387.             //timings (in msecs)
  388.             WEAPONUP_FRAMETIME,             // weapon up frametime
  389.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  390.             850,                            // reload frametime
  391.             0,                              // cooldown frametime
  392.             10000,                          // projectile timeout
  393.             0,                              // smooth refire
  394.  
  395.             //damages
  396.             75,                             // damage
  397.             0.85,                           // selfdamage ratio
  398.             100,                                // knockback
  399.             1250,                           // stun
  400.             130,                            // splash radius
  401.             8,                              // splash minimum damage
  402.             8,                             // splash minimum knockback
  403.  
  404.             //projectile def
  405.             1200,                           // speed
  406.             0,                              // spread
  407.  
  408.             //ammo
  409.             5,                              // pickup amount
  410.             10                              // max amount
  411.         },
  412.  
  413.         {
  414.             FIRE_MODE_WEAK,
  415.             AMMO_WEAK_ROCKETS,
  416.             1,                              // ammo usage per shot
  417.             1,                              // projectiles fired each shot
  418.  
  419.             //timings (in msecs)
  420.             WEAPONUP_FRAMETIME,             // weapon up frametime
  421.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  422.             850,                            // reload frametime
  423.             0,                              // cooldown frametime
  424.             10000,                          // projectile timeout
  425.             0,                              // smooth refire
  426.  
  427.             //damages
  428.             70,                             // damage
  429.             0.85,                           // selfdamage ratio
  430.             90,                             // knockback
  431.             1250,                           // stun
  432.             130,                            // splash radius
  433.             6,                              // splash minimum damage
  434.             5,                              // splash minimum knockback
  435.  
  436.             //projectile def
  437.             1200,                           // speed
  438.             0,                              // spread
  439.  
  440.             //ammo
  441.             10,                             // pickup amount
  442.             10                              // max amount
  443.         },
  444.     },
  445.            
  446.     {
  447.         "Plasmagun",
  448.         WEAP_PLASMAGUN,
  449.         {
  450.             FIRE_MODE_STRONG,
  451.             AMMO_PLASMA,
  452.             1,                              // ammo usage per shot
  453.             1,                              // projectiles fired each shot
  454.  
  455.             //timings (in msecs)
  456.             WEAPONUP_FRAMETIME,             // weapon up frametime
  457.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  458.             100,                            // reload frametime
  459.             0,                              // cooldown frametime
  460.             5000,                           // projectile timeout
  461.             0,                              // smooth refire
  462.  
  463.             //damages
  464.             15,                             // damage
  465.             0.5,                            // selfdamage ratio
  466.             18,                             // knockback
  467.             200,                            // stun
  468.             45,                             // splash radius
  469.             5,                              // splash minimum damage
  470.             1,                              // splash minimum knockback
  471.  
  472.             //projectile def
  473.             2600,                           // speed
  474.             0,                              // spread
  475.  
  476.             //ammo
  477.             40,                             // pickup amount
  478.             70                              // max amount
  479.         },
  480.  
  481.         {
  482.             FIRE_MODE_WEAK,
  483.             AMMO_WEAK_PLASMA,
  484.             1,                              // ammo usage per shot
  485.             1,                              // projectiles fired each shot
  486.  
  487.             //timings (in msecs)
  488.             WEAPONUP_FRAMETIME,             // weapon up frametime
  489.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  490.             100,                            // reload frametime
  491.             0,                              // cooldown frametime
  492.             5000,                           // projectile timeout
  493.             0,                              // smooth refire
  494.  
  495.             //damages
  496.             12,                             // damage
  497.             0.5,                            // selfdamage ratio
  498.             14,                             // knockback
  499.             200,                            // stun
  500.             45,                             // splash radius
  501.             0,                              // splash minimum damage
  502.             1,                              // splash minimum knockback
  503.  
  504.             //projectile def
  505.             2600,                           // speed
  506.             90,                             // spread
  507.  
  508.             //ammo
  509.             70,                             // pickup amount
  510.             125                             // max amount
  511.         },
  512.     },
  513.  
  514.     {
  515.         "Lasergun",
  516.         WEAP_LASERGUN,
  517.         {
  518.             FIRE_MODE_STRONG,
  519.             AMMO_LASERS,
  520.             1,                              // ammo usage per shot
  521.             1,                              // projectiles fired each shot
  522.  
  523.             //timings (in msecs)
  524.             WEAPONUP_FRAMETIME,             // weapon up frametime
  525.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  526.             50,                             // reload frametime
  527.             0,                              // cooldown frametime
  528.             850,                            // projectile timeout / projectile range for instant weapons
  529.             1,                              // smooth refire
  530.  
  531.             //damages
  532.             6.5,                            // damage
  533.             0,                              // selfdamage ratio (lg cant damage)
  534.             8,                              // knockback
  535.             200,                            // stun
  536.             0,                              // splash radius
  537.             0,                              // splash minimum damage
  538.             0,                              // splash minimum knockback
  539.  
  540.             //projectile def
  541.             INSTANT,                        // speed
  542.             0,                              // spread
  543.  
  544.             //ammo
  545.             50,                             // pickup amount
  546.             100                             // max amount
  547.         },
  548.  
  549.         {
  550.             FIRE_MODE_WEAK,
  551.             AMMO_WEAK_LASERS,
  552.             1,                              // ammo usage per shot
  553.             1,                              // projectiles fired each shot
  554.  
  555.             //timings (in msecs)
  556.             WEAPONUP_FRAMETIME,             // weapon up frametime
  557.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  558.             50,                             // reload frametime
  559.             0,                              // cooldown frametime
  560.             850,                            // projectile timeout / projectile range for instant weapons
  561.             1,                              // smooth refire
  562.  
  563.             //damages
  564.             6.5,                            // damage
  565.             0,                              // selfdamage ratio (lg cant damage)
  566.             8,                              // knockback
  567.             200,                            // stun
  568.             0,                              // splash radius
  569.             0,                              // splash minimum damage
  570.             0,                              // splash minimum knockback
  571.  
  572.             //projectile def
  573.             INSTANT,                        // speed
  574.             0,                              // spread
  575.  
  576.             //ammo
  577.             100,                            // pickup amount
  578.             175                             // max amount
  579.         },
  580.     },
  581.  
  582.     {
  583.         "Electrobolt",
  584.         WEAP_ELECTROBOLT,
  585.         {
  586.             FIRE_MODE_STRONG,
  587.             AMMO_BOLTS,
  588.             1,                              // ammo usage per shot
  589.             1,                              // projectiles fired each shot
  590.  
  591.             //timings (in msecs)
  592.             WEAPONUP_FRAMETIME,             // weapon up frametime
  593.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  594.             1250,                           // reload frametime
  595.             0,                              // cooldown frametime
  596.             900,                            // min damage range
  597.             0,                              // smooth refire
  598.  
  599.             //damages
  600.             75,                             // damage
  601.             0,                              // selfdamage ratio
  602.             40,                             // knockback
  603.             1000,                           // stun
  604.             0,                              // splash radius
  605.             75,                             // minimum damage
  606.             35,                             // minimum knockback
  607.  
  608.             //projectile def
  609.             INSTANT,                        // speed
  610.             0,                              // spread
  611.  
  612.             //ammo
  613.             5,                              // pickup amount
  614.             5                               // max amount
  615.         },
  616.  
  617.         {
  618.             FIRE_MODE_WEAK,
  619.             AMMO_WEAK_BOLTS,
  620.             1,                              // ammo usage per shot
  621.             1,                              // projectiles fired each shot
  622.  
  623.             //timings (in msecs)
  624.             WEAPONUP_FRAMETIME,             // weapon up frametime
  625.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  626.             1250,                           // reload frametime
  627.             0,                              // cooldown frametime
  628.             1024,                           // min damage range
  629.             0,                              // smooth refire
  630.  
  631.             //damages
  632.             60,                             // damage
  633.             0,                              // selfdamage ratio (eb cant selfdamage)
  634.             40,                             // knockback
  635.             1000,                           // stun
  636.             0,                              // splash radius
  637.             60,                             // minimum damage
  638.             35,                             // minimum knockback
  639.  
  640.             //projectile def
  641.             6000,                           // speed
  642.             0,                              // spread
  643.  
  644.             //ammo
  645.             5,                              // pickup amount
  646.             10                              // max amount
  647.         },
  648.     },
  649.  
  650.     {
  651.         "Instagun",
  652.         WEAP_INSTAGUN,
  653.         {
  654.             FIRE_MODE_STRONG,
  655.             AMMO_INSTAS,
  656.             1,                              // ammo usage per shot
  657.             1,                              // projectiles fired each shot
  658.  
  659.             //timings (in msecs)
  660.             WEAPONUP_FRAMETIME,             // weapon up frametime
  661.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  662.             1300,                           // reload frametime
  663.             0,                              // cooldown frametime
  664.             8024,                           // range
  665.             0,                              // smooth refire
  666.  
  667.             //damages
  668.             200,                            // damage
  669.             0.1,                            // selfdamage ratio (ig cant damage)
  670.             95,                             // knockback
  671.             1000,                           // stun
  672.             80,                             // splash radius
  673.             0,                              // splash minimum damage
  674.             0,                              // splash minimum knockback
  675.  
  676.             //projectile def
  677.             INSTANT,                        // speed
  678.             0,                              // spread
  679.  
  680.             //ammo
  681.             5,                              // pickup amount
  682.             5                               // max amount
  683.         },
  684.  
  685.         {
  686.             FIRE_MODE_WEAK,
  687.             AMMO_WEAK_INSTAS,
  688.             1,                              // ammo usage per shot
  689.             1,                              // projectiles fired each shot
  690.  
  691.             //timings (in msecs)
  692.             WEAPONUP_FRAMETIME,             // weapon up frametime
  693.             WEAPONDOWN_FRAMETIME,           // weapon down frametime
  694.             1300,                           // reload frametime
  695.             0,                              // cooldown frametime
  696.             8024,                           // range
  697.             0,                              // smooth refire
  698.  
  699.             //damages
  700.             125,                            // damage
  701.             0.1,                            // selfdamage ratio (ig cant damage)
  702.             95,                             // knockback
  703.             1000,                           // stun
  704.             80,                             // splash radius
  705.             0,                              // splash minimum damage
  706.             0,                              // splash minimum knockback
  707.  
  708.             //projectile def
  709.             INSTANT,                        // speed
  710.             0,                              // spread
  711.  
  712.             //ammo
  713.             5,                              // pickup amount
  714.             15                              // max amount
  715.         },
  716.     },
  717. };
  718.  
  719. #define GS_NUMWEAPONDEFS ( sizeof( gs_weaponDefs )/sizeof( gs_weapon_definition_t ) )
  720.  
  721. /*
  722. * GS_GetWeaponDef
  723. */
  724. gs_weapon_definition_t *GS_GetWeaponDef( int weapon )
  725. {
  726.     assert( GS_NUMWEAPONDEFS == WEAP_TOTAL );
  727.     assert( weapon >= 0 && weapon < WEAP_TOTAL );
  728.     return &gs_weaponDefs[weapon];
  729. }
  730.  
  731. /*
  732. * GS_InitWeapons
  733. */
  734. void GS_InitWeapons( void )
  735. {
  736.     int i;
  737.     gsitem_t *item;
  738.     gs_weapon_definition_t *weapondef;
  739.  
  740.     for( i = WEAP_GUNBLADE; i < WEAP_TOTAL; i++ )
  741.     {
  742.         item = GS_FindItemByTag( i );
  743.         weapondef = GS_GetWeaponDef( i );
  744.  
  745.         assert( item && weapondef );
  746.  
  747.         // hack : use the firedef pickup counts on items
  748.         if( item->weakammo_tag && GS_FindItemByTag( item->weakammo_tag ) )
  749.         {
  750.             GS_FindItemByTag( item->weakammo_tag )->quantity = weapondef->firedef_weak.ammo_pickup;
  751.             GS_FindItemByTag( item->weakammo_tag )->inventory_max = weapondef->firedef_weak.ammo_max;
  752.         }
  753.  
  754.         if( item->ammo_tag && GS_FindItemByTag( item->ammo_tag ) )
  755.         {
  756.             GS_FindItemByTag( item->ammo_tag )->quantity = weapondef->firedef.ammo_pickup;
  757.             GS_FindItemByTag( item->ammo_tag )->inventory_max = weapondef->firedef.ammo_max;
  758.         }
  759.     }
  760. }
  761.  
  762.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement