code:
# interaction_result_city
!handling templates
if sp_txt_is_set_from_save = 0: sp_txt = 1

!interaction type - talk
if $interaction_type = 'standart':
	dynamic $special_part
end

!interaction type - buyer invitation
if $interaction_type = 'buyer_invitation':
	gs '$slave_price'
	npc = 1
	dynamic '$text[1] = $<<$npc_id>>_pref[1]'
	if npc_progress[$npc_id] = 2:
		$text[1] = '  [<<$npc_name[$npc_id]>>]
- I still do not need new slaves. But I said a word to some friends, I am sure you will find buyers for such goods without difficulty.'
	else
		if slave_state = CONST_INT['slave_exist'] and slave['brand'] > 0:
			txt = 1
			$yes = {
				$interaction_type = 'sell_slave_simple'
				gt 'interaction_result_city'
			}
			$no = {
				if from_club = 1:
					from_club = 0
					gt $return_lock
				else
					gt 'city_menu_form'
				end
			}
			gt 'choice_screen'
		end
	end
end

!interaction type - slave sell simple scheme
if $interaction_type = 'sell_slave_simple':
	gs '$slave_price'
	if slave[$npc_id] > 0 and (day - slave[$npc_id]) >= 10: slave[$npc_id] = 0
	if slave_specialisation[$interesting_specialisation[$npc_id]] >= 1 and rating >= demand_rating[$npc_id] and slave[$npc_id] = 0: buyer_interested = 1
	!charm_demand_max = 10 + demand_rating[$npc_id]
	!charm_demand = rand(5,charm_demand_max)
									charm_demand = 6  &! require D- charm ( 6+) at F-/D-/D+ rating    (0-2)
	if demand_rating[$npc_id] >= 3: charm_demand = 12 &! require C- charm (12+) at C-/C+ rating       (3-4)
	if demand_rating[$npc_id] >= 5: charm_demand = 16 &! require B+ charm (16+) at B-/B+ rating       (5-6)
	if demand_rating[$npc_id] >= 7: charm_demand = 20 &! require A+ charm (20+) at A-/A+/S-/S+ rating (7-10)
	! if charm_demand > charm and buyer_interested = 1 and no_charm_check = 1: buyer_interested = 1
	if charm_demand > charm and buyer_interested = 1 and no_charm_check = 0: buyer_interested = 0
	if slave['wounds'] > 0 or slave['energy'] < 0 or slave['stamina'] < 2: buyer_interested = 0
	if slave['rehabilitation'] > 0 or $slave_psy_status = 'broken': buyer_interested = 0
	if slave['pregnant'] > 0 and slave['pregnant_revealed'] > 0: buyer_interested = 0
	! msg 'Slave Rating: <<rating>>'
	! msg 'Demand Rating: <<demand_rating[$npc_id]>>'
	! msg 'Slave Charm: <<charm>>'
	! msg 'Charm Demand: <<charm_demand>>'
	! msg 'NPC ID: <<slave[$npc_id]>>'
	! msg 'Buyer Interested:  <<buyer_interested>>'
	! msg 'No Charm check: <<no_charm_check>>'
	if buyer_interested = 1:
		npc_progress[$npc_id] = 2
		$text[1] = $buy_quote[$npc_id]
		sparks += common_price[demand_rating[$npc_id]]
		if sound_on = 1: play $large_money_sound
		if slave['ill'] > 0: sold_ill_slave += 1 &! trigger follow-up event
		if slave['parasite'] > 0: sold_parasite_slave += 1 &! trigger follow-up event
		dynamic $clear_slave_instance, 'slave'
		master_moodlet['pos_deal'] = 5
		if fixed_brand_rise = 0:
		!was brand_rate, which broke leveling the rate of brand completely and did not give leveling
			if brand_reputation <= demand_rating[$npc_id]/2: brand_rate += demand_rating[$npc_id]/2
			!if faction_fame[$npc_alignment[$npc_id]] < demand_rating[$npc_id]: dynamic $rise_faction_fame
			if faction_fame[$npc_alignment[$npc_id]] < demand_rating[$npc_id]/2:
				no_rise = 0
				if $npc_alignment[$npc_id] = 'taurus' and faction_fame['kamira'] > 2: no_rise = 1
				if $npc_alignment[$npc_id] = 'serpis' and faction_fame['korvus'] > 2: no_rise = 1
				if $npc_alignment[$npc_id] = 'kamira' and faction_fame['taurus'] > 2: no_rise = 1
				if $npc_alignment[$npc_id] = 'korvus' and faction_fame['serpis'] > 2: no_rise = 1
				if noble_status > 0 and faction_fame[$npc_alignment[$npc_id]] = 5: no_rise = 1
				if no_rise = 0: faction_fame[$npc_alignment[$npc_id]] += 1
				brand_rate += 1
			end
		else
			brand_rate += fixed_brand_rise
		end
	else
		if charm_demand > charm: $text[1] = $refuse_charm_quote[$npc_id]
		if slave_specialisation[$interesting_specialisation[$npc_id]] < 1: $text[1] = $refuse_skill_quote[$npc_id]
		if demand_rating[$npc_id] > rating: $text[1] = $refuse_level_quote[$npc_id]
		if slave['wounds'] > 0 or slave['energy'] < 0 or slave['stamina'] < 2: $text[1] = $refuse_health_quote[$npc_id]
		if slave['rehabilitation'] > 0 or $slave_psy_status = 'broken': $text[1] = $refuse_health_quote[$npc_id]
		if slave['pregnant'] > 0 and slave['pregnant_revealed'] > 0: $text[1] = $refuse_pregnant_quote[$npc_id]
		if slave[$npc_id] > 0: $text[1] = $refuse_again_quote[$npc_id]
		if charm_demand > charm: slave[$npc_id] = day
	end
end

!interaction type - slave sell to clients from houses, new scheme
if $interaction_type = 'sell_slave_house':
	gs '$slave_price'
	if slave[$npc_id] > 0 and (day - slave[$npc_id]) >= 10: slave[$npc_id] = 0
	if slave_specialisation[$interesting_specialisation[$npc_id]] >= 1 and rating >= demand_rating[$npc_id] and slave[$npc_id] = 0: buyer_interested = 1
	!charm_demand_max = 15 + demand_rating[$npc_id]
	!charm_demand = rand(5,charm_demand_max)
									charm_demand = 6  &! require D- charm ( 6+) at F-/D-/D+ rating    (0-2)
	if demand_rating[$npc_id] >= 3: charm_demand = 12 &! require C- charm (12+) at C-/C+ rating       (3-4)
	if demand_rating[$npc_id] >= 5: charm_demand = 16 &! require B+ charm (16+) at B-/B+ rating       (5-6)
	if demand_rating[$npc_id] >= 7: charm_demand = 20 &! require A+ charm (20+) at A-/A+/S-/S+ rating (7-10)
	if charm_demand > charm and buyer_interested = 1 and no_charm_check = 1: buyer_interested = 1
	if charm_demand > charm and buyer_interested = 1 and no_charm_check = 0: buyer_interested = 0
	if slave['wounds'] > 0 or slave['energy'] < 0 or slave['stamina'] < 2: buyer_interested = 0
	if slave['rehabilitation'] > 0 or $slave_psy_status = 'broken': buyer_interested = 0
	if slave['pregnant'] > 0 and slave['pregnant_revealed'] > 0: buyer_interested = 0
	if buyer_interested = 1:
		buyer_from_house = 1
		gt 'slave_sell'
	else
		if charm_demand > charm: $text[1] = $refuse_charm_quote[$npc_id]
		if slave_specialisation[$interesting_specialisation[$npc_id]] < 1: $text[1] = $refuse_skill_quote[$npc_id]
		if demand_rating[$npc_id] > rating: $text[1] = $refuse_level_quote[$npc_id]
		if slave['wounds'] > 0 or slave['energy'] < 0 or slave['stamina'] < 2: $text[1] = $refuse_health_quote[$npc_id]
		if slave['rehabilitation'] > 0 or $slave_psy_status = 'broken': $text[1] = $refuse_health_quote[$npc_id]
		if slave['pregnant'] > 0 and slave['pregnant_revealed'] > 0: $text[1] = $refuse_pregnant_quote[$npc_id]
		if slave[$npc_id] > 0: $text[1] = $refuse_again_quote[$npc_id]
		if charm_demand > charm: slave[$npc_id] = day
	end
end

!interaction type - slave sold to clients from houses, new scheme
if $interaction_type = 'slave_sold_house':
	npc = 1
	npc_progress[$npc_id] = 2
	if fixed_brand_rise = 0:
		if have_discounted = 1:
			if brand_reputation <= demand_rating[$npc_id]/2: brand_rate += demand_rating[$npc_id]
			have_discounted = 0
		else
			if brand_reputation <= demand_rating[$npc_id]/2: brand_rate += demand_rating[$npc_id]/2
		end
		if faction_fame[$npc_alignment[$npc_id]] < demand_rating[$npc_id]/2:
			no_rise = 0
			if $npc_alignment[$npc_id] = 'taurus' and faction_fame['kamira'] > 2: no_rise = 1
			if $npc_alignment[$npc_id] = 'serpis' and faction_fame['korvus'] > 2: no_rise = 1
			if $npc_alignment[$npc_id] = 'kamira' and faction_fame['taurus'] > 2: no_rise = 1
			if $npc_alignment[$npc_id] = 'korvus' and faction_fame['serpis'] > 2: no_rise = 1
			if noble_status > 0 and faction_fame[$npc_alignment[$npc_id]] = 5: no_rise = 1
			if no_rise = 0: faction_fame[$npc_alignment[$npc_id]] += 1
		end
	else
		brand_rate += fixed_brand_rise
	end
	sparks += sell_price
	if sound_on = 1: play $large_money_sound
	if slave['ill'] > 0: sold_ill_slave = 1 &! trigger follow-up event
	if slave['parasite'] > 0: sold_parasite_slave = 1 &! trigger follow-up event
	dynamic $sold_clothing
	dynamic $clear_slave_instance, 'slave'
	master_moodlet['pos_deal'] = 5
	city_form = city_form_transfer
	$place = $place_transfer
end

!interaction type - sell_slave_complex
if $interaction_type = 'sell_slave_complex':
	gs 'slave_sell_chek'
	if buyer_interested = 1:
		$text[1] = $buy_quote[$npc_id]
		if noprice = 0:
			sparks += common_price[demand_rating[$npc_id]]
			if sound_on = 1: play $large_money_sound
		end
		if slave['ill'] > 0: sold_ill_slave = 1 &! trigger follow-up event
		if slave['parasite'] > 0: sold_parasite_slave = 1 &! trigger follow-up event
		dynamic $clear_slave_instance, 'slave'
		master_moodlet['pos_deal'] = 5
		!fixed code for kings
		if demand_rating[$npc_id] = 10:
			brand_rate += 20
		else
			brand_rate += demand_rating[$npc_id]
		end

		!faction_fame[$npc_alignment[$npc_id]] < demand_rating[$npc_id]: dynamic $rise_faction_fame
		if faction_fame[$npc_alignment[$npc_id]] < demand_rating[$npc_id]/2:
			no_rise = 0
			if $npc_alignment[$npc_id] = 'taurus' and faction_fame['kamira'] > 2: no_rise = 1
			if $npc_alignment[$npc_id] = 'serpis' and faction_fame['korvus'] > 2: no_rise = 1
			if $npc_alignment[$npc_id] = 'kamira' and faction_fame['taurus'] > 2: no_rise = 1
			if $npc_alignment[$npc_id] = 'korvus' and faction_fame['serpis'] > 2: no_rise = 1
			if noble_status > 0 and faction_fame[$npc_alignment[$npc_id]] = 5: no_rise = 1
			if no_rise = 0: faction_fame[$npc_alignment[$npc_id]] += 1
		end
		npc_progress[$npc_id] = 2
		active[$quest[5]] = 0
		if noble_status = 0 and demand_rating[$npc_id] = 10: noble_status = 1
	else
		if sl_txt = 105: $text[1] = $refuse_pregnant_quote[$npc_id]
		if sl_txt = 104: $text[1] = $refuse_health_quote[$npc_id]
		if sl_txt = 103: $text[1] = $refuse_charm_quote[$npc_id]
		if sl_txt = 102: $text[1] = $refuse_skill_quote[$npc_id]
		if sl_txt = 101: $text[1] = $refuse_level_quote[$npc_id]
		if sl_txt = 100 and $refuse_special_quote[$npc_id] ! '': $text[1] = $refuse_special_quote[$npc_id]
	end
end

!interaction type - cow sell
if $interaction_type = 'sell_milk_cow':
	gs '$cow_price'
	$text[1] = 'Jarik leads you to the cowshed, glancing at your slave with calculating eyes.'
	if cow['cowSK'] > 2: buyer_interested = 1
	if cow['wounds'] > 0 or cow['energy'] < 0 or cow['stamina'] < 1: buyer_interested = 0
	if cow['cowSK'] > 2 and cowprice < 800:
		buyer_interested = 0
	end
	if buyer_interested = 1:
		npc_progress[$npc_id] = 2
		copyarr '$text', '$cow_auction'
		$yes = {
			sparks += cowprice
			if sound_on = 1: play $large_money_sound
			if cow['ill'] > 0: sold_ill_slave += 1 &! trigger follow-up event
			if cow['parasite'] > 0: sold_parasite_slave += 1 &! trigger follow-up event
			dynamic $clear_slave_instance, 'cow'
			master_moodlet['pos_deal'] = 5
			gt 'shop_general'
		}
		$no =
			gt 'shop_general'
		}
		sell_cow_choice = 1
		!'Let me evaluate her... Good, her production will certainly match the public farm requirements. I can offer you <<cowprice>> sparks for her.'
	else
		if cow['cowSK'] < 3:
			$text[2] = '
Jarik quickly examines your girl, then turns to you:
[Jarik]
' + _
			'- A lactating girl doesn’t make a cow! Your girl needs to spend more time in a barn and learn to behave like a cow. I will not make you an offer, sorry sir-trainer.'
		elseif cow['wounds'] > 0 or cow['energy'] < 0 or cow['stamina'] < 2:
			$text[2] = $refuse_health_quote[$npc_id]
		elseif cow['cowSK'] > 2 and cowprice < 800:
			$text[2] = '
Jarik quickly examines your girl, then turns to you:
[Jarik]' + _
			'- Sorry sir-trainer, I can’t take her, she will not be productive enough. Maybe if she becomes more used to living in the barn... But, ummh, perhaps she never will be a good cow.'
		end
	end
end

if $interaction_type = 'ask_milk_tip':
	milk_tip = 1
	if milk_price < 2:
		tip_asked += 2
		if tip_asked > 6: tip_asked = 6
	end
	if milk_price > 6:
		tip_asked -= 2
		if tip_asked < 1: tip_asked = 2
	end
	if tip_asked = 2 or tip_asked = 3:
		milk_demand = 0
		$text[1] = '<<$tip_milk[milk_demand]>>'
	end
	if tip_asked = 4:
		milk_demand = 1
		$text[1] = '<<$tip_milk[milk_demand]>>'
	end
	if tip_asked = 5 or tip_asked = 6:
		milk_demand = 2
		$text[1] = '<<$tip_milk[milk_demand]>>'
	end
end

!interaction type - Bryn teaches the hero a special technique
if $interaction_type = 'learn_spm':
	$place = 'colosseum'
	$return_lock = 'next_day' & is_home = 1 &! is_home = 1 to bypass menu_form ESC intercept
	npc = 1
	$npc_id = 'брина_рыжая'
	$text[1] = '  [RED HAIR BRYN]
- C’mon! Stronger!! Faster!!! You fight worse than a twelve year old girl, slaver. H-ha, take it! Do you feel it? That’s how it should be. This will kill your enemy! Arise, deadhead! Again. Stronger!! Faster!!!'
	$text[2] = '  Bryn drives you through the training arena all day, and as a result you feel squeezed like a lemon. From strike demonstrations you get bruises all over your body. But she also takes sparks for that! Well, at least now you know the new powerful technique. Now home. Time to relax...'
	if $master_spm[1] = '':
		$master_spm[1] = $spm_to_learn
	elseif $master_spm[2] = '':
		$master_spm[2] = $spm_to_learn
	elseif $master_spm[3] = '':
		$master_spm[3] = $spm_to_learn
	elseif $master_spm[4] = '':
		$master_spm[4] = $spm_to_learn
	elseif $master_spm[5] = '':
		$master_spm[5] = $spm_to_learn
	end
	spm_learned[$spm_to_learn] = 1
	spm_number += 1
end

!interaction type - sold slave
if $interaction_type = 'slave_sold':
	personal_relations[$npc_id] += client_satisfaction
	if client_satisfaction > 0 and npc_bennies[$npc_id] > 0:
		bennies_give = 1 + rating - demand_rating[$npc_id]
		if bennies_give <=  npc_bennies[$npc_id]:
			brand_rate += bennies_give
			npc_bennies[$npc_id] -= bennies_give
		else
			brand_rate += npc_bennies[$npc_id]
			npc_bennies[$npc_id] = 0
		end
	end
	if client_satisfaction < 0 and npc_bennies[$npc_id] > 0:
		brand_rate += client_satisfaction
		npc_bennies[$npc_id] += client_satisfaction
		if npc_bennies[$npc_id] < 0: npc_bennies[$npc_id] = 0
	end
	$return_lock = $return_lock_transfer
	sparks += sell_price
	if slave['ill'] > 0: sold_ill_slave = 1 &! trigger follow-up event
	if slave['parasite'] > 0: sold_parasite_slave = 1 &! trigger follow-up event
	dynamic $sold_clothing
	dynamic $clear_slave_instance, 'slave'
	master_moodlet['pos_deal'] = 5
	rr = rand(0,10)
	no_slave_count[$npc_id] = count_size[$npc_id] + rr
	$place = $place_transfer
end

!interaction type - demonstration of the apartments for rent
if $interaction_type = 'rental_demo':
	npc = 1
	$npc_id = 'realtor'
	$return_lock  = 'shop_general'
	$special_action[3] = {
		$place = 'demo'
		$place_name['demo'] = 'Rooms inspection'
		$place_info['demo'] = '   It is necessary to carefully examine all the rooms, so I do not get slipped with some garbage.'
		$bg['demo'] = $interior_study['<<$demo_var>>']
	}
	$special_action[5] = {
		npc = 0
	}
	$special_action[6] = {
		npc = 1
		$bg['demo'] = $interior_bed['<<$demo_var>>']
	}
	$special_action[7] = {
		npc = 0
	}
	$special_action[8] = {
		npc = 1
		$bg['demo'] = $interior_bath['<<$demo_var>>']
	}
	$special_action[9] = {
		npc = 0
	}
	$special_action[10] = {
		npc = 1
		$bg['demo'] = $interior_kitchen['<<$demo_var>>']
	}
	$special_action[11] = {
		npc = 0
	}
	$special_action[12] = {
		npc = 1
		$bg['demo'] = $interior_study['<<$demo_var>>']
	}
	$special_action[13] = {
		npc = 0
		$bg['demo'] = $interior_boudoir['<<$demo_var>>']
	}
	$special_action[14] = {
		$bg['demo'] = $interior_dungeon['<<$demo_var>>']
	}
	$special_action[15] = {
		$bg['demo'] = $interior_lab['<<$demo_var>>']
	}
	$special_action[16] = {
		npc = 1
		$bg['demo'] = $interior_study['<<$demo_var>>']
		gt 'choice_screen'
	}
	$no = {
		$place = 'realtor_office'
		gt 'shop_general'
	}
end

!interaction type - signing rent
if $interaction_type = 'rental_sex':
	npc = 1
	$npc_id = 'realtor'
	menu_form = 0
	gs 'new_estate'
	$place = 'bedroom'
	$return_lock = 'menu_form' & city_form = 0 &! city_form = 0 to bypass menu_form ESC intercept but still play door sound
	$special_action[3] = {npc = 0}
	if sound_on = 1: play $large_money_sound, sound_volume
	if master_excitement = 0: master_excitement = rand(0,5)
	if is_perv > 1 and loli_magic < 2:
		if loli_magic = 0:
			master_excitement_rate -= 41
			master_mood_rate += 31
			master_libido_rate = 0
		else
			master_excitement_rate -= 16
			master_mood_rate -= 33
			master_libido_rate = 2
		end
		loli_magic += 1 &! renting a new home unlocks the next is_perv reduction for dirty old man
		dynamic $master_energy_drop
		cooked_food = 5 & fridge['vegetables'] += 1 & fridge['flower'] += 1 & fridge['cream'] += 1 & fridge['none'] += 1
		house_mess_rate = 0
		house_mess = 0
		copyarr '$text', '$realtor_no_sex'
	elseif master_excitement >= 0:
		if is_master_virgin = 1:
			$special_image[3] = 'girls\sex_scenes\oral_general_milf_2.png'
			$special_image[4] = 'girls\sex_scenes\bj_purple_long_milf.png'
			$special_image[5] = 'girls\sex_scenes\sex_purple_long_milf.png'
			$special_image[6] = 'girls\sex_scenes\sex_general_milf.png'
			$play_sound[3] = '<<$bj_sound[2]>>'
			$play_sound[5] = '<<$fuck_sound[2]>>'
			is_master_virgin = 0
		else
			$special_image[3] = 'girls\sex_scenes\oral_general_milf_2.png'
			$special_image[4] = 'girls\sex_scenes\bj_purple_long_milf.png'
			$special_image[5] = 'girls\sex_scenes\analsex_general_young.png'
			$special_image[6] = 'girls\sex_scenes\analsex_purple_long_milf_3.png'
			$play_sound[3] = '<<$bj_sound[2]>>'
			$play_sound[5] = '<<$assfuck_sound[2]>>'
		end
		ejaculation_intensity = master_excitement
		dynamic $master_ejaculate
		dynamic $master_ejaculate
		dynamic $master_energy_drop
		master_hygiene_rate += 10
		house_mess_rate += 10
		copyarr '$text', '$realtor_bonus_sex'
	else
		dynamic $master_energy_drop
		cooked_food = 5 & fridge['vegetables'] += 1 & fridge['flower'] += 1 & fridge['cream'] += 1 & fridge['none'] += 1
		house_mess_rate = 0
		house_mess = 0
		sparks += 5
		copyarr '$text', '$realtor_no_sex'
	end
end

!interaction type - brothel
if $interaction_type = 'whore':
	$place = 'brothel'
	$return_lock  = 'shop_general'
	sparks -= whore_price
	ejaculation_intensity = whore_quality
	if is_perv = 1 and is_loli = 1:
		master_excitement_rate = max(0, master_excitement_rate + whore_quality*8)
		gs '$calculate_attributes' &! update master_excitement before flaccid check below
		master_perv_rate += whore_quality
	end
	dynamic $master_ejaculate
	dynamic $master_energy_drop
	master_hygiene_rate += 5 * whore_quality
	$picture_type = 'pic_png'

	if master_excitement < -2:
		$special_image[2] = 'empty.png'
		if is_flaccid2 = 1:
			$special_image[2] = 'scene/flaccid'
			g = rand(1, picMax["flaccid"])
			if g > 1: $special_image[2] += '_' + $str(g)
			$special_image[2] += ".png"
		end
		$special_image[3] = 'scene/flaccid'
		g = rand(1, picMax["flaccid"])
		if g > 1: $special_image[3] += '_' + $str(g)
		$special_image[3] += ".png"
	elseif master_str < 4:
		master_str_rate += 1
	end
	dynamic $special_part
end

!interaction type - borrow money
if $interaction_type = 'moneylender':
	$return_lock  = 'shop_general'
	if nsfw = 1: not_safe = 1
	$place = 'moneylender'
	$npc_id = 'moneylender'
	npc = 1
	$text[1] = '  [MONEYLENDER]
- Here’s your sparks, slaver. If you bring back the debt on time, maybe I will increase the amount of your loan. Maybe. But if you can not manage this - I will shorten your life. And this will be for sure. I will be waiting <<debt_count>> days. Do not be late.'
	sparks += loan
end

!interaction type - buy item for current slave
if $interaction_type = 'buy_item':
	$return_lock  = 'shop_general'
	if nsfw = 0 and $item_demo[$item_id] ! '': $bg_path = $item_demo[$item_id] & $picture_type = 'pic_png'
	shop_description = 1
	dynamic "$text[1] = '<<$item_description[$item_id]>>'"
	killvar 'shop_description'
	if one_time_aurabound_items_hint = 0:
		one_time_aurabound_items_hint = 1
		msg '   As you consider the purchase, you recall that most clothes and accessories in the Eternal Rome are imbued with magic. They adapt themselves to fit their wearer, but in the process they become bound to the aura of that person and will not adapt to another, making any sale assuredly final. Caveat emptor! It is probably a way to keep the economy running...'
	end
	if sparks >= item_price[$item_id]:
		$do_buy = {
			if sound_on = 1:
				if item_price[$item_id] >= 50:
					play $large_money_sound, sound_volume
				else
					play $small_money_sound, sound_volume
				end
			end
			sparks -= item_price[$item_id]
			inventory[$item_id] += item_qty
			end
		}
		gt 'item_buy'
	else
		killvar '$text'
		$text[1] = '  The price is <<item_price[$item_id]>> sparks, slightly more than you can afford at the moment, but this is easily remedied. You just have to sell a couple of slaves...'
	end
end

!interaction type - purchase item for the home
if $interaction_type = 'buy_item_home':
	$return_lock  = 'shop_general'
	if nsfw = 0 and $item_demo[$item_id] ! '': $bg_path = $item_demo[$item_id] & $picture_type = 'pic_png'
	shop_description = 1
	dynamic "$text[1] = '<<$item_description[$item_id]>>'"
	killvar 'shop_description'
	if sparks >= item_price[$item_id]:
		$do_buy = {
			if sound_on = 1:
				if item_price[$item_id] >= 50:
					play $large_money_sound, sound_volume
				else
					play $small_money_sound, sound_volume
				end
			end
			sparks -= item_price[$item_id]
			inventory[$item_id] += 1
		}
		gt 'item_buy'
	else
		killvar '$text'
		$text[1] = '  The price is <<item_price[$item_id]>> sparks, slightly more than you can afford at the moment, but this is easily remedied. You just have to sell a couple of slaves...'
	end
end

if $interaction_type = 'buy_item_personal':
	if $return_lock = '': $return_lock = 'city_menu_form' & msg '$return_lock not set for <<$item_id>>, please report this'
	if nsfw = 0 and $item_demo[$item_id] ! '': $bg_path = $item_demo[$item_id] & $picture_type = 'pic_png' & npc = 0
	shop_description = 1
	dynamic "$text[1] = '<<$item_description[$item_id]>>'"
	killvar 'shop_description'
	if sparks >= max(item_price[$item_id], wpn_price):
		$do_buy = {
			if sound_on = 1:
				if max(item_price[$item_id], wpn_price) >= 50:
					play $large_money_sound, sound_volume
				else
					play $small_money_sound, sound_volume
				end
			end
			sparks -= max(item_price[$item_id], wpn_price)
			dynamic '<<$item_id>> += max(1,multiple)' &! at least one if no multiple specified - ImperatorAugustus
			if $return_lock = 'shop_wpn': wpn_price = 0 & npc = 1 & skip_to = 999 & $text[1] = $shop_wpn_accept
		}
		$do_no_buy = {
			wpn_price = 0 &! avoid infinite loop - ImperatorAugustus
		}
		gt 'item_buy'
	elseif wpn_price > 0:
		$do_buy = {
			npc = 1
			skip_to = 999
			wpn_price = 0 &! avoid infinite loop - ImperatorAugustus
			$text[1] = $shop_wpn_deny
		}
		$do_no_buy = {
			wpn_price = 0 &! avoid infinite loop - ImperatorAugustus
		}
		gt 'item_buy'
	else
		$text[1] = '  The price is <<item_price[$item_id]>> sparks, slightly more than you can afford at the moment, but this is easily remedied. You just have to sell a couple of slaves...'
	end
	gt $return_lock
end

