Skip to content

Commit

Permalink
- mini fixes nuclear;
Browse files Browse the repository at this point in the history
- go to facility switches fix
  • Loading branch information
dmitry committed Dec 17, 2017
1 parent 03cc949 commit 0a3c596
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
Binary file added 34.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion core/src/MyStrategy.java
Original file line number Diff line number Diff line change
Expand Up @@ -1089,7 +1089,7 @@ private void switchGoToFacility(VehicleGroupInfo myGroup) {
if (distanceTo == 0) {
distanceTo = 1;
}
if (myAp.getDistanceTo(otherF) / distanceTo < 0.78 && distanceTo > 64) {
if (myAp.getDistanceTo(otherF) / distanceTo < 0.78 && distanceTo > 64 && distanceTo < myAp.getDistanceTo(myF) - 32) {
myGroup.goToFacility = other.goToFacility;
other.goToFacility = null; //TODO mb do not reset
}
Expand Down
2 changes: 1 addition & 1 deletion core/src/NuclearStrike.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private void calcPredicted(VehicleWrapper myVehicle, VehicleWrapper target, MySt

long myId = myStrategy.me.getId();

if (myVehicle.v.getDurability() < 50) {
if (myVehicle.v.getDurability() < Math.min(50, myStrategy.um.maxMyHp * 0.8f)) {
predictedDmg = 0;
return;
}
Expand Down
3 changes: 3 additions & 0 deletions core/src/UnitManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class UnitManager {
TickStats enemyStats;
private List<VehicleWrapper> cachedMy;
private List<VehicleWrapper> cachedEnemy;
public int maxMyHp;


public UnitManager(MyStrategy mys) {
Expand All @@ -41,6 +42,8 @@ public void initializeTick() {
initTickFacUpdates();


maxMyHp = streamVehicles(Ownership.ALLY).max(Comparator.comparingInt(value -> value.v.getDurability())).map(vehicleWrapper -> vehicleWrapper.v.getDurability()).orElse(50);

if (myStats.isNonEmpty()) {
mys.log("My stats: " + myStats);
}
Expand Down
1 change: 1 addition & 0 deletions lr/local-runner-sync.default.properties
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ fog-of-war-quality=1
#seed=541562105365045
#seed=560101143593578
#seed=562820576579634
#seed=610343767212111
seed=

# Путь к каталогу с плагинами или пустая строка для работы без плагинов.
Expand Down

0 comments on commit 0a3c596

Please sign in to comment.