fix stronger buildings artefact + minor battle fixes

This commit is contained in:
unknown
2012-06-08 17:37:39 +03:00
parent 12f48e8f41
commit 16056c768f
2 changed files with 85 additions and 14 deletions
+48 -9
View File
@@ -1547,10 +1547,23 @@ class Automation {
$tblevel = $bdo['f'.$rand];
$tbgid = $bdo['f'.$rand.'t'];
$tbid = $rand;
if($bid34[$stonemason]==0){
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200))) + 0.5);
$artowner = $database->getVillageField($data['to'],"owner");
$bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0));
$bartefact1 = count($database->getOwnUniqueArtefactInfo2($data['to'],1,1,1));
$bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0));
if($bartefact > 0){
$strongerbuildings = 5;
}else if($bartefact1 > 0){
$strongerbuildings = 4;
}else if($bartefact2 > 0){
$strongerbuildings = 3;
}else{
$strongerbuildings = 1;
}
if($stonemason==0){
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / $strongerbuildings)) + 0.5);
}else{
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100) / $strongerbuildings)) + 0.5);
}
if ($battlepart[4]>$needed_cata)
{
@@ -1671,10 +1684,23 @@ class Automation {
$tblevel = $bdo['f'.$rand];
$tbgid = $bdo['f'.$rand.'t'];
$tbid = $rand;
if($bid34[$stonemason]==0){
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200))) + 0.5);
$artowner = $database->getVillageField($data['to'],"owner");
$bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0));
$bartefact1 = count($database->getOwnUniqueArtefactInfo2($data['to'],1,1,1));
$bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0));
if($bartefact > 0){
$strongerbuildings = 5;
}else if($bartefact1 > 0){
$strongerbuildings = 4;
}else if($bartefact2 > 0){
$strongerbuildings = 3;
}else{
$strongerbuildings = 1;
}
if($stonemason==0){
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / $strongerbuildings)) + 0.5);
}else{
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100) / $strongerbuildings)) + 0.5);
}
if (($battlepart[4]/2)>$needed_cata)
{
@@ -1795,10 +1821,23 @@ class Automation {
$tblevel = $bdo['f'.$rand];
$tbgid = $bdo['f'.$rand.'t'];
$tbid = $rand;
if($bid34[$stonemason]==0){
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200))) + 0.5);
$artowner = $database->getVillageField($data['to'],"owner");
$bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0));
$bartefact1 = count($database->getOwnUniqueArtefactInfo2($data['to'],1,1,1));
$bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0));
if($bartefact > 0){
$strongerbuildings = 5;
}else if($bartefact1 > 0){
$strongerbuildings = 4;
}else if($bartefact2 > 0){
$strongerbuildings = 3;
}else{
$strongerbuildings = 1;
}
if($stonemason==0){
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / $strongerbuildings)) + 0.5);
}else{
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
$needed_cata = round((($battlepart[5] * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$battlepart[6]))/200) / (1 * $bid34[$stonemason]['attri']/100) / $strongerbuildings)) + 0.5);
}
if (($battlepart[4]/2)>$needed_cata)
{
+37 -5
View File
@@ -506,8 +506,24 @@ class Battle {
$wctp = pow(($rap/$rdp),1.5);
$wctp = ($wctp >= 1)? 1-0.5/$wctp : 0.5*$wctp;
$wctp *= $catp;
$need = round((($moralbonus * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a8']))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
$artowner = $database->getVillageField($DefenderWref,"owner");
$bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0));
$bartefact1 = count($database->getOwnUniqueArtefactInfo2($DefenderWref,1,1,1));
$bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0));
if($bartefact > 0){
$strongerbuildings = 5;
}else if($bartefact1 > 0){
$strongerbuildings = 4;
}else if($bartefact2 > 0){
$strongerbuildings = 3;
}else{
$strongerbuildings = 1;
}
if($stonemason==0){
$need = round((($moralbonus * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a8']))/200) / $strongerbuildings)) + 0.5);
}else{
$need = round((($moralbonus * (pow($tblevel,2) + $tblevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a8']))/200) / ($bid34[$stonemason]['attri']/100) / $strongerbuildings)) + 0.5);
}
// Aantal katapulten om het gebouw neer te halen
$result[3] = $need;
// Aantal Katapulten die handeling
@@ -519,9 +535,25 @@ class Battle {
$wctp = pow(($rap/$rdp),1.5);
$wctp = ($wctp >= 1)? 1-0.5/$wctp : 0.5*$wctp;
$wctp *= $ram;
$need = round((($moralbonus * (pow($walllevel,2) + $walllevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a7']))/200) / (1 * $bid34[$stonemason]['attri']/100))) + 0.5);
// Aantal katapulten om het gebouw neer te halen
$artowner = $database->getVillageField($DefenderWref,"owner");
$bartefact = count($database->getOwnUniqueArtefactInfo2($artowner,1,3,0));
$bartefact1 = count($database->getOwnUniqueArtefactInfo2($DefenderWref,1,1,1));
$bartefact2 = count($database->getOwnUniqueArtefactInfo2($artowner,1,2,0));
if($bartefact > 0){
$strongerbuildings = 5;
}else if($bartefact1 > 0){
$strongerbuildings = 4;
}else if($bartefact2 > 0){
$strongerbuildings = 3;
}else{
$strongerbuildings = 1;
}
if($stonemason==0){
$need = round((($moralbonus * (pow($walllevel,2) + $walllevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a7']))/200) / $strongerbuildings)) + 0.5);
}else{
$need = round((($moralbonus * (pow($walllevel,2) + $walllevel + 1)) / (8 * (round(200 * pow(1.0205,$att_ab['a7']))/200) / ($bid34[$stonemason]['attri']/100) / $strongerbuildings)) + 0.5);
}
// Aantal katapulten om het gebouw neer te halen
$result[7] = $need;
// Aantal Katapulten die handeling