示例#1
0
 /**
  * Short description for function
  *
  * Long description (if any) ...
  *
  * @param  object    $char Parameter description (if any) ...
  * @return number    Return description (if any) ...
  * @access protected
  */
 protected function getDamageBonus(C $char)
 {
     $level = $char->getLevel();
     if ($level < 11) {
         $dmgBonus = 2;
     } elseif ($level < 21) {
         $dmgBonus = 4;
     } else {
         $dmgBonus = 6;
     }
     if ($char->getEquipment(Constants\Common::EQUIPMENT_MAINHAND)->getType() == Constants\Common::WEAPON_TWOHAND) {
         $dmgBonus *= 1.5;
     }
     return $dmgBonus;
 }
示例#2
0
文件: Level.php 项目: Berdir/dnd
 /**
  * Short description for function
  *
  * Long description (if any) ...
  *
  * @param  object                        $char Parameter description (if any) ...
  * @return void
  * @access public
  * @throws Exception_NotEnoughExperience Exception description (if any) ...
  */
 public function __construct(Character $char)
 {
     $this->char = $char;
     $level = $char->getLevel();
     $xp = $char->getExperience();
     if (self::$xpTable[$level + 1] <= $xp) {
         Logger::info('Starting Level Upgrade to Level %s from Character "%s"', array($level + 1, $char->getName()));
         $this->gain = self::$gainTable[$level + 1];
         $this->newLevel = $level + 1;
         Logger::debug('Aviable at this level: ' . $this->getAviable());
     } else {
         throw new Exception_NotEnoughExperience($char);
     }
 }