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


PHP Shadowfunc::getStatsLvlUpArray方法代码示例

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


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

示例1: execute

 public static function execute(SR_Player $player, array $args)
 {
     $p = $player->getParty();
     # Can lvlup in combat?
     //		if ($p->isFighting())
     //		{
     //			$player->message('You cannot lvlup when your party is fighting.');
     //			return false;
     //		}
     // 		$bot = Shadowrap::instance($player);
     $runner = $player->isRunner();
     $have = $player->getBase('karma');
     if (count($args) !== 1) {
         $cost = self::KARMA_COST_SPELL;
         // 			$b = chr(2);
         $max = $runner ? self::MAX_VAL_SKILL_RUNNER : self::MAX_VAL_SKILL;
         $player->msg('5057', array($max, Shadowfunc::getStatsLvlUpArray($player, SR_Player::$SKILL, self::KARMA_COST_SKILL, $max)));
         // 			$player->message('Skills to upgrade: ' . Shadowfunc::getStatsLvlUpArray($player, SR_Player::$SKILL, self::KARMA_COST_SKILL, $runner?self::MAX_VAL_SKILL_RUNNER:self::MAX_VAL_SKILL));
         $arr = SR_Player::$ATTRIBUTE;
         unset($arr['es']);
         //ignore essence
         $max = $runner ? self::MAX_VAL_ATTRIBUTE_RUNNER : self::MAX_VAL_ATTRIBUTE;
         $player->msg('5058', array($max, Shadowfunc::getStatsLvlUpArray($player, $arr, self::KARMA_COST_ATTRIBUTE, $max)));
         // 			$player->message('Attributes to upgrade: ' . Shadowfunc::getStatsLvlUpArray($player, $arr, self::KARMA_COST_ATTRIBUTE, $runner?self::MAX_VAL_ATTRIBUTE_RUNNER:self::MAX_VAL_ATTRIBUTE));
         $max = $runner ? self::MAX_VAL_KNOWLEDGE_RUNNER : self::MAX_VAL_KNOWLEDGE;
         $player->msg('5059', array($max, Shadowfunc::getStatsLvlUpArray($player, SR_Player::$KNOWLEDGE, self::KARMA_COST_KNOWLEDGE, $max)));
         // 			$player->message('Knowledge to upgrade: ' . Shadowfunc::getStatsLvlUpArray($player, SR_Player::$KNOWLEDGE, self::KARMA_COST_KNOWLEDGE, $runner?self::MAX_VAL_KNOWLEDGE_RUNNER:self::MAX_VAL_KNOWLEDGE));
         $s = '';
         if ($player->getSpellData()) {
             $format = $player->lang('fmt_lvlup');
             $max = $runner ? self::MAX_VAL_SPELL_RUNNER : self::MAX_VAL_SPELL;
             $nl = $player->getSpellData();
             asort($nl);
             foreach (array_reverse($nl) as $name => $base) {
                 $k = 'K';
                 $bold = '';
                 $could = 0;
                 if ($base >= $max) {
                     $n = '*';
                     $k = '';
                 } else {
                     $n = ($base + 1) * 2;
                     if ($n <= $have) {
                         $bold = chr(2);
                         $could = 1;
                         // 							$n = $b.$n.'K'.$b;
                         // 							$name = $b.$name.$b;
                     } else {
                         // 							$n = $n.'K';
                     }
                 }
                 $s .= sprintf($format, $name, $base + 1, $n, $bold, $k, $could);
                 // 					$s .= sprintf(', %s:%s(%s)', $name, ($base+1), $n);
             }
         }
         $s = $s === '' ? $player->lang('none') : ltrim($s, ',; ');
         return $player->msg('5060', array($max, $s));
         // 			$player->message('Spells to upgrade: '.$s);
         // 			return true;
     }
     $f = strtolower($args[0]);
     # Shortcuts
     if (isset(SR_Player::$SKILL[$f])) {
         $f = SR_Player::$SKILL[$f];
     }
     if (isset(SR_Player::$ATTRIBUTE[$f])) {
         $f = SR_Player::$ATTRIBUTE[$f];
     }
     if (isset(SR_Player::$KNOWLEDGE[$f])) {
         $f = SR_Player::$KNOWLEDGE[$f];
     }
     // 		if ($f === 'essence') { $bot->reply('You can not levelup your essence.'); return false; }
     if ($f === 'essence') {
         $player->msg('1024');
         // 			$bot->reply('You can not levelup your essence.');
         return false;
     }
     $is_spell = false;
     $cost = self::getKarmaCostFactor($f);
     if (in_array($f, SR_Player::$SKILL)) {
         $level = $player->getBase($f);
         // 			$cost = self::KARMA_COST_SKILL;
         $max = $runner ? self::MAX_VAL_SKILL_RUNNER : self::MAX_VAL_SKILL;
     } elseif (in_array($f, SR_Player::$ATTRIBUTE)) {
         $level = $player->getBase($f);
         // 			$cost = self::KARMA_COST_ATTRIBUTE;
         $max = $runner ? self::MAX_VAL_ATTRIBUTE_RUNNER : self::MAX_VAL_ATTRIBUTE;
     } elseif (in_array($f, SR_Player::$KNOWLEDGE)) {
         $level = $player->getBase($f);
         // 			$cost = self::KARMA_COST_KNOWLEDGE;
         $max = $runner ? self::MAX_VAL_KNOWLEDGE_RUNNER : self::MAX_VAL_KNOWLEDGE;
     } elseif (false !== ($spell = SR_Spell::getSpell($f))) {
         $level = $spell->getBaseLevel($player);
         // 			$cost = self::KARMA_COST_SPELL;
         $is_spell = true;
         $max = $runner ? self::MAX_VAL_SPELL_RUNNER : self::MAX_VAL_SPELL;
     } else {
         $player->msg('1024');
         // 			$bot->reply('You can only levelup attributes, skills, knowledge and spells.');
         return false;
//.........这里部分代码省略.........
开发者ID:sinfocol,项目名称:gwf3,代码行数:101,代码来源:lvlup.php


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