changeset 136:ac29596f39bf

merged again.
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 31 Oct 2008 02:05:21 +0800
parents 085d2ffcf62d (current diff) 4194f261798b (diff)
children 454657d0308f
files
diffstat 3 files changed, 13 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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);
--- 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;
--- 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