cz.cuni.amis.pogamut.ut2004.bot.command
Class AdvancedShooting

java.lang.Object
  extended by cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
      extended by cz.cuni.amis.pogamut.base.agent.module.SensomotoricModule<UT2004Bot>
          extended by cz.cuni.amis.pogamut.ut2004.bot.command.BotCommands
              extended by cz.cuni.amis.pogamut.ut2004.bot.command.SimpleShooting
                  extended by cz.cuni.amis.pogamut.ut2004.bot.command.AdvancedShooting
All Implemented Interfaces:
IComponent
Direct Known Subclasses:
ImprovedShooting

public class AdvancedShooting
extends SimpleShooting

Class providing Pogamut2 UT2004 advanced shooting commands for the bot - shooting in secondary mode, grenade launcher shooting, etc.


Field Summary
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.SensomotoricModule
act, worldView
 
Fields inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
agent, controller, eventBus, log
 
Constructor Summary
AdvancedShooting(UT2004Bot agent, java.util.logging.Logger log)
          Constructor.
 
Method Summary
protected  void reset()
          Resets the agent module so it may be reused.
 void shoot()
          Bot will start shooting his current weapon (Issues GB SHOOT command)
 void shoot(Player target)
          Bot will start shooting with his current weapon at the target provided.
 void shoot(UnrealId target)
          Bot will start shooting with his current weapon at the target provided.
 void shootPrimary(ILocated location)
          Bot will start shooting his current weapon with primary firing mode at the location specified.
 void shootPrimary(Player target)
          Shortcut for 'shootPrimary(player.getId())', see shootPrimary(UnrealId).
 void shootPrimary(UnrealId target)
          Bot will start shooting his current weapon with primary firing mode at the target specified.
 void shootPrimaryCharged(ILocated location, double chargeTime)
          This method can be used for UT2004 charging weapons.
 void shootPrimaryCharged(Player target, double chargeTime)
          Shortcut for 'shootPrimaryCharged(player.getId())', see shootPrimaryCharged(UnrealId, double).
 void shootPrimaryCharged(UnrealId target, double chargeTime)
          This method can be used for UT2004 charging weapons.
 void shootSecondary()
          Bot will start shooting his current weapon with selected mode.
 void shootSecondary(ILocated location)
          Bot will start shooting his current weapon with secondary firing mode at the location specified.
 void shootSecondary(Player target)
          Shortcut for 'shootSecondary(player.getId())', see shootSecondary(UnrealId).
 void shootSecondary(UnrealId target)
          Bot will start shooting his current weapon with secondary firing mode at the target specified.
 void shootSecondaryCharged(ILocated location, double chargeTime)
          This method can be used for UT2004 charging weapons.
 void shootSecondaryCharged(Player target, double chargeTime)
          Shortcut for 'shootSecondaryCharged(player.getId())', see shootSecondaryCharged(UnrealId, double).
 void shootSecondaryCharged(UnrealId target, double chargeTime)
          This method can be used for UT2004 charging weapons.
 void shootWithMode(boolean secondaryMode)
          Bot will start shooting his current weapon with selected mode.
 void stopShoot()
          Bot will stop shooting his current weapon (Issues GB STOPSHOOT command)
 void stopShooting()
          The bot will stop shooting completely (regardless on the mode of shooting).
 
Methods inherited from class cz.cuni.amis.pogamut.ut2004.bot.command.SimpleShooting
shoot
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
cleanUp, getComponentId, getLog, getState, initComponentId, isRunning, kill, pause, resume, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AdvancedShooting

public AdvancedShooting(UT2004Bot agent,
                        java.util.logging.Logger log)
Constructor. Setups the command module based on given agent and logger.

Parameters:
agent - AbstractUT2004Bot we will send commands for
log - Logger to be used for logging runtime/debug info.
Method Detail

stopShooting

public void stopShooting()
The bot will stop shooting completely (regardless on the mode of shooting).

(issues GB STOPSHOOT command)


shootWithMode

public void shootWithMode(boolean secondaryMode)
Bot will start shooting his current weapon with selected mode.

(issues GB SHOOT command)

Parameters:
secondaryMode - If true secondary firing mode will be issued.

shootSecondary

public void shootSecondary()
Bot will start shooting his current weapon with selected mode.

(issues GB SHOOT command)

Parameters:
secondaryMode - If true secondary firing mode will be issued.

shootPrimary

public void shootPrimary(ILocated location)
Bot will start shooting his current weapon with primary firing mode at the location specified. The bot will shoot on this location even when he will turn a little bit from the direction to the location. If he turn out more then approx 15 - 30 degrees he won't be able to hit the location anymore.

(issues GB SHOOT command)

Parameters:
location - Location we will be shooting at.
See Also:
shootPrimary(UnrealId)

shootPrimary

public void shootPrimary(UnrealId target)
Bot will start shooting his current weapon with primary firing mode at the target specified. The target should exist in the environment. The bot will track the target in the environment as long as other commands won't change his focus (strafe(), turnTo()..). If they will the bot will still shoot on target location until he will turn from target more then approx 15 - 30 degrees. Then he won't be able to hit the target location anymore.

(issues GB SHOOT command)

Parameters:
target - Object in the environment we will shoot at.
See Also:
shootPrimary(ILocated)

shootPrimary

public void shootPrimary(Player target)
Shortcut for 'shootPrimary(player.getId())', see shootPrimary(UnrealId).

(issues GB SHOOT command)

Parameters:
target - Player the bot wants to shoot at.

shootSecondary

public void shootSecondary(ILocated location)
Bot will start shooting his current weapon with secondary firing mode at the location specified. The bot will shoot on this location even when he will turn a little bit from the direction to the location. If he turn out more then approx 15 - 30 degrees he won't be able to hit the location anymore.

(issues GB SHOOT command)

Parameters:
location - Location we will be shooting at.
See Also:
shootSecondary(UnrealId)

shootSecondary

public void shootSecondary(UnrealId target)
Bot will start shooting his current weapon with secondary firing mode at the target specified. The target should exist in the environment. The bot will track the target in the environment as long as other commands won't change his focus (strafe(), turnTo()..). If they will the bot will still shoot on target location until he will turn from target more then approx 15 - 30 degrees. Then he won't be able to hit the target location anymore.

(issues GB SHOOT command)

Parameters:
target - Object in the environment we will shoot at.
See Also:
shootSecondary(ILocated)

shootSecondary

public void shootSecondary(Player target)
Shortcut for 'shootSecondary(player.getId())', see shootSecondary(UnrealId).

(issues GB SHOOT command)

Parameters:
target - Player the bot wants to shoot at.

shootPrimaryCharged

public void shootPrimaryCharged(ILocated location,
                                double chargeTime)
