本文整理汇总了PHP中ressistand函数的典型用法代码示例。如果您正苦于以下问题:PHP ressistand函数的具体用法?PHP ressistand怎么用?PHP ressistand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ressistand函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: showpage
function showpage($content, $omni, $onload)
{
$status = template('playerinfo');
$status = tag2value('name', $_SESSION['user']['name'], $status);
$status = tag2value('base', $_SESSION['user']['base'], $status);
$status = tag2value('ubl', $_SESSION['user']['omni'], $status);
$status = tag2value('points', $_SESSION['user']['points'], $status);
$ressis = ressistand($omni);
$page = template('head');
$page = tag2value("onload", $onload, $page);
$page .= $status;
$page .= $ressis['html'];
$page .= $content;
$page .= '</body></html>';
echo $page;
}
示例2: kampf
//.........这里部分代码省略.........
$d_def += ($einh[$count]['def'] + $einh[$count]['def'] / 10 * $d_fuehrung) * $defender[$type];
} while (15 > $count);
$count = 4;
do {
$count++;
$type = 'def' . $count;
$d_anz = $d_anz + $defender_def[$type];
$d_off += ($def[$count]['off'] + $def[$count]['off'] / 10 * $d_fuehrung) * $defender_def[$type];
$d_def += ($def[$count]['def'] + $def[$count]['def'] / 10 * $d_fuehrung) * $defender_def[$type];
} while (10 > $count);
if ($d_anz == 0) {
$content .= ' <b>vernichtet</b><br />';
$vernichtet = 'd';
}
if ($inst['text']) {
$defender_def['def5'] += $inst[1005];
$defender_def['def6'] += $inst[1006];
$defender_def['def7'] += $inst[1007];
$defender_def['def8'] += $inst[1008];
$defender_def['def9'] += $inst[1009];
$defender_def['def10'] += $inst[1010];
$content .= "<br /><b>Folgende Verteidigungsanlagen liessen sich reparieren:</b><br />";
$content .= $inst['text'] . "<br />";
}
$count = 0;
if ($o_anz > 0) {
do {
$count++;
$type = 'einh' . $count;
if ($offender[$type] > 0) {
$space += $offender[$type] * $einh[$count]['space'];
}
} while (14 > $count);
$ressis = ressistand($d_omni);
$ressis_old = $ressis;
$ausbeute = rand(40, 90);
$ressisgesammt = $ressis['eisen'] + $ressis['titan'] + $ressis['oel'] + $ressis['uran'] + $ressis['gold'] + $ressis['chanje'];
$ressis['eisen'] - ($gebaeude['rohstofflager'] * 100 + 500) >= 0 ? $ressis['eisen'] -= $gebaeude['rohstofflager'] * 100 + 500 : ($ressis['eisen'] = 0);
$ressis['titan'] - ($gebaeude['rohstofflager'] * 100 + 500) >= 0 ? $ressis['titan'] -= $gebaeude['rohstofflager'] * 100 + 500 : ($ressis['titan'] = 0);
$ressis['oel'] - ($gebaeude['rohstofflager'] * 100 + 500) >= 0 ? $ressis['oel'] -= $gebaeude['rohstofflager'] * 100 + 500 : ($ressis['oel'] = 0);
$ressis['uran'] - ($gebaeude['rohstofflager'] * 100 + 500) >= 0 ? $ressis['uran'] -= $gebaeude['rohstofflager'] * 100 + 500 : ($ressis['uran'] = 0);
$ressis['gold'] - ($gebaeude['rohstofflager'] * 100 + 500) >= 0 ? $ressis['gold'] -= $gebaeude['rohstofflager'] * 100 + 500 : ($ressis['gold'] = 0);
$ressis['chanje'] - ($gebaeude['rohstofflager'] * 100 + 500) >= 0 ? $ressis['chanje'] -= $gebaeude['rohstofflager'] * 100 + 500 : ($ressis['chanje'] = 0);
$pluenderung['eisen'] = number_format($ressis['eisen'] / 100 * $ausbeute, 0, '', '');
$pluenderung['titan'] = number_format($ressis['titan'] / 100 * $ausbeute, 0, '', '');
$pluenderung['oel'] = number_format($ressis['oel'] / 100 * $ausbeute, 0, '', '');
$pluenderung['uran'] = number_format($ressis['uran'] / 100 * $ausbeute, 0, '', '');
$pluenderung['gold'] = number_format($ressis['gold'] / 100 * $ausbeute, 0, '', '');
$pluenderung['chanje'] = number_format($ressis['chanje'] / 100 * $ausbeute, 0, '', '');
$free = $space;
$pluendern[0]['name'] = 'eisen';
$pluendern[1]['name'] = 'titan';
$pluendern[2]['name'] = 'oel';
$pluendern[3]['name'] = 'uran';
$pluendern[4]['name'] = 'gold';
$pluendern[5]['name'] = 'chanje';
$max = number_format(rand(25, 90), 0, '', '');
$max = $space / 100 * $max;
do {
$rand = rand(0, 2);
if ($pluenderung[$pluendern[$rand]['name']] > $max) {
$pluenderung[$pluendern[$rand]['name']] = $max;
}
if (count($pluendern) > 3) {
$name = $pluendern[$rand]['name'];
unset($pluendern[$rand]);
示例3: Karten
$content = "<b>Deine Karten (" . score() . "):</b><br />" . showcards() . "<br /><b>Der Bank ihre Karten (" . bankscore() . "):</b><br />" . showbankcards() . '<br /><a href="?action=new&' . SID . '">[Runde starten!]</a><br /><br /><form method="post" action="?' . SID . '" enctype="multipart/form-data">
Der Einsatz beträgt: <input type="text" name="bet" value="' . $_SESSION['bet'] . '" size="4" />
<input type="hidden" name="action" value="bet" />
<input type="hidden" name="ok" value="1" />
<input type="submit" name="submit" value="ändern" /></form>Minimum: 1 / Maximum: 250';
} elseif ($_SESSION['card'] == 2) {
$content = showcards() . "<br /><b>Derzeitige Punkte: " . score() . '</b><br /><a href="?action=hit&' . SID . '">hit</a> / <a href="?action=stand&' . SID . '">stand</a><br />';
} else {
$content = showcards() . "<br /><b>Derzeitige Punkte: " . score() . '</b><br /><a href="?action=hit&' . SID . '">hit</a> / <a href="?action=stand&' . SID . '">stand</a>';
}
$content = str_replace("%content%", $content, template1());
$content = str_replace("%status%", $_SESSION['game'], $content);
$content = str_replace("%credits%", number_format($ressis['display_gold'], 0, '', '.'), $content);
$content = str_replace("%bet%", $_SESSION['bet'], $content);
mysql_query("UPDATE `ressis` SET `gold` = '" . $_SESSION['credit'] . "' WHERE `omni` = '" . $_SESSION['user']['omni'] . "' LIMIT 1;");
$ressis = ressistand($_SESSION['user']['omni']);
// get playerinfo template and replace tags
$status = template('playerinfo');
$status = tag2value('name', $_SESSION['user']['name'], $status);
$status = tag2value('base', $_SESSION['user']['base'], $status);
$status = tag2value('ubl', $_SESSION['user']['omni'], $status);
$status = tag2value('points', $_SESSION['user']['points'], $status);
echo tag2value('onload', $onload, template('head')) . $status . $ressis['html'] . $content . '</table>' . template('footer');
// debug
// show_vars();
function template1()
{
// standard xhtml template
$template = '<br /><br />
<table width="700px" border="1" cellspacing="0" cellpadding="0" class="standard">
<tr align="center">
示例4: logincheck
// Basisfunktionen laden
include "functions.php";
// check session
logincheck();
// get html head
$content = template('head');
// get playerinfo template and replace tags
$status = template('playerinfo');
$status = tag2value('name', $_SESSION['user']['name'], $status);
$status = tag2value('base', $_SESSION['user']['base'], $status);
$status = tag2value('ubl', $_SESSION['user']['omni'], $status);
$status = tag2value('points', $_SESSION['user']['points'], $status);
// add playerinfo to html
$content .= $status;
// ressourcen berechnen und ausgeben
$ressis = ressistand($_SESSION[user][omni]);
$content .= $ressis['html'];
$dbh = db_connect();
$piece = template('rank_piece');
// pages
$result = mysql_query("SELECT * FROM `user` WHERE `omni` >0 ORDER BY `plasmapunkte` DESC;");
$count = mysql_num_rows($result) / 100;
$count = explode('.', $count);
$c = $count[0];
if ($count[1] != 0) {
$c++;
}
if ($_GET['page'] == "last") {
$_GET['page'] = $c;
} elseif (!$_GET['page']) {
$_GET['page'] = 1;
示例5: buy_agent
function buy_agent()
{
$ressis = ressistand($_SESSION['user']['omni']);
$dbh = db_connect();
$select = "SELECT * FROM `gebauede` WHERE `omni` = '" . $_SESSION[user][omni] . "';";
$selectResult = mysql_query($select, $dbh);
$gebaeude = mysql_fetch_array($selectResult);
$select = "SELECT * FROM `agenten` WHERE `omni` = '" . $_SESSION['user']['omni'] . "';";
$agenten = mysql_query($select);
$agenten = mysql_num_rows($agenten);
if ($ressis['gold'] < 100) {
$result = 'Du hast nicht genug Gold um einen Agenten zu kaufen.';
} elseif ($gebaeude['agentenzentrum'] * 2 <= $agenten) {
$result = 'Du hast nicht genug Platz um einen weiteren Agenten unterzubringen.';
} else {
$result = 'Du haste einen Agenten für 100 Gold gekauft.';
$select = "INSERT INTO `agenten` ( `id` , `name` , `omni` , `alive` , `abwehr` , `spionage` , `sabotage` , `diebstahl` , `tarnung` ) VALUES ( '0', '" . name() . "', '" . $_SESSION['user']['omni'] . "', '1', '0', '0', '0', '0', '0' );";
mysql_query($select);
$select = "UPDATE `ressis` SET `gold` = '" . ($ressis[gold] - 100) . "' WHERE `omni` = '" . $_SESSION[user][omni] . "' LIMIT 1 ;";
mysql_query($select);
}
return $result;
}
示例6: mysql_query
if ($array[$a[$i]]) {
$result = mysql_query("SELECT * FROM `user` WHERE `omni` = '" . $a[$i] . "' LIMIT 1;");
$row = mysql_fetch_array($result);
if ($_SESSION['ubl'] != $a[$i]) {
if ($array[$a[$i]] > 2000) {
$red = 'class="red"';
}
$multi .= '<a ' . $red . ' href="uebersicht.php?ubl=' . $a[$i] . '&' . SID . '">UBL: ' . $a[$i] . ' - ' . $row['name'] . ' [' . $array[$a[$i]] . ']</a><br />';
unset($red);
}
}
$i++;
} while ($a[$i]);
}
$ressis = template('ressis');
$ress = ressistand($_SESSION['ubl']);
$ressis = tag2value('eisen', number_format($ress['eisen'], 0, ',', '.'), $ressis);
$ressis = tag2value('titan', number_format($ress['titan'], 0, ',', '.'), $ressis);
$ressis = tag2value('oel', number_format($ress['oel'], 0, ',', '.'), $ressis);
$ressis = tag2value('gold', number_format($ress['gold'], 0, ',', '.'), $ressis);
$ressis = tag2value('uran', number_format($ress['uran'], 0, ',', '.'), $ressis);
$ressis = tag2value('chanje', number_format($ress['chanje'], 0, ',', '.'), $ressis);
$sperren = template('sperren');
$content .= template('index');
$content = tag2value('ubl', $_SESSION['ubl'], $content);
$content = tag2value('content', $form . $c1 . '<table cellspacing="0" border="1"><tr valign="top"><td width="254px"><b>Potentielle Multis:</b><br />' . $multi . '</td><td width="254px"><b>Ressis buchen:</b><br />' . $ressis . '</td></tr>
<tr><td><b>Spieler sperren:</b>' . $sperren . '</td>
<td></td>
</tr>
</table>', $content);
echo $content;
示例7: db_connect
}
// Basisfunktionen laden
include "functions.php";
include "debuglib.php";
// mit datenbank verbinden
$dbh = db_connect();
$content = template('admin_form');
if ($_GET['ubl']) {
$_POST['ubl'] = $_GET['ubl'];
}
if (!$_POST['ubl']) {
$_POST['ubl'] = 1;
}
if ($_POST['ubl'] != '') {
if ($_POST['submit'] == 'ausfuehren') {
$ressis = ressistand($_POST['ubl']);
mysql_query("UPDATE `ressis` SET `eisen` = eisen+(" . number_format($_POST['eisen'], 0, '', '') . "), `titan` = titan+(" . number_format($_POST['titan'], 0, '', '') . "), `oel` = oel+(" . number_format($_POST['oel'], 0, '', '') . "), `uran` = uran+(" . number_format($_POST['uran'], 0, '', '') . "), `gold` = gold+(" . number_format($_POST['gold'], 0, '', '') . "), `chanje` = chanje+(" . number_format($_POST['chanje'], 0, '', '') . ") WHERE `omni` = " . $_POST['ubl'] . " LIMIT 1;");
}
$select = "SELECT * FROM `user` WHERE 1 AND `omni` = '" . $_POST['ubl'] . "' LIMIT 1;";
$result = mysql_query($select, $dbh);
$row = mysql_fetch_array($result);
$_SESSION['user']['name'] = $row['name'];
$_SESSION['user']['sig'] = $row['sig'];
$_SESSION['user']['omni'] = $row['omni'];
$_SESSION['user']['base'] = $row['base'];
$_SESSION['user']['clan'] = $row['clan'];
$_SESSION['user']['mail'] = $row['email'];
$_SESSION['user']['points'] = number_format($row['points'], 0, '', '.');
$_SESSION['user']['ip'] = $_SERVER['REMOTE_ADDR'];
$_SESSION['user']['browser'] = $_SERVER['HTTP_USER_AGENT'];
// supporter