@@ -35,8 +35,9 @@ public double evaluate(Collection<Agent> agentsA, Collection<Agent> agentsB) {
35
35
agentsB .forEach (a -> a .onDeathHandler .accept (a , finalAgentsB ));
36
36
finalAgentsA .addAll (agentsA );
37
37
finalAgentsB .addAll (agentsB );
38
- int damageToA = new DamageBoard (finalAgentsB ).sumDamageTo (finalAgentsA );
39
- int damageToB = new DamageBoard (finalAgentsA ).sumDamageTo (finalAgentsB );
38
+ double damageToA = new DamageBoard (finalAgentsB ).sumDamageTo (finalAgentsA );
39
+ double damageToB = new DamageBoard (finalAgentsA ).sumDamageTo (finalAgentsB );
40
+
40
41
int regenToA = regeneration (finalAgentsA );
41
42
int regenToB = regeneration (finalAgentsB );
42
43
damageToA -= regenToA ;
@@ -48,14 +49,12 @@ public double evaluate(Collection<Agent> agentsA, Collection<Agent> agentsB) {
48
49
damageToB = 0 ;
49
50
}
50
51
double evalA =
51
- (double ) damageToA
52
- / (finalAgentsA .stream ()
52
+ damageToA / (finalAgentsA .stream ()
53
53
.mapToDouble (a -> a .getHealth () + a .getShields () * parameters .shieldScale )
54
54
.sum ()
55
55
+ EPS );
56
56
double evalB =
57
- (double ) damageToB
58
- / (finalAgentsB .stream ()
57
+ damageToB / (finalAgentsB .stream ()
59
58
.mapToDouble (a -> a .getHealth () + a .getShields () * parameters .shieldScale )
60
59
.sum ()
61
60
+ EPS );
@@ -74,12 +73,6 @@ private int regeneration(Collection<Agent> agents) {
74
73
.mapToInt (
75
74
a -> {
76
75
int healed = 0 ;
77
- if (a .regeneratesHealth ) {
78
- healed = parameters .healthRegen ;
79
- }
80
- if (a .maxShieldsShifted > 0 ) {
81
- healed += parameters .shieldRegen ;
82
- }
83
76
if (a .isHealer ) {
84
77
healed += healables * parameters .heal ;
85
78
}
@@ -126,12 +119,12 @@ private void sumGroundDamage(Agent agent) {
126
119
}
127
120
128
121
private void sumAirDamage (Agent agent ) {
129
- Weapon weapon = agent .groundWeapon ;
122
+ Weapon weapon = agent .airWeapon ;
130
123
double damageToApply = calculateDamage (agent , weapon );
131
- if (agent . airWeapon .damageType == DamageType .CONCUSSIVE ) {
124
+ if (weapon .damageType == DamageType .CONCUSSIVE ) {
132
125
airConcussiveDamage += (int ) damageToApply ;
133
126
airConcussiveHits += weapon .hits ;
134
- } else if (agent . airWeapon .damageType == DamageType .EXPLOSIVE ) {
127
+ } else if (weapon .damageType == DamageType .EXPLOSIVE ) {
135
128
airExplosiveDamage += (int ) damageToApply ;
136
129
airExplosiveHits += weapon .hits ;
137
130
} else {
@@ -141,23 +134,19 @@ private void sumAirDamage(Agent agent) {
141
134
}
142
135
143
136
private double calculateDamage (Agent attacker , Weapon weapon ) {
144
- double rangeFactor = 1.0 + weapon .maxRange * parameters .rangeScale ;
145
- double speedFactor = 1.0 + attacker .speed * parameters .speedScale ;
146
- double radialSplashFactor = weapon .splashType == SplashType .RADIAL_ENEMY_SPLASH || weapon .splashType == SplashType .RADIAL_SPLASH ? 1.0 + parameters .radialSplashFactor * weapon .innerSplashRadius : 1 .0 ;
147
- double lineSplashFactor = weapon .splashType == SplashType .LINE_SPLASH ? 1.0 + parameters .lineSplashFactor * weapon .innerSplashRadius : 1 .0 ;
148
- double bounceSplashFactor = weapon .splashType == SplashType .BOUNCE ? parameters .bounceSplashFactor : 1 .0 ;
137
+ double rangeFactor = weapon .maxRange * parameters .rangeScale ;
138
+ double speedFactor = attacker . burrowedAttacker ? 0.0 : attacker .speed * parameters .speedScale ;
139
+ double radialSplashFactor = weapon .splashType == SplashType .RADIAL_ENEMY_SPLASH || weapon .splashType == SplashType .RADIAL_SPLASH ? parameters .radialSplashScale * weapon .innerSplashRadius : 0 .0 ;
140
+ double lineSplashFactor = weapon .splashType == SplashType .LINE_SPLASH ? parameters .lineSplashScale * weapon .innerSplashRadius : 0 .0 ;
141
+ double bounceSplashFactor = weapon .splashType == SplashType .BOUNCE ? parameters .bounceSplashFactor : 0 .0 ;
149
142
150
143
return weapon .damageShifted
151
- * rangeFactor
152
- * speedFactor
153
- * radialSplashFactor
154
- * lineSplashFactor
155
- * bounceSplashFactor
144
+ * (1.0 + rangeFactor + speedFactor + radialSplashFactor + lineSplashFactor + bounceSplashFactor )
156
145
/ attacker .maxCooldown ;
157
146
}
158
147
159
- int sumDamageTo (Collection <Agent > targets ) {
160
- int damageSum = 0 ;
148
+ double sumDamageTo (Collection <Agent > targets ) {
149
+ double damageSum = 0 ;
161
150
for (Agent target : targets ) {
162
151
if (!target .detected ) {
163
152
continue ;
@@ -219,27 +208,23 @@ public static class Parameters {
219
208
final double shieldScale ;
220
209
final double speedScale ;
221
210
final double rangeScale ;
222
- final double radialSplashFactor ;
223
- final double lineSplashFactor ;
211
+ final double radialSplashScale ;
212
+ final double lineSplashScale ;
224
213
final double bounceSplashFactor ;
225
- final int heal ;
226
- final int healthRegen ;
227
- final int shieldRegen ;
214
+ final double heal ;
228
215
229
216
public Parameters (double [] source ) {
230
217
shieldScale = source [0 ];
231
218
speedScale = source [1 ];
232
219
rangeScale = source [2 ];
233
- radialSplashFactor = source [3 ];
234
- lineSplashFactor = source [4 ];
220
+ radialSplashScale = source [3 ];
221
+ lineSplashScale = source [4 ];
235
222
bounceSplashFactor = source [5 ];
236
- heal = (int ) source [6 ];
237
- healthRegen = (int ) source [7 ];
238
- shieldRegen = (int ) source [8 ];
223
+ heal = source [6 ] * 500000 ;
239
224
}
240
225
241
226
public Parameters () {
242
- this (new double [] { 62.55550402780286 , 455.5108652989783 , 16.644298951231356 , 0.0881036657313995 , 534.3720029493211 , 2.2237277860926357 , 506.53351985609726 , 780.675841755981 , 778.571115050493 });
227
+ this (new double []{ 2.0608350462547205 , 8.19938619214691 , 0.19223277374228906 , 7.706789576045348 , 6.154650149331842 , 5.884458141154542 , 0.8991451082849068 });
243
228
}
244
229
}
245
230
}
0 commit comments