示例#1
0
 /**
  * Short description for function
  *
  * Long description (if any) ...
  *
  * @param  array                        $abilities Parameter description (if any) ...
  * @return void
  * @access public
  */
 public function rollAbilities()
 {
     $dice = Game::getDice();
     $dice->setSides(6);
     $dice->setRepeat(4);
     $dice->setKeep(3);
     foreach (AbilityHelper::getAbilities() as $ability) {
         $this->abilities[$ability] = $dice->rollandKeepSettings();
     }
     $dice->reset();
 }
示例#2
0
文件: Character.php 项目: Berdir/dnd
 public function checkSkill($skill, $take10 = FALSE)
 {
     // @todo Improve according to page 178 in Players Handbook.
     $modifier = floor($this->getLevel() / 2) + $this->getSkill($skill);
     if ($take10) {
         return $modifier + 10;
     } else {
         $dice = Game::getDice();
         return $dice->roll(20, 1, $modifier);
     }
 }