nl.tudelft.pogamut.ut2004.agent.module.shooting.weapon
Class FlakCannonShooting
java.lang.Object
cz.cuni.amis.pogamut.base.agent.module.AgentModule<AGENT>
cz.cuni.amis.pogamut.base.agent.module.SensorModule<UT2004Bot>
nl.tudelft.pogamut.ut2004.agent.module.shooting.AbstractWeaponShooting
nl.tudelft.pogamut.ut2004.agent.module.shooting.weapon.FlakCannonShooting
- All Implemented Interfaces:
- cz.cuni.amis.pogamut.base.component.IComponent, WeaponShooting
public class FlakCannonShooting
- extends AbstractWeaponShooting
Module to work efficiently with the flak cannon.
To avoid self damage the module won't use the secondary fire mode when it
might blow up in it's face and won't be able to survive the damage. Instead
secondary mode will be used. The effectiveness of this is somewhat limited as
flak cannon projectiles bounce around.
Consider using WeaponPrefs to ban the flak cannon on close range.
- Author:
- mpkorstanje
| 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 |
|
Method Summary |
protected WeaponPref |
getDefaultWeaponPref()
|
protected boolean |
isSafeToShoot(cz.cuni.amis.pogamut.base3d.worldview.object.ILocated target)
Don't shoot unless we are far away enough to avoid damaging ourselves, or
healthy enough to survive the damage. |
protected void |
shoot()
Shoot will be called after every end message. |
| 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 |
FLAK_CANNON_PRIMARY
protected static final WeaponPref FLAK_CANNON_PRIMARY
FLAK_CANON_SECONDARY_PROJECTILE_SPLASH_RADIUS
protected static final double FLAK_CANON_SECONDARY_PROJECTILE_SPLASH_RADIUS
- See Also:
- Constant Field Values
FLAK_CANON_SECONDARY_PROJECTILE_DAMAGE
protected static final int FLAK_CANON_SECONDARY_PROJECTILE_DAMAGE
- See Also:
- Constant Field Values
FlakCannonShooting
public FlakCannonShooting(UT2004Bot<?,?,?> agent,
AgentInfo info,
ImprovedShooting shoot,
Weaponry weaponry)
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
isSafeToShoot
protected boolean isSafeToShoot(cz.cuni.amis.pogamut.base3d.worldview.object.ILocated target)
- Don't shoot unless we are far away enough to avoid damaging ourselves, or
healthy enough to survive the damage.
- Parameters:
target - to shoot
- Returns:
- true iff we won't kill ourselves.
getDefaultWeaponPref
protected WeaponPref getDefaultWeaponPref()
- Specified by:
getDefaultWeaponPref in class AbstractWeaponShooting
- Returns:
- the default weapon preference.
Copyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.