… | |
… | |
3 | # wizard commands |
3 | # wizard commands |
4 | |
4 | |
5 | cf::register_command goto => 0, sub { |
5 | cf::register_command goto => 0, sub { |
6 | my ($ob, $arg) = @_; |
6 | my ($ob, $arg) = @_; |
7 | |
7 | |
8 | return unless $ob->flag (cf::FLAG_WIZ) || $cf::CFG{unpriv_goto}; |
8 | return unless $ob->may ("command_goto"); |
9 | |
9 | |
10 | my $portal = cf::object::new "exit"; |
10 | my $portal = cf::object::new "exit"; |
11 | |
11 | |
12 | $portal->slaying ($arg); |
12 | $portal->slaying ($arg); |
13 | $portal->stats->hp (0); |
13 | $portal->stats->hp (0); |
… | |
… | |
19 | }; |
19 | }; |
20 | |
20 | |
21 | cf::register_command wizpass => 0, sub { |
21 | cf::register_command wizpass => 0, sub { |
22 | my ($ob, $arg) = @_; |
22 | my ($ob, $arg) = @_; |
23 | |
23 | |
24 | return unless $ob->flag (cf::FLAG_WIZ) || $cf::CFG{unpriv_wizpass}; |
24 | return unless $ob->may ("command_wizpass"); |
25 | |
25 | |
26 | my $new_val = length $arg ? $arg * 1 : !$ob->flag (cf::FLAG_WIZPASS); |
26 | my $new_val = length $arg ? $arg * 1 : !$ob->flag (cf::FLAG_WIZPASS); |
27 | |
27 | |
28 | $ob->flag (cf::FLAG_WIZPASS, $new_val); |
28 | $ob->flag (cf::FLAG_WIZPASS, $new_val); |
29 | |
29 | |
… | |
… | |
35 | }; |
35 | }; |
36 | |
36 | |
37 | cf::register_command wizcast => 0, sub { |
37 | cf::register_command wizcast => 0, sub { |
38 | my ($ob, $arg) = @_; |
38 | my ($ob, $arg) = @_; |
39 | |
39 | |
40 | return unless $ob->flag (cf::FLAG_WIZ) || $cf::CFG{unpriv_wizcast}; |
40 | return unless $ob->may ("command_wizcast"); |
41 | |
41 | |
42 | my $new_val = length $arg ? $arg * 1 : !$ob->flag (cf::FLAG_WIZCAST); |
42 | my $new_val = length $arg ? $arg * 1 : !$ob->flag (cf::FLAG_WIZCAST); |
43 | |
43 | |
44 | $ob->flag (cf::FLAG_WIZCAST, $new_val); |
44 | $ob->flag (cf::FLAG_WIZCAST, $new_val); |
45 | |
45 | |