This is a simple, nice one. Fixes a minor frame-late error with the original Sniper Rifle laser, and on top of that, makes it fade out so you can actually SEE it!

(Sorry for fucked up indentation, blame the things I had to work with.)
object_event_add(Rifle,ev_create,0,"
laserAlpha = 0;
");
object_event_add(Rifle,ev_other,ev_user1,"
if (shot)
{
laserAlpha = 0.8;
shotx = x;
shoty = y;
}
");
object_event_clear(Rifle,ev_draw,0);
object_event_add(Rifle,ev_draw,0,"
event_inherited();
if (laserAlpha > 0.05)
{
shot = false;
var origdepth;
origdepth = depth;
depth = -2;
draw_set_alpha(laserAlpha);
if(owner.team == TEAM_RED)
draw_line_width_color(shotx,shoty,x2,y2,2,c_red,c_red);
else
draw_line_width_color(shotx,shoty,x2,y2,2,c_blue,c_blue);
laserAlpha /= 1.75;
draw_set_alpha(1);
depth = origdepth;
}
else
laserAlpha = 0;
if (owner.zoomed && owner == global.myself.object)
{
if (hitDamage < maxDamage)
{
draw_set_alpha(0.25);
draw_sprite_ext(ChargeS, 0, mouse_x + 15*-image_xscale, mouse_y - 10, -image_xscale, 1, 0, c_white, image_alpha);
draw_set_alpha(0.8);
}
else
draw_sprite_ext(FullChargeS, 0, mouse_x + 65*-image_xscale, mouse_y, 1, 1, 0, c_white, image_alpha);
draw_sprite_part_ext(ChargeS, 1, 0, 0, ceil((hitDamage)*40/maxDamage), 20, mouse_x + 15*-image_xscale, mouse_y - 10, -image_xscale, 1, c_white, image_alpha);
}
");
Versions: Any
Conflicts: None known; anything that modifies Rifle Draw event