Эх сурвалжийг харах

[Code Refactor] Move repeated header commands to a new module - home_family_init to help reduce code bloat and standardise locations in preparation for pet integration. Any commands that affects multiple rooms should be routed through the init file. Migrated to the set_stage function for location banners and have variables managing location for base images in home_family_init.

Hooded Silence 1 сар өмнө
parent
commit
a14c699b7c

+ 1 - 0
glife.qproj

@@ -466,6 +466,7 @@
 		<Location name="misha"/>
 	</Folder>
 	<Folder name="Home-Parent's Apartment">
+		<Location name="home_family_init"/>
 		<Location name="bedrPar"/>
 		<Location name="bedrPar2"/>
 		<Location name="sitrPar"/>

+ 55 - 34
locations/bedrPar.qsrc

@@ -1,26 +1,37 @@
 # bedrPar
+!! Date refactored: 31st March, 2024
+!! Author: Myles
+!!
+!! Version: .01 - initial refactoring
+!! 
+!! Desc: {MC} and sisters family bedroom links to family flat corridor
 
-*clr & cla
-fromoutside = iif($loc = 'bedrPar',0,1)
-menu_off = 0
-minut += 1
-!!day check so mom doesn''t think you have been out all night if you get up very early 
-motherworry[1] = daystart
-gs 'shortgs', 'setloc', 'bedrPar', $ARGS[0]
-$location_type = 'private'
-$locclass = 'bedr'
-gs 'themes', 'indoors'
-gs 'stat'
-gs 'family_schedule'
-!! ballet career
-gs 'core_library', 'init'
-
-!! This is runs only once, just to make sure that Sveta can sing from the start, does not have to wait a whole day for `cikl` to run.
-if ml_performance['max_perform_minutes'] = 0: ml_performance['max_perform_minutes'] = pcs_instrmusic + pcs_vokal
 
+!! Set up default image paths for npc and location:
+!! Start location initialisation
+!! Set location header - img path is set in init
+!! Paths are not set due to content structure
+
+
+!! Begin location content
 if $ARGS[0] = '' or $ARGS[0] = 'start':
+	!! Set location vars:
+	fromoutside = iif($loc = 'bedrPar',0,1)
+	minut += 1
+	!!day check so mom doesn''t think you have been out all night if you get up very early 
+	motherworry[1] = daystart
+	!! This is runs only once, just to make sure that Sveta can sing from the start, does not have to wait a whole day for `cikl` to run.
+	if ml_performance['max_perform_minutes'] = 0: ml_performance['max_perform_minutes'] = pcs_instrmusic + pcs_vokal
+
+	!! Call in location default actions
+	gs 'home_family_init', 'init'
+
+	!! Set up game location data
+	$locclass = 'bedr'
+	gs 'shortgs', 'setloc', 'bedrpar', $ARGS[0]
+	!! End location initialisation
 	if locat['Mother'] = 26 and fromoutside and func('homes_properties', 'can_live_here'):
-		'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/prost1.jpg"></center>'
+		'<center><img <<$set_imgh>> src="<<$mother_img_path>>prost1.jpg"></center>'
 		if mc_inventory['equipped_condoms'] > 0 and rand(1,3) = 1 and mom['condoms'] = 0:
 			gt 'mother', 'condom_find'
 		elseif mc_inventory['dildo_small'] + mc_inventory['dildo_normal'] + mc_inventory['dildo_big'] + mc_inventory['dildo_large'] + mc_inventory['dildo_huge'] + mc_inventory['dildo_enormous'] + mc_inventory['dildo_gigantic'] > 0 and motherQW['seen_dildos'] ! 1 and rand(1,3) = 1:
@@ -83,12 +94,17 @@ if $ARGS[0] = '' or $ARGS[0] = 'start':
 		act 'Leave': gt 'korrPar'
 	else
 		if func('homes_properties', 'can_live_here'):
-			'<center><h1><font color="maroon">Your bedroom</font></h1></center>'
-		else
-			'<center><h1><font color="maroon">Your old bedroom</font></h1></center>'
+			$setloc['StageTitle'] = 'Your bedroom'
+		else		
+			$setloc['StageTitle'] = 'Your old bedroom'
+			
 		end
+		!! Display header and banner image
 		! WD: Correct Image path ~ "images/qwest/alter/<<$loc>>.jpg"
-		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/bedrpar.jpg"></center>'
+		$setloc['StageImage'] = '<<$default_img_path>>/bedrpar.jpg'
+		gs 'core_library', 'stage_title'
+
+		!! Location default description:
 		*nl
 		if func('homes_properties', 'is_current_home'):
 			'This is the small bedroom you share with your sister, Anya. On one side of the room is a <a href="exec:gt ''wardrobe'', ''start''">wardrobe</a> where you can choose outfits and organise your clothing.'
@@ -98,6 +114,8 @@ if $ARGS[0] = '' or $ARGS[0] = 'start':
 			'This small bedroom you used to share with your sister, Anya. The furniture is old and basic.'
 		end
 		*nl
