… | |
… | |
159 | cp += 3; |
159 | cp += 3; |
160 | } |
160 | } |
161 | else |
161 | else |
162 | cp = NULL; |
162 | cp = NULL; |
163 | |
163 | |
164 | if (!spob->skill) |
|
|
165 | { |
|
|
166 | new_draw_info_format (NDI_UNIQUE, 0, op, "%s is a weird spell, please report it to the dungeon master!", &spob->name); |
|
|
167 | LOG (llevError, "spell without skill found: %s", spob->debug_desc ()); |
|
|
168 | return 1; |
|
|
169 | } |
|
|
170 | |
|
|
171 | if (castnow) |
164 | if (castnow) |
172 | cast_spell (op, op, op->facing, spob, cp); |
165 | cast_spell (op, op, op->facing, spob, cp); |
173 | else if (op->apply (spob)) |
166 | else if (op->apply (spob)) |
174 | { |
167 | { |
175 | splay (spob); |
168 | splay (spob); |
… | |
… | |
207 | return command_cast_spell (op, params, 'p'); |
200 | return command_cast_spell (op, params, 'p'); |
208 | } |
201 | } |
209 | |
202 | |
210 | /**************************************************************************/ |
203 | /**************************************************************************/ |
211 | |
204 | |
212 | static void |
205 | int |
213 | change_spell (object *op, char k) |
206 | command_rotateshoottype (object *op, char *params) |
214 | { |
207 | { |
215 | if (op->contr->combat_ob && op->contr->ranged_ob) |
208 | if (op->contr->combat_ob && op->contr->ranged_ob) |
216 | op->change_weapon ( |
209 | op->apply ( |
217 | op->current_weapon == op->contr->combat_ob |
210 | op->current_weapon == op->contr->combat_ob |
218 | ? op->contr->ranged_ob |
211 | ? op->contr->ranged_ob |
219 | : op->contr->combat_ob |
212 | : op->contr->combat_ob |
220 | ); |
213 | ); |
221 | |
214 | |
222 | //TODO: maybe switch to golem, if any? |
215 | //TODO: maybe switch to golem, if any? |
223 | } |
|
|
224 | |
|
|
225 | int |
|
|
226 | command_rotateshoottype (object *op, char *params) |
|
|
227 | { |
|
|
228 | if (!params) |
|
|
229 | change_spell (op, '+'); |
|
|
230 | else |
|
|
231 | change_spell (op, params[0]); |
|
|
232 | |
216 | |
233 | return 0; |
217 | return 0; |
234 | } |
218 | } |