[note ISPY]
[uncover]
[let {book_no=7}]

[load bg]

///ISPY
[load Ispy\_0048_Case.png as obj_01]		[tport it 196, 496]	
[load Ispy\_0047_Mask.png as obj_02]		[tport it 396, 412]	[rescale it 0.9 0.9]
[load Ispy\_0046_Shield.png as obj_03]		[tport it 579, 333]	
[load Ispy\_0045_Dog.png as obj_04]		[tport it 607, 211]	[rescale it 0.8 0.8]
[load Ispy\_0044_Grapes.png as obj_05]		[tport it 336, 291]	
[load Ispy\_0043_Scissors.png as obj_06]	[tport it 92, 405]	
[load Ispy\_0042_Watering_can.png as obj_07]	[tport it 642, 19]	
[load Ispy\_0041_Apples.png as obj_08]		[tport it 738, 428]	
[load Ispy\_0040_For_sale.png as obj_09]	[tport it 274, 311]	
[load Ispy\_0039_Dinner.png as obj_10]		[tport it 516, 38]	[rescale it 0.9 0.9]
[load Ispy\_0038_Bottles.png as obj_11]		[tport it 549, 482]	
[load Ispy\_0037_Handbell.png as obj_12]	[tport it 183, 264]	
[load Ispy\_0036_Ball.png as obj_13]		[tport it 538, 508]	
[load Ispy\_0035_Teddy_bear.png as obj_14]	[tport it 90, 471]	
[load Ispy\_0034_Accordion.png as obj_15]	[tport it 446, 492]	
[load Ispy\_0033_Flower.png as obj_16]		[tport it 376, 35]	
[load Ispy\_0032_No-smoking.png as obj_17]	[tport it 394, 349]	[rescale it 0.8 0.8]
[load Ispy\_0031_Car_nunber.png as obj_18]	[tport it 624, 461]	
[load Ispy\_0030_Wedding_cake_doll.png as obj_19][tport it 3, 406]	
[load Ispy\_0029_Axe.png as obj_20]		[tport it 493, 236]	
[load Ispy\_0028_Asparagus.png as obj_21]	[tport it 635, 466]	
[load Ispy\_0027_Coffee_grinder.png as obj_22]	[tport it 221, 414]	
[load Ispy\_0026_Boots.png as obj_23]		[tport it 517, 91]	
[load Ispy\_0025_Halberd.png as obj_24]		[tport it 50, -5]	[rescale it 0.8 0.8]
[load Ispy\_0024_Helmet.png as obj_25]		[tport it 0, 24]	
[load Ispy\_0023_Eagle.png as obj_26]		[tport it 695, 83]	
[load Ispy\_0022_Flowerpot.png as obj_27]	[tport it 651, 361]	
[load Ispy\_0021_Cucumber.png as obj_28]	[tport it 667, 489]	
[load Ispy\_0020_Top.png as obj_29]		[tport it 267, 272]	[rescale it 0.8 0.8]	

[load fg]					[tport it 0, 0]	

[load Ispy\_0018_Hat.png as obj_30]		[tport it 427, 190]	
[load Ispy\_0017_Swab.png as obj_31]		[tport it 139, 125]	
[load Ispy\_0016_Bucket.png as obj_32]		[tport it 384, 484]	
[load Ispy\_0015_Guitar.png as obj_33]		[tport it 342, 216]	
[load Ispy\_0014_Brush.png as obj_34]		[tport it 166, 43]	
[load Ispy\_0013_Phone.png as obj_35]		[tport it 85, 143]	
[load Ispy\_0012_Prize.png as obj_36]		[tport it 443, 250]	

[load Ispy\_0002_Clock_group.png as obj_37]	[tport it 11, 275]	[rescale it 0.8 0.8]
[load Ispy\_0005_Umbrella_group.png as obj_38]	[tport it 514, 304]	[rescale it 0.9 0.9]
[load Ispy\_0007_Bug_group.png as obj_39]	[tport it 330, 32]	
[load Ispy\_0004_Butterfly_group.png as obj_40]	[tport it 689, 240]	

[load Ispy\_0008_Clock_group.png as obj_41]	[tport it 516, 145]	
[load Ispy\_0010_Umbrella_group.png as obj_42]	[tport it 300, 466]	[rescale it 0.8 0.8]
[load Ispy\_0006_Bug_group.png as obj_43]	[tport it 125, 35]	
[load Ispy\_0011_Bug_group.png as obj_44]	[tport it 432, 27]
[load Ispy\_0003_Butterfly_group.png as obj_45]	[tport it 695, 188]	
[load Ispy\_0009_Butterfly_group.png as obj_46]	[tport it 221, 17]	[rescale it 0.8 0.8]

[load mug_1.png as obj_47]			[tport it 564, 474][hide it]

[ load mug_0]					[ tport it 295, 194]

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
[let {QI=48}]	квестовый предмет (Quest Item) //////////////////////////////////////////////////////////////////////////////////////////////////////////////
[load mug_0 as obj_{QI}]	[tport it 295, 194]
[load mug_0 as inv_{QI}]	
[invent it]
[hide it]
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

[make quest_null][resize it 200,200][tport it 481, 322][add_ps it "psystem/easy_sparks.ps" center]

[load fg_2][tport it 684, 175]	

//ISPY WORK
[make_group CLOCK]
[set_group obj_37 CLOCK]
[set_group obj_41 CLOCK]

[make_group UMBRELLA]
[set_group obj_38 UMBRELLA]
[set_group obj_42 UMBRELLA]

[make_group BUG]
[set_group obj_39 BUG]
[set_group obj_43 BUG]
[set_group obj_44 BUG]

[make_group BUTTERFLY]
[set_group obj_40 BUTTERFLY]
[set_group obj_45 BUTTERFLY]
[set_group obj_46 BUTTERFLY]

[make_counter OBJS 40] //Число всех объектов минуc группы одинаковых.
[make_counter ISPY_OBJS 46] //Число всех объектов вместе с группы одинаковых минуc исключения.
[make_counter OBJ_LIST 12]

[make_list TEMP {OBJS}]
[make_list ISPY]
[randomize_list TEMP]

[let {i=0}]
[while {i=i+1;i<=OBJ_LIST}]
	[put_in_list ISPY {(i)TEMP}]
[endw]

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
[change_in_list ISPY 1 47]
[change_in_list ISPY 2 {QI}] //Добавление квестового предмета.  ///////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

[randomize_list ISPY]

[12x $LIST_? " "]
[12x show $LIST_?]
[12x tport $LIST_? {i=?-1; 165+i\6*76+(i\6>2)*100-50},{532+trunc(i/6)*18}]
[12x font_number $LIST_? 5]
[12x color $LIST_? 255, 255, 255]
[12x justify $LIST_? 0]
[12x resize $LIST_? 100]

[12x make under_LIST_?]
[12x resize under_LIST_? 100 20]
[12x tport under_LIST_? {$LIST_?_x} {$LIST_?_y+15}]


//фонт для спрятаных предметов
[let {i=0}]
[while {i=i+1;i<=12}]
	[if {(i ISPY)==47}] //Меняем цвет обязательному предмету
		[font_number $LIST_{i} 6]
		[color $it 211, 33, 12]
	[endif]
	[if {(i ISPY)==QI}] //Меняем цвет квестовому предмету //////////////////////////////////////////////////////////////////////////////////////
		[font_number $LIST_{i} 5]
	[endif]
[endw]


[load_sound sounds/spy_07_beer as sound_beer]		- Берлин. Наливаем пиво

[load_sound sounds/find as sound_find]			- Звук нахождения квестового предмета

[load_sound ambients/city_ambient_outdoor as ambient_outdoor]		

#include "..\interface\init.scr"
[$Ispy_title ""][show $it][resize $it 228][justify $it 0][tport $it 0,2][font_number $it 5][color $it 255,255,255]
[set_parent $Ispy_title hud_days]