+		*nl
+		!! End default Description
 		if $ml_guitar['location'] = $loc: 'Your guitar rests on its stand next to your bed.'
 
 		if ParrotQW['Owned2'] = 1 and func('homes_properties', 'is_current_home'):
@@ -311,13 +329,16 @@ end
 
 if $ARGS[0] = 'intro':
 	CLOSE ALL
+	$setloc['StageTitle'] = 'Your Bedroom'
+	$setloc['StageImage'] = 'characters/pavlovsk/resident/mom/prost4.jpg'
+	gs 'shortgs', 'setloc', 'bedrpar', 'start'
 	grandmaQW['last_month_paid'] = month
 	menu_off = 1
 	hour = 6
 	gs 'stat'
 	music_loop = 0
-	'<center><h1><font color="maroon">Your Bedroom</font></h1></center>'
-	'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/prost4.jpg"></center>'
+	!! Display the header text and banner image
+	gs 'core_library', 'stage_title'
 	'You sudenly hear a familiar voice yelling out. "<<$pcs_nickname>>, time to get up! You can''t spend the whole day laying around!"'
 	wait 1000
 	$temp_nickname = input('<center>What name do you address your mother by?<br>Mother (default), Mum, Mom, Mama, etc.</center>')
@@ -327,8 +348,8 @@ if $ARGS[0] = 'intro':
 		cla & *clr
 		minut += 2
 		gs 'stat'
-		'<center><h1><font color="maroon">Your Bedroom</font></h1></center>'
-		'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/prost5.jpg"></center>'
+		$setloc['StageImage'] = 'characters/pavlovsk/resident/mom/prost5.jpg'
+		gs 'core_library', 'stage_title'
 		'You tiredly open your eyes and see your mother standing over you. "Fifteen more minutes..." you mumble.'
 		'Your mother lets out a loud sigh. "No, up now!" she says as she yanks the covers off.'
 		'"<<$npc_nickname[''A29'']>>!" you exclaim as you feel a slightly cold breeze hit your body.'
@@ -337,24 +358,24 @@ if $ARGS[0] = 'intro':
 			cla & *clr
 			minut += 2
 			gs 'stat'
-			'<center><h1><font color="maroon">Your Bedroom</font></h1></center>'
-			'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/prost4.jpg"></center>'
+			$setloc['StageImage'] = 'characters/pavlovsk/resident/mom/prost4.jpg'
+			gs 'core_library', 'stage_title'
 			'As soon as you get off your now coverless bed, your mother is quick to resume her nagging, repeating what you already heard from her a few moments ago. "Summer is no excuse to laze around all day. You can''t sleep in anymore, not even for another fifteen minutes." She''s not even looking at you while she talks, but luckily for you that means she misses you rolling your eyes.'
 			'"What are you going to do when school starts, or when you get a job? You better get into the habit of setting your alarm so you can wake up bright and early."'
 			act 'Continue':
 				cla & *clr
 				minut += 2
 				gs 'stat'
-				'<center><h1><font color="maroon">Your Bedroom</font></h1></center>'
-				'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/prost5.jpg"></center>'
+				$setloc['StageImage'] = 'characters/pavlovsk/resident/mom/prost5.jpg'
+				gs 'core_library', 'stage_title'
 				'You let out an exasperated sigh. "Yeah yeah I know, you told me that already. So how early are we talking?"'
 				'Your mother shoots you a sharp look and you know to fix your attitude or else. "Well, that depends on what you plan to do in the morning. There''s breakfast, showering and brushing your teeth, doing your hair and then makeup and shaving if you really need to. If I remember right... Anya used to wake up at 06:00 for school."'
 				act 'Continue':
 					cla & *clr
 					minut += 2
 					gs 'stat'
-					'<center><h1><font color="maroon">Your Bedroom</font></h1></center>'
-					'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/prost4.jpg"></center>'
+					$setloc['StageImage'] = 'characters/pavlovsk/resident/mom/prost4.jpg'
+					gs 'core_library', 'stage_title'
 					'"You want me to wake up that early?!" you huff. "Can''t I wake up at like... 07:00?"'
 					'Your mother shrugs. "You could, but then you might have to cut corners or even end up running late to school, and I won''t be having any of that. Your teachers won''t either," she warns before making her way towards the kitchen.'
 					if stat['think_virgin'] = 1: '"Oh, don''t forget; you need to head down to the clinic and see the gynecologist for a check up. Not just once, but every month!" she adds quickly.'
@@ -363,8 +384,8 @@ if $ARGS[0] = 'intro':
 						cla & *clr
 						minut += 2
 						gs 'stat'
