1
0
forked from 0ad/0ad

Remove training speedup hack. Add time discount for batches.

This was SVN commit r7928.
This commit is contained in:
Ykkrosh 2010-08-13 13:14:59 +00:00
parent 2e4be5f781
commit a2b2acb522

View File

@ -58,9 +58,12 @@ TrainingQueue.prototype.AddBatch = function(player, templateName, count)
if (!template)
return;
var timeMult = count; // TODO: we want some kind of discount for larger batches
var costMult = count;
// Apply a time discount to larger batches.
// TODO: work out what equation we should use here.
var timeMult = Math.pow(count, 0.7);
var time = timeMult * (template.Cost.BuildTime || 1);
var costs = {};
for each (var r in ["food", "wood", "stone", "metal"])
@ -203,8 +206,6 @@ TrainingQueue.prototype.ProgressTimeout = function(data)
// with items that take fractions of a second)
var time = g_ProgressInterval;
time *= 10; // XXX: this is a hack to make testing easier
while (time > 0 && this.queue.length)
{
var item = this.queue[0];