0) $energie_m = ceil((exp($mine_m*0.28)*10)); else $energie_m= 0; if ($mine_c > 0) $energie_c = ceil((exp($mine_c*0.28)*10)); else $energie_c= 0; if ($mine_h > 0) $energie_h = ceil((exp($mine_h*0.31)*10)); else $energie_h= 0; if ($centrale_f > 0 ) $energie_f = ceil((($centrale_f*80+(exp($centrale_f*0.38)*11)))); else $energie_f = 1; // pour pas avoir div by 0 if ($centrale_s > 0 ) $energie_s = ceil((($centrale_s*20+(exp($centrale_s*0.3)*10)))); else $energie_s = 0; $nrj = ($energie_s+$energie_f) - ($energie_m+$energie_c+$energie_h); $t = $energie_f+$energie_s; $coeff=($energie_s+$energie_f+$energie_m+$energie_c+$energie_h)/($energie_s+$energie_f); if ( $coeff < 0 ) $coeff = 0; if ( $coeff > 1 ) $coeff = 1; if ($metal >= $cap) { $prod_met=0; $metal = $cap; } else { if ($mine_m < 0) $prod_met = 0.011*$temps_ecoule; else $prod_met = (ceil(((($mine_m*32)+(pow(1.41,$mine_m)*exp(0.066*$mine_m))*$coeff)/0.36)*$temps_ecoule)/10000)*3.7 + 0.011*$temps_ecoule; } if ($cristal >= $cap) { $prod_cri=0; $cristal = $cap; } else { if ( $mine_c < 0 ) $prod_cri = 0.0055*$temps_ecoule; else $prod_cri = ((floor(((($mine_c*13)+(pow(1.36,$mine_c)*exp(0.0675*$mine_c))*$coeff)/0.36)*$temps_ecoule)/10000)*7) + 0.0055*$temps_ecoule; } if ($hydrogene >= $cap) { $prod_hy=0; $hydrogene = $cap; } else { if ($centrale_f > 0) $conso_h = ((ceil((($centrale_f*5+(exp($centrale_f*0.3)*10))*$coeff)/0.36)/10000)*$temps_ecoule); else $conso_h = 0; if ($mine_h < 0) $prod_hy = 0; else $prod_hy = (((floor(((($mine_h*12)+(pow(1.394,$mine_h)*exp(0.072*$mine_h))*$coeff)/0.36)*$temps_ecoule)/10000)*5)) - $conso_h; if ($mine_h == 0) $prod_hy=0; if ($prod_hy < 0) $prod_hy = 0; } $a=$metal+$prod_met; $b=$cristal+$prod_cri; $c=$hydrogene+$prod_hy; //---------------M.A.J-------------- //mysql_query("UPDATE planete SET timestamp='$temps_actuel', metal='$a', cristal='$b', hydrogene='$c', coeff='$coeff', energie='$t' WHERE id_user='$id' AND galaxie='$g' AND ss='$s'AND position='$p'"); $pseudoz = $ressource['pseudo']; $planetes = mysql_query("SELECT COUNT(*) AS nb FROM planete WHERE id_user='$id'"); $nbre = mysql_fetch_assoc($planetes); $pla = $nbre['nb']; echo '
![]() |
"; } echo " | ".$ressourc[0]." | ".$ressourc[1]." | ".$ressourc[2]." | ".$ressourc[3]." |
".floor($a)." | ".floor($b)." | ".floor($c)." | ".$nrj."/".$t." |