cz.cuni.amis.pogamut.ut2004.agent.module.sensor
Class AgentInfo

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
      extended by cz.cuni.amis.pogamut.base.agent.module.SensorModule<UT2004Bot>
          extended by cz.cuni.amis.pogamut.ut2004.agent.module.sensor.AgentInfo
All Implemented Interfaces:
IComponent

public class AgentInfo
extends SensorModule<UT2004Bot>

Memory module specialized on general info about the agent whereabouts.

It is designed to be initialized inside IUT2004BotController.prepareBot(UT2004Bot) method call and may be used since first Self message is received, i.e, since the first IUT2004BotController.botSpawned(cz.cuni.amis.pogamut.ut2004.communication.messages.gbinfomessages.GameInfo, ConfigChange, InitedMessage, Self) is called.


Field Summary
static double AT_LOCATION_EPSILON
          Which distance to a location is considered the same as specified location.
 Game game
          Game memory module.
static double IS_FACING_ANGLE
          What angle is considered to be maximum facing angle by default (in degrees).
static java.lang.String NONE_WEAPON_ID
           
static int TEAM_BLUE
          Blue team number.
static int TEAM_GOLD
          Gold team number.
static int TEAM_GREEN
          Green team number.
static int TEAM_NONE
          No-team number.
static int TEAM_RED
          Red team number.
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensorModule
worldView
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
agent, controller, eventBus, log
 
Constructor Summary
AgentInfo(UT2004Bot bot)
          Constructor.
AgentInfo(UT2004Bot bot, Game game)
          Constructor.
AgentInfo(UT2004Bot bot, Game game, java.util.logging.Logger log)
          Constructor.
 
Method Summary
 java.lang.Double _getCurrentVolumeTerminalVelocity()
          FIXME[js]: What the hell is this good for?
 boolean atLocation(ILocated location)
          Returns whether the bot is at 'location', using AT_LOCATION_EPSILON.
 boolean atLocation(ILocated location, double epsilon)
          Returns whether the bot is at 'location', using 'epsilon' as a distance tolerance
 boolean atLocation(java.lang.String objectId)
          Tells whether the bot is at navpoint/item/...
 boolean atLocation(java.lang.String objectId, double epsilon)
          Tells whether the bot is at navpoint/item/...
