# housing

! 'rent' checks rent days given matches days of the month, and how much each rental costs.
! 'util' checks which properties having working utilities, then multiplies the amount owed accordingly.
! 'cable' checks which properties can have cable TV, then multiplies the amount owed accordingly.

! home_owned[1] = 2: 'Apartment in St. Petersburg residential area.'
! home_owned[1] = 3: 'Apartment in St. Petersburg residential area, that is currently occupied by your tenants.'
! home_owned[2] = 1: 'Apartment in Pavlovsk where you live with your parents.'
! home_owned[3] > 0: 'An cottage located in the cooperative village.'
! home_owned[4] = 1: 'An apartment in Pushkin.'
! home_owned[5] = 1: 'A plot of land in the St. Petersburg suburbs.'

if $ARGS[0] = 'rent':
	if month = 1:
		ArendHouseSL_due = 31
	elseif month = 2:
		if ((year mod 4 = 0) and (year mod 100 ! 0)) or (year mod 400 = 0):
			ArendHouseSL_due = 29
		else
			ArendHouseSL_due = 28
		end
	elseif month = 3:
		ArendHouseSL_due = 31
	elseif month = 4:
		ArendHouseSL_due = 30
	elseif month = 5:
		ArendHouseSL_due = 31
	elseif month = 6:
		ArendHouseSL_due = 30
	elseif month = 7:
		ArendHouseSL_due = 31
	elseif month = 8:
		ArendHouseSL_due = 31
	elseif month = 9:
		ArendHouseSL_due = 30
	elseif month = 10:
		ArendHouseSL_due = 31
	elseif month = 11:
		ArendHouseSL_due = 30
	elseif month = 12:
		ArendHouseSL_due = 31
	end

	home_rent[1] = 15000
	$home_rent_txt[1] = '15,000'

	!home_rent[3] = 00000
	!$home_rent_txt[3] = '00,000'

	home_rent[4] = 10000
	$home_rent_txt[4] = '10,000'

	!home_rent[5] = 00000
	!$home_rent_txt[5] = '00,000'
end

if $ARGS[0] = 'sale':
	home_value[1] = 2000000
	$home_value_txt[1] = '2,000,000'

	home_value[3] = 150000
	$home_value_txt[3] = '150,000'

	!home_value[4] = 000000
	!$home_value_txt[4] = '000,000'

	home_value[5] = 1500000
	$home_value_txt[5] = '1,500,000'
end

if $ARGS[0] = 'util':
	killvar 'hcount_util'
	if home_owned[1] = 1: hcount_util += 1
	if home_owned[3] > 1: hcount_util += 1
	if home_owned[4] > 0: hcount_util += 1
	if home_owned[5] > 2: hcount_util += 1
end

if $ARGS[0] = 'cable':
	if home_owned[1] = 1: hcount_cable += 1
	!if home_owned[3] > 1: hcount_cable += 1
	if home_owned[4] > 0: hcount_cable += 1
	if home_owned[5] > 2: hcount_cable += 1
end

--- housing ---------------------------------

