Exemplo n.º 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();
 }
Exemplo n.º 2
0
$standardArray->assignAbilities(array(Constants\Abilities::STR => 16, Constants\Abilities::CON => 14, Constants\Abilities::DEX => 13, Constants\Abilities::WIS => 12, Constants\Abilities::CHA => 11, Constants\Abilities::INT => 10));
$berdir->setAbilityScore($standardArray);
// $rollScore = AbilityHelper::factoryGenerator('RollingScore');
// $rollScore->rollAbilities();
// $berdir->setAbilityScore($rollScore);
$berdir->build();
$level = new Level($berdir);
$level->chooseFeat(new Feats\Powerattack());
$level->finish();
$berdir->activateFeat(Feats\Powerattack::Name);
$berdir->deactivateFeat(Feats\Powerattack::Name);
$berdir->rollInitiative();
Logger::debug($berdir->dump());
$curunair = Game::addCharacter('Curunair');
$curunair->setRace(new Race\Dwarf());
$fighter = $curunair->setClass(new Classes\Fighter());
$fighter->chooseTrainedSkill(array(Constants\Skills::ATHLETHICS, Constants\Skills::ENDURANCE, Constants\Skills::STREETWISE));
$standardArray = AbilityHelper::factoryGenerator('StandardArray');
$standardArray->assignAbilities(array(Constants\Abilities::STR => 16, Constants\Abilities::CON => 14, Constants\Abilities::DEX => 13, Constants\Abilities::WIS => 12, Constants\Abilities::CHA => 11, Constants\Abilities::INT => 10));
$curunair->setAbilityScore($standardArray);
// $rollScore = AbilityHelper::factoryGenerator('RollingScore');
// $rollScore->rollAbilities();
// $berdir->setAbilityScore($rollScore);
$curunair->build();
$level = new Level($curunair);
$level->chooseFeat(new Feats\Powerattack());
$level->finish();
$curunair->rollInitiative();
Logger::debug($curunair->dump());
$encounter = Game::startEncounter();
$encounter->start();