/// подсветка айспайных предметов:
///ISPY
//Это иконки для всех предметов тоже самое что и список предметов только с reload и icon
[reload Ispy\_0048_Case.png as icon_01]		
[reload Ispy\_0047_Mask.png as icon_02]		
[reload Ispy\_0046_Shield.png as icon_03]		
[reload Ispy\_0045_Dog.png as icon_04]		
[reload Ispy\_0044_Grapes.png as icon_05]		
[reload Ispy\_0043_Scissors.png as icon_06]	
[reload Ispy\_0042_Watering_can.png as icon_07]	
[reload Ispy\_0041_Apples.png as icon_08]		
[reload Ispy\_0040_For_sale.png as icon_09]	
[reload Ispy\_0039_Dinner.png as icon_10]		
[reload Ispy\_0038_Bottles.png as icon_11]		
[reload Ispy\_0037_Handbell.png as icon_12]	
[reload Ispy\_0036_Ball.png as icon_13]		
[reload Ispy\_0035_Teddy_bear.png as icon_14]	
[reload Ispy\_0034_Accordion.png as icon_15]	
[reload Ispy\_0033_Flower.png as icon_16]		
[reload Ispy\_0032_No-smoking.png as icon_17]	
[reload Ispy\_0031_Car_nunber.png as icon_18]	
[reload Ispy\_0030_Wedding_cake_doll.png as icon_19]
[reload Ispy\_0029_Axe.png as icon_20]		
[reload Ispy\_0028_Asparagus.png as icon_21]	
[reload Ispy\_0027_Coffee_grinder.png as icon_22]	
[reload Ispy\_0026_Boots.png as icon_23]		
[reload Ispy\_0025_Halberd.png as icon_24]		
[reload Ispy\_0024_Helmet.png as icon_25]		
[reload Ispy\_0023_Eagle.png as icon_26]		
[reload Ispy\_0022_Flowerpot.png as icon_27]	
[reload Ispy\_0021_Cucumber.png as icon_28]	
[reload Ispy\_0020_Top.png as icon_29]		
[reload Ispy\_0018_Hat.png as icon_30]		
[reload Ispy\_0017_Swab.png as icon_31]		
[reload Ispy\_0016_Bucket.png as icon_32]		
[reload Ispy\_0015_Guitar.png as icon_33]		
[reload Ispy\_0014_Brush.png as icon_34]		
[reload Ispy\_0013_Phone.png as icon_35]		
[reload Ispy\_0012_Prize.png as icon_36]		

[reload Ispy\_0002_Clock_group.png as icon_37]	
[reload Ispy\_0005_Umbrella_group.png as icon_38]	
[reload Ispy\_0007_Bug_group.png as icon_39]	
[reload Ispy\_0004_Butterfly_group.png as icon_40]	
[reload Ispy\_0008_Clock_group.png as icon_41]	
[reload Ispy\_0010_Umbrella_group.png as icon_42]	
[reload Ispy\_0006_Bug_group.png as icon_43]	
[reload Ispy\_0011_Bug_group.png as icon_44]	
[reload Ispy\_0003_Butterfly_group.png as icon_45]	
[reload Ispy\_0009_Butterfly_group.png as icon_46]	

[reload mug_1.png as icon_47]
[reload mug_0 as icon_{QI}] ////////////////////////////////////////////////////////////////////////////////////////////////////////
[make_counter ICONS 48] //количество иконок (все предметы)


[{ICONS}x add_ps obj_? "psystem/ispy.ps" center][{ICONS}x stop_ps_emit obj_?][{ICONS}x ps_under_obj obj_?]

[let {i=0}]
[while {i=i+1;i<=ICONS}]
	[fill_qq_with {i}]
	[if {icon_?_w>icon_?_h}]
		[rescale icon_? {32/icon_?_w} {32/icon_?_w}]
	[endif]
	[if {icon_?_w<=icon_?_h}]
		[rescale icon_? {32/icon_?_h} {32/icon_?_h}]
	[endif]
	[tport icon_? {403-icon_?_w/2} {560-icon_?_h/2}]
	[shade it]
	[hide it]
[endw]

/// создание списка объектов кандидатов в хинты
[make_list HINT_CANDIDATES]
[make_counter HINT_CA_CNT 0]
[let {i=0}]
[while {i=i+1;i<=12}]
	[let {j=0}]
	[while {j=j+1;j<=ICONS}]
		[let {temp=(i)ISPY}]
		[if {temp==j} or {(obj_&temp&_group_n==obj_&j&_group_n)*(obj_&j&_group_n!=0)}]
			[put_in_list HINT_CANDIDATES {j}]
			[inc_counter HINT_CA_CNT]
		[endif]
	[endw]
[endw]
