Cstrike: Added sniper scopes to the AWP, G3SG1, Scout and SG550.
Their zoom-levels aren't final, I am pretty sure CS 1.5 had different zoom levels for each weapon. We'll have to research those values.
This commit is contained in:
parent
27cfaba85f
commit
bc9978be12
8 changed files with 154 additions and 35 deletions
|
@ -78,3 +78,46 @@ Cstrike_DrawSimpleCrosshair(void)
|
|||
cross_pos = g_hudmins + (g_hudres / 2) + [-12,-12];
|
||||
drawsubpic(cross_pos, [24,24], "sprites/crosshairs.spr_0.tga", [0.1875,0], [0.1875, 0.1875], [1,1,1], 1, DRAWFLAG_NORMAL);
|
||||
}
|
||||
|
||||
/*
|
||||
=================
|
||||
HUD_DrawScope
|
||||
|
||||
Tries to draw a scope whenever viewzoom < 1.0f
|
||||
=================
|
||||
*/
|
||||
void
|
||||
Cstrike_DrawScope(void)
|
||||
{
|
||||
vector scope_pos;
|
||||
static float scope_offset;
|
||||
static float scope_scale;
|
||||
|
||||
static void Cstrike_ScopePic(vector pos, vector sz, string img) {
|
||||
drawpic((pos * scope_scale) + [scope_offset, 0], img, sz * scope_scale, [1,1,1], 1.0f);
|
||||
}
|
||||
|
||||
// Draw the scope in the middle, seperately from the border
|
||||
scope_pos = g_hudmins + (g_hudres / 2) + [-128,-128];
|
||||
drawpic(scope_pos, "sprites/sniper_scope.spr_0.tga", [256,256], [1,1,1], 1.0f, DRAWFLAG_NORMAL);
|
||||
|
||||
// Border scale to fit the screen
|
||||
scope_scale = g_hudres[1] / 480;
|
||||
scope_offset = (g_hudres[0] / 2) - ((640 * scope_scale) / 2);
|
||||
|
||||
// Type 1 Border... more coming soon?
|
||||
Cstrike_ScopePic([0,0], [192,112], "sprites/top_left.spr_0.tga");
|
||||
Cstrike_ScopePic([192,0], [256,112], "sprites/top.spr_0.tga");
|
||||
Cstrike_ScopePic([448,0], [192,112], "sprites/top_right.spr_0.tga");
|
||||
Cstrike_ScopePic([0,112], [192,256], "sprites/left.spr_0.tga");
|
||||
Cstrike_ScopePic([448,112], [192,256], "sprites/right.spr_0.tga");
|
||||
Cstrike_ScopePic([0,368], [192,112], "sprites/bottom_left.spr_0.tga");
|
||||
Cstrike_ScopePic([192,368], [256,112], "sprites/bottom.spr_0.tga");
|
||||
Cstrike_ScopePic([448,368], [192,112], "sprites/bottom_right.spr_0.tga");
|
||||
|
||||
// Rect borders left and right
|
||||
if (scope_offset > 0) {
|
||||
drawfill([0,0], [scope_offset, g_hudres[1]], [0,0,0], 1.0f);
|
||||
drawfill([(640 * scope_scale) + scope_offset, 0], [scope_offset, g_hudres[1]], [0,0,0], 1.0f);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,4 +15,5 @@
|
|||
*/
|
||||
|
||||
void Cstrike_DrawCrosshair(void);
|
||||
void Cstrike_DrawSimpleCrosshair();
|
||||
void Cstrike_DrawSimpleCrosshair(void);
|
||||
void Cstrike_DrawScope(void);
|
||||
|
|
|
@ -14,9 +14,6 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
float(entity foo, float chanid) getchannellevel = #0;
|
||||
|
||||
|
||||
/*
|
||||
=================
|
||||
Client_Init
|
||||
|
@ -25,6 +22,16 @@ Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
|||
=================
|
||||
*/
|
||||
void Client_Init(float apilevel, string enginename, float engineversion)
|
||||
{
|
||||
}
|
||||
|
||||
void Client_InitDone(void)
|
||||
{
|
||||
/* change this to the motd */
|
||||
//VGUI_ChooseTeam();
|
||||
}
|
||||
|
||||
void Game_RendererRestarted(string rstr)
|
||||
{
|
||||
precache_model("sprites/640hud1.spr");
|
||||
precache_model("sprites/640hud2.spr");
|
||||
|
@ -40,9 +47,6 @@ void Client_Init(float apilevel, string enginename, float engineversion)
|
|||
precache_model("sprites/640hud14.spr");
|
||||
precache_model("sprites/640hud15.spr");
|
||||
precache_model("sprites/640hud16.spr");
|
||||
precache_model("sprites/hud640_01.spr");
|
||||
precache_model("sprites/hud640_02.spr");
|
||||
precache_model("sprites/hud640_04.spr");
|
||||
precache_model("sprites/bottom.spr");
|
||||
precache_model("sprites/bottom_left.spr");
|
||||
precache_model("sprites/bottom_right.spr");
|
||||
|
@ -53,16 +57,5 @@ void Client_Init(float apilevel, string enginename, float engineversion)
|
|||
precache_model("sprites/top.spr");
|
||||
precache_model("sprites/top_left.spr");
|
||||
precache_model("sprites/top_right.spr");
|
||||
|
||||
BEAM_TRIPMINE = particleeffectnum("beam_tripmine");
|
||||
}
|
||||
|
||||
void Client_InitDone(void)
|
||||
{
|
||||
/* change this to the motd */
|
||||
//VGUI_ChooseTeam();
|
||||
}
|
||||
|
||||
void Game_RendererRestarted(string rstr)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -23,14 +23,6 @@ Comparable to worldspawn in SSQC in that it's mostly used for precaches
|
|||
*/
|
||||
void Client_Init(float apilevel, string enginename, float engineversion)
|
||||
{
|
||||
precache_model("sprites/640hud1.spr");
|
||||
precache_model("sprites/640hud2.spr");
|
||||
precache_model("sprites/640hud3.spr");
|
||||
precache_model("sprites/640hud4.spr");
|
||||
precache_model("sprites/640hud5.spr");
|
||||
precache_model("sprites/640hud6.spr");
|
||||
|
||||
BEAM_TRIPMINE = particleeffectnum("beam_tripmine");
|
||||
}
|
||||
|
||||
void Client_InitDone(void)
|
||||
|
@ -39,5 +31,11 @@ void Client_InitDone(void)
|
|||
|
||||
void Game_RendererRestarted(string rstr)
|
||||
{
|
||||
|
||||
precache_model("sprites/640hud1.spr");
|
||||
precache_model("sprites/640hud2.spr");
|
||||
precache_model("sprites/640hud3.spr");
|
||||
precache_model("sprites/640hud4.spr");
|
||||
precache_model("sprites/640hud5.spr");
|
||||
precache_model("sprites/640hud6.spr");
|
||||
BEAM_TRIPMINE = particleeffectnum("beam_tripmine");
|
||||
}
|
||||
|
|
|
@ -160,6 +160,24 @@ w_awp_primary(void)
|
|||
pl.w_idle_next = pl.w_attack_next;
|
||||
}
|
||||
|
||||
void
|
||||
w_awp_secondary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next) {
|
||||
return;
|
||||
}
|
||||
/* Simple toggle of fovs */
|
||||
if (pl.viewzoom == 1.0f) {
|
||||
pl.viewzoom = 0.45f;
|
||||
} else if (pl.viewzoom == 0.45f) {
|
||||
pl.viewzoom = 0.1f;
|
||||
} else {
|
||||
pl.viewzoom = 1.0f;
|
||||
}
|
||||
pl.w_attack_next = 0.5f;
|
||||
}
|
||||
|
||||
void
|
||||
w_awp_reload(void)
|
||||
{
|
||||
|
@ -203,7 +221,10 @@ void
|
|||
w_awp_hud(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
Cstrike_DrawCrosshair();
|
||||
player pl = (player)self;
|
||||
if (pl.viewzoom < 1.0f) {
|
||||
Cstrike_DrawScope();
|
||||
}
|
||||
HUD_DrawAmmo1();
|
||||
HUD_DrawAmmo2();
|
||||
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
|
@ -252,7 +273,7 @@ weapon_t w_awp =
|
|||
w_awp_draw,
|
||||
__NULL__,
|
||||
w_awp_primary,
|
||||
__NULL__,
|
||||
w_awp_secondary,
|
||||
w_awp_reload,
|
||||
w_cstrike_weaponrelease,
|
||||
w_awp_hud,
|
||||
|
|
|
@ -156,6 +156,24 @@ w_g3sg1_primary(void)
|
|||
pl.w_idle_next = pl.w_attack_next;
|
||||
}
|
||||
|
||||
void
|
||||
w_g3sg1_secondary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next) {
|
||||
return;
|
||||
}
|
||||
/* Simple toggle of fovs */
|
||||
if (pl.viewzoom == 1.0f) {
|
||||
pl.viewzoom = 0.45f;
|
||||
} else if (pl.viewzoom == 0.45f) {
|
||||
pl.viewzoom = 0.1f;
|
||||
} else {
|
||||
pl.viewzoom = 1.0f;
|
||||
}
|
||||
pl.w_attack_next = 0.5f;
|
||||
}
|
||||
|
||||
void
|
||||
w_g3sg1_reload(void)
|
||||
{
|
||||
|
@ -199,7 +217,10 @@ void
|
|||
w_g3sg1_hud(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
Cstrike_DrawCrosshair();
|
||||
player pl = (player)self;
|
||||
if (pl.viewzoom < 1.0f) {
|
||||
Cstrike_DrawScope();
|
||||
}
|
||||
HUD_DrawAmmo1();
|
||||
HUD_DrawAmmo2();
|
||||
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
|
@ -248,7 +269,7 @@ weapon_t w_g3sg1 =
|
|||
w_g3sg1_draw,
|
||||
__NULL__,
|
||||
w_g3sg1_primary,
|
||||
__NULL__,
|
||||
w_g3sg1_secondary,
|
||||
w_g3sg1_reload,
|
||||
w_cstrike_weaponrelease,
|
||||
w_g3sg1_hud,
|
||||
|
|
|
@ -157,6 +157,24 @@ w_scout_primary(void)
|
|||
pl.w_idle_next = pl.w_attack_next;
|
||||
}
|
||||
|
||||
void
|
||||
w_scout_secondary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next) {
|
||||
return;
|
||||
}
|
||||
/* Simple toggle of fovs */
|
||||
if (pl.viewzoom == 1.0f) {
|
||||
pl.viewzoom = 0.45f;
|
||||
} else if (pl.viewzoom == 0.45f) {
|
||||
pl.viewzoom = 0.1f;
|
||||
} else {
|
||||
pl.viewzoom = 1.0f;
|
||||
}
|
||||
pl.w_attack_next = 0.5f;
|
||||
}
|
||||
|
||||
void
|
||||
w_scout_reload(void)
|
||||
{
|
||||
|
@ -200,7 +218,10 @@ void
|
|||
w_scout_hud(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
Cstrike_DrawCrosshair();
|
||||
player pl = (player)self;
|
||||
if (pl.viewzoom < 1.0f) {
|
||||
Cstrike_DrawScope();
|
||||
}
|
||||
HUD_DrawAmmo1();
|
||||
HUD_DrawAmmo2();
|
||||
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
|
@ -249,7 +270,7 @@ weapon_t w_scout =
|
|||
w_scout_draw,
|
||||
__NULL__,
|
||||
w_scout_primary,
|
||||
__NULL__,
|
||||
w_scout_secondary,
|
||||
w_scout_reload,
|
||||
w_cstrike_weaponrelease,
|
||||
w_scout_hud,
|
||||
|
|
|
@ -157,6 +157,24 @@ w_sg550_primary(void)
|
|||
pl.w_idle_next = pl.w_attack_next;
|
||||
}
|
||||
|
||||
void
|
||||
w_sg550_secondary(void)
|
||||
{
|
||||
player pl = (player)self;
|
||||
if (pl.w_attack_next) {
|
||||
return;
|
||||
}
|
||||
/* Simple toggle of fovs */
|
||||
if (pl.viewzoom == 1.0f) {
|
||||
pl.viewzoom = 0.45f;
|
||||
} else if (pl.viewzoom == 0.45f) {
|
||||
pl.viewzoom = 0.1f;
|
||||
} else {
|
||||
pl.viewzoom = 1.0f;
|
||||
}
|
||||
pl.w_attack_next = 0.5f;
|
||||
}
|
||||
|
||||
void
|
||||
w_sg550_reload(void)
|
||||
{
|
||||
|
@ -200,7 +218,10 @@ void
|
|||
w_sg550_hud(void)
|
||||
{
|
||||
#ifdef CSQC
|
||||
Cstrike_DrawCrosshair();
|
||||
player pl = (player)self;
|
||||
if (pl.viewzoom < 1.0f) {
|
||||
Cstrike_DrawScope();
|
||||
}
|
||||
HUD_DrawAmmo1();
|
||||
HUD_DrawAmmo2();
|
||||
vector aicon_pos = g_hudmins + [g_hudres[0] - 48, g_hudres[1] - 42];
|
||||
|
@ -249,7 +270,7 @@ weapon_t w_sg550 =
|
|||
w_sg550_draw,
|
||||
__NULL__,
|
||||
w_sg550_primary,
|
||||
__NULL__,
|
||||
w_sg550_secondary,
|
||||
w_sg550_reload,
|
||||
w_cstrike_weaponrelease,
|
||||
w_sg550_hud,
|
||||
|
|
Loading…
Reference in a new issue