From f5a3bf8ab0146e700893465528bb128927b7875f Mon Sep 17 00:00:00 2001 From: AL-Kateb Date: Wed, 3 Jan 2018 20:53:40 +0000 Subject: [PATCH] Fixed bakery wrng calculation Issue #408 --- .gitignore | 3 +++ GameEngine/Village.php | 5 ++++- Templates/text.tpl | 31 +------------------------------ 3 files changed, 8 insertions(+), 31 deletions(-) diff --git a/.gitignore b/.gitignore index 09f43e87..b9944138 100644 --- a/.gitignore +++ b/.gitignore @@ -18,6 +18,9 @@ GameEngine/config.php GameEngine/Prevention/* GameEngine/Notes/* +# Ignore Templates/text.tpl because it is dynamically generated +Templates/text.tpl + # Install instalation_done marker left by install script /.buildpath /.project diff --git a/GameEngine/Village.php b/GameEngine/Village.php index c200c133..35a95424 100755 --- a/GameEngine/Village.php +++ b/GameEngine/Village.php @@ -262,10 +262,13 @@ private function getCropProd() { for ( $i = 0; $i <= count( $cropholder ) - 1; $i ++ ) { $basecrop += $bid4[ $this->resarray[ $cropholder[ $i ] ] ]['prod']; } + $bonus = 0.25 * $this->ocounter[3]; $crop = $basecrop + $basecrop * 0.25 * $this->ocounter[3]; + if($grainmill >= 1 || $bakery >= 1) { - $crop += $basecrop /100 * (isset($bid8[$grainmill]['attri']) ? $bid8[$grainmill]['attri'] : 0) + (isset($bid9[$bakery]['attri']) ? $bid9[$bakery]['attri'] : 0); + $crop += $basecrop /100 * ((isset($bid8[$grainmill]['attri']) ? $bid8[$grainmill]['attri'] : 0) + (isset($bid9[$bakery]['attri']) ? $bid9[$bakery]['attri'] : 0)); } + if($session->bonus4 == 1) { $crop *= 1.25; } diff --git a/Templates/text.tpl b/Templates/text.tpl index 7fcae382..99e7fcc9 100644 --- a/Templates/text.tpl +++ b/Templates/text.tpl @@ -10,36 +10,7 @@ ################################################################################# -$txt="Construction plans - - - -Countless days have passed since the first battles upon the walls of the cursed villages of the Dread Natars, many armies of both the free ones and the Natarian empire struggled and died before the walls of the many strongholds from which the Natars had once ruled all creation. Now with the dust settled and a relative calm having settled in, armies began to count their losses and collect their dead, the stench of combat still lingering in the night air, a smell of a slaughter unforgettable in its extent and brutality yet soon to be dwarfed by yet others. The largest armies of the free ones and the Dread Natars were marshalling for yet another renewed assault upon the coveted former strongholds of the Natarian Empire. - -Soon scouts arrived telling of a most awesome sight and a chilling reminder, a dread army of an unfathomable size had been spotted marshalling at the end of the world, the Natarian capital, a force so great and unstoppable that the dust from their march would choke off all light, a force so brutal and ruthless that it would crush all hope. The free people knew that they had to race now, race against time and the endless hordes of the Natarian Empire to raise a Wonder of the World to restore the world to peace and vanquish the Natarian threat. - -But to raise such a great Wonder would be no easy task, one would need construction plans created in the distant past, plans of such an arcane nature that even the very wisest of sages knew not their contents or locations. - -Tens of thousands of scouts roamed across all existence searching in vain for these mystical plans, looking in all places but the dreaded Natarian Capital, yet could not find them. Today however, they return bearing good news, they return baring the locations of the plans, hidden by the armies of the Natars inside secret strongholds constructed to be hidden from the eyes of man. - -Now begins the final stretch, when the greatest armies of the Free people and the Natars will clash across the world for the fate of all that lies under heaven. This is the war that will echo across the eons, this is your war, and here you shall etch your name across history, here you shall become legend. - - -Facts: -To steal one, the following things must happen: -You must attack the village (NO Raid!) -WIN the Attack -Destroy the treasury -An empty treasury lvl 10 MUST be in the village where that attack came from -Have a hero in an attack - -If not, the next attack on that village, winning with a hero and empty treasury will take the building plan. - -To build a WW, you must own a plan yourself (you = the WW village owner) from lvl 0 to 50, from 51 to 100 you need an additional plan in your alliance! Two plans in the WW village account would not work! - -The construction plans are conquerable immediately when they appear to the server. - -There will be a countdown in game, showing the exact time of the release, 5 days prior to the launch. "; +$txt="Test"; //bbcode = html code $txt = preg_replace("/\[b\]/is",'', $txt);