本文整理汇总了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;
}