Esempio n. 1
0
 private static function hasItem(SR_Player $player, $itemID)
 {
     $items = array_merge($player->getAllEquipment(false), $player->getInventory(), $player->getBankItems(), $player->getMountInvItems(), $player->getCyberware());
     foreach ($items as $item) {
         $item instanceof SR_Item;
         if ($item->getID() == $itemID) {
             // 				printf("Found item :)\n");
             return true;
         }
     }
     return false;
 }
Esempio n. 2
0
 public static function getEquipment(SR_Player $player, $langkey = '5048')
 {
     // 		$b = chr(2);
     $back = '';
     $format = $player->lang('fmt_equip');
     foreach ($player->getAllEquipment(true) as $key => $item) {
         $item instanceof SR_Equipment;
         $back .= sprintf($format, self::translateVariable($player, $key), $item->displayFullName($player), self::shortcutEquipment($key));
         // 			$back .= sprintf($format, $key, $item->getItemName(), self::shortcutEquipment($key));
         // 			$back .= sprintf(', %s:%s', "{$b}$key{$b}", $item->getItemName());
     }
     $back = ltrim($back, ',; ');
     $args = array();
     if ($langkey > 5048) {
         $args[] = $player->getName();
     }
     $args[] = $back;
     return Shadowrun4::lang($langkey, $args);
 }