mirror of
https://github.com/brues-code/SuperCleveRoidMacros.git
synced 2026-09-16 03:38:00 +00:00
Add [mana]/[rage]/[energy] type-specific power conditionals
Read a SPECIFIC power slot (Enum.PowerType) as a percentage via ClassicAPI UnitPower/UnitPowerMax, rather than the unit's primary power. Adds mana/ mymana, rage/myrage, energy/myenergy (no-prefix = target, @unit-overridable; my = player), each supporting operators and multi-comparison like [power]/ [mypower]. Works cross-form (druid mana in Cat) and cross-unit -- the standout being [@target,mana:<15] to catch a caster near OOM. A unit with no such pool (max <= 0) fails rather than reading 0%. Registered in the macro error checker (needsArgs + operator hint); VALID_CONDITIONALS auto-populates from Keywords.
This commit is contained in:
@@ -651,6 +651,8 @@ local function validateConditional(conditional, args, action)
|
||||
combo = true,
|
||||
hp = true, myhp = true, rawhp = true, myrawhp = true,
|
||||
power = true, mypower = true, rawpower = true, myrawpower = true,
|
||||
mana = true, mymana = true, rage = true, myrage = true,
|
||||
energy = true, myenergy = true,
|
||||
hplost = true, myhplost = true,
|
||||
powerlost = true, mypowerlost = true,
|
||||
stat = true,
|
||||
@@ -678,6 +680,8 @@ local function validateConditional(conditional, args, action)
|
||||
-- Check operator syntax for numeric comparisons
|
||||
if args and type(args) == "string" then
|
||||
local hasHpOrPower = safeStringFind(baseCond, "hp") or safeStringFind(baseCond, "power") or
|
||||
safeStringFind(baseCond, "mana") or safeStringFind(baseCond, "energy") or
|
||||
safeStringFind(baseCond, "rage") or
|
||||
safeStringFind(baseCond, "combo") or baseCond == "stat"
|
||||
if hasHpOrPower then
|
||||
local hasOperator = safeStringFind(args, "[<>=~]+")
|
||||
|
||||
Reference in New Issue
Block a user