hedgewars/uGears.pas
changeset 3450 c250116b9136
parent 3443 14d12df0d363
child 3453 d65657c94bb9
equal deleted inserted replaced
3449:033e4a8a9c74 3450:c250116b9136
   220 end;
   220 end;
   221 
   221 
   222 procedure spawnHealthTagForHH(HHGear: PGear; dmg: Longword);
   222 procedure spawnHealthTagForHH(HHGear: PGear; dmg: Longword);
   223 var tag: PVisualGear;
   223 var tag: PVisualGear;
   224 begin
   224 begin
   225 tag:= AddVisualGear(hwRound(HHGear^.X), hwRound(HHGear^.Y), vgtHealthTag, dmg);
   225 tag:= AddVisualGear(hwRound(HHGear^.X), hwRound(HHGear^.Y), vgtHealthTag, dmg);if (tag <> nil) then
   226 tag^.Hedgehog:= PHedgehog(HHGear^.Hedgehog); // the tag needs the tag to determine the text color
   226     begin
   227 tag^.doStep(tag,1); // do this now because the Gear could already be deleted on next step call
   227     tag^.Hedgehog:= PHedgehog(HHGear^.Hedgehog); // the tag needs the tag to determine the text color
   228 tag^.Hedgehog:= nil;
   228     tag^.doStep(tag,1); // do this now because the Gear could already be deleted on next step call
       
   229     tag^.Hedgehog:= nil
       
   230     end;
   229 AllInactive:= false;
   231 AllInactive:= false;
   230 HHGear^.Active:= true;
   232 HHGear^.Active:= true;
   231 end;
   233 end;
   232 
   234 
   233 function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
   235 function AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
  1158 if Radius > 25 then KickFlakes(Radius, X, Y);
  1160 if Radius > 25 then KickFlakes(Radius, X, Y);
  1159 
  1161 
  1160 if ((Mask and EXPLNoGfx) = 0) then
  1162 if ((Mask and EXPLNoGfx) = 0) then
  1161     begin
  1163     begin
  1162     if Radius > 50 then AddVisualGear(X, Y, vgtBigExplosion)
  1164     if Radius > 50 then AddVisualGear(X, Y, vgtBigExplosion)
  1163     else if Radius > 10 then AddVIsualGear(X, Y, vgtExplosion);
  1165     else if Radius > 10 then AddVisualGear(X, Y, vgtExplosion);
  1164     end;
  1166     end;
  1165 if (Mask and EXPLAutoSound) <> 0 then PlaySound(sndExplosion);
  1167 if (Mask and EXPLAutoSound) <> 0 then PlaySound(sndExplosion);
  1166 
  1168 
  1167 if (Mask and EXPLAllDamageInRadius) = 0 then
  1169 if (Mask and EXPLAllDamageInRadius) = 0 then
  1168     dmgRadius:= Radius shl 1
  1170     dmgRadius:= Radius shl 1