-						'<center><h1><font color="maroon">Your Bedroom</font></h1></center>'
-						'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/prost5.jpg"></center>'
+						$setloc['StageImage'] = 'characters/pavlovsk/resident/mom/prost5.jpg'
+						gs 'core_library', 'stage_title'
 						'Before you can finish, she cuts you off. "I''m not going to have you running around town like so many of those other girls I see! Opening their legs for any boy that comes around..." She shakes her head in disgust. "I want a referral every month and it better tell me you''re still a virgin or else, understand?" she says before she storms out of the room without giving you a chance to respond.'
 						act 'I understand...':gt 'alarmclock', 'start'
 					end

+ 39 - 26
locations/bedrPar2.qsrc

@@ -1,23 +1,36 @@
 # bedrPar2
-!2021/04/26
-if $ARGS[0] = '':
-	CLOSE ALL
-	*clr & cla
-	$loc = 'bedrPar2'
-	$loc_arg = ''
-	$locclass = 'bedr'
-	$location_type = 'private'
-	$menu_loc = 'bedrPar2'
-	$menu_arg = ''
-	menu_off = 0
-	minut += 1
-	gs 'stat'
-	gs 'themes', 'indoors'
-	gs 'family_schedule'
-	'<center><h1><font color="maroon">Master bedroom</font></h1></center>'
-	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/bedrpar2.jpg"></center>'
+!! Date refactored: 31st March, 2024
+!! Author: Myles
+!!
+!! Version: .01 - initial refactoring
+!! 
+!! Desc: Paernts bedroom links to family flat corridor
+
+!! Set location header - img path is set in init
+$setloc['StageTitle'] = 'Parents Bedroom'
+$setloc['StageImage'] = '<<$default_img_path>>/bedrpar2.jpg'
+
+!! Set location vars:
+minut += 1
+!! Call in location default actions
+gs 'home_family_init', 'init'
+
+!! Set up game location data
+$locclass = 'bedr'
+gs 'shortgs', 'setloc', 'bedrPar2', $ARGS[0]
+!! End location initialisation
+
+
+!! Begin location content
+
+if $ARGS[0] = '' or $ARGS[0] = 'start':
+	!! Display header and banner image
+	gs 'core_library', 'stage_title'
+	!! Location default description:
 	*nl
 	'The room in which your parents sleep. Their large bed, <a href="exec: gt ''bedrPar2'',''parents_wardrobe''">wardrobe</a> and other closets take up most of the space.'
+	*nl
+	!! End default Description
 	if locat['Fam_inGad'] = 0:
 		if locat['Mother'] = 1 and locat['Stepdad'] = 1:
 			'Your mother and stepfather are sleeping on the bed.'
@@ -60,7 +73,7 @@ if $ARGS[0] = 'kamasutra':
 	*clr & cla
 	menu_off = 1
 	minut += 1
-	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/book.jpg"></center>'
+	'<center><img <<$set_imgh>> src="<<$default_img_path>>book.jpg"></center>'
 	'The cover says "Kama Sutra"'
 	act 'Leave': gt $loc, $loc_arg
 	act 'Read': kamasutra_page = 0 & kamasutra_day = daystart & gt 'bedrPar2', 'read_book'
@@ -81,7 +94,7 @@ end
 ! parent''s wardrobe
 if $ARGS[0] = 'parents_wardrobe':
 	*clr & cla
-	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/wardrobe.jpg"></center>'
+	'<center><img <<$set_imgh>> src="<<$default_img_path>>wardrobe.jpg"></center>'
 	'An old looking wardrobe, probably from the Soviet times.'
 	act 'Leave ': gt $loc, $loc_arg
 	act 'Rummage': gt 'bedrPar2', 'wardrobe_search'
@@ -95,14 +108,14 @@ if $ARGS[0] = 'wardrobe_search':
 		exit
 	end
 	if rand(1,100) > 75:
-		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/wardrobesearch'+rand(1,4)+'.jpg"></center>'
+		'<center><img <<$set_imgh>> src="<<$default_img_path>>wardrobesearch'+rand(1,4)+'.jpg"></center>'
 		$failwords[0]= 'You don''t find anything interesting.'
 		$failwords[1]= 'You find some clothes and underwear.'
 		$failwords[2]= 'You dig through your mother''s closet, but find nothing interesting except underwear.'
 		*pl $failwords[rand(0,2)]
 		killvar '$failwords'
 	else
-		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/wardrobetoy.jpg"></center>'
+		'<center><img <<$set_imgh>> src="<<$default_img_path>>wardrobetoy.jpg"></center>'
 		$findmomtoy[0]= 'Digging through the closet, you find a <a href="exec: gt ''bedrPar2'',''momtoy_play''">dildo</a>.'
 		$findmomtoy[1]= 'Rummaging through your mother''s lingerie, you find a small <a href="exec: gt ''bedrPar2'',''momtoy_play''">dildo</a>.'
 		$findmomtoy[2]= 'You find your mother''s <a href="exec: gt ''bedrPar2'',''momtoy_play''">toy</a>.'
