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


PHP ResourceUpdate::CheckAndGetLabLevel方法代码示例

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


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

示例1: __construct

 public function __construct()
 {
     global $PLANET, $USER, $LNG, $resource, $reslist, $CONF, $db, $pricelist, $OfficerInfo;
     include_once ROOT_PATH . 'includes/functions/IsTechnologieAccessible.php';
     include_once ROOT_PATH . 'includes/functions/GetElementPrice.php';
     $template = new template();
     if ($PLANET[$resource[31]] == 0) {
         $template->message($LNG['bd_lab_required']);
         exit;
     }
     $bContinue = $this->CheckLabSettingsInQueue($PLANET) ? true : false;
     $TheCommand = request_var('cmd', '');
     $Element = request_var('tech', 0);
     $ListID = request_var('listid', 0);
     $PlanetRess = new ResourceUpdate();
     $PLANET[$resource[31] . '_inter'] = $PlanetRess->CheckAndGetLabLevel($USER, $PLANET);
     $PlanetRess->CalcResource();
     if (!empty($Element) && $bContinue && $USER['urlaubs_modus'] == 0 && ($USER[$resource[$Element]] < $pricelist[$Element]['max'] && IsTechnologieAccessible($USER, $PLANET, $Element) && in_array($Element, $reslist['tech'])) || $TheCommand == "cancel" || $TheCommand == "remove") {
         switch ($TheCommand) {
             case 'cancel':
                 $this->CancelBuildingFromQueue($PlanetRess);
                 break;
             case 'remove':
                 $this->RemoveBuildingFromQueue($ListID, $PlanetRess);
                 break;
             case 'insert':
                 $this->AddBuildingToQueue($Element, true);
                 break;
             case 'destroy':
                 $this->AddBuildingToQueue($Element, false);
                 break;
         }
     }
     $PlanetRess->SavePlanetToDB();
     $ScriptInfo = array();
     $TechQueue = $this->ShowTechQueue();
     foreach ($reslist['tech'] as $ID => $Element) {
         if (!IsTechnologieAccessible($USER, $PLANET, $Element)) {
             continue;
         }
         $CanBeDone = IsElementBuyable($USER, $PLANET, $Element);
         if (isset($pricelist[$Element]['max']) && $USER[$resource[$Element]] >= $pricelist[$Element]['max']) {
             $TechnoLink = "<font color=\"#FF0000\">" . $LNG['bd_maxlevel'] . "</font>";
         } elseif (MAX_RESEACH_QUEUE_SIZE > 1) {
             $LevelToDo = 1 + $USER[$resource[$Element]];
             $TechnoLink = $CanBeDone && $bContinue ? "<a href=\"game.php?page=buildings&amp;mode=research&amp;cmd=insert&amp;tech=" . $Element . "\"><font color=\"#00FF00\">" . ($USER['b_tech_id'] != 0 ? $LNG['bd_add_to_list'] : $LNG['bd_research'] . ($LevelToDo == 1 ? "" : "<br>" . $LNG['bd_lvl'] . " " . $LevelToDo)) . "</font></a>" : "<font color=\"#FF0000\">" . $LNG['bd_research'] . ($LevelToDo == 1 ? "" : "<br>" . $LNG['bd_lvl'] . " " . $LevelToDo) . "</font>";
             if ($USER['b_tech_id'] != 0) {
                 $template->loadscript('researchlist.js');
                 $template->execscript('ReBuildView();Techlist();');
                 $ScriptInfo = array('bd_cancel' => $LNG['bd_cancel'], 'bd_continue' => $LNG['bd_continue'], 'bd_finished' => $LNG['bd_finished'], 'build' => $TechQueue);
             }
         } else {
             if ($USER['b_tech_id'] == 0) {
                 $LevelToDo = 1 + $USER[$resource[$Element]];
                 $TechnoLink = $CanBeDone && $bContinue ? "<a href=\"game.php?page=buildings&amp;mode=research&amp;cmd=insert&amp;tech=" . $Element . "\"><font color=\"#00FF00\">" . $LNG['bd_research'] . ($LevelToDo == 1 ? "" : "<br>" . $LNG['bd_lvl'] . " " . $LevelToDo) . "</font></a>" : "<font color=\"#FF0000\">" . $LNG['bd_research'] . ($LevelToDo == 1 ? "" : "<br>" . $LNG['bd_lvl'] . " " . $LevelToDo) . "</font>";
             } else {
                 if ($USER['b_tech_id'] == $Element) {
                     $template->loadscript('research.js');
                     if ($USER['b_tech_planet'] == $PLANET['id']) {
                         $ScriptInfo = array('tech_time' => $USER['b_tech'], 'tech_name' => '', 'game_name' => $CONF['game_name'], 'tech_lang' => $LNG['tech'][$USER['b_tech_id']], 'tech_home' => $USER['b_tech_planet'], 'tech_id' => $USER['b_tech_id'], 'bd_cancel' => $LNG['bd_cancel'], 'bd_ready' => $LNG['bd_ready'], 'bd_continue' => $LNG['bd_continue']);
                     } else {
                         $ScriptInfo = array('tech_time' => $USER['b_tech'], 'tech_name' => $LNG['bd_on'] . '<br>' . $TechQueue['planet'], 'tech_home' => $USER['b_tech_planet'], 'tech_id' => $USER['b_tech_id'], 'game_name' => $CONF['game_name'], 'tech_lang' => $LNG['tech'][$USER['b_tech_id']], 'bd_cancel' => $LNG['bd_cancel'], 'bd_ready' => $LNG['bd_ready'], 'bd_continue' => $LNG['bd_continue']);
                     }
                     $TechnoLink = '<div id="research"></div>';
                 } else {
                     $TechnoLink = '<center>-</center>';
                 }
             }
         }
         $ResearchList[] = array('id' => $Element, 'maxinfo' => isset($pricelist[$Element]['max']) && $pricelist[$Element]['max'] != 255 ? sprintf($LNG['bd_max_lvl'], $pricelist[$Element]['max']) : '', 'name' => $LNG['tech'][$Element], 'descr' => $LNG['res']['descriptions'][$Element], 'price' => GetElementPrice($USER, $PLANET, $Element), 'time' => pretty_time(GetBuildingTime($USER, $PLANET, $Element)), 'restprice' => $this->GetRestPrice($Element), 'elvl' => $Element == 106 ? $USER['rpg_espion'] * $OfficerInfo[610]['info'] . " (" . $LNG['tech'][610] . ")" : ($Element == 108 ? $USER['rpg_commandant'] * $OfficerInfo[611]['info'] . " (" . $LNG['tech'][611] . ")" : false), 'lvl' => $USER[$resource[$Element]], 'link' => $TechnoLink, 'oldlink' => MAX_RESEACH_QUEUE_SIZE == 1, 'queue' => $TechQueue);
     }
     $template->assign_vars(array('ResearchList' => $ResearchList, 'IsLabinBuild' => !$bContinue, 'ScriptInfo' => json_encode($ScriptInfo), 'bd_building_lab' => $LNG['bd_building_lab'], 'bd_remaining' => $LNG['bd_remaining'], 'bd_lvl' => $LNG['bd_lvl'], 'fgf_time' => $LNG['fgf_time']));
     $template->show('buildings_research.tpl');
 }
开发者ID:sonicmaster,项目名称:RPG,代码行数:74,代码来源:class.ShowResearchPage.php


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