protected  void cleanUp()
          Hook where to perform clean up of data structures of the module.
 java.lang.Double getAccelerationRate()
          Retreives acceleration rate of the agent.
 java.lang.Integer getAdrenaline()
          Tells, how much adrenaline the agent has.
 java.lang.Double getAirControl()
          Retreives agent's control of movement while in the air.
 java.lang.Double getAirSpeed()
          Retreives maximum speed of the agent while moving in the air.
 java.lang.Integer getArmor()
          Tells, how much of combined armor the agent is wearing.
 java.lang.Double getBaseSpeed()
          Retreives maximum base speed of the agent.
 ConfigChange getConfig()
          Retrieves the configuration of the bot inside UT2004.
 java.lang.Integer getCurrentAmmo()
          Tells, how much ammunition the agent has left for the current weapon in its primary firing mode.
 java.lang.Integer getCurrentSecondaryAmmo()
          Tells, how much ammunition the agent has left for the current weapon in its alternate (secondary) firing mode.
 java.lang.Double getCurrentVolumeDamagePerSec()
          Amount of damage taken for spending time in the current volume.
 java.lang.String getCurrentVolumeDamageType()
          Retreives type of damage the current volume inflicts to the agent while he spends time in this volume.
 java.lang.Double getCurrentVolumeFluidFriction()
          Friction of the fluid in this map volume.
 java.lang.Double getCurrentVolumeGroundFriction()
          Friction of the floor in this map volume.
 UnrealId getCurrentWeapon()
          Retreives UnrealId of the weapon the agent is currently holding.
 java.lang.String getCurrentWeaponName()
          Returns name of the currently wielded weapon (or null if no such weapon exists).
 ItemType getCurrentWeaponType()
          Returns type of the weapon the agent is currently holding (or null if no such weapon exists).
 Velocity getCurrentZoneGravity()
          Gravity in this map zone.
 Velocity getCurrentZoneVelocity()
          Pulling velocity in this map zone.
 java.lang.Double getDamageScaling()
          Retreives scaling factor for damage dealt by the agent.
 int getDeaths()
          Retreives number of deaths the agent took.
 java.lang.Double getDistance(ILocated location)
          Computes crow-fly distance of the agent from given location.
 java.lang.Double getDodgeSpeedFactor()
          Retreives maximum speed of the agent while using dodge.
 java.lang.Double getDodgeZBoost()
          Retreives boost of the agent in the Z axis while using dodge.
 java.lang.Double getFallSpeed()
          Retreives maximum speed of the agent while falling.
 Location getFloorLocation()
          Retreives location of the nearest map geometry directly beneath the agent.
 java.lang.Integer getHealth()
          Tells, how much health the agent has.
 java.lang.Integer getHighArmor()
          Tells, how much of high armor the agent is wearing.
 Rotation getHorizontalRotation()
          Retreives absolute rotation of the agent within the map.
 UnrealId getId()
          Retreives a unique ID of the agent in the game.
 java.lang.Double getJumpZBoost()
          Retreives boost of the agent in the Z axis while jumping.
 int getKills()
          Retreives number of kills the agent scored.
 java.lang.Double getLadderSpeed()
          Retreives maximum speed of the agent while moving on a ladder.
 Location getLocation()
          Retreives absolute location of the agent within the map.
 java.lang.Integer getLowArmor()
          Tells, how much of low armor the agent is wearing.
 java.lang.String getName()
          Retreives current name of the agent in the game.
 Item getNearestItem()
          Retrieves nearest known item to current agent location.
 NavPoint getNearestNavPoint()
          Retrieves nearest known navpoint to current agent location.
 Player getNearestPlayer()
          Retrieves nearest known player to current agent location.
 Item getNearestVisibleItem()
          Retrieves nearest visible item to current agent location.
 NavPoint getNearestVisibleNavPoint()
          Retrieves nearest visible navpoint to current agent location.
 Player getNearestVisiblePlayer()
          Retrieves nearest visible player to current agent location.
 java.lang.Double getRemainingUDamageTime()
          Tells whether the agent has the damage multiplier (UDamage) bonus boost activated and how long will the UDamage boost remain active.
 Rotation getRotation()
          Retreives absolute rotation of the agent within the map.
 int getScore()
          Retreives current agent score.
 Self getSelf()
           
 int getSuicides()
          Retreives number of suicides the agent commited.
 java.lang.Integer getTeam()
          Retreives team number the agent is on.
 int getTeamScore()
          Retreives current agent's team score.
 double getTime()
          Retreives current game time, since the game started.
 Velocity getVelocity()
          Retreives current velocity of the agent as a vector of movement.
 java.lang.Double getWaterSpeed()
          Retreives maximum speed of the agent while moving in water.
 java.lang.Boolean hasArmor()
          Tells, whether the agent is armored to the maximum extent.
 java.lang.Boolean hasFastFire()
          Tells, whether the agent has special bonus action activated: the fast firing rate.
 java.lang.Boolean hasHighArmor()
          Tells, whether the agent is armored to the maximum of high-armor extent.
 java.lang.Boolean hasInvisibility()
          Tells, whether the agent has special bonus action activated: the invisibility.
 java.lang.Boolean hasLowArmor()
          Tells, whether the agent is armored to the maximum of low-armor extent.
 java.lang.Boolean hasRegeneration()
          Tells, whether the agent has special bonus action activated: the regenration, which is also called booster.
 java.lang.Boolean hasSpeed()
          Tells, whether the agent has special bonus action activated: the speed.
 java.lang.Boolean hasUDamage()
          Tells whether the agent has the damage multiplier (UDamage) bonus boost activated.
 java.lang.Boolean hasWeapon()
          Tells whether the bot is holding some weapon or not.
 java.lang.Boolean isAdrenalineFull()
          Tells, whether the agent has full adrenaline.
 java.lang.Boolean isAdrenalineSufficient()
          Tells, whether the agent gained enough adrenaline to use it for special adrenaline-based action, e.g.
 boolean isAtLocation(ILocated location)
          Returns whether the bot is at 'location'.
 java.lang.Boolean isCrouched()
          Tells, whether the agent is crouched.
 java.lang.Boolean isCurrentVolumeAffectingProjectiles()
          Tells, whether the current volume imparts its velocity to projectiles.
 java.lang.Boolean isCurrentVolumeBanningInventory()
          Tells, whether the current volume (the one the agent is within) forbids usage of the inventory.
 java.lang.Boolean isCurrentVolumeDestructive()
          Tells, whether the current volume kills the actors (almost) instantly.
 java.lang.Boolean isCurrentVolumePainCausing()
          Tells, whether the current volume is causing damage.
 java.lang.Boolean isCurrentVolumeWater()
          Tells, whether the current volume is water.
 java.lang.Boolean isCurrentZoneNeutral()
          Tells, whether the current zone is a neutral zone.
 boolean isEnemy(int team)
          Tells, whether a given team is an enemy team to the agent.
 boolean isEnemy(Player player)
          Tells, whether a given player is an enemy to the agent.
 java.lang.Boolean isFacing(ILocated location)
          Tells if the agent is currently facing input location.
 java.lang.Boolean isFacing(ILocated location, double angle)
          Tells if the agent is currently facing input location.
 boolean isFriend(int team)
          Tells, whether a given team is a friend team to the agent.
 boolean isFriend(Player player)
          Tells, whether a given player is a friend to the agent.
 java.lang.Boolean isHealthy()
          Tells, whether the agent is healthy, i.e.
 java.lang.Boolean isMoving()
          Tells, whether the agent is moving.
 java.lang.Boolean isPrimaryShooting()
          Tells, whether the agent is shooting with primary fire mode.
 java.lang.Boolean isSecondaryShooting()
          Tells, whether the agent is shooting with alternate (secondary) fire mode.
 java.lang.Boolean isShooting()
          Tells, whether the agent is shooting or not.
 java.lang.Boolean isSuperHealthy()
          Tells, whether the agent is healthy to the maximum boostable extent.
 java.lang.Boolean isTouchingGround()
          Tells, whether the agent is currently touching the groud with his feets.
 java.lang.Boolean isWalking()
          Tells, whether the agent is walking.
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, reset, resume, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE_WEAPON_ID

public static final java.lang.String NONE_WEAPON_ID
See Also:
Constant Field Values

TEAM_RED

public static final int TEAM_RED
Red team number.

See Also:
Constant Field Values

TEAM_BLUE

public static final int TEAM_BLUE
Blue team number.

See Also:
Constant Field Values

TEAM_GREEN

public static final int TEAM_GREEN
Green team number.

See Also:
Constant Field Values

TEAM_GOLD

public static final int TEAM_GOLD
Gold team number.

See Also:
Constant Field Values

TEAM_NONE

public static final int TEAM_NONE
No-team number.

See Also:
Constant Field Values

AT_LOCATION_EPSILON

public static final double AT_LOCATION_EPSILON
Which distance to a location is considered the same as specified location. Note that UT units are rather small.

See Also:
Constant Field Values

IS_FACING_ANGLE

public static final double IS_FACING_ANGLE
What angle is considered to be maximum facing angle by default (in degrees).

See Also:
Constant Field Values

game

public Game game
Game memory module.

Constructor Detail

AgentInfo

public AgentInfo(UT2004Bot bot)
Constructor. Setups the memory module based on bot's world view.

Parameters:
game - game info module

AgentInfo

public AgentInfo(UT2004Bot bot,
                 Game game)
Constructor. Setups the memory module based on bot's world view.

Parameters:
bot - owner of the module
game - game info module

AgentInfo

public AgentInfo(UT2004Bot bot,
                 Game game,
                 java.util.logging.Logger log)
Constructor. Setups the memory module based on bot's world view.

Parameters:
bot - owner of the module
game - game info module
log - Logger to be used for logging runtime/debug info. Note: If null is provided, this memory module creates it's own logger.
Method Detail

getId

public UnrealId getId()
Retreives a unique ID of the agent in the game.

Note: This ID does not change and can be relied upon during entire match. However, be aware that the ID may change between different matches and/or sessions.

Returns:
ID of the agent in the game.

getName

public java.lang.String getName()
Retreives current name of the agent in the game.

Note: The agent may choose and change it's name during a match and it does not need to be unique among players. Even an empty string might be a valid name.

Returns:
Name of the agent in the game.

getTeam

public java.lang.Integer getTeam()
Retreives team number the agent is on.

Returns:
Team number the player is on.
See Also:
TEAM_RED, TEAM_BLUE, TEAM_GREEN, TEAM_GOLD, TEAM_NONE, isEnemy(int), isEnemy(Player), isFriend(int), isFriend(Player)

isEnemy

public boolean isEnemy(int team)
Tells, whether a given team is an enemy team to the agent.

Parameters:
team - Team number to be tested.
Returns:
True, if the given team is an enemy team.
See Also:
getTeam(), isFriend(int)

isEnemy

public boolean isEnemy(Player player)
Tells, whether a given player is an enemy to the agent.

Parameters:
player - Player to be tested.
Returns:
True, if the given player is an enemy.
See Also:
getTeam(), isFriend(Player)

isFriend

public boolean isFriend(int team)
Tells, whether a given team is a friend team to the agent.

Parameters:
team - Team number to be tested.
Returns:
True, if the given team is a friend team.
See Also:
getTeam(), isEnemy(int)

isFriend

public boolean isFriend(Player player)
Tells, whether a given player is a friend to the agent.

Parameters:
player - Player to be tested.
Returns:
True, if the given player is a friend.
See Also:
getTeam(), isEnemy(Player)

getLocation

public Location getLocation()
Retreives absolute location of the agent within the map.

Returns:
Location of the agent within the map.
See Also:
getDistance(Location), Location.getDistance(Location), Location.getDistanceL1(Location), Location.getDistanceLinf(Location), Location.getDistancePlane(Location), Location.getDistanceSquare(Location)

atLocation

public boolean atLocation(java.lang.String objectId)
Tells whether the bot is at navpoint/item/... (anything ILocated) of id 'objectId'. Note that IDs are case sensitive! UT2004 is usually using camel-case.

Parameters:
objectId -
Returns:

atLocation

public boolean atLocation(java.lang.String objectId,
                          double epsilon)
Tells whether the bot is at navpoint/item/... (anything ILocated) of id 'objectId'. Note that IDs are case sensitive! UT2004 is usually using camel-case.

Parameters:
objectId -
epsilon -
Returns:

isAtLocation

public boolean isAtLocation(ILocated location)
Returns whether the bot is at 'location'.

Synonym for AgentInfo#atLocation(Location).

Returns:
bot is at lcoation

atLocation

public boolean atLocation(ILocated location)
Returns whether the bot is at 'location', using AT_LOCATION_EPSILON.

Returns:
bot is at lcoation

atLocation

public boolean atLocation(ILocated location,
                          double epsilon)
Returns whether the bot is at 'location', using 'epsilon' as a distance tolerance

Parameters:
location -
epsilon -
Returns:
bot is at lcoation with desired epsilon tolerance

getDistance

public java.lang.Double getDistance(ILocated location)
Computes crow-fly distance of the agent from given location.

Parameters:
location - Location within the map.
Returns:
Crow-fly distance of the agent and the location.
See Also:
getLocation()

getRotation

public Rotation getRotation()
Retreives absolute rotation of the agent within the map.

Returns:
Rotation of the agent within the map.

getHorizontalRotation

public Rotation getHorizontalRotation()
Retreives absolute rotation of the agent within the map.

Returns:
Rotation of the agent within the map.

getVelocity

public Velocity getVelocity()
Retreives current velocity of the agent as a vector of movement.

Returns:
Current velocity of the agent in the map.
See Also:
isMoving()

isMoving

public java.lang.Boolean isMoving()
Tells, whether the agent is moving. The agent is moving, when his actual velocity is non-zero.

Returns:
True, if the agent is moving.
See Also:
getVelocity()

isCrouched

public java.lang.Boolean isCrouched()
Tells, whether the agent is crouched. When crouched, the height of the agent is smaller and thus harder to spot/hit.

Returns:
True, if the agent is crouched.

isWalking

public java.lang.Boolean isWalking()
Tells, whether the agent is walking. When walking, the agent does not fall off the edges before notification about such edge can be sent to the agent. The agent's movement is, however, much slower.

Returns:
True, if the agent is walking.

isFacing

public java.lang.Boolean isFacing(ILocated location)
Tells if the agent is currently facing input location.

Parameters:
location - input location.
Returns:
True, if the bot is facing input location.

isFacing

public java.lang.Boolean isFacing(ILocated location,
                                  double angle)
Tells if the agent is currently facing input location.

Parameters:
location - input location.
angle - specifies maximum angle (in degrees) that will be still considered as facing angle.
Returns:
True, if the angle between agent facing vector and input location is smaller or equal to input angle.

getFloorLocation

public Location getFloorLocation()
Retreives location of the nearest map geometry directly beneath the agent. This can be used to determine how far the agent is above the ground, etc.

Returns:
Location of the ground beneath the agent.

isTouchingGround

public java.lang.Boolean isTouchingGround()
Tells, whether the agent is currently touching the groud with his feets. When not touching ground, the agent might be either jumping, or falling, or hanging from a ledge, or otherwise flying above the ground.

Returns:
True, if the agent is touching ground with his feets.

getRemainingUDamageTime

public java.lang.Double getRemainingUDamageTime()
Tells whether the agent has the damage multiplier (UDamage) bonus boost activated and how long will the UDamage boost remain active.

When UDamage is activated, the agent is causing double (or tripple, or even more) damage to other players. The multiplying factor depends on game settings and mutators.

Returns:
Time remaining for UDamage bonus boost. When this value is positive, the agent has the UDamage bonus boost currently activated. When this value is negative, the agent does not have UDamage activated.
See Also:
hasUDamage()

hasUDamage

public java.lang.Boolean hasUDamage()
Tells whether the agent has the damage multiplier (UDamage) bonus boost activated.

When UDamage is activated, the agent is causing double (or tripple, or even more) damage to other players. The multiplying factor depends on game settings and mutators.

Returns:
True, if the agent has damage multiplier bonus action activated.
See Also:
getRemainingUDamageTime()

hasInvisibility

public java.lang.Boolean hasInvisibility()
Tells, whether the agent has special bonus action activated: the invisibility. When invisibility is activated, the agent is almost invisible to other players. When moving, outline of the agent is glittering a bit. When standing still, he is very hard to spot.

To learn, for how long the bonus action will remain activated, check the remaining amount of adrenaline. When level of adrenaline reaches zero, the bonus action is deactivated. See getAdrenaline().

Returns:
True, if the agent has invisibility bonus action activated.
See Also:
getAdrenaline()

hasFastFire

public java.lang.Boolean hasFastFire()
Tells, whether the agent has special bonus action activated: the fast firing rate. When fast firing rate is activated, the agent is firing his weapon at a faster rate, eating more ammo, but launching more projectiles into air.

To learn, for how long the bonus action will remain activated, check the remaining amount of adrenaline. When level of adrenaline reaches zero, the bonus action is deactivated. See getAdrenaline().

Returns:
True, if the agent has fast firing rate bonus action activated.
See Also:
getAdrenaline()

hasRegeneration

public java.lang.Boolean hasRegeneration()
Tells, whether the agent has special bonus action activated: the regenration, which is also called booster. When booster is activated, the agent regenerates health slowly. Note: The agent's health never rises above the maximum health level.

To learn, for how long the bonus action will remain activated, check the remaining amount of adrenaline. When level of adrenaline reaches zero, the bonus action is deactivated. See getAdrenaline().

Returns:
True, if the agent has regenration bonus action activated.
See Also:
getAdrenaline()

hasSpeed

public java.lang.Boolean hasSpeed()
Tells, whether the agent has special bonus action activated: the speed. When speed is activated, the agent can move much faster than other players. Note: Firing rate does not change with speed.

To learn, for how long the bonus action will remain activated, check the remaining amount of adrenaline. When level of adrenaline reaches zero, the bonus action is deactivated. See getAdrenaline().

Returns:
True, if the agent has speed bonus action activated.
See Also:
getAdrenaline()

getHealth

public java.lang.Integer getHealth()
Tells, how much health the agent has.

The health usually starts at 100, and ranges from 0 to 199. These values, however, can be changed by various mutators.

Returns:
Current health status.
See Also:
isHealthy(), isSuperHealthy()

isHealthy

public java.lang.Boolean isHealthy()
Tells, whether the agent is healthy, i.e. not wounded.

Returns:
True, if the agent has at least standard amount of health.
See Also:
getHealth(), isSuperHealthy()

isSuperHealthy

public java.lang.Boolean isSuperHealthy()
Tells, whether the agent is healthy to the maximum boostable extent.

Returns:
True, if the agent has maximum amount of health.
See Also:
getHealth(), isHealthy()

getArmor

public java.lang.Integer getArmor()
Tells, how much of combined armor the agent is wearing.

The combined armor usually starts at 0, and ranges from 0 to 150. These values, however, can be changed by various mutators.

Note: The armor consist of two parts, which are summed together into combined armor value. However, each part is powered-up by different item (low armor by small shield; high armor by super-shield).

Returns:
Current armor status.
See Also:
hasArmor(), getLowArmor(), getHighArmor()

hasArmor

public java.lang.Boolean hasArmor()
Tells, whether the agent is armored to the maximum extent.

Returns:
True, if the agent has maximum amount of armor.
See Also:
getArmor(), hasLowArmor(), hasHighArmor()

getLowArmor

public java.lang.Integer getLowArmor()
Tells, how much of low armor the agent is wearing.

The low armor usually starts at 0, and ranges from 0 to 50. These values, however, can be changed by various mutators.

Note: The armor consist of two parts, which are summed together into combined armor value. However, each part is powered-up by different item (low armor by small shield; high armor by super-shield).

Returns:
Current low armor status.
See Also:
hasLowArmor(), getArmor(), getHighArmor()

hasLowArmor

public java.lang.Boolean hasLowArmor()
Tells, whether the agent is armored to the maximum of low-armor extent.

Returns:
True, if the agent has maximum amount of low-armor.
See Also:
getLowArmor(), hasArmor(), hasHighArmor()

getHighArmor

public java.lang.Integer getHighArmor()
Tells, how much of high armor the agent is wearing.

The high armor usually starts at 0, and ranges from 0 to 100. These values, however, can be changed by various mutators.

Note: The armor consist of two parts, which are summed together into combined armor value. However, each part is powered-up by different item (low armor by small shield; high armor by super-shield).

Returns:
Current high armor status.
See Also:
hasHighArmor(), getArmor(), getLowArmor()

hasHighArmor

public java.lang.Boolean hasHighArmor()
Tells, whether the agent is armored to the maximum of high-armor extent.

Returns:
True, if the agent has maximum amount of high-armor.
See Also:
getHighArmor(), hasArmor(), hasLowArmor()

getAdrenaline

