99 int flags,
int pri,
const object *pl, uint8_t type,
100 uint8_t subtype,
const char *message) {
108 draw_ext_info((flags&~NDI_ALL&~NDI_ALL_DMS), pri, tmppl->
ob, type, subtype, message);
164 va_start(ap, format);
167 vsnprintf(buf,
HUGE_BUF, format, ap);
170 va_start(ap, format);
176 else if (*buf ==
'\0')
177 vsnprintf(buf,
HUGE_BUF, format, ap);
180 draw_ext_info(flags|NDI_NO_TRANSLATE, pri, pl, type, subtype, buf);
200 if (pl->
ob != NULL && pl->
ob->
map == map) {
224 if (pl->
ob != NULL && pl->
ob->
map == map && pl->
ob != op) {
250 if (pl->
ob != NULL && pl->
ob->
map == map
251 && pl->
ob != op1 && pl->
ob != op2) {
270 strncpy(obuf,
"Range: nothing", len);
276 for (op = pl->
inv; op; op = op->
below)
283 snprintf(obuf, len,
"Range: %s (%s)", name, op->
race ? op->
race :
"nothing");
290 snprintf(obuf, len,
"Range: Holding spell (%s)", pl->
spell->
name);
292 snprintf(obuf, len,
"Range: Casting spell (%s)", pl->
spell->
name);
302 strncpy(name,
"none",
MAX_BUF);
303 snprintf(obuf, len,
"Range: %s", name);
314 strncpy(obuf,
"Range: nothing", len);
324 snprintf(obuf, len,
"Builder: %s", name);
328 strncpy(obuf,
"Range: illegal", len);
338 snprintf(buf, len,
"Player: %s ", pl->
name);
339 p = strchr(buf,
'\0');
361 int x, y, dx, dy, mflags, l;
367 for (dx = -1; dx <= 1; dx++) {
368 for (dy = -1; dy <= 1; dy++) {
435 for (x = -strength; x < strength; x++) {
436 for (y = -strength; y < strength; y++) {
478 int xmin, xmax, ymin, ymax;
501 if (map_mark[x+MAGIC_MAP_SIZE*y]&~
FACE_FLOOR) {
513 for (y = ymin; y <= ymax; y++) {
514 for (x = xmin; x <= xmax; x++) {
void SockList_AddPrintf(SockList *sl, const char *format,...)
Adds a printf like formatted string.
#define NDI_DELAYED
If set, then message is sent only after the player's tick completes.
object * ranges[range_size]
Object for each range.
Spell-related defines: spellpath, subtypes, ...
void draw_magic_map(object *pl)
Creates and sends magic map to player.
void SockList_Init(SockList *sl)
Initializes the SockList instance.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
#define NDI_ALL
Inform all players of this message.
#define FABS(x)
Decstations have trouble with fabs()...
const char * i18n(const object *who, const char *code)
Translate a message in the appropriate language.
player * first_player
First player.
New face structure - this enforces the notion that data is face by face only - you can not change the...
object * below
Pointer to the object stacked below this one.
#define HUGE_BUF
Used for messages - some can be quite long.
#define FACE_WALL
Or'd into the color value by the server right before sending.
Socket structure, represents a client-server connection.
#define NDI_NO_TRANSLATE
Do not attempt to translate.
int16_t y
Position in the map for this object.
object * chosen_skill
The skill chosen to use.
void rangetostring(const object *pl, char *obuf, size_t len)
Get player's current range attack in obuf.
Global type definitions and header inclusions.
struct player * contr
Pointer to the player which control this object.
void set_title(const object *pl, char *buf, size_t len)
Sets player title.
uint8_t casting_time
It takes awhile to cast a spell.
rangetype shoottype
Which range-attack is being used by player.
const Face * blank_face
Following can just as easily be pointers, but it is easier to keep them like this.
object * spell
Spell that was being cast.
player * next
Pointer to next player, NULL if this is last.
int16_t casting_time
Time left before spell goes off.
#define NDI_ALL_DMS
Inform all logged in DMs.
#define QUERY_FLAG(xyz, p)
void SockList_Term(SockList *sl)
Frees all resources allocated by a SockList instance.
void player_get_title(const player *pl, char *buf, size_t bufsize)
Returns the player's title.
socket_struct * socket
Socket information for this player.
SockList * player_get_delayed_buffer(player *pl)
Get a delayed socket buffer, that will be sent after the player's tick is complete.
#define MAP_LAYERS
This correspondes to the map layers in the map2 protocol.
sstring race
Human, goblin, dragon, etc.
object * ob
The object representing the player.
const Face * face
Face with colors.
#define NDI_COLOR_MASK
Gives lots of room for expansion - we are using an int anyways, so we have the space to still do all ...
#define P_OUT_OF_MAP
This space is outside the map.
struct Settings settings
Global settings.
void draw_ext_info_format(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *format,...)
Sends message to player(s).
#define FLAG_WIZ
Object has special privilegies.
uint8_t listening
Which priority will be used in info_all.
void draw_ext_info(int flags, int pri, const object *pl, uint8_t type, uint8_t subtype, const char *message)
Sends message to player(s).
#define MAX_BUF
Used for all kinds of things.
int16_t invisible
How much longer the object will be invis.
struct mapstruct * map
Pointer to the map in which this object is present.
Skill-related defines, including subtypes.
static const flag_definition flags[]
Flag mapping.
void SockList_AddChar(SockList *sl, unsigned char c)
Adds an 8 bit value.
#define GET_MAP_FACE_OBJ(M, X, Y, L)
Gets the layer face of specified square.
void query_base_name(const object *op, int plural, char *buf, size_t size)
Query a short name for the item.
void magic_mapping_mark(object *pl, char *map_mark, int strength)
Creates magic map for player.
void print_ext_msg(socket_struct *ns, int color, uint8_t type, uint8_t subtype, const char *message)
Draws an extended message on the client.
sstring name
The name of the object, obviously...
static void do_print_ext(SockList *sl, int color, uint8_t type, uint8_t subtype, const char *message)
Fill a socket buffer with an extended message.
int get_map_flags(mapstruct *oldmap, mapstruct **newmap, int16_t x, int16_t y, int16_t *nx, int16_t *ny)
This rolls up wall, blocks_magic, blocks_view, etc, all into one function that just returns a P_...
uint8_t type
PLAYER, BULLET, etc.
#define FLAG_APPLIED
Object is ready for use by living.
object * inv
Pointer to the first object in the inventory.
void ext_info_map_except(int color, const mapstruct *map, const object *op, uint8_t type, uint8_t subtype, const char *str1)
Writes to everyone on the map except *op.
#define P_BLOCKSVIEW
This spot blocks the player's view.
Contains the base information we use to make up a packet we want to send.
void ext_info_map_except2(int color, const mapstruct *map, const object *op1, const object *op2, int type, int subtype, const char *str1)
Writes to everyone on the map except op1 and op2.
uint8_t magicmap
Color to show this in magic map.
static void magic_mapping_mark_recursive(object *pl, char *map_mark, int px, int py)
Helper for magic map creation.
void ext_info_map(int color, const mapstruct *map, uint8_t type, uint8_t subtype, const char *str1)
Writes to everyone on the specified map.
void Send_With_Handling(socket_struct *ns, SockList *sl)
Calls Write_To_Socket to send data to the client.