diff options
Diffstat (limited to 'src/fpsgame/game.h')
| -rw-r--r-- | src/fpsgame/game.h | 38 |
1 files changed, 18 insertions, 20 deletions
diff --git a/src/fpsgame/game.h b/src/fpsgame/game.h index 3ab0447..9427864 100644 --- a/src/fpsgame/game.h +++ b/src/fpsgame/game.h @@ -268,9 +268,23 @@ static const struct guninfo { { S_RLFIRE, 800, 120, 0, 270, 10, 1024, 1, 160, 40, 0, "rocketlauncher", "rocket", 0 }, { S_RIFLE, 1200, 120, 0, 0, 30, 2048, 1, 80, 0, 0, "rifle", "rifle", 0 }, { S_FLAUNCH, 600, 90, 0, 300, 20, 1024, 1, 250, 45, 1500, "grenadelauncher", "gl", 0 }, - { S_PISTOL, 400, 60, 160, 0, 10, 1024, 1, 80, 0, 0, "pistol", "pistol", 0 }, + { S_PISTOL, 400, 60, 110, 0, 10, 1024, 1, 80, 0, 0, "pistol", "pistol", 0 }, }; +/// Rough accuracy code, client-side only. + +extern int pwshotsfired[NUMGUNS]; +extern int pwshotshit[NUMGUNS]; +extern int pwdamagedealt[NUMGUNS]; +extern int pwaccuracy[NUMGUNS]; +extern int pwavgaccuracy; +extern int pwitemspicked[7]; + +extern void pwshot(int gun); +extern void pwhit(int gun, int damage); +extern void pwcalcaccuracy(void); +extern void pwreset(void); + #include "ai.h" // inherited by fpsent and server clients @@ -318,12 +332,6 @@ struct fpsstate [[fallthrough]]; case I_YELLOWARMOUR: return maxarmour<is.max || armour<maxarmour; - //~case I_TINYARMOUR: - //~if(armourtype==A_GREEN || armourtype==A_YELLOW || armour>=50)return false; - //~case I_GREENARMOUR: - //~// (100h/100g only absorbs 200 damage) - //~if(armourtype==A_YELLOW && armour>=100)return false; - //~case I_YELLOWARMOUR: return !armourtype || armour<is.max; case I_QUAD: return quadmillis<is.max; default: return ammo[is.info]<is.max; } @@ -338,13 +346,9 @@ struct fpsstate case I_TINYHEALTH: health = min(health+is.add, maxhealth); break; - //~case I_TINYARMOUR: - //~armour = min(armour+is.add, is.max); - //~armourtype = A_BLUE; - //~break; case I_BOOST: maxhealth = min(maxhealth+is.info, is.max); - [[fallthrough]]; + [[fallthrough]]; case I_HEALTH: // boost also adds to health health = min(health+is.add, maxhealth); break; @@ -357,11 +361,6 @@ struct fpsstate armour = min(armour+is.add, maxarmour); armourtype = is.info; break; - //~case I_GREENARMOUR: - //~case I_YELLOWARMOUR: - //~armour = min(armour+is.add, is.max); - //~armourtype = is.info; - //~break; case I_QUAD: quadmillis = min(quadmillis+is.add, is.max); break; @@ -402,7 +401,7 @@ struct fpsstate { armourtype = A_GREEN; armour = 100; - loopi(5) baseammo(i+1); + loopi(NUMGUNS-1) baseammo(i+1); gunselect = GUN_CG; ammo[GUN_CG] /= 2; } @@ -411,14 +410,13 @@ struct fpsstate armourtype = A_BLUE; armour = 25; ammo[GUN_PISTOL] = 40; - ammo[GUN_GL] = 1; } } // just subtract damage here, can set death, etc. later in code calling this int dodamage(int damage) { - int ad = (damage*(armourtype+1)*25)/100; // let armour absorb when possible + int ad = (damage*(armourtype+1)*30)/100; // let armour absorb when possible if(ad>armour) ad = armour; armour -= ad; damage -= ad; |