public java.lang.Integer getAdrenaline()
Tells, how much adrenaline the agent has.

Adrenaline can be gained through fulfilling various game tasks, such as killing opponents, capturing flags, controlling domination points, picking up adrenaline pills, etc. Note: More adrenaline is gained when the agent fulfill these tasks in combos (e.g. by scoring a double-kill the agent receives significantly more adrenaline than by scoring two single-kills).

Once the adrenaline reaches a designated level, it can be used to start special bonus actions like booster, invisibility, speed, etc. The adrenaline is then spent on the action. The more adrenaline the agent has, the longer the action lasts. Note: The agent may gain new adrenaline during the bonus action, which prolongs the action duration. See isAdrenalineFull() to determine, when the necessary adrenaline level is reached.

The adrenaline usually starts at 0, and ranges from 0 to 100. These values, however, can be changed by various mutators.

Returns:
Current armor status.
See Also:
isAdrenalineFull()

isAdrenalineSufficient

public java.lang.Boolean isAdrenalineSufficient()
Tells, whether the agent gained enough adrenaline to use it for special adrenaline-based action, e.g. booster, invisibility, etc.

Returns:
True, if the adrenaline level is high enough for bonus action.
See Also:
getAdrenaline()

isAdrenalineFull

public java.lang.Boolean isAdrenalineFull()
Tells, whether the agent has full adrenaline.

Returns:
True, if the adrenaline level is at maximum.
See Also:
getAdrenaline()

getCurrentWeapon

public UnrealId getCurrentWeapon()
Retreives UnrealId of the weapon the agent is currently holding. This UnrealId is a unique identifier of weapon from the agent's inventory. Note that this UnrealId is different from UnrealId of item the agent seen or picked up from the ground earlier.

The UnrealId might contains a substring, which identifies the type of the weapon. However, this is not guaranteed by definition. Therefore, you shoud use inventory to retreive the appropriate weapon object, to further retreive correct type of weapon.

Returns:
UnrealId of the weapon the agent is currently holding in hands.
See Also:
getCurrentAmmo(), getCurrentSecondaryAmmo(), Weaponry#getCurrentWeapon(), Weaponry#getWeapon(UnrealId)

getCurrentWeaponName

public java.lang.String getCurrentWeaponName()
Returns name of the currently wielded weapon (or null if no such weapon exists).

Returns:
See Also:
getCurrentWeapon

getCurrentWeaponType

public ItemType getCurrentWeaponType()
Returns type of the weapon the agent is currently holding (or null if no such weapon exists).

Returns:

hasWeapon

public java.lang.Boolean hasWeapon()
Tells whether the bot is holding some weapon or not.

Note that getCurrentWeapon() always returns some id. But there is a special id that marks 'no weapon'

Returns:

getCurrentAmmo

public java.lang.Integer getCurrentAmmo()
Tells, how much ammunition the agent has left for the current weapon in its primary firing mode.

Returns:
Amount of ammunition for the primary firing mode.
See Also:
getCurrentSecondaryAmmo(), Inventory#getCurrentPrimaryAmmo()

getCurrentSecondaryAmmo

public java.lang.Integer getCurrentSecondaryAmmo()
Tells, how much ammunition the agent has left for the current weapon in its alternate (secondary) firing mode. Note that many weapons use primary ammo for the alternate (secondary) firing mode as well. In such cases, the amount of ammo for primary mode is returned.

Returns:
Amount of ammunition for the secondary firing mode.
See Also:
getCurrentAmmo(), Inventory#getCurrentSecondaryAmmo()

isShooting

public java.lang.Boolean isShooting()
Tells, whether the agent is shooting or not.

This method reports shooting with either primary or secondary fire mode. To distinguish between the fire modes, see isPriShooting(), isAltShooting().

Returns:
Returns true, if the agent is shooting his weapon.
See Also:
isPrimaryShooting(), isSecondaryShooting()

isPrimaryShooting

public java.lang.Boolean isPrimaryShooting()
Tells, whether the agent is shooting with primary fire mode.

This method reports shooting with primary fire mode only. See isAltShooting() method to determine, whether the agent shoots with alternate firing mode. See isShooting() to determine, whether the agent shoots with either primary or alternate firing mode.

Returns:
True, if the agent is shooting weapon in primary firing mode.
See Also:
isShooting(), isSecondaryShooting()

isSecondaryShooting

public java.lang.Boolean isSecondaryShooting()
Tells, whether the agent is shooting with alternate (secondary) fire mode.

This method reports shooting with alternate (secondary) fire mode only. See isPriShooting() method to determine, whether the agent shoots with primary firing mode. See isShooting() to determine, whether the agent shoots with either primary or alternate (secondary) firing mode.

