Browse Source

Maid: Chore-system moved to its own location

Christine 5 năm trước cách đây
mục cha
commit
8964056216
5 tập tin đã thay đổi với 195 bổ sung113 xóa
  1. 1 0
      glife.qproj
  2. 15 100
      locations/nichApartment.qsrc
  3. 1 1
      locations/nichBedroomTanja.qsrc
  4. 177 0
      locations/nichChore.qsrc
  5. 1 12
      locations/nichUtil.qsrc

+ 1 - 0
glife.qproj

@@ -361,6 +361,7 @@
 		<Location name="nichBedroomMaster"/>
 		<Location name="nichBedroomServant"/>
 		<Location name="nichBedroomTanja"/>
+		<Location name="nichChore"/>
 		<Location name="nichCook"/>
 		<Location name="nichGala"/>
 		<Location name="nichKitchen"/>

+ 15 - 100
locations/nichApartment.qsrc

@@ -7,7 +7,7 @@ $loc = 'nichApartment'
 $menu_loc = 'nichApartment'
 $menu_arg = ''
 menu_off = 0
-
+$location_type = 'private'
 !! A list of used variables is included in nichUtil
 
 !! Has to happen before there is any output
@@ -188,101 +188,9 @@ if $ARGS[0] = '' or $ARGS[0] = 'start' or $ARGS[0] = 'return':
 	end
 
 	if nichWork = 2:
-		if nichWorkState = 0:
-			act 'Inspect hallway':
-				*clr & cla
-				nichChoreID = 0
-				nichChoreTimeF = 1
-				$nichChoreType = 'floor'
-				$nichChoreLoc = 'hallway'
-				if nichChoreState[nichChoreID] = 0:
-					'The hallway has been cleaned recently. There is no need to clean it again.'
-				elseif nichChoreState[nichChoreID] <= 5:
-					'The floor is a little bit dirty.'
-				elseif nichChoreState[nichChoreID] <= 15:
-					nichChoreTimeF = 2
-					'The floor is somewhat dirty. One has to be careful not to step into the dirt.'
-				else
-					nichChoreTimeF = 4
-					'The floor is very dirty. Wearing shoes here would be wise because otherwise hosiery could be ruined.'
-				end
-				
-				nichtTimeQuick = 10* nichChoreTimeF
-				nichTimeNormal = 20* nichChoreTimeF
-				nichTimeDiligently = min(30* nichChoreTimeF,60)
-					
-				if nichOutfitState = 0:
-					'<b><font color = red>You have to change into an appropriate outfit before cleaning up.</font></b>'
-				elseif nichChoreState[nichChoreID] > 0:
-					act '(<<nichtTimeQuick>> minutes) Clean quickly':
-						*clr & cla
-						'<center><img <<$set_imgh>> src="<<$nichTempPic>>"></center>'
-						'You decide to clean the hallway as quickly as possible, not wasting your time with harder to reach spots or visiting a place twice.'
-						if pcs_cleaning < 80:
-							nichRand = rand(1,10)
-							if nichRand <= 3:
-								'Once you are finished you realize that you didn''t improve the condition of the floor at all. It is still as dirty as before.'
-							elseif rand <= 6 and nichChoreState[nichChoreID] > 10:
-								'Once you are finished you realize that the floor is now cleaner, but not perfectly clean.'
-								nichChoreState[nichChoreID] -= 10
-							else
-								nichChoreState[nichChoreID] = 0
-							end
-						end
-						minut += nichtTimeQuick
-						
-						cleaning_exp += rand (0,1)
-						gs'stat'
-						act 'Finish':
-							gt $loc, 'return'
-						end
-					end
-					
-					act '(<<nichTimeNormal>> minutes) Clean normally':
-						*clr & cla
-						'<center><img <<$set_imgh>> src="<<$nichTempPic>>"></center>'
-						'You carefully clean the hallway, making sure you also remove the dirt in hard to reach corners.'
-						minut += nichTimeNormal
-						nichChoreState[nichChoreID] = 0
-						cleaning_exp += rand (1,3)
-						act 'Finish':
-							gt $loc, 'return'
-						end
-					end
-					
-					act '(<<nichTimeDiligently>> minutes) Clean diligently':
-						*clr & cla
-						'<center><img <<$set_imgh>> src="<<$nichTempPic>>"></center>'
-						'You carefully clean the hallway, making sure you also remove the dirt in hard to reach corners.'
-						'Afterwards you apply a special polish to protect the wooden floor from visible aging.'
-						if rand(1,100) < pcs_cleaning:
-							'Much to your delight the polish visibly enhances the appearance of the floor.'
-							nichChoreState[nichChoreID] = -1
-						else
-							'The polish has no visible effect. The floor looks very clean nevertheless.'
-							nichChoreState[nichChoreID] = 0
-						end
-						
-						minut += nichTimeDiligently
-						
-						cleaning_exp += rand (1,5)
-						act 'Finish':
-							gt $loc, 'return'
-						end
-					end
-				end
-				
-				act 'Don''t clean':
-					gt $loc, 'return'
-				end
-				
-			end
 	
-		else
-			act 'Clean the apartment':
-				
-			end
-		end
+		gs 'nichChore','inspect','hallway'
+	
 	end
 	
 	if nichDebug = 1:
@@ -290,9 +198,12 @@ if $ARGS[0] = '' or $ARGS[0] = 'start' or $ARGS[0] = 'return':
 			gt 'nichUtil', 'debug'
 		end
 	end
-	
+		
 elseif $ARGS[0] = 'jobInterview':
 	*clr & cla
+	$location_type = 'event'
+	menu_off = 1
+	
 	'The adress you have been given leads you to a very expensive looking apartment building. A porter stands at the door, inspecting you while you come closer.'
 	'"Hello, I am here to apply for the job as live-in maid."'
 	
@@ -325,9 +236,8 @@ elseif $ARGS[0] = 'jobInterview':
 	end
 elseif $ARGS[0] = 'hiring':
 	*clr & cla
-	$location_type = 'private'
-	killvar '$locclass'
-	menu_off = 0
+	$location_type = 'event'
+	menu_off = 1
 	
 	if nichHotelReferral = 2:
 		nichHireMode = 1
@@ -449,10 +359,11 @@ elseif $ARGS[0] = 'hiring':
 			'She leads you to your new room.'
 			'It has a small double bed, a wardrobe, a desk and enough free space for doing excercises. A door leads to your personal bathroom.'
 			if nichHireMode = 1:
-				cla
+				killvar 'nichHireMode'
 				'After showing you around your tiny new home she leaves you.'
 				act 'Continue': gt 'nichBedroomServant'
 			elseif nichHireMode = 2:
+				killvar 'nichHireMode'
 				'After showing you around your tiny new home she sits down on your bed.'
 				'"Do I really have to call you Miss Tanya now, Miss Tanya?"'
 				'She laughs out. "No, of course not. Only when Nicholas is around. Following the ''protocol'' is very important to him."'
@@ -488,6 +399,10 @@ elseif $ARGS[0] = 'hiring':
 	
 elseif $ARGS[0] = 'visitTanya':
 	!! Visiting Tanya is only possible if PC is not employed by Nicholas. If she is she can find Tanya by going to her room.
+	
+	$location_type = 'event'
+	menu_off = 1
+	
 	if nichWork = 1:
 		*clr & cla
 		!! PC agreed to meet the parents for the job interview. Tanya expects her to be unemployed and dressed as a maid.

+ 1 - 1
locations/nichBedroomTanja.qsrc

@@ -17,7 +17,7 @@ if $ARGS[0] = '' or $ARGS[0] = 'start' or $ARGS[0] = 'return':
 	'<center><b>Tanya''s Room</b></center>'
 	'<center><img <<$set_imgh>> src="images/characters/city/nicholas/apartment/bedroomTanja.jpg"></center>'
 	*nl
