/** * Short description for function * * Long description (if any) ... * * @return unknown Return description (if any) ... * @access public */ public function getName() { return L::singleton()->t(static::Name); }
function __construct($prerequisites, \DnDEngine\Character $char) { parent::__construct(L::singleton()->t('Prerequisites not met for %s, requires %s.', array($char->getName(), $prerequisites))); }
/** * Short description for function * * Long description (if any) ... * * @return string Return description (if any) ... * @access public */ public function getPrerequisites() { return L::singleton()->t('15 Strength'); }
/** * Short description for function * * Long description (if any) ... * * @return unknown Return description (if any) ... * @access public */ public function getName() { return L::singleton()->t($this->name); }
* @version SVN: $Id:$ * @link http://pear.php.net/package/Language * @see References to other sections (if any)... */ namespace DnDEngine; use DnDEngine\Race; use DnDEngine\Classes; use DnDEngine\Constants; use DnDEngine\Feats; date_default_timezone_set('Europe/Zurich'); /** * Description for include */ include '../init.php'; Language::setLanguage('German'); Logger::addListener('StdOut'); Game::setName('Test'); $berdir = Game::addCharacter('Berdir'); $berdir->setRace(new Race\Dwarf()); $fighter = $berdir->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)); $berdir->setAbilityScore($standardArray); // $rollScore = AbilityHelper::factoryGenerator('RollingScore'); // $rollScore->rollAbilities(); // $berdir->setAbilityScore($rollScore); $berdir->build(); $level = new Level($berdir); $level->chooseFeat(new Feats\Powerattack());
/** * Short description for function * * Long description (if any) ... * * @return mixed Return description (if any) ... * @access public */ public function dump() { return Language::singleton()->t(' ==== Dumping Character Information: === Name : %s Race : %s Class: %s Hitpoints: %s/%s Speed : %s Vision : %s Size : %s Ability Score: %s', array($this->getName(), $this->getRace()->getName(), $this->getClass()->getName(), $this->getHitPoints(), $this->getMaxHitPoints(), $this->getSpeed(), $this->getVision(), $this->getSize(), $this->getAbilities())); }
/** * Short description for function * * Long description (if any) ... * * @return string Return description (if any) ... * @access public */ public function getPrerequisites() { return Language::singleton()->t('Human'); }
/** * Short description for function * * Long description (if any) ... * * @param unknown $message Parameter description (if any) ... * @param unknown $level Parameter description (if any) ... * @return boolean Return description (if any) ... * @access public */ public function log($message, $level) { if (!$this->isEnabled($level)) { return false; } $levelText = Language::singleton()->t(Logger::getText($level)); foreach (explode("\n", $message) as $line) { echo date('d.m.Y H:i:s:' . (int) (round(microtime(), 4) * 1000) . ' : ') . $levelText . ' : ' . trim($line) . "\n"; } }
/** * Short description for function * * Long description (if any) ... * * @param unknown $message Parameter description (if any) ... * @param integer $level Parameter description (if any) ... * @param array $paramaters Parameter description (if any) ... * @return void * @access public * @static */ public static function log($message, $level = self::INFO, $paramaters = array()) { $message = Language::singleton()->t($message, $paramaters); foreach (self::$listeners as $listener) { $listener->log($message, $level); } }