Exemplo n.º 1
0
 /**
  * Return status string for a player.
  * @param SR_Player $player
  */
 public static function getStatus(SR_Player $player, $key = '5014')
 {
     $args = array();
     # Scanner in Use?
     if ($key > 5015) {
         $args[] = $player->getName();
     }
     # Pre magic
     $args = array_merge($args, array($player->getGender(), $player->getRace(), $player->getBase('level'), $player->get('level'), $player->getHP(), $player->getMaxHP()));
     # Magic?
     if ($player->getBase('magic') >= 0) {
         $key++;
         # different event
         $args = array_merge($args, array($player->getMP(), $player->getMaxMP()));
     }
     # After magic
     $args = array_merge($args, array($player->get('attack'), $player->get('defense'), $player->get('min_dmg'), $player->get('max_dmg'), $player->get('marm'), $player->get('farm'), round($player->getBase('xp'), 2), $player->getBase('karma'), round($player->getNuyen(), 2), $player->displayWeight(), $player->displayMaxWeight()));
     return Shadowrun4::lang($key, $args);
     # Status message
     // 		if ($player->getBase('magic') >= 0)
     // 		{
     // 			return Shadowrun4::lang('5014', array(
     // 				$player->getGender(), $player->getRace(), $player->getBase('level'), $player->get('level'),
     // 				$player->getHP(), $player->getMaxHP(),
     // 				$player->getMP(), $player->getMaxMP(),
     // 				$player->get('attack'), $player->get('defense'),
     // 				$player->get('min_dmg'), $player->get('max_dmg'),
     // 				$player->get('marm'), $player->get('farm'),
     // 				round($player->getBase('xp'), 2), $player->getBase('karma'),
     // 				round($player->getNuyen(), 2),
     // 				$player->displayWeight(), $player->displayMaxWeight(),
     // 			));
     // 		}
     // 		else
     // 		{
     // 			return Shadowrun4::lang('5015', array(
     // 				$player->getGender(), $player->getRace(), $player->getBase('level'), $player->get('level'),
     // 				$player->getHP(), $player->getMaxHP(),
     // 				$player->get('attack'), $player->get('defense'),
     // 				$player->get('min_dmg'), $player->get('max_dmg'),
     // 				$player->get('marm'), $player->get('farm'),
     // 				round($player->getBase('xp'), 2), $player->getBase('karma'),
     // 				round($player->getNuyen(), 2),
     // 				$player->displayWeight(), $player->displayMaxWeight(),
     // 			));
     // 		}
 }
Exemplo n.º 2
0
 public function onBrew(SR_Player $player, $mp, $diff, $hits)
 {
     if ($player->getMP() < $mp) {
         $player->msg('1077', array($mp, $player->getMP()));
         // 			$player->message(sprintf('You need %s MP to brew this potion, but you got only %s.', $mp, $player->getMP()));
         return false;
     }
     $player->healMP(-$mp);
     $es = $player->get('essence');
     $al = $player->get('alchemy');
     $wi = $player->get('wisdom');
     $dices = $es * 3 + $al * 2 + $wi;
     $hit = Shadowfunc::dicePool($dices, $diff, $diff);
     return $hit >= $hits;
 }