-	'This room belongs to <a href="exec: gt ''nichTanya'', ''desc''">Tanya</a>, the woman you met at the gym and Nicholas'' stepdaughter. She is the reason you got this job to begin with, and while she is a little bit selfish, quick-tempered and spoiled, her heart seems to be in the right place.'
+	'This room belongs to <a href="exec: gt ''nichTanya'', ''desc''">Tanya</a>, Nicholas'' stepdaughter. While she is a little bit selfish, quick-tempered and spoiled, her heart seems to be in the right place.'
 	'Her room is usually in a state of chaos - typical for somebody who''s gotten used to others cleaning up after them - but otherwise displays the warmth and mix of colors you would expect of a woman who is still trying to figure herself out and doesn''t worry too much about the future.'
 	
 	$nichNichAct = func('nichUtil','npcActivity','nicholas')

+ 177 - 0
locations/nichChore.qsrc

@@ -0,0 +1,177 @@
+# nichChore
+
+
+
+!! $nichChoreID:
+!! 0: hallway
+!! 1: guest bathroom
+!! 2: servant bedroom
+!! 3: servant bathroom
+!! 4: laundry
+!! 5: tanya bedroom
+!! 6: master bathroom
+!! 7: master bedroom
+!! 8: living room
+!! 9: kitchen
+!!10: study
+
+!! nichChoreTimeF: Factor to multiply basetime with
+
+gs 'nichUtil', 'checkOutfit'
+
+if $ARGS[0] = 'inspect':
+	if $ARGS[1] = 'hallway':
+		$location_type = 'event'
+		menu_off = 1
+		
+		nichChoreID = 0
+		nichChoreTimeF = 1
+		$nichChoreType = 'floor'
+		$nichChoreLoc = 'hallway'
+		$nichChoreActCaption = 'Inspect Hallway'
+		
+		nichTimeBQuick		= 10
+		nichTimeBNormal		= 20
+		nichTimeBDiligent	= 30
+		
+		if nichChoreState[nichChoreID] = 0:
+			$nichChoreDesc = 'The hallway has been cleaned recently. There is no need to clean it again.'
+		elseif nichChoreState[nichChoreID] <= 5:
+			$nichChoreDesc = 'The floor is a little bit dirty.'
+		elseif nichChoreState[nichChoreID] <= 15:
+			nichChoreTimeF = 2
+			$nichChoreDesc = 'The floor is somewhat dirty. One has to be careful not to step into the dirt.'
+		else
+			nichChoreTimeF = 4
+			$nichChoreDesc = 'The floor is very dirty. Wearing shoes here would be wise because otherwise hosiery could be ruined.'
+		end
+		
+		
+		nichtTimeQuick 		= nichTimeBQuick    * nichChoreTimeF
+		nichTimeNormal 		= nichTimeBNormal   * nichChoreTimeF
+		nichTimeDiligent 	= nichTimeBDiligent * nichChoreTimeF
+		
+		
+	end
+	
+	
+	
+	act '<<$nichChoreActCaption>>':
+	
+		*clr & cla
+		'<<$nichChoreDesc>>'
+		
+		if nichOutfitState = 0:
+			'<b><font color = red>You have to change into an appropriate outfit before cleaning up.</font></b>'
+		elseif nichChoreState[nichChoreID] > 0:
+			act '(<<nichtTimeQuick>> minutes) Clean quickly':
+				gt 'nichChore', 'work', 1
+			end
+			act '(<<nichTimeNormal>> minutes) Clean normally':
+				gt 'nichChore', 'work', 2
+			end
+			act '(<<nichTimeDiligent>> minutes) Clean diligently':
+				gt 'nichChore', 'work', 3
+			end
+		end
+		
+		act 'Don''t clean':
+			gt $loc, 'return'
+		end
+		
+	end
+
+elseif $ARGS[0] = 'work':
+	!! ARG[1]:
+	!!	1: quick
+	!!	2: normal
+	!!	3: diligent
+	
+	nichRand = rand(1,100)
+	
+	killvar '$nichChoreResultCode'
+	killvar 'nichChoreResulChance'
+	
+	$nichTempPic = func('nichUtil','cleanPic',$nichChoreType,$nichChoreLoc)
+	
+	nichChoreResult = 0
+	
+	if nichChoreID = 0:
+		if ARGS[1] = 1:
+			$nichChoreDesc = 'You decide to clean the hallway as quickly as possible, not wasting your time with harder to reach spots or visiting a place twice.'
+			$nichChoreResultCode[ARRSIZE('$nichChoreResultCode')] = "*pl 'Once you are finished you realize that you didn''t improve the condition of the floor at all. It is still as dirty as before.' & nichChoreResult = nichChoreState[nichChoreID]"
+			nichChoreResulChance[ARRSIZE('nichChoreResulChance')] = 30
+			if nichChoreState[nichChoreID] > 10:
+				$nichChoreResultCode[ARRSIZE('$nichChoreResultCode')] = "*pl 'Once you are finished you realize that the floor is now cleaner, but not perfectly clean.' & nichChoreResult = nichChoreState[nichChoreID] - 10"
+				nichChoreResulChance[ARRSIZE('nichChoreResulChance')] = 30
+			end
+		elseif ARGS[1] = 2:
+			$nichChoreDesc = 'You carefully clean the hallway, making sure you also remove the dirt in hard to reach corners.'
+		else
+			$nichChoreDesc = 'You carefully clean the hallway, making sure you also remove the dirt in hard to reach corners. Afterwards you apply a special polish to protect the wooden floor from visible aging.'
+			$nichChoreResultCode[ARRSIZE('$nichChoreResultCode')] = "*pl 'Much to your delight the polish visibly enhances the appearance of the floor.' & nichChoreResult = -1"
+			nichChoreResulChance[ARRSIZE('nichChoreResulChance')] = pcs_cleaning
+			$nichChoreResultCode[ARRSIZE('$nichChoreResultCode')] = "*pl 'The polish has no visible effect. The floor looks very clean nevertheless.'"
+			nichChoreResulChance[ARRSIZE('nichChoreResulChance')] = 100
+		end
+	end
+	
+	!! Default to an empty event to prevent infinite loops
+	$nichChoreResultCode[ARRSIZE('$nichChoreResultCode')] = ''
+	nichChoreResulChance[ARRSIZE('nichChoreResulChance')] = 10000
+	
+	nichI = 0
+
+	:nichChoreResultLoop
+	if nichRand <= nichChoreResulChance[nichI]:
+		'<center><img <<$set_imgh>> src="<<$nichTempPic>>"></center>'
+		$nichChoreDesc
+		dynamic $nichChoreResultCode[nichI]
+	else
+		nichRand -= nichChoreResulChance[nichI]
+		nichI += 1
+		jump 'nichChoreResultLoop'
+	end
+	
+	if ARGS[1] = 1:
+		minut += nichtTimeQuick
+		cleaning_exp += rand (0,1)
+	elseif ARGS[1] = 2:
+		minut += nichTimeNormal
+		cleaning_exp += rand (1,3)
+	else
+		minut += nichTimeDiligent
+		cleaning_exp += rand (1,5)
+	end
+	
+	nichChoreState[nichChoreID] = nichChoreResult
+	
+	killvar 'nichChoreResult'
+	killvar '$nichChoreDesc'
+	killvar '$nichChoreResultCode'
+	killvar 'nichChoreResulChance'
+	
+	act 'Finish':
+		gt $loc, 'return'
+	end
+	
+end
+
+
+
+
+!!killvar 'nichChoreID'
+!!killvar 'nichChoreTimeF'
+!!killvar '$nichChoreType'
+!!killvar '$nichChoreLoc'
+!!killvar '$nichChoreDesc'
+
+!!killvar 'nichTimeBQuick'
+!!killvar 'nichTimeBNormal'
+!!killvar 'nichTimeBDiligent'
+
+!!killvar 'nichtTimeQuick'
+!!killvar 'nichTimeNormal'
+!!killvar 'nichTimeDiligently'
+
+--- nichChore ---------------------------------

+ 1 - 12
locations/nichUtil.qsrc

@@ -15,18 +15,7 @@
 !! nichSalaryNext
 !! nichSalaryOutstanding
 
-!! Chore IDs:
-!! 0: hallway
-!! 1: guest bathroom
-!! 2: servant bedroom
-!! 3: servant bathroom
-!! 4: laundry
-!! 5: tanya bedroom
-!! 6: master bathroom
-!! 7: master bedroom
-!! 8: living room
-!! 9: kitchen
-!!10: study
+