Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
expand a building
#1
Does someone know how to calculate the needed time to expand a building if I have the $factor, $world_speed, $build_level and $build (the dbname of a build, just to find out the buildings expand time);

Let's just supose I have a function as is follows:
PHP Code:
function get_build_time($build,$level,$world_speed) {
    
$time = array('main' => 30'barracks' => 20'stable' => 40 etc); //this is the default time for a building
    
$factor 0.3;
    ..................
    
formula how to calculate the needed time for a building to be expanded in dslan without using the function from include.inc.php
    
..................
    return 
$seconds;


PHP Code:
return ceil($time[$build]*(percentage($level,maxstage($build))*$level/6)); //i used this, as a formula to get similar values like dslan ones 

Does anyone know the formula ? I don't need the function word by word, i can make it on my own, just the formula so I can develop it.
Reply
#2
Why you write an own function you can use the Function get_time($main_stage,$dbname,$stage) (part of the builds class, saved in $cl_builds)
LG
steffen
Reply
#3
PHP Code:
return round(($building_time pow($stage_factor$building_stage)) / pow($main_factor$main_stage)); 
Reply
#4
steffengy, it's not about dslan what i'm working at, so I can't use the functions from there Big Grin
Reply
#5
then it must be in the section "Sonstige Fragen" when its not about TWLan / DSLan
Ihr wollt sowas wie DS gerne online spielen - Privatserver?!

klick
Reply
#6
~moved
Reply




Users browsing this thread: 2 Guest(s)