本文整理汇总了PHP中SR_Player::lang方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::lang方法的具体用法?PHP SR_Player::lang怎么用?PHP SR_Player::lang使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SR_Player
的用法示例。
在下文中一共展示了SR_Player::lang方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getHelpText
public function getHelpText(SR_Player $player)
{
$back = '';
if (count($this->getComputers()) > 0) {
$back .= $player->lang('hlp_hack');
# You can use a Cyberdeck here to hack into a computer.';
}
if ($this->isSearchable()) {
$back .= $player->lang('hlp_search');
# ' You can use #search here to search the room for items.';
}
return $back === '' ? false : substr($back, 1);
}
示例2: getHelpText
public function getHelpText(SR_Player $player)
{
return $player->lang('hlp_hotel', array($this->displaySleepPrice($player)));
// $price = $this->calcPrice($player);
// $c = Shadowrun4::SR_SHORTCUT;
// return sprintf('You can pay %s to %ssleep here and restore your party`s HP/MP.', $price, $c);
}
示例3: onHPMP
protected static function onHPMP(SR_Player $player, $what, $key)
{
// $i = 1;
$b = chr(2);
// $bot = Shadowrap::instance($player);
$party = $player->getParty();
$members = $party->getMembers();
$format = $player->lang('fmt_hp_mp');
$back = '';
foreach ($members as $member) {
$member instanceof SR_Player;
$hpmp = $member->getBase($what);
$hpmmpm = $member->get('max_' . $what);
$b2 = '';
$b1 = 0;
if ($what === 'hp') {
if ($member->needsHeal()) {
$b2 = $b;
$b1 = 1;
}
} elseif ($what === 'mp') {
if ($member->getBase('magic') >= 0) {
if ($member->needsEther()) {
$b2 = $b;
$b1 = 1;
}
}
}
$back .= sprintf($format, $member->getEnum(), $member->getName(), $hpmp, $hpmmpm, $b2, $b1);
// $back .= sprintf(", %s-%s%s(%s/%s)%s", $b.($member->getEnum()).$b, $b2, $member->getName(), $hpmp, $hpmmpm, $b2);
}
return self::rply($player, $key, array(ltrim($back, ',; ')));
// $bot->reply(sprintf('Your parties %s: %s.', $text, substr($back, 2)));
// return true;
}
示例4: execute
public static function execute(SR_Player $player, array $args)
{
$pp = Shadowrun4::getParties();
foreach ($pp as $i => $p) {
$p instanceof SR_Party;
if (!$p->isHuman()) {
unset($pp[$i]);
}
}
$page = isset($args[0]) ? intval($args[0]) : 1;
$nItems = count($pp);
$nPages = GWF_PageMenu::getPagecount(self::PPP, $nItems);
$page = Common::clamp($page, 1, $nPages);
$from = GWF_PageMenu::getFrom($page, self::PPP);
$slice = array_slice($pp, $from, self::PPP);
$out = '';
$format = $player->lang('fmt_list');
foreach ($slice as $p) {
$p instanceof SR_Party;
$leader = $p->getLeader()->displayName();
$l = $p->getSum('level', true);
$ll = $p->getSum('level', false);
$mc = $p->getMemberCount();
$item = sprintf('%s(L%s(%s))(M%s)', $leader, $l, $ll, $mc);
$out .= sprintf($format, $item);
// $out .= sprintf(', %s(L%s(%s))(M%s)', $leader, $l, $ll, $mc);
}
return self::rply($player, '5248', array($page, $nPages, ltrim($out, ',; ')));
// $bot = Shadowrap::instance($player);
// $bot->reply(sprintf('Parties page %s from %s: %s.', $page, $nPages, substr($out, 2)));
}
示例5: messagePartyFeelings
private static function messagePartyFeelings(SR_Player $player)
{
$party = $player->getParty();
$enum = 1;
$fmt = $player->lang('fmt_feel');
$out = '';
foreach ($party->getMembers() as $member) {
$member instanceof SR_Player;
$out .= vsprintf($fmt, self::argsForMember($member, $enum));
}
$player->msg('5312', array(ltrim($out, ',; ')));
}
示例6: execute
public static function execute(SR_Player $player, array $args)
{
$p = $player->getParty();
$back = '';
$format = $player->lang('fmt_xp');
# 1-gizmore L14(177/288xp) KA(5.4/12xp)
foreach ($p->getMembers() as $member) {
$member instanceof SR_Player;
$back .= sprintf($format, $member->getEnum(), $member->getName(), $member->getBase('level'), round($member->getBase('xp_level'), 2), $member->getXPPerLevel(), round($member->getBase('xp'), 2), $member->getXPPerKarma());
}
return self::rply($player, '5308', array(ltrim($back, '|,; ')));
}
示例7: displayBounties
public static function displayBounties(SR_Player $player, $page = 1, $ipp = 10, $orderby = 'bounty DESC', $server = NULL)
{
// $gdo = gdo_db();
$bounties = self::table(__CLASS__);
$numItems = $bounties->countRows('', NULL, 'sr4bo_victim');
$numPages = GWF_PageMenu::getPagecount($ipp, $numItems);
$page = Common::clamp(intval($page, 10), 1, $numPages);
$from = GWF_PageMenu::getFrom($page, $ipp);
$bounties = $bounties->selectAll('concat(user_name, "{", user_sid, "}") name, SUM(sr4bo_bounty) bounty', '', $orderby, array('victim'), 10, $from, GDO::ARRAY_N, 'sr4bo_victim');
if (count($bounties) === 0) {
return $player->lang('no_bounties');
// return 'There are no bounties at the moment.';
}
$format = $player->lang('fmt_sumlist');
$out = '';
foreach ($bounties as $i => $data) {
$ny = Shadowfunc::displayNuyen($data[1]);
$out .= sprintf($format, $i + 1, $data[0], $ny);
// $out .= sprintf(", \x02%s\X02-%s(%s)", $i+1, $data[0], $ny);
}
return $player->lang('bounty_page', array($page, $numPages, ltrim(',; ', 2)));
// return sprintf('Bounties page %s/%s: %s.', $page, $numPages, substr($out, 2));
}
示例8: showDistances
private static function showDistances(SR_Player $player)
{
$p = $player->getParty();
$format = $player->lang('fmt_sumlist');
$key = $player->isFighting() ? '5123' : '5124';
$out = '';
foreach ($p->getMembers() as $member) {
$member instanceof SR_Player;
$val = $player->isFighting() ? $p->getDistance($member) : $member->getBase('distance');
$out .= sprintf($format, $member->getEnum(), $member->getName(), $val);
// $out .= sprintf(', %s:%s(%s)', $member->getName(), $member->getBase('distance'), $p->getDistance($member));
}
return self::rply($player, $key, array(ltrim($out, ',; ')));
}
示例9: execute
public static function execute(SR_Player $player, array $args)
{
// $bot = Shadowrap::instance($player);
$p = $player->getParty();
$out = '';
$format = $player->lang('fmt_sumlist');
foreach ($p->getMembers() as $member) {
$member instanceof SR_Player;
$summand = sprintf('L%s(%s)', $member->getBase('level'), $member->get('level'));
$out .= sprintf($format, $member->getEnum(), $member->getName(), $summand);
// $out .= sprintf(', %s(L%s(%s))', $member->getName(), $member->getBase('level'), $member->get('level'));
}
return self::rply($player, '5056', array($p->getPartyLevel(), $p->getPartyXP(), SR_Party::XP_PER_LEVEL, ltrim($out, ',; ')));
// $bot->reply(sprintf('Your party has level %s(%s/%s): %s.', $p->getPartyLevel(), $p->getPartyXP(), SR_Party::XP_PER_LEVEL, substr($out, 2)));
// return true;
}
示例10: onEnable
protected static function onEnable(SR_Player $player, $bit, $bool, $name)
{
$text = $bool === true ? 'enabled' : 'disabled';
$text = $player->lang($text);
$old = $player->isOptionEnabled($bit);
if ($bool === $old) {
$player->msg('5070', array($name, $text));
// $player->message(sprintf('%s has been already %s.', $name, $text));
return true;
}
if (false === $player->saveOption($bit, $bool)) {
return false;
}
$player->msg('5071', array($name, $text));
// $player->message(sprintf('%s has been %s for your character.', $name, $text));
$player->modify();
return true;
}
示例11: execute
public static function execute(SR_Player $player, array $args)
{
// $bot = Shadowrap::instance($player);
$party = $player->getParty();
$members = $party->getMembers();
$total = 0;
$format = $player->lang('fmt_sumlist');
$back = '';
foreach ($members as $member) {
$member instanceof SR_Player;
$karma = $member->getBase('karma');
$total += $karma;
$back .= sprintf($format, $member->getEnum(), $member->getName(), $karma);
// $back .= sprintf(', %s-%s(%s)', $b.($member->getEnum()).$b, $member->getName(), $karma);
}
return self::rply($player, '5052', array($total, ltrim($back, ',; ')));
// $bot->reply(sprintf('Your party has %s karma: %s.', $total, substr($back, 2)));
// return true;
}
示例12: announceUsage
public function announceUsage(SR_Player $player, SR_Player $target, $message = '', $message2 = '', $useamt = 1)
{
if ($player->isFighting()) {
$busy = $player->busy($this->getItemUsetime());
$busymsg = $player->lang('busy', array($busy));
#sprintf(' %ds busy.', $busy);
} else {
$busymsg = '';
}
$player->getParty()->ntice('5228', array($player->displayNameNB(), $this->getName(), $target->displayNameNB(), $busymsg, $message));
// $player->getParty()->notice(sprintf('%s used %s on %s.%s%s', $player->getName(), $this->getName(), $target->getName(), $busymsg, $message));
if ($player->isFighting()) {
$player->getEnemyParty()->ntice('5229', array($player->displayNameNB(), $this->getName(), $target->displayNameNB(), $busymsg, $message2));
// $player->getEnemyParty()->notice(sprintf('%s used %s on %s.%s', $player->getName(), $this->getName(), $target->getName(), $message2));
}
if ($useamt > 0) {
return $this->useAmount($player, $useamt);
}
return true;
}
示例13: execute
public static function execute(SR_Player $player, array $args)
{
// $bot = Shadowrap::instance($player);
// $party = $player->getParty();
// $members = $party->getMembers();
$total = 0;
$back = '';
$format = $player->lang('fmt_sumlist');
foreach ($player->getParty()->getMembers() as $member) {
$member instanceof SR_Player;
$we = $member->get('weight');
$mw = $member->get('max_weight');
$b = $we > $mw ? chr(2) : '';
$total += $we;
$summand = sprintf('%s/%s', $b . Shadowfunc::displayWeight($we) . $b, Shadowfunc::displayWeight($mw));
$back .= sprintf($format, $member->getEnum(), $b . $member->getName() . $b, $summand);
// $back .= sprintf(', %s(%s/%s)', $b.$member->getName().$b, $b.Shadowfunc::displayWeight($we).$b, Shadowfunc::displayWeight($mw));
}
return self::rply($player, '5064', array(Shadowfunc::displayWeight($total), ltrim($back, ',; ')));
// $bot->reply(sprintf('Your party carries %s: %s.', Shadowfunc::displayWeight($total), substr($back, 2)));
// return true;
}
示例14: on_view
public function on_view(SR_Player $player, array $args)
{
$items = $player->getBankItems();
$text = array('prefix' => $player->lang('bank'), 'code' => '5188');
return Shadowfunc::genericViewI($player, $items, $args, $text, false);
}
示例15: getHelpText
public function getHelpText(SR_Player $player)
{
return $player->lang('hlp_elevator');
}