1 | /* |
1 | /* |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
2 | * This file is part of Deliantra, the Roguelike Realtime MMORPG. |
3 | * |
3 | * |
4 | * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
4 | * Copyright (©) 2005,2006,2007,2008,2009,2010 Marc Alexander Lehmann / Robin Redeker / the Deliantra team |
5 | * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team |
5 | * Copyright (©) 2002 Mark Wedel & Crossfire Development Team |
6 | * Copyright (©) 1992,2007 Frank Tore Johansen |
6 | * Copyright (©) 1992 Frank Tore Johansen |
7 | * |
7 | * |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
8 | * Deliantra is free software: you can redistribute it and/or modify it under |
9 | * the terms of the Affero GNU General Public License as published by the |
9 | * the terms of the Affero GNU General Public License as published by the |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
10 | * Free Software Foundation, either version 3 of the License, or (at your |
11 | * option) any later version. |
11 | * option) any later version. |
… | |
… | |
108 | /* sets up to cast a spell. op is the caster, params is the spell name, |
108 | /* sets up to cast a spell. op is the caster, params is the spell name, |
109 | * and command is the first letter of the spell type (c=cast, i=invoke, |
109 | * and command is the first letter of the spell type (c=cast, i=invoke, |
110 | * p=prepare). Invoke casts a spell immediately, where as cast (and I believe |
110 | * p=prepare). Invoke casts a spell immediately, where as cast (and I believe |
111 | * prepare) just set up the range type. |
111 | * prepare) just set up the range type. |
112 | */ |
112 | */ |
113 | int |
113 | static int |
114 | command_cast_spell (object *op, char *params, char command) |
114 | command_cast_spell (object *op, char *params, char command) |
115 | { |
115 | { |
116 | int castnow = 0; |
116 | int castnow = 0; |
117 | char *cp; |
117 | char *cp; |
118 | object *spob; |
118 | object *spob; |
… | |
… | |
230 | return command_cast_spell (op, params, 'p'); |
230 | return command_cast_spell (op, params, 'p'); |
231 | } |
231 | } |
232 | |
232 | |
233 | /**************************************************************************/ |
233 | /**************************************************************************/ |
234 | |
234 | |
235 | void |
235 | static void |
236 | change_spell (object *op, char k) |
236 | change_spell (object *op, char k) |
237 | { |
237 | { |
238 | if (op->contr->combat_ob == op->current_weapon) |
238 | if (op->contr->combat_ob == op->current_weapon) |
239 | { |
239 | { |
240 | if (op->contr->ranged_ob) |
240 | if (op->contr->ranged_ob) |