hedgewars/GSHandlers.inc
changeset 2424 b52344de23ae
parent 2376 ece7b87f1334
child 2425 a4af95e6382c
equal deleted inserted replaced
2423:32213ae19ba9 2424:b52344de23ae
  1229 
  1229 
  1230 ////////////////////////////////////////////////////////////////////////////////
  1230 ////////////////////////////////////////////////////////////////////////////////
  1231 procedure doStepFlame(Gear: PGear);
  1231 procedure doStepFlame(Gear: PGear);
  1232 var i: Integer;
  1232 var i: Integer;
  1233 begin
  1233 begin
  1234 AllInactive:= false;
  1234     if (Gear^.State and gsttmpFlag) = 0 then AllInactive:= false;
  1235 
  1235 
  1236 if not TestCollisionYwithGear(Gear, 1) then
  1236 if not TestCollisionYwithGear(Gear, 1) then
  1237 	begin
  1237 	begin
  1238 	if hwAbs(Gear^.dX) > _0_01 then
  1238 	if hwAbs(Gear^.dX) > _0_01 then
  1239 		Gear^.dX:= Gear^.dX * _0_995;
  1239 		Gear^.dX:= Gear^.dX * _0_995;
  1252 			PlaySound(sndVaporize, false, nil);
  1252 			PlaySound(sndVaporize, false, nil);
  1253 			end;
  1253 			end;
  1254 		DeleteGear(Gear);
  1254 		DeleteGear(Gear);
  1255 		exit
  1255 		exit
  1256 		end
  1256 		end
  1257 	end else begin
  1257     end else begin
  1258 	if Gear^.Timer > 0 then dec(Gear^.Timer)
  1258         if (Gear^.State and gsttmpFlag) <> 0 then 
  1259 		else begin
  1259             begin
  1260 		Gear^.Radius:= 9;
  1260             Gear^.Radius:= 9;
  1261 		AmmoShove(Gear, 4, 100);
  1261             AmmoShove(Gear, 4, 100);
  1262 		Gear^.Radius:= 1;
  1262             Gear^.Radius:= 1
  1263 		doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 4, EXPLNoDamage);
  1263             end;
  1264 		dec(Gear^.Health);
  1264 	    if Gear^.Timer > 0 then dec(Gear^.Timer)
  1265 		Gear^.Timer:= 450 - Gear^.Tag * 8
  1265         else begin
  1266 		end
  1266 // Standard fire
  1267 	end;
  1267             if (Gear^.State and gsttmpFlag) = 0 then
  1268 
  1268                 begin
  1269 //if (((GameTicks div 8) mod 64) = Gear^.Tag) then
  1269                 Gear^.Radius:= 9;
  1270 //	AmmoFlameWork(Gear);
  1270                 AmmoShove(Gear, 4, 100);
  1271 
  1271                 Gear^.Radius:= 1;
       
  1272                 doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 4, EXPLNoDamage);
       
  1273                 if Gear^.Health > 0 then dec(Gear^.Health);
       
  1274                 Gear^.Timer:= 450 - Gear^.Tag * 8
       
  1275                 end
       
  1276                 else begin
       
  1277 // Modified fire
       
  1278                 if ((GameTicks and $1FF) = 0) and ((GameFlags and gfSolidLand) = 0) then
       
  1279                     DrawExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 4);
       
  1280                 // This one is interesting.  I think I understand the purpose, but I wonder if a bit more fuzzy of kicking could be done with getrandom.
       
  1281         	    Gear^.Timer:= 100 - Gear^.Tag * 3;
       
  1282                 if ((GameTicks and $FF) = 0) then Gear^.Health:= 0
       
  1283                 end
       
  1284             end
       
  1285         end;
  1272 if Gear^.Health = 0 then
  1286 if Gear^.Health = 0 then
  1273 	DeleteGear(Gear)
  1287 	DeleteGear(Gear)
  1274 end;
  1288 end;
  1275 
  1289 
  1276 ////////////////////////////////////////////////////////////////////////////////
  1290 ////////////////////////////////////////////////////////////////////////////////