Returns:
True, if the agent is shooting his weapon in alternate (secondary) firing mode.
See Also:
isShooting(), isPrimaryShooting()

getKills

public int getKills()
Retreives number of kills the agent scored.

A kill is counted, whenever the agent kills an opponent.

Returns:
Number of kills the agent scored.

getDeaths

public int getDeaths()
Retreives number of deaths the agent took.

A death is counted, whenever the agent dies.

Note that if Integer.MIN_VALUE is returned, than the number of deaths is unknown. This happens only if you call this method before the first logic iteration of the agent (i.e., before first PlayerScore messages are exported by GameBots).

Returns:
Number of deaths the agent took.

getSuicides

public int getSuicides()
Retreives number of suicides the agent commited.

A suicide is counted, whenever the agent dies by his own weapon, or by damaging himself by falling into pits, lava, acid, etc.

It can also be said that suicide is every agent's death, which could not be credited to any other player in the map.

Each suicide is also counted as death. See getDeaths().

Returns:
Number of suicides the agent commited.

getScore

public int getScore()
Retreives current agent score.

Agent score is usually rising by achieving some goals, e.g. killing opponents, capturing flags, controlling domination points, etc. Note: Agent score might decrease upon suicides, based on map, game type and game settings.

Note that if Integer.MIN_VALUE is returned, than the score is unknown. This happens only if you call this method before the first logic iteration of the agent (i.e., before first PlayerScore messages are exported by GameBots).

Returns:
Current agent score.

getTeamScore

public int getTeamScore()
Retreives current agent's team score.

Agent's team score is usually rising by achieving team goals, e.g. killing opponents, capturing flags, controlling domination points, etc. Note: Agent's team score might decrease, when oposing teams score points themselves, based on map, game type and game settings.

Returns:
Current agent's team score.

getCurrentZoneVelocity

public Velocity getCurrentZoneVelocity()
Pulling velocity in this map zone. Such pulling velocity effectively draws the player towards a specific direction or even lifts him upwards.

Returns:
Pulling velocity in this zone.

getCurrentZoneGravity

public Velocity getCurrentZoneGravity()
Gravity in this map zone. Gravity might differ throughout different parts of the map. The gravity is expressed as a velocity vector. This vector is used an acceleration. The fall speed may ramp up, to as much as getFallSpeed().

Returns:
Gravity in this zone.

getCurrentVolumeGroundFriction

public java.lang.Double getCurrentVolumeGroundFriction()
Friction of the floor in this map volume. Friction of the floor works towards movement, slowing down the acceleration and speed of the agent in any direction.

Returns:
Friction of the floor.

getCurrentVolumeFluidFriction

public java.lang.Double getCurrentVolumeFluidFriction()
Friction of the fluid in this map volume. Friction of the fluid works towards movement, slowing down the acceleration and speed of the agent in any direction.

Returns:
Friction of the fluid.

_getCurrentVolumeTerminalVelocity

public java.lang.Double _getCurrentVolumeTerminalVelocity()
FIXME[js]: What the hell is this good for?

Returns:
TerminalVelocity of the CurrentVolume.

isCurrentVolumeWater

public java.lang.Boolean isCurrentVolumeWater()
Tells, whether the current volume is water. When the agent is in water, getCurrentVolumeFluidFriction() and getWaterSpeed() can help to determine changes to movement and speed of the agent. Also note that getCurrentZoneVelocity(), getCurrentZoneGravity(), and others may change (and usually does) in water.

Returns:
True, if the current volume is water.

isCurrentVolumePainCausing

public java.lang.Boolean isCurrentVolumePainCausing()
Tells, whether the current volume is causing damage. Such damage is applied to the agent's health every second. The amount of damage taken per each second spent in this volume can be determined by getCurrentVolumeDamagePerSec(). When the volume damages the agent to the death, the death is counted as a suicide.

Returns:
True, if the current volume is causing damage.
See Also:
isCurrentVolumeDestructive(), getCurrentVolumeDamagePerSec()

getCurrentVolumeDamagePerSec

public java.lang.Double getCurrentVolumeDamagePerSec()
Amount of damage taken for spending time in the current volume. Such damage is applied to the agent's health every second. When the volume damages the agent to the death, the death is counted as a suicide.

Returns:
Amount of damage taken for spending time in the current volume.
See Also:
isCurrentVolumePainCausing()

isCurrentVolumeDestructive

public java.lang.Boolean isCurrentVolumeDestructive()
Tells, whether the current volume kills the actors (almost) instantly. Death in such destructive volume is counted as a suicide.

Returns:
True, if the current volume kills (almost) instantly.
See Also:
isCurrentVolumePainCausing()

getCurrentVolumeDamageType

public java.lang.String getCurrentVolumeDamageType()
Retreives type of damage the current volume inflicts to the agent while he spends time in this volume.