!interaction type - service
if $interaction_type = 'service':
	$return_lock  = 'shop_general'
	$picture_type = 'pic_png'
	$bg_path  = $service_picture
	if sparks >= service_price:
		sparks -= service_price
		if sound_on = 1:
			if service_price >= 50:
				play $large_money_sound, sound_volume
			else
				play $small_money_sound, sound_volume
			end
		end
		dynamic $do_service
	else
		$bg_path  = ''
		killvar '$text'
		$text[1] = '  The price of the service is <<service_price>> sparks, slightly more than you can afford at the moment, but this is easily remedied. You just have to sell a couple of slaves...'
	end
end

!interaction type - treat a girl at the bar
if $interaction_type = 'hit_on_patron':
	$place = 'tavern'
	if city_already_done_today[interaction_city] <= 0:
		a = rand(1,2)
		if a = 1: $npc_id = 'брина_рыжая'
		if a = 2: $npc_id = 'poison'
		npc = 1
		dynamic $npc_flirt[$npc_id]
		npc_reveal[$npc_id] = 1
		sparks -= 2
	else
		$text[1] = '  You are viewing the pub in search of other bored and lonely women, but no suitable candidate for courtship is visible. Probably should try your luck tomorrow.'
	end
end

if $interaction_type = 'dine':
	$text[1] = '<<$text[1]>>'
end

!completion tags
city_already_done_today[interaction_city] += 1
city_already_done_ever[interaction_city] += 1

if txt_is_set_from_save = 0: txt = 1
gt 'interaction_screen_city'

--- interaction_result_city ---------------------------------

repo_name: Tcallas/game

license: unknown


code:
# interaction_screen
gs '_layout'
if $special_action[txt] ! '':
	dynamic $special_action[txt]
end

if nsfw = 0:
	if $bg[$place] ! '':
		*p '
<img src="content/pic/bg/<<$bg[$place]>>.png">
'
	end
	if $bg_path ! '':
		*p '
<img src="content/pic/<<$bg_path>>.png">
'
	end
	if $special_image_full[txt] ! '':
		*p '
<img src="<<$special_image_full[txt]>>">
'
	elseif $special_image[txt] ! '':
		*p '
<img src="content/pic/<<$special_image[txt]>>">
'
	end
end

*p '
<<$text[txt]>>
'

!Displays the slave’s fullimage on the first screen during sex training - not wanted by the community - crushboss
!if $interaction_type = 'self_sex_lesson':
!	if nsfw = 0:
!		if txt = 1:
!			*p '
<img src="content/pic/<<$slave[''fullimage'']>>.png">
'
!			else
!			*p '
<img src="content/pic/<<$bg_path>>.png">
'
!		end
!	end
!end

if $interaction_type = 'self_sex_lesson_special':
	if txt = 1 or txt = 5:
		if nsfw = 0: *p '
<img src="content/pic/<<$slave[''fullimage'']>>.png">
'
	end
end

if $interaction_type = 'chestbuster':
	if txt = 2 and nsfw = 0: *p '
<img src="content/pic/<<$bg_path>>.png">
'
	if nsfw = 0 and txt > 2:
		$bg_path = "scene/event_chestbuster"
		g = rand(1, picMax["event_chestbuster"])
		if g > 1: $bg_path += '_' + $str(g)
		*p '
<img src="content/pic/<<$bg_path>>.png">
'
	end
end

if show_slave_fullimage = 1:
	npc = 0
	if nsfw = 0: *p '
<img src="content/pic/<<$slave[''fullimage'']>>.png">
'
! 	if nsfw = 0: *p '
<img src="content/pic/<<$fullimage[slave_type]>>.png">
'
elseif show_assistant_fullimage = 1:
	npc = 1
	!$npc_id = '<<$assistant_name>>'
	$npc_id = 'ваша_ассистентка'
	if nsfw = 0: *p '
<img src="content/pic/<<$assistant[''fullimage'']>>.png">
'
elseif show_prisoner_fullimage = 1:
	npc = 0
	if nsfw = 0: *p '
<img src="content/pic/<<$prisoner[''fullimage'']>>.png">
'
elseif show_cow_fullimage = 1:
	npc = 0
	if nsfw = 0: *p '
<img src="content/pic/<<$cow[''fullimage'']>>.png">
'
elseif show_pig_fullimage = 1:
	npc = 0
	if nsfw = 0: *p '
<img src="content/pic/<<$pig[''fullimage'']>>.png">
'
elseif show_harpy_fullimage = 1:
	npc = 0
	if nsfw = 0: *p '
<img src="content/pic/<<$harpy[''fullimage'']>>.png">
'
elseif show_farmhand_fullimage = 1:
	npc = 0
	if nsfw = 0: *p '
<img src="content/pic/<<$farmhand[''fullimage'']>>.png">
'
end

if npc = 0:
	*p '

<<$place_name[$place]>>
<<$place_location[$place]>>
'
	*nl 'Information for consideration:
'
	*p '
<<$place_info[$place]>>
'
elseif npc = 1 and $npc_name[$npc_id] ! '':
	if nsfw = 0 and $npc_image[$npc_id] ! '': *p '
<img src="content/pic/characters/<<$npc_image[$npc_id]>>.png">
'
	*p '

<<$npc_name[$npc_id]>>
<<$npc_status[$npc_id]>>
'
	*nl 'Information for consideration:
'
	*p '
<<$npc_attitude[npc_attitude[$npc_id]]>>'
	*nl '<<$npc_info[$npc_id]>>
'
end

$info_bar = ''
*p '
<<$info_bar>>
'

!Not needed - crushboss
!if (res < 0 or sin > 0) and $interaction_type ! 'torture' and $interaction_type ! 'present_torture' and $interaction_type ! 'prisoner_torture' and $interaction_type ! '':
!	npc = 1
!	$npc_id = '<<$slave_name>>'
!	if nsfw = 0: *p '
<img src="content/pic/<<$fullimage[slave_type]>>.png">
'
!	 if nsfw = 0: *p '
<img src="content/pic/<<$slave[''fullimage'']>>.png">
'
!end

if sound_on = 1 and $play_sound[txt] ! '': play 'content/snd/<<$play_sound[txt]>>.wav', sound_volume
if $play_sound[txt] ! '': $play_sound[txt] = ''

if txt > 1:
	addobj ''
else
	addobj ''
end
addobj ''

!Tutorial sex training - bug fix - crushboss
if exam_in_progress = 1 and $interaction_type = 'self_sex_lesson' and txt > 4:
	killobj
	gt 'demo_menu_form'
end

--- interaction_screen ---------------------------------


code:
# interaction_screen_city
gs '_layout'
if $special_action[txt] ! '':
	dynamic $special_action[txt]
end

if not_safe = 1:
	not_safe = 0
	*p '

'
elseif $bg[$place] ! '':
	*p '
<img src="content\pic\bg\<<$bg[$place]>>.png">
'
end

if $special_image_full[txt] ! '':
	if nsfw = 0:*p '
<img src="<<$special_image_full[txt]>>">
'
elseif $special_image[txt] ! '':
	if nsfw = 0:*p '
<img src="content\pic\<<$special_image[txt]>>">
'
end

if $place = 'computer' and nsfw = 1: *p '

'

*p '
<<$text[txt]>>
'

if $picture_type = 'pic_png':
	if $bg_path ! '': *p '
<img src="content\pic\<<$bg_path>>.png">
'
end
if $picture_type = 'untyped':
	if nsfw = 0:*p '
<img src="<<$bg_path>>">
'
end
if ($interaction_type = 'drop_to_farid' and txt = 2) or interaction_city = 61120:
	npc = 0
	jump 'first_point'
end

if $interaction_type = 'sell_milk_cow':
	$info_bar = ''
	if nsfw = 1:
		*p '

'
		else
		*p '

'
	end

	*p '

<<$npc_name[$npc_id]>>
<<$npc_status[$npc_id]>>
'
	*nl 'Information for consideration:
'

	*p '
<<$npc_attitude[npc_attitude[$npc_id]]>>'
	*nl '<<$csell_tuto>>
'
	jump 'second_point'
end

if npc = 0:
	$info_bar = ''
	*p '

<<$place_name[$place]>>
<<$place_location[$place]>>
'
	*nl 'Information for consideration:
'
	*p '
<<$place_info[$place]>>
'
else
	$info_bar = ''
	if nsfw = 1:
		*p '

'
	elseif $npc_image[$npc_id] ! '':
		*p '
<img src="content\pic\characters\<<$npc_image[$npc_id]>>.png">
'
	end
	*p '

<<$npc_name[$npc_id]>>
<<$npc_status[$npc_id]>>
'
	*nl 'Information for consideration:
'

	*p '
<<$npc_attitude[npc_attitude[$npc_id]]>>'
	*nl '<<$npc_info[$npc_id]>>
'
end

jump 'second_point'
:first_point
if $master_head_gear = 'raven_crown': gs '$slave_price', 'stock' &! update rating
$info_bar = '

