コード例 #1
0
 public function preRecoverUnits()
 {
     parent::preRecoverUnits();
     $b = Battle::getBattle();
     $scenario = $b->scenario;
     if ($this->wasIndecisive || !empty($scenario->noIndecision)) {
         return;
     }
     $turn = $b->gameRules->turn;
     if ($turn <= 3 && $this->wasIndecisive === false && $b->gameRules->phase == RED_MOVE_PHASE) {
         $Die = floor(6 * (rand() / getrandmax()));
         /* 1 or 2 is 0 or 1 */
         if ($Die < 2) {
             $this->isIndecisive = true;
             $this->wasIndecisive = true;
             $b->gameRules->flashMessages[] = "No Danish Movement this turn.";
             return;
         }
     }
     if ($turn == 4 && $this->wasIndecisive === false && $b->gameRules->phase == RED_MOVE_PHASE) {
         $this->isIndecisive = true;
         $this->wasIndecisive = true;
     }
 }
コード例 #2
0
 public function preRecoverUnits()
 {
     parent::preRecoverUnits();
 }