This method can be used for UT2004 charging weapons. Some weapons in UT2004 feature charging firing modes. These modes works as follows. To shoot with a charging firing mode the bot has to start shooting first - this will trigger the weapon to start charging (it won't fire yet). To fire the weapon the bot needs to send STOPSHOOT command to stop charging the weapon and to release the projectile. This method does this automatically for primary firing mode of the weapon. The time of charging can be specified too (second parameter in seconds).

This method can be also used for non-charing (primary) firing mode of the weapon - then it will work as burst fire - the bot will continue firing for the amout of seconds specified.

So if the current weapon primary firing mode is charging, the bot will release the projectiles once. With normal primary firing mode the bot will fire a burst.

Note: We will shoot at location specified. The bot will continue to aim on the location in the environment (for the time of charging or bursting) as long as other commands won't change his focus (strafe(), turnTo()..). If they will the bot will still shoot on location until he will turn from it more then approx 15 - 30 degrees. Then he won't be able to hit the location anymore.

(issues GB SHOOT command)

Parameters:
location - Location we will be shooting at.
chargeTime - In seconds - how long we will charge the weapon (or how long will be the burst fire).
See Also:
shootPrimaryCharged(UnrealId, double)

shootPrimaryCharged

public void shootPrimaryCharged(UnrealId target,
                                double chargeTime)
This method can be used for UT2004 charging weapons. Some weapons in UT2004 feature charging firing modes. These modes works as follows. To shoot with a charging firing mode the bot has to start shooting first - this will trigger the weapon to start charging (it won't fire yet). To fire the weapon the bot needs to send STOPSHOOT command to stop charging the weapon and to release the projectile. This method does this automatically for primary firing mode of the weapon. The time of charging can be specified too (second parameter in seconds).

This method can be also used for non-charing (primary) firing mode of the weapon - then it will work as burst fire - the bot will continue firing for the amout of seconds specified.

So if the current weapon primary firing mode is charging, the bot will release the projectiles once. With normal primary firing mode the bot will fire a burst.

Note: The target for shooting should exist in the environment. The bot will track the target in the environment (for the time of charging or bursting) as long as other commands won't change his focus (strafe(), turnTo()..). If they will the bot will still shoot on target location until he will turn from target more then approx 15 - 30 degrees. Then he won't be able to hit the target location anymore.

(issues GB SHOOT command)

Parameters:
target - Object in the environment we will shoot at (basic tracking provided).
chargeTime - In seconds - how long we will charge the weapon (or how long will be the burst fire).
See Also:
shootPrimaryCharged(ILocated, double)

shootPrimaryCharged

public void shootPrimaryCharged(Player target,
                                double chargeTime)
Shortcut for 'shootPrimaryCharged(player.getId())', see shootPrimaryCharged(UnrealId, double).

(issues GB SHOOT command)

Parameters:
target - Player the bot wants to shoot at.

shootSecondaryCharged

public void shootSecondaryCharged(ILocated location,
                                  double chargeTime)
This method can be used for UT2004 charging weapons. Some weapons in UT2004 feature charging firing modes. These modes works as follows. To shoot with a charging firing mode the bot has to start shooting first - this will trigger the weapon to start charging (it won't fire yet). To fire the weapon the bot needs to send STOPSHOOT command to stop charging the weapon and to release the projectile. This method does this automatically for secondary firing mode of the weapon. The time of charging can be specified too (second parameter in seconds).

This method can be also used for non-charing (secondary) firing mode of the weapon - then it will work as burst fire - the bot will continue firing for the amout of seconds specified.

So if the current weapon secondary firing mode is charging, the bot will release the projectiles once. With normal secondary firing mode the bot will fire a burst.

Note: We will shoot at location specified. The bot will continue to aim on the location in the environment (for the time of charging or bursting) as long as other commands won't change his focus (strafe(), turnTo()..). If they will the bot will still shoot on location until he will turn from it more then approx 15 - 30 degrees. Then he won't be able to hit the location anymore.

(issues GB SHOOT command)

Parameters:
location - Location we will be shooting at.
chargeTime - In seconds - how long we will charge the weapon (or how long will be the burst fire).
See Also:
shootSecondaryCharged(UnrealId, double)

shootSecondaryCharged

public void shootSecondaryCharged(UnrealId target,
                                  double chargeTime)
This method can be used for UT2004 charging weapons. Some weapons in UT2004 feature charging firing modes. These modes works as follows. To shoot with a charging firing mode the bot has to start shooting first - this will trigger the weapon to start charging (it won't fire yet). To fire the weapon the bot needs to send STOPSHOOT command to stop charging the weapon and to release the projectile. This method does this automatically for secondary firing mode of the weapon. The time of charging can be specified too (second parameter in seconds).

This method can be also used for non-charing (secondary) firing mode of the weapon - then it will work as burst fire - the bot will continue firing for the amout of seconds specified.

So if the current weapon secondary firing mode is charging, the bot will release the projectiles once. With normal secondary firing mode the bot will fire a burst.

Note: The target for shooting should exist in the environment. The bot will track the target in the environment (for the time of charging or bursting) as long as other commands won't change his focus (strafe(), turnTo()..). If they will the bot will still shoot on target location until he will turn from target more then approx 15 - 30 degrees. Then he won't be able to hit the target location anymore.

(issues GB SHOOT command)

Parameters:
target - Object in the environment we will shoot at (basic tracking provided).
chargeTime - In seconds - how long we will charge the weapon (or how long will be the burst fire).
See Also:
shootSecondaryCharged(ILocated, double)

shootSecondaryCharged

public void shootSecondaryCharged(Player target,
                                  double chargeTime)
Shortcut for 'shootSecondaryCharged(player.getId())', see shootSecondaryCharged(UnrealId, double).

(issues GB SHOOT command)

Parameters:
target - Player the bot wants to shoot at.

reset

protected void reset()
Resets the agent module so it may be reused.

Overrides:
reset in class AgentModule<UT2004Bot>

shoot

public void shoot()
Description copied from class: SimpleShooting
Bot will start shooting his current weapon (Issues GB SHOOT command)

Overrides:
shoot in class SimpleShooting
See Also:
SimpleShooting.stopShoot(), SimpleShooting.shoot(UnrealId), SimpleShooting.shoot(ILocated)

shoot

public void shoot(UnrealId target)
Description copied from class: SimpleShooting
Bot will start shooting with his current weapon at the target provided. (Issues GB SHOOT command) Note that the bot will track the target while shooting. If not interrupted by other command that will change bot target or that will change bot focus too much.

Overrides:
shoot in class SimpleShooting
Parameters:
target - Target (that should be ILocated) the bot will shoot at. Bot will track the target, but see note above.
See Also:
SimpleShooting.stopShoot(), SimpleShooting.shoot()

shoot

public void shoot(Player target)
Description copied from class: SimpleShooting
Bot will start shooting with his current weapon at the target provided. (Issues GB SHOOT command) Note that the bot will track the target while shooting. If not interrupted by other command that will change bot target or that will change bot focus too much.

Overrides:
shoot in class SimpleShooting
Parameters:
target - Player the bot wants to shoot at.
See Also:
SimpleShooting.stopShoot(), SimpleShooting.shoot()

stopShoot

public void stopShoot()
Description copied from class: SimpleShooting
Bot will stop shooting his current weapon (Issues GB STOPSHOOT command)

Overrides:
stopShoot in class SimpleShooting
See Also:
SimpleShooting.shoot(), SimpleShooting.shoot(UnrealId)