seta crosshair_dot_color "1 0 0" "when != 0, use custom color for the crosshair dot"
seta crosshair_pickup 0.25
seta crosshair_pickup_speed 4
+seta crosshair_hitindication 0.5
+seta crosshair_hitindication_color "10 -10 -10"
+seta crosshair_hitindication_speed 5
seta crosshair_per_weapon 0 "when 1, each gun will display a different crosshair"
seta crosshair_color_per_weapon 1 "when 1, each gun will display the crosshair with a different color"
seta crosshair_effect_speed -1 "how fast (in seconds) some crosshair effects should take place, 0 = instant, -1 = 2x weapon switch time"
entity nightvision_noise, nightvision_noise2;
float pickup_crosshair_time, pickup_crosshair_size;
+float hitindication_crosshair_time, hitindication_crosshair_size;
float use_nex_chargepool;
float myhealth, myhealth_prev;
wcross_scale += sin(pickup_crosshair_size) * autocvar_crosshair_pickup;
}
+
+ vector hitindication_color;
+ if(autocvar_crosshair_hitindication)
+ {
+ hitindication_color = stov(autocvar_crosshair_hitindication_color);
+ if(hitindication_crosshair_time < getstatf(STAT_HIT_TIME))
+ {
+ hitindication_crosshair_size = 1;
+ hitindication_crosshair_time = getstatf(STAT_HIT_TIME);
+ }
+
+ if(hitindication_crosshair_size > 0)
+ hitindication_crosshair_size -= autocvar_crosshair_hitindication_speed * frametime;
+ else
+ hitindication_crosshair_size = 0;
+
+ wcross_scale += sin(hitindication_crosshair_size) * autocvar_crosshair_hitindication;
+ wcross_color_x += sin(hitindication_crosshair_size) * hitindication_color_x;
+ wcross_color_y += sin(hitindication_crosshair_size) * hitindication_color_y;
+ wcross_color_z += sin(hitindication_crosshair_size) * hitindication_color_z;
+ }
if(shottype == SHOTTYPE_HITENEMY)
wcross_scale *= autocvar_crosshair_hittest; // is not queried if hittest is 0
float autocvar_crosshair_dot_size;
float autocvar_crosshair_effect_scalefade;
float autocvar_crosshair_effect_speed;
+float autocvar_crosshair_hitindication;
+string autocvar_crosshair_hitindication_color;
+float autocvar_crosshair_hitindication_speed;
float autocvar_crosshair_hittest;
float autocvar_crosshair_hittest_blur;
float autocvar_crosshair_hittest_showimpact;
const float STAT_LAST_PICKUP = 50;
const float STAT_HUD = 51;
const float STAT_NEX_CHARGEPOOL = 52;
+const float STAT_HIT_TIME = 53;
// see DP source, quakedef.h
const float STAT_MOVEVARS_AIRSPEEDLIMIT_NONQW = 222;
self.impulse = 0;
self.items = spectatee.items;
self.last_pickup = spectatee.last_pickup;
+ self.hit_time = spectatee.hit_time;
self.metertime = spectatee.metertime;
self.strength_finished = spectatee.strength_finished;
self.invincible_finished = spectatee.invincible_finished;
.float last_pickup;
+.float hit_time;
+
.float stat_leadlimit;
float radar_showennemies;
else
attacker.hitsound += 1;
attacker.prevhitsound = time;
+ attacker.hit_time = time;
}
damage_goodhits += 1;
addstat(STAT_LEADLIMIT, AS_FLOAT, stat_leadlimit);
addstat(STAT_BULLETS_LOADED, AS_INT, sniperrifle_bulletcounter);
addstat(STAT_LAST_PICKUP, AS_FLOAT, last_pickup);
+ addstat(STAT_HIT_TIME, AS_FLOAT, hit_time);
addstat(STAT_NEX_CHARGE, AS_FLOAT, nex_charge);
addstat(STAT_NEX_CHARGEPOOL, AS_FLOAT, nex_chargepool_ammo);