Exemplo n.º 1
0
<span class="caption">' . constant($game->sprache("TEXT5")) . '</span><br><br>

<table width="450" border="0" align="center">
  <tr>
    <td>' . constant($game->sprache("TEXT6")) . '<br>' . constant($game->sprache("TEXT7")) . '<br>' . constant($game->sprache("TEXT8")) . '
    ' . (round($game->planet['unit_1'] * 2 + $game->planet['unit_2'] * 3 + $game->planet['unit_3'] * 4 + $game->planet['unit_4'] * 4, 0) < $game->planet['min_troops_required'] ? '<br><u>' . constant($game->sprache("TEXT9")) . round(100 * round($game->planet['unit_1'] * 2 + $game->planet['unit_2'] * 3 + $game->planet['unit_3'] * 4 + $game->planet['unit_4'] * 4, 0) / $game->planet['min_troops_required'], 0) . '%</b> ' . constant($game->sprache("TEXT10")) . '</u>' : '') . '
    </td>
  </tr>
</table>
<br><br>
<table width="450" align="center" border="0" cellpadding="1" cellspacing="1" class="style_outer"><tr><td>
<table width="450" align="center" border="0" cellpadding="2" cellspacing="2" class="style_inner">
  <form name="metal_form" method="post" action="' . parse_link('a=mines') . '" onSubmit="return deactivate_buttons();">
  <tr>
    <td width="350"><b>' . $BUILDING_NAME[$game->player['user_race']][1] . '</b> (<img src="' . $game->GFX_PATH . 'menu_metal_small.gif">&nbsp;<b>' . ($ress_tax != 0 ? '' . $ress_tax * ResourcesPerTickMetal() . '' : '' . ResourcesPerTickMetal() . '') . '</b> <i>' . constant($game->sprache("TEXT11")) . '</i> / <b>' . ($ress_tax != 0 ? '' . $ress_tax * ResourcesPerHourMetal() . '' : '' . ResourcesPerHourMetal() . '') . '</b> <i>' . constant($game->sprache("TEXT12")) . '</i>)</td>
    <td width="100" rowspan="2" align="center" valign="middle"><input class="button" type="submit" name="submit" value="' . constant($game->sprache("TEXT13")) . '"></td>
  </tr>
  <tr>
    <td width="300">' . constant($game->sprache("TEXT14")) . ' <select name="worker">' . $metal_option_html . '</select></td>
  </tr>
  <input type="hidden" name="type" value="1">
  </form>
</table>
</td></tr></table>
<br><br>
<table width="450" align="center" border="0" cellpadding="1" cellspacing="1" class="style_outer"><tr><td>
<table width="450" align="center" border="0" cellpadding="2" cellspacing="2" class="style_inner">
  <form name="minerals_form" method="post" action="' . parse_link('a=mines') . '" onSubmit="return deactivate_buttons();">
  <tr>
    <td width="350"><b>' . $BUILDING_NAME[$game->player['user_race']][2] . '</b> (<img src="' . $game->GFX_PATH . 'menu_mineral_small.gif">&nbsp;<b>' . ($ress_tax != 0 ? '' . $ress_tax * ResourcesPerTickMineral() . '' : '' . ResourcesPerTickMineral() . '') . '</b> <i>' . constant($game->sprache("TEXT11")) . '</i> / <b>' . ($ress_tax != 0 ? '' . $ress_tax * ResourcesPerHourMineral() . '' : '' . ResourcesPerHourMineral() . '') . '</b> <i>' . constant($game->sprache("TEXT12")) . '</i>)</td>
Exemplo n.º 2
0
// Recompute Static Planet Values
$sdl->start_job('Recompute Static Planet Values');
$sql = 'SELECT p.*,
               u.user_id, u.user_race, u.user_vacation_start, u.user_vacation_end
        FROM (planets p)
        LEFT join (user u) ON u.user_id = p.planet_owner
        WHERE p.recompute_static = 1';
if (($q_planets = $db->query($sql)) === false) {
    $sdl->log('<b>Error:</b> Could not query planets data to recompute static planet values! - SKIPPED');
} else {
    $n_recomputed = 0;
    while ($planet = $db->fetchrow($q_planets)) {
        if (empty($planet['user_id'])) {
            continue;
        }
        $add_1 = ResourcesPerTickMetal($planet);
        $add_2 = ResourcesPerTickMineral($planet);
        $add_3 = ResourcesPerTickLatinum($planet);
        $add_4 = $planet['rateo_4'] * $RACE_DATA[$planet['user_race']][12] + $planet['research_1'] * $RACE_DATA[$planet['user_race']][20] * 0.1 + $planet['research_2'] * $RACE_DATA[$planet['user_race']][20] * 0.2;
        if ($ACTUAL_TICK >= $planet['user_vacation_start'] && $ACTUAL_TICK <= $planet['user_vacation_end']) {
            $add_1 *= 0.2;
            $add_2 *= 0.2;
            $add_3 *= 0.2;
            $add_4 *= 0.2;
        }
        $sql = 'UPDATE planets
                SET add_1 = ' . $add_1 . ',
                    add_2 = ' . $add_2 . ',
                    add_3 = ' . $add_3 . ',
                    add_4 = ' . $add_4 . ',
                    recompute_static = 0,