73 while (prev != NULL && prev->
next != NULL && prev->
next != pl)
75 if (!prev || prev->
next != pl) {
76 LOG(
llevError,
"Free_player: Can't find previous player.\n");
149 if (info->
spell == spell)
205 snprintf(pl->
title,
sizeof(pl->
title),
"%s hatchling", attack);
207 snprintf(pl->
title,
sizeof(pl->
title),
"%s wyrm", attack);
209 snprintf(pl->
title,
sizeof(pl->
title),
"%s wyvern", attack);
211 snprintf(pl->
title,
sizeof(pl->
title),
"%s dragon", attack);
213 else if (skin_resist > 80)
214 snprintf(pl->
title,
sizeof(pl->
title),
"legendary %s dragon", attack);
215 else if (skin_resist > 50)
216 snprintf(pl->
title,
sizeof(pl->
title),
"ancient %s dragon", attack);
218 snprintf(pl->
title,
sizeof(pl->
title),
"big %s dragon", attack);
235 snprintf(buf, bufsize,
"the %s", pl->
title);
291 if (tmp->type ==
SKILL) {
292 for (skill = 0; skill <
MAX_SKILLS; skill++) {
309 object *force =
add_force(op,
"criminal", 25);
325 snprintf(buf,
sizeof(buf),
"You stop %s.", pl->
repeat_action);
uint8_t delayed_buffers_allocated
Number of items in delayed_buffers_used.
int stack_position
Current stack position, 0 for no item.
struct archetype * arch
Pointer to archetype.
void LOG(LogLevel logLevel, const char *format,...)
Logs a message to stderr, or to file.
void player_set_own_title(struct player *pl, const char *title)
Sets the custom title.
void player_set_dragon_title(player *pl, int level, const char *attack, int skin_resist)
Updates the title of a dragon player to reflect the current level, attack type, and resistances...
void object_set_msg(object *op, const char *msg)
Set the message field of an object.
void object_remove(object *op)
This function removes the object op from the linked list of objects which it is currently tied to...
object * spell
Spell object this structure is about.
player * first_player
First player.
void link_player_skills(object *op)
This function goes through the player inventory and sets up the last_skills[] array in the player obj...
int is_dragon_pl(const object *op)
Checks if player is a dragon.
#define FREE_OBJ_NO_DESTROY_CALLBACK
Do not run the destroy callback.
This stores, for a spell a player knows, the last sp/gr/dam information sent to client.
int player_has_own_title(const struct player *pl)
Returns whether the player has a custom title.
char title[BIG_NAME]
Default title, like fighter, wizard, etc.
Global type definitions and header inclusions.
object * last_exit
Last exit used by player or NULL.
struct player * contr
Pointer to the player which control this object.
client_spell * spell_state
Spell information sent to client.
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 FLAG_REMOVED
Object is not in any map or invenory.
repeat_cb repeat_func
If not NULL, automatically repeat the action repeat_func until interrupted.
void free_string(sstring str)
This will reduce the refcount, and if it has reached 0, str will be freed.
int is_old_wraith_pl(object *op)
Checks if player is a wraith without the 'wraith feed' skill.
void object_free(object *ob, int flags)
Frees everything allocated by an object, removes it from the list of used objects, and puts it on the list of free objects.
player * next
Pointer to next player, NULL if this is last.
#define MSG_TYPE_COMMAND
Responses to commands, eg, who.
tag_t * stack_items
Item stack for patch/dump/...
sstring repeat_action
Shared string with textual description of current repeat action (e.g.
#define QUERY_FLAG(xyz, p)
Information on one title.
void player_get_title(const player *pl, char *buf, size_t bufsize)
Returns the player's title.
void object_free_drop_inventory(object *ob)
Frees everything allocated by an object, removes it from the list of used objects, and puts it on the list of free objects.
#define FOR_INV_FINISH()
Finishes FOR_INV_PREPARE().
client_spell * get_client_spell_state(player *pl, object *spell)
Gets the (client-side) spell state for specified spell.
sstring race
Human, goblin, dragon, etc.
int atnr_is_dragon_enabled(int attacknr)
Determine if the attacktype represented by the specified attack-number is enabled for dragon players...
object * ob
The object representing the player.
const char * player_get_own_title(const struct player *pl)
Returns the player's own title.
object * find_force(object *op, const char *name)
Find a force with the given 'name' in the slaying field.
void free_player(player *pl)
Frees player structure, including pointed object (through object_free_drop_inventory()).
object * add_force(object *op, const char *name, int duration)
Add or return an existing force inside 'op' with the given 'name' and 'duration' in units of 100 tick...
#define FREE_AND_CLEAR_STR(xyz)
Release the shared string, and set it to NULL.
void fatal(enum fatal_error err)
fatal() is meant to be called whenever a fatal signal is intercepted.
#define MAX_BUF
Used for all kinds of things.
void replace_unprintable_chars(char *buf)
Replaces any unprintable character in the given buffer with a space.
int64_t last_skill_exp[MAX_SKILLS]
Last exp sent to client.
size_t strlcpy(char *dst, const char *src, size_t size)
Portable implementation of strlcpy(3).
struct client_spell * next
Next spell information.
bool is_old_wraith
Whether this player is a "old" wraith, initialized at load time and updated when eating.
Also see SKILL_TOOL (74) below.
object * last_skill_ob[MAX_SKILLS]
Exp objects sent to client.
#define MSG_TYPE_COMMAND_INFO
Generic info: resistances, etc.
uint8_t type
PLAYER, BULLET, etc.
uint8_t delayed_buffers_used
Used items in delayed_buffers_used.
SockList ** delayed_buffers
Buffers which will be sent after the player's tick completes.
#define NDI_UNIQUE
Print immediately, don't buffer.
int is_wraith_pl(object *op)
Tests if a player is a wraith.
bool is_criminal(object *op)
void commit_crime(object *op, const char *description)
char own_title[MAX_NAME]
Title the player has chosen for themself.
void clear_player(player *pl)
Clears data in player structure.
const char * unarmed_skill
Prefered skill to use in unarmed combat.
#define MAX_SKILLS
This is the maximum number of skills the game may handle.
void player_cancel_repeat(player *pl)
If the player is repeating an action, cancel it.
#define FREE_AND_CLEAR(xyz)
Free the pointer and then set it to NULL.
bool is_wraith
Whether this player is a wraith or not, initialized at load time.
object clone
An object from which to do object_copy()
#define FOR_INV_PREPARE(op_, it_)
Constructs a loop iterating over the inventory of an object.
void * repeat_func_data
Arguments to pass into repeat_func.