public final class ActionsComplex
extends Object
Actions
Modifier and Type | Method and Description |
---|---|
static IAction |
descend(IGame game)
Remove levitation item or Descend.
|
static IAction |
doSokoban(IGame game)
Returns an action that will lead to solving the sokoban puzzle or null if
sokoban is already solved or given up on.
|
static IAction |
enhanceAll(IGame game)
Enhance any skill that can be enhanced or return null.
|
static IAction |
kick(IGame game,
Direction dir)
Kick in the given direction if the player is capable of kicking
and there don't seem to be heavy objects.
|
static IAction |
makeUse(IGame game,
Character slot)
If it is possible for the player, use the item at slot in the usual way:
This means wearing armor (removing any blocking armor) or putting on jewelry.
|
static IAction |
pray(IGame game)
Pray if it is likely to succeed, otherwise returns null.
|
static IAction |
removeUse(IGame game,
Character slot)
If it is possible for the player, stop using the item at slot.
|
static IAction |
unbag(IGame game,
Map.Entry<Character,IItem> item)
If the slot of the item MapEntry is a bag, take one of item out of the bag, otherwise returns null.
|
static IAction |
untrapMove(IGame game)
Move in any direction to escape a trap.
|
static IAction |
wield(IGame game,
Character slot)
If it is possible for the player, wield item at slot as a weapon, otherwise returns null.
|
static IAction |
withoutLevitation(IGame game,
IAction action)
Action modifier – if the player is levitating, replaces the given action
with removal of the levitation item, otherwise returns the action unmodified.
|
static IAction |
withReason(IAction action,
String reason)
Action modifier – attach a human-understandable reason to the given action.
|
public static IAction pray(IGame game)
IGame.canPray()
public static IAction kick(IGame game, Direction dir)
public static IAction unbag(IGame game, Map.Entry<Character,IItem> item)
public static IAction wield(IGame game, Character slot)
public static IAction makeUse(IGame game, Character slot)
public static IAction removeUse(IGame game, Character slot)
public static IAction enhanceAll(IGame game)
public static IAction descend(IGame game)
public static IAction doSokoban(IGame game)
This means seeking out the sokoban branch, pushing boulders to solve the puzzle and eventually reaching the zoo on the last level.
The bot needs to take over at times and actively kill any monsters that interfere or get stuck behind a boulder, otherwise the bot itself will likely get stuck.
Sokoban is considered solved when the bot reaches the prize tile in the zoo (with perma-engraved Elbereth). If more boulders appear on the level the bot will give up (and may get stuck on the level).
public static IAction withoutLevitation(IGame game, IAction action)
IGame.haveLevitationItemOn()
public static IAction withReason(IAction action, String reason)
reason
- Human readable text that will be logged when the action triggers