… | |
… | |
87 | $ob->reply (undef, (join "\n", who_listing $ob->may ("extended_who")), cf::NDI_UNIQUE | cf::NDI_DK_ORANGE); |
87 | $ob->reply (undef, (join "\n", who_listing $ob->may ("extended_who")), cf::NDI_UNIQUE | cf::NDI_DK_ORANGE); |
88 | |
88 | |
89 | 1 |
89 | 1 |
90 | }; |
90 | }; |
91 | |
91 | |
|
|
92 | cf::register_command mapinfo => sub { |
|
|
93 | my ($ob) = @_; |
|
|
94 | |
|
|
95 | my $map = $ob->map |
|
|
96 | or return; |
|
|
97 | $ob->reply (undef, (sprintf "%s (%s) %s", $map->name, $map->path, $ob->region->longname)); |
|
|
98 | $ob->reply (undef, (sprintf "players: %d difficulty: %d size: %d start: %dx%d timeout: %d", |
|
|
99 | $map->players, $map->difficulty, $map->width, $map->height, $map->enter_x, $map->enter_y, $map->timeout)) |
|
|
100 | if $ob->flag (cf::FLAG_WIZ); |
|
|
101 | $ob->reply (undef, $map->msg); |
|
|
102 | |
|
|
103 | 1 |
|
|
104 | }; |
|
|
105 | |
|
|
106 | cf::register_command whereami => sub { |
|
|
107 | my ($ob) = @_; |
|
|
108 | |
|
|
109 | my $reg = $ob->region; |
|
|
110 | $ob->reply (undef, (sprintf "You are %s.\n%s", $reg->longname, $reg->msg)); |
|
|
111 | |
|
|
112 | 1 |
|
|
113 | }; |
|
|
114 | |
92 | cf::register_command applymode => sub { |
115 | cf::register_command applymode => sub { |
93 | my ($ob, $arg) = @_; |
116 | my ($ob, $arg) = @_; |
94 | my @types = ("nochoice", "never", "always"); |
117 | my @types = ("nochoice", "never", "always"); |
95 | my $mapping = { |
118 | my $mapping = { |
96 | nochoice => 1, |
119 | nochoice => 1, |
… | |
… | |
190 | $ob->reply (undef, $ob->contr->braced ? "You are braced." : "Not braced."); |
213 | $ob->reply (undef, $ob->contr->braced ? "You are braced." : "Not braced."); |
191 | |
214 | |
192 | 1 |
215 | 1 |
193 | }; |
216 | }; |
194 | |
217 | |
|
|
218 | cf::register_command 'output-count' => sub { |
|
|
219 | my ($ob, $arg) = @_; |
|
|
220 | |
|
|
221 | return $ob->reply (undef, "Output count is presently " . $ob->contr->outputs_count) |
|
|
222 | unless $arg > 0; |
|
|
223 | |
|
|
224 | $ob->contr->outputs_count ($arg); |
|
|
225 | $ob->reply (undef, "Output count now set to " . $ob->contr->outputs_count); |
|
|
226 | |
|
|
227 | 1 |
|
|
228 | }; |
|
|
229 | |
|
|
230 | cf::register_command 'output-sync' => sub { |
|
|
231 | my ($ob, $arg) = @_; |
|
|
232 | |
|
|
233 | return $ob->reply (undef, "Output sync time is presently " . $ob->contr->outputs_sync) |
|
|
234 | unless $arg > 0; |
|
|
235 | |
|
|
236 | $ob->contr->outputs_sync ($arg); |
|
|
237 | $ob->reply (undef, "Output sync time now set to " . $ob->contr->outputs_sync); |
|
|
238 | |
|
|
239 | 1 |
|
|
240 | }; |
|
|
241 | |
195 | # XXX: This has a bug. After one sets his wimpy level to 0 and resets it to |
242 | # XXX: This has a bug. After one sets his wimpy level to 0 and resets it to |
196 | # some other level (which may also be 0), this does not get echoed, |
243 | # some other level (which may also be 0), this does not get echoed, |
197 | # but it does get set. |
244 | # but it does get set. |
198 | cf::register_command wimpy => sub { |
245 | cf::register_command wimpy => sub { |
199 | my ($ob, $arg) = @_; |
246 | my ($ob, $arg) = @_; |
… | |
… | |
221 | #$ob->contr->peaceful ($ob->contr->peaceful ? 0 : 1); |
268 | #$ob->contr->peaceful ($ob->contr->peaceful ? 0 : 1); |
222 | #$ob->reply (undef, $ob->contr->peaceful ? "You will attack other players." : "You will not attack other players."); |
269 | #$ob->reply (undef, $ob->contr->peaceful ? "You will attack other players." : "You will not attack other players."); |
223 | |
270 | |
224 | 1 |
271 | 1 |
225 | }; |
272 | }; |
226 | |
|
|
227 | |
273 | |
228 | cf::register_command rename => sub { |
274 | cf::register_command rename => sub { |
229 | my ($ob, $arg) = @_; |
275 | my ($ob, $arg) = @_; |
230 | |
276 | |
231 | $ob->speed_left ($ob->speed_left - 0.25); |
277 | $ob->speed_left ($ob->speed_left - 0.25); |