ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/c_range.C
(Generate patch)

Comparing deliantra/server/server/c_range.C (file contents):
Revision 1.28 by root, Sun Jul 1 05:00:19 2007 UTC vs.
Revision 1.34 by root, Tue May 6 16:55:26 2008 UTC

1/* 1/*
2 * This file is part of Crossfire TRT, the Roguelike Realtime MORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007 Marc Alexander Lehmann / Robin Redeker / the Crossfire TRT team 4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2002,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen 6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 * 7 *
8 * Crossfire TRT is free software: you can redistribute it and/or modify 8 * Deliantra is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 3 of the License, or 10 * the Free Software Foundation, either version 3 of the License, or
11 * (at your option) any later version. 11 * (at your option) any later version.
12 * 12 *
13 * This program is distributed in the hope that it will be useful, 13 * This program is distributed in the hope that it will be useful,
16 * GNU General Public License for more details. 16 * GNU General Public License for more details.
17 * 17 *
18 * You should have received a copy of the GNU General Public License 18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>. 19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 * 20 *
21 * The authors can be reached via e-mail to <crossfire@schmorp.de> 21 * The authors can be reached via e-mail to <support@deliantra.net>
22 */ 22 */
23 23
24/* This file deals with range related commands (casting, shooting, 24/* This file deals with range related commands (casting, shooting,
25 * throwing, etc. 25 * throwing, etc.
26 */ 26 */
187 187
188 object *skill = find_skill_by_name (op, spob->skill); 188 object *skill = find_skill_by_name (op, spob->skill);
189 189
190 if (!skill) 190 if (!skill)
191 { 191 {
192 new_draw_info_format (NDI_UNIQUE, 0, op, "You need the skill %s to cast %s!", &spob->skill, &spob->name); 192 op->failmsg (format ("You need the skill %s to cast %s!", &spob->skill, &spob->name));
193 return 1; 193 return 1;
194 } 194 }
195
196 splay (spob);
195 197
196 if (castnow) 198 if (castnow)
197 cast_spell (op, op, op->facing, spob, cp); 199 cast_spell (op, op, op->facing, spob, cp);
198 else 200 else
199 { 201 {
202 if (op->contr->ranged_ob)
203 if (op->contr->ranged_ob->flag [FLAG_APPLIED])
204 apply_special (op, op->contr->ranged_ob, AP_UNAPPLY);
205 else
206 op->contr->ranged_ob = 0;
207
208 if (op->contr->ranged_ob)
209 op->failmsg (format ("You have to unapply the %s first to ready a spell.", &op->contr->ranged_ob->name));
210 else
211 {
200 op->change_weapon (op->contr->ranged_ob = spob); 212 op->change_weapon (op->contr->ranged_ob = spob);
201 213
202 assign (op->contr->spellparam, cp ? cp : ""); 214 assign (op->contr->spellparam, cp ? cp : "");
203 new_draw_info_format (NDI_UNIQUE, 0, op, "You ready the spell %s", &spob->name); 215 op->statusmsg (format ("You ready the spell %s", &spob->name));
216 }
204 } 217 }
205 218
206 return 0; 219 return 0;
207 } /* else fall through to below and print spells */ 220 } /* else fall through to below and print spells */
208 } /* params supplied */ 221 } /* params supplied */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines