本文整理汇总了PHP中Shadowfunc::shortcutVariable方法的典型用法代码示例。如果您正苦于以下问题:PHP Shadowfunc::shortcutVariable方法的具体用法?PHP Shadowfunc::shortcutVariable怎么用?PHP Shadowfunc::shortcutVariable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Shadowfunc
的用法示例。
在下文中一共展示了Shadowfunc::shortcutVariable方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: displayModifiers
public static function displayModifiers(SR_Player $player, array $modifiers)
{
$back = '';
$format = Shadowrun4::lang('fmt_mods');
foreach ($modifiers as $k => $v) {
$mod = Shadowfunc::shortcutVariable($player, $k);
$back .= sprintf($format, $mod, $v);
}
return ltrim($back, ',; ');
}
示例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;
}
//.........这里部分代码省略.........