nl.tudelft.pogamut.ut2004.agent.module.shooting.weapon
Class LinkGunShooting

Package class diagram package LinkGunShooting
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 nl.tudelft.pogamut.ut2004.agent.module.shooting.AbstractWeaponShooting
              extended by nl.tudelft.pogamut.ut2004.agent.module.shooting.weapon.LinkGunShooting
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.component.IComponent, WeaponShooting

public class LinkGunShooting
extends AbstractWeaponShooting
implements WeaponShooting

Module to efficient work with the link gun. Will power up team mates when possible.

To power up a team mate the AbstractWeaponShooting.shoot(WeaponPref, ILocated) must be called with a target that is a friendly player. In which case the weaponPref will be ignored. The module will only shoot at team mates who are in less then LINK_GUN_SEC_MAX_RANGE UT units away. To conserve ammo this shooting will not shoot at friendly players when they are not in range.

When facing a shielded player, the module will switch to secondary fire mode if the target is within secondary range or stop shooting all together.

Author:
mpkorstanje

Field Summary
protected static WeaponPref LINK_GUN_PRIMARY
          Primary mode preference.
protected static int LINK_GUN_SEC_MAX_RANGE
          Practical experiments show that the link guns secondary fire has a range of 1150UT units.
protected static WeaponPref LINK_GUN_SECONDARY
          Secondary mode preference.
protected static int SHIELD_GUN_DEFLECT_ANGLE
          Angle at which shield gun can deflect projectiles.
 
Fields inherited from class nl.tudelft.pogamut.ut2004.agent.module.shooting.AbstractWeaponShooting
ABOVE_PLAYER_OFFSET, active, BELOW_PLAYER_OFFSET, endMessageListener, FACING_ANGLE, focus, info, shoot, target, weaponPref, weaponry
 
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
LinkGunShooting(UT2004Bot<?,?,?> bot, AgentInfo info, ImprovedShooting shoot, Weaponry weaponry)
           
 
Method Summary
protected  boolean canAssist(Player player)
           
protected  WeaponPref getDefaultWeaponPref()
          Primary fire mode is preferred for the link gun.
protected  void shoot()
           Shoot will be called after every end message.
protected  void shootFriend(Player player)
           
 
Methods inherited from class nl.tudelft.pogamut.ut2004.agent.module.shooting.AbstractWeaponShooting
getFocus, getWeaponType, hasTarget, isActive, isWeaponReady, setFocus, shoot, stopShoot
 
Methods inherited from class cz.cuni.amis.pogamut.base.agent.module.AgentModule
cleanUp, 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
 
Methods inherited from interface nl.tudelft.pogamut.ut2004.agent.module.shooting.WeaponShooting
getFocus, getWeaponType, isActive, shoot, stopShoot
 

Field Detail

SHIELD_GUN_DEFLECT_ANGLE

protected static final int SHIELD_GUN_DEFLECT_ANGLE
Angle at which shield gun can deflect projectiles.

See Also:
Constant Field Values

LINK_GUN_SEC_MAX_RANGE

protected static final int LINK_GUN_SEC_MAX_RANGE
Practical experiments show that the link guns secondary fire has a range of 1150UT units. When attached to a friendly player, the range is ~1500UT unit. Since we can't test attachment we use 1150UT units.

See Also:
Constant Field Values

LINK_GUN_SECONDARY

protected static final WeaponPref LINK_GUN_SECONDARY
Secondary mode preference.


LINK_GUN_PRIMARY

protected static final WeaponPref LINK_GUN_PRIMARY
Primary mode preference.

Constructor Detail

LinkGunShooting

public LinkGunShooting(UT2004Bot<?,?,?> bot,
                       AgentInfo info,
                       ImprovedShooting shoot,
                       Weaponry weaponry)
Method Detail

shoot

protected void shoot()
Description copied from class: AbstractWeaponShooting

Shoot will be called after every end message.

Implementing subclasses should make a best effort attempt to shoot the given target using the given weapon preference if possible. Subclasses should take care to note that a target may not always be present. e.g. target == null.

Specified by:
shoot in class AbstractWeaponShooting

shootFriend

protected void shootFriend(Player player)

canAssist

protected boolean canAssist(Player player)

getDefaultWeaponPref

protected WeaponPref getDefaultWeaponPref()
Primary fire mode is preferred for the link gun.

Specified by:
getDefaultWeaponPref in class AbstractWeaponShooting
Returns:
the default weapon preference.


Copyright © 2013 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.