# HG changeset patch # User "Rex Tsai " # Date 1225389892 -28800 # Node ID 4194f261798bbcff161e3a73eb2c6171a7ef6104 # Parent 21df8eb17a52653fd53e2d79fc9cf9b4a7cd7a83 check for transporters is available diff -r 21df8eb17a52 -r 4194f261798b warfare.pl --- a/warfare.pl Fri Oct 31 01:59:33 2008 +0800 +++ b/warfare.pl Fri Oct 31 02:04:52 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 21df8eb17a52 -r 4194f261798b warfare.yaml --- a/warfare.yaml Fri Oct 31 01:59:33 2008 +0800 +++ b/warfare.yaml Fri Oct 31 02:04:52 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