コード例 #1
0
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";
        $container["body"] = "death.php";
        $container["ahhh"] = "Yes";
コード例 #2
0
             // calc how many are actually hitting
             $number_hitting = ceil($damage / $forces_damage);
         }
         //subtract the damage
         $curr_attacker_ship->hardware[HARDWARE_ARMOR] -= $damage;
         // add the force_damage
         $force_damage += $damage;
         // print message
         $force_msg[] = "<span style=\"color:yellow;\">{$number_hitting}</span> mines kamikaze themselves against <span style=\"color:yellow;\">{$curr_attacker->player_name}</span>'s ship destroying <span style=\"color:red;\">{$damage}</span> armor.";
         //subtract mines that hit
         $forces->mines -= $number_hitting;
     }
 }
 // is he dead now?
 if ($curr_attacker_ship->hardware[HARDWARE_SHIELDS] == 0 && $curr_attacker_ship->hardware[HARDWARE_ARMOR] == 0) {
     $curr_attacker->mark_dead();
 }
 if ($forces->scout_drones > 0 && $curr_attacker->dead == "FALSE") {
     $number_hitting = $forces->scout_drones;
     // fed ships take half damage from drones
     $damage = $number_hitting * $forces_damage;
     // does the attacker have shields left?
     if ($curr_attacker_ship->hardware[HARDWARE_SHIELDS] > 0) {
         //Can we destroy all the shields or do they not have enough?
         if ($damage > $curr_attacker_ship->hardware[HARDWARE_SHIELDS]) {
             // reduce damage to number of shields left
             $damage = $curr_attacker_ship->hardware[HARDWARE_SHIELDS];
             // calc how many are actually hitting
             $number_hitting = ceil($damage / $forces_damage);
         }
         //scouts kamikaze