FIXME[js]: Is is possible to provide an enum here?

Returns:
Type of the damage the current volume inflicts to the agent.

isCurrentVolumeBanningInventory

public java.lang.Boolean isCurrentVolumeBanningInventory()
Tells, whether the current volume (the one the agent is within) forbids usage of the inventory. If so, no weapons or items can be used, changed, or picked up.

Returns:
True, if the current volume forbids usage of the inventory.

isCurrentVolumeAffectingProjectiles

public java.lang.Boolean isCurrentVolumeAffectingProjectiles()
Tells, whether the current volume imparts its velocity to projectiles. E.g. A volume might impart velocity to players to emulate wind. This settings tells, whether the same applies to projectiles. If so, Their trajectory will be affected by this volume velocity.

Returns:
True, if the current volume imparts its velocity to projectiles.

isCurrentZoneNeutral

public java.lang.Boolean isCurrentZoneNeutral()
Tells, whether the current zone is a neutral zone. In neutral zone, players can't take damage.

Returns:
True, if the current zone is a neutral zone.

getDamageScaling

public java.lang.Double getDamageScaling()
Retreives scaling factor for damage dealt by the agent. All damage dealt by the agent is reduced (or increased) by this value.

Returns:
Scaling factor for damage dealt by the agent.

getBaseSpeed

public java.lang.Double getBaseSpeed()
Retreives maximum base speed of the agent.

Returns:
Maximum base speed of the agent.

getAirSpeed

public java.lang.Double getAirSpeed()
Retreives maximum speed of the agent while moving in the air.

Returns:
Maximum speed of the agent while moving in the air.

getLadderSpeed

public java.lang.Double getLadderSpeed()
Retreives maximum speed of the agent while moving on a ladder.

Returns:
Maximum speed of the agent while moving on a ladder.

getWaterSpeed

public java.lang.Double getWaterSpeed()
Retreives maximum speed of the agent while moving in water.

Returns:
Maximum speed of the agent while moving in water.

getFallSpeed

public java.lang.Double getFallSpeed()
Retreives maximum speed of the agent while falling.

Returns:
Maximum speed of the agent while falling.

getDodgeSpeedFactor

public java.lang.Double getDodgeSpeedFactor()
Retreives maximum speed of the agent while using dodge.

FIXME[js]: Check about the name depending on the meaning/value.

Returns:
Maximum speed of the agent while using dodge.

getAccelerationRate

public java.lang.Double getAccelerationRate()
Retreives acceleration rate of the agent.

Returns:
Acceleration rate of the agent.

getAirControl

public java.lang.Double getAirControl()
Retreives agent's control of movement while in the air. This value ranges from 0 (none) to 1 (full control).

Returns:
Agent's control of movement while in the air.

getJumpZBoost

public java.lang.Double getJumpZBoost()
Retreives boost of the agent in the Z axis while jumping.

Returns:
Jumping boost of the agent in the Z axis.

getDodgeZBoost

public java.lang.Double getDodgeZBoost()
Retreives boost of the agent in the Z axis while using dodge.

Returns:
Dodge boost of the agent in the Z axis.

getTime

public double getTime()
Retreives current game time, since the game started.

Returns:
Current game timestamp.

getConfig

public ConfigChange getConfig()
Retrieves the configuration of the bot inside UT2004.

Returns:
Configuration of the bot.

getNearestNavPoint

public NavPoint getNearestNavPoint()
Retrieves nearest known navpoint to current agent location.

WARNING: O(n) complexity.

Returns:
nearest navpoint

getNearestVisibleNavPoint

public NavPoint getNearestVisibleNavPoint()
Retrieves nearest visible navpoint to current agent location.

WARNING: O(n) complexity.

Returns:
nearest visible navpoint

getNearestItem

public Item getNearestItem()
Retrieves nearest known item to current agent location.

WARNING: O(n) complexity.

Returns:
nearest item

getNearestVisibleItem

public Item getNearestVisibleItem()
Retrieves nearest visible item to current agent location.

WARNING: O(n) complexity.

Returns:
nearest visible item

getNearestPlayer

public Player getNearestPlayer()
Retrieves nearest known player to current agent location.

WARNING: O(n) complexity.

Returns:
nearest player

getNearestVisiblePlayer

public Player getNearestVisiblePlayer()
Retrieves nearest visible player to current agent location.

WARNING: O(n) complexity.

Returns:
nearest visible player

getSelf

public Self getSelf()

cleanUp

protected void cleanUp()
Description copied from class: AgentModule
Hook where to perform clean up of data structures of the module.

Called from AgentModule.stop(), AgentModule.kill(), AgentModule.reset().

Overrides:
cleanUp in class AgentModule<UT2004Bot>