1 | #! perl |
1 | #! perl # depends=irc |
2 | |
2 | |
3 | # archetype nekosan |
3 | # archetype nekosan |
4 | |
4 | |
5 | sub teleport { |
5 | sub teleport { |
6 | my ($pl, $map, $x, $y) = @_; |
6 | my ($pl, $map, $x, $y) = @_; |
… | |
… | |
62 | $spell->last_sp (100); # fill sp |
62 | $spell->last_sp (100); # fill sp |
63 | $spell->last_grace (100); # fill gr |
63 | $spell->last_grace (100); # fill gr |
64 | $spell->attacktype (cf::AT_CONFUSION | cf::AT_POISON | cf::AT_BLIND | cf::AT_DISEASE); |
64 | $spell->attacktype (cf::AT_CONFUSION | cf::AT_POISON | cf::AT_BLIND | cf::AT_DISEASE); |
65 | |
65 | |
66 | $pl->message ("(Neko-san makes strange noises)"); |
66 | $pl->message ("(Neko-san makes strange noises)"); |
67 | $pl->cast_spell ($self, $dir, $spell); |
67 | $pl->cast_heal ($self, $spell, 0); |
68 | |
68 | |
69 | $spell->destroy; |
69 | $spell->destroy; |
70 | } |
70 | } |
71 | |
71 | |
72 | } else { |
72 | } else { |
73 | # check for fish in his inv and steal it |
73 | # check for fish in his inv and steal it |
74 | if (my $fish = (grep $_->arch->name eq "fishfood", $pl->inv)[0]) { |
74 | if (my $fish = (grep $_->arch->archname eq "fishfood", $pl->inv)[0]) { |
75 | # add force |
75 | # add force |
76 | my $gave_fish = cf::object::new "force"; |
76 | my $gave_fish = cf::object::new "force"; |
77 | $gave_fish->slaying ("schmorp-neko-gave-fish"); |
77 | $gave_fish->slaying ("schmorp-neko-gave-fish"); |
78 | $gave_fish->speed (0); |
78 | $gave_fish->speed (0); |
79 | $gave_fish->insert_ob_in_ob ($pl); |
79 | $pl->insert ($gave_fish); |
80 | |
80 | |
81 | # remove fish |
81 | # remove fish |
82 | $fish->destroy; |
82 | $fish->destroy; |
83 | |
83 | |
84 | # be nice |
84 | # be nice |
… | |
… | |
111 | $hitter->{neko_attack} = 0; |
111 | $hitter->{neko_attack} = 0; |
112 | } |
112 | } |
113 | |
113 | |
114 | $hitter->{neko_last_attack} = time; |
114 | $hitter->{neko_last_attack} = time; |
115 | $hitter->{neko_attack}++ |
115 | $hitter->{neko_attack}++ |
116 | or ext::schmorp_irc::do_notice "Neko-san was attacked by ". $hitter->name . "!\n"; |
116 | or ext::irc::do_notice "Neko-san was attacked by ". $hitter->name . "!\n"; |
117 | |
117 | |
118 | $hitter->message ("Meoow! (Please do not hurt me)") |
118 | $hitter->message ("Meoow! (Please do not hurt me)") |
119 | if !($hitter->{neko_attack} & 15); |
119 | if !($hitter->{neko_attack} & 15); |
120 | |
120 | |
121 | if ($hitter->{neko_attack} > 512) { |
121 | if ($hitter->{neko_attack} > 512) { |
… | |
… | |
134 | } |
134 | } |
135 | |
135 | |
136 | sub on_say { |
136 | sub on_say { |
137 | my ($self, $pl, $msg) = @_; |
137 | my ($self, $pl, $msg) = @_; |
138 | |
138 | |
139 | ext::schmorp_irc::do_notice (sprintf "[Neko-fon] %s: %s\n", $pl->ob->name, $msg); |
139 | ext::irc::do_notice (sprintf "[Neko-fon] %s: %s\n", $pl->ob->name, $msg); |
140 | } |
140 | } |
141 | |
141 | |
142 | cf::object::attachment "Nekosan", package => __PACKAGE__; |
142 | cf::object::attachment "Nekosan", package => __PACKAGE__; |
143 | |
143 | |