Kaynağa Gözat

[fixed] simplify a few conditionals. make the code for buying 10 joints worth of weed actually show up if you have the right amount of money and make the associated text say you are buying 10, not 5

Spackled Lanturn 3 yıl önce
ebeveyn
işleme
1e6de54f4f
1 değiştirilmiş dosya ile 4 ekleme ve 18 silme
  1. 4 18
      locations/metro.qsrc

+ 4 - 18
locations/metro.qsrc

@@ -115,25 +115,13 @@ if $ARGS[0] = 'vagon':
 	'<center><b><font color="maroon">Metro car</font></b></center>'
 	if hour < 7 or hour >=22:
 		if rand(0, 100) >= 70:gt 'metro_events', 'frot'
-		if rand(0,1) = 0:
-			metro_busy = 0
-		else
-			metro_busy = 1
-		end
+		metro_busy = rand(0,1)
 	elseif (hour >= 9 and hour < 16) or (hour >= 18 and hour < 22):
 		if rand(0, 100) >= 80:gt 'metro_events', 'frot'
-		if rand(0,1) = 0:
-			metro_busy = 1
-		else
-			metro_busy = 2
-		end
+		metro_busy = rand(1,2)
 	else
 		if rand(0, 100) >= 90:gt 'metro_events', 'frot'
-		if rand(0,1) = 0:
-			metro_busy = 2
-		else
-			metro_busy = 3
-		end
+		metro_busy = rand(2,3)
 	end
 
 	if metro_busy = 0:
@@ -215,9 +203,7 @@ if $ARGS[0] = 'shop':
 	end
 	if money >= 250:
 		'Buy enough <a href="exec:money -= 250 & joint += 5 & gt ''metro'', ''shop''">weed</a> for 5 joints for 250 <b>₽</b>'
-	elseif money >= 500:
-		'Buy enough <a href="exec:money -= 250 & joint += 5 & gt ''metro'', ''shop''">weed</a> for 5 joints for 250 <b>₽</b>'
-		'Buy enough <a href="exec:money -= 500 & joint += 10 & gt ''metro'', ''shop''">weed</a> for 5 joints for 500 <b>₽</b>'
+		if money >= 500:'Buy enough <a href="exec:money -= 500 & joint += 10 & gt ''metro'', ''shop''">weed</a> for 10 joints for 500 <b>₽</b>'
 	else
 		'Buy enough weed for 5 joints for 250 <b>₽</b> (You do not have enough money)'
 	end