ipowerfighter: improve logic for switching attack styles

This commit is contained in:
illumineawake 2020-10-30 17:13:42 +11:00
parent 5f8b33c2e2
commit 912b12c013
8 changed files with 23 additions and 6 deletions

View File

@ -23,7 +23,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
version = "3.2.0"
version = "3.3.0"
project.extra["PluginName"] = "iPowerfighter Plugin"
project.extra["PluginDescription"] = "Illumine - Powerfighter plugin"

View File

@ -450,11 +450,13 @@ public class iPowerFighterPlugin extends Plugin
int highestDiff = config.attackLvl() - attackLevel;
combatType type = combatType.ATTACK;
if ((config.strengthLvl() - strengthLevel) > highestDiff)
if ((config.strengthLvl() - strengthLevel) > highestDiff ||
(strengthLevel < config.strengthLvl() && strengthLevel < attackLevel && strengthLevel < defenceLevel))
{
type = combatType.STRENGTH;
}
if ((config.defenceLvl() - defenceLevel) > highestDiff)
if ((config.defenceLvl() - defenceLevel) > highestDiff ||
(defenceLevel < config.defenceLvl() && defenceLevel < attackLevel && defenceLevel < strengthLevel))
{
type = combatType.DEFENCE;
}

View File

@ -23,7 +23,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
version = "1.4.0"
version = "1.5.0"
project.extra["PluginName"] = "iUtils"
project.extra["PluginDescription"] = "Illumine - Utils required for plugins to function with added automation"

View File

@ -15,6 +15,7 @@ import net.runelite.api.Tile;
import net.runelite.api.TileItem;
import net.runelite.api.TileObject;
import net.runelite.api.WallObject;
import net.runelite.api.coords.LocalPoint;
import net.runelite.api.coords.WorldPoint;
import net.runelite.api.queries.DecorativeObjectQuery;
import net.runelite.api.queries.GameObjectQuery;
@ -297,7 +298,7 @@ public class ObjectUtils
return localGameObjects;
}
public GameObject getGameObjectAtLocation(WorldPoint worldPoint)
public GameObject getGameObjectAtWorldPoint(WorldPoint worldPoint)
{
assert client.isClientThread();
@ -311,6 +312,20 @@ public class ObjectUtils
.result(client).first();
}
public GameObject getGameObjectAtLocalPoint(LocalPoint localPoint)
{
assert client.isClientThread();
if (client.getLocalPlayer() == null)
{
return null;
}
return new GameObjectQuery()
.atLocalLocation(localPoint)
.result(client).first();
}
@Nullable
public GameObject findNearestBank()
{

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.