<?php
define( '_IN_JOHNCMS', 1 );
//Вертолеты
if ( $ku[ 'time_drakon' ] > $time )
				$drakon_act = 1;
if ( $ku[ 'time_yastreb' ] > $time )
				$yastreb_act = 1;
if ( $ku[ 'time_shmel' ] > $time )
				$shmel_act = 1;
//Гидропоника
if ( $ku[ 'hydropinics_time' ] > $time )
		{
				$hp_act = 1;
				$hp_ps  = $ku[ 'hydropinics_type' ];
		}
//Пугало
if ( $ku[ 'scarecrow_time' ] > $time )
				$sc_act = 1;
//Сеялка
if ( $ku[ 'seeder' ] > 0 )
		{
				$sd = $ku[ 'seeder' ];
				if ( $sd <= 10 )
								$seeder_act_skid = $sd * 5;
				elseif ( $sd == 11 )
								$seeder_act_skid = 50;
				elseif ( $sd == 12 )
								$seeder_act_skid = 50;
				if ( $sd <= 6 )
								$seeder_act = $sd * 10;
				elseif ( $sd == 7 )
								$seeder_act = 80;
				elseif ( $sd == 8 )
								$seeder_act = 100;
				elseif ( $sd == 9 )
								$seeder_act = 130;
				elseif ( $sd == 10 )
								$seeder_act = 170;
				elseif ( $sd == 11 )
								$seeder_act = 220;
				elseif ( $sd == 12 )
								$seeder_act = 280;
		}
if ( $ku[ 'seeder2' ] > 0 )
		{
				$sd = $ku[ 'seeder2' ];
				if ( $sd <= 10 )
								$seeder2_act_skid = $sd * 5;
				elseif ( $sd == 11 )
								$seeder2_act_skid = 50;
				elseif ( $sd == 12 )
								$seeder2_act_skid = 50;
				if ( $sd <= 6 )
								$seeder2_act = $sd * 10;
				elseif ( $sd == 7 )
								$seeder2_act = 80;
				elseif ( $sd == 8 )
								$seeder2_act = 100;
				elseif ( $sd == 9 )
								$seeder2_act = 130;
				elseif ( $sd == 10 )
								$seeder2_act = 170;
				elseif ( $sd == 11 )
								$seeder2_act = 220;
				elseif ( $sd == 12 )
								$seeder2_act = 280;
		}
if ( $ku[ 'fooder2' ] > 0 )
		{
				$fr = $ku[ 'fooder2' ];
				if ( $fr == 1 )
								$fooder_act2 = 10;
				elseif ( $fr == 2 )
								$fooder_act2 = 20;
				elseif ( $fr == 3 )
								$fooder_act2 = 30;
				elseif ( $fr == 4 )
								$fooder_act2 = 40;
				elseif ( $fr == 5 )
								$fooder_act2 = 50;
				elseif ( $fr == 6 )
								$fooder_act2 = 60;
				elseif ( $fr == 7 )
								$fooder_act2 = 80;
				elseif ( $fr == 8 )
								$fooder_act2 = 100;
				elseif ( $fr == 9 )
								$fooder_act2 = 130;
				elseif ( $fr == 10 )
								$fooder_act2 = 170;
				elseif ( $fr == 11 )
								$fooder_act2 = 220;
				elseif ( $fr == 12 )
								$fooder_act2 = 280;
				if ( isset( $shmel_act ) )
								$fooder_act2 = $fooder_act2 * 2;
		}
if ( $ku[ 'fooder2' ] > 0 )
		{
				if ( $fr == 1 )
								$fooder_act3 = 10;
				elseif ( $fr == 2 )
								$fooder_act3 = 20;
				elseif ( $fr == 3 )
								$fooder_act3 = 30;
				elseif ( $fr == 4 )
								$fooder_act3 = 40;
				elseif ( $fr == 5 )
								$fooder_act3 = 50;
				elseif ( $fr == 6 )
								$fooder_act3 = 60;
				elseif ( $fr == 7 )
								$fooder_act3 = 80;
				elseif ( $fr == 8 )
								$fooder_act3 = 100;
				elseif ( $fr == 9 )
								$fooder_act3 = 130;
				elseif ( $fr == 10 )
								$fooder_act3 = 170;
				elseif ( $fr == 11 )
								$fooder_act3 = 220;
				elseif ( $fr == 12 )
								$fooder_act3 = 280;
				if ( isset( $shmel_act ) )
								$fooder_act3 = $fooder_act3 * 2;
		}
if ( $ku[ 'harvester' ] > 0 )
		{
				$hv = $ku[ 'harvester' ];
				if ( $hv <= 6 )
								$harvester_act = $hv * 10;
				elseif ( $hv == 7 )
								$harvester_act = 80;
				elseif ( $hv == 8 )
								$harvester_act = 100;
				elseif ( $hv == 9 )
								$harvester_act = 130;
				elseif ( $hv == 10 )
								$harvester_act = 170;
				elseif ( $hv == 11 )
								$harvester_act = 220;
				elseif ( $hv == 12 )
								$harvester_act = 280;
		}
if ( $ku[ 'harvester2' ] > 0 )
		{
				$hv = $ku[ 'harvester2' ];
				if ( $hv <= 6 )
								$harvester2_act = $hv * 5;
				elseif ( $hv == 7 )
								$harvester2_act = 40;
				elseif ( $hv == 8 )
								$harvester2_act = 50;
				elseif ( $hv == 9 )
								$harvester2_act = 65;
				elseif ( $hv == 10 )
								$harvester2_act = 85;
				elseif ( $hv == 11 )
								$harvester2_act = 110;
				elseif ( $hv == 12 )
								$harvester2_act = 140;
		}
if ( $ku[ 'soiler' ] > 0 )
		{
				$sr = $ku[ 'soiler' ];
				if ( $sr <= 6 )
								$soiler_act = $sr * 10;
				elseif ( $sr == 7 )
								$soiler_act = 80;
				elseif ( $sr == 8 )
								$soiler_act = 100;
				elseif ( $sr == 9 )
								$soiler_act = 130;
				elseif ( $sr == 10 )
								$soiler_act = 170;
				elseif ( $sr == 11 )
								$soiler_act = 220;
				elseif ( $sr == 12 )
								$soiler_act = 280;
				if ( isset( $mc ) && $mc[ 'soil' ] > 0 )
						{
								$mc_p_soiler = $mc[ 'soil' ] * 5;
								$soiler_act  = ( ( $soiler_act / 100 ) * $mc_p_soiler ) + $soiler_act;
						}
				//echo $soiler_act;
		}
//Клумба
if ( $ku[ 'flowerbed' ] > 0 )
		{
				$fb = $ku[ 'flowerbed' ];
				if ( $fb <= 6 )
								$flowerbed_act = $fb;
				elseif ( $fb == 7 )
								$flowerbed_act = 8;
				elseif ( $fb == 8 )
								$flowerbed_act = 10;
				elseif ( $fb == 9 )
								$flowerbed_act = 13;
				elseif ( $fb == 10 )
								$flowerbed_act = 17;
				elseif ( $fb == 11 )
								$flowerbed_act = 22;
				elseif ( $fb == 12 )
								$flowerbed_act = 28;
		}
