Skip to content

Commit

Permalink
- fix nuclear; 32
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry committed Dec 15, 2017
1 parent a574631 commit 12ff487
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
Binary file added 32.jar
Binary file not shown.
8 changes: 5 additions & 3 deletions core/src/MyStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ public final class MyStrategy implements Strategy {
public static final int WORLD_CELL_SIZE = 32;
public static final double GROUP_SIZE = 50;
public static final double GROUP_HALF_SIZE = GROUP_SIZE / 2;
public static final int MIN_NUCLEAR_DMG = 520;
public static final List<VehicleType> FIGHTER_PREF_TARGETS = Arrays.asList(HELICOPTER, FIGHTER);
public static final List<VehicleType> HELI_PREF_TARGETS = Arrays.asList(TANK, ARRV, HELICOPTER, IFV, FIGHTER);
public static final double SHOULD_HEAL_TRESHOLD = 0.64;
Expand Down Expand Up @@ -791,7 +790,6 @@ private PlainArray calcMap(VehicleGroupInfo group) { //TODO improve logic at fin
});



cornerPushersFiltered.keySet().removeIf(corner -> {
int distanceThreshold = 13 * 13;
for (Point2D facPoint : getUnitsCount(true).get(ARRV).keySet()) {
Expand Down Expand Up @@ -1389,7 +1387,7 @@ private boolean tryPickNuclearTarget() {
if (me.getRemainingNuclearStrikeCooldownTicks() == 0 && scheduledStrike == null) {
int remainingHp = um.enemyStats.remainingHp;

int minNuclearDmg = world.getTickIndex() > 8_000 ? (int) Math.min(MyStrategy.MIN_NUCLEAR_DMG, remainingHp * 0.6) : MyStrategy.MIN_NUCLEAR_DMG;
int minNuclearDmg = world.getTickIndex() > 8_000 ? (int) Math.min(getMinNuclearDmg(), remainingHp * 0.6) : getMinNuclearDmg();

NuclearStrike max = NuclearStrike.getMaxDmg(this, minNuclearDmg);

Expand Down Expand Up @@ -1450,6 +1448,10 @@ private boolean tryPickNuclearTarget() {
return false;
}

public int getMinNuclearDmg() {
return world.getTickIndex() > 6000 ? 3000 : 3700;
}

private double getSmartDistance(VehicleGroupInfo g1, VehicleGroupInfo g2) {
if (g2 == null) {
return 2000;
Expand Down
4 changes: 2 additions & 2 deletions core/src/NuclearStrike.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import java.util.Comparator;

public class NuclearStrike {
public static final int PREDICTION_TICK = 33 / 3;
public static final int PREDICTION_TICK = 0;
public static final int KILL_BONUS = 45;
public final VehicleWrapper myVehicle;
public final VehicleWrapper target;
Expand Down Expand Up @@ -114,7 +114,7 @@ public void finish() {

myVehicleDidSurvive = myVehicle.v.getDurability() > 0;

if (enemyStats.damagedPoints < -MyStrategy.MIN_NUCLEAR_DMG) {
if (enemyStats.damagedPoints < -myStrategy.getMinNuclearDmg()) {
succeed = true;
}
myStrategy.didNuclearStrikes.add(this);
Expand Down
2 changes: 1 addition & 1 deletion lr/local-runner-sync.default.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Отрисовка игры на экран: true или false.
render-to-screen=false
render-to-screen=true

# Синхронизация обсчёта игры и её отрисовки на экран: true или false.
# Не используется, если настройка render-to-screen=false.
Expand Down

0 comments on commit 12ff487

Please sign in to comment.