Browse Source

[edit][fixed] I changed the code so that it does 99% the same thing without having the same text repeated contantly. The only thing that is changed is that you can now get the "water the plants" task in september.
fixed a logic error in beginning of the file. (you could never get the rand(0,2) option)

CroWke 5 years ago
parent
commit
ed614a3225
1 changed files with 92 additions and 229 deletions
  1. 92 229
      locations/grandmahelp.qsrc

+ 92 - 229
locations/grandmahelp.qsrc

@@ -9,120 +9,35 @@ frost = 0
 
 'You ask your grandmother if you there was something you could help out with something here at home. Your grandmother turns to you and says:'
 
-if month <= 4 and month >= 10:grandmahelping = RAND(0,2)
-if month = 5 or month = 6:grandmahelping = RAND(0,5)
-if month = 7:grandmahelping = RAND(0,6)
-if month = 8:grandmahelping = RAND(7,13)
-if month = 9:grandmahelping = RAND(14,19)
-
-if grandmahelping = 0:
-	'"- There is always something to do <<$pcs_nickname>>. I''ve gotten quite old and my strength is not what it used to be. Could you help me out by cleaning the floor?"'
-
-	act 'Clean the floor (1:00)':
-		cls
-		minut += 60
-		grandmahelp += 1
-		gs'stat'
+if month <= 4 or month >= 10:
+	grandmahelping = RAND(0,2)
+elseif month = 5 or month = 6:
+	grandmahelping = RAND(0,5)
+else
+	grandmahelping = RAND(0,6)
+end
 
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/washfloor.jpg"></center>'
-		'You grab a bucket and a rag, and get down on your knees and begin scrubbing the floor. Within the hour the floor shines and you are satisfied with the work you''ve done. You put the cleaning supplies into a corner and continue on with your day.'
-		
-		act 'Go':gt'Gadhouse'
-	end
+if grandmahelping = 0: 
+	gt 'grandmahelp', 'cleanfloor'
 elseif grandmahelping = 1:
-	'"- Of course, <<$pcs_nickname>>, you can help me wash your grandfathers dirty clothes."'
-
-	act 'Wash clothes (1:00)':
-		cls
-		minut += 60
-		grandmahelp += 1
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/washclothes1.jpg"></center>'
-		'You pick up grandfathers dirty clothes and take it with you outside where you soak them in water for an hour.'
-		
-		act 'Hang the Laundry':
-		    cls
-		    minut += 10
-		    gs'stat'
-		    '<center><img <<$set_imgh>> src="images/locations/gadukino/village/washclothes2.jpg"></center>'
-		    'You are done with the washing and walk over to the yard to carefully hang the clothes to dry.'
-
-		    act 'Go':gt'Gaddvor'
-		end    
-	end
+	gt 'grandmahelp', 'washclothes'
 elseif grandmahelping = 2 and hour < 9 and hour > 20:
-	' "- <<$pcs_nickname>>, go to the barn and milk the cows."'
-
-	act 'Go to the barn (0:10)':
-		cls
-		minut += 10
-		milk_cow = 1
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
-		'You walk over to the shed where the cows are kept.'
-
-		act 'Further':gt'Gadsarai'
-	end	
+	gt 'grandmahelp', 'milkcows'
 elseif grandmahelping = 3:
-	'"- Of course my dear <<$pcs_nickname>>, could you go to the yard and feed the chickens?"'
-	
-	act 'Feed for the chickens (0:30)':
-		cls
-		feed_chickens = 1
-		minut += 30
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/feed_chickens.jpg"></center>'
-		'You take the grain mix for the chickens with you and walk over to the yard.'
-
-		act 'Go':gt'Gaddvor'
-	end
+	gt 'grandmahelp', 'feedchickens'
 elseif grandmahelping = 4 and sunWeather = 1:
-	'"- <<$pcs_nickname>>, go to the garden and check on the plants."'
-
-	act 'Go to garden (0:10)':
-		cls
-        work_garden = 1
-		minut += 10
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
-		'You go to the garden.'
-
-		act 'Further':gt'Gadgarden','garden'
-	end	
+	gt 'grandmahelp', 'checkplants'
 elseif grandmahelping = 5 and sunWeather = 1:
-	'"- Dear <<$pcs_nickname>>, could you go and water the planted field in the garden?"'
-
-	act 'Go to the garden (0:10)':
-		cls
-        water_garden = 1
-		minut += 10
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
-		'You bring a bucket along with you to the garden.'
-
-		act 'Further':gt'Gadgarden','garden'
-	end
+	gt 'grandmahelp', 'waterplants'
 elseif grandmahelping = 6 and sunWeather = 1:
-	'"- <<$pcs_nickname>> dear, the strawberries are ripe to pick. Could you go over to the plot and pick them today?"'
-	
-	act 'Go to the strawberry plot (0:15)':
-		cls
-        collect_strawberries = 1
-		minut += 15
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
-		'You bring a basket with you and walk to the strawberry plot.'
+	gt 'grandmahelp', 'harvest'
+else
+	'"- There is nothing to do today <<$pcs_nickname>>, take a day off.'
+	act 'Go':gt'Gadhouse'			
+end
 
-		act 'Further':gt'Gadgarden','strawberry'
-	end
-elseif grandmahelping = 7:
-	'"- There is always something to do <<$pcs_nickname>>. I''ve gotten quite old and my knees hurt. Would you be kind and help me out by cleaning the floor?"'
+if $ARGS[0] = 'cleanfloor':
+	'"- There is always something to do <<$pcs_nickname>>. I''ve gotten quite old and my strength is not what it used to be. Could you help me out by cleaning the floor?"'
 
 	act 'Clean the floor (1:00)':
 		cls
@@ -131,117 +46,13 @@ elseif grandmahelping = 7:
 		gs'stat'
 
 		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/washfloor.jpg"></center>'
-		'Armed with a bucket and a rag, you hunch over and begin to scrub the floor. The floor is shining. You are satisfied and put the cleaning supplies into a corner.'
-
-		act 'Go':gt'Gadhouse'
-	end
-elseif grandmahelping = 8:
-	'"- Of course, <<$pcs_nickname>>, you grandfather was out running around the field, could you help me wash his dirty clothes?"'
-	
-	act 'Do the laundry (1:00)':
-		cls
-		minut += 60
-		grandmahelp += 1
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/washclothes1.jpg"></center>'
-		'You pick up grandfathers dirty clothes and take it with you outside where you soak them in water for an hour.'
+		'You grab a bucket and a rag, and get down on your knees and begin scrubbing the floor. Within the hour the floor shines and you are satisfied with the work you''ve done. You put the cleaning supplies into a corner and continue on with your day.'
 		
-		act 'Hang the Laundry':
-		    cls
-		    minut += 10
-		    gs'stat'
-		    '<center><img <<$set_imgh>> src="images/locations/gadukino/village/washclothes2.jpg"></center>'
-		    'You took the laundry out of the metal basin and carefully hung it in the yard.'
-
-		    act 'Go':gt'Gaddvor'
-		end    
-	end
-elseif grandmahelping = 9:
-	'"- Of course my dear <<$pcs_nickname>>, could you go and feed the chickens?"'
-	
-	act 'Feed the chickens (0:30)':
-		cls
-		feed_chickens = 1
-		minut += 30
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/feed_chickens.jpg"></center>'
-		'You take the grain mix for the chickens with you and walk over to the yard.'
-
-		act 'Go':gt'Gaddvor'
-	end
-elseif grandmahelping = 10 and hour < 9 and hour > 20:
-	'"- <<$pcs_nickname>>, go to the barn to milk the cows."'
-
-	act 'Go to the barn (0:10)':
-		cls
-		minut += 10
-		milk_cow = 1
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
-		'You walk over to the shed where the cows are kept.'
-
-		act 'Further':gt'Gadsarai'
-	end
-elseif grandmahelping = 11 and sunWeather = 1:
-	'"- <<$pcs_nickname>>, go to the garden and check on the plants."'
-
-	act 'Go to the garden (0:10)':
-		cls
-        work_garden = 1
-		minut += 10
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
-		'You go to the garden.'
-
-		act 'Further':gt'Gadgarden','garden'
-	end		
-elseif grandmahelping = 12 and sunWeather = 1:
-	'"- Dear <<$pcs_nickname>>, could you go and water the field in the garden?"'
-
-	act 'Go to the garden (0:10)':
-		cls
-        water_garden = 1
-		minut += 10
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
-		'You bring a bucket along with you to the garden.'
-
-		act 'Further':gt'Gadgarden','garden'
-	end	
-elseif grandmahelping = 13 and sunWeather = 1:
-	'"- <<$pcs_nickname>> dear, the fruits are ripe and it is time to start collecting them, could you go and do it today?"'
-
-	act 'Go to the garden (0:15)':
-		cls
-        fruit_collect = 1
-		minut += 15
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
-		'You bring a basket with you and walk to the fruit garden.'
-
-		act 'Further':gt'Gadgarden','fruit_garden'
-	end
-elseif grandmahelping = 14:
-	'"- Sure <<$pcs_nickname>>. I''ve gotten quite old, could you help me out by cleaning the floor?"'
-
-	act 'Clean the floor (1:00)':
-		cls
-		minut += 60
-		grandmahelp += 1
-		gs'stat'
-
-		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/washfloor.jpg"></center>'
-		'Armed with a bucket and a rag, you hunch over and begin to scrub the floor. The floor is shining. You are satisfied and put the cleaning supplies into a corner.'
-
 		act 'Go':gt'Gadhouse'
 	end
-elseif grandmahelping = 15:
+end
+
+if $ARGS[0] = 'washclothes':
 	'"- Of course, <<$pcs_nickname>>, you can help me wash your grandfathers dirty clothes."'
 	
 	act 'Wash clothes (1:00)':
@@ -263,7 +74,9 @@ elseif grandmahelping = 15:
 		    act 'Go':gt'Gaddvor'
 		end    
 	end
-elseif grandmahelping = 16:
+end
+
+if $ARGS[0] = 'feedchickens':
 	'"- Of course <<$pcs_nickname>>, would you be kind and feed the chickens?"'
 	
 	act 'Feed the chickens (0:30)':
@@ -277,8 +90,10 @@ elseif grandmahelping = 16:
 
 		act 'Go':gt'Gaddvor'
 	end
-elseif grandmahelping = 17 and hour < 9 and hour > 20:
-	'"- <<$pcs_nickname>>, go to the barn and milk the cows."'
+end
+
+if $ARGS[0] = 'milkcows':
+	' "- <<$pcs_nickname>>, go to the barn and milk the cows."'
 
 	act 'Go to the barn (0:10)':
 		cls
@@ -290,9 +105,11 @@ elseif grandmahelping = 17 and hour < 9 and hour > 20:
 		'You walk over to the shed where the cows are kept.'
 
 		act 'Further':gt'Gadsarai'
-	end
-elseif grandmahelping = 18 and sunWeather = 1:
-	'"- <<$pcs_nickname>>, could you go to the garden and check on the plants?"'
+	end	
+end
+
+if $ARGS[0] = 'checkplants':
+	'"- <<$pcs_nickname>>, go to the garden and check on the plants."'
 
 	act 'Go to garden (0:10)':
 		cls
@@ -301,27 +118,73 @@ elseif grandmahelping = 18 and sunWeather = 1:
 		gs'stat'
 
 		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
-		'You take a walk to the garden.'
+		'You go to the garden.'
 
 		act 'Further':gt'Gadgarden','garden'
 	end
-elseif grandmahelping = 19 and sunWeather = 1:
-	'"- <<$pcs_nickname>> dear, could you go to the garden today, it''s time to collect the harvest."'
+end
 
-	act 'Go to garden (0:10)':
+if $ARGS[0] = 'waterplants':
+	'"- Dear <<$pcs_nickname>>, could you go and water the planted field in the garden?"'
+
+	act 'Go to the garden (0:10)':
 		cls
-        harvest_garden = 1
+        water_garden = 1
 		minut += 10
 		gs'stat'
 
 		'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
-		'You bring the harvest tools with you and go over to the garden.'
+		'You bring a bucket along with you to the garden.'
 
 		act 'Further':gt'Gadgarden','garden'
 	end
-else
-	'"- There is nothing to do today <<$pcs_nickname>>, take a day off.'
-	act 'Go':gt'Gadhouse'			
 end
+
+if $ARGS[0] = 'harvest':
+	if month = 7:
+		'"- <<$pcs_nickname>> dear, the strawberries are ripe to pick. Could you go over to the plot and pick them today?"'
+		
+		act 'Go to the strawberry plot (0:15)':
+			cls
+			collect_strawberries = 1
+			minut += 15
+			gs'stat'
+
+			'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
+			'You bring a basket with you and walk to the strawberry plot.'
+
+			act 'Further':gt'Gadgarden','strawberry'
+		end
+	elseif month = 8:
+		'"- <<$pcs_nickname>> dear, the fruits are ripe and it is time to start collecting them, could you go and do it today?"'
+
+		act 'Go to the garden (0:15)':
+			cls
+			fruit_collect = 1
+			minut += 15
+			gs'stat'
+
+			'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
+			'You bring a basket with you and walk to the fruit garden.'
+
+			act 'Further':gt'Gadgarden','fruit_garden'
+		end
+	elseif month = 9:
+		'"- <<$pcs_nickname>> dear, could you go to the garden today, it''s time to collect the harvest."'
+
+		act 'Go to garden (0:10)':
+			cls
+			harvest_garden = 1
+			minut += 10
+			gs'stat'
+
+			'<center><img <<$set_imgh>> src="images/locations/gadukino/village/go_yard.jpg"></center>'
+			'You bring the harvest tools with you and go over to the garden.'
+
+			act 'Further':gt'Gadgarden','garden'
+		end
+	end
+end
+
 --- grandmahelp ---------------------------------