… | |
… | |
20 | |
20 | |
21 | sub on_move { |
21 | sub on_move { |
22 | my ($data) = @_; |
22 | my ($data) = @_; |
23 | |
23 | |
24 | if (my $pl = $data->{who}->nearest_player) { |
24 | if (my $pl = $data->{who}->nearest_player) { |
25 | if ($pl->level >= 10) { |
|
|
26 | my (undef, undef, undef, $dir, undef) = $data->{who}->direction ($pl); |
25 | my (undef, undef, undef, $dir, undef) = $data->{who}->rangevector ($pl); |
27 | $data->{who}->move ($data->{who}, $dir); |
26 | $data->{who}->move ($dir); |
28 | } |
|
|
29 | } |
27 | } |
30 | |
28 | |
31 | 1 |
29 | 1 |
32 | } |
30 | } |
33 | |
31 | |
34 | sub on_attack { |
32 | sub on_attack { |
35 | my ($data) = @_; |
33 | my ($data) = @_; |
36 | |
34 | |
|
|
35 | $data->{activator}{neko_attack}++ |
37 | cf::LOG cf::llevDebug, sprintf "QBERT Neko-san was attacked by %s!", $data->{activator}->name; |
36 | or cf::LOG cf::llevDebug, sprintf "QBERT Neko-san was attacked by %s!\n", $data->{activator}->name; |
38 | |
37 | |
39 | $data->{activator}->message ("Neko-san is suddenly gone!"); |
38 | $data->{activator}->message ("Meoow! (Please do not hurt me)") |
40 | teleport $data->{activator}, "/scorn/misc/scorn_illusions", 15, 7; |
39 | if !($data->{activator}{neko_attack} & 15); |
41 | $data->{activator}->message ("You hear strange noises all around you..."); |
|
|
42 | $data->{activator}->message ("You feel dumb."); |
|
|
43 | |
40 | |
|
|
41 | if ($data->{activator}{neko_attack} > 512) { |
|
|
42 | $data->{activator}{neko_attack} -= 128; |
|
|
43 | $data->{activator}->message ("Neko-san is suddenly gone!"); |
|
|
44 | teleport $data->{activator}, "/scorn/misc/scorn_illusions", 15, 7; |
|
|
45 | $data->{activator}->message ("You hear strange noises all around you..."); |
|
|
46 | $data->{activator}->message ("You feel dumb."); |
44 | 0 |
47 | } |
|
|
48 | |
|
|
49 | 1 |
45 | } |
50 | } |
46 | |
51 | |
47 | sub on_say { |
52 | sub on_say { |
48 | my ($data) = @_; |
53 | my ($data) = @_; |
49 | |
54 | |
50 | cf::LOG cf::llevDebug, "QBERT [Neko-fon] $data->{message}"; |
55 | cf::LOG cf::llevDebug, sprintf "QBERT [Neko-fon] %s: %s\n", $data->{activator}->name, $data->{message}; |
51 | |
56 | |
52 | 0 |
57 | 0 |
53 | } |
58 | } |
54 | |
59 | |