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


PHP Game::getMissionName方法代码示例

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


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

示例1: getOrgModeName

 /**
  * Returns the translated original mode name.
  *
  * @return string
  */
 public function getOrgModeName()
 {
     return Game::getMissionName($this->getOrgMode());
 }
开发者ID:enriquesomolinos,项目名称:Bengine,代码行数:9,代码来源:Event.php

示例2: sendFleet


//.........这里部分代码省略.........
             $data["silicon"] = _pos(Game::getPlanet()->getData("silicon"));
         }
         if ($data["hydrogen"] > Game::getPlanet()->getData("hydrogen") - $data["consumption"]) {
             $data["hydrogen"] = _pos(Game::getPlanet()->getData("hydrogen") - $data["consumption"]);
         }
         if ($mode == 13) {
             $data["duration"] = _pos($holdingTime);
             if ($data["duration"] > 24) {
                 $data["duration"] = 24;
             }
             $data["duration"] *= 3600;
         }
         $capa = $temp["capacity"] - $data["consumption"] - $data["metal"] - $data["silicon"] - $data["hydrogen"];
         // Reduce used capacity automatically
         if ($capa < 0) {
             if ($capa + $data["hydrogen"] > 0) {
                 $data["hydrogen"] -= abs($capa);
             } else {
                 $capa += $data["hydrogen"];
                 $data["hydrogen"] = 0;
                 if ($capa + $data["silicon"] > 0 && $capa < 0) {
                     $data["silicon"] -= abs($capa);
                 } else {
                     if ($capa < 0) {
                         $capa += $data["silicon"];
                         $data["silicon"] = 0;
                         if ($capa + $data["metal"] && $capa < 0) {
                             $data["metal"] -= abs($capa);
                         } else {
                             if ($capa < 0) {
                                 $data["metal"] = 0;
                             }
                         }
                     }
                 }
             }
         }
         $data["capacity"] = $temp["capacity"] - $data["consumption"] - $data["metal"] - $data["silicon"] - $data["hydrogen"];
         if ($data["capacity"] < 0) {
             Logger::dieMessage("NOT_ENOUGH_CAPACITY");
         }
         // If mission is recycling, get just the capacity of the recyclers.
         if ($mode == 9 && $data["capacity"] > 0) {
             $_result = Core::getQuery()->select("ship_datasheet", "capicity", "", "unitid = '37'");
             // It is __capacity__ and not capicity
             $_row = $_result->fetchRow();
             $_result->closeCursor();
             $recCapa = $_row["capicity"] * $temp["ships"][37]["quantity"];
             if ($data["capacity"] >= $recCapa) {
                 $data["capacity"] = $recCapa;
             }
         }
         $time = Game::getFlyTime($distance, $data["maxspeed"], $temp["speed"]);
         $data["time"] = $time;
         if ($mode == 18) {
             $data["alliance_attack"] = $temp["alliance_attack"];
             $mainFleet = Game::getEH()->getMainFormationFleet($data["alliance_attack"]["eventid"]);
             $allFleets = Game::getEH()->getFormationFleets($data["alliance_attack"]["eventid"]);
             $numFleets = 1;
             $formationUser[$mainFleet->get("user")] = true;
             /* @var Bengine_Game_Model_Fleet $oneFleet */
             foreach ($allFleets as $oneFleet) {
                 $numFleets++;
                 $formationUser[$oneFleet->get("user")] = true;
             }
             unset($formationUser[Core::getUser()->get("userid")]);
             if ($numFleets >= Core::getOptions()->get("MAX_FORMATION_FLEETS")) {
                 Logger::dieMessage("MAX_FORMATION_FLEETS_EXCEEDED");
             }
             if (count($formationUser) >= Core::getOptions()->get("MAX_FORMATION_USER")) {
                 Logger::dieMessage("MAX_FORMATION_USER_EXCEEDED");
             }
             if ($data["time"] + TIME > ($mainFleet["time"] - TIME) * (1 + Core::getOptions()->get("MAX_FORMATION_DELAY")) + TIME) {
                 Logger::dieMessage("MAX_FORMATION_DELAY_EXCEEDED");
             }
         }
         Hook::event("SendFleet", array(&$data, &$time, &$temp, $distance));
         Core::getQuery()->delete("temp_fleet", "planetid = ?", null, null, array(Core::getUser()->get("curplanet")));
         $handler = Game::getEH()->addEvent($mode, $time + TIME, Core::getUser()->get("curplanet"), Core::getUser()->get("userid"), isset($temp["destination"]) ? $temp["destination"] : null, $data);
         Core::getTPL()->assign("mission", Game::getMissionName($mode));
         Core::getTPL()->assign("mode", $mode);
         Core::getTPL()->assign("distance", fNumber($distance));
         Core::getTPL()->assign("speed", fNumber($temp["maxspeed"]));
         Core::getTPL()->assign("consume", fNumber($data["consumption"]));
         Core::getTPL()->assign("start", Game::getPlanet()->getCoords(false));
         Core::getTPL()->assign("target", $data["galaxy"] . ":" . $data["system"] . ":" . $data["position"]);
         Core::getTPL()->assign("arrival", Date::timeToString(1, $handler->getFinishTime()));
         if ($returnTime = $handler->getReturnTime()) {
             Core::getTPL()->assign("return", Date::timeToString(1, $returnTime));
         }
         $fleet = array();
         foreach ($data["ships"] as $key => $value) {
             $fleet[$key]["name"] = Core::getLanguage()->getItem($value["name"]);
             $fleet[$key]["quantity"] = fNumber($value["quantity"]);
         }
         Core::getTPL()->addLoop("fleet", $fleet);
         $this->setTemplate("mission/step4");
     }
     return $this;
 }
开发者ID:enriquesomolinos,项目名称:Bengine,代码行数:101,代码来源:Mission.php

示例3: getModeName

 /**
  * Returns the translated event mode name.
  *
  * @return string
  */
 public function getModeName()
 {
     return Game::getMissionName($this->get("event_type_id"));
 }
开发者ID:enriquesomolinos,项目名称:Bengine,代码行数:9,代码来源:Type.php


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