# HG changeset patch # User "Rex Tsai " # Date 1234678887 -28800 # Node ID 1ece3379f7a261a047c0908a326f259fb77223b4 # Parent 84311fc6fe351114a09e2fede32f03bcdff20d39# Parent bf59bef30dfcf4896c6ac65e249415d5f56be77f merged diff -r bf59bef30dfc -r 1ece3379f7a2 defend-network.pl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/defend-network.pl Sun Feb 15 14:21:27 2009 +0800 @@ -0,0 +1,1 @@ +../gamma/defend-network.pl \ No newline at end of file diff -r bf59bef30dfc -r 1ece3379f7a2 enemy.pl --- a/enemy.pl Sun Feb 15 14:19:47 2009 +0800 +++ b/enemy.pl Sun Feb 15 14:21:27 2009 +0800 @@ -13,8 +13,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 travelMatrix { @@ -68,7 +72,7 @@ my @cities = (); foreach (glob("city-*-dump.yaml")) { my $city = LoadFile($_); - $city->{distance} = travelTime($island->x, $island->y, $city->{island}->{x}, $city->{island}->{y}, 20); + $city->{distance} = travelTime($island->x, $island->y, $city->{island}->{x}, $city->{island}->{y}, 60); push (@cities, $city); } @cities = sort { $a->{distance} <=> $b->{distance}; } (@cities); @@ -77,10 +81,10 @@ for my $x (0..$n) { printf("%s (%d)\t- ", $cities[$x]->{name}, $cities[$x]->{id}); printf("Land %3d Ship %3d Catapult %3d Ram %3d\n", - travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y), - travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 8), - travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 6), - travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 10), + travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 60), + travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 33), + travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 26), + travelTime($cities[$x]->{island}->{x}, $cities[$x]->{island}->{y}, $island->x, $island->y, 40), ); } } diff -r bf59bef30dfc -r 1ece3379f7a2 planner.pl --- a/planner.pl Sun Feb 15 14:19:47 2009 +0800 +++ b/planner.pl Sun Feb 15 14:21:27 2009 +0800 @@ -61,7 +61,7 @@ # NAVY my $city = LoadFile(sprintf("city-%s-dump.yaml", $navyCity)); -$city->{distance} = travelTime($targetCity->island->x, $targetCity->island->y, $city->{island}->{x}, $city->{island}->{y}, 33) + 25; +$city->{distance} = travelTime($targetCity->island->x, $targetCity->island->y, $city->{island}->{x}, $city->{island}->{y}, 33) + 45; $city->{type} = "navy"; push (@cities, $city); diff -r bf59bef30dfc -r 1ece3379f7a2 sheep.pl --- a/sheep.pl Sun Feb 15 14:19:47 2009 +0800 +++ b/sheep.pl Sun Feb 15 14:21:27 2009 +0800 @@ -64,19 +64,19 @@ # Ignore 假期模式 next if($c->status eq 'v'); - unless($c->status eq 'i') { - # 依照影響力區分 - unless ($sheep->allyId == '0') { - unless (!defined($sheep->allyId) || $sheep->allyId == 0) { - my $ally = Ikariam::Ally->retrieve($sheep->allyId); - next if(!defined($ally)); - next if($ally->score > $myAlly->score); - } - } - } +# unless($c->status eq 'i') { +# # 依照影響力區分 +# unless ($sheep->allyId == '0') { +# unless (!defined($sheep->allyId) || $sheep->allyId == 0) { +# my $ally = Ikariam::Ally->retrieve($sheep->allyId); +# next if(!defined($ally)); +# next if($ally->score > $myAlly->score); +# } +# } +# } - next if($c->citylevel le 10); - next if($c->risk ge 30); + next if($c->citylevel le 5); + next if($c->risk ge 50); my $island = Ikariam::Island->retrieve($c->island);