diff --git a/GameEngine/Automation.php b/GameEngine/Automation.php index ffbc545f..2fc5851a 100644 --- a/GameEngine/Automation.php +++ b/GameEngine/Automation.php @@ -2085,9 +2085,9 @@ $crannyimg = "getOwnUniqueArtefactInfo2($from['owner'],2,2,0)); if($artefact > 0){ $fastertroops = 3; - }else if($artefact1 > 1){ + }else if($artefact1 > 0){ $fastertroops = 2; - }else if($artefact2 > 1){ + }else if($artefact2 > 0){ $fastertroops = 1.5; }else{ $fastertroops = 1; @@ -2203,9 +2203,9 @@ $crannyimg = "getOwnUniqueArtefactInfo2($from['owner'],2,2,0)); if($artefact > 0){ $fastertroops = 3; - }else if($artefact1 > 1){ + }else if($artefact1 > 0){ $fastertroops = 2; - }else if($artefact2 > 1){ + }else if($artefact2 > 0){ $fastertroops = 1.5; }else{ $fastertroops = 1; @@ -2371,9 +2371,9 @@ $crannyimg = "getOwnUniqueArtefactInfo2($from['owner'],2,2,0)); if($artefact > 0){ $fastertroops = 3; - }else if($artefact1 > 1){ + }else if($artefact1 > 0){ $fastertroops = 2; - }else if($artefact2 > 1){ + }else if($artefact2 > 0){ $fastertroops = 1.5; }else{ $fastertroops = 1; diff --git a/GameEngine/Technology.php b/GameEngine/Technology.php index 8dc0df94..92f9946e 100644 --- a/GameEngine/Technology.php +++ b/GameEngine/Technology.php @@ -408,10 +408,10 @@ class Technology { if($artefact > 0){ $upkeep /= 2; $upkeep = round($upkeep); - }else if($artefact1 > 1){ + }else if($artefact1 > 0){ $upkeep /= 2; $upkeep = round($upkeep); - }else if($artefact2 > 1){ + }else if($artefact2 > 0){ $upkeep /= 4; $upkeep = round($upkeep); $upkeep *= 3; diff --git a/GameEngine/Units.php b/GameEngine/Units.php index dc8aa85f..800918ea 100644 --- a/GameEngine/Units.php +++ b/GameEngine/Units.php @@ -311,9 +311,9 @@ class Units { $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); if($artefact > 0){ $fastertroops = 3; - }else if($artefact1 > 1){ + }else if($artefact1 > 0){ $fastertroops = 2; - }else if($artefact2 > 1){ + }else if($artefact2 > 0){ $fastertroops = 1.5; }else{ $fastertroops = 1; @@ -439,9 +439,9 @@ class Units { $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); if($artefact > 0){ $fastertroops = 3; - }else if($artefact1 > 1){ + }else if($artefact1 > 0){ $fastertroops = 2; - }else if($artefact2 > 1){ + }else if($artefact2 > 0){ $fastertroops = 1.5; }else{ $fastertroops = 1; @@ -475,21 +475,9 @@ class Units { if($rallypoint['f39'] > 0){ if($cps >= $need_cps) { $unit = ($session->tribe*10); - $artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0)); - $artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1)); - $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); - if($artefact > 0){ - $fastertroops = 3; - }else if($artefact1 > 1){ - $fastertroops = 2; - }else if($artefact2 > 1){ - $fastertroops = 1.5; - }else{ - $fastertroops = 1; - } $database->modifyResource($village->wid,750,750,750,750,0); $database->modifyUnit($village->wid,array($unit),array(3),array(0)); - $database->addMovement(5,$village->wid,$post['s'],0,time(),round(($post['timestamp']-time())/$fastertroops)+time()); + $database->addMovement(5,$village->wid,$post['s'],0,time(),$post['timestamp']); header("Location: build.php?id=39"); if($form->returnErrors() > 0) { diff --git a/Templates/a2b/attack.tpl b/Templates/a2b/attack.tpl index a12ba3ef..459750d8 100644 --- a/Templates/a2b/attack.tpl +++ b/Templates/a2b/attack.tpl @@ -7,7 +7,19 @@ $from = array('x'=>$eigen['x'], 'y'=>$eigen['y']); $to = array('x'=>$coor['x'], 'y'=>$coor['y']); -$time = $generator->procDistanceTime($from,$to,300,0); + $artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0)); + $artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1)); + $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); + if($artefact > 0){ + $fastertroops = 3; + }else if($artefact1 > 0){ + $fastertroops = 2; + }else if($artefact2 > 0){ + $fastertroops = 1.5; + }else{ + $fastertroops = 1; + } +$time = round($generator->procDistanceTime($from,$to,300,0)/$fastertroops); // Temp @@ -368,8 +380,19 @@ $end = ($tribe*10); $process['c'] = 1; - - $time = $generator->procDistanceTime($from,$to,min($speeds),1); + $artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0)); + $artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1)); + $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); + if($artefact > 0){ + $fastertroops = 3; + }else if($artefact1 > 0){ + $fastertroops = 2; + }else if($artefact2 > 0){ + $fastertroops = 1.5; + }else{ + $fastertroops = 1; + } + $time = round($generator->procDistanceTime($from,$to,min($speeds),1)/$fastertroops); ?> diff --git a/Templates/a2b/attack_5.tpl b/Templates/a2b/attack_5.tpl index 075996ff..65ce2ede 100644 --- a/Templates/a2b/attack_5.tpl +++ b/Templates/a2b/attack_5.tpl @@ -10,7 +10,19 @@ $from = array('x'=>$eigen['x'], 'y'=>$eigen['y']); $to = array('x'=>$coor['x'], 'y'=>$coor['y']); -$time = $generator->procDistanceTime($from,$to,300,0); + $artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0)); + $artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1)); + $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); + if($artefact > 0){ + $fastertroops = 3; + }else if($artefact1 > 0){ + $fastertroops = 2; + }else if($artefact2 > 0){ + $fastertroops = 1.5; + }else{ + $fastertroops = 1; + } +$time = round($generator->procDistanceTime($from,$to,300,0)/$fastertroops); // Temp @@ -363,8 +375,19 @@ $actionType = "Raid"; $process['c'] = 1; - - $time = $generator->procDistanceTime($from,$to,min($speeds),1); + $artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0)); + $artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1)); + $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); + if($artefact > 0){ + $fastertroops = 3; + }else if($artefact1 > 0){ + $fastertroops = 2; + }else if($artefact2 > 0){ + $fastertroops = 1.5; + }else{ + $fastertroops = 1; + } + $time = round($generator->procDistanceTime($from,$to,min($speeds),1)/$fastertroops); ?> diff --git a/Templates/a2b/newdorf.tpl b/Templates/a2b/newdorf.tpl index cd6d61a2..b4a2de98 100644 --- a/Templates/a2b/newdorf.tpl +++ b/Templates/a2b/newdorf.tpl @@ -5,7 +5,19 @@ $newvillage = $database->getMInfo($_GET['id']); $eigen = $database->getCoor($village->wid); $from = array('x'=>$eigen['x'], 'y'=>$eigen['y']); $to = array('x'=>$newvillage['x'], 'y'=>$newvillage['y']); -$time = $generator->procDistanceTime($from,$to,300,0); + $artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0)); + $artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1)); + $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); + if($artefact > 0){ + $fastertroops = 3; + }else if($artefact1 > 0){ + $fastertroops = 2; + }else if($artefact2 > 0){ + $fastertroops = 1.5; + }else{ + $fastertroops = 1; + } +$time = round($generator->procDistanceTime($from,$to,300,0)/$fastertroops); echo '
';
 echo '
'; diff --git a/Templates/a2b/sendback_1.tpl b/Templates/a2b/sendback_1.tpl index c94d83b8..28231860 100644 --- a/Templates/a2b/sendback_1.tpl +++ b/Templates/a2b/sendback_1.tpl @@ -144,7 +144,19 @@ $tocoor = $database->getCoor($enforce['vref']); $hero_unit=$hero_f['unit']; $speeds[] = $GLOBALS['u'.$hero_unit]['speed']; } - $time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1); + $artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0)); + $artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1)); + $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); + if($artefact > 0){ + $fastertroops = 3; + }else if($artefact1 > 0){ + $fastertroops = 2; + }else if($artefact2 > 0){ + $fastertroops = 1.5; + }else{ + $fastertroops = 1; + } + $time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops); ?> diff --git a/Templates/a2b/sendback_2.tpl b/Templates/a2b/sendback_2.tpl index fb64454e..fa31e928 100644 --- a/Templates/a2b/sendback_2.tpl +++ b/Templates/a2b/sendback_2.tpl @@ -145,7 +145,19 @@ $tocoor = $database->getCoor($enforce['vref']); $hero_unit=$hero_f['unit']; $speeds[] = $GLOBALS['u'.$hero_unit]['speed']; } - $time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1); + $artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0)); + $artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1)); + $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); + if($artefact > 0){ + $fastertroops = 3; + }else if($artefact1 > 0){ + $fastertroops = 2; + }else if($artefact2 > 0){ + $fastertroops = 1.5; + }else{ + $fastertroops = 1; + } + $time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops); ?> diff --git a/Templates/a2b/sendback_3.tpl b/Templates/a2b/sendback_3.tpl index 308d5860..c0c7b187 100644 --- a/Templates/a2b/sendback_3.tpl +++ b/Templates/a2b/sendback_3.tpl @@ -144,7 +144,19 @@ $tocoor = $database->getCoor($enforce['vref']); $hero_unit=$hero_f['unit']; $speeds[] = $GLOBALS['u'.$hero_unit]['speed']; } - $time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1); + $artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0)); + $artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1)); + $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); + if($artefact > 0){ + $fastertroops = 3; + }else if($artefact1 > 0){ + $fastertroops = 2; + }else if($artefact2 > 0){ + $fastertroops = 1.5; + }else{ + $fastertroops = 1; + } + $time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops); ?> diff --git a/Templates/a2b/sendback_4.tpl b/Templates/a2b/sendback_4.tpl index e8a8a1ad..4cb50201 100644 --- a/Templates/a2b/sendback_4.tpl +++ b/Templates/a2b/sendback_4.tpl @@ -145,7 +145,19 @@ $tocoor = $database->getCoor($enforce['vref']); $hero_unit=$hero_f['unit']; $speeds[] = $GLOBALS['u'.$hero_unit]['speed']; } - $time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1); + $artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0)); + $artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1)); + $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); + if($artefact > 0){ + $fastertroops = 3; + }else if($artefact1 > 0){ + $fastertroops = 2; + }else if($artefact2 > 0){ + $fastertroops = 1.5; + }else{ + $fastertroops = 1; + } + $time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops); ?> diff --git a/Templates/a2b/sendback_5.tpl b/Templates/a2b/sendback_5.tpl index edc96727..25e1daff 100644 --- a/Templates/a2b/sendback_5.tpl +++ b/Templates/a2b/sendback_5.tpl @@ -143,7 +143,19 @@ $tocoor = $database->getCoor($enforce['vref']); $hero_unit=$hero_f['unit']; $speeds[] = $GLOBALS['u'.$hero_unit]['speed']; } - $time = $generator->procDistanceTime($fromCor,$toCor,min($speeds),1); + $artefact = count($database->getOwnUniqueArtefactInfo2($session->uid,2,3,0)); + $artefact1 = count($database->getOwnUniqueArtefactInfo2($village->wid,2,1,1)); + $artefact2 = count($database->getOwnUniqueArtefactInfo2($session->uid,2,2,0)); + if($artefact > 0){ + $fastertroops = 3; + }else if($artefact1 > 0){ + $fastertroops = 2; + }else if($artefact2 > 0){ + $fastertroops = 1.5; + }else{ + $fastertroops = 1; + } + $time = round($generator->procDistanceTime($fromCor,$toCor,min($speeds),1)/$fastertroops); ?>