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


PHP Battle::pokePlayer方法代码示例

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


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

示例1: selectNextPhase

 function selectNextPhase($click)
 {
     global $phase_name;
     if ($this->mode == MOVING_MODE && $this->moveRules->movesLeft()) {
         return false;
     }
     if ($this->moveRules->anyUnitIsMoving) {
         $this->moveRules->stopMove($this->force->units[$this->moveRules->movingUnitId]);
     }
     if (($this->gameHasCombatResolutionMode == false || $this->force->moreCombatToResolve() == false) && $this->moveRules->anyUnitIsMoving == false) {
         /* @var Battle $battle */
         $battle = Battle::getBattle();
         $victory = $battle->victory;
         for ($i = 0; $i < count($this->phaseChanges); $i++) {
             if ($this->phaseChanges[$i]->currentPhase == $this->phase) {
                 $this->phase = $this->phaseChanges[$i]->nextPhase;
                 //                    $prevMode = $this->mode;
                 $this->mode = $this->phaseChanges[$i]->nextMode;
                 //                    if($this->gameHasCombatResolutionMode === false && $this->mode == COMBAT_RESOLUTION_MODE && $prevMode == COMBAT_SETUP_MODE){
                 //                        $this->combatRules->combatsToResolve = $this->combatRules->combats;
                 //                    }
                 $this->replacementsAvail = false;
                 $this->phaseClicks[] = $click + 1;
                 $this->phaseClickNames[] = $phase_name[$this->phase];
                 if ($this->phaseChanges[$i]->phaseWillIncrementTurn == true) {
                     $this->incrementTurn();
                 }
                 if ($this->attackingForceId != $this->phaseChanges[$i]->nextAttackerId) {
                     $battle = Battle::getBattle();
                     $players = $battle->players;
                     $this->playTurnClicks[] = $click + 1;
                     if ($players[1] != $players[2]) {
                         Battle::pokePlayer($players[$this->phaseChanges[$i]->nextAttackerId]);
                     }
                     $victory->playerTurnChange($this->phaseChanges[$i]->nextAttackerId);
                 }
                 $this->attackingForceId = $this->phaseChanges[$i]->nextAttackerId;
                 $this->defendingForceId = $this->phaseChanges[$i]->nextDefenderId;
                 $this->force->setAttackingForceId($this->attackingForceId, $this->defendingForceId);
                 $victory->phaseChange();
                 $this->force->recoverUnits($this->phase, $this->moveRules, $this->mode);
                 if ($this->turn > $this->maxTurn) {
                     $victory->gameEnded();
                     $this->flashMessages[] = "@gameover";
                 }
                 return true;
             }
         }
     }
     return false;
 }
开发者ID:daverodal,项目名称:wargaming,代码行数:51,代码来源:GameRules.php


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