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


PHP Globals::getGameSpeed方法代码示例

本文整理汇总了PHP中Globals::getGameSpeed方法的典型用法代码示例。如果您正苦于以下问题:PHP Globals::getGameSpeed方法的具体用法?PHP Globals::getGameSpeed怎么用?PHP Globals::getGameSpeed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Globals的用法示例。


在下文中一共展示了Globals::getGameSpeed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: channel_msg_sd_list

function channel_msg_sd_list($fp, $rdata, $account, $player)
{
    if (preg_match('/^:(.*)!(.*)@(.*)\\sPRIVMSG\\s(.*)\\s:!sd list\\s$/i', $rdata, $msg)) {
        global $sds;
        $nick = $msg[1];
        $user = $msg[2];
        $host = $msg[3];
        $channel = $msg[4];
        echo_r('[SD_LIST] by ' . $nick . ' in ' . $channel);
        $refresh_per_hour = 250 * Globals::getGameSpeed($player->getGameID());
        $refresh_per_sec = $refresh_per_hour / 3600;
        fputs($fp, 'PRIVMSG ' . $channel . ' :The following supply/demand list has been recorded:' . EOL);
        fputs($fp, 'PRIVMSG ' . $channel . ' :Sector   Amount' . EOL);
        foreach ($sds as $sd) {
            if ($sd[3] == $channel) {
                $seconds_since_refresh = time() - $sd[2];
                if ($seconds_since_refresh < 0) {
                    $seconds_since_refresh = 0;
                }
                $amt_to_add = floor($seconds_since_refresh * $refresh_per_sec);
                if ($sd[1] + $amt_to_add > 4000) {
                    fputs($fp, 'PRIVMSG ' . $channel . ' : ' . sprintf('%4s', $sd[0]) . '     ' . sprintf('%4s', 'full') . EOL);
                } else {
                    fputs($fp, 'PRIVMSG ' . $channel . ' : ' . sprintf('%4s', $sd[0]) . '     ' . sprintf('%4s', $sd[1] + $amt_to_add) . EOL);
                }
            }
        }
        return true;
    }
}
开发者ID:smrealms,项目名称:smrv2.0,代码行数:30,代码来源:channel_msg_sd.php

示例2: USING

$template->assign('PageTopic', 'Ship Dealer');
$db->query('SELECT ship_type_id FROM location
			JOIN location_sells_ships USING (location_type_id)
			WHERE sector_id = ' . $db->escapeNumber($player->getSectorID()) . '
				AND game_id = ' . $db->escapeNumber($player->getGameID()) . '
				AND location_type_id = ' . $db->escapeNumber($var['LocationID']));
$shipsSold = array();
if ($db->getNumRows() > 0) {
    $container = create_container('skeleton.php', 'shop_ship.php');
    transfer('LocationID');
    while ($db->nextRecord()) {
        $shipTypeID = $db->getField('ship_type_id');
        $shipsSold[$shipTypeID] =& AbstractSmrShip::getBaseShip(Globals::getGameType($player->getGameID()), $shipTypeID);
        $container['ship_id'] = $shipTypeID;
        $container['level_needed'] = $shipsSold[$shipTypeID]['Level'];
        $shipsSoldHREF[$shipTypeID] = SmrSession::getNewHREF($container);
    }
}
$template->assign('ShipsSold', $shipsSold);
$template->assign('ShipsSoldHREF', $shipsSoldHREF);
if (isset($var['ship_id'])) {
    $compareShip = AbstractSmrShip::getBaseShip(Globals::getGameType($player->getGameID()), $var['ship_id']);
    $compareShip['RealSpeed'] = $compareShip['Speed'] * Globals::getGameSpeed($player->getGameID());
    $compareShip['Turns'] = round($player->getTurns() * $compareShip['Speed'] / $ship->getSpeed());
    $container = create_container('shop_ship_processing.php');
    transfer('LocationID');
    transfer('ship_id');
    $compareShip['BuyHREF'] = SmrSession::getNewHREF($container);
    $template->assign('CompareShip', $compareShip);
}
开发者ID:smrealms,项目名称:smrv2.0,代码行数:30,代码来源:shop_ship.php

示例3: define

<?php

//general info
define('MAX_TURNS', Globals::getGameSpeed($player->getGameID()) * 400);
$limit = 10;
define('MAXIMUM_FLEET_SIZE', $limit);
//result info
define('SHIELD_DMG_DONE', 0);
define('DRONE_DMG_DONE', 1);
define('ARMOUR_DMG_DONE', 2);
define('DRONES_FIRED', 3);
define('RESULT_OF_WEAPON', 4);
define('TARGET', 5);
define('DRONES_HIT_BEHIND_SHIELDS', 6);
//result[4]
define('NORMAL_HIT', 0);
define('SHIELD_ON_DRONES', 1);
define('ARMOUR_ON_SHIELD', 2);
define('PORT_DEAD', 3);
define('FINAL_HIT', 4);
define('WEAPON_MISS', 5);
define('ALREADY_DEAD', 6);
define('SHIELD_ON_ARMOUR', 7);
//player array info
define('PLAYER_ID', 0);
define('PLAYER_NAME', 1);
define('ALLIANCE_ID', 2);
define('RACE_ID', 3);
define('CREDITS', 4);
define('TURNS', 5);
define('ALIGNMENT', 6);
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:port_attack_processing.php

示例4: number_format

?>
</td>
					</tr>
					<tr>
						<td align="right">Game Type</td>
						<td>&nbsp;</td>
						<td align="left"><?php 
echo Globals::getGameType($StatsGameID);
?>
</td>
					</tr>
					<tr>
						<td align="right">Game Speed</td>
						<td>&nbsp;</td>
						<td align="left"><?php 
echo Globals::getGameSpeed($StatsGameID);
?>
</td>
					</tr>
					<tr>
						<td align="right">Credits Needed</td>
						<td>&nbsp;</td>
						<td align="left"><?php 
echo number_format(Globals::getGameCreditsRequired($StatsGameID));
?>
</td>
					</tr>
					<tr>
						<td align="right">Stats Ignored</td>
						<td>&nbsp;</td>
						<td align="left"><?php 
开发者ID:smrealms,项目名称:smrv2.0,代码行数:31,代码来源:game_stats.php


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