comparison agent.pl @ 144:9fb18f3d6e26

added warning dialog for attacks
author "Rex Tsai <chihchun@kalug.linux.org.tw>"
date Fri, 31 Oct 2008 16:13:36 +0800
parents 3bbb1e559e21
children fab1593cadf1
comparison
equal deleted inserted replaced
143:bfa78302cf09 144:9fb18f3d6e26
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 return ($self->{'ikariam'}->{'military'}->{attacks} > 0 ) ? 1 : 0; 28 return ($self->{'ikariam'}->{'military'}->{attacks} > 0 ) ? 1 : 0;
24 } 29 }
25 30
26 sub is_constructing { 31 sub is_constructing {
27 my ($self, $city) = @_; 32 my ($self, $city) = @_;