require_once get_file_loc('smr_alliance.inc'); require_once get_file_loc("smr_force.inc"); require_once get_file_loc("smr_planet.inc"); require_once get_file_loc("smr_port.inc"); require_once get_file_loc('smr_sector.inc'); $player = new SMR_PLAYER(SmrSession::$old_account_id, SmrSession::$game_id); $ship = new SMR_SHIP(SmrSession::$old_account_id, SmrSession::$game_id); $sector = new SMR_SECTOR($player->sector_id, SmrSession::$game_id, SmrSession::$old_account_id); // update turns on that player $player->update_turns($ship->speed); // we cant move if we are dead //check if we are in kill db...if we are we don't do anything $db->query("SELECT * FROM kills WHERE dead_id = {$player->account_id} AND game_id = {$player->game_id}"); if (!$db->next_record()) { if ($ship->hardware[HARDWARE_SHIELDS] == 0 && $ship->hardware[HARDWARE_ARMOR] == 0 && ($var["body"] != "trader_attack.php" && $var["url"] != "trader_attack_processing.php" && $var["body"] != "port_attack.php" && $var["url"] != "port_attack_processing.php" && $var["body"] != "planet_attack.php" && $var["url"] != "planet_attack_processing.php")) { $player->sector_id = $player->get_home(); $player->newbie_turns = 100; $player->mark_dead(); $player->update(); $ship->get_pod(); //print("$var[body], $var[url]"); $container = array(); $container["url"] = "skeleton.php"; $container["body"] = "current_sector.php"; forward($container); } } elseif (!isset($var["ahhh"])) { $db->query("SELECT * FROM kills WHERE dead_id = {$player->account_id} AND processed = 'TRUE' AND game_id = {$player->game_id}"); if ($db->next_record() && $var["body"] != "trader_attack.php") { $container = array(); $container["url"] = "skeleton.php";
} // record death stat $killed->update_stat("deaths", 1); if ($debug) { print "reset hof (turns used)<br>"; } // reset the turns used since last death stat $db->query("UPDATE account_has_stats SET turns_used = 0 WHERE account_id = {$killed_id}"); $db->query("UPDATE player_has_stats SET turns_used = 0 WHERE account_id = {$killed_id}"); if ($debug) { print "back to hq<br>"; } // send him to his hq //send out scout msgs $sector->leaving_sector(); $db->query("UPDATE player SET sector_id = " . $killed->get_home() . " WHERE account_id = {$killed_id} AND game_id = {$player->game_id}"); if ($debug) { print "increase player deaths<br>"; } // register deaths $db->query("UPDATE player SET deaths = deaths + 1 WHERE account_id = {$killed_id} AND game_id = {$player->game_id}"); if ($debug) { print "Update Ship Cost HoF<br>"; } $db->query("SELECT * FROM ship_type WHERE ship_type_id = {$killed->ship_type_id}"); $db->next_record(); $killer->update_stat("killed_ships", $db->f("cost")); $killed->update_stat("died_ships", $db->f("cost")); if ($debug) { print "delete all weapons, hardware, illusion and cloak<br>"; }