@@ -131,7 +144,7 @@ if $ARGS[0] = 'peek':
 	parentsexday = daystart
 	minut += 2
 	gs 'stat'
-	'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/sex/momvlad1.jpg"></center>'
+	'<center><img <<$set_imgh>> src="<<$mother_img_path>>sex/momvlad1.jpg"></center>'
 	'You crack the door open just a little and you see your mother and Vladimir near their bed. "Stop! The kids are here," your mother says as Vlad starts running his hands over her body.'
 	'He doesn''t seem to care about what she says as he doesn''t stop. "Come on, they won''t hear us and you know you want it."'
 	act 'Leave': gt 'korrPar'
@@ -139,7 +152,7 @@ if $ARGS[0] = 'peek':
 	act 'Keep peeking':
 		cla & *clr
 		gs 'stat'
-		'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/sex/momvlad2.jpg"></center>'
+		'<center><img <<$set_imgh>> src="<<$mother_img_path>>sex/momvlad2.jpg"></center>'
 		'You mother seems to be loving the attention and doesn''t put up much of a fight as he starts to undress her. Once she''s mostly naked, he pushes her down on the bed so she''s sitting on it in front of him, her head about crotch height to him. Knowing what he wants, she opens the fly on his pants and pulls out his cock, stroking it a few times in her hand until he gets hard. She then takes his dick into her mouth and starts sucking it. He moans softly as she does. "Fuck, you''re the best cocksucker ever, Natasha."'
 		gs 'arousal', 'voyeur_sex', 3
 		gs 'stat'
@@ -149,7 +162,7 @@ if $ARGS[0] = 'peek':
 		act 'Keep peeking':
 			cla & *clr
 			gs 'stat'
-			'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/sex/momvlad3.jpg"></center>'
+			'<center><img <<$set_imgh>> src="<<$mother_img_path>>sex/momvlad3.jpg"></center>'
 			'After spending several minutes sucking Vlad''s cock, she helps him strip while continuing to suck his dick. Once he''s naked, he lies down on the bed and she straddles him and quickly starts riding his dick reverse cowgirl style.'
 			'Both of them start moaning as they fuck. "Oh god Vlad, your dick feels so good in my pussy! It''s so big!"'
 			gs 'arousal', 'voyeur_sex', 5
@@ -160,7 +173,7 @@ if $ARGS[0] = 'peek':
 			act 'Keep peeking':
 				cla & *clr
 				gs 'stat'
-				'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/sex/momvlad4.jpg"></center>'
+				'<center><img <<$set_imgh>> src="<<$mother_img_path>>sex/momvlad4.jpg"></center>'
 				'Vlad suddenly grabs her and throws her on her side on the bed. He turns on his side, lifting up her leg with one hand while using the other to guide his cock. He feels around until he places the head of his dick against her anus, then pushes it in, using only her pussy juices for lubrication. It slides in surprisingly easy and you can only guess that this is far from the first time your mother has had a dick in her ass. They both moan in pleasure and she rubs her clit as Vlad fucks her ass.'
 				gs 'arousal', 'voyeur_sex', 5
 				gs 'stat'
@@ -169,7 +182,7 @@ if $ARGS[0] = 'peek':
 				act 'Keep peeking':
 					cla & *clr
 					gs 'stat'
-					'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/sex/momvlad5.jpg"></center>'
+					'<center><img <<$set_imgh>> src="<<$mother_img_path>>sex/momvlad5.jpg"></center>'
 					'They keep going for several more minutes until Vlad starts to pant and buries his dick balls deep in your mother''s ass and lets out a loud moan as he twitches. After a few seconds, he pulls out of her and rolls off the bed as she gets on her back and spreads her ass, giving both you and Vlad a good view of her asshole as his cum starts leaking out of it.'
 					'"You''re such a nasty bitch, Natasha!" he laughs.'
 					'She smiles at him. "That''s why you love me," she replies. They start getting cleaned up and you decide it''s time to go before you get caught.'

+ 41 - 18
locations/korrPar.qsrc

@@ -1,35 +1,50 @@
 # korrPar
+!! Date refactored: 31st March, 2024
+!! Author: Myles
+!!
+!! Version: .01 - initial refactoring
+!! 
+!! Desc: Family home kitchen links to family flat corridor
 
-music_loop = 0
-CLOSE ALL
-menu_off = 0
 
-if sound = 0 and pavhome_enter = 1:
-	PLAY 'sound/korr.mp3',30
-	pavhome_enter = 0
-end
+!! Set location header - img path is set in init
+$setloc['StageTitle'] = 'Corridor'
+$setloc['StageImage'] = '<<$default_img_path>>/korrpar.jpg'
 
-gs 'shortgs', 'setloc', 'korrPar', $ARGS[0]
+!! Set location vars:
 killvar '$locclass'
-clr
+!! Unique vars - unknown status, legacy code
+!! TODO: Follow up and determine what these do and if they can be removed.
 popolaini = 0
 saunaYouRoom = 0
 boycherdaksex = 0
