本文整理汇总了PHP中Globals::getGameType方法的典型用法代码示例。如果您正苦于以下问题:PHP Globals::getGameType方法的具体用法?PHP Globals::getGameType怎么用?PHP Globals::getGameType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Globals
的用法示例。
在下文中一共展示了Globals::getGameType方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2:
<?php
$shipID = $var['ship_id'];
$newShip =& AbstractSmrShip::getBaseShip(Globals::getGameType($player->getGameID()), $shipID);
$cost = $ship->getCostToUpgrade($shipID);
// trade master 33
// trip maker 30
//(22,25,23,75,43,55,61,24,21,38,67,33,49)
// Top racials minus ATM + top UG/FED are restricted
if ($newShip['AlignRestriction'] == 2 && $player->getAlignment() > -100) {
create_error('You can\'t buy smuggler ships!');
}
if ($newShip['AlignRestriction'] == 1 && $player->getAlignment() < 100) {
create_error('You can\'t buy federal ships!');
}
if ($newShip['RaceID'] != 1 && $player->getRaceID() != $newShip['RaceID']) {
create_error('You can\'t buy other race\'s ships!');
}
/*if ($player->getAccountID() == 101)
create_error('Cheaters do NOT get ships!');*/
// do we have enough cash?
if ($player->getCredits() < $cost) {
create_error('You do not have enough cash to purchase this ship!');
}
// adapt turns
$player->setTurns(round($player->getTurns() * $newShip['Speed'] / $ship->getSpeed()));
//Don't times by game speed as getSpeed doesn't include it meaning ratio will be the same but less work.
// take the money from the user
if ($cost > 0) {
$player->decreaseCredits($cost);
} else {
示例3: foreach
$Ships =& AbstractSmrShip::getAllBaseShips(Globals::getGameType($ThisPlayer->getGameID()));
Sorter::sortByNumElement($Ships, 'Name');
foreach ($Ships as &$Ship) {
?>
<option value="<?php
echo $Ship['ShipTypeID'];
?>
"><?php
echo $Ship['Name'];
?>
</option><?php
}
unset($Ship);
break;
case 'Weapons':
$Weapons =& SmrWeapon::getAllWeapons(Globals::getGameType($ThisPlayer->getGameID()));
Sorter::sortByNumMethod($Weapons, 'getName');
foreach ($Weapons as &$Weapon) {
?>
<option value="<?php
echo $Weapon->getWeaponTypeID();
?>
"><?php
echo $Weapon->getName();
?>
</option><?php
}
unset($Weapon);
break;
case 'Locations':
?>
示例4: foreach
foreach ($races as &$race) {
$file .= inify($race['Race Name']) . '=' . $race['Race ID'] . EOL;
}
unset($race);
$file .= '[Goods]
; ID = Name, BasePrice' . EOL;
$goods =& Globals::getGoods();
foreach ($goods as &$good) {
$file .= $good['ID'] . '=' . inify($good['Name']) . ',' . $good['BasePrice'] . EOL;
}
unset($good);
$file .= '[Weapons]
; Weapon = Race,Cost,Shield,Armour,Accuracy,Power level,EMP (%),Align Restriction,Attack Restriction
; Align: 0=none, 1=good, 2=evil, 3=newbie
; Attack: 0=none, 1=raid' . EOL;
$weapons =& SmrWeapon::getAllWeapons(Globals::getGameType($gameID));
foreach ($weapons as &$weapon) {
$file .= inify($weapon->getName()) . '=' . inify($weapon->getRaceName()) . ',' . $weapon->getCost() . ',' . $weapon->getShieldDamage() . ',' . $weapon->getArmourDamage() . ',' . $weapon->getBaseAccuracy() . ',' . $weapon->getPowerLevel() . ',' . $weapon->getEmpDamage() . ',' . $weapon->getBuyerRestriction() . ',' . ($weapon->isRaidWeapon() ? '1' : '0') . EOL;
}
unset($weapon);
$file .= '[ShipEquipment]
; Name = Cost' . EOL;
$hardwares =& Globals::getHardwareTypes();
foreach ($hardwares as &$hardware) {
$file .= inify($hardware['Name']) . '=' . $hardware['Cost'] . EOL;
}
unset($hardware);
$file .= '[Ships]
; Name = Race,Cost,TPH,Hardpoints,Power,+Equipment (Optional),+Restrictions(Optional)
; Restrictions:Align(Integer)' . EOL;
$ships =& AbstractSmrShip::getAllBaseShips($gameID);
示例5: ob_start
ob_start();
$time_start = getmicrotime();
// ********************************
// *
// * I n c l u d e s h e r e
// *
// ********************************
// config file
require_once "config.inc";
require_once ENGINE . "1.2/smr.inc";
// overwrite database class to use our db
require_once get_file_loc('SmrMySqlDatabase.class.inc');
require_once get_file_loc('SmrSession.class.inc');
require_once get_file_loc('Globals.class.inc');
// do we have a session?
if (SmrSession::$old_account_id == 0 || SmrSession::$game_id == 0 || Globals::getGameType(SmrSession::$game_id) != '1.2') {
header('Location: ' . URL . '/loader.php');
exit;
}
//include function
$includes = new SmrMySqlDatabase();
require_once get_file_loc('smr_account.inc');
require_once get_file_loc('smr_player.inc');
require_once get_file_loc('smr_ship.inc');
require_once get_file_loc('smr_sector.inc');
// We want these to be already defined as globals
$player = null;
$ship = null;
$sector = null;
$container = null;
$var = null;
示例6: doShipUpgrade
function doShipUpgrade(AbstractSmrPlayer &$player, $upgradeShipID)
{
$plotNearest = plotToNearest($player, AbstractSmrShip::getBaseShip(Globals::getGameType($player->getGameID()), $upgradeShipID));
if ($plotNearest == true) {
//We're already there!
//TODO: We're going to want to UNO after upgrading
return create_container('shop_ship_processing.php', '', array('ship_id' => $upgradeShipID));
}
//Otherwise return the plot
return $plotNearest;
}
示例7: number_format
?>
</td>
</tr>
<tr>
<td align="right">Alliance Max Vets</td>
<td> </td>
<td align="left"><?php
echo number_format(Globals::getAllianceMaxVets($StatsGameID));
?>
</td>
</tr>
<tr>
<td align="right">Game Type</td>
<td> </td>
<td align="left"><?php
echo Globals::getGameType($StatsGameID);
?>
</td>
</tr>
<tr>
<td align="right">Game Speed</td>
<td> </td>
<td align="left"><?php
echo Globals::getGameSpeed($StatsGameID);
?>
</td>
</tr>
<tr>
<td align="right">Credits Needed</td>
<td> </td>
<td align="left"><?php