![]() |
Crossfire Server, Trunk
1.75.0
|
#include "global.h"
#include <stdlib.h>
#include <string.h>
#include "commands.h"
#include "shared/newclient.h"
#include "skills.h"
#include "spells.h"
#include "sproto.h"
Go to the source code of this file.
Functions | |
void | command_cast (object *op, const char *params) |
'cast' command, prepares a spell for laster casting. More... | |
void | command_cast_spell (object *op, const char *params, int cast_now) |
Sets up to cast a spell. More... | |
void | command_invoke (object *op, const char *params) |
'invoke' command, fires a spell immediately. More... | |
void | command_rotateshoottype (object *op, const char *params) |
'rotateshoottype' command, switch range attack. More... | |
void | command_shoottype (object *op, const char *params) |
'shoottype' command, set range attack. More... | |
int | legal_range (object *op, int r) |
Check for the validity of a player range. More... | |
static void | send_updated_shoottype (object *op) |
Sends the updated range attack to the client. More... | |
static void | show_matching_spells (object *op, const char *params) |
Shows all spells that op knows. More... | |
Range related commands (casting, shooting, throwing, etc.).
Definition in file c_range.cpp.
void command_cast | ( | object * | op, |
const char * | params | ||
) |
'cast' command, prepares a spell for laster casting.
op | player. |
params | spell. |
Definition at line 50 of file c_range.cpp.
References command_cast_spell().
Referenced by commands_init().
void command_cast_spell | ( | object * | op, |
const char * | params, | ||
int | cast_now | ||
) |
Sets up to cast a spell.
Invoke casts a spell immediately, whereas cast just set up the range type.
op | caster. |
params | spell name. |
cast_now | 0 to ready the spell, 1 to cast it immediately |
Definition at line 146 of file c_range.cpp.
References cast_spell(), object::contr, object::count, draw_ext_info_format(), object::facing, find_skill_by_name(), player::golem_count, lookup_spell_by_name(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_SUCCESS, MSG_TYPE_SKILL, MSG_TYPE_SKILL_MISSING, object::name, NDI_UNIQUE, object_find_by_tag(), object_free_drop_inventory(), object_get_value(), object_remove(), range_golem, range_magic, player::ranges, remove_friendly_object(), safe_strncpy, player::shoottype, show_matching_spells(), object::skill, SPELL, object::spell, player::spellparam, sstring, and object::type.
Referenced by command_cast(), and command_invoke().
void command_invoke | ( | object * | op, |
const char * | params | ||
) |
'invoke' command, fires a spell immediately.
op | player. |
params | spell. |
Definition at line 38 of file c_range.cpp.
References command_cast_spell().
Referenced by commands_init().
void command_rotateshoottype | ( | object * | op, |
const char * | params | ||
) |
'rotateshoottype' command, switch range attack.
op | player. |
params | arguments to the command. '+' selects next range, other values previous range. |
Definition at line 343 of file c_range.cpp.
References object::contr, legal_range(), MAX_BUF, name, range_bottom, range_none, range_size, send_updated_shoottype(), and player::shoottype.
Referenced by commands_init().
void command_shoottype | ( | object * | op, |
const char * | params | ||
) |
'shoottype' command, set range attack.
op | player. |
params | arguments to the command. |
Definition at line 370 of file c_range.cpp.
References object::contr, draw_ext_info_format(), legal_range(), MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_CONFIG, NDI_UNIQUE, range_bow, range_builder, range_golem, range_magic, range_misc, range_none, range_size, range_skill, send_updated_shoottype(), and player::shoottype.
Referenced by commands_init().
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.
op | player to check. |
r | range to check. |
1 | range specified is legal - that is, the character has an item that is equipped for that range type. |
0 | no item of that range type that is usable. |
Definition at line 247 of file c_range.cpp.
References object::chosen_skill, object::contr, object::count, player::golem_count, range_bow, range_builder, range_golem, range_magic, range_misc, range_none, range_skill, and player::ranges.
Referenced by check_login(), command_rotateshoottype(), and command_shoottype().
|
static |
Sends the updated range attack to the client.
op | player. |
Definition at line 284 of file c_range.cpp.
References object::chosen_skill, object::contr, draw_ext_info, draw_ext_info_format(), MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, name, object::name, NDI_UNIQUE, query_base_name(), query_name(), object::race, range_bow, range_builder, range_golem, range_magic, range_misc, range_none, range_skill, player::ranges, and player::shoottype.
Referenced by command_rotateshoottype(), and command_shoottype().
|
static |
Shows all spells that op knows.
Given there is more than one skill, we can't supply break them down to cleric/wizardry.
op | player wanting to knows her spells. |
params | if supplied, the spell name must match that. |
Definition at line 65 of file c_range.cpp.
References draw_ext_info, draw_ext_info_format(), FOR_INV_FINISH, FOR_INV_PREPARE, MAX_BUF, MSG_TYPE_COMMAND, MSG_TYPE_COMMAND_ERROR, MSG_TYPE_COMMAND_SUCCESS, NDI_UNIQUE, NROFREALSPELLS, object::path_denied, SP_level_spellpoint_cost(), spell, SPELL, and SPELL_HIGHEST.
Referenced by command_cast_spell().