comparison sheep.pl @ 65:3a611c51b99b

for the new world, we only have sheep with a little gold. poor people.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Tue, 21 Oct 2008 16:41:16 +0800
parents d2ac1e198ce4
children 27b16506231f
comparison
equal deleted inserted replaced
59:b40f87f16263 65:3a611c51b99b
35 35
36 Ikariam::User->set_sql(sheeps => qq { 36 Ikariam::User->set_sql(sheeps => qq {
37 SELECT user.id 37 SELECT user.id
38 FROM user, cities 38 FROM user, cities
39 WHERE user.id == cities.user 39 WHERE user.id == cities.user
40 AND user.trader_score_secondary >= 20 40 AND user.trader_score_secondary >= 200
41 AND user.army_score_main <= 100 41 AND user.army_score_main <= 100
42 AND cities.island IN (SELECT island.id FROM island WHERE island.x <= ? AND island.x >= ? AND island.y <= ? AND island.y >= ? ) 42 AND cities.island IN (SELECT island.id FROM island WHERE island.x <= ? AND island.x >= ? AND island.y <= ? AND island.y >= ? )
43 } 43 }
44 ); 44 );
45 45
71 my $line = ""; 71 my $line = "";
72 # Ignore 假期模式 72 # Ignore 假期模式
73 next if($c->status eq 'v'); 73 next if($c->status eq 'v');
74 74
75 unless($c->status eq 'i') { 75 unless($c->status eq 'i') {
76 next if($members > 3); 76 next if($members > 5);
77 } 77 }
78 78
79 my $island = Ikariam::Island->retrieve($c->island); 79 my $island = Ikariam::Island->retrieve($c->island);
80 80
81 # 所得金錢 = 對方城鎮等級x(對方城鎮等級-1)x對方金錢/10000 81 # 所得金錢 = 對方城鎮等級x(對方城鎮等級-1)x對方金錢/10000
82 my $robbery = $c->citylevel * ($c->citylevel - 1) * $sheep->trader_score_secondary / 10000; 82 my $capture = $c->citylevel * ($c->citylevel - 1) * $sheep->trader_score_secondary / 10000;
83 83
84 next if($robbery < 2000); 84 next if($capture < 100);
85 85
86 $line = sprintf("%d %s army %d %s/%s(%d),", 86 $line = sprintf("%d %s army %d %s/%s(%d),",
87 $robbery, 87 $capture,
88 $c->status, $sheep->army_score_main, $sheep->name, $sheep->ally, $members); 88 $c->status, $sheep->army_score_main, $sheep->name, $sheep->ally, $members);
89 89
90 $line .= sprintf("\"%s\" %d [%d,%d] %s http://s2.ikariam.tw/index.php?view=island&id=%d&selectCity=%d\n", 90 $line .= sprintf("\"%s\" %d [%d,%d] %s http://s2.ikariam.tw/index.php?view=island&id=%d&selectCity=%d\n",
91 $c->cityname, $c->citylevel, 91 $c->cityname, $c->citylevel,
92 $island->x, $island->y, 92 $island->x, $island->y,