From 2441b1ca631bd18eb9a8bfff633eff5208f2e986 Mon Sep 17 00:00:00 2001 From: driAn Date: Sun, 9 Nov 2008 22:20:03 +0000 Subject: [PATCH] reverted sniper test scenario git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@3478 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/entity.h | 2 +- source/src/weapon.cpp | 9 +++------ source/src/weapon.h | 1 + 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/source/src/entity.h b/source/src/entity.h index 55d5b8e3..aa3ad325 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, 81, 0, 0, 1, 50, 5, 4, 4, 1, 100, 500, 100, 1, false }, + { "sniper", S_SNIPER, S_RSNIPER, 1950, 1500, 85, 0, 0, 60, 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, 80, 19, 0, 0, 80, 10, 16, 6, 5, 4, 30, 75, 150, 1, true }, diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index cae2effc..7ca6e007 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -1020,6 +1020,7 @@ 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; } @@ -1029,12 +1030,8 @@ void sniperrifle::renderhudmodel() { if(!scoped) weapon::renderhudmodel(); } void sniperrifle::renderaimhelp(bool teamwarning) { - if(scoped) - { - drawscope(); - drawcrosshair(owner, teamwarning ? CROSSHAIR_TEAMMATE : CROSSHAIR_SCOPE, NULL, 24.0f); - } - else weapon::renderaimhelp(teamwarning); + if(scoped) drawscope(); + if(scoped || teamwarning) drawcrosshair(owner, teamwarning ? CROSSHAIR_TEAMMATE : CROSSHAIR_SCOPE, 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 b5de517f..0c4fdb09 100644 --- a/source/src/weapon.h +++ b/source/src/weapon.h @@ -103,6 +103,7 @@ struct sniperrifle : gun void attackfx(const vec &from, const vec &to, int millis); bool reload(); + int dynspread(); float dynrecoil(); bool selectable(); void onselecting();