-minut += 1
 bonusZ = 0
 display_bb = 0
-$location_type = 'private'
-gs 'themes', 'indoors'
-gs 'family_schedule'
-gs 'stat'
-'<center><h1><font color="maroon">Corridor</font></h1></center>'
-'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/korrpar.jpg"></center>'
+
+!! Call in location default actions
+gs 'home_family_init', 'init'
+
+!! Set up game location data
+gs 'shortgs', 'setloc', 'korrPar', $ARGS[0]
+
+!! Set up location trackers
+gs 'home_family_init', 'trackers'
+
+!! Enable location audio
+if sound = 0 and pavhome_enter = 1:
+	PLAY 'sound/korr.mp3',30
+	pavhome_enter = 0
+end
+
+!! Location default description:
 *nl
 'The corridor of your parent''s apartment. There are several doors which lead to the other rooms of the apartment, as well as the front door which leads outside to the stairwell.'
 *nl
 'A <a href="exec:gt ''mirror'', ''start''">mirror</a> hangs on the wall near the front door.'
 *nl
+!! End default Description
 
+!! Additional location content:
 if locat['Fam_inGad'] = 1:'With your parents away visiting your grandparents, the apartment seems quiet and empty.'
 
 gs 'courtletter'
@@ -40,6 +55,8 @@ if locat['Mother'] = 1 and hour = 22 and minut < 30 and motherQW['con_steal_talk
 
 act '<b>Leave and go to the stairwell</b>':
 	if $clothingworntype ! 'nude':
+		$default_img_path = 'reset'
+		killvar '$mother_img_path'
 		gt'pod_ezd','etaj_2'
 	else
 		msg'<b><font color = red>You need to get dressed.</font></b>'
@@ -54,11 +71,17 @@ act '<b>Leave and go to the courtyard</b>':
 			cla
 			act '<font color=red><b>Yes, go outside</b></font>': 
 				minut += 5 
+				!! Reset vars - temp until other parts of game migrated
+				killvar '$default_img_path'
+				killvar '$mother_img_path'
 				gt'pav_complex', 'start'
 			end
 			act 'No, stay inside':gt 'korrPar'
 		else
 			minut += 5
+			!! Reset vars - temp until other parts of game migrated
+			killvar '$default_img_path'
+			killvar '$mother_img_path'
 			gt'pav_complex', 'start'
 		end
 	else
@@ -169,7 +192,7 @@ else
 	end
 end
 
-$korrParMomHeader = '<center><h1><font color="maroon"><<$npc_nickname[''A29'']>></font></h1></center><center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/mother.jpg"></center><br />'
+$korrParMomHeader = '<center><h1><font color="maroon"><<$npc_nickname[''A29'']>></font></h1></center><center><img <<$set_imgh>> src="<<$mother_img_path>>mother.jpg"></center><br />'
 
 if hour >= 16 and hour <= 20 and locat['Fam_inGad'] = 0:
 	if artemvbrosvid = 1 and artemhakday ! daystart and npc_QW['A29'] < 2 and mothervideotalk = 0 or BrotherNo = 1 and BrotherNoDay ! daystart and BJvideoPublic = 0:
@@ -203,7 +226,7 @@ if hour >= 16 and hour <= 20 and locat['Fam_inGad'] = 0:
 			gs 'pain', 5, 'asscheeks', 'spank'
 			gs 'stat'
 			'<center><h1><font color="maroon"><<$npc_nickname[''A29'']>></font></h1></center>'
-			'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/spank.jpg"></center>'
+			'<center><img <<$set_imgh>> src="<<$mother_img_path>>spank.jpg"></center>'
 			*nl
 			'You stand in the hallway staring at the floor, too embarrassed to say anything.'
 			'Your mother grabs you by the arm and pulls you into the living room. "Take off your pants and bend over!" You shake your head, not liking where this is going at all. Getting even angrier by your refusal, she shouts, "Vladimir, come and hold her down!"'

+ 37 - 27
locations/kuhrPar.qsrc

@@ -1,6 +1,32 @@
 # kuhrPar
-CLOSE ALL
-*clr & cla
+!! Date refactored: 31st March, 2024
+!! Author: Myles
+!!
+!! Version: .01 - initial refactoring
+!! 
+!! Desc: Family home kitchen links to family flat corridor
+
+!! Start location initialisation
+!! Set location header - img path is set in init
+$setloc['StageTitle'] = 'Parents Kitchen'
+$setloc['StageImage'] = '<<$default_img_path>>/kuhrpar.jpg'
+
+!! Set location vars:
+minut += 1
+
+!! Call in kitchen library:
+gs 'kit_din'
+
+!! Call in location default actions
+gs 'home_family_init', 'init'
+
+!! Set up game location data
+gs 'shortgs', 'setloc', 'kuhrpar', $ARGS[0]
+!! End location initialisation
+
+
+!! Begin location content
+
 if fullmorrout = 1:
 	minut += 2
 	act '<font color = maroon><b>Leave the apartment and go outside</b></font>':
@@ -15,25 +41,6 @@ act 'Return to the hallway':
 	killvar 'fullmorrout'
 	gt 'korrPar'
 end
-
-$loc = 'kuhrPar'
-$loc_arg = ''
-$locclass = 'kitr'
-$menu_loc = 'kuhrPar'
-$menu_arg = ''
-menu_off = 0
-minut += 1
-gs 'stat'
-gs 'kit_din'
-gs 'themes', 'indoors'
-gs 'family_schedule'
-
-!! ballet career
-gs 'core_library', 'init'
-
-'<center><b><font color="maroon">Kitchen</font></b></center>'
-'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/kuhrpar.jpg"></center>'
-
 if func('homes_properties', 'can_live_here'):
 	if locat['Mother'] = 4:
 		if locat['Mom_kitchen_action'] = 1:
@@ -43,7 +50,7 @@ if func('homes_properties', 'can_live_here'):
 			cla & *clr
 			minut += 5
 			gs'stat'
-			'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/gotovka.jpg"></center>'
+			'<center><img <<$set_imgh>> src="<<$mother_img_path>>gotovka.jpg"></center>'
 			'Your <<$npc_nickname[''A29'']>> turns to you. "<<$pcs_nickname>>, please set the table for breakfast." You sigh and grab the dishes.'
 			act 'Set the table for breakfast': gt 'kuhrPar'
 			exit
@@ -88,7 +95,7 @@ if func('homes_properties', 'can_live_here'):
 			act 'Eat breakfast with your family':
 				*clr & cla
 				gs 'stat'
-				'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/prost6.jpg"></center>'
+				'<center><img <<$set_imgh>> src="<<$mother_img_path>>prost6.jpg"></center>'
 				'Your <<$npc_nickname[''A29'']>> catches you just before you sit down.'
 				'Your Mum glares at you and you realize you haven''t washed the cum stains off which makes you feel terrible.'
 				'"I''m so ashamed of you! Go and clean it off now! Get out of my sight you whore!"'
@@ -102,7 +109,7 @@ if func('homes_properties', 'can_live_here'):
 				npc_rel['A29'] += 1
 				breakfast_day = daystart
 				gs 'stat'
-				'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/breakfasthome.jpg"></center>'
+				'<center><img <<$set_imgh>> src="<<$default_img_path>>/breakfasthome.jpg"></center>'
 				'As you sit down and join your family for breakfast, your stepfather engages you in conversation. "How are you doing in school <<$pcs_nickname>>?"'
 				if kanikuli = 0 and mid($start_type,1,2) = 'sg' and $home['current'] = 'parents_home' and SchoolBlock = 0:
 					if class['school_grade_average'] >= 80:
@@ -127,7 +134,7 @@ if func('homes_properties', 'can_live_here'):
 			act 'Eat breakfast with your family':
 				*clr & cla
 				gs 'stat'
-				'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/breakfasthome.jpg"></center>'
+				'<center><img <<$set_imgh>> src="<<$default_img_path>>/breakfasthome.jpg"></center>'
 				'Everyone stares at you as you sit down for breakfast. "What?" you exclaim.'
 				*nl
 				'Your mother stands up from her seat, nearly knocking her chair over in the process. "What on God''s earth are you doing <<$pcs_nickname>>?! Have you have no shame? Get dressed immediately young lady!"'
@@ -145,7 +152,7 @@ if func('homes_properties', 'can_live_here'):
 				npc_rel['A29'] += 1
 				dinner_day = daystart
 				gs 'stat'
-				'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/dinnerhome.jpg"></center>'
+				'<center><img <<$set_imgh>> src="<<$default_img_path>>/dinnerhome.jpg"></center>'
 				'You sit down and join your family for dinner and your stepfather starts teasing you. "So, do you have a boyfriend yet <<$pcs_nickname>>?"'
 				if fame['pav_slut'] > 150 and motherKnowSpravka = 0:
 					'You''re about to respond when your mother interrupts you. "Of course not! She''s still too young to be thinking about boys!"'
@@ -179,7 +186,7 @@ if func('homes_properties', 'can_live_here'):
 			act 'Eat dinner with your family':
 				*clr & cla
 				gs 'stat'
-				'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/dinnerhome.jpg"></center>'
+				'<center><img <<$set_imgh>> src="<<$default_img_path>>/dinnerhome.jpg"></center>'
 				'Everyone stares at you as you sit down for dinner.  "What?" you exclaim.'
 				*nl
 				'Your mother stands up from her seat, nearly knocking her chair over in the process. "What on God''s earth are you doing <<$pcs_nickname>>?! Have you have no shame? Get dressed immediately young lady!"'
@@ -208,6 +215,9 @@ if func('homes_properties', 'can_live_here'):
 		act 'Eat a light meal (0:10)':gs 'food', 's_meal'
 	end
 
+
+	!! Call in meal and pill functions for location:
+
 	dynamic $edasnack
 	dynamic $sandwich
 	dynamic $driwater

+ 48 - 27
locations/sitrPar.qsrc

@@ -1,37 +1,58 @@
 # sitrPar
+!! Date refactored: 31st March, 2024
+!! Author: Myles
+!!
+!! Version: .01 - initial refactoring
+!! 
+!! Desc: Family living room and Kolka''s bedroom links to family corridor
 
-if $ARGS[0] = '':
-	CLOSE ALL
-	$loc_arg = ''
-	$loc = 'sitrPar'
-	$menu_loc = 'sitrPar'
-	$menu_arg = ''
-	menu_off = 0
-	$location_type = 'private'
+if $ARGS[0] = '' or $ARGS[0] = 'start':
+
+	!! Start location initialisation
+
+	!! Set location header - img path is set in init
+	$setloc['StageTitle'] = 'Parents Living Room'
+	if locat['Mother'] = 19 and locat['Stepdad'] = 10:
+		$setloc['StageImage'] = '<<$default_img_path>>/momvladtv.jpg'
+	else
+		$setloc['StageImage'] = '<<$default_img_path>>/sitrpar.jpg'
+	end
+	!! Sitting room variables:
 	$locclass = 'livingr'
 	locat['Fam_livingroom'] = 0
 	minut += 1
-	gs 'stat'
-	gs 'themes', 'indoors'
-	gs 'family_schedule'
+
+
+	!! Set location vars:
+	minut += 1
+
+	!! Call in location default actions
+	gs 'home_family_init', 'init'
+	
+	!! Check if anyone is in the room
 	gs 'sitrPar', 'occupied'
-	*clr & cla
-	'<center><b><font color="maroon">Living Room</font></b></center>'
-	if locat['Mother'] = 19 and locat['Stepdad'] = 10:
-		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/momvladtv.jpg"></center>'
-	else
-		'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/sitrpar.jpg"></center>'
-	end
-	act 'Leave the room': gt 'korrPar'
-	act 'Sit on the sofa': gt 'sitrPar', 'sofa'
-	''
+
+
+	!! Set up game location data
+	gs 'shortgs', 'setloc', 'sitrPar', $ARGS[0]
+	!! End location initialisation
+
+	!! Begin location content
+	!! Display header and banner image
+	gs 'core_library', 'stage_title'
+
+	!! Location default description:
 	'The living room has a <a href="exec:gt ''TV'',''pav''">TV</a> near the window. In front of the TV is a <a href="exec:gt ''sitrPar'',''sofa''">sofa bed</a> on which your brother sleeps at night. A large tapestry covers one wall, while the other wall has several shelves on it, stocked with books and other things.'
 	*nl
+	!! End default Description
 	if locat['Fam_livingroom'] = 0 and locat['Mother'] ! 24 and locat['Mother'] ! 19:
 		'No one else is here right now, so you''re free to use the room how you like.'
 		gs 'exercise','start'
 	end
 
+	act 'Leave the room': gt 'korrPar'
+	act 'Sit on the sofa': gt 'sitrPar', 'sofa'
+
 	if locat['Kolka'] = 2 and brothermorningsex = daystart:
 		'<a href="exec:gt ''brother'', ''start''">Kolka</a> is getting ready for school.'
 	elseif locat['Kolka'] = 1:
@@ -92,7 +113,7 @@ if $ARGS[0] = '':
 		end
 	elseif locat['Mother'] = 24:
 		*clr & cla
-		'<center><img <<$set_imgh>> src="images/characters/pavlovsk/resident/mom/uborka1.jpg"></center>'
+		'<center><img <<$set_imgh>> src="<<$mother_img_path>>uborka1.jpg"></center>'
 		if kanikuli = 0 and mid($start_type,1,2) = 'sg' and SchoolAtestat = 0 and SchoolBlock = 0 and week < 6:
 			if CloStyle2 = 4:
 				'As you walk into the living room, you see your mother sweeping the floor. She looks up and gives you a disappointed look. "What are you still doing here? Go to school, now!" She practically pushes you out of the apartment and closes the door.' 
@@ -109,7 +130,7 @@ if $ARGS[0] = '':
 		exit
 	elseif locat['Mother'] = 19 and locat['Stepdad'] = 10:
 		!! Watches TV with Vladimir
-		!!'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/momvladtv.jpg"></center>'
+		!!'<center><img <<$set_imgh>> src="<<$default_img_path>>/momvladtv.jpg"></center>'
 		'As you walk into the living room, you see your mother and Vladimir sitting on the couch watching TV.'
 		act 'Leave':gt 'korrPar'
 		
@@ -121,7 +142,7 @@ if $ARGS[0] = '':
 			npc_rel['A29'] += 1
 			npc_rel['A34'] += 1
 			gs 'stat'
-			!!'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/familytv.jpg"></center>'
+			!!'<center><img <<$set_imgh>> src="<<$default_img_path>>/familytv.jpg"></center>'
 			'You move over to join them, and your mother scoots away from Vladimir and pats the spot between her and him. You take a seat between them and Vlad barely even glances at you with a brief smile before he goes back to watching TV. Your mother pats you on the shoulder before returning her attention to the TV, apparently happy the family is spending time together.'
 			act 'Leave':gt 'korrPar'
 			
@@ -163,7 +184,7 @@ if $ARGS[0]= 'sofa':
 	gs 'family_schedule'
 	gs 'sitrPar', 'occupied'
 	*clr & cla
-	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/sofa.jpg"></center>'
+	'<center><img <<$set_imgh>> src="<<$default_img_path>>/sofa.jpg"></center>'
 	*nl
 	'<center>A small sofa bed, when not folded out into a bed, is just big enough for you to curl up on and take a nap.</center>'
 
@@ -203,7 +224,7 @@ if $ARGS[0] = 'TVfam':
 	minut += 30
 	gs 'family_schedule'
 	gs 'stat'
-	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/familytv.jpg"></center>'
+	'<center><img <<$set_imgh>> src="<<$default_img_path>>/familytv.jpg"></center>'
 	'You continue to watch TV with the family. Everyone seems very engrossed in the program and almost never says anything, though Kolka occasionally makes a crack about what is happening, often getting shushed by Vlad or your mother.'
 	if locat['Mother'] = 19: act 'Keep watching TV with your family': gt 'sitrPar', 'TVfam'
 	act 'Finish watching':gt 'sitrPar', 'TVend'
@@ -213,7 +234,7 @@ if $ARGS[0] = 'TVend':
 	cla & *clr
 	gs 'family_schedule'
 	gs 'stat'
-	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/familytv.jpg"></center>'
+	'<center><img <<$set_imgh>> src="<<$default_img_path>>/familytv.jpg"></center>'
 	'Once the show is over, Vladimir picks up the remote and turns the TV off. He gets up and stretches before he turns and walks out of the room, likely heading to bed. Your mother also gets up. "You should go to bed or at least go to your room so your brother can get his rest." She then turns to Kolka. "Don''t stay up, go to bed." She then ushers you out of the room. As you walk out, you see Kolka putting his pillow and sheet on the couch.'
 	act 'Leave': gt 'korrPar'
 end

+ 34 - 18
locations/vanrPar.qsrc

@@ -1,26 +1,42 @@
 # vanrPar
+!! Date refactored: 31st March, 2024
+!! Author: Myles
+!!
+!! Version: .01 - initial refactoring
+!! 
+!! Desc: Family home bathroom links to family flat corridor
 
-if $ARGS[0] = '':
-	CLOSE ALL
-	$locM = 'vanrPar'
-	$locM_arg = ''
-	$loc = 'vanrPar'
-	$loc_arg = ''
-	$menu_loc = 'vanrPar'
-	$menu_arg = ''
-	menu_off = 0
-	$location_type = 'bathroom'
-	$bathtype = 'bathtub shower'
-	*clr & cla
-	gs 'stat'
-	gs 'family_schedule'
-	gs 'themes', 'indoors'
-	'<center><b><font color="maroon">Bathroom</font></b></center>'
-	'<center><img <<$set_imgh>> src="images/locations/pavlovsk/resident/apartment/home/vanrpar.jpg"></center>'
+!! Start location initialisation
+!! Set location header - img path is set in init
+$setloc['StageTitle'] = 'Parents Bathroom'
+$setloc['StageImage'] = '<<$default_img_path>>/vanrpar.jpg'
+
+!! Set location vars:
+minut += 1
+
+!! Call in location default actions
+
+gs 'home_family_init', 'init'
+
+!! Set up game location data
+$location_type = 'bathroom'
+$bathtype = 'bathtub shower'
+gs 'shortgs', 'setloc', 'vanrPar', $ARGS[0]
+
+!! End location initialisation
+if $ARGS[0] = '' or $ARGS[0] = 'start':
+	!! Display header and banner image
+	gs 'core_library', 'stage_title'
+
+
+	!! Begin location content
+	
+	!! Location default description:
 	'The bathroom is very small and unimpressive. Nevertheless, it has everything you need.'
 	*nl
 	'There is a shower, toilet, sink, <a href="exec:gt ''mirror'',''start''">mirror</a> where you can ' + iif(pcs_hairbsh = 0,'<a href="exec:gt ''mirror'',''brush''">brush</a>','brush') + ' your hair, and even a bath tub.'
-
+	*nl
+	!! End default Description
 	if vanr_lock = 0:
 		'The door is not locked and does not close properly. <a href="exec:gt ''vanrPar'',''latch''">Latch the door</a> or <a href="exec:gt ''vanrPar'',''perm_latch''">Always latch the door</a>.'
 	elseif vanr_lock = 2: