Permalink
Browse files

Add Exotic Weapon Quest tab

 - beta
  • Loading branch information...
1 parent 6f60dc1 commit d07d5b0c201c94114a477304e18c9f407b4088f2 @iBotPeaches iBotPeaches committed Nov 6, 2016
@@ -2,6 +2,7 @@
namespace App\Http\Controllers;
+use Destiny\Exotics;
use Destiny\Player;
use Illuminate\Http\Request;
use Illuminate\View\Factory as View;
@@ -64,6 +65,24 @@ public function grimoire($platform, $gamertag)
]);
}
+ /**
+ * @param $platform string
+ * @param $gamertag string
+ * @return \Illuminate\Contracts\View\View
+ */
+ public function exotics($platform, $gamertag)
+ {
+ $player = $this->findPlayer($platform, $gamertag);
+ $grimoire = $player->grimoire;
+
+ return $this->view->make('exotics', [
+ 'player' => $player,
+ 'platform' => $platform,
+ 'grimoire' => $grimoire,
+ 'exotics' => new Exotics($grimoire)
+ ]);
+ }
+
//-------------------------------------------------------
// Protected Functions
//-------------------------------------------------------
View
@@ -23,4 +23,5 @@
Route::group(['prefix' => '{platform}/{player}'], function () {
Route::get('/', ['uses' => 'AccountController@index', 'as' => 'account']);
Route::get('grimoire', ['uses' => 'AccountController@grimoire', 'as' => 'grimoire']);
+ Route::get('exotics', ['uses' => 'AccountController@exotics', 'as' => 'exotics']);
});
View
@@ -0,0 +1,176 @@
+<?php namespace Destiny;
+
+/**
+ * Class Exotics
+ * @package destiny
+ */
+class Exotics extends Model
+{
+ /**
+ * @var array
+ */
+ public $exotics = [
+ [
+ 'name' => 'Tlaloc',
+ 'cardIds' => [700302],
+ 'weapon' => 700302,
+ 'hint' => 'Hit Rank 3 with Gunsmith under Warlock character.'
+ ],
+ [
+ 'name' => 'Fabian Strategy',
+ 'cardIds' => [700301],
+ 'weapon' => 700301,
+ 'hint' => 'Hit Rank 3 with Gunsmith under Titan character.'
+ ],
+ [
+ 'name' => 'Ace of Spades',
+ 'cardIds' => [700300],
+ 'weapon' => 700300,
+ 'hint' => 'Hit Rank 3 with Gunsmith under Hunter character.'
+ ],
+ [
+ 'name' => 'Iron Gjallarhorn',
+ 'cardIds' => [304020, 800439],
+ 'weapon' => 304020,
+ 'hint' => 'Complete ROI Campaign and start Echos of the Past quest.'
+ ],
+ [
+ 'name' => 'First Curse',
+ 'cardIds' => [700170],
+ 'weapon' => 700170,
+ 'hint' => 'Hit Rank 5 with Gunsmith under any character and start Imprecation Quest.'
+ ],
+ [
+ 'name' => 'Khvostov 7G-0X',
+ 'cardIds' => [800402],
+ 'weapon' => 800402,
+ 'hint' => 'Dismantle an original Khvostov or find a schematic in the Fallen Ketch in the Breach.'
+ ],
+ [
+ 'name' => 'Black Spindle',
+ 'cardIds' => [700240],
+ 'weapon' => 700240,
+ 'hint' => 'Do the alternative ending to the Lost to Light mission killing all Taken in 10 minutes.'
+ ],
+ [
+ 'name' => 'No Time To Explain',
+ 'cardIds' => [700180],
+ 'weapon' => 700180,
+ 'hint' => 'Do the alternative ending to the Paradox mission finding all dead ghosts in the vault.'
+ ],
+ [
+ 'name' => 'Vex Mythoclast',
+ 'cardIds' => [303065],
+ 'weapon' => 303065,
+ 'hint' => 'Random drop from Atheon during Vault of Glass raid.'
+ ],
+ [
+ 'name' => 'Necrochasm',
+ 'cardIds' => [302037],
+ 'weapon' => 302037,
+ 'hint' => 'Obtain Husk of the Pit and upgrade to Eidolon Ally then use Crux of Crota (Hard mode drop at Crota).'
+ ],
+ [
+ 'name' => 'Touch of Malice',
+ 'cardIds' => [700130],
+ 'weapon' => 700130,
+ 'hint' => 'Multiple quests related to collecting 45 Calcified Fragments.'
+ ],
+ [
+ 'name' => 'Boolean Gemini',
+ 'cardIds' => [700160],
+ 'weapon' => 700160,
+ 'hint' => 'Complete Taken War and Petra Quests, then hit Rank 3 with Queen\'s Wrath.'
+ ],
+ [
+ 'name' => 'Thorn',
+ 'cardIds' => [302150],
+ 'weapon' => 302150,
+ 'hint' => 'Quest earned after turning in Iron Lord bounties (random).'
+ ],
+ [
+ 'name' => 'Outbreak Prime',
+ 'cardIds' => [800401],
+ 'weapon' => 800401,
+ 'hint' => 'Unlock all 5 monitors in the Wrath of the Machine raid.'
+ ],
+ [
+ 'name' => 'Young Wolf\'s Howl',
+ 'cardIds' => [800452],
+ 'weapon' => 800452,
+ 'hint' => 'Complete Rise of Iron Campaign.'
+ ],
+ [
+ 'name' => 'Dark-Drinker',
+ 'cardIds' => [700292],
+ 'weapon' => 700292,
+ 'hint' => 'Infuse Void Edge to at least 280 light and start A Sword Reforged Quest.'
+ ],
+ [
+ 'name' => 'Raze-Lighter',
+ 'cardIds' => [700291],
+ 'weapon' => 700291,
+ 'hint' => 'Infuse Sol Edge to at least 280 light and start A Sword Reforged Quest.'
+ ],
+ [
+ 'name' => 'Bolt-Caster',
+ 'cardIds' => [700290],
+ 'weapon' => 700290,
+ 'hint' => 'Infuse Arc Edge to at least 280 light and start A Sword Reforged Quest.'
+ ],
+ [
+ 'name' => 'Sleeper Simulant',
+ 'cardIds' => [700250],
+ 'weapon' => 700250,
+ 'hint' => 'Find all four DVALIN Relics to unlock The First Firewall Quest.'
+ ],
+ [
+ 'name' => 'Chaperone',
+ 'cardIds' => [700220],
+ 'weapon' => 700220,
+ 'hint' => 'Obtain Level 40 and hit Rank 3 in Crucible.'
+ ],
+ ];
+
+ /**
+ * Exotics constructor.
+ * @param Grimoire $grimoire
+ */
+ public function __construct(Grimoire $grimoire)
+ {
+ $properties = [];
+
+ foreach ($this->exotics as $exotic)
+ {
+ $complete = true;
+ foreach ($exotic['cardIds'] as $cardId)
+ {
+ $card = $grimoire->getCard($cardId);
+
+ if ($card === null)
+ {
+ $complete = false;
+ }
+ else if ($card->isIncomplete())
+ {
+ $complete = false;
+ }
+
+ if ($cardId === $exotic['weapon'])
+ {
+ $exotic['weapon'] = $card;
+ }
+ }
+
+ $exotic['complete'] = $complete;
+
+ $properties['weapons'][] = $exotic;
+ }
+
+ $properties['weapons'] = array_sort($properties['weapons'], function($item) {
+ return ! ($item['complete']) . $item['name'];
+ });
+
+ parent::__construct($properties);
+ }
+}
View
@@ -34,6 +34,18 @@ public function __construct(Player $player, array $properties)
$this->themeCollection = new ThemeCollection($this, $this->definitions->themeCollection);
}
+ public function getCard($cardId)
+ {
+ $cards = $this->cards;
+
+ if (isset($cards[$cardId]))
+ {
+ return $cards[$cardId];
+ }
+
+ return null;
+ }
+
protected function gDefinitions()
{
return manifest()->grimoire();
@@ -0,0 +1,31 @@
+.exotics-index
+{
+ .card {
+ &.first {
+ clear: left;
+ }
+ .title[data-completed="true"] .name {
+ color: $color-light;
+ }
+ .title {
+ margin-bottom: 4px;
+
+ h3 {
+ margin: 0 0 2px 0;
+
+ a {
+ color: $color-title;
+ }
+ }
+ }
+ .images {
+ font-size: 0;
+ margin-bottom: 5px;
+
+ canvas {
+ width: (100% / 3);
+ height: auto;
+ }
+ }
+ }
+}
@@ -47,3 +47,4 @@
@import "advisors";
@import "account";
@import "grimoire";
+@import "exotics";
@@ -16,4 +16,5 @@
<ul class="nav nav-pills nav-span">
<li class="<?= $tab == 'account' ? 'active' : '' ?>"><a href="<?= route('account', ['platform' => $player->platform, 'gamertag' => $player->displayName]) ?>">Characters</a></li>
<li class="<?= $tab == 'grimoire' ? 'active' : '' ?>"><a href="<?= route('grimoire', ['platform' => $player->platform, 'gamertag' => $player->displayName]) ?>">Grimoire</a></li>
+ <li class="<?= $tab == 'exotics' ? 'active' : '' ?>"><a href="<?= route('exotics', ['platform' => $player->platform, 'gamertag' => $player->displayName]) ?>">Exotic Weapons</a></li>
</ul>
@@ -0,0 +1,38 @@
+@extends('layout')
+@section('title', 'Exotic Weapon Quests for '.$player->displayName)
+@section('content')
+@include('block/player', ['player' => $player, 'tab' => 'exotics'])
+<?php
+/**
+ * @var \Destiny\Grimoire $grimoire
+ * @var \Destiny\Exotics $exotics
+ */
+?>
+
+<div class="exotics-index row">
+ <?php $i = 0; foreach ($exotics['weapons'] as $exotic): ?>
+ <div class="card <?= $exotic['weapon']->active ? 'active' : '' ?> col-md-4 <?= ($i % 3 == 0) ? 'first' : ''; ?>">
+ <div class="panel">
+ <div class="title">
+ <div class="images">
+ <?= $exotic['weapon']->thumbnail ?>
+ <?= $exotic['weapon']->page->thumbnail ?>
+ <?= $exotic['weapon']->theme->thumbnail ?>
+ </div>
+ <div class="title" data-completed="<?= $exotic['weapon']->active ? "true" : "false"; ?>">
+ <h3 class="name">
+ <a class="name" href="<?= dtrgrimoire($exotic['weapon']) ?>" target="_blank"><?= e($exotic['name']) ?></a>
+ <?php if ($exotic['weapon']->active): ?>
+ <i class="fa fa-check"></i>
+ <?php endif; ?>
+ </h3>
+ </div>
+ <p>
+ <?= $exotic['hint']; ?>
+ </p>
+ </div>
+ </div>
+ </div>
+ <?php $i++; endforeach; ?>
+</div>
+@stop

0 comments on commit d07d5b0

Please sign in to comment.