' + _
IIF($master_head_gear = 'raven_crown', 'Attributes Rating:  <<$rating[rating]>>
', '
') + _
'ATTRIBUTES
' + _
'<<$beauty[stock["beauty"]]>>
' + _
'<<$stamina[stock["stamina"]]>>
' + _
'<<$sensitivity[stock["sensitivity"]]>>
' + _
'<<$temper[stock["temper"]]>>
' + _
'<<$intellect[stock["intellect"]]>>
' + _
'<<$ego[stock["ego"]]>>
' + _
'<<$pride[stock["pride"]]>>
' + _
'<<$exotic[stock["exotic"]]>>
' + _
'<<$fat[stock["fat"]]>>
' + _
'<<$style[stock["style"]]>>
' + _
'TRAITS
' + _
'<<$ucase($mid($stock_boobs2_txt[stock["boobs"]],1,1))+mid($stock_boobs2_txt[stock["boobs"]],2)>>
' + _
'<<$stock_features_list>>'

if $interaction_type ! 'hunting_trophy': $special_image[3] = '<<$stock["fullimage"]>>.png'
if interaction_city = 61120:
	$stock_attrib_list = $info_bar
	$info_bar = ''
end

:second_point

*p '
<<$info_bar>>
'

if sound_on = 1 and $play_sound[txt] ! '': play 'content\snd\<<$play_sound[txt]>>.wav', sound_volume
if $play_sound[txt] ! '': $play_sound[txt] = ''

if txt > 1:
	addobj ''
else
	addobj ''
end
addobj ''

--- interaction_screen_city ---------------------------------


code:
# interior_change
!Move to a different room in your apartment
!Created by crushboss

!gs 'main_layout'

if change_interior = 1: interior_num += 1
if interior_num > 7: interior_num = 1
if interior_num = 1: $place = 'bedroom_lux'
if interior_num = 2 and bath > 0:
	$place = 'bathroom_lux'
elseif interior_num = 2 and bath = 0:
	interior_num += 1
end
if interior_num = 3 and dungeon > 0:
	$place = 'dungeon_lux'
elseif interior_num = 3 and dungeon = 0:
	interior_num += 1
end
if interior_num = 4 and kitchen > 0:
	$place = 'kitchen_lux'
elseif interior_num = 4 and kitchen = 0:
	interior_num += 1
end
if interior_num = 5 and lab > 0:
	$place = 'lab_lux'
elseif interior_num = 5 and lab = 0:
	interior_num += 1
end
if interior_num = 6 and boudoir > 0:
	$place = 'boudoir_lux'
elseif interior_num = 6 and boudoir = 0:
	interior_num += 1
end
if interior_num = 7: $place = 'home_lux'

change_interior = 0

--- interior_change ---------------------------------


code:
# interior_restore
!Interior Restore - created by crushboss
!Restores the players saved interiors after a full database reload

ui_style = previous_ui_style
nsfw = previous_nsfw

$study = $previous_study
$bed = $previous_bed
if bath > 0: $bath = $previous_bath
if dungeon > 0: $dungeon = $previous_dungeon
if kitchen > 0: $kitchen = $previous_kitchen
if lab > 0: $lab = $previous_lab
if boudoir > 0: $boudoir = $previous_boudoir
if barn > 0: $barn = $previous_barn

!Estate Interiors

$bg['study'] = $interior_study[$study]
$bg['home_lux'] = $interior_study_large[$study]
$place_name['study'] = $estate_study_name[$estate]
$place_location['study'] = $estate_study_location[$estate]
$place_info['study'] = $interior_study_info[$study]

$bg['bedroom'] = $interior_bed[$bed]
$bg['bedroom_lux'] = $interior_bed_large[$bed]
$place_name['bedroom'] = $estate_bed_name[$estate]
$place_location['bedroom'] = $estate_bed_location[$estate]
$place_info['bedroom'] = $interior_bed_info[$bed]

if bath > 0:
	$bg['bathroom'] = $interior_bath[$bath]
	$bg['bathroom_lux'] = $interior_bath_large[$bath]
	$place_name['bathroom'] = $estate_bath_name[$estate]
	$place_location['bathroom'] = $estate_bath_location[$estate]
	$place_info['bathroom'] = $interior_bath_info[$bath]
end
if dungeon > 0:
	$bg['dungeon'] = $interior_dungeon[$dungeon]
	$bg['dungeon_lux'] = $interior_dungeon_large[$dungeon]
	$place_name['dungeon'] = $estate_dungeon_name[$estate]
	$place_location['dungeon'] = $estate_dungeon_location[$estate]
	$place_info['dungeon'] = $interior_dungeon_info[$dungeon]
end
if kitchen > 0:
	$bg['kitchen'] = $interior_kitchen[$kitchen]
	$bg['kitchen_lux'] = $interior_kitchen_large[$kitchen]
	$place_name['kitchen'] = $estate_kitchen_name[$estate]
	$place_location['kitchen'] = $estate_kitchen_location[$estate]
	$place_info['kitchen'] = $interior_kitchen_info[$kitchen]
end
if lab > 0:
	$bg['lab'] = $interior_lab[$lab]
	$bg['lab_lux'] = $interior_lab_large[$lab]
	$place_name['lab'] = $estate_lab_name[$estate]
	$place_location['lab'] = $estate_lab_location[$estate]
	$place_info['lab'] = $interior_lab_info[$lab]
end
if boudoir > 0:
	$bg['boudoir'] = $interior_boudoir[$boudoir]
	$bg['boudoir_lux'] = $interior_boudoir_large[$boudoir]
	$place_name['boudoir'] = $estate_boudoir_name[$estate]
	$place_location['boudoir'] = $estate_boudoir_location[$estate]
	$place_info['boudoir'] = $interior_boudoir_info[$boudoir]
end
if barn > 0:
	$bg['barn'] = $interior_barn
	$bg['barn_lux'] = $interior_barn_large
	$place_name['barn'] = $estate_barn_name[$estate]
	$place_location['barn'] = $estate_barn_location[$estate]
	$place_info['barn'] = $interior_barn_info[$barn]
end

killvar 'previous_ui_style'
killvar '$previous_study'
killvar '$previous_bed'
killvar '$previous_bath'
killvar '$previous_dungeon'
killvar '$previous_kitchen'
killvar '$previous_lab'
killvar '$previous_boudoir'

--- interior_restore ---------------------------------


code:
# interior_storage
!Interior Storage - created by crushboss
!Fixes bugs when restoring/reloading all the databases in the game

previous_ui_style = ui_style
previous_nsfw = nsfw

$previous_study = $study
$previous_bed = $bed
if bath > 0: $previous_bath = $bath
if dungeon > 0: $previous_dungeon = $dungeon
if kitchen > 0: $previous_kitchen = $kitchen
if lab > 0: $previous_lab = $lab
if boudoir > 0: $previous_boudoir = $boudoir
if barn > 0: $prvious_barn = $barn

--- interior_storage ---------------------------------


code:
# item_buy
!Screen for item purchasing
gs '_layout'

*p '
<img src="content\pic\bg\<<$bg[$place]>>.png">
'
if $bg_path ! '': *p '
<img src="content\pic\<<$bg_path>>.png">
'
*p '
<<$text[1]>>
'

if npc = 0:
	$info_bar = ''
	*p '

<<$place_name[$place]>>
<<$place_location[$place]>>
'
	*nl 'Information for consideration:
'
	*p '
<<$place_info[$place]>>
'
else
	$info_bar = ''
	if nsfw = 0 and $npc_image[$npc_id] ! '': *p '
<img src="content\pic\characters\<<$npc_image[$npc_id]>>.png">
'
	*p '

<<$npc_name[$npc_id]>>
<<$npc_status[$npc_id]>>
'
	*nl 'Information for consideration:
'
	*p '
<<$npc_attitude[npc_attitude[$npc_id]]>>'
	*nl '<<$npc_info[$npc_id]>>
'
end

*p '
<<$info_bar>>
'

!Commented out - doesn’t work here, must be placed in interaction_city_result for each $do_buy section - crushboss
!if sound_on = 1 and $play_sound[txt] ! '': play 'content\snd\<<$play_sound[txt]>>.wav', sound_volume
!if $play_sound[txt] ! '': $play_sound[txt] = ''

*p '

'
*p '

'

--- item_buy ---------------------------------


code:
# item_change
!change item in the selected slot
if is_home = 0 and $return_lock ! 'none':
	$return_lock = 'menu_form'
	dynamic $home_sounds &! before is_home = 1
	menu_form = 0
	is_home = 1
end

if slot < 20:

	if slot = 1:
	 	if $master_armor ! 'без_брони' and $master_armor ! '': dynamic '<<$master_armor>> += 1'
	 	$master_armor = $new_item

	elseif slot = 2:
	 	if $master_back_wpn ! 'безоружный' and $master_back_wpn ! '': dynamic '<<$master_back_wpn>> += 1'
	 	$master_back_wpn = $new_item

	elseif slot = 3:
	 	if $master_left_wpn ! 'безоружный' and $master_left_wpn ! '': dynamic '<<$master_left_wpn>> += 1'
	 	$master_left_wpn = $new_item

	elseif slot = 4:
	 	if $master_right_wpn ! 'безоружный' and $master_right_wpn ! '': dynamic '<<$master_right_wpn>> += 1'
	 	$master_right_wpn = $new_item

	elseif slot = 5:
	 	if $master_arm_wpn ! 'безоружный' and $master_arm_wpn ! '': dynamic '<<$master_arm_wpn>> += 1'
	 	$master_arm_wpn = $new_item

	elseif slot = 6:
	 	if $master_leg_wpn ! 'безоружный' and $master_leg_wpn ! '': dynamic '<<$master_leg_wpn>> += 1'
	 	$master_leg_wpn = $new_item

	elseif slot = 7:
	 	if $master_cloth ! '':
			dynamic $item_property_off[$master_cloth]
			dynamic '<<$master_cloth>> += 1'
		end
	 	$master_cloth = $new_item

	elseif slot = 8:
	 	if $master_head_gear ! '' and $master_head_gear ! 'none':
			dynamic $item_property_off[$master_head_gear]
			dynamic '<<$master_head_gear>> += 1'
		end
	 	$master_head_gear = $new_item

	elseif slot = 9:
	 	if $master_earring ! '' and $master_earring ! 'none':
			dynamic $item_property_off[$master_earring]
			dynamic '<<$master_earring>> += 1'
		end
	 	$master_earring = $new_item

	elseif slot = 10:
	 	if $master_amulet ! '' and $master_amulet ! 'none':
			dynamic $item_property_off[$master_amulet]
			dynamic '<<$master_amulet>> += 1'
		end
	 	$master_amulet = $new_item

	elseif slot = 11:
	 	if $master_ring ! '' and $master_ring ! 'none':
			dynamic $item_property_off[$master_ring]
			dynamic '<<$master_ring>> += 1'
		end
	 	$master_ring = $new_item
	end

	dynamic 'if val(<<$new_item>>) > 0: <<$new_item>> -= 1'
	if $item_property[$new_item] ! '': dynamic $item_property[$new_item]

	dynamic $show_item_description_and_image, $new_item

	if $return_lock ! 'none':
		$equip_choice = ''
		gs '$newloc'
		gt 'master_stat'
	end

elseif slot > 39:

	if slot = 40:
	 	if $assistant["armor"] ! 'без_брони' and $assistant["armor"] ! '': dynamic '<<$assistant["armor"]>> += 1'
	 	$assistant["armor"] = $new_item

	elseif slot = 41:
	 	if $assistant["back_wpn"] ! 'безоружный' and $assistant["back_wpn"] ! '': dynamic '<<$assistant["back_wpn"]>> += 1'
	 	$assistant["back_wpn"] = $new_item

	elseif slot = 42:
	 	if $assistant["left_wpn"] ! 'безоружный' and $assistant["left_wpn"] ! '': dynamic '<<$assistant["left_wpn"]>> += 1'
	 	$assistant["left_wpn"] = $new_item

	elseif slot = 43:
	 	if $assistant["right_wpn"] ! 'безоружный' and $assistant["right_wpn"] ! '': dynamic '<<$assistant["right_wpn"]>> += 1'
	 	$assistant["right_wpn"] = $new_item

	elseif slot = 44:
		if $assistant["cloth"] ! '' and $item_name[$assistant["cloth"]] ! '-' and $item_name[$assistant["cloth"]] ! 'Naked': assistant_inventory[$assistant["cloth"]] += 1
		assistant_inventory[$new_item] -= 1
		$assistant["cloth"] = $new_item

	elseif slot = 45:
		if $assistant["headband"] ! '' and $item_name[$assistant["headband"]] ! '-': assistant_inventory[$assistant["headband"]] += 1
		assistant_inventory[$new_item] -= 1
		$assistant["headband"] = $new_item

	elseif slot = 46:
		if $assistant["earrings"] ! '' and $item_name[$assistant["earrings"]] ! '-': assistant_inventory[$assistant["earrings"]] += 2
		assistant_inventory[$new_item] -= 2
		$assistant["earrings"] = $new_item

	elseif slot = 47:
		if $assistant["collar"] ! '' and $item_name[$assistant["collar"]] ! '-': assistant_inventory[$assistant["collar"]] += 1
		assistant_inventory[$new_item] -= 1
		$assistant["collar"] = $new_item

	elseif slot = 48:
		if $assistant["gloves"] ! '' and $item_name[$assistant["gloves"]] ! '-': assistant_inventory[$assistant["gloves"]] += 1
		assistant_inventory[$new_item] -= 1
		$assistant["gloves"] = $new_item

	elseif slot = 49:
		if $assistant["nipplerings"] ! '' and $item_name[$assistant["nipplerings"]] ! '-': assistant_inventory[$assistant["nipplerings"]] += 2
		assistant_inventory[$new_item] -= 2
		$assistant["nipplerings"] = $new_item

	elseif slot = 50:
		if $assistant["clitring"] ! '' and $item_name[$assistant["clitring"]] ! '-': assistant_inventory[$assistant["clitring"]] += 1
		assistant_inventory[$new_item] -= 1
		$assistant["clitring"] = $new_item

	elseif slot = 51:
		if $assistant["boots"] ! '' and $item_name[$assistant["boots"]] ! '-': assistant_inventory[$assistant["boots"]] += 1
		assistant_inventory[$new_item] -= 1
		$assistant["boots"] = $new_item

	elseif slot = 52:
		if $assistant["ring_left"] ! '' and $item_name[$assistant["ring_left"]] ! '-': assistant_inventory[$assistant["ring_left"]] += 1
		assistant_inventory[$new_item] -= 1
		$assistant["ring_left"] = $new_item

	elseif slot = 53:
		if $assistant["ring_right"] ! '' and $item_name[$assistant["ring_right"]] ! '-': assistant_inventory[$assistant["ring_right"]] += 1
		assistant_inventory[$new_item] -= 1
		$assistant["ring_right"] = $new_item

	elseif slot = 54:
		if $assistant["navel"] ! '' and $item_name[$assistant["navel"]] ! '-': assistant_inventory[$assistant["navel"]] += 1
		assistant_inventory[$new_item] -= 1
		$assistant["navel"] = $new_item

	elseif slot = 55:
		if $assistant["tongue"] ! '' and $item_name[$assistant["tongue"]] ! '-': assistant_inventory[$assistant["tongue"]] += 1
		assistant_inventory[$new_item] -= 1
		$assistant["tongue"] = $new_item
	end

	if assistant_inventory[$new_item] < 0 and inventory[$new_item] > 0:
		assistant_inventory[$new_item] = 0
		inventory[$new_item] -= 1
	else
		dynamic 'if val(<<$new_item>>) > 0: <<$new_item>> -= 1'
	end

	dynamic $show_item_description_and_image, $new_item

	if $return_lock ! 'none':
		$equip_choice = ''
		gs '$newloc'
		gt 'assistant_stat'
	end

else

	if slot = 20:
	 	if $slave["armor"] ! 'без_брони' and $slave["armor"] ! '': dynamic '<<$slave["armor"]>> += 1'
	 	$slave["armor"] = $new_item

	elseif slot = 21:
	 	if $slave["back_wpn"] ! 'безоружный' and $slave["back_wpn"] ! '': dynamic '<<$slave["back_wpn"]>> += 1'
	 	$slave["back_wpn"] = $new_item

	elseif slot = 22:
	 	if $slave["left_wpn"] ! 'безоружный' and $slave["left_wpn"] ! '': dynamic '<<$slave["left_wpn"]>> += 1'
	 	$slave["left_wpn"] = $new_item

	elseif slot = 23:
	 	if $slave["right_wpn"] ! 'безоружный' and $slave["right_wpn"] ! '': dynamic '<<$slave["right_wpn"]>> += 1'
	 	$slave["right_wpn"] = $new_item

	elseif slot = 24:
		if $slave["cloth"] ! '' and $item_name[$slave["cloth"]] ! '-' and $item_name[$slave["cloth"]] ! 'Naked': slave_inventory[$slave["cloth"]] += 1
		slave_inventory[$new_item] -= 1
		$slave["cloth"] = $new_item

	elseif slot = 25:
		if $slave["headband"] ! '' and $item_name[$slave["headband"]] ! '-': slave_inventory[$slave["headband"]] += 1
		slave_inventory[$new_item] -= 1
		$slave["headband"] = $new_item

	elseif slot = 26:
		if $slave["earrings"] ! '' and $item_name[$slave["earrings"]] ! '-': slave_inventory[$slave["earrings"]] += 2
		slave_inventory[$new_item] -= 2
		$slave["earrings"] = $new_item

	elseif slot = 27:
		if $slave["collar"] ! '' and $item_name[$slave["collar"]] ! '-': slave_inventory[$slave["collar"]] += 1
		slave_inventory[$new_item] -= 1
		$slave["collar"] = $new_item

	elseif slot = 28:
		if $slave["gloves"] ! '' and $item_name[$slave["gloves"]] ! '-': slave_inventory[$slave["gloves"]] += 1
		slave_inventory[$new_item] -= 1
		$slave["gloves"] = $new_item

	elseif slot = 29:
		if $slave["nipplerings"] ! '' and $item_name[$slave["nipplerings"]] ! '-': slave_inventory[$slave["nipplerings"]] += 2
		slave_inventory[$new_item] -= 2
		$slave["nipplerings"] = $new_item

	elseif slot = 30:
		if $slave["clitring"] ! '' and $item_name[$slave["clitring"]] ! '-': slave_inventory[$slave["clitring"]] += 1
		slave_inventory[$new_item] -= 1
		$slave["clitring"] = $new_item

	elseif slot = 31:
		if $slave["boots"] ! '' and $item_name[$slave["boots"]] ! '-': slave_inventory[$slave["boots"]] += 1
		slave_inventory[$new_item] -= 1
		$slave["boots"] = $new_item

	elseif slot = 32:
		if $slave["ring_left"] ! '' and $item_name[$slave["ring_left"]] ! '-': slave_inventory[$slave["ring_left"]] += 1
		slave_inventory[$new_item] -= 1
		$slave["ring_left"] = $new_item

	elseif slot = 33:
		if $slave["ring_right"] ! '' and $item_name[$slave["ring_right"]] ! '-': slave_inventory[$slave["ring_right"]] += 1
		slave_inventory[$new_item] -= 1
		$slave["ring_right"] = $new_item

	elseif slot = 34:
		if $slave["navel"] ! '' and $item_name[$slave["navel"]] ! '-': slave_inventory[$slave["navel"]] += 1
		slave_inventory[$new_item] -= 1
		$slave["navel"] = $new_item

	elseif slot = 35:
		if $slave["tongue"] ! '' and $item_name[$slave["tongue"]] ! '-': slave_inventory[$slave["tongue"]] += 1
		slave_inventory[$new_item] -= 1
		$slave["tongue"] = $new_item
	end

	if slave_inventory[$new_item] < 0 and inventory[$new_item] > 0:
		slave_inventory[$new_item] = 0
		inventory[$new_item] -= 1
	else
		dynamic 'if val(<<$new_item>>) > 0: <<$new_item>> -= 1'
	end

	dynamic $show_item_description_and_image, $new_item

	if $return_lock ! 'none':
		$equip_choice = ''
	 	gs '$newloc'
	 	gt 'slave_stat'
	end
end

if $return_lock = 'none': $return_lock = 'menu_form' &! used when giving items as gifts

--- item_change ---------------------------------


code:
# main_layout
!layout for a main game screen
INTEGRATED_ACTIONS = 0
if ui_style = 1:$backimage = 'content/pic/ui/old/bg_main_old.png'
if ui_style = 2:$backimage = 'content/pic/ui/grimdark/bg_main.png'
if ui_style = 0:$backimage = 'content/pic/ui/classic/bg_main.png'

SHOWOBJS 0
SHOWSTAT 0
SHOWACTS 0

!$onnewloc = '$newloc'

LCOLOR = rgb(0,0,255)
FCOLOR = rgb(0,0,0)

$MAINDESC_BACKIMAGE = ''
! removed non-existent path 'content/.png' -ImperatorAugustus
MAINDESC_X = 1
MAINDESC_Y = 1
MAINDESC_W = 1280
MAINDESC_H = 800

$STATDESC_BACKIMAGE = ''
! removed non-existent path 'content/.png' -ImperatorAugustus
STATDESC_X = 810
STATDESC_Y = 1
STATDESC_W = 450
STATDESC_H = 800
--- main_layout ---------------------------------


code:
# main_menu
!Main Start menu of the game
!Overhauled by crushboss
!Revised by ImperatorAugustus

if warning_pass = 0: gt 'warning' &! before start_refresh

!AddOn - changed text output to reflect version number

!The line breaks here are used to vertically position the menu buttons
'

'
$text_display = ''
func('$menu', '===BEGIN===', 'mainmenu')
func('$menu', 'exec_options', $menu_item_Tutorial, 'gt "demo_intro"', 'Tutorial')
func('$menu', 'exec_options', $menu_item_Storyselect, 'gt "hero_customization"', 'Normal Start')
func('$menu', 'exec_options', $menu_item_Storycreate, 'gs "init_custom_game" & gt "hero_creation"', 'Custom Start')
func('$menu', 'exec_options', $menu_item_Controls, 'gt "controls"', 'Controls')
func('$menu', 'exec_options', $menu_item_Aboutfix, 'gt "development"', 'Development')
func('$menu', 'exec_options', $menu_item_Credits, 'gt "credits"', 'Credits')
func('$menu', '===END===')
*p '
<<$text_display>>
'

!CLOSE ALL

gs 'start_refresh' &! ERASES ALL VARIABLES IN THE GAME, MUST BE DONE AFTER MENU DISPLAY ABOVE FOR CORRECT RENDERING

!AddOn - Initialisation
$title_fix = 'Jack-o-nine-tails v2.2 Dev Version'
$game_ver = $title_fix

gs '$addon_custom_data'
gs 'refresh_database'
gs 'init_game'

if sound_on = 1 and warning_pass = 1:
	play 'content/snd/mainscreen.wav', music_volume, 'only, loop'
else
	close 'content/snd/mainscreen.wav'
end

a = rand(1,3)
if a = 1: $backimage = 'content/pic/title.png'
if a = 2: $backimage = 'content/pic/title10.png'
if a = 3: $backimage = 'content/pic/title17.png'

MAINDESC_X = 1
MAINDESC_Y = 1
MAINDESC_W = 1280
MAINDESC_H = 800

--- main_menu ---------------------------------


code:
# main_screen
!main_screen, at home
dynamic $home_sounds

gs 'main_layout'
presets_list = 0
$info_text = '' &! reset stats screens bottom text
$prisoner_info_text = '' &! reset prison bottom text
$cow_info_text = '' &! reset barn screen bottom text

*p '
<img src="content\pic\bg\<<$bg[$place]>>.png">
'
*p '
<<$text_display>>
'

if wizard_mode = 1:
	*p '

Day: <<day>> (<<sparks>>$) | Contract: <<contract["time"]>> days. |  Cal: <<slave["calories"]>>  |  Fr: <<slave["fear"]>>/<<slave_rate["fear"]>>  |  Ins: <<slave["instinct"]>>/<<slave_rate["instinct"]>>  |  Rat: <<slave["rational"]>>/<<slave_rate["rational"]>>  |  Cus: <<slave["custom"]>>/<<slave_rate["custom"]>>  |  Mor: <<slave["moral"]>>/<<slave_rate["moral"]>>  |  Spl: <<slave["spoil"]>>/<<slave_rate["spoil"]>>  |  Ang: <<slave["angst"]>>/<<slave_rate["angst"]>>

'
else
	$shedule_warn = ''
	if exam_in_progress = 0:
		if ride_count = 0:    $shedule_warn += '!'
		if auction_count = 0: $shedule_warn += '!'
		if gladi_count = 0:   $shedule_warn += '!'
	end
	if exam_in_progress = 1:
		$upper_info_bar = 'Day: <<day>> (<<sparks>>$)'
	else
		$upper_info_bar = 'Day: <<day>> (<<sparks>>$)'
	end
	if debt > 0: $upper_info_bar += ' | Debt: <<debt>>$ (<<debt_count>> days)'
	if contract['time'] > 0: $upper_info_bar += ' | Contract: <<contract["time"]>> days'
	if slave_state > CONST_INT['no_slave']: $upper_info_bar += ' | '
	*p '

<<$shedule_warn>> <<$upper_info_bar>>
'
	if slave_state > CONST_INT['no_slave']:
		if difficulty_setting = 2 or slave['diet_portion'] ! 4:
			*p '

'
			$upper_info_bar = ' <<IIF(slave["calories"] > 0, "+", "")>><<slave["calories"]*100>> cal | '
			*p '
<<$upper_info_bar>>
'
		end

		if header_clothing = 0:
			if $item_name[$slave["cloth"]] ! '-' and $item_name[$slave["cloth"]] ! 'Naked':
				$upper_info_bar = '<div style="display:inline-block;position:relative;" class="tooltip-bottom" tooltip-data="<<$item_name[$slave["cloth"]]>>"> <img src ="content\pic\ui overhaul\clothing bar small\<<$slave["cloth"]>>.png">
'
			else
				if slave['age'] = CONST_INT['young_age']:
					$upper_info_bar = '

'
				elseif slave['age'] = CONST_INT['loli_age']:
					$upper_info_bar = '

'
				else
					$upper_info_bar = '

'
				end
			end

			if $item_name[$slave["headband"]] ! '' and $item_name[$slave["headband"]] ! '-':
				$upper_info_bar += '<div style="display:inline-block;position:relative;" class="tooltip-bottom" tooltip-data="<<$item_name[$slave["headband"]]>>"> <img src ="content\pic\ui overhaul\clothing bar small\<<$slave["headband"]>>.png">
'
			else
				$upper_info_bar += '

'
			end

			if $item_name[$slave["earrings"]] ! '' and $item_name[$slave["earrings"]] ! '-':
				$upper_info_bar += '<div style="display:inline-block;position:relative;" class="tooltip-bottom" tooltip-data="<<$item_name[$slave["earrings"]]>>"> <img src ="content\pic\ui overhaul\clothing bar small\<<$slave["earrings"]>>.png">
'
			else
				$upper_info_bar += '

'
			end

			if $item_name[$slave["collar"]] ! '' and $item_name[$slave["collar"]] ! '-':
				$upper_info_bar += '<div style="display:inline-block;position:relative;" class="tooltip-bottom" tooltip-data="<<$item_name[$slave["collar"]]>>"> <img src ="content\pic\ui overhaul\clothing bar small\<<$slave["collar"]>>.png">
'
			else
				$upper_info_bar += '

'
			end

			if $item_name[$slave["gloves"]] ! '' and $item_name[$slave["gloves"]] ! '-':
				$upper_info_bar += '<div style="display:inline-block;position:relative;" class="tooltip-bottom" tooltip-data="<<$item_name[$slave["gloves"]]>>"> <img src ="content\pic\ui overhaul\clothing bar small\<<$slave["gloves"]>>.png">
'
			else
				$upper_info_bar += '

'
			end

			if $item_name[$slave["boots"]] ! '' and $item_name[$slave["boots"]] ! '-':
				$upper_info_bar += '<div style="display:inline-block;position:relative;" class="tooltip-bottom" tooltip-data="<<$item_name[$slave["boots"]]>>"> <img src ="content\pic\ui overhaul\clothing bar small\<<$slave["boots"]>>.png">
'
			else
				$upper_info_bar += '

'
			end

			$upper_info_bar += ' '
		else
			if $item_name[$slave["armor"]] ! 'Without armor' and $item_name[$slave["armor"]] ! '-':
				$upper_info_bar = '<div style="display:inline-block;position:relative;" class="tooltip-bottom" tooltip-data="<<$item_name[$slave["armor"]]>>"> <img src ="content\pic\ui overhaul\clothing bar small\<<$slave["armor"]>>.png">
'
			else
				$upper_info_bar = '

'
			end

			if $item_name[$slave["left_wpn"]] ! '' and $item_name[$slave["left_wpn"]] ! '-' and $item_name[$slave["left_wpn"]] ! 'Fist':
				$upper_info_bar += '<div style="display:inline-block;position:relative;" class="tooltip-bottom" tooltip-data="<<$item_name[$slave["left_wpn"]]>>"> <img src ="content\pic\ui overhaul\clothing bar small\<<$slave["left_wpn"]>>.png">
'
			else
				$upper_info_bar += '

'
			end

			if $item_name[$slave["right_wpn"]] ! '' and $item_name[$slave["right_wpn"]] ! '-' and $item_name[$slave["right_wpn"]] ! 'Fist':
				$upper_info_bar += '<div style="display:inline-block;position:relative;" class="tooltip-bottom" tooltip-data="<<$item_name[$slave["right_wpn"]]>>"> <img src ="content\pic\ui overhaul\clothing bar small\<<$slave["right_wpn"]>>.png">
'
			else
				$upper_info_bar += '

'
			end

			if $item_name[$slave["back_wpn"]] ! '' and $item_name[$slave["back_wpn"]] ! '-':
				$upper_info_bar += '<div style="display:inline-block;position:relative;" class="tooltip-bottom" tooltip-data="<<$item_name[$slave["back_wpn"]]>>"> <img src ="content\pic\ui overhaul\clothing bar small\<<$slave["back_wpn"]>>.png">
'
			else
				$upper_info_bar += '

'
			end

			$upper_info_bar += ' '
		end
		*p '
<<$upper_info_bar>>
'
	end
	*p '
'
end

!schedule
if ride_count > 2: $rideday = 'in <<ride_count>> days.'
if ride_count = 2: $rideday = 'the day after tomorrow.'
if ride_count = 1: $rideday = 'tomorrow.'
if ride_count = 0: $rideday = 'today!'
if auction_count > 2: $auctionday = 'in <<auction_count>> days.'
if auction_count = 2: $auctionday = 'the day after tomorrow.'
if auction_count = 1: $auctionday = 'tomorrow.'
if auction_count = 0: $auctionday = 'today!'
if gladi_count > 2: $gladiday = 'in <<gladi_count>> days.'
if gladi_count = 2: $gladiday = 'the day after tomorrow.'
if gladi_count = 1: $gladiday = 'tomorrow.'
if gladi_count = 0: $gladiday = 'today!'

$shedule = 'Events schedule
' + _
'- Ponygirl race <<$rideday>>
' + _
'- Arena fights <<$gladiday>>
' + _
'- Guild auction <<$auctionday>>'
!added
 line breaks to schedule text - ImperatorAugustus

!option icon
if exam_in_progress = 1:
	*p '

'
else
	*p '

'
	if slave_state = CONST_INT['slave_exist'] and cheat_show = 1:
		*p '

'
	end
	!*p '

'
end
!console button, only in developer versions
if instr($title_fix, 'Dev') ! 0: *p '

'

if sound_on = 1:
	*p '
<img src="content\pic\<<IIF(ui_style = 2, ''ui\grimdark\buttons\sound_on.png'', ''buttons\sound_on.png'')>>">
'
else
	*p '
<img src="content\pic\<<IIF(ui_style = 2, ''ui\grimdark\buttons\sound_off.png'', ''buttons\sound_off.png'')>>">
'
end

!sound option
if menu_form = 2000:
	if exam_in_progress = 1:
		*p '

'
		*p '

MUSIC:		<<music_volume>>%
'
		*nl '
SOUND:		<<sound_volume>>%

'
	else
		*p '

'
		*p '

MUSIC:		<<music_volume>>%
'
		*nl '
SOUND:		<<sound_volume>>%

'
	end
end

act '1':
	music_volume -= 10
	if music_volume < 0: music_volume = 0
	gt $curloc
end

act '2':
	music_volume += 10
	if music_volume > 100: music_volume = 100
	gt $curloc
end

act '3':
	if music_volume ! 0:
		rem_music_volume = music_volume
		music_off = 1
		music_volume = 0
	else
		music_volume = rem_music_volume
		music_off = 0
	end
	gt $curloc
end

act '4':
	sound_volume  -= 10
	if sound_volume < 0: sound_volume = 0
	gt $curloc
end

act '5':
	sound_volume += 10
	if sound_volume > 100: sound_volume = 100
	gt $curloc
end

act '6':
	if sound_volume ! 0:
		rem_sound_volume =  sound_volume
		sound_off = 1
		sound_volume = 0
	else
		sound_volume = rem_sound_volume
		sound_off = 0
	end
	gt $curloc
end

!Trophy Room feature - created by crushboss (relocated for readability -ImperatorAugustus)
if exam_in_progress = 0:
	*p '

'
end

!button for fast travel to cryo facility (relocated for readability, and use $transport_energy_drop instead of $master_energy_drop -ImperatorAugustus)
if stasis_tank = 1:
	*p '
<img src="content\pic\<<IIF(ui_style = 2, ''ui\grimdark\buttons\cryobutton.png'', ''buttons\cryobutton.png'')>>">
'
end

!showing spell state
$active_spell = ''
if auspex = 1: $active_spell += ' AUSP
'
if magna_magnifika > 0: $active_spell += ' MAGN
'
if slave['domini_dictum'] = 1: $active_spell += ' DOMI
'
if slave['sententia_veritas'] > 0: $active_spell += ' SENT
'
$active_spell += ''
*p '
<<$active_spell>>
'

!ImperatorAugustus: consolidated master avatar and status display, sync with city_screen
*p '
<img src = "<<$master_ava>>">
'
*p '
Energy <<$master_energy_stars>>'
	$tooltip_text = func('$addon', 'no_rate_full_grade_tooltip_text', 'mood', master_mood, 1)
	*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href="EXEC: master_stat_screen = 3 & gt ''master_stat''"><<$mood[master_mood_plus]>>'
	$tooltip_text = func('$addon', 'no_rate_full_grade_tooltip_text', 'master_excitement', master_excitement, 1)
	*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href = "EXEC: msg $excitement_chart"><<$excitement[master_excitement_plus]>>'
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'hygiene', master_hygiene, -1)
	*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href = "EXEC: msg $hygiene_chart"><<$personal_hygiene[master_hygiene]>>'
