hedgewars/GSHandlers.inc
changeset 2882 b9aceb3fe3d6
parent 2871 eec42a0b7014
child 2886 c7087a565bd2
equal deleted inserted replaced
2881:70d7976fa829 2882:b9aceb3fe3d6
  1188 	AllInactive:= false
  1188 	AllInactive:= false
  1189 	end else
  1189 	end else
  1190 	if ((GameTicks and $3F) = 25) then
  1190 	if ((GameTicks and $3F) = 25) then
  1191 		doStepFallingGear(Gear);
  1191 		doStepFallingGear(Gear);
  1192 
  1192 
  1193 if ((Gear^.State and gsttmpFlag) <> 0) then
  1193 if ((Gear^.State and gsttmpFlag) <> 0) and (Gear^.Health <> 0) then
  1194 	if ((Gear^.State and gstAttacking) = 0) then
  1194 	if ((Gear^.State and gstAttacking) = 0) then
  1195 		begin
  1195 		begin
  1196 		if ((GameTicks and $1F) = 0) then
  1196 		if ((GameTicks and $1F) = 0) then
  1197 			if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear^.State:= Gear^.State or gstAttacking
  1197 			if CheckGearNear(Gear, gtHedgehog, 46, 32) <> nil then Gear^.State:= Gear^.State or gstAttacking
  1198 		end else // gstAttacking <> 0
  1198 		end else // gstAttacking <> 0
  1199 		begin
  1199 		begin
  1200 		AllInactive:= false;
  1200 		AllInactive:= false;
  1201 		if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick);
  1201 		if (Gear^.Timer and $FF) = 0 then PlaySound(sndMineTick);
  1202 		if Gear^.Timer = 0 then
  1202 		if Gear^.Timer = 0 then
  1203 			begin
  1203 			begin
  1204 			doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
  1204             if ((Gear^.State and gstWait) <> 0) or 
  1205 			DeleteGear(Gear);
  1205                (cMineDudPercent = 0) or
       
  1206 		       (getRandom(100) > cMineDudPercent) then
       
  1207                begin
       
  1208 			   doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 50, EXPLAutoSound);
       
  1209 			   DeleteGear(Gear)
       
  1210                end
       
  1211             else Gear^.Health:= 0;
  1206 			exit
  1212 			exit
  1207 			end;
  1213 			end;
  1208 		dec(Gear^.Timer);
  1214 		dec(Gear^.Timer);
  1209 		end else // gsttmpFlag = 0
  1215 		end else // gsttmpFlag = 0
  1210 	if TurnTimeLeft = 0 then Gear^.State:= Gear^.State or gsttmpFlag;
  1216 	if TurnTimeLeft = 0 then Gear^.State:= Gear^.State or gsttmpFlag;