From 960e6c8476a032c7a56868d31f78d6888228dbb2 Mon Sep 17 00:00:00 2001 From: Dan Sheppard Date: Wed, 23 Aug 2023 21:05:49 -0500 Subject: [PATCH] Add Warlock options --- Versions/Common/BeStride_Mount.lua | 13 +++++++ Versions/Common/BeStride_Variables.lua | 6 +++ Versions/Common/logic.class.lua | 51 +++++++++++++++++++++++++- Versions/Common/mounting.class.lua | 7 ++++ Versions/Common/options.lua | 15 ++++++++ Versions/Common/upgrade.lua | 2 + libs/Ace3 | 2 +- localization/de-DE.lua | 1 + localization/en-US.lua | 1 + localization/fr-FR.lua | 1 + localization/ko-KR.lua | 1 + localization/zh-TW.lua | 1 + 12 files changed, 99 insertions(+), 2 deletions(-) diff --git a/Versions/Common/BeStride_Mount.lua b/Versions/Common/BeStride_Mount.lua index d13c73e..295ddd6 100644 --- a/Versions/Common/BeStride_Mount.lua +++ b/Versions/Common/BeStride_Mount.lua @@ -321,3 +321,16 @@ end function BeStride_Mount:RogueSprint() return self:MountSpell("[@player] "..SpellToName(2983)) end + +function BeStride_Mount:Warlock() + return self:WarlockBurningRush() +end + +function BeStride_Mount:WarlockBurningRush() + spell = SpellToName(111400) + if spell then + return self:MountSpell("[@player] " .. spell .. "\n/cancelaura " .. spell) + else + return nil + end +end diff --git a/Versions/Common/BeStride_Variables.lua b/Versions/Common/BeStride_Variables.lua index 0074007..3c0aaa9 100644 --- a/Versions/Common/BeStride_Variables.lua +++ b/Versions/Common/BeStride_Variables.lua @@ -65,6 +65,9 @@ BeStride_Variables = { { {name="classes.evoker.hover",element="CheckBox",label=LibStub("AceLocale-3.0"):GetLocale("BeStride")["Settings.Classes.Evoker.Hover"],class="evoker"}, }, + { + {name="classes.warlock.rush",element="CheckBox",label=LibStub("AceLocale-3.0"):GetLocale("BeStride")["Settings.Classes.Warlock.BurningRush"],class="warlock"}, + }, } }, } @@ -151,6 +154,9 @@ defaults = { evoker = { hover = true, }, + warlock = { + rush = true, + }, }, }, mounts = { diff --git a/Versions/Common/logic.class.lua b/Versions/Common/logic.class.lua index f80c065..97db612 100644 --- a/Versions/Common/logic.class.lua +++ b/Versions/Common/logic.class.lua @@ -97,6 +97,15 @@ function BeStride:IsEvoker() end end +function BeStride:IsWarlock() + -- Check for Warlock + if playerTable["class"]["id"] == 9 then + return true + else + return false + end +end + function BeStride:IsEvokerAndSpecial() if self:IsEvoker() then if IsFlying() and self:NoDismountWhileFlying() then @@ -268,7 +277,17 @@ function BeStride:IsShamanAndSpecial() end end - +function BeStride:IsWarlockAndSpecial() + if self:IsWarlock() then + if self:WarlockBurningRush() and self:MovementCheck() then + return true + else + return false + end + else + return false + end +end -- +--------------------------+ -- -- Class Specific Spells Checks -- @@ -483,6 +502,18 @@ function BeStride:RogueCanSprint() end end +-- -------------- -- +-- Warlock Spells -- +-- -------------- -- + +function BeStride:WarlockCanBurningRush() + if IsUsableSpell(111400) then + return true + else + return false + end +end + -- +-------------------------+ -- -- Class Specific Mount Checks -- -- +-------------------------+ -- @@ -754,6 +785,24 @@ function BeStride:ShamanGhostWolf() end end + +-- ------- -- +-- Warlock -- +-- ------- -- + +function BeStride:WarlockBurningRush() + -- Todo: Bitwise Compare + if self:IsWarlock() then + if self:WarlockCanBruningRush() and BeStride:DBGet("settings.classes.warlock.rush") then + return true + else + return false + end + else + return false + end +end + -- ------ -- -- Evoker -- -- ------ -- diff --git a/Versions/Common/mounting.class.lua b/Versions/Common/mounting.class.lua index 9a94543..f569b82 100644 --- a/Versions/Common/mounting.class.lua +++ b/Versions/Common/mounting.class.lua @@ -131,3 +131,10 @@ function BeStride:Rogue() BeStride_Debug:Error("This is a error. Please report to the maintainer at https://www.github.com/dansheps/bestride/issues/. ID: RGBSL") end end + +function BeStride:Warlock() + if not IsFlying() and self:MovementCheck() and self:WarlockBurningRush() then + return BeStride_Mount:Warlock() + end + BeStride_Debug:Error("This is a error. Please report to the maintainer at https://www.github.com/dansheps/bestride/issues/. ID: PABSL") +end diff --git a/Versions/Common/options.lua b/Versions/Common/options.lua index 82dc909..b8cc16f 100644 --- a/Versions/Common/options.lua +++ b/Versions/Common/options.lua @@ -416,6 +416,21 @@ local optionsTable_Options = { }, }, }, + warlock = { + type="group", + name=L["Classes.Warlock"], + disabled = function (info) return BeStride:IsWrath() and not BeStride:IsMainline() end, + args = { + ["classes.warlock.rush"]={ + type="toggle", + name=L["Settings.Classes.Warlock.BurningRush"], + order=1, + width="full", + get=function (info) return BeStride:DBGetSetting(info[#info]) end, + set=function (info,val) BeStride:DBSetSetting(info[#info],val) end, + }, + }, + }, }, }, } diff --git a/Versions/Common/upgrade.lua b/Versions/Common/upgrade.lua index 84a31b8..3825331 100644 --- a/Versions/Common/upgrade.lua +++ b/Versions/Common/upgrade.lua @@ -76,6 +76,8 @@ function BeStride:Upgrade() self.db.profile.settings.classes.mage.blink = value elseif key == "EVOKER" then self.db.profile.settings.classes.evoker.hover = value + elseif key == "Warlock" then + self.db.profile.settings.classes.warlock.rush = value end end) diff --git a/libs/Ace3 b/libs/Ace3 index 9a9a929..d319317 160000 --- a/libs/Ace3 +++ b/libs/Ace3 @@ -1 +1 @@ -Subproject commit 9a9a92911ba23b1eec36bd973edce48ad042db35 +Subproject commit d319317580d85c3cc6bc945f258cea9ba4bd186d diff --git a/localization/de-DE.lua b/localization/de-DE.lua index c9ee9c3..356fa8c 100644 --- a/localization/de-DE.lua +++ b/localization/de-DE.lua @@ -104,3 +104,4 @@ L["Settings.Profiles.CreateNew"] = "Neues Profil erstellen:" L["Settings.Profiles.Current"] = "Aktuelles Profil:" L["Settings.Profiles.CopyFrom"] = "Einstellungen kopieren von:" L["Settings.Profiles.Delete"] = "Profil löschen:" +L["Settings.Classes.Warlock.BurningRush"] = "Hexenmeister: Brennender Ansturm" diff --git a/localization/en-US.lua b/localization/en-US.lua index c4ca3bc..02de8cd 100644 --- a/localization/en-US.lua +++ b/localization/en-US.lua @@ -110,3 +110,4 @@ L["Settings.Profiles.CreateNew"] = "Create new Profile:" L["Settings.Profiles.Current"] = "Current Profile:" L["Settings.Profiles.CopyFrom"] = "Copy settings from:" L["Settings.Profiles.Delete"] = "Delete profile:" +L["Settings.Classes.Warlock.BurningRush"] = "Warlock: Burning Rush" diff --git a/localization/fr-FR.lua b/localization/fr-FR.lua index c7dc509..e1d3e18 100644 --- a/localization/fr-FR.lua +++ b/localization/fr-FR.lua @@ -103,3 +103,4 @@ L["Settings.Profiles.CreateNew"] = "Créer un nouveau Profile :" L["Settings.Profiles.Current"] = "Profil Actuel :" L["Settings.Profiles.CopyFrom"] = "Copier les paramètres depuis :" L["Settings.Profiles.Delete"] = "Supprimer le Profil :" +L["Settings.Classes.Warlock.BurningRush"] = "Warlock: Burning Rush" diff --git a/localization/ko-KR.lua b/localization/ko-KR.lua index 3dc4edc..29e1817 100644 --- a/localization/ko-KR.lua +++ b/localization/ko-KR.lua @@ -104,3 +104,4 @@ L["Settings.Profiles.CreateNew"] = "새 프로필 만들기:" L["Settings.Profiles.Current"] = "현재 프로필:" L["Settings.Profiles.CopyFrom"] = "프로필 복사:" L["Settings.Profiles.Delete"] = "프로필 삭제:" +L["Settings.Classes.Warlock.BurningRush"] = "Warlock: Burning Rush" diff --git a/localization/zh-TW.lua b/localization/zh-TW.lua index 5332923..20c2f0a 100644 --- a/localization/zh-TW.lua +++ b/localization/zh-TW.lua @@ -103,3 +103,4 @@ L["Settings.Profiles.CreateNew"] = "創建新的設定檔:" L["Settings.Profiles.Current"] = "當前設定檔:" L["Settings.Profiles.CopyFrom"] = "複製設定檔:" L["Settings.Profiles.Delete"] = "刪除設定檔:" +L["Settings.Classes.Warlock.BurningRush"] = "Warlock: Burning Rush"