# homes_properties_attr

if ARRSIZE('home_name') < 4:
	!! The list goes like this:
	!!    1.      $home_name['property code']
	!!    2.      $home_name['property id']  - for backward compatibility only, nothing else and the number is a string index
	!!    3.      $home_name['enctrance location'] 
	!!    4.- N.  $home_name['other locations']

	!! CITY APARTMENT
	$home_name['city_apartment'] = 'city_apartment'
	$home_name['1'] = 'city_apartment'
	$home_name['korr'] = 'city_apartment'
	$home_name['bedr'] = 'city_apartment'
	$home_name['sitr'] = 'city_apartment'
	$home_name['kuhr'] = 'city_apartment'
	$home_name['vanr'] = 'city_apartment'

	!! PARENTS HOME
	$home_name['parents_home'] = 'parents_home'
	$home_name['2'] = 'parents_home'
	$home_name['code'] = 'parents_home'
	$home_name['korrPar'] = 'parents_home'
	$home_name['bedrPar'] = 'parents_home'
	$home_name['sitrPar'] = 'parents_home'
	$home_name['kuhrPar'] = 'parents_home'
	$home_name['vanrPar'] = 'parents_home'

	!! VILLAGE COTTAGE
	$home_name['village_cottage'] = 'village_cottage'
	$home_name['3'] = 'village_cottage'
	$home_name['dachamy'] = 'village_cottage'
	$home_name['dachain'] = 'village_cottage'
	$home_name['dachaogr'] = 'village_cottage'
	$home_name['dachaogr0'] = 'village_cottage'

	!! OLD TOWN (PUSHKIN) APARTMENTS
	$home_name['old_town_apartment'] = 'old_town_apartment'
	$home_name['4'] = 'old_town_apartment'
	$home_name['korr2x'] = 'old_town_apartment'
	$home_name['bedr2x'] = 'old_town_apartment'
	$home_name['sitr2x'] = 'old_town_apartment'
	$home_name['kuhr2x'] = 'old_town_apartment'
	$home_name['vanr2x'] = 'old_town_apartment'

	!! MATRYONA MANSION
	$home_name['matryona_mansion'] = 'matryona_mansion'
	$home_name['5'] = 'matryona_mansion'
	$home_name['city_mansion_entrance'] = 'matryona_mansion'
	$home_name['city_mansion_residence_1'] = 'matryona_mansion'
	$home_name['city_mansion_residence_2'] = 'matryona_mansion'
	$home_name['city_mansion_residence_3'] = 'matryona_mansion'

	!! PAVLOVSK HOTEL
	$home_name['pavlovsk_hotel'] = 'pavlovsk_hotel'
	$home_name['6'] = 'pavlovsk_hotel'
	$home_name['pav_hotel'] = 'pavlovsk_hotel'
	$home_name['HotelRoom'] = 'pavlovsk_hotel'

	!! LIVE IN MAID BEDROOM
	$home_name['maid_bedroom'] = 'maid_bedroom'
	$home_name['7'] = 'maid_bedroom'
	$home_name['nichBedroomServant'] = 'maid_bedroom'

	!! NIKO''S APARTMENT
	$home_name['niko_apartment'] = 'niko_apartment'
	$home_name['8'] = 'niko_apartment'
	!! This home actually doesn''t exist yet, but it was defined,
	!! has an ID and all so, I am keeping it here

	!! SHULGA APARTMENT
	$home_name['shulga_apartment'] = 'vasilyhome'
	$home_name['9'] = 'vasilyhome'
	$home_name['vasilyhome'] = 'vasilyhome'
	
	!! LYCEUM DORM
	$home_name['lyceum_dorm'] = 'lyceum_dorm'
	$home_name['10'] = 'lyceum_dorm'
	$home_name['dom_gor'] = 'lyceum_dorm'

	!! UNIVERSITY DORM
	$home_name['university_dorm'] = 'university_dorm'
	$home_name['11'] = 'university_dorm'
	$home_name['uni_grounds'] = 'university_dorm'
	$home_name['uni_dorm'] = 'university_dorm'
	
	!! HUNTERS LODGE
	$home_name['hunters_lodge'] = 'hunters_lodge'
	$home_name['12'] = 'hunters_lodge'
	$home_name['swamphouse'] = 'hunters_lodge'
	$home_name['swamp_yard'] = 'hunters_lodge'


	!! SHARED APARTMENT - PAVLOVSK
	$home_name['shared_apartment'] = 'shared_apartment'
	$home_name['13'] = 'shared_apartment'
	$home_name['pav_shared_apt'] = 'shared_apartment'

	!! GRANDPARENTS HOUSE
	$home_name['grandparents_house'] = 'grandparents_house'
	$home_name['14'] = 'grandparents_house'
	$home_name['gaddvor'] = 'grandparents_house'
	$home_name['gadgarden'] = 'grandparents_house'
	$home_name['gadbana'] = 'grandparents_house'
	$home_name['gadgarden'] = 'grandparents_house'
	$home_name['gadhouse'] = 'grandparents_house'


	!! CITY HOUSE
	$home_name['city_house'] = 'city_house'
	$home_name['15'] = 'city_house'
	$home_name['city_house_res_misc'] = 'city_house'
	$home_name['city_house_res_bath'] = 'city_house'
	$home_name['city_house_re_bedr'] = 'city_house'
	$home_name['city_house-res_kitch'] = 'city_house'


	!! MEYNODLD HOUSEHOLD
	$home_name['meynold_household'] = 'meynold_household'
	$home_name['16'] = 'meynold_household'
	$home_name['mey_home'] = 'meynold_household'
