Crossfire Server, Branch 1.12  R12190
Functions
c_range.c File Reference

Range related commands (casting, shooting, throwing, etc.). More...

#include <global.h>
#include <sproto.h>
#include <spells.h>
#include <skills.h>
#include <newclient.h>
#include <commands.h>
Include dependency graph for c_range.c:

Go to the source code of this file.

Functions

void change_spell (object *op, char k)
 Rotate the selected range attack.
int command_cast (object *op, char *params)
 'cast' command, prepares a spell for laster casting.
int command_cast_spell (object *op, char *params, char command)
 Sets up to cast a spell.
int command_invoke (object *op, char *params)
 'invoke' command, fires a spell immediately.
int command_prepare (object *op, char *params)
 Equivalent to command_cast().
int command_rotateshoottype (object *op, char *params)
 'rotateshoottype' command, switch range attack.
int legal_range (object *op, int r)
 Check for the validity of a player range.
static void show_matching_spells (object *op, char *params)
 Shows all spells that op knows.

Detailed Description

Range related commands (casting, shooting, throwing, etc.).

Definition in file c_range.c.


Function Documentation

void change_spell ( object *  op,
char  k 
)

Rotate the selected range attack.

Parameters:
opplayer.
k'+' selects next range, other values previous range.

Definition at line 321 of file c_range.c.

References draw_ext_info(), draw_ext_info_format(), legal_range(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, query_base_name(), query_name(), range_bottom, range_bow, range_golem, range_magic, range_misc, range_none, range_size, and range_skill.

Referenced by command_rotateshoottype().

Here is the call graph for this function:

Here is the caller graph for this function:

int command_cast ( object *  op,
char *  params 
)

'cast' command, prepares a spell for laster casting.

Parameters:
opplayer.
paramsspell.
Returns:
1 for success, 0 for failure.

Definition at line 67 of file c_range.c.

References command_cast_spell().

Here is the call graph for this function:

int command_cast_spell ( object *  op,
char *  params,
char  command 
)

Sets up to cast a spell.

Invoke casts a spell immediately, whereas cast just set up the range type.

Parameters:
opcaster.
paramsspell name.
commandfirst letter of the spell type (c=cast, i=invoke, p=prepare).
Returns:
0 if success, 1 for failure.

Definition at line 178 of file c_range.c.

References cast_spell(), draw_ext_info(), draw_ext_info_format(), find_skill_by_name(), free_object(), lookup_spell_by_name(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, NDI_UNIQUE, range_golem, range_magic, remove_friendly_object(), remove_ob(), show_matching_spells(), and SPELL.

Referenced by command_cast(), command_invoke(), and command_prepare().

Here is the call graph for this function:

Here is the caller graph for this function:

int command_invoke ( object *  op,
char *  params 
)

'invoke' command, fires a spell immediately.

Parameters:
opplayer.
paramsspell.
Returns:
1 for success, 0 for failure.

Definition at line 53 of file c_range.c.

References command_cast_spell().

Here is the call graph for this function:

int command_prepare ( object *  op,
char *  params 
)

Equivalent to command_cast().

Parameters:
opplayer.
paramsspell.
Returns:
1 for success, 0 for failure.
Todo:
remove.

Definition at line 82 of file c_range.c.

References command_cast_spell().

Here is the call graph for this function:

int command_rotateshoottype ( object *  op,
char *  params 
)

'rotateshoottype' command, switch range attack.

Parameters:
opplayer.
paramsarguments to the command.
Returns:
0.

Definition at line 394 of file c_range.c.

References change_spell().

Here is the call graph for this function:

int legal_range ( object *  op,
int  r 
)

Check for the validity of a player range.

This function could probably be simplified, eg, everything should index into the ranges[] array.

Parameters:
opplayer to check.
rrange to check.
Return values:
1range specified is legal - that is, the character has an item that is equipped for that range type.
0no item of that range type that is usable.

Definition at line 282 of file c_range.c.

References range_bow, range_golem, range_magic, range_misc, range_none, and range_skill.

Referenced by change_spell(), and check_login().

Here is the caller graph for this function:

static void show_matching_spells ( object *  op,
char *  params 
) [static]

Shows all spells that op knows.

Given there is more than one skill, we can't supply break them down to cleric/wizardry.

Parameters:
opplayer wanting to knows her spells.
paramsif supplied, the spell name must match that.

Definition at line 97 of file c_range.c.

References draw_ext_info(), draw_ext_info_format(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, NROFREALSPELLS, snprintf(), SP_level_spellpoint_cost(), SPELL, and SPELL_HIGHEST.

Referenced by command_cast_spell().

Here is the call graph for this function:

Here is the caller graph for this function: