1
0
Pārlūkot izejas kodu

Maid: convert old variables to new maid system

Christine 6 gadi atpakaļ
vecāks
revīzija
89dcf95441
3 mainītis faili ar 99 papildinājumiem un 19 dzēšanām
  1. 3 0
      glife.qproj
  2. 48 4
      locations/nichUtil.qsrc
  3. 48 15
      locations/tanhouse.qsrc

+ 3 - 0
glife.qproj

@@ -354,6 +354,9 @@
 		<Location name="tanvanr"/>
 		<Location name="tanNicholas"/>
 	</Folder>
+	<Folder name="Nicholas">
+		<Location name="nichUtil"/>
+	</Folder>
 	<Folder name="Apartment">
 		<Location name="bedr"/>
 		<Location name="sitr"/>

+ 48 - 4
locations/nichUtil.qsrc

@@ -1,7 +1,10 @@
+# nichUtil
+
 !! Used variables-
 !! Prefix- nich
 !! nichWork- 0= does not work for nicholas and never has, 1= currently works for nicholas, 2= quit job in good faith and could get hired again, 3= quit job in bad faith or got thrown out and nicholas is blocked
 !! nichPerformance- ranging from 0 (fired) to 100 (best)
+!! nickHired- the day Sveta was hired
 !! nichVacationFrom- the first free day if Sveta gets some time off 
 !! nichVactionTil- the last free day if Sveta gets some time off (=nichVacationFrom if she has one free day)
 !! nichLastWorkDay- the last day Sveta was in the appartment... needed because otherwise the player could avoid work performance checks by just not showing up here
@@ -20,7 +23,10 @@ end
 if $ARGS[0] = 'startWorkday':
 	nichMissedWorkdays = daystart - nichLastWorkDay - 1
 		
-	if nichVactionTil + 1 = daystart:
+	if nickHired + 1 = daystart:
+		!! this is the first workday ever
+		nichMissedWorkdays = 0
+	elseif nichVactionTil + 1 = daystart:
 		!! this is the first day Sveta has to work after a vacation... maybe work piled up?		
 		nichMissedWorkdays = nichMissedWorkdays - nichVactionTil + nichVacationFrom -1
 	elseif nichVactionTil >= daystart and nichVacationFrom <= daystart:
@@ -35,7 +41,7 @@ if $ARGS[0] = 'startWorkday':
 			'You see a note hanging at the door to your room.'
 			'"<<$pcs_nichname>>, you missed work. This is unacceptable. Take your stuff and leave. You are fired. -Nicholas"'
 			'You see all your belongings standing in front of the door prepared for your departure.'
-			gt 'nichUtil' 'fired'
+			gt 'nichUtil', 'fired'
 		else
 			'You see a note hanging at the door to your room.'
 			'"<<$pcs_nichname>>, you missed work. This is unacceptable. I expect this not to happen again. -Nicholas"'
@@ -47,7 +53,7 @@ if $ARGS[0] = 'startWorkday':
 			'You see a note hanging at the door to your room.'
 			'"<<$pcs_nichname>>, you missed your last evaluation. This is unacceptable. Take your stuff and leave. You are fired. -Nicholas"'
 			'You see all your belongings standing in front of the door prepared for your departure.'
-			gt 'nichUtil' 'fired'
+			gt 'nichUtil', 'fired'
 		else
 			'You see a note hanging at the door to your room.'
 			'"<<$pcs_nichname>>, you missed your last evaluation. This is unacceptable. I expect this not to happen again. -Nicholas"'
@@ -61,6 +67,7 @@ end
 !! get rid of all variables concerning Nicholas except for nichWork
 if $ARGS[0] = 'clearVars':
 	killvar 'nichPerformance'
+	killvar 'nickHired'
 	killvar 'nichVacationFrom'
 	killvar 'nichVactionTil'
 	killvar 'nichLastWorkDay'
@@ -78,7 +85,44 @@ if $ARGS[0] = 'fired':
 	
 	nichWork = 2
 	
-	gs 'nichUtil' 'clearVars'
+	gs 'nichUtil', 'clearVars'
 	
 	act 'Take your belongings and leave':gt 'down'
 end
+
+
+!! initializes variables when hired, might mess everything up if called at any other time
+if $ARGS[0] = 'hired':
+	nichWork = 1
+	nichPerformance = 20
+	nickHired = daystart
+	nichVacationFrom = daystart
+	nichVactionTil = daystart
+	nichLastWorkDay = daystart
+	nichEvaluationLast = daystart
+	nichEvaluationLastReq = daystart
+	nichMaidLaundry = 0
+	nichMaidDishes = 0
+	nichMaidGroceries = 0
+end
+
+!! convert the old vars to the new system
+if $ARGS[0] = 'convert':
+	if tanwork = 1:
+		gs 'nichUtil', 'hired'
+		nichPerformance = tan_work_rep * 5
+	end
+	killvar 'MaidWorkDay'
+	killvar 'MaidWork'
+	killvar 'TanHallClean'
+	killvar 'TanRoomClean'
+	killvar 'TanBathClean'
+	killvar 'TanMasterClean'
+	killvar 'TanLivingClean'
+	killvar 'TanMaidRoomClean'
+	killvar 'TanKitchenClean'
+	killvar 'TanMadeBreakfast'
+	killvar 'tanwork'
+	killvar 'tan_work_rep'
+end
+--- nichUtil ---------------------------------

+ 48 - 15
locations/tanhouse.qsrc

@@ -15,6 +15,11 @@ if $ARGS[0] = '' or $ARGS[0] = 'start':
 	tanhouse1 = 1
 	$location_type = 'private'
 	killvar '$locclass'
+	
+	if tanwork > 0:
+		gs 'nichUtil', 'convert'
+	end
+	
 	gs 'stat'
 	'<center><b>Nicholas'' Apartment</b></center>'
 	'<center><img <<$set_imgh>> src="images/locations/city/shared/house.jpg"></center>'
@@ -26,14 +31,14 @@ if $ARGS[0] = '' or $ARGS[0] = 'start':
 	end
 	'The corridor''s floor and walls are a tasteful mix of marble and wood. Besides several paintings and small statues for decoration, the only thing of note in it is are a coat and shoe rack for guests.'
 	
-	if nichWork = 1
+	if nichWork = 1:
 		if nichLastWorkDay ! daystart:
-			gs 'nichUtil' 'startWorkday'
+			gs 'nichUtil', 'startWorkday'
 		end
 	end
 	
 	
-	if MaidWorkDay ! daystart:
+!'	if MaidWorkDay ! daystart:
 		MaidWorkDay = daystart
 		MaidWork = 0
 		TanHallClean = 0
@@ -56,10 +61,10 @@ if $ARGS[0] = '' or $ARGS[0] = 'start':
 		'You did not go to see Nicholas yesterday evening. Regardless of how much or little work you did, this is sure to decrease your professional standing with him as your employer.'
 		tan_work_evaluation = 0
 	end
-
+'!
 	
 	
-	if niksvid >= 2 and hour > 12 and hour < 19 and dayrazb < daystart:gt 'tanhouse', 'razb'
+!!	if niksvid >= 2 and hour > 12 and hour < 19 and dayrazb < daystart:gt 'tanhouse', 'razb'
 	
 	if tan_work_evaluation = 0 and hour >= 20 and hour < 23:
 		''
@@ -68,20 +73,45 @@ if $ARGS[0] = '' or $ARGS[0] = 'start':
 
 	act '<b>Leave and go to the city center</b>':
 		if $clothingworntype ! 'nude':
+			minut += 5
 			gt'down'
 		else
 			msg'<b><font color = red>You can''t walk around the city like that! You need to get dressed first.</font></b>'
 			gt $CURLOC
 		end
 	end
-	act 'Go to the bathroom':gt 'tanvanr'
-	act 'Go to the kitchen':gt 'tankitchen'
-	act 'Go to your bedroom':gt 'tanspalnya'
-	act 'Go to the master bedroom':gt 'tanhozspal'
-	act 'Go to the living room':gt 'tanhousezal'
-	act 'Go to Tanya''s room':gt 'tanroom'
+	act 'Go to the bathroom':
+		minut += 1
+		gt 'tanvanr'
+	end
+	
+	act 'Go to the kitchen':
+		minut += 1
+		gt 'tankitchen'
+	end
+
+	act 'Go to your bedroom':
+		minut += 1
+		gt 'tanspalnya'
+	end
 
-	if tanwork = 1:
+	act 'Go to the master bedroom':
+		minut += 1
+		gt 'tanhozspal'
+	end
+
+	act 'Go to the living room':
+		minut += 1
+		gt 'tanhousezal'
+	end
+
+	act 'Go to Tanya''s room':
+		minut += 1
+		gt 'tanroom'
+	end
+
+
+!'	if tanwork = 1:
 		act 'Quit your Maid Job':
 			cla
 			menu_off = 1
@@ -95,8 +125,9 @@ if $ARGS[0] = '' or $ARGS[0] = 'start':
 			act 'No, I will carry on working here':	gt 'tanhouse'
 		end
 	end
+'!
 	
-	if $clothingworntype ! 'uniform' and TanHallClean = 0:
+!'	if $clothingworntype ! 'uniform' and TanHallClean = 0:
 		''
 		'You have not cleaned this room yet today but your contract requires that you wear a <b>maid uniform</b> while you work in the house.'
 	end
@@ -117,7 +148,9 @@ if $ARGS[0] = '' or $ARGS[0] = 'start':
 
 	if rand (0,2) ! 0:gs 'din_bad' & dynamic $mobile_check
 end
-
+'!
+end
+!'
 if $ARGS[0] = 'razb':
 	*clr & cla
 	menu_off = 1
@@ -216,6 +249,6 @@ if $ARGS[0] = 'razb':
 		end
 	end
 end
-
+'!
 --- tanhouse ---------------------------------