From 94a3dd52da3ae180af37c6fd0e8c24b3562da388 Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Wed, 4 Oct 2023 11:32:04 +0200 Subject: initial commit 2 --- src/Model/Building.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/Model/Building.php') diff --git a/src/Model/Building.php b/src/Model/Building.php index eb166f9..78d1aa5 100644 --- a/src/Model/Building.php +++ b/src/Model/Building.php @@ -69,7 +69,7 @@ class Building */ public function getResourceRequirements(): array { - return $this->getResourceRequirementsForLevel($this->level); + return $this->getResourceRequirementsForLevel($this->level + 1); } /** @@ -77,10 +77,8 @@ class Building */ public function getResourceRequirementsForLevel(int $level): array { - $level += 1; - return array_map( - fn ($resourceRequirement) => ceil(log($level * 2) * $resourceRequirement * 64 * $level), + fn ($resourceRequirement) => ceil(log($level * 2) * $resourceRequirement * $_ENV['BASE_BUILDING_RESOURCE_REQUIREMENT_FACTOR'] * $level), $this->resourceRequirements ); } -- cgit v1.2.3