コード例 #1
0
ファイル: ShopController.php プロジェクト: synthx/infuse
 /**
  * Show itemset's shop page
  * GET
  *
  * @param int $id
  * @param string $name
  * @return Response
  */
 public function showItemset($id, $name)
 {
     $itemset = ItemsetManager::find($id);
     $items = ItemTemplateManager::where('panoplie', $itemset->ID)->orderBy('level', 'desc')->get();
     $otherItemsets = ItemsetManager::where('shop', 1)->where('ID', '!=', $itemset->ID)->orderByRaw('RAND()')->take(4)->get();
     $players = PlayerManager::where('account', Auth::user()->guid)->orderBy('xp', 'asc')->get();
     return view('shop.itemset', compact('itemset', 'items', 'players', 'otherItemsets'));
 }
コード例 #2
0
 public function showItem($id, $name)
 {
     $item = ItemTemplateManager::find($id);
     $craft = CraftManager::find($item->id);
     $itemset = ItemsetManager::find($item->panoplie);
     $itemsetObjects = $itemset ? ItemTemplateManager::where('panoplie', $itemset->ID)->orderBy('level', 'asc')->get() : [];
     $drops = DropManager::join('monsters', 'monsters.id', '=', 'drops.mob')->where('item', $item->id)->get();
     return view('encyclopedia.item', compact('item', 'craft', 'itemset', 'itemsetObjects', 'drops'));
 }
コード例 #3
0
ファイル: JsonController.php プロジェクト: synthx/infuse
 public function encodeJsonItems()
 {
     $items = \App\Model\ItemTemplate::select('id', 'name', 'appearance', 'type', 'level')->where('appearance', '!=', 0)->whereIn('type', [16, 17, 18, 82])->get();
     $json = '{<br/>';
     foreach ($items as $item) {
         $json .= '"' . $item->id . '" : {"name" : "' . e($item->name) . '", "level" : "' . $item->level . '", "type" : "' . $item->type . '", "appearance" : "' . $item->appearance . '"},<br/>';
     }
     $json .= '}';
     return $json;
 }
コード例 #4
0
ファイル: MiscController.php プロジェクト: synthx/infuse
 /**
  * Show homepage
  * GET
  *
  * @return Response
  */
 public function showIndex()
 {
     $blogs = Cache::remember('blogs', 60, function () {
         return BlogManager::orderBy('date', 'desc')->take(8)->get();
     });
     $video = Cache::remember('video', 60, function () {
         return VideoManager::first();
     });
     $item = Cache::remember('itemShop', 60, function () {
         return \App\Model\ItemTemplate::where('shop', 1)->orderByRaw('RAND()')->first();
     });
     return view('home.home', compact('blogs', 'video', 'item'));
 }
コード例 #5
0
ファイル: Code.php プロジェクト: synthx/infuse
 /**
  * Title of code page
  *
  * @param int $action
  * @param int $param
  */
 public function type($action, $param)
 {
     switch ($action) {
         case 1:
             return 'Don de ' . $param . ' points';
             break;
         case 2:
             return 'Don du ' . \App\Model\Tokens::find($param)->name;
             break;
         case 3:
             return 'Don de l\'objet ' . \App\Model\ItemTemplate::find($param)->name;
             break;
         case 4:
             return 'Don de la ' . \App\Model\Itemset::find($param)->name;
             break;
     }
 }
コード例 #6
0
ファイル: Tokens.php プロジェクト: synthx/infuse
 /**
  * Get item's image of token
  *
  * @param string $itemString
  */
 public function getItems($itemString)
 {
     $itemLib = new Item();
     $html = '';
     $itemArray = [];
     if (!empty($itemString)) {
         $items = explode(',', $itemString);
         foreach ($items as $item) {
             if (!empty($item)) {
                 array_push($itemArray, $item);
             }
         }
         $objects = ItemTemplateManager::whereIn('id', $itemArray)->orderByRaw('RAND()')->take(6)->get();
         foreach ($objects as $object) {
             $html .= $itemLib->generateTooltip($object->id, $object->name, $object->level, $object->type, $object->icon, $object->statsTemplate, 52);
         }
     }
     return $html;
 }
コード例 #7
0
ファイル: Item.php プロジェクト: synthx/infuse
 /**
  * Show if item is use in another recipe
  *
  * @param int $id
  */
 public function useInCraft($id)
 {
     $text = '';
     $itemArray = [];
     $crafts = \App\Model\Craft::all();
     foreach ($crafts as $craft) {
         if (!empty($craft->craft)) {
             $objects = explode(';', $craft);
             foreach ($objects as $object) {
                 if (!empty($object)) {
                     list($itemId) = explode('*', $object);
                     if ($itemId == $id) {
                         array_push($itemArray, $craft->id);
                     }
                 }
             }
         }
     }
     if (count($itemArray) > 0) {
         $text .= '<div class="ak-container ak-panel"><div class="ak-panel-title"><span class="ak-panel-title-icon"></span>Est utilisé dans la recette</div><div class="ak-panel-content"><div class="ak-container ak-content-list ak-displaymode-image-col"><div class="row ak-container">';
         $items = \App\Model\ItemTemplate::whereIn('id', $itemArray)->orderBy('level', 'asc')->get();
         foreach ($items as $item) {
             $text .= '<div class="ak-column ak-container col-xs-12 col-md-6"><div class="ak-list-element"><div class="ak-main"><div class="ak-main-content"><div class="ak-image"><span class="ak-linker">' . $this->generateTooltip($item->id, $item->name, $item->level, $item->type, $item->icon, $item->statsTemplate, 48) . '</span></div><div class="ak-content"><div class="ak-title"><a href="' . route('encyclopedia.' . $this->routeName($item->type), [$item->id, str_slug($item->name)]) . '">' . $item->name . '</a></div><div class="ak-text">' . $this->type($item->type) . '</div></div><div class="ak-aside">Niv. ' . $item->level . '</div></div></div></div></div><div class="clearfix  visible-xs visible-sm"></div>';
         }
         $text .= '</div></div></div></div>';
     }
     return $text;
 }
コード例 #8
0
ファイル: Itemset.php プロジェクト: synthx/infuse
 /**
  * Return itemset's effects when wearing all items
  *
  * @param string $items
  * @param string $bonus
  */
 public function bonusComplete($itemsetId, $bonus)
 {
     $effectLib = new Effect();
     $effectsArray = [111, 112, 115, 116, 117, 118, 119, 121, 122, 123, 123, 124, 125, 126, 128, 138, 152, 153, 154, 155, 156, 157, 158, 159, 160, 161, 162, 162, 168, 169, 171, 174, 175, 176, 177, 178, 179, 182, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249];
     $items = ItemTemplateManager::where('panoplie', $itemsetId)->get();
     $k = 0;
     $bonus = explode(';', $bonus);
     $last = $bonus[count($items) - 2];
     $lastEffects = explode(',', $last);
     $html = '<div class="ak-container ak-content-list ak-displaymode-col"><div class="row ak-container">';
     foreach ($effectsArray as $effectId) {
         $min = 0;
         $max = 0;
         /**
          * Gestion des bonus de panoplies
          */
         foreach ($lastEffects as $lastEffect) {
             list($id, $value) = explode(':', $lastEffect);
             if ($id == $effectId) {
                 $min += $value;
                 $max += $value;
             }
         }
         /**
          * Gestion des bonus des items
          */
         foreach ($items as $item) {
             if (!empty($item->statsTemplate)) {
                 $bonusEffects = explode(',', $item->statsTemplate);
                 foreach ($bonusEffects as $bonus) {
                     if (!empty($bonus)) {
                         list($id, $minValue, $maxValue) = explode('#', $bonus);
                         if (hexdec($id) == $effectId) {
                             $min += hexdec($minValue);
                             $max += $maxValue != 0 ? hexdec($maxValue) : hexdec($minValue);
                         }
                     }
                 }
             }
         }
         if ($min != 0 && $max != 0) {
             $html .= '<div class="ak-column ak-container col-sm-6"><div class="ak-list-element"><div class="ak-main"><div class="ak-main-content"><div class="ak-content"><div class="ak-title">' . $effectLib->get($effectId, $min, $max) . '</div></div><div class="ak-aside"><span class="ak-tooltip ak-icon-small ' . $effectLib->icon($effectId) . '" data-hasqtip="19"></span><script type="application/json">{"manual":true,"tooltip":{"content":{"title":"","text":"' . $effectLib->name($effectId) . '"},"style":{"classes":"ak-tooltip-content"}},"forceOnTouch":true}</script></div></div></div></div></div>';
             $k++;
             if ($k % 2 == 0) {
                 $html .= '<div class="clearfix  visible-sm visible-md visible-lg"></div>';
             }
         }
     }
     $html .= '</div></div>';
     return $html;
 }
コード例 #9
0
ファイル: TokensController.php プロジェクト: synthx/infuse
 /**
  * Show token of user
  * GET
  *
  * @param int $id
  * @param string $name
  * @return Response
  */
 public function showToken($id, $name)
 {
     $token = TokensAccountManager::join('cms_tokens', 'cms_tokens.id', '=', 'token')->where('guid', Auth::user()->guid)->where('token', $id)->first();
     $players = PlayerManager::where('account', Auth::user()->guid)->get();
     $ids = explode(',', $token->items);
     $objectArray = [];
     foreach ($ids as $id) {
         if (!empty($id)) {
             array_push($objectArray, $id);
         }
     }
     $objects = ItemTemplateManager::whereIn('id', $objectArray)->orderBy('level', 'asc')->get();
     return view('tokens.page', compact('token', 'objects', 'players'));
 }