Search in sources :

Example 1 with RSCombatInfo1

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

the class RSActorMixin method getHealthRatio.

@Inject
@Override
public int getHealthRatio() {
    RSCombatInfoList combatInfoList = getCombatInfoList();
    if (combatInfoList != null) {
        RSNode node = combatInfoList.getNode();
        RSNode next = node.getNext();
        if (next instanceof RSCombatInfoListHolder) {
            RSCombatInfoListHolder combatInfoListWrapper = (RSCombatInfoListHolder) next;
            RSCombatInfoList combatInfoList1 = combatInfoListWrapper.getCombatInfo1();
            RSNode node2 = combatInfoList1.getNode();
            RSNode next2 = node2.getNext();
            if (next2 instanceof RSCombatInfo1) {
                RSCombatInfo1 combatInfo = (RSCombatInfo1) next2;
                return combatInfo.getHealthRatio();
            }
        }
    }
    return -1;
}
Also used : RSCombatInfoList(net.runelite.rs.api.RSCombatInfoList) RSCombatInfoListHolder(net.runelite.rs.api.RSCombatInfoListHolder) RSNode(net.runelite.rs.api.RSNode) RSCombatInfo1(net.runelite.rs.api.RSCombatInfo1) Inject(net.runelite.api.mixins.Inject)

Aggregations

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