Differential D1011 Diff 9901 ps/trunk/binaries/data/mods/public/simulation/components/ResourceGatherer.js
Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/ResourceGatherer.js
Show First 20 Lines • Show All 95 Lines • ▼ Show 20 Lines | if (this.lastCarriedType && this.lastCarriedType.generic in this.carrying) | ||||
return this.lastCarriedType; | return this.lastCarriedType; | ||||
return undefined; | return undefined; | ||||
}; | }; | ||||
// Since this code is very performancecritical and applying technologies quite slow, cache it. | // Since this code is very performancecritical and applying technologies quite slow, cache it. | ||||
ResourceGatherer.prototype.RecalculateGatherRatesAndCapacities = function() | ResourceGatherer.prototype.RecalculateGatherRatesAndCapacities = function() | ||||
{ | { | ||||
let cmpPlayer = QueryOwnerInterface(this.entity, IID_Player); | this.baseSpeed = ApplyValueModificationsToEntity("ResourceGatherer/BaseSpeed", +this.template.BaseSpeed, this.entity); | ||||
let multiplier = cmpPlayer ? cmpPlayer.GetGatherRateMultiplier() : 1; | |||||
this.baseSpeed = multiplier * ApplyValueModificationsToEntity("ResourceGatherer/BaseSpeed", +this.template.BaseSpeed, this.entity); | |||||
this.rates = {}; | this.rates = {}; | ||||
for (let r in this.template.Rates) | for (let r in this.template.Rates) | ||||
{ | { | ||||
let type = r.split("."); | let type = r.split("."); | ||||
if (type[0] != "treasure" && type.length > 1 && !Resources.GetResource(type[0]).subtypes[type[1]]) | if (type[0] != "treasure" && type.length > 1 && !Resources.GetResource(type[0]).subtypes[type[1]]) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 238 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator