View file element_function/element_function_labirint.php

File size: 3.73Kb
<?php
	// Функция определяет статус игры
	function Element_Status_Labirint($time, $game) {
		if ($time <= time() AND $game == 0) $status = 0; // Вход в лабиринт открыт. Можно начинать
		if ($time <= time() AND $game == 1) $status = 1; // Уже играю в лабиринте
		if ($time >  time() AND $game == 0) $status = 2; // Вход в лабиринт закрыт. Ждем
		return $status;
	}

	//	$user['lost_labirint'] = '0:0:0:0:0:0:0:0:0';
	//	writecache('element_users_id_'.$user['lost_id'], $user);
	
	function Element_Chance($etap, $bonus) {
		global $user_blessing;
		if ($user_blessing) $params = $user_blessing['duh']; else $params = 0;
	
			// Дальше // Кр. дух // Кр этап // Опыт этап // Кол зол ( 5% ) // % параметры дух
			if ($etap == 0) return array(100 + $bonus,  5,   5,   5,  5,  (20 - $params));
	   else if ($etap == 1) return array( 80 + $bonus, 10,  13,  15,  5,  (40 - $params));
	   else if ($etap == 2) return array( 70 + $bonus, 20,  26,  30,  5,  (50 - $params));
	   else if ($etap == 3) return array( 60 + $bonus, 30,  39,  45,  5,  (70 - $params));
	   else if ($etap == 4) return array( 50 + $bonus, 40,  52,  60,  5,  (80 - $params));
	   else if ($etap == 5) return array( 40 + $bonus, 50,  65,  75,  5,  (90 - $params));
	   else if ($etap == 6) return array( 30 + $bonus, 60,  78,  90,  5, (100 - $params));
	   else if ($etap == 7) return array( 20 + $bonus, 70,  91, 105,  5, (120 - $params));
	   else if ($etap == 8) return array( 10 + $bonus, 80, 104, 120,  5, (130 - $params));
	   else if ($etap == 9) return array(  0 + $bonus, 90, 120, 150, 10, (200 - $params));
	}
	
	
	
	function StatusLabirint($time,$game) {
		if ($time <= time() AND $game == 0) $status = 0; // вход открыт
		if ($time <= time() AND $game == 1) $status = 1; // играю
		if ($time >  time() AND $game == 0) $status = 2; // вход закрыт
		if ($game == 2) $status = 3; // заркыт, награду не забрал
		return $status;
	}
	
	function GetShans($etap) { // % дальше / Крис. Дух / % найт Крист / Крист / Опыт / Дух
			 if ($etap == 0) 	$shans = array(90,  5, 20,  2,  10, 90);
		else if ($etap == 1) 	$shans = array(80, 10, 25,  4,  20, 80);
		else if ($etap == 2) 	$shans = array(70, 16, 30,  6,  30, 70);
		else if ($etap == 3) 	$shans = array(60, 23, 35,  8,  40, 60);
		else if ($etap == 4) 	$shans = array(50, 31, 40, 11,  50, 50);
		else if ($etap == 5) 	$shans = array(40, 40, 50, 15,  60, 40);
		else if ($etap == 6) 	$shans = array(30, 50, 60, 20,  70, 30);
		else if ($etap == 7) 	$shans = array(20, 61, 70, 26,  80, 20);
		else if ($etap == 8) 	$shans = array(15, 73, 80, 33,  90, 10);
		else if ($etap == 9) 	$shans = array( 8, 90, 90, 41, 200,  5);
		return $shans;
	}
	
	function Labirint_StatusGame($time,$game) {
		if ($time <= time() AND $game == 0) return 0; // вход открыт
		if ($time <= time() AND $game >  0) return 1; // играю
		if ($time >  time() AND $game == 0) return 2; // вход закрыт
	}
	
	function Labirint_GetShans($etap) { // 0: next; 1: Cristalls D; 2: Cristalls; 3: Exp; 4: Duh; 5: Заблуждение; 6: Irrydiy;
			 if ($etap == 0) 	$shans = array(90,  5,  2,  10,   60,  0,  1);
		else if ($etap == 1) 	$shans = array(80, 10,  4,  20,   70,  0,  2);
		else if ($etap == 2) 	$shans = array(70, 16,  6,  30,   75,  0,  3);
		else if ($etap == 3) 	$shans = array(60, 23,  8,  40,   85, 15,  4);
		else if ($etap == 4) 	$shans = array(50, 31, 11,  50,   90, 20,  5);
		else if ($etap == 5) 	$shans = array(40, 40, 15,  60,  110, 25,  6);
		else if ($etap == 6) 	$shans = array(30, 50, 20,  70,  130, 30,  7);
		else if ($etap == 7) 	$shans = array(20, 61, 26,  80,  150, 35,  8);
		else if ($etap == 8) 	$shans = array(15, 73, 33,  90,  160, 40,  9);
		else if ($etap == 9) 	$shans = array( 8, 90, 41, 200,  200, 45, 10);
		return $shans;
	}

?>