Mercurial > eagle-eye
diff 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 |
line wrap: on
line diff
--- a/agent.pl Fri Oct 31 12:47:34 2008 +0800 +++ b/agent.pl Fri Oct 31 16:13:36 2008 +0800 @@ -20,6 +20,11 @@ sub is_attacked { my ($self, $city) = @_; + if($self->{'ikariam'}->{'military'}->{attacks} > 0) { + # notify youself. + system('zenity --warning --title="Ikariam" --text="You are attacked"'); + } + return ($self->{'ikariam'}->{'military'}->{attacks} > 0 ) ? 1 : 0; }