fix artefact: cranny + random aim

This commit is contained in:
unknown
2012-06-10 20:02:21 +03:00
parent 57eaa07638
commit 71feafa699
3 changed files with 36 additions and 8 deletions
+14 -2
View File
@@ -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']);
+6 -2
View File
@@ -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']);
+16 -4
View File
@@ -1,5 +1,17 @@
<?php
include("next.tpl");
$artefact_2 = count($database->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;
}
?>
<div id="build" class="gid23"><a href="#" onClick="return Popup(23,4);" class="build_logo">
<img class="building g23" src="img/x.gif" alt="Cranny" title="Cranny" />
@@ -32,11 +44,11 @@ include("next.tpl");
<?php
if($session->tribe == 3) {
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*2; ?></b> units</td>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*2*$artefact_bouns; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']; ?></b> units</td>
<td><b><?php echo $bid23[$village->resarray['f'.$id]+1+$loopsame+$doublebuild+$master]['attri']*$artefact_bouns; ?></b> units</td>
<?php
}}else{
?>
@@ -44,11 +56,11 @@ include("next.tpl");
<?php
if($session->tribe == 3) {
?>
<td><b><?php echo $bid23[10]['attri']*2; ?></b> units</td>
<td><b><?php echo $bid23[10]['attri']*2*$artefact_bouns; ?></b> units</td>
<?php
}else{
?>
<td><b><?php echo $bid23[10]['attri']; ?></b> units</td>
<td><b><?php echo $bid23[10]['attri']*$artefact_bouns; ?></b> units</td>
<?php
}}}
?>