public function BuildTime(Colony $colony, Cost $buildCosts) { // Calculate time required global $NN_config; $metalCost =& $buildCosts->Metal(); $crystalCost =& $buildCosts->Crystal(); $gameSpeed =& $NN_config["game_speed"]; $robotFactories = $colony->Buildings()->GetMemberByName("robotics_factory")->Amount(); $nanoFactories = $colony->Buildings()->GetMemberByName("nano_factory")->Amount(); $manufacturers = $colony->Owner()->Officers()->GetMemberByName("manufacturer")->Amount(); $timeRequired = ($metalCost + $crystalCost) / $gameSpeed * (1 / ($robotFactories + 1)) * pow(0.5, $nanoFactories); $timeRequired = floor($timeRequired * 3600 * (1 - $manufacturers * 0.1)); return $timeRequired; }
public function BuildTime(Colony $colony) { // Calculate time required global $NN_config; $metalCost = $this->Cost()->Metal(); $crystalCost = $this->Cost()->Crystal(); $gameSpeed =& $NN_config["game_speed"]; $shipyards = $colony->Buildings()->GetMemberByName("shipyard")->Amount(); $nanoFactories = $colony->Buildings()->GetMemberByName("nano_factory")->Amount(); $defenders = $colony->Owner()->Officers()->GetMemberByName("defender")->Amount(); $timeRequired = ($metalCost + $crystalCost) / $gameSpeed * (1 / ($shipyards + 1)) * pow(0.5, $nanoFactories); $timeRequired = floor($timeRequired * 3600 * (1 - $defenders * 0.375)); return $timeRequired; }
public function BuildCost(Colony $c, $buildLevel = NULL) { if ($buildLevel == NULL) { $buildLevel = $this->GetScheduledLevelsInDatabase() + $c->Buildings()->GetMemberByName($this->Name())->Amount(); } $metalCost = floor($this->Cost()->Metal() * pow($this->NextcostModifier(), $buildLevel)); $crystalCost = floor($this->Cost()->Crystal() * pow($this->NextcostModifier(), $buildLevel)); $deuteriumCost = floor($this->Cost()->Deuterium() * pow($this->NextcostModifier(), $buildLevel)); $energyCost = floor($this->Cost()->Energy() * pow($this->NextcostModifier(), $buildLevel)); return new Cost($metalCost, $crystalCost, $deuteriumCost, $energyCost); }