Browse Source

[Added] Added a feature to rent a room at the hotel in city center

ADCSux 2 years ago
parent
commit
52cf553815
2 changed files with 102 additions and 20 deletions
  1. 93 17
      locations/city_hotel.qsrc
  2. 9 3
      locations/stat.qsrc

+ 93 - 17
locations/city_hotel.qsrc

@@ -1,7 +1,6 @@
 # city_hotel
-$this = 'city_hotel'
 
-if $ARGS[0] = 'start':
+if $ARGS[0] = 'start' or $ARGS[0] = '':
 	*clr & cla
 	nom_o[1] = 100
 	nom_o[2] = 1000
@@ -40,15 +39,18 @@ if $ARGS[0] = 'start':
 
 	act 'Leave': minut += 5 & gt 'city_center'
 
-	act 'Go to the reception desk': gt 'city_hotel', 'reception'
-	
-	act 'Go to the lift': 
-		*clr & cla
-		minut += 1
-		gs 'stat'
-		msg 'Excuse me, but the elevator is not working'
-		gt 'city_hotel', 'start'
+	if hotelRoom['city_hotel'] > 1:
+		act 'Go to your room':
+			$hotel = 'city_hotel'
+			if hotelRoom['city_hotel'] = 1:gt'hotelroom','normal'
+			if hotelRoom['city_hotel'] = 2:gt'hotelroom','better'
+			if hotelRoom['city_hotel'] = 3:gt'hotelroom','best'
+		end
+		
 	end
+
+	act 'Go to the reception desk': gt 'city_hotel', 'reception'
+
 end
 
 if $ARGS[0] = 'reception':
@@ -87,13 +89,87 @@ if $ARGS[0] = 'reception':
 	end
 
 	act 'Rent a room':
-		cla
-		minut += 1
-		gs 'stat'
-		*nl
-		'"I would like to rent a room." you tell the girl at the counter.'
-		'"Unfortunately, we have no rooms available." she replies.'
-		act 'Move away': gt 'city_hotel', 'start'
+		menu_off = 1
+		*clr & cla
+		gs'stat'
+		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/hotel/resep.girl0,'+rand(0,10)+'.jpg"></center>'
+		'The girl behind the desk smiles at you and asks: "Hello miss! Would you like to rent a room?"'
+
+		if hotelRoom['city_hotel'] > 0:
+			*clr & cla
+			'<center><img <<$set_imgh>> src="images/locations/pavlovsk/hotel/resep.girl0,'+rand(0,10)+'.jpg"></center>'
+			'She looks in the computer: "I see you already have a room here. As it is already booked and paid for the only way to change it to a different room, would be to cancel your existing booking. To do so without notice would forfeit your payment, I would advise against this, but you may do so if you wish."'
+			act'Yes, cancel your booking':hotelroom=0 & gt'city_hotel'
+			act'No':gt'city_hotel'
+		elseif hotelRoom['city_hotel'] = 0:
+			act 'Yes':
+				*clr & cla
+				'<center><img <<$set_imgh>> src="images/locations/pavlovsk/hotel/resep.girl0,'+rand(0,10)+'.jpg"></center>'
+				'She smiles at you happily: "Excellent! We have the following rooms available right now:"'
+				'Standard room - 500 <b>₽</b> / night;'
+				'Luxury room - 1500 <b>₽</b> / night;'
+				'and the Royal Suite - 10000 <b>₽</b> / night.'
+				act'Standard room':
+					*clr
+					cla
+					hotelRoomDays['city_hotel']=input ("For how long would you like to stay?")
+					totalCost = hotelRoomDays['city_hotel'] * 500
+					if hotelRoomDays['city_hotel'] <= 0:gt'city_hotel'
+					
+					if totalCost<=money:
+						money-=totalCost
+						hotelRoom['city_hotel']=3
+						hotelRoomDays['city_hotel'] = daystart + hotelRoomDays['city_hotel']
+						'You count the money and give it to her. She gives you the key to your room in return. She says happily: "Thank you miss, I hope you enjoy your stay!"'
+						act'Step away from the reception desk':gt'city_hotel'
+					else
+						msg'You can''t afford to stay in the hotel for that long.'
+						gt'city_hotel'
+					end
+				end
+
+				act'Luxury room':
+					*clr
+					cla
+					hotelRoomDays['city_hotel']=input ("For how long would you like to stay?")
+					totalCost = hotelRoomDays['city_hotel'] * 1500
+					if hotelRoomDays['city_hotel'] <= 0:gt'city_hotel'
+
+					if totalCost<=money:
+						money-=totalCost
+						hotelRoom['city_hotel']=3
+						hotelRoomDays['city_hotel'] = daystart + hotelRoomDays['city_hotel']
+						'You count the money and give it to her. She gives you the key to your room in return. She says happily: "Thank you miss, I hope you enjoy your stay!"'
+						act'Step away from the reception desk':gt'city_hotel'
+					else
+						msg'You can''t afford to stay in the hotel for that long.'
+						gt'city_hotel'
+					end
+				end
+
+				act'Royal Suite':
+					*clr
+					cla
+					hotelRoomDays['city_hotel']=input ("For how long would you like to stay?")
+					totalCost = hotelRoomDays['city_hotel'] * 10000
+					if hotelRoomDays['city_hotel'] <= 0:gt'city_hotel'
+					
+					if totalCost<=money:
+						money-=totalCost
+						hotelRoom['city_hotel']=3
+						hotelRoomDays['city_hotel'] = daystart + hotelRoomDays['city_hotel']
+						'You count the money and give it to her. She gives you the key to your room in return. She says happily: "Thank you miss, I hope you enjoy your stay!"'
+						act'Step away from the reception desk':gt'city_hotel'
+					else
+						msg'You can''t afford to stay in the hotel for that long.'
+						gt'city_hotel'
+					end
+				end
+
+				act 'Step away from the reception desk':gt'city_hotel'
+			end
+			act'No, thank you':gt'city_hotel'
+		end
 	end
 end
 

