-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#2504 Added support for Mark of the Wild, Skyfury Totem, etc. for Sim…
…ulationCraft options.
- Loading branch information
Showing
16 changed files
with
389 additions
and
156 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,18 @@ | ||
<?php | ||
|
||
namespace App\Models\SimulationCraft; | ||
|
||
enum SimulationCraftRaidBuffs: int | ||
{ | ||
case Bloodlust = 1; | ||
case ArcaneIntellect = 2; | ||
case PowerWordFortitude = 4; | ||
case MarkOfTheWild = 8; | ||
case BattleShout = 16; | ||
case MysticTouch = 32; | ||
case ChaosBrand = 64; | ||
case Skyfury = 128; | ||
case HuntersMark = 256; | ||
case PowerInfusion = 512; | ||
case Bleeding = 1024; | ||
} |
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,36 @@ | ||
<?php | ||
|
||
namespace App\Models\Traits; | ||
|
||
trait BitMasks | ||
{ | ||
/** | ||
* @param int $value | ||
* @param int $flag | ||
* @return int | ||
*/ | ||
protected function bitMaskAdd(int $value, int $flag): int | ||
{ | ||
return $value | $flag; | ||
} | ||
|
||
/** | ||
* @param int $value | ||
* @param int $flag | ||
* @return int | ||
*/ | ||
protected function bitMaskRemove(int $value, int $flag): int | ||
{ | ||
return $value & ~$flag; | ||
} | ||
|
||
/** | ||
* @param int $value | ||
* @param int $flag | ||
* @return bool | ||
*/ | ||
protected function bitMaskHasValue(int $value, int $flag): bool | ||
{ | ||
return ($value & $flag) > 0; | ||
} | ||
} |
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
28 changes: 28 additions & 0 deletions
28
...11_12_122024_add_raid_buffs_mask_column_to_simulation_craft_raid_events_options_table.php
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,28 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration { | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::table('simulation_craft_raid_events_options', function (Blueprint $table) { | ||
$table->integer('raid_buffs_mask')->after('thundering_clear_seconds')->default(0); | ||
$table->index('raid_buffs_mask'); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('simulation_craft_raid_events_options', function (Blueprint $table) { | ||
$table->dropColumn('raid_buffs_mask'); | ||
}); | ||
} | ||
}; |
44 changes: 44 additions & 0 deletions
44
...22042_migrate_to_raid_buffs_mask_column_in_simulation_craft_raid_events_options_table.php
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,44 @@ | ||
<?php | ||
|
||
use App\Models\SimulationCraft\SimulationCraftRaidBuffs; | ||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration { | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
$replace = [ | ||
'bloodlust' => SimulationCraftRaidBuffs::Bloodlust, | ||
'arcane_intellect' => SimulationCraftRaidBuffs::ArcaneIntellect, | ||
'power_word_fortitude' => SimulationCraftRaidBuffs::PowerWordFortitude, | ||
'battle_shout' => SimulationCraftRaidBuffs::BattleShout, | ||
'mystic_touch' => SimulationCraftRaidBuffs::MysticTouch, | ||
'chaos_brand' => SimulationCraftRaidBuffs::ChaosBrand, | ||
]; | ||
|
||
foreach($replace as $from => $to) { | ||
/** @noinspection SqlResolve */ | ||
DB::update( | ||
sprintf( | ||
'UPDATE `simulation_craft_raid_events_options` SET `raid_buffs_mask` = `raid_buffs_mask` | %d WHERE `%s` = 1', | ||
$to, | ||
$from | ||
) | ||
); | ||
} | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::table('simulation_craft_raid_events_options', function (Blueprint $table) { | ||
// | ||
}); | ||
} | ||
}; |
Oops, something went wrong.