Skip to content

Commit

Permalink
feat: #2039 add Spell Learned condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ascott18 committed Dec 23, 2023
1 parent fc14a09 commit ae50b2d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
26 changes: 26 additions & 0 deletions Components/Core/Conditions/Categories/Spells.lua
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,32 @@ function Env.ReactiveHelper(NameFirst, Checked)
end
end

ConditionCategory:RegisterCondition(2.95, "SPELL_LEARNED", {
text = L["SPELL_LEARNED"],

bool = true,

name = function(editbox)
editbox:SetTexts(L["SPELL_LEARNED"], L["CNDT_ONLYFIRST"])
editbox:SetLabel(L["SPELLTOCHECK"])
end,
useSUG = true,
unit = false,
formatter = TMW.C.Formatter.BOOL,
icon = 237558,
tcoords = CNDT.COMMON.standardtcoords,
Env = {
GetSpellInfo = GetSpellInfo,
},
-- In Classic SoD, IsPlayerSpell doesn't work for rune abilities (always returns false).
-- However, GetSpellInfo with a name input only returns the player's spells.
funcstr = [[BOOLCHECK( GetSpellInfo(c.Spells.FirstString) )]],
events = function(ConditionObject, c)
return
ConditionObject:GenerateNormalEventString("SPELLS_CHANGED")
end,
})

ConditionCategory:RegisterCondition(3, "REACTIVE", {
text = L["SPELLREACTIVITY"],
tooltip = L["REACTIVECNDT_DESC"],
Expand Down
1 change: 1 addition & 0 deletions Localization/TellMeWhen-enUS.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1690,6 +1690,7 @@ L["SPELLCHARGETIME_DESC"] = "Tracks the time remaining until a spell like %s or

L["EMPOWEREDSTAGE"] = "Empowered Spell Stage"
L["EMPOWEREDSTAGE_DESC"] = "Current stage of empowered spell"
L["SPELL_LEARNED"] = "Spell Learned"
L["SPELLREACTIVITY"] = "Spell Reactivity"
L["MP5"] = "%d MP5"
L["REACTIVECNDT_DESC"] = "This condition only checks the reactive state of the ability, not the cooldown of it."
Expand Down

0 comments on commit ae50b2d

Please sign in to comment.