… | |
… | |
107 | } |
107 | } |
108 | |
108 | |
109 | sub on_attack { |
109 | sub on_attack { |
110 | my ($event, $ob, $who) = @_; |
110 | my ($event, $ob, $who) = @_; |
111 | |
111 | |
|
|
112 | if ($who->{neko_last_attack} < time - 300) { |
|
|
113 | $who->{neko_attack} = 0; |
|
|
114 | } |
|
|
115 | |
|
|
116 | $who->{neko_last_attack} = time; |
112 | $who->{neko_attack}++ |
117 | $who->{neko_attack}++ |
|
|
118 | or do { |
113 | or cf::LOG cf::llevDebug, sprintf "QBERT Neko-san was attacked by %s!\n", $who->name; |
119 | cf::LOG cf::llevDebug, my $n = sprintf "QBERT Neko-san was attacked by %s!\n", $who->name; |
|
|
120 | cf::ext::schmorp_irc::do_notice ($n); |
|
|
121 | }; |
114 | |
122 | |
115 | $who->message ("Meoow! (Please do not hurt me)") |
123 | $who->message ("Meoow! (Please do not hurt me)") |
116 | if !($who->{neko_attack} & 15); |
124 | if !($who->{neko_attack} & 15); |
117 | |
125 | |
118 | if ($who->{neko_attack} > 512) { |
126 | if ($who->{neko_attack} > 512) { |
… | |
… | |
128 | |
136 | |
129 | sub on_say { |
137 | sub on_say { |
130 | my ($event, $ob, $who, $msg) = @_; |
138 | my ($event, $ob, $who, $msg) = @_; |
131 | |
139 | |
132 | cf::LOG cf::llevDebug, sprintf "QBERT [Neko-fon] %s: %s\n", $who->name, $msg; |
140 | cf::LOG cf::llevDebug, sprintf "QBERT [Neko-fon] %s: %s\n", $who->name, $msg; |
|
|
141 | cf::ext::schmorp_irc::do_notice (sprintf "[Neko-fon] %s: %s\n", $who->name, $msg); |
133 | } |
142 | } |
134 | |
143 | |