end

!!{ All the existing properties should be added here. 
	id:			The old numerical id - for the nostalgia
	code:		The code of the property. Example: 'city_apartment', 'village_cottage'
	name:		General name to display
	display: 	The string to use in the middle of a sentence
	town:		The town/city/village the property can be found
	location:	The region within the town
	location-arg: The entry argument for the 'location' location 
	entrance:	The location where the charactes enter
	entrance-arg: The entry argument for the 'entrance' location 

	gs '<<location>>', '<<location-arg>>' will take Sveta to the location that leads 
				to the property. For example Pavlovsk Complex, City Residential, etc.)
	gs '<<entrance>>', '<<entrance-arg>>' will take Sveta straight to the entrance of
				the property. For example the hallway in the Parents'' Home.		

	type:		The type of the property - it is used by some checks right now, dating app and such. 
				In the future this could be expanded to things like business properties, offices or other whatever we 
				want to simplify some checks.
	price:		The sales value of the property.
	rent:		The monthly rent of the property. 
	rental:		Whether the property can be rented by Sveta or not. 
				1: Can be rented
				0: Can''t be rented // Examples are: Parents home, Shulga apartment, Hotel room in Pavlovsk, University dorm.
				Possible values are:

	free_internet: if the property comes with free internet (uses subscription['free']) then the value is `1`

	internet_enabled: If the value is 1, then Sveta can buy, cancel, transfer an internet subscription here

	can_be_renovated: Whether the property can be renovated or not. Tentative, not sure it is needed.
	construction_needed: If the value is 1, then the property needs to built before Sveta can move it.
					Currently the Matryona Mansion works like this, it starts as an empty plot of land.

	Property Types
	!! IMPORTANT: 
	!! NOTE: The types are not 100% clear and decided yet, need some more thinking. Also new ones can be added.

	permanent_residence:	This is a home that can be used for everything. Certain things don''t allow the more "transient"
							homes, like the dating app in Uni.
	temporary_residence:	This is a home that some events/actions won''t consider.

	New ones in the future could be for porperties that Sveta can own, rent, used, is not a home but can be changed/customised, etc. 
	For example a music studio/practice room, or a gallery, or a newspaper kiosk

	To make life easier, if is 0 or ''  for a property, then I didn''t include it. 
	Undefined strings will always evaluate to '' and undefined integers have a value of 0.
}

!! Always call this function with gs and use killvar'property' after finished with the data.
!!
!! ARGS[1] - the proprty code - a string identifier of the property. 
if $ARGS[0] = 'get_property_attr':
	killvar 'property'
	if $ARGS[1] = 'city_apartment':
		property['id'] = 1
		$property['code'] = $ARGS[1]
		$property['name'] = 'City residential apartment'
		$property['display'] = 'apartment in St. Petersburg''s residential area'
		$property['town'] = 'city'
		$property['location'] = 'city_residential'
		$property['location_arg'] = ''
		$property['entrance'] = 'korr'
		$property['entrance_arg'] = ''
		$property['type'] = 'permanent_residence'

		property['price'] = 800000
		property['rent'] = 15000
		property['rental'] = 1
		property['internet_enabled'] = 1
		property['can_be_renovated'] = 1
	elseif $ARGS[1] = 'parents_home':
		property['id'] = 2
		$property['code'] = $ARGS[1]
		$property['name'] = 'Parent''s home in Pavlovsk'
		$property['display'] = 'parent''s home in Pavlovsk'
		$property['town'] = 'pavlovsk'
		$property['location'] = 'pav_complex'
		$property['location_arg'] = 'start'
 		$property['entrance'] = 'korrPar'
		$property['entrance_arg'] = 'start'
		$property['type'] = 'permanent_residence'
		
		property['free_internet'] = 1	
	elseif $ARGS[1] = 'village_cottage':
		property['id'] = 3
		$property['code'] = $ARGS[1]
		$property['name'] = 'My cottage in the cooperative village'
		$property['display'] = 'cottage located in the cooperative village'
		$property['town'] = 'city'
		$property['location'] = 'dachamy'
		$property['location_arg'] = ''
		$property['entrance'] = 'dachamy'
		$property['entrance_arg'] = ''
		$property['type'] = 'permanent_residence'

		property['price'] = 150000
		!! Currently no cable or internet can be installed at this property, maybe later.
		property['internet_enabled'] = 0
	elseif $ARGS[1] = 'old_town_apartment':
		property['id'] = 4
		$property['code'] = $ARGS[1]
		$property['name'] = 'Old town apartment'
		$property['display'] = 'apartment in the old town of Pushkin'
		$property['town'] = 'oldtown'
		$property['location'] = 'liames'
		$property['location_arg'] = ''
		$property['entrance'] = 'korr2x'
		$property['entrance_arg'] = ''
		$property['type'] = 'permanent_residence'
		
		property['rental'] = 1
		property['rent'] = 10000		
		property['internet_enabled'] = 1
	elseif $ARGS[1] = 'matryona_mansion':
		property['id'] = 5
		$property['code'] = $ARGS[1]
		$property['name'] = 'Matryona mansion'
		$property['display_0'] = 'plot of land in the St. Petersburg''s suburbs'
		$property['display_1'] = 'impressive mansion under construction in the St. Petersburg''s suburbs'
		$property['display_2'] = 'impressive mansion in the St. Petersburg''s suburbs'
		$property['town'] = 'city'
		$property['location'] = 'city_mansion_entrance'
		$property['location_arg'] = ''
		$property['entrance'] = 'city_mansion_residence_1'
		$property['entrance_arg'] = 'yfoyer'
		$property['type'] = 'permanent_residence'

		property['price'] = 1500000
		property['internet_enabled'] = 1
		property['construction_needed'] = 1
	elseif $ARGS[1] = 'pavlovsk_hotel':
		property['id'] = 6
		$property['code'] = $ARGS[1]
		$property['name'] = 'My hotel room in Pavlovsk'
		$property['display'] = 'hotel room in Pavlovsk'
		$property['town'] = 'pavlovsk'
		$property['location'] = 'pav_market'
		$property['location_arg'] = ''
		$property['entrance'] = 'pav_hotel'
		$property['entrance_arg'] = ''
		$property['type'] = 'temporary_residence'

		property['free_internet'] = 1	
	elseif $ARGS[1] = 'maid_bedroom':
		property['id'] = 7
		$property['code'] = $ARGS[1]
		$property['name'] = 'Nicholas'' Apartment'
		$property['display'] = 'maid bedroom in Nicholas'' apartment'
		$property['town'] = 'city'
		$property['location'] = 'city_center'
		$property['location_arg'] = ''
		$property['entrance'] = 'nichBedroomServant'
		$property['entrance_arg'] = 'start'
		$property['type'] = 'permanent_residence'

		property['free_internet'] = 1	
	elseif $ARGS[1] = 'niko_apartment':
		property['id'] = 8
		$property['code'] = $ARGS[1]
		$property['name'] = 'Niko''s apartment'
		$property['display'] = 'Niko''s apartment'
		$property['town'] = 'pavlovsk'
		$property['location'] = 'pav_residential'
		$property['location_arg'] = ''
		$property['entrance'] = 'pav_residential'
		$property['entrance_arg'] = ''
		$property['type'] = 'temporary_residence'
	elseif $ARGS[1] = 'shulga_apartment':
		property['id'] = 9
		$property['code'] = $ARGS[1]	
		$property['name'] = 'Uncle Sergey''s apartment'
		$property['display'] = 'Uncle Sergey''s apartment'
		$property['town'] = 'pavlovsk'
		$property['location'] = 'pav_complex'
		$property['location_arg'] = 'start'
		$property['entrance'] = 'vasilyhome'
		$property['entrance_arg'] = 'hallway'
		$property['type'] = 'temporary_residence'

		property['free_internet'] = 1	
	elseif $ARGS[1] = 'lyceum_dorm':
		property['id'] = 10
		$property['code'] = $ARGS[1]	
		$property['name'] = 'Lyceum school'
		$property['display'] = 'room in the Lyceum dorm'
		$property['town'] = 'pavlovsk'
		$property['location'] = 'pav_commercial'
		$property['location_arg'] = ''
		$property['entrance'] = 'etoexhib'
		$property['entrance_arg'] = 'pos40'
		$property['type'] = 'permanent_residence'

		property['free_internet'] = 1	
	elseif $ARGS[1] = 'university_dorm':
		property['id'] = 11
		$property['code'] = $ARGS[1]
		$property['name'] = 'University halls'
		$property['display'] = 'room in the university dorm'
		$property['town'] = 'city'
		$property['location'] = 'city_island'
		$property['location_arg'] = ''
		$property['entrance'] = 'uni_dorm'
		$property['entrance_arg'] = 'dorm_room'
		$property['type'] = 'permanent_residence'

		property['free_internet'] = 1		
	elseif $ARGS[1] = 'hunters_lodge':
		property['id'] = 12
		$property['code'] = $ARGS[1]
		$property['name'] = 'Hunter''s lodge in Gadukino'
		$property['display'] = 'hunter''s lodge in Gadukino'
		$property['town'] = 'gadukino'
		$property['location'] = 'swamp_yard'
		$property['location_arg'] = 'start'
		$property['entrance'] = 'swamphouse'
		$property['entrance_arg'] = 'start'
		$property['type'] = 'temporary_residence'
	elseif $ARGS[1] = 'shared_apartment':
		property['id'] = 13
		$property['code'] = $ARGS[1]	
		$property['name'] = 'Shared apartment in Pavlovsk'
		$property['display'] = 'shared apartment in Pavlovsk'
		$property['town'] = 'pavlovsk'
		$property['location'] = 'pav_complex'
		$property['location_arg'] = 'start'
		$property['entrance'] = 'pav_shared_apt'
		$property['entrance_arg'] = 'start'
		$property['type'] = 'temporary_residence'

		property['free_internet'] = 1	
	elseif $ARGS[1] = 'grandparents_house':
		property['id'] = 14
		$property['code'] = $ARGS[1]
		$property['name'] = 'Grandparent''s house in Gadukino'
		$property['display'] = 'grandparent''s house in Gadukino'
		$property['town'] = 'gadukino'
		$property['location'] = 'gaddvor'
		$property['location_arg'] = ''
		$property['entrance'] = 'gaddvor'
		$property['entrance_arg'] = ''
		$property['type'] = 'temporary_residence'
	elseif $ARGS[1] = 'city_house':
		property['id'] = 15
		$property['code'] = $ARGS[1]
		$property['name'] = 'City residential house'
		$property['display'] = 'house in the St. Petersburg''s residential area'
		$property['town'] = 'city'
		$property['location'] = 'city_residential'
		$property['location_arg'] = ''
		$property['entrance'] = 'city_house_res_misc'
		$property['entrance_arg'] = 'fronty'		
		$property['type'] = 'permanent_residence'
		
		property['price'] = 100000
		property['internet_enabled'] = 1
	elseif $ARGS[1] = 'meynold_household':
		property['id'] = 16
		$property['code'] = $ARGS[1]
		$property['name'] = 'Meynold Household'
		$property['display'] = 'the Meynold Household'
		$property['town'] = 'pavlovsk'
		$property['location'] = 'pav_residential'
		$property['location_arg'] = ''
		$property['entrance'] = 'mey_home'
		$property['entrance_arg'] = 'door'
		$property['type'] = 'temporary_residence'

		property['free_internet'] = 1
	else
		gs 'homes_properties_attr', 'mod_property_query_hook'
	end
