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

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

public class ShockRifleShooting
extends nl.tudelft.pogamut.unreal.agent.module.shooting.AbstractWeaponShooting

Module to work efficiently with the shock rifle. Will use shock combos when possible.

To create a shock combo AbstractWeaponShooting.shoot(WeaponPref, ILocated) must be called with a weaponPref that allows the secondary fire mode to be used. When used through AdvancedShooting the appropriate weapon preference must be set on WeaponPrefs.

To avoid self damage the module won't use the secondary firemode when the projectile may blow up in it's face and won't be able to survive the damage. Generally WeaponPrefs should handle this but it may not be within ImprovedShooting.getChangeWeaponCooldown(). When unable to use the secondary, the primary will be used.

To avoid projectiles being deflected back by a shield gun, the module won't directly shoot at players who have an active shield gun facing them. It will however attempt to detonate a combo above the target if they are in range.

Author:
mpkorstanje

Field Summary
protected  cz.cuni.amis.pogamut.base3d.worldview.object.Location lastLocation
          Last known location of our target.
protected  nl.tudelft.pogamut.unreal.agent.module.sensor.Projectiles projectiles
           
protected static int SHIELD_GUN_DEFLECT_ANGLE
          Angle at which shield gun can deflect projectiles.
protected static double SHOCK_RIFLE_COMBO_RADIUS
          Radius of the shock combo blast.
protected static int SHOCK_RIFLE_MIN_DISTANCE_COMBO
          Minimum distance in UT units the orb will travel before reload.
protected static WeaponPref SHOCK_RIFLE_PRIMARY
          Primary mode preference.
protected static int SHOCK_RIFLE_PROJECTILE_DAMAGE
          Damage to self when hit by projectile.
protected static double SHOCK_RIFLE_PROJECTILE_SPLASH_RADIUS
          Radius of the shock orb splash damage.
protected static WeaponPref SHOCK_RIFLE_SECONDARY
          Secondary mode preference.
 
Fields inherited from class nl.tudelft.pogamut.unreal.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
ShockRifleShooting(UT2004Bot<?,?,?> bot, AgentInfo info, ImprovedShooting shoot, Weaponry weaponry, nl.tudelft.pogamut.unreal.agent.module.sensor.Projectiles projectiles)
           
 
Method Summary
protected  WeaponPref getDefaultWeaponPref()
           
protected  boolean isSafeToShoot(cz.cuni.amis.pogamut.base3d.worldview.object.ILocated target, WeaponPref weaponPref)
          Don't shoot unless we are far away enough to avoid damaging ourselves, or healthy enough to survive the damage, or not using the secondary mode.
protected  void shoot()
          The actual shooting.
protected  boolean shootCombo(cz.cuni.amis.pogamut.base3d.worldview.object.ILocated target)
           
protected  void shootPlayer(boolean safeToSHoot, boolean canDeflect, boolean facing)
          Shoot without getting splash damage, without our projectiles being deflected and while looking in the right direction.
protected  void shootShieldedPlayer(boolean safeToSHoot, boolean facing)
           
protected  void shootTarget(boolean safeToSHoot, boolean facing)
          Shoot without getting splash damage and while looking in the right direction.
 
Methods inherited from class nl.tudelft.pogamut.unreal.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

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

SHOCK_RIFLE_PRIMARY

protected static final WeaponPref SHOCK_RIFLE_PRIMARY
Primary mode preference.


SHOCK_RIFLE_SECONDARY

protected static final WeaponPref SHOCK_RIFLE_SECONDARY
Secondary mode preference.


SHOCK_RIFLE_COMBO_RADIUS

protected static final double SHOCK_RIFLE_COMBO_RADIUS
Radius of the shock combo blast. Experimentally determined.

See Also:
Constant Field Values

SHOCK_RIFLE_PROJECTILE_SPLASH_RADIUS

protected static final double SHOCK_RIFLE_PROJECTILE_SPLASH_RADIUS
Radius of the shock orb splash damage. Experimentally determined.

See Also:
Constant Field Values

SHOCK_RIFLE_PROJECTILE_DAMAGE

protected static final int SHOCK_RIFLE_PROJECTILE_DAMAGE
Damage to self when hit by projectile. Experimentally determined.

See Also:
Constant Field Values

SHOCK_RIFLE_MIN_DISTANCE_COMBO

protected static final int SHOCK_RIFLE_MIN_DISTANCE_COMBO
Minimum distance in UT units the orb will travel before reload. Experimentally determined.

See Also:
Constant Field Values

projectiles

protected nl.tudelft.pogamut.unreal.agent.module.sensor.Projectiles projectiles

lastLocation

protected cz.cuni.amis.pogamut.base3d.worldview.object.Location lastLocation
Last known location of our target. Used to detonate shock combos on targets that have hidden. They might still be close.

Constructor Detail

ShockRifleShooting

public ShockRifleShooting(UT2004Bot<?,?,?> bot,
                          AgentInfo info,
                          ImprovedShooting shoot,
                          Weaponry weaponry,
                          nl.tudelft.pogamut.unreal.agent.module.sensor.Projectiles projectiles)
Method Detail

shoot

protected void shoot()
The actual shooting.

Specified by:
shoot in class nl.tudelft.pogamut.unreal.agent.module.shooting.AbstractWeaponShooting

shootPlayer

protected void shootPlayer(boolean safeToSHoot,
                           boolean canDeflect,
                           boolean facing)
Shoot without getting splash damage, without our projectiles being deflected and while looking in the right direction.

Parameters:
safeToSHoot -
canDeflect -
facing -

shootShieldedPlayer

protected void shootShieldedPlayer(boolean safeToSHoot,
                                   boolean facing)

shootTarget

protected void shootTarget(boolean safeToSHoot,
                           boolean facing)
Shoot without getting splash damage and while looking in the right direction.

Parameters:
safeToSHoot -
facing -

isSafeToShoot

protected boolean isSafeToShoot(cz.cuni.amis.pogamut.base3d.worldview.object.ILocated target,
                                WeaponPref weaponPref)
Don't shoot unless we are far away enough to avoid damaging ourselves, or healthy enough to survive the damage, or not using the secondary mode.

Parameters:
target - to shoot
Returns:
true iff we won't kill ourselves.

shootCombo

protected boolean shootCombo(cz.cuni.amis.pogamut.base3d.worldview.object.ILocated target)

getDefaultWeaponPref

protected WeaponPref getDefaultWeaponPref()
Specified by:
getDefaultWeaponPref in class nl.tudelft.pogamut.unreal.agent.module.shooting.AbstractWeaponShooting


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