Search in sources :

Example 1 with RSCombatInfo2

use of net.runelite.rs.api.RSCombatInfo2 in project runelite by runelite.

the class RSActorMixin method getHealth.

@Inject
@Override
public int getHealth() {
    RSCombatInfoList combatInfoList = getCombatInfoList();
    if (combatInfoList != null) {
        RSNode node = combatInfoList.getNode();
        RSNode next = node.getNext();
        if (next instanceof RSCombatInfoListHolder) {
            RSCombatInfoListHolder combatInfoListWrapper = (RSCombatInfoListHolder) next;
            RSCombatInfo2 cf = combatInfoListWrapper.getCombatInfo2();
            return cf.getHealthScale();
        }
    }
    return -1;
}
Also used : RSCombatInfoList(net.runelite.rs.api.RSCombatInfoList) RSCombatInfoListHolder(net.runelite.rs.api.RSCombatInfoListHolder) RSNode(net.runelite.rs.api.RSNode) RSCombatInfo2(net.runelite.rs.api.RSCombatInfo2) Inject(net.runelite.api.mixins.Inject)

Aggregations

Inject (net.runelite.api.mixins.Inject)1 RSCombatInfo2 (net.runelite.rs.api.RSCombatInfo2)1 RSCombatInfoList (net.runelite.rs.api.RSCombatInfoList)1 RSCombatInfoListHolder (net.runelite.rs.api.RSCombatInfoListHolder)1 RSNode (net.runelite.rs.api.RSNode)1