本文整理汇总了PHP中Shadowfunc::translateVariable方法的典型用法代码示例。如果您正苦于以下问题:PHP Shadowfunc::translateVariable方法的具体用法?PHP Shadowfunc::translateVariable怎么用?PHP Shadowfunc::translateVariable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shadowfunc
的用法示例。
在下文中一共展示了Shadowfunc::translateVariable方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onQuestSolve
public function onQuestSolve(SR_Player $player)
{
$player->message($this->lang('impressed'));
// $player->message("The monk smiles. I am very impressed my $son. May the spirit of Buddah guide your path...");
if ($player->hasSkill('searching')) {
$player->message($this->lang('strong'));
// $player->message('The monk says: "You are really strong my '.$son.', please take this donation as a sign of deep respect to your greatful skills and patience."');
$player->message($this->lang('nyward', array(300)));
$player->giveNuyenEvent(300);
// $player->message('You received a donation of 300 nuyen.');
} else {
$player->message($this->lang('reward1'));
// $player->message('The monk says: "I will now teach you a real skill, the skill of seeing the invisible and finding the hidden paths."');
$player->levelupFieldTo('searching', 0);
$skillname = Shadowfunc::translateVariable($player, 'searching');
$player->message($this->lang('reward2', array($skillname)));
// $player->message('You have learned the skill "searching".');
}
}
示例2: displayItemnameFull
public static function displayItemnameFull(SR_Player $player, SR_Item $item, $short_mods = false, $colors = true)
{
$back = self::displayItemname($player, $item, false);
if (NULL !== ($mods = $item->getItemModifiersB())) {
$mod = '';
$format = $player->lang('fmt_itemmods');
foreach ($mods as $key => $value) {
$key = $short_mods ? Shadowfunc::shortcutVariable($player, $key) : Shadowfunc::translateVariable($player, $key);
$mod .= sprintf($format, $key, $value);
}
$back = $back . $player->lang('of') . ltrim($mod, ',; ');
}
if ($colors) {
if ($item->isItemRare()) {
return "5{$back}";
} elseif (false !== SR_SetItems::getSetForItem($item->getName())) {
return "6{$back}";
}
}
return $back;
}
示例3: getComparisonMatrix
private static function getComparisonMatrix(SR_Player $player, SR_Item $item1, SR_Item $item2)
{
$titles = array();
$item1Stuff = array();
$item2Stuff = array();
$b = chr(2);
$type = $item1->getItemType();
// $titles[] = 'Type';
$titles[] = Shadowfunc::translateVariable($player, 'Type');
$item1Stuff[] = str_replace(" Weapon", "", $player->lang($item1->displayType()));
$item2Stuff[] = str_replace(" Weapon", "", $player->lang($item2->displayType()));
// $titles[] = 'Lvl';
$titles[] = Shadowfunc::shortcutVariable($player, 'Level');
$item1Lvl = $item1->getItemLevel();
$item2Lvl = $item2->getItemLevel();
if ($item1Lvl == $item2Lvl) {
$item1Stuff[] = $b . $item1Lvl . $b;
$item2Stuff[] = $b . $item2Lvl . $b;
} else {
if ($item2Lvl > $item1Lvl) {
$item1Stuff[] = $item1Lvl;
$item2Stuff[] = $b . $item2Lvl . $b;
} else {
$item1Stuff[] = $b . $item1Lvl . $b;
$item2Stuff[] = $item2Lvl;
}
}
// $item1ModA = $item1->getItemModifiersA($player);
// $item2ModA = $item2->getItemModifiersA($player);
$item1ModA = $item1->getItemModifiers($player);
$item2ModA = $item2->getItemModifiers($player);
unset($item1ModA['weight']);
unset($item2ModA['weight']);
if ($item1ModA || $item2ModA) {
if (array_key_exists('min_dmg', $item1ModA) || array_key_exists('min_dmg', $item2ModA)) {
// $titles[] = 'dmg';
$titles[] = Shadowfunc::shortcutVariable($player, 'Damage');
$item1min = false;
$item1max = false;
$item2min = false;
$item2max = false;
if (array_key_exists('min_dmg', $item1ModA)) {
$item1min = $item1ModA['min_dmg'];
$item1max = $item1ModA['max_dmg'];
unset($item1ModA['min_dmg']);
unset($item1ModA['max_dmg']);
}
if (array_key_exists('min_dmg', $item2ModA)) {
$item2min = $item2ModA['min_dmg'];
$item2max = $item2ModA['max_dmg'];
unset($item2ModA['min_dmg']);
unset($item2ModA['max_dmg']);
}
if ($item1min == $item2min) {
$item1min = $b . $item1min . $b;
$item2min = $b . $item2min . $b;
} else {
if ($item1min > $item2min) {
$item1min = $b . $item1min . $b;
} else {
$item2min = $b . $item2min . $b;
}
}
if ($item1max == $item2max) {
$item1min = $b . $item1min . $b;
$item2min = $b . $item2min . $b;
} else {
if ($item1max > $item2max) {
$item1max = $b . $item1max . $b;
} else {
$item2max = $b . $item2max . $b;
}
}
if ($item1max) {
$item1Stuff[] = $item1min . '-' . $item1max;
} else {
$item1Stuff[] = "";
}
if ($item2max) {
$item2Stuff[] = $item2min . '-' . $item2max;
} else {
$item2Stuff[] = "";
}
}
$keys = array_unique(array_merge(array_keys($item1ModA ? $item1ModA : array()), array_keys($item2ModA ? $item2ModA : array())));
foreach ($keys as $k => $v) {
// $titles[] = Shadowfunc::longModifierToShort($v);
$titles[] = Shadowfunc::shortcutVariable($player, $v);
$item1V = $item1ModA && array_key_exists($v, $item1ModA) ? $item1ModA[$v] : false;
$item2V = $item2ModA && array_key_exists($v, $item2ModA) ? $item2ModA[$v] : false;
if ($item1V && $item2V && $item1V == $item2V) {
$item1V = $b . $item1V . $b;
$item2V = $b . $item2V . $b;
} else {
if (!$item1V || $item2V > $item1V) {
$item2V = $b . $item2V . $b;
} else {
if (!$item2V || $item1V > $item2V) {
$item1V = $b . $item1V . $b;
}
//.........这里部分代码省略.........
示例4: levelupFieldTo
public function levelupFieldTo($field, $value)
{
$value = (int) $value;
$old = $this->getBase($field);
$by = $value - $old;
if (false === $this->saveBase($field, $value)) {
return false;
}
$this->modify();
return $this->msg('5285', array(Shadowfunc::translateVariable($this, $field), $value, $by, Shadowcmd_lvlup::getMaxLevel($this, $field), Shadowcmd_lvlup::getKarmaCost($field, $value)));
}
示例5: displayMembers
public function displayMembers($with_distance = false, $with_levels = false)
{
if ($this->getMemberCount() === 0) {
return 'This party is empty! (should not see me)';
}
$b = chr(2);
$back = '';
foreach ($this->members as $player) {
$player instanceof SR_Player;
$dist = $with_distance ? sprintf('(%.01fm)', $this->distance[$player->getID()]) : '';
$level = $with_levels ? Shadowfunc::displayLevel($player) : '';
$rmod = $player->isOptionEnabled(SR_Player::RUNNING_MODE) ? '[RM]' : '';
$pbot = $player->isOptionEnabled(SR_Player::PLAYER_BOT) ? '[BOT]' : '';
$race = '[' . Shadowfunc::translateVariable($player, '_' . $player->getRace()) . ']';
$back .= sprintf(', %s-%s%s%s%s%s%s', $b . $player->getEnum() . $b, $player->getName(), $dist, $level, $pbot, $rmod, $race);
}
return substr($back, 2);
}