Mercurial > eagle-eye
comparison agent.pl @ 150:fab1593cadf1
fixed the combat reading issue.
author | "Rex Tsai <chihchun@kalug.linux.org.tw>" |
---|---|
date | Sat, 01 Nov 2008 03:52:09 +0800 |
parents | 9fb18f3d6e26 |
children | 7071116f6ae7 |
comparison
equal
deleted
inserted
replaced
149:97dfcc0d1e3f | 150:fab1593cadf1 |
---|---|
18 return bless $self, $class; | 18 return bless $self, $class; |
19 } | 19 } |
20 | 20 |
21 sub is_attacked { | 21 sub is_attacked { |
22 my ($self, $city) = @_; | 22 my ($self, $city) = @_; |
23 if($self->{'ikariam'}->{'military'}->{attacks} > 0) { | |
24 # notify youself. | |
25 system('zenity --warning --title="Ikariam" --text="You are attacked"'); | |
26 } | |
27 | 23 |
28 return ($self->{'ikariam'}->{'military'}->{attacks} > 0 ) ? 1 : 0; | 24 return ($self->{'ikariam'}->{'military'}->{attacks} > 0 ) ? 1 : 0; |
29 } | 25 } |
30 | 26 |
31 sub is_constructing { | 27 sub is_constructing { |
290 } | 286 } |
291 # Debug | 287 # Debug |
292 # print(Dump($cities->{$cityId}->{parse_path})) if(defined($verbose)); | 288 # print(Dump($cities->{$cityId}->{parse_path})) if(defined($verbose)); |
293 } | 289 } |
294 # print(Dump($cities)) if(defined($verbose)); | 290 # print(Dump($cities)) if(defined($verbose)); |
295 DumpFile("dump.yaml", $cities); | 291 DumpFile("cities-dump.yaml", $cities); |
292 DumpFile("research-dump.yaml", $i->{'research'}); | |
293 DumpFile("military-dump.yaml", $i->{'military'}); | |
296 | 294 |
297 $i->logout; | 295 $i->logout; |
298 | 296 |
299 sub triggerAction { | 297 sub triggerAction { |
300 my ($action, $cityId) = @_; | 298 my ($action, $cityId) = @_; |