changeset 308:f6f56a47f383

implemented is_tavern_enough
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Sun, 04 Jan 2009 23:49:41 +0800
parents 2f36120aba83
children 9e8dccf177e8 68138c99ee16 995862190853
files agent.pl city.yaml
diffstat 2 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/agent.pl	Wed Dec 10 00:42:31 2008 +0800
+++ b/agent.pl	Sun Jan 04 23:49:41 2009 +0800
@@ -50,7 +50,12 @@
 sub is_museum_enough {
     my ($self, $city) = @_;
     return 1 if($city->{buildings}->{museum} >= 8);
-    return ($city->{buildings}->{museum} >= ($city->{buildings}->{tavern}/2) ? 1 : 0);
+}
+
+sub is_tavern_enough {
+    my ($self, $city) = @_;
+    return 0 if(!defined($city->{buildings}->{tavern}));
+    return 1 if($city->{buildings}->{museum} >= 12);
 }
 
 sub is_branchOffice_enough {
@@ -132,10 +137,6 @@
     return 1 if($city->{buildings}->{townHall} >= 20);
 }
 
-sub is_tavern_available {
-    my ($self, $city) = @_;
-    return (defined($city->{buildings}->{tavern}) ? 1 : 0);
-}
 
 sub is_bacchanal {
     my ($self, $city) = @_;
--- a/city.yaml	Wed Dec 10 00:42:31 2008 +0800
+++ b/city.yaml	Sun Jan 04 23:49:41 2009 +0800
@@ -31,7 +31,7 @@
                               1: build_museum
                        - is_winepress_researched:
                            1:
-                              - is_tavern_available:
+                              - is_tavern_enough:
                                  0: build_tavern
                                  1: 
                                     - is_bacchanal: