--- cf.schmorp.de/maps/perl/schmorp-neko.ext 2006/08/27 15:23:30 1.22 +++ cf.schmorp.de/maps/perl/schmorp-neko.ext 2006/08/27 15:39:17 1.23 @@ -35,7 +35,6 @@ sub on_move { my ($self, $enemy) = @_; - #warn "move<@_>\n";#d# if (my $pl = find_target_player $self) { my ($d, undef, undef, $dir, undef) = $self->rangevector ($pl); @@ -106,26 +105,25 @@ } sub on_attack { - my ($self) = @_; - #warn "attack<@_>\n";#d# + my ($self, $hitter) = @_; - if ($self->{neko_last_attack} < time - 300) { - $self->{neko_attack} = 0; + if ($hitter->{neko_last_attack} < time - 300) { + $hitter->{neko_attack} = 0; } - $self->{neko_last_attack} = time; - $self->{neko_attack}++ - or ext::schmorp_irc::do_notice "Neko-san was attacked by ". $self->name . "!\n"; - - $self->message ("Meoow! (Please do not hurt me)") - if !($self->{neko_attack} & 15); - - if ($self->{neko_attack} > 512) { - $self->{neko_attack} -= 128; - $self->message ("Neko-san is suddenly gone!"); - teleport $self, "/scorn/misc/scorn_illusions", 15, 7; - $self->message ("You hear strange noises all around you..."); - $self->message ("You feel dumb."); + $hitter->{neko_last_attack} = time; + $hitter->{neko_attack}++ + or ext::schmorp_irc::do_notice "Neko-san was attacked by ". $hitter->name . "!\n"; + + $hitter->message ("Meoow! (Please do not hurt me)") + if !($hitter->{neko_attack} & 15); + + if ($hitter->{neko_attack} > 512) { + $hitter->{neko_attack} -= 128; + $hitter->message ("Neko-san is suddenly gone!"); + teleport $hitter, "/scorn/misc/scorn_illusions", 15, 7; + $hitter->message ("You hear strange noises all around you..."); + $hitter->message ("You feel dumb."); } cf::override;