-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Lots of changes - tests are failing out and I am not sure why
- Loading branch information
Showing
53 changed files
with
2,721 additions
and
1,855 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace App\Flare\Values; | ||
|
||
use Exception; | ||
|
||
class NameTags { | ||
|
||
const ICE_QUEEN_SLAYER = 'ice-queen-slayer'; | ||
const EXPLORER = 'explorer'; | ||
const RULER = 'ruler'; | ||
const DEMON_SLAYER = 'demon-slayer'; | ||
const QUEEN_OF_HEARTS = 'queen-of-hearts'; | ||
const GAMBLING_ADDICT = 'gambling-addict'; | ||
|
||
/** | ||
* @var string $value | ||
*/ | ||
private string $value; | ||
|
||
/** | ||
* @var string[] $values | ||
*/ | ||
protected static array $values = [ | ||
self::ICE_QUEEN_SLAYER => self::ICE_QUEEN_SLAYER, | ||
self::EXPLORER => self::EXPLORER, | ||
self::RULER => self::RULER, | ||
self::DEMON_SLAYER => self::DEMON_SLAYER, | ||
self::QUEEN_OF_HEARTS => self::QUEEN_OF_HEARTS, | ||
self::GAMBLING_ADDICT => self::GAMBLING_ADDICT, | ||
]; | ||
|
||
public static array $valueNames = [ | ||
self::ICE_QUEEN_SLAYER => 'Slayer of the Queen of Ice', | ||
self::EXPLORER => 'Explorer of Tlessa', | ||
self::RULER => 'Ruler of Tlessa', | ||
self::DEMON_SLAYER => 'Twisted Demon Slayer of Galidoth', | ||
self::QUEEN_OF_HEARTS => 'Lover to the Queen of Hearts', | ||
self::GAMBLING_ADDICT => 'Gambling Addict', | ||
]; | ||
|
||
/** | ||
* Throws if the value does not exist in the array of const values. | ||
* | ||
* @param string $value | ||
* @throws Exception | ||
*/ | ||
public function __construct(string $value) { | ||
if (!in_array($value, self::$values)) { | ||
throw new Exception($value . ' does not exist.'); | ||
} | ||
|
||
$this->value = $value; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<?php | ||
|
||
namespace App\Flare\View\Livewire\Info\Items; | ||
|
||
use App\Flare\Models\Item; | ||
use App\Flare\Values\ItemSpecialtyType; | ||
use Illuminate\Database\Eloquent\Builder; | ||
use Rappasoft\LaravelLivewireTables\Views\Column; | ||
use Rappasoft\LaravelLivewireTables\DataTableComponent; | ||
|
||
class CorruptedIce extends DataTableComponent { | ||
public function configure(): void { | ||
$this->setPrimaryKey('id'); | ||
} | ||
|
||
public function builder(): Builder { | ||
return Item::whereNull('item_prefix_id') | ||
->whereNull('item_suffix_id') | ||
->where('specialty_type', ItemSpecialtyType::CORRUPTED_ICE); | ||
} | ||
|
||
public function columns(): array { | ||
return [ | ||
Column::make('Name')->searchable()->format(function ($value, $row) { | ||
$itemId = Item::where('name', $value)->first()->id; | ||
|
||
return '<a href="/items/'. $itemId.'" >'.$row->name . '</a>'; | ||
})->html(), | ||
Column::make('Type')->searchable()->format(function ($value) { | ||
return ucfirst(str_replace('-', ' ', $value)); | ||
}), | ||
|
||
Column::make('Damage', 'base_damage')->sortable()->format(function ($value) { | ||
return number_format($value); | ||
}), | ||
Column::make('AC', 'base_ac')->sortable()->format(function ($value) { | ||
return number_format($value); | ||
}), | ||
Column::make('Healing', 'base_healing')->sortable()->format(function ($value) { | ||
return number_format($value); | ||
}), | ||
Column::make('Gold Cost', 'cost')->sortable()->format(function ($value) { | ||
return number_format($value); | ||
}), | ||
Column::make('Gold Dust Cost', 'gold_dust_cost')->sortable()->format(function ($value) { | ||
return number_format($value); | ||
}), | ||
Column::make('Shard Cost', 'shards_cost')->sortable()->format(function ($value) { | ||
return number_format($value); | ||
}), | ||
Column::make('Copper Coin Cost', 'copper_coin_cost')->sortable()->format(function ($value) { | ||
return number_format($value); | ||
}) | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.