Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- if(readyToShoot == true) {
- playsound(x,y,SniperSnd);
- shot=true;
- justShot=true;
- readyToShoot = false;
- alarm[0] = reloadTime + 20*owner.zoomed;
- var hit;
- var x1,y1,xm,ym, len;
- var hitline;
- len=2000;
- x1=x;
- y1=y;
- x2=x+lengthdir_x(len,owner.aimDirection);
- y2=y+lengthdir_y(len,owner.aimDirection);
- while(len>1) {
- xm=(x1+x2)/2;
- ym=(y1+y2)/2;
- hitline = false;
- with(owner) {
- if (collision_line(x1,y1,xm,ym,Generator,true,true)>=0) {
- hitline = true;
- if instance_nearest(x1,y1,Generator).team == team hitline = false;
- }
- if(collision_line(x1,y1,xm,ym,Obstacle,true,true)>=0) {
- hitline = true;
- } else if (collision_line(x1,y1,xm,ym,Character,true,true)>=0) {
- hitline = true;
- } else if (collision_line(x1,y1,xm,ym,Sentry,true,false)>=0) {
- hitline = true;
- } else if (collision_line(x1,y1,xm,ym,TeamGate,true,true)>=0) {
- hitline = true;
- } else if (collision_line(x1,y1,xm,ym,IntelGate,true,true)>=0) {
- hitline = true;
- } else if (collision_line(x1,y1,xm,ym,ControlPointSetupGate,true,true)>=0) {
- if ControlPointSetupGate.solid == true hitline = true;
- } else if (collision_line(x1,y1,xm,ym,BulletWall,true,true)>=0) {
- hitline = true;
- }
- }
- if(hitline) {
- x2=xm;
- y2=ym;
- } else {
- x1=xm;
- y1=ym;
- }
- len/=2;
- }
- with(Player) {
- if(id != other.ownerPlayer and team != other.owner.team and object != -1) {
- if(collision_line(other.x,other.y,other.x2,other.y2,object,true,false)>=0) && object.ubered == 0 {
- object.hp -= other.hitDamage;
- //new
- if (object.lastDamageDealer != other.ownerPlayer && object.lastDamageDealer != object.player){
- object.secondToLastDamageDealer = object.lastDamageDealer;
- object.alarm[4] = object.alarm[3]
- }
- object.alarm[3] = ASSIST_TIME;
- //end
- object.lastDamageDealer = other.ownerPlayer;
- object.cloakAlpha = min(object.cloakAlpha + 0.3, 1);
- //new
- if(global.gibLevel > 0){
- blood = instance_create(object.x,object.y,Blood);
- blood.direction = other.owner.aimDirection-180;
- }
- if (!other.owner.zoomed)
- object.lastDamageSource = WEAPON_RIFLE;
- else
- object.lastDamageSource = WEAPON_RIFLE_CHARGED;
- exit;
- }
- }
- }
- with(Sentry) {
- if(team != other.owner.team) {
- if(collision_line(other.x,other.y,other.x2,other.y2,id,false,false)>=0) {
- hp -= other.hitDamage;
- lastDamageDealer = other.ownerPlayer;
- //new
- if (!other.owner.zoomed)
- lastDamageSource = WEAPON_RIFLE;
- else
- lastDamageSource = WEAPON_RIFLE_CHARGED;
- exit;
- }
- }
- }
- with(Generator) {
- if(team != other.owner.team) {
- if(collision_line(other.x,other.y,other.x2,other.y2,id,true,false)>=0) {
- hp -= other.hitDamage;
- exit;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement