Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/Foundation.js
Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Lines | |||||
Foundation.prototype.GetBuildTime = function() | Foundation.prototype.GetBuildTime = function() | ||||
{ | { | ||||
let timeLeft = (1 - this.GetBuildProgress()) * Engine.QueryInterface(this.entity, IID_Cost).GetBuildTime(); | let timeLeft = (1 - this.GetBuildProgress()) * Engine.QueryInterface(this.entity, IID_Cost).GetBuildTime(); | ||||
let rate = this.totalBuilderRate * this.buildMultiplier; | let rate = this.totalBuilderRate * this.buildMultiplier; | ||||
// The rate if we add another woman to the foundation. | // The rate if we add another woman to the foundation. | ||||
let rateNew = (this.totalBuilderRate + 1) * this.CalculateBuildMultiplier(this.GetNumBuilders() + 1); | let rateNew = (this.totalBuilderRate + 1) * this.CalculateBuildMultiplier(this.GetNumBuilders() + 1); | ||||
return { | return { | ||||
"timeRemaining": timeLeft / rate, | "timeRemaining": timeLeft / rate, | ||||
"timeSpeedup": timeLeft / rate - timeLeft / rateNew | "timeRemainingNew": timeLeft / rateNew | ||||
}; | }; | ||||
}; | }; | ||||
/** | /** | ||||
* Perform some number of seconds of construction work. | * Perform some number of seconds of construction work. | ||||
* Returns true if the construction is completed. | * Returns true if the construction is completed. | ||||
*/ | */ | ||||
Foundation.prototype.Build = function(builderEnt, work) | Foundation.prototype.Build = function(builderEnt, work) | ||||
▲ Show 20 Lines • Show All 246 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator