diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index bc413b18..0b1520ab 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -1334,8 +1334,20 @@ class Automation { //cranny efficiency $atk_bonus = ($owntribe == 2)? (4/5) : 1; $def_bonus = ($targettribe == 3)? 2 : 1; - - $cranny_eff = ($cranny * $atk_bonus)*$def_bonus; + $to_owner = $database->getVillageField($data['to'],"owner"); + $artefact_2 = count($database->getOwnUniqueArtefactInfo2($to_owner,7,3,0)); + $artefact1_2 = count($database->getOwnUniqueArtefactInfo2($data['to'],7,1,1)); + $artefact2_2 = count($database->getOwnUniqueArtefactInfo2($to_owner,7,2,0)); + if($artefact_2 > 0){ + $artefact_bouns = 6; + }else if($artefact1_2 > 0){ + $artefact_bouns = 3; + }else if($artefact2_2 > 0){ + $artefact_bouns = 2; + }else{ + $artefact_bouns = 1; + } + $cranny_eff = ($cranny * $atk_bonus)*$def_bonus*$artefact_bouns; // work out available resources. $this->updateRes($data['to'],$to['owner']); diff --git a/GameEngine/Units.php b/GameEngine/Units.php index 800918ea..b458eb83 100644 --- a/GameEngine/Units.php +++ b/GameEngine/Units.php @@ -319,8 +319,12 @@ class Units { $fastertroops = 1; } $time = round($generator->procDistanceTime($from,$to,min($speeds),1)/$fastertroops); - if (isset($post['ctar1'])){$post['ctar1'] = $post['ctar1'];}else{ $post['ctar1'] = 0;} - if (isset($post['ctar2'])){$post['ctar2'] = $post['ctar2'];}else{ $post['ctar2'] = 0;} + $to_owner = $database->getVillageField($data['to_vid'],"owner"); + $artefact_2 = count($database->getOwnUniqueArtefactInfo2($to_owner,7,3,0)); + $artefact1_2 = count($database->getOwnUniqueArtefactInfo2($data['to_vid'],7,1,1)); + $artefact2_2 = count($database->getOwnUniqueArtefactInfo2($to_owner,7,2,0)); + if (isset($post['ctar1'])){if($artefact_2 > 0 or $artefact1_2 > 0 or $artefact2_2 > 0){$post['ctar1'] = 99}else{$post['ctar1'] = $post['ctar1'];}}else{ $post['ctar1'] = 0;} + if (isset($post['ctar2'])){if($artefact_2 > 0 or $artefact1_2 > 0 or $artefact2_2 > 0){$post['ctar2'] = 99}else{$post['ctar2'] = $post['ctar2'];}}else{ $post['ctar2'] = 0;} if (isset($post['spy'])){$post['spy'] = $post['spy'];}else{ $post['spy'] = 0;} $abdata = $database->getABTech($village->wid); $reference = $database->addAttack(($village->wid),$data['u1'],$data['u2'],$data['u3'],$data['u4'],$data['u5'],$data['u6'],$data['u7'],$data['u8'],$data['u9'],$data['u10'],$data['u11'],$data['type'],$post['ctar1'],$post['ctar2'],$post['spy'],$abdata['b1'],$abdata['b2'],$abdata['b3'],$abdata['b4'],$abdata['b5'],$abdata['b6'],$abdata['b7'],$abdata['b8']); diff --git a/Templates/Build/23.tpl b/Templates/Build/23.tpl index e4fd43da..bbe65b6f 100644 --- a/Templates/Build/23.tpl +++ b/Templates/Build/23.tpl @@ -1,5 +1,17 @@ getOwnUniqueArtefactInfo2($session->uid,7,3,0)); + $artefact1_2 = count($database->getOwnUniqueArtefactInfo2($village->wid,7,1,1)); + $artefact2_2 = count($database->getOwnUniqueArtefactInfo2($session->uid,7,2,0)); + if($artefact_2 > 0){ + $artefact_bouns = 6; + }else if($artefact1_2 > 0){ + $artefact_bouns = 3; + }else if($artefact2_2 > 0){ + $artefact_bouns = 2; + }else{ + $artefact_bouns = 1; + } ?>
@@ -32,11 +44,11 @@ include("next.tpl");
tribe == 3) {
?>
-