*p '
'

!ImperatorAugustus: consolidated assistant avatar and status display, moved energy to top, added : to fiend status
if assistant_state = CONST_INT['slave_exist']:
	*p '
<img src = "<<$assistant[''ava_clear'']>>.png">
'
	*p '
Energy <<$assistant_energy_stars>>'
elseif assistant_state = CONST_INT['no_slave']:
	*p '

'
	*p '
No assistant'
elseif assistant_state = CONST_INT['slave_faint']:
	*p '
<img src = "<<$assistant["ava"]>>.png">
'
	*p '
Unconscious'
elseif assistant_state = CONST_INT['slave_dead']:
	*p '
<img src = "<<$assistant["ava_gray"]>>.png">
'
	*p '
Dead'
end
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'house_mess', house_mess, -1)
	*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href = "EXEC: msg $house_mess_chart"><<$house_mess[house_mess]>>'
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'cooked_food', cooked_food_plus, 1)
	*nl '<div style="display:inline-block;position:relative;" class="tooltip-left" tooltip-data="<<$tooltip_text>>"><<$cooked_food[cooked_food_plus]>>
'
	if pet_tentacle = 0:
		*nl '<<$tentacle_state[tentacle_state]>>'
	else
		*nl '<<$tentacle_name[tentacle_size]>>: <<$tentacle_state[tentacle_state]>>'
	end
*p '
'

if cooked_food < 1 and kitchen > 0:
	if slave_state = CONST_INT['slave_exist'] and slave['cooks_rule'] = 1:
		*p '
<a class="tooltip-left-small-button" tooltip-data="<<$slave_name>>, prepare dinner" href = "EXEC: interaction = menu_dinner_S & gt ''interaction''">
'
	elseif assistant_state = CONST_INT['slave_exist'] and assistant['cooks_rule'] = 1:
		*p '
<a class="tooltip-left-small-button" tooltip-data="<<$assistant_name>>, prepare dinner" href = "EXEC: interaction = 43 & gt ''interaction''">
'
	else
		*p '

'
	end
	!fixed state checks: a fainted or dead assistant cannot cook - ImperatorAugustus
end

!fast button for fiend
if tentacle_state = 1:
	if slave_state = CONST_INT['slave_exist'] and slave['tentacle_rule'] = 1:
		*p '
<a class="tooltip-left-small-button" tooltip-data="<<$slave_name>>, milk the fiend" href = "EXEC: interaction = 59 & gt ''interaction''">
'
	elseif assistant_state = CONST_INT['slave_exist']:
		*p '
<a class="tooltip-left-small-button" tooltip-data="<<$assistant_name>>, milk the fiend" href = "EXEC: interaction = 45 & gt ''interaction''">
'
	end
end

!fast button for cleaning
if house_mess > 1:
	if slave_state = CONST_INT['slave_exist'] and slave['cleans_rule'] = 1:
		*p '
<a class="tooltip-left-small-button" tooltip-data="<<$slave_name>>, clean the house" href = "EXEC: interaction = menu_tidy_S & gt ''interaction''">
'
	elseif assistant_state = CONST_INT['slave_exist'] and assistant['cleans_rule'] = 1:
		*p '
<a class="tooltip-left-small-button" tooltip-data="<<$assistant_name>>, clean the house" href = "EXEC: interaction = 42 & gt ''interaction''">
'
	else
		*p '

'
	end
	!fixed state checks: a fainted or dead assistant cannot clean - ImperatorAugustus
end

!ImperatorAugustus: consolidated slave avatar and status display, sync with city_screen
if slave_state = CONST_INT['slave_exist']:
	*p '
<img src = "<<$slave[''ava_clear'']>>.png">
'
	*p '
Energy <<$slave_energy_stars>>'
		$tooltip_text = func('$addon', 'no_rate_full_grade_tooltip_text', 'mood', slave['mood'], 1)
		*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $mood_chart"><<$mood[slave_mood_plus]>>'
		if slave['virtue'] > 0 and slave['sin'] > 0:
			$tooltip_text = '<<$slave_name>> feels both guilty and meritorious'
		elseif slave['virtue'] > 0:
			$tooltip_text = '<<$slave_name>> feels meritorious'
		elseif slave['sin'] > 0:
			$tooltip_text = '<<$slave_name>> feels guilty'
		else
			$tooltip_text = '<<$slave_name>> feels neither guilty nor meritorious'
		end
		*nl '<div style="display:inline-block;position:relative;" class="tooltip-left" tooltip-data="<<$tooltip_text>>"><<$behavior_evaluation[eval]>>
'
		$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'hygiene', slave['hygiene'], -1)
		*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href = "EXEC: msg $hygiene_chart"><<$personal_hygiene[slave["hygiene"]]>>'
	*p '
'

	if exam_in_progress = 1:
		*p  '

'
		*p  '

'
	else
		*p  '

'
		*p  '

'
	end
elseif slave_state = CONST_INT['no_slave']:
! *p '

'
	*p '

'
	*p '
No slave
'
elseif slave_state = CONST_INT['slave_faint']:
	*p '
<img src = "<<$slave[''ava'']>>.png">
'
	*p '
Unconscious
'
elseif slave_state = CONST_INT['slave_dead']:
	*p '
<img src = "<<$slave[''ava_gray'']>>.png">
'
	*p '
Dead
'
end

!Debug Info Screen feature - created by crushboss
!if exam_in_progress = 0:
!	if $master_head_gear = 'raven_crown':
!		if slave_state = CONST_INT['slave_exist']:
!			*p '

'
!		end
!		if assistant_state = CONST_INT['slave_exist']:
!			*p '

'
!		end
!	end
!end

if (exam_in_progress = 1 or ($master_head_gear = 'raven_crown' and instr($title_fix, 'Dev') ! 0)) and slave_state = CONST_INT['slave_exist']:
	*p '

'
end

if slave_state = CONST_INT['slave_exist']:
	if exam_in_progress = 1:
		if slave['virtue'] > 0: *p '

'
		if slave['sin'] > 0: *p '

'
		if slave['sin'] = 0 and slave['virtue'] = 0:
			*p '

'
			*p '

'
		end
	else
		if slave['virtue'] > 0: *p '

'
		if slave['sin'] > 0: *p '

'
		if slave['sin'] = 0 and slave['virtue'] = 0:
			*p '

'
			*p '

'
		end
	end
end

!Bathe radio buttons - overhauled by crushboss, and again by i107760 and again by ImperatorAugustus
if bath > 0:
	!fast wash button for master - slave bathes master, assistant bathes master, or master bathes alone
	if master_hygiene > 0:
		if slave_state = CONST_INT['slave_exist'] and slave['washes_master_rule'] = 1:
			*p '

'
		elseif assistant_state = CONST_INT['slave_exist'] and assistant['washes_master_rule'] = 1:
			*p '

'
		else
			*p '

'
		end
	end
	!fast wash button for slave - assistant bathes slave, slave bathes master (only if master is dirty), or slave bathes alone
	if slave_state = CONST_INT['slave_exist'] and slave['hygiene'] > 0:
		if assistant_state = CONST_INT['slave_exist'] and assistant['washes_slave_rule'] = 1:
			*p '

'
		elseif master_hygiene > 0 and slave_state = CONST_INT['slave_exist'] and slave['washes_master_rule'] = 1:
			*p '

'
		else
			*p '

'
		end
	end
end

if master_excitement >= 0:
	if slave_state = CONST_INT['slave_exist']:
		if exam_in_progress = 1:
			*p '
<a class="tooltip-left-small-button" tooltip-data="Fuck <<$slave_name>>!" href = "EXEC: menu_form = 16 & gt ''demo_menu_form''">
'
		else
			*p '
<a class="tooltip-left-small-button" tooltip-data="Fuck <<$slave_name>>!" href = "EXEC: menu_form = 16 & gt ''menu_form''">
'
		end
	end
	if assistant_state = CONST_INT['slave_exist']:
		*p '
<a class="tooltip-left-small-button" tooltip-data="Fuck <<$assistant_name>>!" href = "EXEC: menu_form = 4 & gt ''menu_form''">
'
	end
end

!exchange button for the slave and assistant (slave must be devoted or slave slot must be empty while there is an assistant)
if exam_in_progress = 0:
	if slave_state = CONST_INT['slave_exist'] and slave['moral'] >= 3:
		*p  '

'
	elseif slave_state = CONST_INT['no_slave'] and assistant_state ! CONST_INT['no_slave']:
		*p  '

'
	end
end

!Change rooms in apartment - crushboss
if exam_in_progress = 0:
	*p  '

'
	!bug fix: added missing closing  tag - ImperatorAugustus
end

!fast buttons for milking - Pianocat
if slave_state = CONST_INT['slave_exist'] and slave['lactation'] > 0:
	if slave['milk_summ'] >= 10:
		*p '

'
	elseif slave['milk_summ'] < 10:
		*p '
<a class="tooltip-left-down" tooltip-data="Not enough milk"
'
	end
end
if assistant_state = CONST_INT['slave_exist'] and assistant['lactation'] > 0 and assistant['milk_summ'] >= 10:
	*p '

'
end
if cow_state = CONST_INT['slave_exist']:
	*p '

'
	if cow['milk_summ'] >= 10:
		*p '

'
	end
end

!options
*p '
<<$setting_display>>
'
*p '
<<$setting_display_c>>
'
*p '
<<$setting_display_c2>>
'
*p '
<<$setting_display_r>>
'

!buttons/icons disabled in option menu
if menu_form < 2000:
	if exam_in_progress = 0:
		if ride_count = 0:
			*p '

'
		else
			*p '
<a class="tooltip-left-down" tooltip-data="The race will begin in <<ride_count>> days">
'
		end
		if gladi_count = 0:
			*p '

'
		else
			*p '
<a class="tooltip-left-down" tooltip-data="Fights in the Colosseum will start in <<gladi_count>> days">
'
		end
		if auction_count > 0:
			*p '
<a class="tooltip-left-down" tooltip-data="The Guild auction of branded slaves is in <<auction_count>> day<<IIF(auction_count > 1, {s}, {})>>">
'
		elseif slave_state ! CONST_INT['no_slave']:
			if slave['brand'] = 0:
				*p '

'
			else
				*p '

'
			end
		end
	end
	if dungeon > 0:
		!ImperatorAugustus: show clear avatar image for awake prisoner, regular avatar for fainted prisoner (was used for all except no_slave), gray avatar for dead prisoner
		if prisoner_state = CONST_INT['no_slave']:
			*p '

'
		elseif prisoner_state = CONST_INT['slave_exist']:
			*p '
<img src = "<<$prisoner["ava_clear"]>>.png">
'
		elseif prisoner_state = CONST_INT['slave_faint']:
			*p '
<img src = "<<$prisoner["ava"]>>.png">
'
		elseif prisoner_state = CONST_INT['slave_dead']:
			*p '
<img src = "<<$prisoner["ava_gray"]>>.png">
'
		end
		*p '

'
	end

	if barn > 0:
		!ImperatorAugustus: consolidated cow avatar display, show clear avatar for awake cow, fix states (dead state was showing regular avatar image instead of gray image)
		if cow_state = CONST_INT['no_slave']:
			*p '

'
		elseif cow_state = CONST_INT['slave_exist']:
			*p '
<img src = "<<$cow["ava_clear"]>>.png">
'
		elseif cow_state = CONST_INT['slave_faint']:
			*p '
<img src = "<<$cow["ava"]>>.png">
'
		elseif cow_state = CONST_INT['slave_dead']:
			*p '
<img src = "<<$cow["ava_gray"]>>.png">
'
		end
		*p '

'
	end

	if stasis_tank > 0:
		!Cryo Storage - new buttons on main menu feature - crushboss (converted to #dynamic - ImperatorAugustus)
		dynamic $do_for_each_slave_in_list, '$show_main_screen_cryo_cell_button', '$iced_slave_characters'
		!Cryo Storage - selected cell - crushboss (converted to #dynamic - ImperatorAugustus)
		if cryo_cell_selected ! 0: dynamic $show_main_screen_selected_cryo_cell_avatar
	end

	if slave_state = CONST_INT['slave_exist']:
		*p '
<img src="content\pic\<<IIF(ui_style = 2, ''ui\grimdark\buttons\teach.png'', ''buttons\teach.png'')>>">
'
		if assistant_state = CONST_INT['slave_exist']:
			if sparks >= coach_price[0]: *p '
<a class="tooltip-bottom" tooltip-data="Invite a tutor for <<$slave_name>>" href = "EXEC: teach_stat_screen = 1 & gt ''teach_screen''"><img src="content\pic\<<IIF(ui_style = 2, ''ui\grimdark\buttons\teach_r.png'', ''buttons\teach_r.png'')>>">
'
			if sparks >= school_price[0]: *p '
<a class="tooltip-bottom" tooltip-data="<<$slave_name>>, attend classes..." href = "EXEC: teach_stat_screen = 2 & gt ''teach_screen''"><img src="content\pic\<<IIF(ui_style = 2, ''ui\grimdark\buttons\teach_s.png'', ''buttons\teach_s.png'')>>">
'
			*p '
<a class="tooltip-bottom" tooltip-data="<<$assistant_name>>, conduct a lesson" href = "EXEC: teach_stat_screen = 3 & gt ''teach_screen''"><img src="content\pic\<<IIF(ui_style = 2, ''ui\grimdark\buttons\teach_a.png'', ''buttons\teach_a.png'')>>">
'
		else
			if sparks >= coach_price[0]: *p '
<a class="tooltip-bottom" tooltip-data="Invite a tutor for <<$slave_name>>" href = "EXEC: teach_stat_screen = 1 & gt ''teach_screen''"><img src="content\pic\<<IIF(ui_style = 2, ''ui\grimdark\buttons\teach_r.png'', ''buttons\teach_r.png'')>>">
'
			if sparks >= school_price[0] and exam_in_progress ! 1: *p '
<a class="tooltip-bottom" tooltip-data="<<$slave_name>>, attend classes..." href = "EXEC: teach_stat_screen = 2 & gt ''teach_screen''"><img src="content\pic\<<IIF(ui_style = 2, ''ui\grimdark\buttons\teach_s.png'', ''buttons\teach_s.png'')>>">
'
		end
	end

	if lab > 0 and (slave_state = CONST_INT['slave_exist'] or assistant_state = CONST_INT['slave_exist']):
		if assistant['alchemist_rule'] = 1:
			$rule_subject = '<<$assistant_name>>'
		else
			$rule_subject = '<<$slave_name>>'
		end
		*p '
<a class="wide tooltip-left-large" tooltip-data="<<$rule_subject>>, brew a potion..." href = "EXEC: interaction = 21 & gt ''interaction''"><img src="content\pic\<<IIF(ui_style = 2, ''ui\grimdark\buttons\lab.png'', ''buttons\lab.png'')>>">
'
	end
end

if menu_form ! 2000 and menu_form ! 2020 and menu_form ! 2022 and exam_in_progress = 0 and menu_form ! 2100 and menu_form ! 2101 and menu_form ! 2102 and menu_form ! 2103 and menu_form ! 2104 and menu_form ! 2105 and menu_form ! 2110:
	if sound_on = 1:
		*p '

'
	else
		*p '

'
	end
end

!for decade count
if decadecount >= 10:
	gs 'billing'
	msg '<<$bill_message>>'
	barn_report_available = 0
	if barn_report_food_cost > 0:
		msg '<<$barn_accounts>>'
		barn_report_available = 1
	end
	if assistant_quiet_rule = 1 and decade_eggs +  decade_milk + decade_semen + decade_cream > 0: msg $produce_msg

	decade_eggs = 0
	decade_milk = 0
	decade_cream = 0
	decade_semen = 0
	decade_consume = 0
	decade_mince = 0
	decade_meat = 0
	decade_virgin = 0

	!Refresh all databases - crushboss
	gs 'interior_storage'
	gs 'refresh_database'
	gs 'interior_restore'
	decadecount = 0
	decade += 1
	decadesave = 1
	if final_payment > sparks and exam_in_progress ! 1:
		dynamic $death, 'You are not able to pay the bills and have been expelled from the Guild of Trainers for inability to solve your financial problems.'
	else
		sparks -= final_payment
		sparks += barn_total_profit
	end
	gt 'menu_form' &! refresh menus and mood to reflect potential changes from billing
end

if search['active'] = 2:
	search['active'] = 3
	msg 'Gaudete, <<$master_name>>!
' + _
	'It seems I managed to find just such a slave as you ordered. I already bought her and put her in my stasis chamber. Prepare a place for her and come find me at the Guild when you are ready to take her.

' + _
	'				Sincerely, Skups.'
end

if sbros = 1:
	sbros = 0
	if exam_in_progress = 1:
		gt 'demo_menu_form'
	else
		gt 'menu_form'
	end
end

if slave['pregnant'] >= 150:
	interaction = 9911
	slave['pregnant'] = 0
	gt 'interaction'
end

if assistant['pregnant'] >= 150:
	interaction = 9912
	assistant['pregnant'] = 0
	gt 'interaction'
end

if prisoner['pregnant'] >= 150:
	interaction = 9913
	prisoner['pregnant'] = 0
	gt 'interaction'
end

!autosave
if autosave = 1:
	if autosave_day = 1:
		autosave = 0
		savegame 'save/auto_day.sav'
	end
end
if autosave_decade = 1:
	if decadesave = 1:
		decadesave = 0
		savegame 'save/auto_decade.sav'
	end
end

hunting_prize = 0

!Strec - jon_UIadds addition (begin)
!Added logic to fix the Travel buttons from displaying in the Game Options and other locations - crushboss (changed to menu_form < 2000 to exclude settings menus instead of a long list of not-checks - ImperatorAugustus)
if menu_form < 2000 and sex_num ! 100 and exam_in_progress = 0:
	$quick_move_action = "show"
else
	$quick_move_action = "none"
end

gs 'sjm_UI_UIadds'

!Strec - jon_UIadds addition (end)

!Debug code for tracking variables
!msg '<<slave_rate["stamina"]>>'

--- main_screen ---------------------------------


code:
# master_stat
gs '$newloc' &! ensure all stats are updated before displaying them
gs 'stats_layout'
gs '$furniture_list'

if slot = 0: $equip_choice = ''
slot = 0

buyers_list = 0

*p '
Storage
'
*p '
Objectives
'
*p '
Equipment
'
*p '
Diary
'

if exam_in_progress = 1:
 	*p '

'
elseif is_home = 1:
 	*p '

'
else
 	*p '

'
end

!Формируем список на обучение
$left_text_list = ''
$middle_text_list = ''
$right_text_list = ''

if kitchen > 0:
	$left_text_list += 'CRYOSTORE [<<fridge_items>>/<<estate_size[$estate]>>]:
' + _
	'Vegetables х<<fridge["vegetables"]>>
' + _
	'Flour and Grains х<<fridge["flower"]>>
' + _
	'Herbs and Spices х<<fridge["spice"]>>
' + _
	'Cheese and Butter х<<fridge["cheese"]>>
' + _
	'Alcohol х<<fridge["alcohol"]>>
' + _
	'Eggs х<<fridge["eggs"]>>
' + _
	'Milk х<<fridge["milk"]>>
' + _
	'Cream х<<fridge["cream"]>>
' + _
	'Chopped Meat х<<fridge["mince"]>>
' + _
	'Tenderloin х<<fridge["meat"]>>
' + _
	'Virgin Meat х<<fridge["virgin_meat"]>>
' + _
	'Spawn’s Semen x<<spawn_semen>>
'
end
if lab > 0:
	$middle_text_list += 'LABORATORY [<<lab_items>>/<<estate_size[$estate]>>]:
' + _
	'Fiend’s mucus х<<lab_store["slime"]>>
' + _
	'Elysian datura х<<lab_store["kanabis"]>>
' + _
	'Kamrian resin х<<lab_store["koffe"]>>
' + _
	'Faeries’ pollen х<<lab_store["meth"]>>
' + _
	'Essence of oblivion х<<lab_store["opium"]>>

' + _
	'Bacchic x<<вакхический_нектар>>
' + _
	'Tonic x<<тонизируюзщий_эликсир>>
' + _
	'Balm x<<целительный_бальзам>>
' + _
	'Aphrodisiac x<<афродизиак>>
' + _
	'Super-aphrodisiac x<<мощный_афодизиак>>
' + _
	'Philtre x<<приворотное_зелье>>
' + _
	'Water of Lethe x<<вода_леты>>
'
else
	$middle_text_list += 'SUBSTANCE:
' + _
	'Fiend’s mucus х<<lab_store["slime"]>>
' + _
	'Elysian datura х<<lab_store["kanabis"]>>
' + _
	'Kamrian resin х<<lab_store["koffe"]>>
' + _
	'Faeries’ pollen х<<lab_store["meth"]>>
' + _
	'Essence of oblivion х<<lab_store["opium"]>>

' + _
	'Bacchic x<<вакхический_нектар>>
' + _
	'Tonic x<<тонизируюзщий_эликсир>>
' + _
	'Balm x<<целительный_бальзам>>
' + _
	'Aphrodisiac x<<афродизиак>>
' + _
	'Super-aphrodisiac x<<мощный_афодизиак>>
' + _
	'Philtre x<<приворотное_зелье>>
' + _
	'Water of Lethe x<<вода_леты>>
'
end

$right_text_list += 'HOUSE [<<house_items>>/<<estate_size[$estate]>>]:
<<$furniture_list>>
'

!STORAGE TAB
if master_stat_screen = 0:
	*p '

'
	*p '

'
	*p '

'
	*p '

'
	if ui_style = 2:
		*p '

'
	else
		*p '

'
	end
	*p '
<<$left_text_list>>
'
	*p '
<<$middle_text_list>>
'
	*p '
<<$right_text_list>>
'
end

*p '
'
	*nl 'Slaver:  <<$master_name>>
'
	*nl 'CHARACTERISTICS '
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_str', master_str, 1)
	*nl '<a class="tooltip-right" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $strength_chart & $info_text = $strength_help & gt $curloc"><<$master_str[master_str]>>'
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_cha', master_cha, 1)
	*nl '<a class="tooltip-right" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $charisma_chart & $info_text = $charisma_help & gt $curloc"><<$master_cha[master_cha]>>'
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_style', master_style, 1)
	*nl '<a class="tooltip-right" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $allure_chart & $info_text = $allure_help & gt $curloc"><<$master_style[master_style]>>'
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_libido', master_libido, 1)
	*nl '<a class="tooltip-right" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $libido_chart & $info_text = $libido_help & gt $curloc"><<$master_libido[master_libido]>>'
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_domination', master_domination, 1)
	*nl '<a class="tooltip-right" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $dominance_chart & $info_text = $dominance_help & gt $curloc"><<$master_domination[master_domination]>>'
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'brand_reputation', brand_reputation, 1)
	*nl '<a class="tooltip-right" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $brand_chart & $info_text = $brand_help & gt $curloc"><<$brand[brand_reputation]>>'
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'guild_reputation', guild_reputation, 1)
	*nl '<a class="tooltip-right" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $guild_brand_chart & $info_text = $guild_brand_help & gt $curloc"><<$guild_brand[guild_reputation]>>'
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_wealth', master_wealth, 1)
	*nl '<a class="tooltip-right" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $wealth_chart & $info_text = $wealth_help & gt $curloc"><<$master_wealth[master_wealth]>>'
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'hygiene', master_hygiene, -1)
	*nl '<a class="tooltip-right" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $hygiene_chart & $info_text = $hygiene_help & gt $curloc"><<$personal_hygiene[master_hygiene]>>'
	$tooltip_text = func('$addon', 'no_rate_full_grade_tooltip_text', 'mood', master_mood, 1)
	*nl '<a class="tooltip-right" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $mood_chart & $info_text = $mood_help & gt $curloc"><<$mood[master_mood_plus]>>'
	$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_wounds', master_wounds, -1)
	*nl '<a class="tooltip-right" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $wounds_chart & $info_text = $wounds_help & gt $curloc"><<$wounds[master_wounds]>>'
*p '
'

*p '
'
*nl 'AUTO CASTING'
*nl '- Auspex'
*nl '- Magna Magnifika'
*nl '- Sententia Veritas'
*nl
*nl '- Hide Auto Casting
'

if auspex_auto_cast = 1:
	*p '

'
else
	*p '

'
end

if master_mage < 1:
	magna_magnifika_auto_cast = 0
	*p '

'
elseif magna_magnifika_auto_cast = 1:
	*p '

'
else
	*p '

'
end

if master_mage < 2:
	sententia_auto_cast = 0
	*p '

'
elseif sententia_auto_cast = 1:
	*p '

'
else
	*p '

'
end

if silent_auto_cast = 1:
	*p '

'
else
	*p '

'
end

*p '
'
*nl 'SKILLS'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_tutor', master_tutor)
*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $учитель_справка & $info_text = $учитель_совет & gt $curloc"><<$master_tutor[master_tutor]>>'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_butler', master_butler)
*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $дворецкий_справка & $info_text = $дворецкий_совет & gt $curloc"><<$master_butler[master_butler]>>'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_artdirector', master_artdirector)
*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $артдиректор_справка & $info_text = $артдиректор_совет & gt $curloc"><<$master_artdirector[master_artdirector]>>'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_medic', master_medic)
*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $медик_справка & $info_text = $медик_совет & gt $curloc"><<$master_medic[master_medic]>>'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_fighter', master_fighter)
*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $боец_справка & $info_text = $боец_совет & gt $curloc"><<$master_fighter[master_fighter]>>'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_mage', master_mage)
*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $маг_справка & $info_text = $маг_совет & gt $curloc"><<$master_mage[master_mage]>>'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_flagelation', master_flagelation)
*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $флагеляция_справка & $info_text = $флагеляция_совет & gt $curloc"><<$master_flagelation[master_flagelation]>>'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_torture', master_torture)
*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $палач_справка & $info_text = $палач_совет & gt $curloc"><<$master_torture[master_torture]>>'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_bondage', master_bondage)
*nl '<a class="tooltip-left" tooltip-data="<<$tooltip_text>>" href="EXEC: msg $бондаж_справка & $info_text = $бондаж_совет & gt $curloc"><<$master_bondage[master_bondage]>>
'
*nl 'SEX TECHNIQUES'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_petting', master_petting)
*nl '<div style="display:inline-block;position:relative;" class="tooltip-left" tooltip-data="<<$tooltip_text>>"><<$master_petting[master_petting]>>
'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_oral', master_oral)
*nl '<div style="display:inline-block;position:relative;" class="tooltip-left" tooltip-data="<<$tooltip_text>>"><<$master_oral[master_oral]>>
'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_penetration', master_penetration)
*nl '<div style="display:inline-block;position:relative;" class="tooltip-left" tooltip-data="<<$tooltip_text>>"><<$master_penetration[master_penetration]>>
'
$tooltip_text = func('$addon', 'no_rate_stat_tooltip_text', 'master_fetish', master_fetish)
*nl '<div style="display:inline-block;position:relative;" class="tooltip-left" tooltip-data="<<$tooltip_text>>"><<$master_fetish[master_fetish]>>

