Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/ResourceGatherer.js
Show First 20 Lines • Show All 242 Lines • ▼ Show 20 Lines | ResourceGatherer.prototype.GetTargetGatherRate = function(target) | ||||
let type = cmpResourceSupply.GetType(); | let type = cmpResourceSupply.GetType(); | ||||
let rate = 0; | let rate = 0; | ||||
if (type.specific) | if (type.specific) | ||||
rate = this.GetGatherRate(type.generic+"."+type.specific); | rate = this.GetGatherRate(type.generic+"."+type.specific); | ||||
if (rate == 0 && type.generic) | if (rate == 0 && type.generic) | ||||
rate = this.GetGatherRate(type.generic); | rate = this.GetGatherRate(type.generic); | ||||
// Health dependent rate of the supply if any | |||||
rate *= cmpResourceSupply.GetHealthRate(); | |||||
let cmpPlayer = QueryOwnerInterface(this.entity, IID_Player); | let cmpPlayer = QueryOwnerInterface(this.entity, IID_Player); | ||||
let cheatMultiplier = cmpPlayer ? cmpPlayer.GetCheatTimeMultiplier() : 1; | let cheatMultiplier = cmpPlayer ? cmpPlayer.GetCheatTimeMultiplier() : 1; | ||||
rate = rate / cheatMultiplier; | rate = rate / cheatMultiplier; | ||||
if ("Mirages" in cmpResourceSupply) | if ("Mirages" in cmpResourceSupply) | ||||
return rate; | return rate; | ||||
// Apply diminishing returns with more gatherers, for e.g. infinite farms. For most resources this has no effect | // Apply diminishing returns with more gatherers, for e.g. infinite farms. For most resources this has no effect | ||||
▲ Show 20 Lines • Show All 96 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator