hedgewars/GSHandlers.inc
changeset 5871 09daa06191d7
parent 5870 b9b9fb00c9dd
child 5873 4f2d8ce3732b
equal deleted inserted replaced
5870:b9b9fb00c9dd 5871:09daa06191d7
   510 procedure doStepMolotov(Gear: PGear);
   510 procedure doStepMolotov(Gear: PGear);
   511 var 
   511 var 
   512     i, gX, gY: LongInt;
   512     i, gX, gY: LongInt;
   513     dX, dY: hwFloat;
   513     dX, dY: hwFloat;
   514     Fire: PGear;
   514     Fire: PGear;
       
   515     smoke: PVisualGear;
   515 begin
   516 begin
   516     AllInactive := false;
   517     AllInactive := false;
   517 
   518 
   518     doStepFallingGear(Gear);
   519     doStepFallingGear(Gear);
   519     CalcRotationDirAngle(Gear);
   520     CalcRotationDirAngle(Gear);
   520 
   521 
   521     // let's add some smoke depending on speed
   522     // let's add some smoke depending on speed
   522     i:= max(32,152 - hwRound(Distance(Gear^.dX,Gear^.dY)*120));
   523     i:= max(32,152 - hwRound(Distance(Gear^.dX,Gear^.dY)*120))+random(10);
   523     if (GameTicks mod i) = 0 then
   524     if (GameTicks mod i) = 0 then
   524         AddVisualGear(hwRound(Gear^.X)-round(cos((Gear^.DirAngle+50) * pi / 180)*20), hwRound(Gear^.Y)-round(sin((Gear^.DirAngle+50) * pi / 180)*20), vgtSmoke);
   525         begin
       
   526         smoke:= AddVisualGear(hwRound(Gear^.X)-round(cos((Gear^.DirAngle+50) * pi / 180)*20), hwRound(Gear^.Y)-round(sin((Gear^.DirAngle+50) * pi / 180)*20), vgtSmoke);
       
   527         if smoke <> nil then smoke^.Scale:= 0.75;
       
   528         end;
   525 
   529 
   526     if (Gear^.State and gstCollision) <> 0 then
   530     if (Gear^.State and gstCollision) <> 0 then
   527     begin
   531     begin
   528         PlaySound(sndMolotov);
   532         PlaySound(sndMolotov);
   529         gX := hwRound(Gear^.X);
   533         gX := hwRound(Gear^.X);