'

!OBJECTIVES TAB
if master_stat_screen = 1:
	gs '#quest_base' &! update dynamic quest status and text
	if city_already_done_today[menu_findcustomers]: gs '$appropriate_buyers_list'
	gs '$quest_list' &! update quest list for objectives tab
	*p '

'
	*p '

'
	*p '

'
	*p '

'
	if ui_style = 2:
		*p '

'
	else
		*p '

'
	end

	*p '

<<$quest_list>>
'
end

!EQUIP TAB
if master_stat_screen = 2:
	gs '$calculate_attributes' &! TODO: is this needed?
	*p '

'
	*p '

'
	*p '

'
	*p '

'
	if ui_style = 2:
		*p '

'
	else
		*p '

'
	end
	*p '
'
		*p 'MY EQUIPMENT'
		*p '
Armour: <<$item_name[$master_armor]>>
'
		*p '
Shoulder Holster: <<$item_name[$master_back_wpn]>>
'
		*p '
Left Hand: <<$item_name[$master_left_wpn]>>
'
		*p '
Right Hand: <<$item_name[$master_right_wpn]>>
'
		*p '
Sleeve Holster: <<$item_name[$master_arm_wpn]>>
'
		*p '
Boot Holster: <<$item_name[$master_leg_wpn]>>
'
		*p '
'
		*p '
Clothes: <<$item_name[$master_cloth]>>
'
		*p '
Headgear: <<$item_name[$master_head_gear]>>
'
		*p '
Earring: <<$item_name[$master_earring]>>
'
		*p '
Neck: <<$item_name[$master_amulet]>>
'
		*p '
Ring: <<$item_name[$master_ring]>>
'
	*p '
'
	*p '
AVAILABLE OPTIONS
<<$equip_choice>>
'
end

!DIARY TAB
if master_stat_screen = 3:
	*p '

'
	*p '

'
	*p '

'
	*p '

'
	if ui_style = 2:
		*p '

'
	else
		*p '

'
	end
	*p '

DAY <<day>>:
<<$master_mood_list>>
'
end

*p '
<<$info_text>>
'

if barn < 1 and milk_can = 1:
	*p '

'
	*p '

<<milk_stock>>
'
end

!Debug - Testing Variables - crushboss
!msg '<<модификатор_колющий>>
'
!msg '<<master_fighter_rate>>'
!msg '<<tentacle_hp>>'
!msg '<<master_supermacy>>'
!msg '<<brand_rate>>'
!if master_stat_screen = 3:
! 	msg 'Butler: <<master_butler>>
 Butler Rate: <<master_butler_rate>>
Art Director: <<master_artdirector>>
Art Director Rate: <<master_artdirector_rate>>
Mage: <<master_mage>>
Mage Rate: <<master_mage_rate>>
Medic: <<master_medic>>
Medic Rate: <<master_medic_rate>>
Fighter: <<master_fighter>>
Fighter Rate: <<master_fighter_rate>>
'
!end
!if master_stat_screen = 3: msg 'Master Supermacy: <<master_supermacy>>
'

--- master_stat ---------------------------------


code:
# master_stat_clients
!ИНФОРМАЦИЯ О КЛИЕНТАХ
gs '_layout'

!Подсчитываем количество записей для пролистывания
if $great_house = 'serpis':
	if npc_reveal['barman'] = 1:
		$npc[] = 'barman'
	end
	if npc_reveal['лао_ван'] = 1:
		$npc[] = 'лао_ван'
	end
end

if $great_house = 'taurus':
	if npc_reveal['madame_jofre'] = 1:
		$npc[] = 'madame_jofre'
	end
end

if $great_house = 'kamira':
	if npc_reveal['uncle_bo'] = 1:
		$npc[] = 'uncle_bo'
	end
end

if $great_house = 'korvus':
	if npc_reveal['poison'] = 1:
		$npc[] = 'poison'
	end
end

if $great_house = 'neutral':
	if npc_reveal['брина_рыжая'] = 1:
		$npc[] = 'брина_рыжая'
	end
	if npc_reveal['менхантер'] = 1:
		$npc[] = 'менхантер'
	end
	if npc_reveal['kagami_san'] = 1:
		$npc[] = 'kagami_san'
	end
	if npc_reveal['azura'] = 1:
		$npc[] = 'azura'
	end
	if npc_reveal['servilia_quinta'] = 1:
		$npc[] = 'servilia_quinta'
	end
	if npc_reveal['estelindel'] = 1:
		$npc[] = 'estelindel'
	end
	if npc_reveal['moneylender'] = 1:
		$npc[] = 'moneylender'
	end
end

$place = 'study'

if txt = 0: txt = 1
$text[txt] = ''
$npc_id = $npc[txt]

if no_slave_count[$npc_id] > 0:
	$client_status = 'Не покупает [<<no_slave_count[$npc_id]>>]'
	if train_slave_count[$npc_id] > 0: $client_status = 'Есть контракт на обучение [<<train_slave_count[$npc_id]>>]'
else
	$client_status = 'Заинтересован в приобретении рабыни!'
end

index = 1
$npc_demand_list_add = ''
killvar '$pre_list'
killvar 'stat_importance'
killvar 'demand'
demand['max_exotic'] = 99
demand['max_fat'] = 99
dynamic $buyer_demand[$npc_id]
dynamic $npc_preferences[$npc_id]

if stat_importance['sensitivity'] > 0: $pre_list[index] = "Утонченность: <<$rating[stat_importance['sensitivity']]>> / <<$rating[slave['sensitivity']]>>" & index += 1
if stat_importance['temper'] > 0: $pre_list[index] = "Темперамент: <<$rating[stat_importance['temper']]>> / <<$rating[slave['temper']]>>" & index += 1
if stat_importance['intellect'] > 0: $pre_list[index] = "Интеллект: <<$rating[stat_importance['intellect']]>> / <<$rating[slave['intellect']]>>" & index += 1
if stat_importance['ego'] > 0: $pre_list[index] = "Характер: <<$rating[stat_importance['ego']]>> / <<$rating[slave['ego']]>>" & index += 1

if stat_importance['expression'] > 0: $pre_list[index] = "Этикет: <<$rating[stat_importance['expression']]>> / <<$rating[slave['expression']]>>" & index += 1
if stat_importance['pet'] > 0: $pre_list[index] = "Питомец: <<$rating[stat_importance['pet']]>> / <<$rating[slave['pet']]>>" & index += 1
if stat_importance['dressage'] > 0: $pre_list[index] = "Выездка: <<$rating[stat_importance['dressage']]>> / <<$rating[slave['dressage']]>>" & index += 1
if stat_importance['nurse'] > 0: $pre_list[index] = "Медицина: <<$rating[stat_importance['nurse']]>> / <<$rating[slave['nurse']]>>" & index += 1
if stat_importance['service'] > 0: $pre_list[index] = "Уборка: <<$rating[stat_importance['service']]>> / <<$rating[slave['service']]>>" & index += 1
if stat_importance['cook'] > 0: $pre_list[index] = "Кулинария: <<$rating[stat_importance['cook']]>> / <<$rating[slave['cook']]>>" & index += 1
if stat_importance['gladiatrix'] > 0: $pre_list[index] = "Боевые искусства: <<$rating[stat_importance['gladiatrix']]>> / <<$rating[slave['gladiatrix']]>>" & index += 1
if stat_importance['alchemy'] > 0: $pre_list[index] = "Alchemy: <<$rating[stat_importance['alchemy']]>> / <<$rating[slave['alchemy']]>>" & index += 1
if stat_importance['enchanter'] > 0: $pre_list[index] = "Чародейство: <<$rating[stat_importance['enchanter']]>> / <<$rating[slave['enchanter']]>>" & index += 1
if stat_importance['calisthenics'] > 0: $pre_list[index] = "Грация: <<$rating[stat_importance['calisthenics']]>> / <<$rating[slave['calisthenics']]>>" & index += 1
if stat_importance['art'] > 0: $pre_list[index] = "Пение: <<$rating[stat_importance['art']]>> / <<$rating[slave['art']]>>" & index += 1
if stat_importance['cowSK'] > 0: $pre_list[index] = "Indolent: <<$rating[stat_importance['cowSK']]>> / <<$rating[slave['cowSK']]>>" & index += 1
if stat_importance['music'] > 0: $pre_list[index] = "Музыка: <<$rating[stat_importance['music']]>> / <<$rating[slave['music']]>>" & index += 1
if stat_importance['secretary'] > 0: $pre_list[index] = "Грамота: <<$rating[stat_importance['secretary']]>> / <<$rating[slave['secretary']]>>" & index += 1

if stat_importance['oral'] > 0: $pre_list[index] = "Язычок: <<$rating[stat_importance['oral']]>> / <<$rating[slave['oral']]>>" & index += 1
if stat_importance['penetration'] > 0: $pre_list[index] = "Пенетрация: <<$rating[stat_importance['penetration']]>> / <<$rating[slave['penetration']]>>" & index += 1
if stat_importance['petting'] > 0: $pre_list[index] = "Петтинг: <<$rating[stat_importance['petting']]>> / <<$rating[slave['petting']]>>" & index += 1
if stat_importance['orgy'] > 0: $pre_list[index] = "Оргии: <<$rating[stat_importance['orgy']]>> / <<$rating[slave['orgy']]>>" & index += 1
if stat_importance['roleplay'] > 0: $pre_list[index] = "Демонстрация: <<$rating[stat_importance['roleplay']]>> / <<$rating[slave['roleplay']]>>" & index += 1
if stat_importance['xenophily'] > 0: $pre_list[index] = "Ксенофилия: <<$rating[stat_importance['xenophily']]>> / <<$rating[slave['xenophily']]>>" & index += 1
if stat_importance['fetishism'] > 0: $pre_list[index] = "Фетишизм: <<$rating[stat_importance['fetishism']]>> / <<$rating[slave['fetishism']]>>" & index += 1

if index > 8:
	$npc_demand_list = '		<<$pre_list[1]>>'
	$npc_demand_list += '
		<<$pre_list[2]>>'
	$npc_demand_list += '
		<<$pre_list[3]>>'
	$npc_demand_list += '
		<<$pre_list[4]>>'
	$npc_demand_list += '
		<<$pre_list[5]>>'
	$npc_demand_list += '
		<<$pre_list[6]>>'
	$npc_demand_list += '
		<<$pre_list[7]>>'
	$npc_demand_list += '
		<<$pre_list[8]>>'
	$npc_demand_list_add = $pre_list[9]
	if index >= 10: $npc_demand_list_add += '
<<$pre_list[10]>>'
	if index >= 11: $npc_demand_list_add += '
<<$pre_list[11]>>'
	if index >= 12: $npc_demand_list_add += '
<<$pre_list[12]>>'
	if index >= 13: $npc_demand_list_add += '
<<$pre_list[13]>>'
	if index >= 14: $npc_demand_list_add += '
<<$pre_list[14]>>'
	if index >= 15: $npc_demand_list_add += '
<<$pre_list[15]>>'
	if index >= 16: $npc_demand_list_add += '
<<$pre_list[16]>>'
else
	$npc_demand_list = $pre_list[1]
	if index >= 2: $npc_demand_list += '
<<$pre_list[2]>>'
	if index >= 2: $npc_demand_list += '
<<$pre_list[3]>>'
	if index >= 2: $npc_demand_list += '
<<$pre_list[4]>>'
	if index >= 2: $npc_demand_list += '
<<$pre_list[5]>>'
	if index >= 2: $npc_demand_list += '
<<$pre_list[6]>>'
	if index >= 2: $npc_demand_list += '
<<$pre_list[7]>>'
	if index >= 2: $npc_demand_list += '
<<$pre_list[8]>>'
end

$npc_demand_list += '

Дополнительные требования:'
if demand['refuse_age'] = 1: $npc_demand_list += ' не ребёнок,'
if demand['refuse_age'] = 2: $npc_demand_list += ' не старая,'
if demand['agree_age'] = 1: $npc_demand_list += ' незрелая,'
if demand['agree_age'] = 2: $npc_demand_list += ' зрелая,'
if demand['virginity'] = 1: $npc_demand_list += ' обязательно девственница,'
if demand['virginity'] = 2: $npc_demand_list += ' зрелая,'
if demand['min_beauty'] > 0: $npc_demand_list += ' красивая [<<$rating[demand["min_beauty"]]>>],'
if demand['min_stamina'] > 0: $npc_demand_list += ' здоровая [<<$rating[demand["min_stamina"]]>>],'
if demand['max_exotic'] ! 99: $npc_demand_list += ' без модификаций,'
if demand['min_exotic'] > 0: $npc_demand_list += ' экзотичная [<<$rating[demand["min_exotic"]]>>],'
if demand['min_fat'] > 0: $npc_demand_list += ' не худая.'
if demand['max_fat'] ! 99: $npc_demand_list += ' стройная.'

$text_display = 'ИНФОРМАЦИЯ О КЛИЕНТЕ
' + _
'Категория: <<$rating[demand_rating[$npc_id]]>>  /  <<$rating[rating]>>
' + _
'<<$client_status>>
' + _
'   ТРЕБОВАНИЯ:
' + _
'<<$npc_demand_list>>'

*p '

'
*p '
<<$text[txt]>>
'
*p '
<<$text_display>>
'
*p '
<<$npc_demand_list_add>>
'
*p '

'

$info_bar = ''
*p '

<<$npc_name[$npc_id]>>
<<$npc_status[$npc_id]>>
'
*nl 'Информация к размышлению:
'
*p '
<<$npc_attitude[npc_attitude[$npc_id]]>>'
*nl '<<$npc_info[$npc_id]>>
'

if txt > 1:
	addobj ''
else
	addobj ''
end
addobj ''

--- master_stat_clients ---------------------------------