|
import java.util.ArrayList; |
|
|
|
|
|
private double _timeSinceVChange? = 0; |
|
private long _timeSinceVChange? = 0; private long _timeSinceZeroVelocity? = 0; private long _timeSinceMaxVelocity? = 0; |
|
private Wave _lastWave = null; private ArrayList _enemyPositions = new ArrayList(); |
|
// CREDIT: RaikoMicro's gun, by Jamougha // http://robowiki.net?RaikoMicro |
|
// CREDIT: Jamougha and PEZ for event based waves. |
|
_enemyPositions.add(_enemyLocation); double distanceLastEightTicks? = _enemyLocation.distance( ((Point2D.Double)_enemyPositions.get( Math.max(0, _enemyPositions.size() - 9)))); double distanceLastFifteenTicks? = _enemyLocation.distance( ((Point2D.Double)_enemyPositions.get( Math.max(0, _enemyPositions.size() - 16)))); double distanceLastTwentyFiveTicks? = _enemyLocation.distance( ((Point2D.Double)_enemyPositions.get( Math.max(0, _enemyPositions.size() - 26)))); |
|
_timeSinceZeroVelocity?++; _timeSinceMaxVelocity?++; |
|
if (Math.abs(e.getVelocity()) <= 1) { _timeSinceZeroVelocity? = 0; } if (Math.abs(e.getVelocity()) > 7) { _timeSinceMaxVelocity? = 0; } |
|
|
|
double reverseWallDistance = 3; for (double d = 0; d < 3; d += 0.01) { if (!gunWallDistance(-d * maxEscapeAngle?)) { reverseWallDistance = d; break; } } |
|
w.timeSinceVChange? = (long)_timeSinceVChange?; |
|
w.timeSinceVChange? = _timeSinceVChange?; w.timeSinceZeroVelocity? = _timeSinceZeroVelocity?; w.timeSinceMaxVelocity? = _timeSinceMaxVelocity?; |
|
w.reverseWallDistance = reverseWallDistance; |
|
w.distanceLastEightTicks? = distanceLastEightTicks?; w.distanceLastFifteenTicks? = distanceLastFifteenTicks?; w.distanceLastTwentyFiveTicks? = distanceLastTwentyFiveTicks?; w.fireTime = getTime() + 1; |
|
w.firing = true; |
|
if (_lastWave != null) { _lastWave.firing = true; } |
|
_lastWave = w; |
|
output += w.timeSinceZeroVelocity? + " : "; output += w.timeSinceMaxVelocity? + " : "; |
|
output += round(w.relativeHeading, 4) + "\n"; |
|
output += round(w.reverseWallDistance, 3) + " : "; output += round(w.relativeHeading, 4) + " : "; output += round(w.distanceLastEightTicks?, 1) + " : "; output += round(w.distanceLastFifteenTicks?, 1) + " : "; output += round(w.distanceLastTwentyFiveTicks?, 1) + "\n"; |
|
while (x < 1000 && getDataFile?(_enemyName + "." + x + ".txt").exists()) { |
|
while (x < 1000 && getDataFile?(_enemyName + "." + x + ".w2.txt").exists()) { |
|
getDataFile?(_enemyName + "." + x + ".txt")); |
|
getDataFile?(_enemyName + "." + x + ".w2.txt")); |
|
long timeSinceVChange?; |
|
long timeSinceVChange?, timeSinceZeroVelocity?, timeSinceMaxVelocity?, fireTime; |
|
double velocity, distance, latVel, wallDistance, relativeHeading; |
|
double velocity, distance, latVel, wallDistance, reverseWallDistance, relativeHeading; double distanceLastEightTicks?, distanceLastFifteenTicks?, distanceLastTwentyFiveTicks?; |
|
<= (distanceTraveled+=bulletVelocity) + (.5*bulletVelocity)) { |
|
<= (getTime() - fireTime + 1.5) * bulletVelocity) { |