Reference › Function reference › Platform

Platform.points.GetPlayerComboPointObservation

public

Call as

addon.Platform:GetPlayerComboPointObservation(powerType, kind)

Available directly through addon; no dependency is needed.

What it does

Observe the explicitly selected TBC player combo transport. Current uses exactly GetComboPoints(player,target); maximum uses UnitPowerMax(player,powerType) with the original selector. Other families are unavailable here and must use their existing point-power observer. Preserve readable finite signed, fractional and zero values. Missing, failed, restricted or malformed data remains unavailable; a failed chosen combo query never falls back to UnitPower. This observes no other actor and adds no cache.

Arguments

NameTypeWhat it does
selfRMPlatformRotation Master platform adapter (implicit with colon calls).
powerTypenumberOriginal explicit readable finite nonnegative integer combo-resource selector, including zero; retained for the maximum query.
kindstringExactly current for the player/target combo query or maximum for the player capacity query.

Returns

1number | nilFinite native resource quantity, retaining its sign and fractional part; nil when unavailable.
2string | nilPolicy, query-validation or required observation availability reason for a nil quantity.

Editions

Built In helpers are registered on every edition. What differs is the game API they read; where one is missing the helper falls back or returns nil with a reason.

  • Not available on that edition (the reason is in the tooltip)
  • Only while Blizzard's deprecation fallbacks are on
Game APIClassic EraTBC AnniversaryClassic progressionForeverRetail
GetComboPointsClassic EraTBC AnniversaryClassic progressionForeverRetail
UnitPowerMaxClassic EraTBC AnniversaryClassic progressionForeverRetail
canaccessvalueClassic EraTBC AnniversaryClassic progressionForeverRetail

Secret values (Retail and Forever)

On Retail and Forever the game hands addons secret values. This helper checks what it reads (addon.Platform:CanReadValue) and returns nil with a reason such as restricted-value instead of a secret it cannot compare. Treat nil as unavailable, not as false.

Example

-- TBC only; 4 is the combo point power type
local current = addon.Platform:GetPlayerComboPointObservation(4, "current")
if current == nil then return nil end
return current >= 5

Source

Platform/points.lua, line 216. Read only in game; Duplicate makes an editable copy.

Platform.points.GetPlayerComboPointObservation(self, powerType, kind)
    local info=self:GetClientInfo()
    if info.combatDataPolicy~='probe' then return nil,'unsupported-policy' end
    local family
    if self:CanReadValue(info) and type(info)=='table' then family=rawget(info,'family') end
    if not self:CanReadValue(family) then return nil,'restricted-value' end
    if canaccessvalue and not canaccessvalue(family) then return nil,'restricted-value' end
    if family~='tbc' then return nil,'unsupported-point-transport' end
    if not self:CanReadValue(powerType) or not self:CanReadValue(kind) then return nil,'restricted-value' end
    if type(powerType)~='number' or powerType~=powerType or powerType<0 or powerType==math.huge or powerType%1~=0 then return nil,'invalid-point-power-query' end
    if kind~='current' and kind~='maximum' then return nil,'invalid-point-power-query' end
    local api
    if kind=='current' then api=GetComboPoints else api=UnitPowerMax end
    if type(api)~='function' then return nil,'missing-api' end
    local ok,result
    if kind=='current' then ok,result=pcall(api,'player','target') else ok,result=pcall(api,'player',powerType) end
    if not ok then return nil,'api-error' end
    if not self:CanReadValue(result) then return nil,'restricted-value' end
    if canaccessvalue and not canaccessvalue(result) then return nil,'restricted-value' end
    if result==nil then return nil,'point-power-unavailable' end
    if type(result)~='number' or result~=result or result==math.huge or result==-math.huge then return nil,'invalid-api-result' end
    return result

Back to Function reference