diff --git a/Fuyutsui/Fuyutsui.toc b/Fuyutsui/Fuyutsui.toc index 102594df..f4e5006b 100644 --- a/Fuyutsui/Fuyutsui.toc +++ b/Fuyutsui/Fuyutsui.toc @@ -1,4 +1,4 @@ -## Interface: 120000, 120001, 120005, 120007, 120010 +## Interface: 120000, 120001, 120005, 120007, 120010 ## Title: Fuyutsui ## Version: 1.2.1 diff --git a/Fuyutsui/class/Paladin.lua b/Fuyutsui/class/Paladin.lua index cb884f4e..1b8ae949 100644 --- a/Fuyutsui/class/Paladin.lua +++ b/Fuyutsui/class/Paladin.lua @@ -1,11 +1,6 @@ if UnitClassBase("player") ~= "PALADIN" then return end local addon, ns = ... -local function isSpellKnown() - local known = C_SpellBook.IsSpellKnownOrInSpellBook(432459) or C_SpellBook.IsSpellKnownOrInSpellBook(432472) - return known -end - Fuyutsui.ClassBlocks = { [1] = { states = { @@ -30,7 +25,8 @@ Fuyutsui.ClassBlocks = { "难度", "施法技能", "施法目标", - "神圣军备" + "神圣军备", + "自律", }, ["能量"] = { "法力值", @@ -93,7 +89,8 @@ Fuyutsui.ClassBlocks = { { spellId = 114165, name = "神圣棱镜" }, { spellId = 31821, name = "光环掌握" }, { spellId = 200025, name = "美德道标" }, - { spellId = 432459, name = "神圣壁垒", charge = true, maxCharge = 4 }, + { spellId = 432459, name = "神圣壁垒", charge = true, maxCharge = 2 }, + { spellId = 391054, name = "代祷" }, }, group = { num = 6, @@ -128,6 +125,7 @@ Fuyutsui.ClassBlocks = { "队伍人数", "首领战", "难度", + "自律", }, ["能量"] = { "法力值", @@ -209,6 +207,7 @@ Fuyutsui.ClassBlocks = { "首领战", "难度", "敌人数量", + "自律", }, ["能量"] = { "法力值", @@ -341,4 +340,7 @@ Fuyutsui.spellsList = { [200025] = { index = 24, name = "美德道标" }, [114165] = { index = 25, name = "神圣棱镜" }, [53595] = { index = 26, name = "正义之锤" }, + [6940] = { index = 27, name = "牺牲祝福" }, + [391054] = { index = 28, name = "代祷" }, + [633] = { index = 29, name = "圣疗术" }, } diff --git a/Fuyutsui/core/events.lua b/Fuyutsui/core/events.lua index 4fc8cd46..f4b24f4e 100644 --- a/Fuyutsui/core/events.lua +++ b/Fuyutsui/core/events.lua @@ -187,15 +187,11 @@ function Fuyutsui:UNIT_SPELLCAST_SUCCEEDED(_, unitTarget, castGUID, spellID, cas end end -local test = {} function Fuyutsui:SPELL_UPDATE_COOLDOWN(_, spellID, baseSpellID) if issecretvalue(spellID) then return end - if spellID and not test[spellID] then - test[spellID] = true - local spellLink = C_Spell.GetSpellLink(spellID) - if spellLink then - print(spellID, spellLink) - end + + if spellID == 25771 then + self:UpdatePlayerForbearance() end self:UpdateKnightStatus(spellID) end @@ -435,7 +431,7 @@ function Fuyutsui:OnUpdate(elapsed) end self.timeElapsed1 = self.timeElapsed1 + elapsed - if self.timeElapsed1 > 1 then + if self.timeElapsed1 >= 1 then self:UpdatePlayerCombatTime() self:UpdateKnightStatusCount() self.timeElapsed1 = 0 diff --git a/Fuyutsui/core/player.lua b/Fuyutsui/core/player.lua index 8468c27c..4b8d914f 100644 --- a/Fuyutsui/core/player.lua +++ b/Fuyutsui/core/player.lua @@ -419,3 +419,25 @@ function Fuyutsui:UpdateMountCasting(spellID, casting) end) end end + +local forbearanceTimer = nil + +function Fuyutsui:UpdatePlayerForbearance() -- 25771 自律 + if forbearanceTimer then + forbearanceTimer:Cancel() + forbearanceTimer = nil + end + + local remaining = 30 + state.forbearance = remaining / 255 + self:UpdateStateBlock("状态", "自律") + + forbearanceTimer = C_Timer.NewTicker(1, function() + remaining = remaining - 1 + state.forbearance = remaining > 0 and (remaining / 255) or 0 + self:UpdateStateBlock("状态", "自律") + if remaining <= 0 then + forbearanceTimer = nil + end + end, 30) +end diff --git a/Fuyutsui/core/stateblocks.lua b/Fuyutsui/core/stateblocks.lua index 7f5c6aa6..5528d612 100644 --- a/Fuyutsui/core/stateblocks.lua +++ b/Fuyutsui/core/stateblocks.lua @@ -69,6 +69,7 @@ function Fuyutsui:GetUnitInterruptiblePixel(unit, mode) if not channel then return 0 end local _, _, _, _, _, _, notInterruptible, _, _, _, castBarID = UnitChannelInfo(unit) if not castBarID then return nil end + ---@diagnostic disable-next-line: param-type-mismatch local interruptibleColor = EvaluateColorFromBoolean(notInterruptible, ColorValue0, ColorValue1) local _, _, interruptible = interruptibleColor:GetRGB() return interruptible @@ -76,6 +77,7 @@ function Fuyutsui:GetUnitInterruptiblePixel(unit, mode) if not UnitCastingDuration(unit) then return 0 end local _, _, _, _, _, _, _, notInterruptible = UnitCastingInfo(unit) + ---@diagnostic disable-next-line: param-type-mismatch local interruptibleColor = EvaluateColorFromBoolean(notInterruptible, ColorValue0, ColorValue1) local _, _, interruptible = interruptibleColor:GetRGB() return interruptible @@ -126,6 +128,7 @@ local stateBlockGetters = { ["符文"] = function() return GetRunePixel() end, ["姿态"] = function() return state.shapeshiftFormID or 0 end, ["天启骑士数量"] = function() return state.knightCount or 0 end, + ["自律"] = function() return state.forbearance or 0 end, ["爆发开关"] = function(self) return GetConfigPixel(self, "cooldowns") end, ["AOE开关"] = function(self) return GetConfigPixel(self, "aoeMode") end, diff --git a/Infrastructure/ClassStateCatalog.cs b/Infrastructure/ClassStateCatalog.cs index 29918cd2..3dcd47da 100644 --- a/Infrastructure/ClassStateCatalog.cs +++ b/Infrastructure/ClassStateCatalog.cs @@ -32,7 +32,7 @@ internal static class ClassStateCatalog "首领战", "难度", "英雄天赋", "施法目标", "施法技能", "敌人数量", "敌人数-无仇恨", "敌人数-有仇恨","施法", "引导", "蓄力", "蓄力层数", "酒池", "符文", "姿态", - "救赎之魂1", "救赎之魂2", "神圣军备" + "救赎之魂1", "救赎之魂2", "神圣军备", "自律" ]), (CategoryConfig, [ diff --git a/UI/StatusForm.cs b/UI/StatusForm.cs index a0e3465e..9d64f820 100644 --- a/UI/StatusForm.cs +++ b/UI/StatusForm.cs @@ -776,7 +776,7 @@ public sealed class StatusForm : Form "队伍类型", "队伍人数", "首领战", "难度", "英雄天赋", "施法目标", "施法技能", "敌人数量", "敌人数-无仇恨", "敌人数-有仇恨", "施法", "引导", "蓄力", "蓄力层数", "酒池", "符文", "姿态", - "救赎之魂1", "救赎之魂2", "神圣军备" + "救赎之魂1", "救赎之魂2", "神圣军备", "自律" ], 150), 0, 0); fields.Controls.Add(CreateAboutFieldCard(