Forráskód Böngészése

[fixed] (1) make it so that the text and action for the case where the player's car breaks down when the player starts it are actually displayed, (2) make it so that the case where the player drives drunk and crashes into a tree is actually reachable (it wasn't previously because if alko >= 10 then alko > 0 is always true), and (3) simplify the conditional for determining whether the car breaks down by removing unnecessary parts

Spackled Lanturn 3 éve
szülő
commit
a299528e9d
1 módosított fájl, 58 hozzáadás és 79 törlés
  1. 58 79
      locations/carF.qsrc

+ 58 - 79
locations/carF.qsrc

@@ -110,32 +110,22 @@ if $ARGS[0] = 'salon':
 	act 'Get out of the car':dynamic $enddrive
 
 	if benz > 0 and wrek = 0 and prava > 0:
-		if teh >= tehcar * 75 / 100 and wrek = 0:
-			wrekrand = rand(0, 1000)
-
-			if wrekrand = 1000:wrek = 1
-		elseif teh < tehcar * 75 / 100 and teh >= tehcar * 50/100 and wrek = 0:
-			wrekrand = rand(0, 100)
-
-			if wrekrand = 100:wrek = 1
-		elseif teh < tehcar * 50 / 100 and teh >= tehcar * 25 / 100 and wrek = 0:
-			wrekrand = rand(0, 100)
-
-			if wrekrand >= 80:wrek = 1
-		elseif teh < tehcar * 25 / 100 and wrek = 0:
-			wrekrand = rand(0, 100)
+		if teh >= tehcar * 75 / 100:
+			if rand(0, 1000) = 1000:wrek = 1
+		elseif teh >= tehcar * 50 / 100:
+			if rand(0, 100) = 100:wrek = 1
+		elseif teh >= tehcar * 25 / 100:
+			if rand(0, 100) >= 80:wrek = 1
+		else
+			if rand(0, 100) >= 40:wrek = 1
+		end
 
-			if wrekrand >= 40:wrek = 1
-		elseif wrek = 1:
+		if wrek = 1:
 			'Something clatters loudly, and the engine stalls.'
 
 			act 'Fuck':gt 'carF', 'salon'
-		end
-
-		if alko > 0:
-			dpsrand = rand(0, 100)
-
-			if dpsrand <= alko:
+		else
+			if alko > 0 and rand(0, 100) <= alko:
 				'A policeman stops you. He looks at your condition and requests you breathe into a tube. You breathe, and a red light brightens up on the instrument panel.'
 				'The officer snorts and writes something down. He hands you a slip of paper with the number 50,000 on it'
 				'"Or I can write a report. But you will get a permanent record for driving drunk."'
@@ -157,70 +147,59 @@ if $ARGS[0] = 'salon':
 
 					act 'In the salon':gt 'carF', 'salon'
 				end
-
-				exit
-			end
-		elseif alko >= 10:
-			avarand = rand(0, 100)
-
-			if avarand >= 50:
+			elseif alko >= 10 and rand(0, 100) >= 50:
 				teh = teh/2
 				wrek = 1
 				'Driving drunk, you crash into a tree and wreck your car.'
 
 				act 'In the salon':gt 'carF', 'salon'
-
-				exit
-			end
-		end
-
-		if wrek = 0:
-
-			if (cardrive = 22 and nroad >= 18) or cardrive = 14 or cardrive = 20 or cardrive = 21 or cardrive = 24 or cardrive = 26:
-				car_town = 0
-				act 'Go to local destination': gs 'carF', 'pav'
-				act 'Go to the city':
-					minut += 65
-					*nl
-					'You drive for more than an hour on the highway before you get to the city.'
-					gs 'carF', 'city'
-				end
-				act 'Go to another destination':
-					minut += 30
-					*nl
-					'You drive out of Pavlovsk.'
-					gs 'carF', 'other'
-				end
-			elseif cardrive <= 11 or cardrive = 19 or cardrive = 25 or cardrive = 27:
-				car_town = 1
-				act 'Go to another city destination': gs 'carF', 'city'
-				act 'Go to Pavlovsk':
-					minut += 65
-					*nl
-					'You drive for more than an hour on the highway before you get to the town of Pavlovsk.'
-					gs 'carF', 'pav'
-				end
-				act 'Go to another destination':
-					minut += 30
-					*nl
-					'You drive out of the city.'
-					gs 'carF', 'other'
-				end
 			else
-				car_town = 2
-				act 'Go to a city destination':
-					minut += 30
-					*nl
-					'You drive for half an hour on the highway before you get to the city.'
-					gs 'carF', 'city'
-				end
-				act 'Go to a Pavlovsk destination':
-					minut += 30
-					*nl
-					'You drive for half an hour on the highway before you get to the town of Pavlovsk.'
-					gs 'carF', 'pav'
+				if (cardrive = 22 and nroad >= 18) or cardrive = 14 or cardrive = 20 or cardrive = 21 or cardrive = 24 or cardrive = 26:
+					car_town = 0
+					act 'Go to local destination': gs 'carF', 'pav'
+					act 'Go to the city':
+						minut += 65
+						*nl
+						'You drive for more than an hour on the highway before you get to the city.'
+						gs 'carF', 'city'
+					end
+					act 'Go to another destination':
+						minut += 30
+						*nl
+						'You drive out of Pavlovsk.'
+						gs 'carF', 'other'
+					end
+				elseif cardrive <= 11 or cardrive = 19 or cardrive = 25 or cardrive = 27:
+					car_town = 1
+					act 'Go to another city destination': gs 'carF', 'city'
+					act 'Go to Pavlovsk':
+						minut += 65
+						*nl
+						'You drive for more than an hour on the highway before you get to the town of Pavlovsk.'
+						gs 'carF', 'pav'
+					end
+					act 'Go to another destination':
+						minut += 30
+						*nl
+						'You drive out of the city.'
+						gs 'carF', 'other'
+					end
+				else
+					car_town = 2
+					act 'Go to a city destination':
+						minut += 30
+						*nl
+						'You drive for half an hour on the highway before you get to the city.'
+						gs 'carF', 'city'
+					end
+					act 'Go to a Pavlovsk destination':
+						minut += 30
+						*nl
+						'You drive for half an hour on the highway before you get to the town of Pavlovsk.'
+						gs 'carF', 'pav'
+					end
+					act 'Go to another destination': gs 'carF', 'other'
 				end
-				act 'Go to another destination': gs 'carF', 'other'
 			end
 		end
 	end