hedgewars/GSHandlers.inc
changeset 1586 2c6f1d1f43c1
parent 1579 2f581b1f289e
child 1590 646d56eacb8f
equal deleted inserted replaced
1585:9f9138531070 1586:2c6f1d1f43c1
  1128 Gear^.doStep:= @doStepIdle
  1128 Gear^.doStep:= @doStepIdle
  1129 end;
  1129 end;
  1130 
  1130 
  1131 ////////////////////////////////////////////////////////////////////////////////
  1131 ////////////////////////////////////////////////////////////////////////////////
  1132 procedure doStepFlame(Gear: PGear);
  1132 procedure doStepFlame(Gear: PGear);
  1133 var cWindFactor: hwFloat;
       
  1134 begin
  1133 begin
  1135 AllInactive:= false;
  1134 AllInactive:= false;
  1136 
  1135 
  1137 if not TestCollisionYwithGear(Gear, 1) then
  1136 if not TestCollisionYwithGear(Gear, 1) then
  1138 	begin
  1137 	begin
  1139 	cWindFactor:= cWindSpeed * 270;
  1138 	if hwAbs(Gear^.dX) > _0_01 then
       
  1139 		Gear^.dX:= Gear^.dX * _0_995;
       
  1140 
       
  1141 	Gear^.dY:= Gear^.dY + cGravity;
       
  1142 	if hwAbs(Gear^.dY) > _0_08 then Gear^.dY:= Gear^.dY * _0_995;
  1140 	
  1143 	
  1141 	if hwAbs(Gear^.dX - cWindFactor) > _0_01 then
  1144 	Gear^.X:= Gear^.X + Gear^.dX + cWindSpeed * 270;
  1142 		Gear^.dX:= (Gear^.dX - cWindFactor) * _0_995 + cWindFactor;
       
  1143 
       
  1144 	Gear^.dY:= Gear^.dY + cGravity;
       
  1145 	if hwAbs(Gear^.dY) > _0_1 then Gear^.dY:= Gear^.dY * _0_995;
       
  1146 	
       
  1147 	Gear^.X:= Gear^.X + Gear^.dX;
       
  1148 	Gear^.Y:= Gear^.Y + Gear^.dY;
  1145 	Gear^.Y:= Gear^.Y + Gear^.dY;
  1149 	
  1146 	
  1150 	if not (hwRound(Gear^.Y) < cWaterLine) then
  1147 	if not (hwRound(Gear^.Y) < cWaterLine) then
  1151 		begin
  1148 		begin
  1152 		DeleteGear(Gear);
  1149 		DeleteGear(Gear);
  1153 		exit
  1150 		exit
  1154 		end
  1151 		end
  1155 	end else begin
  1152 	end else begin
  1156 	if Gear^.Timer > 0 then dec(Gear^.Timer)
  1153 	if Gear^.Timer > 0 then dec(Gear^.Timer)
  1157 		else begin
  1154 		else begin
  1158 		Gear^.Radius:= 7;
  1155 		Gear^.Radius:= 9;
  1159 		AmmoShove(Gear, 3, 100);
  1156 		AmmoShove(Gear, 4, 100);
  1160 		Gear^.Radius:= 1;
  1157 		Gear^.Radius:= 1;
  1161 		doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 4, EXPLNoDamage);
  1158 		doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 4, EXPLNoDamage);
  1162 		dec(Gear^.Health);
  1159 		dec(Gear^.Health);
  1163 		Gear^.Timer:= 1250 - Gear^.Tag * 12
  1160 		Gear^.Timer:= 450 - Gear^.Tag * 8
  1164 		end
  1161 		end
  1165 	end;
  1162 	end;
  1166 
  1163 
  1167 //if (((GameTicks div 8) mod 64) = Gear^.Tag) then
  1164 //if (((GameTicks div 8) mod 64) = Gear^.Tag) then
  1168 //	AmmoFlameWork(Gear);
  1165 //	AmmoFlameWork(Gear);
  1293 	begin
  1290 	begin
  1294 	dec(Gear^.Health);
  1291 	dec(Gear^.Health);
  1295 	case Gear^.State of
  1292 	case Gear^.State of
  1296 			0: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0);
  1293 			0: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAirBomb, 0, cBombsSpeed * Gear^.Tag, _0, 0);
  1297 			1: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine,    0, cBombsSpeed * Gear^.Tag, _0, 0);
  1294 			1: FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine,    0, cBombsSpeed * Gear^.Tag, _0, 0);
  1298 			2: for i:= -17 to 17 do
  1295 			2: for i:= -19 to 19 do
  1299 				FollowGear:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtFlame, 0, _0_01 * i, _0, 0);
  1296 				FollowGear:= AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0, _0_001 * i, _0, 0);
  1300 			end;
  1297 			end;
  1301 	Gear^.dX:= Gear^.dX + int2hwFloat(30 * Gear^.Tag)
  1298 	Gear^.dX:= Gear^.dX + int2hwFloat(30 * Gear^.Tag)
  1302 	end;
  1299 	end;
  1303 
  1300 
  1304 if (GameTicks and $3F) = 0 then
  1301 if (GameTicks and $3F) = 0 then