hedgewars/GSHandlers.inc
changeset 2024 2985f3bd18b7
parent 2023 41d3afaa20c7
child 2025 692308790912
equal deleted inserted replaced
2023:41d3afaa20c7 2024:2985f3bd18b7
   493 Gear^.doStep:= @doStepBulletWork
   493 Gear^.doStep:= @doStepBulletWork
   494 end;
   494 end;
   495 
   495 
   496 procedure doStepSniperRifleShot(Gear: PGear);
   496 procedure doStepSniperRifleShot(Gear: PGear);
   497 begin
   497 begin
       
   498 cArtillery:= true;
   498 if not cLaserSighting then // game doesn't have default laser sight. turn it on and give them a chance to aim
   499 if not cLaserSighting then // game doesn't have default laser sight. turn it on and give them a chance to aim
   499     begin
   500     begin
   500     cLaserSighting:= true;
   501     cLaserSighting:= true;
   501     cArtillery:= true;
       
   502 	DeleteGear(Gear);
   502 	DeleteGear(Gear);
   503 	AfterAttack;
   503 	AfterAttack;
   504     dec(CurrentHedgehog^.AttacksNum);
       
   505     exit 
   504     exit 
   506     end;
   505     end
       
   506 else
       
   507     inc(CurrentHedgehog^.AttacksNum); // burn up a shot, Tiy wants only a single shot
   507 
   508 
   508 if (PHedgehog(Gear^.Hedgehog)^.Gear^.Message and gm_Attack) <> 0 then
   509 if (PHedgehog(Gear^.Hedgehog)^.Gear^.Message and gm_Attack) <> 0 then
   509     begin
   510     begin
   510 	Gear^.State:= Gear^.State or gstAnimation;
   511 	Gear^.State:= Gear^.State or gstAnimation;
   511     PlaySound(sndGun, false, nil);
   512     PlaySound(sndGun, false, nil);
   512     Gear^.doStep:= @doStepBulletWork
   513     Gear^.doStep:= @doStepBulletWork
   513     end
   514     end;
       
   515 
       
   516 if (Gear^.Ammo^.NumPerTurn < CurrentHedgehog^.AttacksNum) and
       
   517    ((GameFlags and gfArtillery) = 0) then cArtillery:= false;
       
   518 
   514 end;
   519 end;
   515 
   520 
   516 ////////////////////////////////////////////////////////////////////////////////
   521 ////////////////////////////////////////////////////////////////////////////////
   517 procedure doStepActionTimer(Gear: PGear);
   522 procedure doStepActionTimer(Gear: PGear);
   518 begin
   523 begin