Fixed some catapult/ram bugs

Battle.php:
Fixed the blacksmith level formula for catapults and rams.

Automation.php:
+Catapults and rams now works better because of a new formula.

Note: this formula isn't 100% accurate with the real Travian formula, i can't find that formula anywhere, so i created an approximate formula.
This commit is contained in:
Pietro
2018-04-05 17:05:25 +02:00
committed by GitHub
parent 9fc3db754c
commit a1fbf9dcfc
2 changed files with 15 additions and 26 deletions
+2 -2
View File
@@ -583,7 +583,7 @@ class Battle {
if($catp > 0 && $tblevel != 0) {
$wctp = pow(($rap/$rdp),1.5);
$wctp = ($wctp >= 1)? 1-0.5/$wctp : 0.5*$wctp;
$wctp *= $catp+($att_ab8/1.5);
$wctp *= $catp + (round(200 * pow(1.0205,$att_ab8))/200);
$artowner = $database->getVillageField( $DefenderWref, "owner" );
$bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0));
$bartefact1 = count($database->getOwnUniqueArtefactInfo2($DefenderWref,1,1,1));
@@ -626,7 +626,7 @@ class Battle {
if($ram > 0 && $walllevel != 0) {
$wctp = pow(($rap/$rdp),1.5);
$wctp = ($wctp >= 1)? 1-0.5/$wctp : 0.5*$wctp;
$wctp *= ($ram/2) + ($att_ab7/1.5);
$wctp *= ($ram/2) + (round(200 * pow(1.0205,$att_ab7))/200);
$artowner = $database->getVillageField( $DefenderWref, "owner" );
$bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0));
$bartefact1 = count($database->getOwnUniqueArtefactInfo2($DefenderWref,1,1,1));