File | Line |
---|
nl/tudelft/pogamut/ut3/agent/module/shooting/weapon/RedeemerShooting.java | 30 |
nl/tudelft/pogamut/ut3/agent/module/shooting/weapon/SniperRifleShooting.java | 35 |
public SniperRifleShooting(UT2004Bot<?, ?, ?> agent, AgentInfo info, ImprovedShooting shoot, Weaponry weaponry) {
super(agent, info, shoot, weaponry);
}
@Override
protected void shoot() {
// Wrong weapon, wait up.
if (!isWeaponReady()) {
return;
}
// No target, no shoot.
if (!hasTarget()) {
shoot.stopShooting();
return;
}
if (!(target instanceof Player)) {
shoot.shoot(target);
return;
}
Player player = (Player) target;
// Target not visible, hold fire.
if (!player.isVisible() || !FacingUtil.isFacing2D(info, target, FACING_ANGLE)) {
shoot.stopShooting();
} else {
shoot.shoot(target);
}
}
@Override
protected WeaponPref getDefaultWeaponPref() {
return DEFAULT_WEAPON_PREF;
}
} |
File | Line |
---|
nl/tudelft/pogamut/ut3/agent/module/shooting/weapon/EnforcerShooting.java | 16 |
nl/tudelft/pogamut/ut3/agent/module/shooting/weapon/StingerMinigunShooting.java | 17 |
public StingerMinigunShooting(UT2004Bot<?, ?, ?> agent, AgentInfo info, ImprovedShooting shoot, Weaponry weaponry) {
super(agent, info, shoot, weaponry);
}
@Override
protected void shoot() {
// Wrong weapon, wait up.
if (!isWeaponReady()) {
return;
}
// No target, no shoot.
if (!hasTarget()) {
shoot.stopShooting();
return;
}
if (!(target instanceof Player)) {
shoot.shoot(target);
return;
}
Player player = (Player) target;
// Target not visible, hold fire.
// Keep firing even if not facing, gives time to spin up minigun.
if (!player.isVisible()) {
shoot.stopShooting();
} else {
shoot.shoot(weaponPref, target);
}
}
@Override
protected WeaponPref getDefaultWeaponPref() {
return STINGER_MINIGUN_PRIMARY; |
File | Line |
---|
nl/tudelft/pogamut/ut3/agent/module/shooting/weapon/FlakCannonShooting.java | 38 |
nl/tudelft/pogamut/ut3/agent/module/shooting/weapon/RocketLauncherShooting.java | 46 |
public RocketLauncherShooting(UT2004Bot<?, ?, ?> agent, AgentInfo info, ImprovedShooting shoot, Weaponry weaponry) {
super(agent, info, shoot, weaponry);
}
@Override
protected void shoot() {
// Wrong weapon, wait up.
if (!isWeaponReady()) {
return;
}
// No target, no shoot.
if (!hasTarget()) {
shoot.stopShooting();
return;
}
boolean facing = FacingUtil.isFacing2D(info, target, FACING_ANGLE);
boolean safeToShoot = isSafeToShoot(target);
if (!(target instanceof Player)) {
shootLocation(facing, safeToShoot);
return;
}
Player player = (Player) target;
// Target hidden, flush target out.
if (!player.isVisible() && info.isSecondaryShooting()) { |