diff --git a/GameEngine/Lang/en.php b/GameEngine/Lang/en.php index b6d2b494..18cd5c36 100755 --- a/GameEngine/Lang/en.php +++ b/GameEngine/Lang/en.php @@ -1299,6 +1299,9 @@ tz_def('STONEMASON_DESC', 'The Stonemason is an expert it cutting stone. The hig tz_def('BREWERY', 'Brewery'); tz_def('CURRENT_BONUS', 'Current bonus:'); +tz_def('WATERWORKS_HINT', '(Boost by Waterworks)'); +tz_def('WATERWORKS_AFFECTED', 'annexed oases benefit from this bonus.'); +tz_def('OASIS_EFFECTIVE_BONUS', 'Effective oasis bonus:'); tz_def('BONUS_LEVEL', 'Bonus at level'); tz_def('BREWERY_DESC', 'Tasty mead is brewed here.Drinks make your soldiers braver and stronger when attacking others (1% per Brewery level). Unfortunately, the persuasive power of leaders is reduced by 50% and catapults can only make random hits. Can only be built in the capital, but affects all your villages. The mead-festivals always last 72 hours.
Tribe-specific: Teutons only'); tz_def('MEAD_FESTIVAL', 'Mead-Festival'); diff --git a/Templates/Build/37_land.tpl b/Templates/Build/37_land.tpl index a0ec3131..2b8e80d7 100644 --- a/Templates/Build/37_land.tpl +++ b/Templates/Build/37_land.tpl @@ -21,6 +21,21 @@ $oasisarray = $database->getOasis($village->wid); + // Waterworks (gid 45, Egipteni): creste bonusul oazelor cu +5% relativ / nivel. + // Determin nivelul din satul curent si factorul efectiv (25% de baza). + global $bid45; + $wwLevel = 0; + $wwFactor = 0.25; + for ($wwi = 19; $wwi <= 40; $wwi++) { + if (isset($village->resarray['f'.$wwi.'t']) && (int)$village->resarray['f'.$wwi.'t'] == 45) { + $wwLevel = max($wwLevel, (int)$village->resarray['f'.$wwi]); + } + } + if ($wwLevel > 0 && isset($bid45[$wwLevel]['attri'])) { + $wwFactor = 0.25 * (1 + $bid45[$wwLevel]['attri']); + } + $wwMultiplier = $wwFactor / 0.25; // 1.0 fara Waterworks, 1.5 la nivel maxim + if (isset($_GET['gid']) && $_GET['gid'] == 37 && isset($_GET['del']) && $database->getOasisField($_GET['del'], 'owner') == $session->uid) { $units->returnTroops($village->wid, 1); $database->removeOases($_GET['del']); @@ -57,7 +72,7 @@ // Replace the original switch with 12 identical cases as the structure. // Unknown types => empty string, just like the lack of a 'default' in the original switch. - $renderOasisBonus = function ($type) use ($oasisResourceIcons, $oasisTypeBonuses) { + $renderOasisBonus = function ($type) use ($oasisResourceIcons, $oasisTypeBonuses, $wwMultiplier, $wwLevel) { if (!isset($oasisTypeBonuses[$type])) { return ''; } @@ -66,7 +81,15 @@ foreach ($oasisTypeBonuses[$type] as $bonus) { [$resource, $percent] = $bonus; $icon = $oasisResourceIcons[$resource]; - $html .= '' . $icon['alt'] . '+' . $percent . '%'; + // procentul efectiv (bonusul fizic al oazei x multiplicatorul Waterworks) + $effective = $percent * $wwMultiplier; + // afisez cifra rotunda daca e intreaga, altfel o zecimala (25 -> 25, 37.5 -> 37.5) + $effStr = ($effective == floor($effective)) ? (string)(int)$effective : rtrim(rtrim(number_format($effective, 1, '.', ''), '0'), '.'); + $html .= '' . $icon['alt'] . '+' . $effStr . '%'; + // cand Waterworks e activ, arat si bonusul de baza barat pentru context + if ($wwLevel > 0 && $effective != $percent) { + $html .= ' (' . $percent . '%)'; + } } return $html; @@ -112,3 +135,13 @@ if (!empty($oasisarray)) { + + 0): ?> +

+ <?php echo WATERWORKS; ?> + — + +% + +

+ + diff --git a/Templates/Build/45.tpl b/Templates/Build/45.tpl index e607989c..64df51c0 100644 --- a/Templates/Build/45.tpl +++ b/Templates/Build/45.tpl @@ -25,6 +25,14 @@ include("next.tpl"); $level = (int)$village->resarray['f'.$id]; $current = $level > 0 ? (int)round($bid45[$level]['attri'] * 100) : 0; + +// numarul de oaze anexate de acest sat (pentru a arata impactul concret) +$wwOasisCount = 0; +$wwOasisList = $database->getOasis($village->wid); +if (!empty($wwOasisList)) $wwOasisCount = count($wwOasisList); +// procentul efectiv al unei oaze standard (25% de baza) +$wwEffective = $level > 0 ? 25 * (1 + $bid45[$level]['attri']) : 25; +$wwEffStr = ($wwEffective == floor($wwEffective)) ? (string)(int)$wwEffective : rtrim(rtrim(number_format($wwEffective, 1, '.', ''), '0'), '.'); ?>