+ 9 - 3
locations/stat.qsrc

@@ -1145,9 +1145,15 @@ if workFabrika = 1 and week => 1 and week <= 5 and hour > 8 and age => 16 and ag
 end
 
 if hotelRoom['pav_hotel'] > 0:
-	if hotelRoomDays['pav_hotel'] = daystart: $stat_msg += '<BR>You have 1 night left on your hotel booking.'
-	if hotelRoomDays['pav_hotel'] < daystart and hour <= 11: $stat_msg += '<BR>Your hotel booking has expired, and you cannot return to your room after 11:00'
-	if hotelRoomDays['pav_hotel'] < daystart and hour > 11: hotelRoom['pav_hotel'] = 0
+	if hotelRoomDays['pav_hotel'] = daystart: $stat_msg += '<BR>You have 1 night left on your pav hotel booking.'
+	if hotelRoomDays['pav_hotel'] < daystart and hour < 11: $stat_msg += '<BR>Your pav hotel booking has expired, and you cannot return to your room after 11:00'
+	if hotelRoomDays['pav_hotel'] < daystart and hour >= 11: hotelRoom['pav_hotel'] = 0
+end
+
+if hotelRoom['city_hotel'] > 0:
+	if hotelRoomDays['city_hotel'] = daystart: $stat_msg += '<BR>You have 1 night left on your city center hotel booking.'
+	if hotelRoomDays['city_hotel'] < daystart and hour < 11: $stat_msg += '<BR>Your city center hotel booking has expired, and you cannot return to your room after 11:00'
+	if hotelRoomDays['city_hotel'] < daystart and hour >= 11: hotelRoom['city_hotel'] = 0
 end
 
 if hour >= 8 and hour < 14 and week < 6 and StoryLine > 0 and SchoolAtestat = 0 and kanikuli = 0 and schoolProgulDay ! daystart: