Browse Source

[fixed] crash in grandpahelp

julzor 5 years ago
parent
commit
47da9bd56c
2 changed files with 115 additions and 112 deletions
  1. 1 1
      locations/Gadhouse.qsrc
  2. 114 111
      locations/grandpahelp.qsrc

+ 1 - 1
locations/Gadhouse.qsrc

@@ -440,7 +440,7 @@ if $ARGS[0]='grandpa':
 
 		act 'Leave him alone':gt 'Gadhouse', 'Start'
 		
-		if grandpahelpday ! daystart:act 'Offer to help':grandpahelpday = daystart & gt'grandpahelp'
+		if grandpahelpday ! daystart:act 'Offer to help':grandpahelpday = daystart & gt'grandpahelp', 'start'
 		if grandpatalkforest = 0:
 			act 'Ask about the forest (0:10)':
 				*clr & cla

+ 114 - 111
locations/grandpahelp.qsrc

@@ -1,129 +1,132 @@
 # grandpahelp
 
-menu_off = 1
-gs'stat'
-
+*clr & cla
 '<center><img <<$set_imgh>> src="images/locations/gadukino/grandparents/grandpa1.jpg"></center>'
 'You walk up to your grandfather and ask if he needs any help. Grandpa thinks for a moment and says:'
+menu_off = 1
+gs'stat'
 
-if month <= 4 or month >= 10:
-	grandpahelping = rand(0,5)
-elseif month = 5:
-	grandpahelping = rand(3,8)
-elseif month = 6 or month = 9:
-	grandpahelping = rand(3,12)
-else
-	grandpahelping = rand(3,13)
-end
-
-if grandpahelping = 0:
-	'"<<$pcs_nickname>>, could you bring firewood for the stove?"'
+if $ARGS[0] = 'start':
 
-	act 'Fetch firewood (0:15)':
-		*clr & cla
-		if month >= 4 and month <= 10:
-			'<center><img <<$set_imgh>> src="images/locations/gadukino/village/firewood.jpg"></center>'
-		else
-			'<center><img <<$set_imgh>> src="images/locations/gadukino/village/firewood_winter.jpg"></center>'
-		end
-		'You put on some warm clothes and run over to the barn to collect some firewood. '
-		'"I''ve brought some firewood grandfather," you said to your grandfather.'
-		'"You are very quick <<$pcs_nickname>>." he replies with a smile. "That''s today''s youth for ya. There is no more work today."'
-		minut += 15
-		grandmahelp += 1
-		gs'stat'
-
-		act 'Go':gt'Gadhouse'
+	if month <= 4 or month >= 10:
+		grandpahelping = rand(0,5)
+	elseif month = 5:
+		grandpahelping = rand(3,8)
+	elseif month = 6 or month = 9:
+		grandpahelping = rand(3,12)
+	else
+		grandpahelping = rand(3,13)
 	end
-elseif grandpahelping = 1:
-	'"<<$pcs_nickname>>, I need you to go to the barn and feed Desperado."'
 
-	act 'Go to the barn (0:15)':
-		*clr & cla
-		if month >= 4 and month <= 10:
-			'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
-		else
-			'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard_winter.jpg"></center>'
+	if grandpahelping = 0:
+		'"<<$pcs_nickname>>, could you bring firewood for the stove?"'
+
+		act 'Fetch firewood (0:15)':
+			*clr & cla
+			if month >= 4 and month <= 10:
+				'<center><img <<$set_imgh>> src="images/locations/gadukino/village/firewood.jpg"></center>'
+			else
+				'<center><img <<$set_imgh>> src="images/locations/gadukino/village/firewood_winter.jpg"></center>'
+			end
+			'You put on some warm clothes and run over to the barn to collect some firewood. '
+			'"I''ve brought some firewood grandfather," you said to your grandfather.'
+			'"You are very quick <<$pcs_nickname>>." he replies with a smile. "That''s today''s youth for ya. There is no more work today."'
+			minut += 15
+			grandmahelp += 1
+			gs'stat'
+
+			act 'Go':gt'Gadhouse'
 		end
-		'You went to the barn and fed the horse.'
-		feed_horse = 1
-		minut += 15
-		gs'stat'
-
-		act 'Continue':gt'Gadsarai'
-	end
-elseif grandpahelping = 2:
-	'"<<$pcs_nickname>>, go to the barn to feed the cows."'
-
-	act 'Go to the barn (0:15)':
-		*clr & cla
-		if month >= 4 and month <= 10:
-			'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
-		else
-			'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard_winter.jpg"></center>'
+	elseif grandpahelping = 1:
+		'"<<$pcs_nickname>>, I need you to go to the barn and feed Desperado."'
+
+		act 'Go to the barn (0:15)':
+			*clr & cla
+			if month >= 4 and month <= 10:
+				'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
+			else
+				'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard_winter.jpg"></center>'
+			end
+			'You went to the barn and fed the horse.'
+			feed_horse = 1
+			minut += 15
+			gs'stat'
+
+			act 'Continue':gt'Gadsarai'
 		end
-		'You went to the shed and fed the cows.'
-		minut += 15
-		feed_cow = 1
-		gs'stat'
-
-		act 'Continue':gt'Gadsarai'
-	end
-elseif grandpahelping = 3:
-	gt 'grandpahelp', 'cleanyard'
-elseif grandpahelping = 4:
-	gt 'grandpahelp', 'groomhorse'
-elseif grandpahelping = 5:
-	gt 'grandpahelp', 'feedhogs'
-elseif grandpahelping = 6 and hour >= 6 and hour < 9:
-	gt 'grandpahelp', 'grazehorse'
-elseif grandpahelping = 7 and hour >= 6 and hour < 9:
-	gt 'grandpahelp', 'leadcows'
-elseif grandpahelping = 8 and hour >= 6 and hour < 9:
-	gt 'grandpahelp', 'grazecows'
-elseif grandpahelping = 9 and temper >= 15 and sunWeather = 1 and week > 5:
-	gt 'grandpahelp', 'washhorse'
-elseif grandpahelping >= 10 and grandpahelping < 13 and go_in_boletus = 0 and go_in_bilberry = 0 and go_in_boletus_bilberry = 0:
-	gt 'grandpahelp', 'pickforest'
-elseif grandpahelping = 13 and temper >= 15 and sunWeather = 1 and hour >= 6 and hour < 9:
-	'"<<$pcs_nickname>>, we need to help out with hay gathering today. We have to go to the field and help out."'
-	'"Okay, grandfather," you replied. You grab a rake, and start walking towards the field.'
-
-	act 'Go to the field (0:40)':
-		*clr & cla
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_gadfield.jpg"></center>'
-		'With the rake in your hand you met up with the other local residents at the field. All the present at the field got assigned to a task. You work hard gathering the hay.'
-		haying_time = 1
-		minut += 40
-		gs'stat'
-
-		act 'Continue':gt'gadfield','field'
-	end
-else
-	if hour >= 9:
-		randmsg = rand(0,5)
-		if randmsg = 0:
-			'"You can rest today <<$pcs_nickname>>, you don''t need to help me today."'
-		elseif randmsg = 1:
-			'"You can rest today child, there is nothing to do."'
-		elseif randmsg = 2:
-			'"You can rest today <<$pcs_nickname>>, there is nothing to do."'
-		elseif randmsg = 3:
-			'"There''s no work today <<$pcs_nickname>>, go and rest up."'
-		elseif randmsg = 4:
-			'"You can rest today my dear granddaughter."'
-		else
-			'"You can take the day off to rest up."'
+	elseif grandpahelping = 2:
+		'"<<$pcs_nickname>>, go to the barn to feed the cows."'
+
+		act 'Go to the barn (0:15)':
+			*clr & cla
+			if month >= 4 and month <= 10:
+				'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
+			else
+				'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard_winter.jpg"></center>'
+			end
+			'You went to the shed and fed the cows.'
+			minut += 15
+			feed_cow = 1
+			gs'stat'
+
+			act 'Continue':gt'Gadsarai'
+		end
+	elseif grandpahelping = 3:
+		gt 'grandpahelp', 'cleanyard'
+	elseif grandpahelping = 4:
+		gt 'grandpahelp', 'groomhorse'
+	elseif grandpahelping = 5:
+		gt 'grandpahelp', 'feedhogs'
+	elseif grandpahelping = 6 and hour >= 6 and hour < 9:
+		gt 'grandpahelp', 'grazehorse'
+	elseif grandpahelping = 7 and hour >= 6 and hour < 9:
+		gt 'grandpahelp', 'leadcows'
+	elseif grandpahelping = 8 and hour >= 6 and hour < 9:
+		gt 'grandpahelp', 'grazecows'
+	elseif grandpahelping = 9 and temper >= 15 and sunWeather = 1 and week > 5:
+		gt 'grandpahelp', 'washhorse'
+	elseif grandpahelping >= 10 and grandpahelping < 13 and go_in_boletus = 0 and go_in_bilberry = 0 and go_in_boletus_bilberry = 0:
+		gt 'grandpahelp', 'pickforest'
+	elseif grandpahelping = 13 and temper >= 15 and sunWeather = 1 and hour >= 6 and hour < 9:
+		'"<<$pcs_nickname>>, we need to help out with hay gathering today. We have to go to the field and help out."'
+		'"Okay, grandfather," you replied. You grab a rake, and start walking towards the field.'
+
+		act 'Go to the field (0:40)':
+			*clr & cla
+			'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_gadfield.jpg"></center>'
+			'With the rake in your hand you met up with the other local residents at the field. All the present at the field got assigned to a task. You work hard gathering the hay.'
+			haying_time = 1
+			minut += 40
+			gs'stat'
+
+			act 'Continue':gt'gadfield','field'
 		end
 	else
-		randmsg = rand(0,1)
-		if randmsg = 0:
-			'"You don''t need to help out today <<$pcs_nickname>>."'
+		if hour >= 9:
+			randmsg = rand(0,5)
+			if randmsg = 0:
+				'"You can rest today <<$pcs_nickname>>, you don''t need to help me today."'
+			elseif randmsg = 1:
+				'"You can rest today child, there is nothing to do."'
+			elseif randmsg = 2:
+				'"You can rest today <<$pcs_nickname>>, there is nothing to do."'
+			elseif randmsg = 3:
+				'"There''s no work today <<$pcs_nickname>>, go and rest up."'
+			elseif randmsg = 4:
+				'"You can rest today my dear granddaughter."'
+			else
+				'"You can take the day off to rest up."'
+			end
 		else
-			'"You can take the day off."'
+			randmsg = rand(0,1)
+			if randmsg = 0:
+				'"You don''t need to help out today <<$pcs_nickname>>."'
+			else
+				'"You can take the day off."'
+			end
 		end
+		act 'Leave':gt'Gadhouse'
 	end
-	act 'Leave':gt'Gadhouse'
 end
 
 if $ARGS[0] = 'cleanyard':