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.39 by root, Mon Oct 12 14:00:59 2009 UTC vs.
Revision 1.43 by root, Fri Mar 26 01:04:44 2010 UTC

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.
29#include <global.h> 29#include <global.h>
30#include <sproto.h> 30#include <sproto.h>
31#include <spells.h> 31#include <spells.h>
32#include <skills.h> 32#include <skills.h>
33#include <commands.h> 33#include <commands.h>
34
35int
36command_invoke (object *op, char *params)
37{
38 return command_cast_spell (op, params, 'i');
39}
40
41int
42command_cast (object *op, char *params)
43{
44 return command_cast_spell (op, params, 'c');
45}
46
47int
48command_prepare (object *op, char *params)
49{
50 return command_cast_spell (op, params, 'p');
51}
52 34
53/* Shows all spells that op knows. If params is supplied, the must match 35/* Shows all spells that op knows. If params is supplied, the must match
54 * that. Given there is more than one skill, we can't supply break 36 * that. Given there is more than one skill, we can't supply break
55 * them down to cleric/wizardry. 37 * them down to cleric/wizardry.
56 */ 38 */
126/* 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,
127 * 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,
128 * 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
129 * prepare) just set up the range type. 111 * prepare) just set up the range type.
130 */ 112 */
131int 113static int
132command_cast_spell (object *op, char *params, char command) 114command_cast_spell (object *op, char *params, char command)
133{ 115{
134 int castnow = 0; 116 int castnow = 0;
135 char *cp; 117 char *cp;
136 object *spob; 118 object *spob;
228 show_matching_spells (op, params); 210 show_matching_spells (op, params);
229 211
230 return 1; 212 return 1;
231} 213}
232 214
215int
216command_invoke (object *op, char *params)
217{
218 return command_cast_spell (op, params, 'i');
219}
220
221int
222command_cast (object *op, char *params)
223{
224 return command_cast_spell (op, params, 'c');
225}
226
227int
228command_prepare (object *op, char *params)
229{
230 return command_cast_spell (op, params, 'p');
231}
232
233/**************************************************************************/ 233/**************************************************************************/
234 234
235void 235static void
236change_spell (object *op, char k) 236change_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)

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines