hedgewars/GSHandlers.inc
changeset 7281 c22dd112c958
parent 7276 e570bc0df33c
child 7283 322ff9418461
equal deleted inserted replaced
7279:18a620394623 7281:c22dd112c958
  4751 end;
  4751 end;
  4752 
  4752 
  4753 ////////////////////////////////////////////////////////////////////////////////
  4753 ////////////////////////////////////////////////////////////////////////////////
  4754 procedure doStepFlamethrowerWork(Gear: PGear);
  4754 procedure doStepFlamethrowerWork(Gear: PGear);
  4755 var 
  4755 var 
  4756     HHGear: PGear;
  4756     HHGear, flame: PGear;
  4757     rx, ry, speed: hwFloat;
  4757     rx, ry, speed: hwFloat;
  4758     i, gX, gY: LongInt;
  4758     i, gX, gY: LongInt;
  4759 begin
  4759 begin
  4760     AllInactive := false;
  4760     AllInactive := false;
  4761     HHGear := Gear^.Hedgehog^.Gear;
  4761     HHGear := Gear^.Hedgehog^.Gear;
  4789             begin
  4789             begin
  4790             rx := rndSign(getRandomf * _0_1);
  4790             rx := rndSign(getRandomf * _0_1);
  4791             ry := rndSign(getRandomf * _0_1);
  4791             ry := rndSign(getRandomf * _0_1);
  4792             speed := _0_5 * (_10 / Gear^.Tag);
  4792             speed := _0_5 * (_10 / Gear^.Tag);
  4793     
  4793     
  4794             AddGear(gx, gy, gtFlame, gstTmpFlag,
  4794             flame:= AddGear(gx, gy, gtFlame, gstTmpFlag,
  4795                     SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx,
  4795                     SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx,
  4796                     AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
  4796                     AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
       
  4797             flame^.CollisionMask:= $FF7F;
  4797             
  4798             
  4798             if (Gear^.Health mod 30) = 0 then
  4799             if (Gear^.Health mod 30) = 0 then
  4799                 AddGear(gx, gy, gtFlame, 0,
  4800                 begin
       
  4801                 flame:= AddGear(gx, gy, gtFlame, 0,
  4800                         SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx,
  4802                         SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx,
  4801                         AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
  4803                         AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
       
  4804                 flame^.CollisionMask:= $FF7F;
       
  4805                 end
  4802             end;
  4806             end;
  4803         Gear^.Timer:= Gear^.Tag
  4807         Gear^.Timer:= Gear^.Tag
  4804         end;
  4808         end;
  4805 
  4809 
  4806     if (Gear^.Health = 0) or (HHGear^.Damage <> 0) then
  4810     if (Gear^.Health = 0) or (HHGear^.Damage <> 0) then
  4832 end;
  4836 end;
  4833 
  4837 
  4834 ////////////////////////////////////////////////////////////////////////////////
  4838 ////////////////////////////////////////////////////////////////////////////////
  4835 procedure doStepLandGunWork(Gear: PGear);
  4839 procedure doStepLandGunWork(Gear: PGear);
  4836 var 
  4840 var 
  4837     HHGear: PGear;
  4841     HHGear, land: PGear;
  4838     rx, ry, speed: hwFloat;
  4842     rx, ry, speed: hwFloat;
  4839     i, gX, gY: LongInt;
  4843     i, gX, gY: LongInt;
  4840 begin
  4844 begin
  4841     AllInactive := false;
  4845     AllInactive := false;
  4842     HHGear := Gear^.Hedgehog^.Gear;
  4846     HHGear := Gear^.Hedgehog^.Gear;
  4869 
  4873 
  4870         rx := rndSign(getRandomf * _0_1);
  4874         rx := rndSign(getRandomf * _0_1);
  4871         ry := rndSign(getRandomf * _0_1);
  4875         ry := rndSign(getRandomf * _0_1);
  4872         speed := (_3 / Gear^.Tag);
  4876         speed := (_3 / Gear^.Tag);
  4873 
  4877 
  4874         AddGear(gx, gy, gtFlake, gstTmpFlag, 
  4878         land:= AddGear(gx, gy, gtFlake, gstTmpFlag, 
  4875                 SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx, 
  4879                 SignAs(AngleSin(HHGear^.Angle) * speed, HHGear^.dX) + rx, 
  4876                 AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
  4880                 AngleCos(HHGear^.Angle) * ( - speed) + ry, 0);
       
  4881         land^.CollisionMask:= $FF7F;
  4877             
  4882             
  4878         Gear^.Timer:= Gear^.Tag
  4883         Gear^.Timer:= Gear^.Tag
  4879         end;
  4884         end;
  4880 
  4885 
  4881     if (Gear^.Health = 0) or (HHGear^.Damage <> 0) or ((HHGear^.Message and gmAttack) <> 0) then
  4886     if (Gear^.Health = 0) or (HHGear^.Damage <> 0) or ((HHGear^.Message and gmAttack) <> 0) then