From 8fbcc1979c110f8fe73ad6f5ea9fb1ecd7f12b51 Mon Sep 17 00:00:00 2001 From: driAn Date: Sat, 8 Nov 2008 11:35:08 +0000 Subject: [PATCH] sniper test: 80dmg, always show xhair, no spread git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3441 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/entity.h | 2 +- source/src/physics.cpp | 2 +- source/src/protocol.h | 2 +- source/src/weapon.cpp | 14 ++++++++------ source/src/weapon.h | 1 - 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/source/src/entity.h b/source/src/entity.h index 3df62fb5..8c85eaa8 100644 --- a/source/src/entity.h +++ b/source/src/entity.h @@ -66,7 +66,7 @@ static guninfo guns[NUMGUNS] = { "pistol", S_PISTOL, S_RPISTOL, 1400, 170, 19, 0, 0, 80, 10, 8, 6, 5, 1, 40, 75, 150, 1, false }, { "shotgun", S_SHOTGUN, S_RSHOTGUN, 2400, 1000, 5, 0, 0, 1, 35, 7, 9, 9, 1, 130, 500, 150, 1, false }, { "subgun", S_SUBGUN, S_RSUBGUN, 1650, 80, 16, 0, 0, 70, 15, 30, 1, 2, 4, 40, 60, 200, 1, true }, - { "sniper", S_SNIPER, S_RSNIPER, 1950, 1500, 85, 0, 0, 60, 50, 5, 4, 4, 1, 100, 500, 100, 1, false }, + { "sniper", S_SNIPER, S_RSNIPER, 1950, 1500, 80, 0, 0, 1, 50, 5, 4, 4, 1, 100, 500, 100, 1, false }, { "assault", S_ASSAULT, S_RASSAULT, 2000, 130, 24, 0, 0, 20, 40, 15, 0, 2, 2, 25, 60, 150, 1, true }, { "grenade", S_NULL, S_NULL, 1000, 650, 200, 20, 6, 1, 1, 1, 3, 1, 0, 0, 0, 0, 3, false }, { "pistol", S_PISTOL, S_RAKIMBO, 1400, 85, 19, 0, 0, 80, 10, 16, 6, 5, 4, 30, 75, 150, 1, true }, diff --git a/source/src/physics.cpp b/source/src/physics.cpp index 299594a0..7980066e 100644 --- a/source/src/physics.cpp +++ b/source/src/physics.cpp @@ -456,7 +456,7 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime) drop = dropf*curtime/gravity/100/moveres; // at high fps, gravity kicks in too fast rise = speed/moveres/1.2f; // extra smoothness when lifting up stairs - if(pl->maxspeed-16>0.5f) pl += 0xF0F0; + if(pl->maxspeed-16.0f>0.5f) pl += 0xF0F0; } } diff --git a/source/src/protocol.h b/source/src/protocol.h index 44fbbce6..45362a8b 100644 --- a/source/src/protocol.h +++ b/source/src/protocol.h @@ -5,7 +5,7 @@ #define CUBE_SERVINFO_PORT_LAN 28762 #define CUBE_SERVINFO_PORT(serverport) (serverport+1) #define CUBE_SERVINFO_TO_SERV_PORT(servinfoport) (servinfoport-1) -#define PROTOCOL_VERSION 1127 // bump when protocol changes +#define PROTOCOL_VERSION 1 // bump when protocol changes #define DEMO_VERSION 1 // bump when demo format changes #define DEMO_MAGIC "ASSAULTCUBE_DEMO" #define MAXMAPSENDSIZE 65536 diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 0f26a3f2..648dab90 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -479,8 +479,10 @@ void shorten(vec &from, vec &to, vec &target) void raydamage(vec &from, vec &to, playerent *d) { - int gdam = d->weaponsel->info.damage, hitzone = -1; + int dam = d->weaponsel->info.damage; + int hitzone = -1; playerent *o = NULL; + if(d->weaponsel->type==GUN_SHOTGUN) { uint done = 0; @@ -501,7 +503,7 @@ void raydamage(vec &from, vec &to, playerent *d) } else raysleft = true; } - if(hitrays) hitpush(hitrays*gdam, o, d, from, to, d->weaponsel->type, false, hitrays); + if(hitrays) hitpush(hitrays*dam, o, d, from, to, d->weaponsel->type, false, hitrays); if(!raysleft) break; } } @@ -511,11 +513,11 @@ void raydamage(vec &from, vec &to, playerent *d) if(d->weaponsel->type==GUN_KNIFE) gib = true; else if(d==player1 && d->weaponsel->type==GUN_SNIPER && hitzone==2) { - gdam *= 3; + dam *= 3; gib = true; } - hitpush(gdam, o, d, from, to, d->weaponsel->type, gib, gib ? 1 : 0); + hitpush(dam, o, d, from, to, d->weaponsel->type, gib, gib ? 1 : 0); shorten(from, o->o, to); } } @@ -1017,7 +1019,6 @@ bool sniperrifle::reload() return r; } -int sniperrifle::dynspread() { return scoped ? 1 : info.spread; } float sniperrifle::dynrecoil() { return scoped ? info.recoil / 3 : info.recoil; } bool sniperrifle::selectable() { return weapon::selectable() && !m_noprimary && this == owner->primweap; } void sniperrifle::onselecting() { weapon::onselecting(); scoped = false; } @@ -1028,7 +1029,8 @@ void sniperrifle::renderhudmodel() { if(!scoped) weapon::renderhudmodel(); } void sniperrifle::renderaimhelp(bool teamwarning) { if(scoped) drawscope(); - if(scoped || teamwarning) drawcrosshair(owner, teamwarning, type, NULL, 24.0f); + /*if(scoped || teamwarning) */ + drawcrosshair(owner, teamwarning, type, NULL, 24.0f); } void sniperrifle::setscope(bool enable) { if(this == owner->weaponsel && !reloading && owner->state == CS_ALIVE) scoped = enable; } diff --git a/source/src/weapon.h b/source/src/weapon.h index 0c4fdb09..b5de517f 100644 --- a/source/src/weapon.h +++ b/source/src/weapon.h @@ -103,7 +103,6 @@ struct sniperrifle : gun void attackfx(const vec &from, const vec &to, int millis); bool reload(); - int dynspread(); float dynrecoil(); bool selectable(); void onselecting();