ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/maps/perl/schmorp-neko.ext
Revision: 1.4
Committed: Wed Feb 8 06:49:25 2006 UTC (18 years, 3 months ago) by root
Branch: MAIN
Changes since 1.3: +12 -6 lines
Log Message:
*** empty log message ***

File Contents

# Content
1 #! perl
2
3 # archetype nekosan
4
5 use Data::Dumper;
6
7 sub teleport {
8 my ($pl, $map, $x, $y) = @_;
9
10 my $portal = cf::object::new ("exit");
11
12 $portal->set_slaying ($map);
13 $portal->set_hp ($x);
14 $portal->set_sp ($y);
15
16 $portal->apply ($pl);
17
18 $portal->free;
19 }
20
21 sub on_move {
22 my ($data) = @_;
23
24 if (my $pl = $data->{who}->nearest_player) {
25 if ($pl->exp >= 200000) {
26 my (undef, undef, undef, $dir, undef) = $data->{who}->direction ($pl);
27 $data->{who}->move ($data->{who}, $dir);
28 }
29 }
30
31 1
32 }
33
34 sub on_attack {
35 my ($data) = @_;
36
37 $data->{activator}{neko_attack}++
38 or cf::LOG cf::llevDebug, sprintf "QBERT Neko-san was attacked by %s!", $data->{activator}->name;
39
40 $data->{activator}->message ("Meoow! (You are hurting me)")
41 if !($data->{activator}{neko_attack} & 15);
42
43 if ($data->{activator}{neko_attack} > 256) {
44 $data->{activator}->message ("Neko-san is suddenly gone!");
45 teleport $data->{activator}, "/scorn/misc/scorn_illusions", 15, 7;
46 $data->{activator}->message ("You hear strange noises all around you...");
47 $data->{activator}->message ("You feel dumb.");
48 }
49
50 1
51 }
52
53 sub on_say {
54 my ($data) = @_;
55
56 cf::LOG cf::llevDebug, "QBERT [Neko-fon] $data->{message}";
57
58 0
59 }
60