end

!!-----------------------------------------------------------------------------------------------------
!!
!!   Calls for mods 
!!
!!-----------------------------------------------------------------------------------------------------

!! This does nothing, the only reason to have this is that a mod can use a redirect to their own 
!! location, $args[0[] where they have the property info and can return it.
if $ARGS[0] = 'property_query_hook':
	!! use this for the redirect
	mod_result = 1
end


!!{ This is for the mods that want to introduce some new home
**OR** they rename an existing home location.
Call this when the mod is initialised and then never again

Example: A mod changes some things in the bedroom at the parents home and for this
	redirects to `mod_whatever_bedrPar`. 
	In this case it would fail as the location code passed would not match
	`bedrPar` and would get back an empty string a the name of the home 
	To avoid this, the mod should call this function with to location to the mapping.

IMPORTANT: $ARGS[1] is mandatory, and either $ARGS[2] or $ARGS[3] must have a value! 

$ARGS[1]	the new location name as it would appear in the $loc variable. This must start with `mod_` otherwise  it will be ignored
$ARGS[2] 	the name of the home if it is a completely new location - otherwise pass '' or don''t pass it
$ARGS[3] 	the location that is being replaced - if it is a new location, leave this as an empty string }
if $ARGS[0] = 'add_new_home_location':
	if $home_name[$ARGS[1]] ! '': 
		!! WARNING: Do Nothing, the location already exists
	elseif $ARGS[2] = '' and $ARGS[3] = '':
		!! WARNING: Either $ARGS[2] or $ARGS[3] must have a value, otherwise no mapping will be created
		$home_name[$ARGS[1]] = ''
	elseif $ARGS[2] ! '':
		$home_name[$ARGS[1]] = $home_name[$ARGS[2]]
	else
		$home_name[$ARGS[1]] = $home_name[$ARGS[3]]
	end
end
--- homes_properties_attr ---------------------------------