Artifacts fixes part 2

+Artifacts are now activated after a certain amount of time (based on
the official Travian Rules and the server speed) and not immediately
after the conquer
+Artifacts are now activated based on official Travian Rules, you can
only have 1 unique/account active artifacts

Changes in 27_show.tpl:
+Added the text "Can't be activated" to not-activable artifacts

Changes in Automation.php:
+Added a new method which activate activable artifacts

Changes in Database.php:
+Added some methods to support the new artifacts activation system
This commit is contained in:
iopietro
2018-04-25 15:13:24 +02:00
parent 26cb03cdb6
commit 0011d2abcb
4 changed files with 162 additions and 15 deletions
+4 -1
View File
@@ -8,8 +8,11 @@ if($artefact['size'] == 1 && $artefact['type'] != 11){
$effect = ACCOUNT;
}
$activationTime = 86400 / (SPEED == 2 ? 1.5 : (SPEED == 3 ? 2 : SPEED));
if($artefact['owner'] == 3) $active = "-";
elseif (!$artefact['active']) $active = date("Y-m-d H:i:s",$artefact['conquered'] + 86400);
elseif(!$artefact['active'] && $artefact['conquered'] < time() - $activationTime) $active = "<b>Can't be activated</b>";
elseif (!$artefact['active']) $active = date("Y-m-d H:i:s", $artefact['conquered'] + $activationTime);
else $active = "<b>".ACTIVE."</b>";
//// Added by brainiac - thank you