public function canBuildBuilding(Dolumar_Players_Village $village) { // Only one portal allowed if ($village->buildings->hasBuilding($this)) { return false; } if (!defined('ALLOW_CLANPORTALS')) { return false; } if (count($village->getOwner()->getClans()) > 0) { return $this->buildRequirementCheck($village); } return false; }
public function canBuildBuilding(Dolumar_Players_Village $village) { $tc = $village->buildings->getTownCenter(); $villages = count($village->getOwner()->getVillages()); if (!$tc) { return false; } $level = $tc->getLevel(); $max = 1; if ($level >= 10) { $max++; } if ($level >= 15) { $max++; } if ($level >= 18) { $max++; } if ($level >= 20) { $max += $level - 19; } return $villages < $max; }