# HG changeset patch # User "Rex Tsai " # Date 1234444487 -28800 # Node ID 85d60a0569bfefaf31bc660b0c109a828e22b506 # Parent f3bdbc706a379d28e580702608a4105c898ec7dc fixed travel time for 0.3.0 diff -r f3bdbc706a37 -r 85d60a0569bf planner.pl --- a/planner.pl Thu Feb 12 21:13:46 2009 +0800 +++ b/planner.pl Thu Feb 12 21:14:47 2009 +0800 @@ -45,7 +45,7 @@ } } -# + package main; getopts('w'); if($#ARGV < 2) { diff -r f3bdbc706a37 -r 85d60a0569bf sheep.pl --- a/sheep.pl Thu Feb 12 21:13:46 2009 +0800 +++ b/sheep.pl Thu Feb 12 21:14:47 2009 +0800 @@ -41,8 +41,12 @@ sub travelTime { my ($x1, $y1, $x2, $y2, $speed) = @_; - $speed = 20 unless(defined($speed)); - return int( (sqrt((abs($x1 - $x2) * abs($x1 - $x2)) + (abs($y1 - $y2) * abs($y1 - $y2)))+1) * (400/$speed)); + $speed = 60 unless(defined($speed)); + if($x1 == $x2 && $y1 == $y2) { + return 600/$speed; + } else { + return int( (sqrt((abs($x1 - $x2) * abs($x1 - $x2)) + (abs($y1 - $y2) * abs($y1 - $y2)))) * (1200/$speed)); + } } sub listSheeps @@ -73,14 +77,7 @@ my $island = Ikariam::Island->retrieve($c->island); - # 所得金錢 = 對方城鎮等級x(對方城鎮等級-1)x對方金錢/10000 - my $capture = $c->citylevel * ($c->citylevel - 1) * $sheep->trader_score_secondary / 10000; - next if($capture < 200); - - # 測試風險評估 - # $capture = $capture - ($sheep->army_score_main*100); - $line = sprintf("%d %s score %d army %d risk %d %s/%s,", travelTime($::x, $::y, $island->x, $island->y), # $capture,