… | |
… | |
108 | unless $mapping->{$arg}; |
108 | unless $mapping->{$arg}; |
109 | |
109 | |
110 | $ob->contr->usekeys ($mapping->{$arg} - 1); # HACK: because of the $mapping->{$arg} check before, where $arg should not be 0 |
110 | $ob->contr->usekeys ($mapping->{$arg} - 1); # HACK: because of the $mapping->{$arg} check before, where $arg should not be 0 |
111 | # but $arg would be 0 if a user enters an incorrect value |
111 | # but $arg would be 0 if a user enters an incorrect value |
112 | $ob->reply (undef, "usekeys" . ($oldtype == $ob->contr->usekeys ? "" : " now") . " set to " . $types[$ob->contr->usekeys]); |
112 | $ob->reply (undef, "usekeys" . ($oldtype == $ob->contr->usekeys ? "" : " now") . " set to " . $types[$ob->contr->usekeys]); |
|
|
113 | |
|
|
114 | 1 |
113 | }; |
115 | }; |
114 | |
116 | |
115 | cf::register_command afk => sub { |
117 | cf::register_command afk => sub { |
116 | my ($ob, $arg) = @_; |
118 | my ($ob, $arg) = @_; |
117 | |
119 | |
118 | $ob->contr->ns->afk ($ob->contr->ns->afk ? 0 : 1); |
120 | $ob->contr->ns->afk ($ob->contr->ns->afk ? 0 : 1); |
119 | $ob->reply (undef, $ob->contr->ns->afk ? "You are now AFK" : "You are no longer AFK"); |
121 | $ob->reply (undef, $ob->contr->ns->afk ? "You are now AFK" : "You are no longer AFK"); |
|
|
122 | |
|
|
123 | 1 |
120 | }; |
124 | }; |
121 | |
125 | |
122 | cf::register_command sound => sub { |
126 | cf::register_command sound => sub { |
123 | my ($ob, $arg) = @_; |
127 | my ($ob, $arg) = @_; |
124 | |
128 | |
125 | $ob->contr->ns->sound ($ob->contr->ns->sound ? 0 : 1); |
129 | $ob->contr->ns->sound ($ob->contr->ns->sound ? 0 : 1); |
126 | $ob->reply (undef, $ob->contr->ns->sound ? "The sounds are enabled." : "Silence is golden..."); |
130 | $ob->reply (undef, $ob->contr->ns->sound ? "The sounds are enabled." : "Silence is golden..."); |
|
|
131 | |
|
|
132 | 1 |
127 | }; |
133 | }; |
128 | |
134 | |
129 | cf::register_command brace => sub { |
135 | cf::register_command brace => sub { |
130 | my ($ob, $arg) = @_; |
136 | my ($ob, $arg) = @_; |
131 | |
137 | |
132 | $ob->contr->braced ($ob->contr->braced ? 0 : 1); |
138 | $ob->contr->braced ($ob->contr->braced ? 0 : 1); |
133 | $ob->reply (undef, $ob->contr->braced ? "You are braced." : "Not braced."); |
139 | $ob->reply (undef, $ob->contr->braced ? "You are braced." : "Not braced."); |
|
|
140 | |
|
|
141 | 1 |
134 | }; |
142 | }; |
135 | |
143 | |
136 | # XXX: This has a bug. After one sets his wimpy level to 0 and resets it to |
144 | # XXX: This has a bug. After one sets his wimpy level to 0 and resets it to |
137 | # some other level (which may also be 0), this does not get echoed, |
145 | # some other level (which may also be 0), this does not get echoed, |
138 | # but it does get set. |
146 | # but it does get set. |
… | |
… | |
145 | |
153 | |
146 | return $ob->run_away ($arg) && $ob->reply (undef, "Your new wimpy level is $arg.") |
154 | return $ob->run_away ($arg) && $ob->reply (undef, "Your new wimpy level is $arg.") |
147 | if $arg =~ /^\d+$/ and $arg <= 100; |
155 | if $arg =~ /^\d+$/ and $arg <= 100; |
148 | |
156 | |
149 | $ob->reply (undef, "Incorrect parameters for wimpy: $arg"); |
157 | $ob->reply (undef, "Incorrect parameters for wimpy: $arg"); |
|
|
158 | |
|
|
159 | 1 |
150 | }; |
160 | }; |
151 | |
161 | |
152 | cf::register_command peaceful => sub { |
162 | cf::register_command peaceful => sub { |
153 | my ($ob, $arg) = @_; |
163 | my ($ob, $arg) = @_; |
154 | |
164 | |
… | |
… | |
157 | ." if you want to become hostile or in temple of Valriel" |
167 | ." if you want to become hostile or in temple of Valriel" |
158 | ." if you want to become peaceful again."); |
168 | ." if you want to become peaceful again."); |
159 | |
169 | |
160 | #$ob->contr->peaceful ($ob->contr->peaceful ? 0 : 1); |
170 | #$ob->contr->peaceful ($ob->contr->peaceful ? 0 : 1); |
161 | #$ob->reply (undef, $ob->contr->peaceful ? "You will attack other players." : "You will not attack other players."); |
171 | #$ob->reply (undef, $ob->contr->peaceful ? "You will attack other players." : "You will not attack other players."); |
|
|
172 | |
|
|
173 | 1 |
162 | }; |
174 | }; |
163 | |
175 | |
164 | |
176 | |
165 | cf::register_command rename => sub { |
177 | cf::register_command rename => sub { |
166 | my ($ob, $arg) = @_; |
178 | my ($ob, $arg) = @_; |