1 | #! perl |
1 | #! perl |
2 | |
2 | |
3 | # wizard commands |
3 | # wizard commands |
|
|
4 | |
|
|
5 | cf::register_command kick => sub { |
|
|
6 | my ($ob, $arg) = @_; |
|
|
7 | return unless $ob->flag (cf::FLAG_WIZ); |
|
|
8 | |
|
|
9 | my $other = cf::player::find_active $arg |
|
|
10 | or return 0; |
|
|
11 | $other->kick ($ob); |
|
|
12 | $ob->reply (undef, "$arg is kicked out of the game.", cf::NDI_UNIQUE | cf::NDI_ALL | cf::NDI_RED); |
|
|
13 | |
|
|
14 | 1 |
|
|
15 | }; |
4 | |
16 | |
5 | cf::register_command goto => sub { |
17 | cf::register_command goto => sub { |
6 | my ($ob, $arg) = @_; |
18 | my ($ob, $arg) = @_; |
7 | |
19 | |
8 | return unless $ob->may ("command_goto"); |
20 | return unless $ob->may ("command_goto"); |
… | |
… | |
96 | }; |
108 | }; |
97 | |
109 | |
98 | 1 |
110 | 1 |
99 | }; |
111 | }; |
100 | |
112 | |
101 | for my $command (qw(summon arrest kick banish)) { |
113 | for my $command (qw(summon arrest banish)) { |
102 | my $method = "command_$command"; |
114 | my $method = "command_$command"; |
103 | |
115 | |
104 | cf::register_command $command => sub { |
116 | cf::register_command $command => sub { |
105 | my ($ob, $arg) = @_; |
117 | my ($ob, $arg) = @_; |
106 | |
118 | |