当前位置: 首页>>代码示例>>PHP>>正文


PHP ressistand函数代码示例

本文整理汇总了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;
}
开发者ID:o-wars,项目名称:o-wars,代码行数:16,代码来源:functions.php

示例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 .= '&nbsp;&nbsp;&nbsp;<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]);
开发者ID:o-wars,项目名称:o-wars,代码行数:67,代码来源:eventhandler.php

示例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&amp;' . SID . '">[Runde starten!]</a><br /><br /><form method="post" action="?' . SID . '" enctype="multipart/form-data">
	Der Einsatz betr&auml;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="&auml;ndern" /></form>Minimum: 1 / Maximum: 250';
} elseif ($_SESSION['card'] == 2) {
    $content = showcards() . "<br /><b>Derzeitige Punkte: " . score() . '</b><br /><a href="?action=hit&amp;' . SID . '">hit</a> / <a href="?action=stand&amp;' . SID . '">stand</a><br />';
} else {
    $content = showcards() . "<br /><b>Derzeitige Punkte: " . score() . '</b><br /><a href="?action=hit&amp;' . SID . '">hit</a> / <a href="?action=stand&amp;' . 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">
开发者ID:o-wars,项目名称:o-wars,代码行数:31,代码来源:cards.php

示例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;
开发者ID:o-wars,项目名称:o-wars,代码行数:31,代码来源:plasmapunkte.php

示例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&uuml;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;
}
开发者ID:o-wars,项目名称:o-wars,代码行数:23,代码来源:agenten.php

示例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] . '&amp;' . SID . '">UBL: ' . $a[$i] . '  - &nbsp;' . $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;
开发者ID:o-wars,项目名称:o-wars,代码行数:31,代码来源:uebersicht.php

示例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
开发者ID:o-wars,项目名称:o-wars,代码行数:31,代码来源:admin_panel.php


注:本文中的ressistand函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。