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

Package class diagram package ShieldGunShooting
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.ShieldGunShooting
All Implemented Interfaces:
cz.cuni.amis.pogamut.base.component.IComponent, WeaponShooting

public class ShieldGunShooting
extends AbstractWeaponShooting

Module to work efficiently with the shield gun.

When the primary mode is given to the weapon preferences the shield gun will simply charge up. It's up to other component to run into someone.

When the secondary mode is requested by weapon preferences the shield gun activate for 1 second when ever it detects that it is taking damage, sees an incoming projectile or sees it's target shooting or sees it's target aiming a hitscan weapon at it. While doing this the bot will aim in the direction of its target, potentially bouncing shock cores and link gun projectiles to it's target.

Author:
mpkorstanje

Field Summary
protected static WeaponPref DEFAULT_WEAPON_PREF
          Default is the secondary mode.
protected static int INCOMMING_PROJECTILE_MIN_THREAT_DISTANCE
          Distance at which incoming projectiles can be considered threatening.
protected  Projectiles projectiles
          Projectiles modules.
protected  Senses senses
          Senses module.
protected static double SHIELD_GUN_SEC_BURST_DURATION
          Duration in second that the shield gun will fire.
 
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
ShieldGunShooting(UT2004Bot<?,?,?> bot, AgentInfo info, ImprovedShooting shoot, Weaponry weaponry, Projectiles projectiles, Senses senses)
           
 
Method Summary
protected  WeaponPref getDefaultWeaponPref()
           
protected  void shoot()
           Shoot will be called after every end message.
protected  void shootPrimary()
           
protected  void shootSecondary()
           
 
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
 

Field Detail

INCOMMING_PROJECTILE_MIN_THREAT_DISTANCE

protected static final int INCOMMING_PROJECTILE_MIN_THREAT_DISTANCE
Distance at which incoming projectiles can be considered threatening.

See Also:
Constant Field Values

SHIELD_GUN_SEC_BURST_DURATION

protected static final double SHIELD_GUN_SEC_BURST_DURATION
Duration in second that the shield gun will fire.

See Also:
Constant Field Values

DEFAULT_WEAPON_PREF

protected static final WeaponPref DEFAULT_WEAPON_PREF
Default is the secondary mode.


projectiles

protected Projectiles projectiles
Projectiles modules.


senses

protected Senses senses
Senses module. Note: shared with the main again. Careful with "Once" functions.

Constructor Detail

ShieldGunShooting

public ShieldGunShooting(UT2004Bot<?,?,?> bot,
                         AgentInfo info,
                         ImprovedShooting shoot,
                         Weaponry weaponry,
                         Projectiles projectiles,
                         Senses senses)
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

shootPrimary

protected void shootPrimary()

shootSecondary

protected void shootSecondary()

getDefaultWeaponPref

protected WeaponPref getDefaultWeaponPref()
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.