# HG changeset patch # User "Rex Tsai " # Date 1225389921 -28800 # Node ID ac29596f39bf1525e3aac87aa3ed845607bdfe94 # Parent 085d2ffcf62d50c65b6bf8755bb16de3b1fd26b0# Parent 4194f261798bbcff161e3a73eb2c6171a7ef6104 merged again. diff -r 085d2ffcf62d -r ac29596f39bf sheep.pl --- a/sheep.pl Fri Oct 31 02:02:10 2008 +0800 +++ b/sheep.pl Fri Oct 31 02:05:21 2008 +0800 @@ -71,6 +71,9 @@ next if($capture < 200); + # 測試風險評估 + # $capture = $capture - ($sheep->army_score_main*100); + $line = sprintf("%d %s score %d army %d %s/%s(%d),", $capture, $c->status, $sheep->score, $sheep->army_score_main, $sheep->name, $sheep->ally, $members); diff -r 085d2ffcf62d -r ac29596f39bf warfare.pl --- a/warfare.pl Fri Oct 31 02:02:10 2008 +0800 +++ b/warfare.pl Fri Oct 31 02:05:21 2008 +0800 @@ -21,9 +21,7 @@ ORDER BY cities.citylevel * (cities.citylevel - 1) * user.trader_score_secondary / 10000 DESC } ); -# $island->tradegood, -# qw/NULL 葡萄酒 大理石 水晶 硫磺/; -# 不打與自己相同的資源 + Ikariam::Report->set_sql(victim => qq { SELECT report.id FROM report @@ -50,6 +48,11 @@ return ($city->{actionPoints} > ($city->{maxActionPoints}/2) ) ? 1 : 0; } +sub is_transporters_available { + my ($self, $city) = @_; + return ($city->{transporters}->{avail} > 0) ? 1 : 0; +} + sub is_army_available { my ($self, $city) = @_; return ($city->{army}->{Swordsman} >= 2 ) ? 1 : 0; diff -r 085d2ffcf62d -r ac29596f39bf warfare.yaml --- a/warfare.yaml Fri Oct 31 02:02:10 2008 +0800 +++ b/warfare.yaml Fri Oct 31 02:05:21 2008 +0800 @@ -3,5 +3,7 @@ 0: - is_actionPoint_enough: 1: - - is_army_available: - 1: engagement + - is_transporters_available: + 1: + - is_army_available: + 1: engagement