当前位置: 首页>>代码示例>>PHP>>正文


PHP SR_Player::getMP方法代码示例

本文整理汇总了PHP中SR_Player::getMP方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::getMP方法的具体用法?PHP SR_Player::getMP怎么用?PHP SR_Player::getMP使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SR_Player的用法示例。


在下文中一共展示了SR_Player::getMP方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getStatus

 /**
  * 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(),
     // 			));
     // 		}
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:51,代码来源:Shadowfunc.php

示例2: onBrew

 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;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:15,代码来源:teleport.php


注:本文中的SR_Player::getMP方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。