Skip to content

Commit 2ae8d55

Browse files
authored
Merge pull request dsjoerg#27 from nickelsen/fix-completion-times
Display base completion and saturation times on LotV time-scale.
2 parents 2174566 + ba79405 commit 2ae8d55

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

app/assets/javascripts/angular/resources/match.js

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -103,20 +103,20 @@ Entity.prototype.race_macro_pretty = function() {
103103

104104
Entity.prototype.mdelta2 = function() {
105105
if (this.stats == null ||
106-
this.stats.mineral_saturation_2 == null ||
107-
this.stats.miningbase_2 == null) {
106+
this.stats.mineral_saturation_2_adjusted == null ||
107+
this.stats.miningbase_2_adjusted == null) {
108108
return null;
109109
}
110-
return Math.max(0, this.stats.mineral_saturation_2 - this.stats.miningbase_2);
110+
return Math.max(0, this.stats.mineral_saturation_2_adjusted - this.stats.miningbase_2_adjusted);
111111
}
112112

113113
Entity.prototype.mdelta3 = function() {
114114
if (this.stats == null ||
115-
this.stats.mineral_saturation_3 == null ||
116-
this.stats.miningbase_3 == null) {
115+
this.stats.mineral_saturation_3_adjusted == null ||
116+
this.stats.miningbase_3_adjusted == null) {
117117
return null;
118118
}
119-
return Math.max(0, this.stats.mineral_saturation_3 - this.stats.miningbase_3);
119+
return Math.max(0, this.stats.mineral_saturation_3_adjusted - this.stats.miningbase_3_adjusted);
120120
}
121121

122122
Entity.prototype.color_style = function() {
@@ -640,6 +640,22 @@ gg.factory('Match', ['$ggResource', '$compile', 'Matchnote', function($ggResourc
640640
}
641641

642642
entity.summary.resource_collection_rate_adjusted = Math.round(entity.summary.resource_collection_rate*speed_multiplier)
643+
if (entity.stats.mineral_saturation_1 != null) {
644+
entity.stats.mineral_saturation_1_adjusted = Math.round(entity.stats.mineral_saturation_1/speed_multiplier)
645+
}
646+
if (entity.stats.mineral_saturation_2 != null) {
647+
entity.stats.mineral_saturation_2_adjusted = Math.round(entity.stats.mineral_saturation_2/speed_multiplier)
648+
}
649+
if (entity.stats.mineral_saturation_3 != null) {
650+
entity.stats.mineral_saturation_3_adjusted = Math.round(entity.stats.mineral_saturation_3/speed_multiplier)
651+
}
652+
653+
if (entity.stats.miningbase_2 != null) {
654+
entity.stats.miningbase_2_adjusted = Math.round(entity.stats.miningbase_2/speed_multiplier)
655+
}
656+
if (entity.stats.miningbase_3 != null) {
657+
entity.stats.miningbase_3_adjusted = Math.round(entity.stats.miningbase_3/speed_multiplier)
658+
}
643659
}
644660

645661
if(this.MineralsCurrent && this.MineralsCurrent[entity.identity.id]) {

app/views/matches/show.html.erb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,12 @@
164164
<a href class="ggtipper2" title="When a second base is completed, and located directly next to the mineral patches." data-gravity="s">
165165
2nd Mining Base Complete
166166
</a>
167-
</td><td ng-repeat="entity in match.entities">{{ entity.stats.miningbase_2 | minutes_seconds }}</td></tr>
167+
</td><td ng-repeat="entity in match.entities">{{ entity.stats.miningbase_2_adjusted | minutes_seconds }}</td></tr>
168168
<tr><td>
169169
<a href class="ggtipper2" title="When a third base is completed, and located directly next to the mineral patches." data-gravity="s">
170170
3rd Mining Base Complete
171171
</a>
172-
</td><td ng-repeat="entity in match.entities">{{ entity.stats.miningbase_3 | minutes_seconds}}</td></tr>
172+
</td><td ng-repeat="entity in match.entities">{{ entity.stats.miningbase_3_adjusted | minutes_seconds}}</td></tr>
173173
<tr><th>Saturation Speed</a></th>
174174
<th ng-repeat="entity in match.doubleents" ng-show="$index % 2 == 0 || user.view_mode == 1">
175175
<span ng-show="$index % 2 == 0">{{ entity.identity.name }}</span>
@@ -181,7 +181,7 @@
181181
1 Base Mineral Income (870)</a>
182182
</td>
183183
<td ng-repeat="entity in match.doubleents" ng-show="$index % 2 == 0 || user.view_mode == 1">
184-
<span ng-show="$index % 2 == 0">{{ entity.stats.mineral_saturation_1 | minutes_seconds }}</span>
184+
<span ng-show="$index % 2 == 0">{{ entity.stats.mineral_saturation_1_adjusted | minutes_seconds }}</span>
185185
<span ng-show="$index % 2 == 1" ><league data-league="{{ entity.sat_1_skill }}"></league></span>
186186
</td></tr>
187187
<tr><td>

0 commit comments

Comments
 (0)