forgot some things in the last fix + fix artefact1 and artefact2 checking

This commit is contained in:
unknown
2012-06-08 14:38:39 +03:00
parent 4efa1e205f
commit 139e4bc378
11 changed files with 143 additions and 37 deletions
+6 -6
View File
@@ -2085,9 +2085,9 @@ $crannyimg = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$artefact2 = count($database->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 = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$artefact2 = count($database->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 = "<img src=\"".GP_LOCATE."img/g/g23.gif\" height=\"20\" width=\"15\"
$artefact2 = count($database->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;
+2 -2
View File
@@ -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;
+5 -17
View File
@@ -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) {
+26 -3
View File
@@ -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);
?>
+26 -3
View File
@@ -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);
?>
+13 -1
View File
@@ -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 '<pre>';
echo '</pre>';
+13 -1
View File
@@ -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);
?>
+13 -1
View File
@@ -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);
?>
+13 -1
View File
@@ -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);
?>
+13 -1
View File
@@ -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);
?>
+13 -1
View File
@@ -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);
?>