if ( $ku[ 'irregate' ] > 0 )
		{
				$ig = $ku[ 'irregate' ];
				if ( $ig <= 6 )
						{
								$irregate_act   = $ig * 10;
								$irregate_act_m = $ig * 1;
								if ( $ig <= 4 )
												$irregate_act_mnp = $ig * 1;
								elseif ( $ig == 5 )
												$irregate_act_mnp = 6;
								elseif ( $ig == 6 )
												$irregate_act_mnp = 8;
						}
				elseif ( $ig == 7 )
						{
								$irregate_act     = 80;
								$irregate_act_m   = 8;
								$irregate_act_mnp = 10;
						}
				elseif ( $fb == 8 )
						{
								$irregate_act     = 100;
								$irregate_act_m   = 10;
								$irregate_act_mnp = 13;
						}
				elseif ( $fb == 9 )
						{
								$irregate_act     = 130;
								$irregate_act_m   = 13;
								$irregate_act_mnp = 18;
						}
				elseif ( $fb == 10 )
						{
								$irregate_act     = 170;
								$irregate_act_m   = 17;
								$irregate_act_mnp = 25;
						}
				elseif ( $fb == 11 )
						{
								$irregate_act     = 220;
								$irregate_act_m   = 22;
								$irregate_act_mnp = 26;
						}
				elseif ( $fb == 12 )
						{
								$irregate_act     = 280;
								$irregate_act_m   = 28;
								$irregate_act_mnp = 27;
						}
				if ( isset( $shmel_act ) )
								$irregate_act = $irregate_act * 2;
		}
if ( $ku[ 'conveyor' ] > 0 )
		{
				$cr = $ku[ 'conveyor' ];
				if ( $cr == 1 )
								$conveyor_act = 20;
				elseif ( $cr == 2 )
								$conveyor_act = 40;
				elseif ( $cr == 3 )
								$conveyor_act = 60;
				elseif ( $cr == 4 )
								$conveyor_act = 80;
				elseif ( $cr == 5 )
								$conveyor_act = 100;
				elseif ( $cr == 6 )
								$conveyor_act = 120;
				elseif ( $cr == 7 )
								$conveyor_act = 160;
				elseif ( $cr == 8 )
								$conveyor_act = 200;
				elseif ( $cr == 9 )
								$conveyor_act = 260;
				elseif ( $cr == 10 )
								$conveyor_act = 340;
				elseif ( $cr == 11 )
								$conveyor_act = 440;
				elseif ( $cr == 12 )
								$conveyor_act = 560;
				if ( isset( $shmel_act ) )
								$conveyor_act = $conveyor_act * 2;
		}
if ( $ku[ 'conveyor2' ] > 0 )
		{
				$cr = $ku[ 'conveyor2' ];
				if ( $cr == 1 )
								$conveyor_act2 = 20;
				elseif ( $cr == 2 )
								$conveyor_act2 = 40;
				elseif ( $cr == 3 )
								$conveyor_act2 = 60;
				elseif ( $cr == 4 )
								$conveyor_act2 = 80;
				elseif ( $cr == 5 )
								$conveyor_act2 = 100;
				elseif ( $cr == 6 )
								$conveyor_act2 = 120;
				elseif ( $cr == 7 )
								$conveyor_act2 = 160;
				elseif ( $cr == 8 )
								$conveyor_act2 = 200;
				elseif ( $cr == 9 )
								$conveyor_act2 = 260;
				elseif ( $cr == 10 )
								$conveyor_act2 = 340;
				elseif ( $cr == 11 )
								$conveyor_act2 = 440;
				elseif ( $cr == 12 )
								$conveyor_act2 = 560;
				if ( isset( $shmel_act ) )
								$conveyor_act = $conveyor_act * 2;
		}
if ( $ku[ 'conveyor2' ] > 0 )
		{
				$cr = $ku[ 'conveyor3' ];
				if ( $cr == 1 )
								$conveyor_act3 = 20;
				elseif ( $cr == 2 )
								$conveyor_act3 = 40;
				elseif ( $cr == 3 )
								$conveyor_act3 = 60;
				elseif ( $cr == 4 )
								$conveyor_act3 = 80;
				elseif ( $cr == 5 )
								$conveyor_act3 = 100;
				elseif ( $cr == 6 )
								$conveyor_act3 = 120;
				elseif ( $cr == 7 )
								$conveyor_act3 = 160;
				elseif ( $cr == 8 )
								$conveyor_act3 = 200;
				elseif ( $cr == 9 )
								$conveyor_act3 = 260;
				elseif ( $cr == 10 )
								$conveyor_act3 = 340;
				elseif ( $cr == 11 )
								$conveyor_act3 = 440;
				elseif ( $cr == 12 )
								$conveyor_act3 = 560;
				if ( isset( $shmel_act ) )
								$conveyor_act = $conveyor_act * 2;
		}
if ( $ku[ 'fooder' ] > 0 )
		{
				$fr = $ku[ 'fooder' ];
				if ( $fr == 1 )
								$fooder_act = 10;
				elseif ( $fr == 2 )
								$fooder_act = 20;
				elseif ( $fr == 3 )
								$fooder_act = 30;
				elseif ( $fr == 4 )
								$fooder_act = 40;
				elseif ( $fr == 5 )
								$fooder_act = 50;
				elseif ( $fr == 6 )
								$fooder_act = 60;
				elseif ( $fr == 7 )
								$fooder_act = 80;
				elseif ( $fr == 8 )
								$fooder_act = 100;
				elseif ( $fr == 9 )
								$fooder_act = 130;
				elseif ( $fr == 10 )
								$fooder_act = 170;
				elseif ( $fr == 11 )
								$fooder_act = 220;
				elseif ( $fr == 12 )
								$fooder_act = 280;
				if ( isset( $shmel_act ) )
								$fooder_act = $fooder_act * 2;
		}
if ( $ku[ 'cultivator' ] > 0 )
		{
				$sr = $ku[ 'cultivator' ];
				if ( $sr <= 6 )
								$cultivator_act = $sr * 20;
				elseif ( $sr == 7 )
								$cultivator_act = 160;
				elseif ( $sr == 8 )
								$cultivator_act = 200;
				elseif ( $sr == 9 )
								$cultivator_act = 260;
				elseif ( $sr == 10 )
								$cultivator_act = 340;
				elseif ( $sr == 11 )
								$cultivator_act = 440;
				elseif ( $sr == 12 )
								$cultivator_act = 560;
		}
if ( isset( $mc ) && $mc[ 'irrigate' ] > 0 )
		{
				$mc_hp_act = 1;
				$mc_hp_ps  = $mc[ 'irrigate' ] * 10;
				// ороситель (кх постройка)
				// даёт эфект подобный гидре
				// уровень оросителя*10
		}
if ( isset( $mc ) && $mc[ 'school' ] > 0 ) // колхозная школа
		{
				$exp = 25 + ( $mc[ 'school' ] * 2 ); // уровень фермеров
				if ( $exp >= $ku[ 'level' ] )
								$school_act = 1; // удвоение базового опыта доступо фермерам с уровнем больше $exp включительно
		}
if ( isset( $mc ) && $mc[ 'vet' ] > 0 ) //вет. клиника
		{
				$vet_act  = 1;
				$vet_ps_m = $mc[ 'vet' ] * 10;
				$vet_ps_r = $mc[ 'vet' ] * 25;
		}
if ( isset( $mc ) && $mc[ 'bank' ] > 0 ) // кх банк
		{
				$payment_act = 1;
				$payment_ps  = $mc[ 'bank' ] * 5;
				// даёт дополнительные рубины при покупке (уровень * 5%)
		}
if ( isset( $mc ) && $mc[ 'lib' ] == 1 ) // кх библиотека
		{
				$lib_act = 1;
				// повышает получаемый базовый опыт всех колхозников на 50%
		}
if ( isset( $mc ) && $mc[ 'greenhouse' ] > 0 ) // кх теплица
		{
				$greenhouse_act = 1;
				$greenhouse_ps  = $mc[ 'greenhouse' ] * 20;
				// увеличивает урожай с грядок на (уровень * 20%)
		}
?>