Файл: DARK WARS/dark_war/attack/index.php
Строк: 51
<?php
include_once '../start.php';
$doc = new document();
$doc->title('Наподение');
$forwards = mysql_fetch_assoc(mysql_query("SELECT * FROM `dark_war_attack` WHERE `id_player` = '{$player->id}' LIMIT 1"));
$defending = mysql_fetch_assoc(mysql_query("SELECT * FROM `dark_war_attack` WHERE `number` = '{$player->id}' LIMIT 1"));
$ank = new player($defending['id_who']);
if (!$forwards['id']) {
header ("Location: /dark_war/my_profil.php");
exit;
}
include_once 'finish.php'; // Отправит сообщение о победе или поражении и закончит сражение
if (isset($_GET['attack'])) {
include_once 'dmg.php'; // при атаке обычным дамагом
header ("Location: /dark_war/attack/");
}
if (isset($_GET['magic'])) {
include_once 'magic_dmg.php'; // при атаке скилами
include_once 'dmg.php'; // при атаке обычным дамагом
header ("Location: /dark_war/attack/");
exit;
}
$dispatch[] = array ('name' => $player->name, 'hp' => $forwards['hp'], 'mp' => $forwards['mp'], 'dmg' => $forwards['dmg'],
'armor' => $forwards['armor'], 'armorp' => $forwards['armorp'],
'magicr' => $forwards['magicr'], 'magicp' => $forwards['magicp']);
$dispatch[] = array ('name' => $ank->name, 'hp' => $defending['hp'], 'mp' => $defending['mp'], 'dmg' => $defending['dmg'],
'armor' => $defending['armor'],'armorp' => $defending['armorp'], 'magicr' => $defending['magicr'],
'magicp' => $defending['magicp']);
$doc->assign('post', $dispatch);
$doc->display('view_attack.tpl');
$dispatch = array();
$q=mysql_query("SELECT * FROM `dark_war_masteries_u` WHERE `id_player` = '{$player->id}'");
while ($post = mysql_fetch_array($q)) {
$list = $post['name'];
$img = '/dark_war/all_img/masteries/'.$post['img'].'.png" ';
$link = "?magic=" . $post['id'] . "".(isset($_GET['page'])?'&page='.$_GET['page'].'' : '')."";
$descrip = $post['description'];
$dispatch[] = array ('title' => $list, 'img' => $img, 'link' => $link, 'descrip' => $descrip);
}
$doc->assign('post', $dispatch);
$doc->display('view_list_plus_img.tpl');
$doc->act("?attack", "Атака");
?>