本文整理汇总了PHP中SR_Player::getRace方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::getRace方法的具体用法?PHP SR_Player::getRace怎么用?PHP SR_Player::getRace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR_Player
的用法示例。
在下文中一共展示了SR_Player::getRace方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onTrollReward
private function onTrollReward(SR_NPC $npc, SR_Player $player)
{
$max = $player->isRunner() ? Shadowcmd_lvlup::MAX_VAL_ATTRIBUTE_RUNNER : Shadowcmd_lvlup::MAX_VAL_ATTRIBUTE;
$base = $player->getBase('magic');
if ($base >= $max) {
$ny = 5000;
$player->giveNuyen($ny);
return $player->message($this->lang('reward_ny', array($ny)));
// return $player->message('Larry hands you another 5000 nuyen!');
}
$player->message($this->lang('reward1'));
// $player->message('Larry leads you to a shamane: "This is our shamane, Srando, he can help you."');
$race = $player->getRace();
if ($race === 'Ork' || $race === 'Troll') {
$player->message($this->lang('reward2', array($race)));
// $player->message('The shamane says: "You are a strong '.$race.'. You just need to calm down sometime."');
$player->message($this->lang('reward3'));
// $player->message('You are starting to argue, but the shamane continues: "If you calm you have more time to strengthen yourself. Focus yourself, and the path is clear."');
$player->message($this->lang('reward4'));
// $player->message('The shamane touches your head: "Your mind is now clear from anything. You can focus yourself from now on."');
$player->message($this->lang('reward5'));
// $player->message('Your character is now allowed to learn magic and spells.');
} else {
$player->message($this->lang('reward5'));
// $player->message('The shamane mumbles some magic spells and raises your base value for magic by 1.');
}
$player->alterField('magic', 1);
$player->modify();
return true;
}
示例2: getItemModifiersA
public function getItemModifiersA(SR_Player $player)
{
$back = array();
switch ($player->getRace()) {
default:
$back['attack'] = 5.0;
}
return $back;
}
示例3: onNPCTalk
public function onNPCTalk(SR_Player $player, $word, array $args)
{
switch ($word) {
case 'blackmarket':
return $this->rply($word, array($player->getRace()));
// return $this->reply('Thank you '.$player->getRace().'!');
// return $this->reply('Thank you '.$player->getRace().'!');
case 'yes':
case 'no':
return $this->rply('hehe', array($player->getRace()));
// return $this->reply('Hehe thanks '.$player->getRace().'!');
// return $this->reply('Hehe thanks '.$player->getRace().'!');
case 'hello':
default:
return $this->rply('default');
// return $this->reply('Thank you.');
}
}
示例4: getItemModifiersA
public function getItemModifiersA(SR_Player $player)
{
$back = array();
switch ($player->getRace()) {
default:
$back['body'] = 0.5;
break;
}
return $back;
}
示例5: getItemModifiersA
public function getItemModifiersA(SR_Player $player)
{
$back = array();
switch ($player->getRace()) {
default:
$back['max_hp'] = 2.5;
$back['max_mp'] = 5.0;
break;
}
return $back;
}
示例6: getItemModifiersA
public function getItemModifiersA(SR_Player $player)
{
$back = array();
switch ($player->getRace()) {
default:
$back['attack'] = 5;
$back['intelligence'] = 1.5;
break;
}
return SR_Item::mergeModifiers(parent::getItemModifiersA($player), $back);
}
示例7: getItemModifiersA
public function getItemModifiersA(SR_Player $player)
{
$back = array();
switch ($player->getRace()) {
default:
$back['attack'] = 10.0;
$back['wisdom'] = 1.0;
$back['intelligence'] = 1.0;
}
return $back;
}
示例8: onNPCTalk
public function onNPCTalk(SR_Player $player, $word, array $args)
{
switch ($word) {
case 'blackmarket':
// $this->reply('Jerky '.$player->getRace().'!');
// break;
// $this->reply('Jerky '.$player->getRace().'!');
// break;
case 'yes':
case 'no':
// $this->reply('Stop that '.$player->getRace().'!');
// break;
return $this->rply($word, array($player->getRace()));
case 'hello':
default:
return $this->rply('hello');
// $this->reply('You look for angry? Don`t make trouble! I look for you...');
// break;
}
}
示例9: 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(),
// ));
// }
}
示例10: validateBMI
private static function validateBMI(SR_Player $player, $mass, $height)
{
if ($mass <= 0) {
return ' Your own body weight could not get parsed. Try 70kg.';
}
$bmi = self::calcBMI($mass, $height);
if ($bmi < 0.5 || $bmi > 1.5) {
echo "BMI:{$bmi}}n";
return sprintf(' Your height (%dcm), compared with your weight(%s) does not match nicely.', $height, Shadowfunc::displayWeight($mass));
}
$offp = 0.5;
$offn = 0.2;
$b = $player->getRaceBaseVar('bmi') * 1000;
$min = round($b * (1 - $offn));
$max = round($b * (1 + $offp));
if ($mass < $min || $mass > $max) {
return sprintf(' The body mass for a(n) %s should be between %s and %s.', $player->getRace(), Shadowfunc::displayWeight($min), Shadowfunc::displayWeight($max));
}
return '';
}